summaryrefslogtreecommitdiffstats
path: root/kexi/plugins/forms
diff options
context:
space:
mode:
authortpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2011-06-25 05:28:35 +0000
committertpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2011-06-25 05:28:35 +0000
commitf008adb5a77e094eaf6abf3fc0f36958e66896a5 (patch)
tree8e9244c4d4957c36be81e15b566b4aa5ea26c982 /kexi/plugins/forms
parent1210f27b660efb7b37ff43ec68763e85a403471f (diff)
downloadkoffice-f008adb5a77e094eaf6abf3fc0f36958e66896a5.tar.gz
koffice-f008adb5a77e094eaf6abf3fc0f36958e66896a5.zip
TQt4 port koffice
This should enable compilation under both Qt3 and Qt4; fixes for any missed components will be forthcoming git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/applications/koffice@1238284 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'kexi/plugins/forms')
-rw-r--r--kexi/plugins/forms/kexiactionselectiondialog.cpp288
-rw-r--r--kexi/plugins/forms/kexiactionselectiondialog.h23
-rw-r--r--kexi/plugins/forms/kexiactionselectiondialog_p.h9
-rw-r--r--kexi/plugins/forms/kexidataawarewidgetinfo.cpp4
-rw-r--r--kexi/plugins/forms/kexidataawarewidgetinfo.h2
-rw-r--r--kexi/plugins/forms/kexidataprovider.cpp96
-rw-r--r--kexi/plugins/forms/kexidataprovider.h24
-rw-r--r--kexi/plugins/forms/kexidatasourcepage.cpp160
-rw-r--r--kexi/plugins/forms/kexidatasourcepage.h43
-rw-r--r--kexi/plugins/forms/kexidbfactory.cpp132
-rw-r--r--kexi/plugins/forms/kexidbfactory.h33
-rw-r--r--kexi/plugins/forms/kexidbtextwidgetinterface.cpp18
-rw-r--r--kexi/plugins/forms/kexidbtextwidgetinterface.h12
-rw-r--r--kexi/plugins/forms/kexiformdataiteminterface.cpp8
-rw-r--r--kexi/plugins/forms/kexiformdataiteminterface.h28
-rw-r--r--kexi/plugins/forms/kexiformeventhandler.cpp44
-rw-r--r--kexi/plugins/forms/kexiformeventhandler.h18
-rw-r--r--kexi/plugins/forms/kexiformmanager.cpp70
-rw-r--r--kexi/plugins/forms/kexiformmanager.h23
-rw-r--r--kexi/plugins/forms/kexiformpart.cpp222
-rw-r--r--kexi/plugins/forms/kexiformpart.h33
-rw-r--r--kexi/plugins/forms/kexiformscrollview.cpp74
-rw-r--r--kexi/plugins/forms/kexiformscrollview.h37
-rw-r--r--kexi/plugins/forms/kexiformview.cpp360
-rw-r--r--kexi/plugins/forms/kexiformview.h41
-rw-r--r--kexi/plugins/forms/widgets/kexidbautofield.cpp298
-rw-r--r--kexi/plugins/forms/widgets/kexidbautofield.h107
-rw-r--r--kexi/plugins/forms/widgets/kexidbcheckbox.cpp40
-rw-r--r--kexi/plugins/forms/widgets/kexidbcheckbox.h33
-rw-r--r--kexi/plugins/forms/widgets/kexidbcombobox.cpp248
-rw-r--r--kexi/plugins/forms/widgets/kexidbcombobox.h67
-rw-r--r--kexi/plugins/forms/widgets/kexidbdateedit.cpp80
-rw-r--r--kexi/plugins/forms/widgets/kexidbdateedit.h69
-rw-r--r--kexi/plugins/forms/widgets/kexidbdatetimeedit.cpp96
-rw-r--r--kexi/plugins/forms/widgets/kexidbdatetimeedit.h47
-rw-r--r--kexi/plugins/forms/widgets/kexidbdoublespinbox.cpp18
-rw-r--r--kexi/plugins/forms/widgets/kexidbdoublespinbox.h27
-rw-r--r--kexi/plugins/forms/widgets/kexidbform.cpp280
-rw-r--r--kexi/plugins/forms/widgets/kexidbform.h61
-rw-r--r--kexi/plugins/forms/widgets/kexidbimagebox.cpp316
-rw-r--r--kexi/plugins/forms/widgets/kexidbimagebox.h123
-rw-r--r--kexi/plugins/forms/widgets/kexidbintspinbox.cpp18
-rw-r--r--kexi/plugins/forms/widgets/kexidbintspinbox.h27
-rw-r--r--kexi/plugins/forms/widgets/kexidblabel.cpp220
-rw-r--r--kexi/plugins/forms/widgets/kexidblabel.h75
-rw-r--r--kexi/plugins/forms/widgets/kexidblineedit.cpp94
-rw-r--r--kexi/plugins/forms/widgets/kexidblineedit.h49
-rw-r--r--kexi/plugins/forms/widgets/kexidbsubform.cpp50
-rw-r--r--kexi/plugins/forms/widgets/kexidbsubform.h19
-rw-r--r--kexi/plugins/forms/widgets/kexidbtextedit.cpp56
-rw-r--r--kexi/plugins/forms/widgets/kexidbtextedit.h33
-rw-r--r--kexi/plugins/forms/widgets/kexidbtimeedit.cpp46
-rw-r--r--kexi/plugins/forms/widgets/kexidbtimeedit.h35
-rw-r--r--kexi/plugins/forms/widgets/kexidbutils.cpp14
-rw-r--r--kexi/plugins/forms/widgets/kexidbutils.h18
-rw-r--r--kexi/plugins/forms/widgets/kexiframe.cpp24
-rw-r--r--kexi/plugins/forms/widgets/kexiframe.h47
-rw-r--r--kexi/plugins/forms/widgets/kexiframeutils_p.cpp128
-rw-r--r--kexi/plugins/forms/widgets/kexipushbutton.cpp4
-rw-r--r--kexi/plugins/forms/widgets/kexipushbutton.h15
60 files changed, 2354 insertions, 2330 deletions
diff --git a/kexi/plugins/forms/kexiactionselectiondialog.cpp b/kexi/plugins/forms/kexiactionselectiondialog.cpp
index 26b4a9a6..31ab61d0 100644
--- a/kexi/plugins/forms/kexiactionselectiondialog.cpp
+++ b/kexi/plugins/forms/kexiactionselectiondialog.cpp
@@ -34,38 +34,38 @@
#include <kstdguiitem.h>
#include <kpushbutton.h>
-#include <qbitmap.h>
-#include <qlabel.h>
-#include <qheader.h>
-#include <qvbox.h>
-#include <qtooltip.h>
-#include <qwidgetstack.h>
+#include <tqbitmap.h>
+#include <tqlabel.h>
+#include <tqheader.h>
+#include <tqvbox.h>
+#include <tqtooltip.h>
+#include <tqwidgetstack.h>
#include <widget/utils/klistviewitemtemplate.h>
#include <widget/kexibrowser.h>
#include <widget/kexibrowseritem.h>
#include <kexiutils/utils.h>
-typedef KListViewItemTemplate<QString> ActionSelectorDialogListItemBase;
+typedef KListViewItemTemplate<TQString> ActionSelectorDialogListItemBase;
class ActionSelectorDialogListItem : public ActionSelectorDialogListItemBase
{
public:
- ActionSelectorDialogListItem(const QString& data, QListView *parent, QString label1)
- : ActionSelectorDialogListItemBase(data, parent, label1)
+ ActionSelectorDialogListItem(const TQString& data, TQListView *tqparent, TQString label1)
+ : ActionSelectorDialogListItemBase(data, tqparent, label1)
, fifoSorting(true)
{
- m_sortKey.sprintf("%2.2d", parent->childCount());
+ m_sortKey.sprintf("%2.2d", tqparent->childCount());
}
- ActionSelectorDialogListItem(const QString& data, QListViewItem *parent, QString label1)
- : ActionSelectorDialogListItemBase(data, parent, label1)
+ ActionSelectorDialogListItem(const TQString& data, TQListViewItem *tqparent, TQString label1)
+ : ActionSelectorDialogListItemBase(data, tqparent, label1)
, fifoSorting(true)
{
- m_sortKey.sprintf("%2.2d", parent->childCount());
+ m_sortKey.sprintf("%2.2d", tqparent->childCount());
}
- virtual QString key( int column, bool ascending ) const
+ virtual TQString key( int column, bool ascending ) const
{
return fifoSorting ? m_sortKey : ActionSelectorDialogListItemBase::key(column, ascending);
}
@@ -73,18 +73,18 @@ public:
bool fifoSorting : 1;
protected:
- QString m_sortKey;
+ TQString m_sortKey;
};
//---------------------------------------
-ActionsListViewBase::ActionsListViewBase(QWidget* parent)
- : KListView(parent)
+ActionsListViewBase::ActionsListViewBase(TQWidget* tqparent)
+ : KListView(tqparent)
{
- setResizeMode(QListView::AllColumns);
+ setResizeMode(TQListView::AllColumns);
addColumn("");
header()->hide();
- setColumnWidthMode(0, QListView::Maximum);
+ setColumnWidthMode(0, TQListView::Maximum);
setAllColumnsShowFocus(true);
setTooltipColumn(0);
}
@@ -93,9 +93,9 @@ ActionsListViewBase::~ActionsListViewBase()
{
}
-QListViewItem *ActionsListViewBase::itemForAction(const QString& actionName)
+TQListViewItem *ActionsListViewBase::itemForAction(const TQString& actionName)
{
- for (QListViewItemIterator it(this); it.current(); ++it) {
+ for (TQListViewItemIterator it(this); it.current(); ++it) {
ActionSelectorDialogListItem* item = dynamic_cast<ActionSelectorDialogListItem*>(it.current());
if (item && item->data == actionName)
return item;
@@ -103,9 +103,9 @@ QListViewItem *ActionsListViewBase::itemForAction(const QString& actionName)
return 0;
}
-void ActionsListViewBase::selectAction(const QString& actionName)
+void ActionsListViewBase::selectAction(const TQString& actionName)
{
- QListViewItem *item = itemForAction(actionName);
+ TQListViewItem *item = itemForAction(actionName);
if (item) {
setSelected(item, true);
ensureItemVisible(firstChild());
@@ -115,8 +115,8 @@ void ActionsListViewBase::selectAction(const QString& actionName)
//---------------------------------------
-KActionsListViewBase::KActionsListViewBase(QWidget* parent, KexiMainWindow* mainWin)
- : ActionsListViewBase(parent)
+KActionsListViewBase::KActionsListViewBase(TQWidget* tqparent, KexiMainWindow* mainWin)
+ : ActionsListViewBase(tqparent)
, m_mainWin(mainWin)
{
}
@@ -126,7 +126,7 @@ KActionsListViewBase::~KActionsListViewBase() {}
void KActionsListViewBase::init()
{
setSorting(0);
- const QPixmap noIcon( KexiUtils::emptyIcon(KIcon::Small) );
+ const TQPixmap noIcon( KexiUtils::emptyIcon(KIcon::Small) );
KActionPtrList sharedActions( m_mainWin->allActions() );
const Kexi::ActionCategories *acat = Kexi::actionCategories();
foreach (KActionPtrList::ConstIterator, it, sharedActions) {
@@ -142,9 +142,9 @@ void KActionsListViewBase::init()
if (!isActionVisible((*it)->name(), actionCategories))
continue;
ActionSelectorDialogListItem *pitem = new ActionSelectorDialogListItem((*it)->name(),
- this, (*it)->toolTip().isEmpty() ? (*it)->text().replace("&", "") : (*it)->toolTip() );
+ this, (*it)->toolTip().isEmpty() ? (*it)->text().tqreplace("&", "") : (*it)->toolTip() );
pitem->fifoSorting = false; //alpha sort
- pitem->setPixmap( 0, (*it)->iconSet( KIcon::Small, 16 ).pixmap( QIconSet::Small, QIconSet::Active ) );
+ pitem->setPixmap( 0, (*it)->iconSet( KIcon::Small, 16 ).pixmap( TQIconSet::Small, TQIconSet::Active ) );
if (!pitem->pixmap(0) || pitem->pixmap(0)->isNull())
pitem->setPixmap( 0, noIcon );
}
@@ -156,8 +156,8 @@ void KActionsListViewBase::init()
class KActionsListView : public KActionsListViewBase
{
public:
- KActionsListView(QWidget* parent, KexiMainWindow* mainWin)
- : KActionsListViewBase(parent, mainWin)
+ KActionsListView(TQWidget* tqparent, KexiMainWindow* mainWin)
+ : KActionsListViewBase(tqparent, mainWin)
{
}
virtual ~KActionsListView() {}
@@ -172,8 +172,8 @@ public:
class CurrentFormActionsListView : public KActionsListViewBase
{
public:
- CurrentFormActionsListView(QWidget* parent, KexiMainWindow* mainWin)
- : KActionsListViewBase(parent, mainWin)
+ CurrentFormActionsListView(TQWidget* tqparent, KexiMainWindow* mainWin)
+ : KActionsListViewBase(tqparent, mainWin)
{
}
virtual ~CurrentFormActionsListView() {}
@@ -188,11 +188,11 @@ public:
class ActionCategoriesListView : public ActionsListViewBase
{
public:
- ActionCategoriesListView(QWidget* parent) //, KexiProject& project)
- : ActionsListViewBase(parent)
+ ActionCategoriesListView(TQWidget* tqparent) //, KexiProject& project)
+ : ActionsListViewBase(tqparent)
{
- QListViewItem *item = new ActionSelectorDialogListItem("noaction", this, i18n("No action") );
- const QPixmap noIcon( KexiUtils::emptyIcon(KIcon::Small) );
+ TQListViewItem *item = new ActionSelectorDialogListItem("noaction", this, i18n("No action") );
+ const TQPixmap noIcon( KexiUtils::emptyIcon(KIcon::Small) );
item->setPixmap(0, noIcon);
item = new ActionSelectorDialogListItem("kaction", this, i18n("Application actions") );
item->setPixmap(0, SmallIcon("form_action"));
@@ -205,7 +205,7 @@ public:
item = new KexiBrowserItem(this, info);
item->setText(0, part->instanceCaption());
}
- QListViewItem *formItem = itemForAction("form");
+ TQListViewItem *formItem = itemForAction("form");
if (formItem) {
item = new ActionSelectorDialogListItem("currentForm", formItem,
i18n("Current form's actions", "Current"));
@@ -219,9 +219,9 @@ public:
}
//! \return item for action \a actionName, reimplemented to support KexiBrowserItem items
- virtual QListViewItem *itemForAction(const QString& actionName)
+ virtual TQListViewItem *itemForAction(const TQString& actionName)
{
- for (QListViewItemIterator it(this); it.current(); ++it) {
+ for (TQListViewItemIterator it(this); it.current(); ++it) {
//simple case
ActionSelectorDialogListItem* item = dynamic_cast<ActionSelectorDialogListItem*>(it.current());
if (item) {
@@ -243,8 +243,8 @@ public:
class ActionToExecuteListView : public ActionsListViewBase
{
public:
- ActionToExecuteListView(QWidget* parent)
- : ActionsListViewBase(parent)
+ ActionToExecuteListView(TQWidget* tqparent)
+ : ActionsListViewBase(tqparent)
{
}
@@ -253,7 +253,7 @@ class ActionToExecuteListView : public ActionsListViewBase
}
//! Updates actions
- void showActionsForMimeType(const QString& mimeType) {
+ void showActionsForMimeType(const TQString& mimeType) {
if (m_currentMimeType == mimeType)
return;
m_currentMimeType = mimeType;
@@ -263,7 +263,7 @@ class ActionToExecuteListView : public ActionsListViewBase
return;
int supportedViewModes = part->supportedViewModes();
ActionSelectorDialogListItem *item;
- const QPixmap noIcon( KexiUtils::emptyIcon(KIcon::Small) );
+ const TQPixmap noIcon( KexiUtils::emptyIcon(KIcon::Small) );
if (supportedViewModes & Kexi::DataViewMode) {
item = new ActionSelectorDialogListItem("open", this, i18n("Open in Data View"));
item->setPixmap(0, SmallIcon("fileopen"));
@@ -278,7 +278,7 @@ class ActionToExecuteListView : public ActionsListViewBase
printItem->setPixmap(0, SmallIcon("fileprint"));
KAction *a = KStdAction::printPreview(0, 0, 0);
item = new ActionSelectorDialogListItem("printPreview", printItem,
- a->text().replace("&", "").replace("...", ""));
+ a->text().tqreplace("&", "").tqreplace("...", ""));
item->setPixmap(0, SmallIcon(a->icon()));
delete a;
item = new ActionSelectorDialogListItem("pageSetup", printItem, i18n("Show Page Setup"));
@@ -321,7 +321,7 @@ class ActionToExecuteListView : public ActionsListViewBase
setMinimumWidth( columnWidth(0) );
}
- QString m_currentMimeType;
+ TQString m_currentMimeType;
};
//-------------------------------------
@@ -339,25 +339,25 @@ public:
{
}
- void raiseWidget(QWidget *w)
+ void raiseWidget(TQWidget *w)
{
secondAnd3rdColumnStack->raiseWidget( w );
selectActionToBeExecutedLbl->setBuddy(w);
}
- void updateSelectActionToBeExecutedMessage(const QString& actionType)
+ void updateSelectActionToBeExecutedMessage(const TQString& actionType)
{
- QString msg;
+ TQString msg;
if (actionType=="noaction")
- msg = QString::null;
+ msg = TQString();
// hardcoded, but it's not that bad
else if (actionType=="macro")
- msg = i18n("&Select macro to be executed after clicking \"%1\" button:").arg(actionWidgetName);
+ msg = i18n("&Select macro to be executed after clicking \"%1\" button:").tqarg(actionWidgetName);
else if (actionType=="script")
- msg = i18n("&Select script to be executed after clicking \"%1\" button:").arg(actionWidgetName);
+ msg = i18n("&Select script to be executed after clicking \"%1\" button:").tqarg(actionWidgetName);
//default: table/query/form/report...
else
- msg = i18n("&Select object to be opened after clicking \"%1\" button:").arg(actionWidgetName);
+ msg = i18n("&Select object to be opened after clicking \"%1\" button:").tqarg(actionWidgetName);
selectActionToBeExecutedLbl->setText(msg);
}
@@ -374,29 +374,29 @@ public:
}
KexiMainWindow* mainWin;
- QString actionWidgetName;
+ TQString actionWidgetName;
ActionCategoriesListView* actionCategoriesListView; //!< for column #1
- QWidget *kactionPageWidget;
+ TQWidget *kactionPageWidget;
KActionsListView* kactionListView; //!< for column #2
KexiBrowser* objectsListView; //!< for column #2
- QWidget *currentFormActionsPageWidget; //!< for column #2
+ TQWidget *currentFormActionsPageWidget; //!< for column #2
CurrentFormActionsListView* currentFormActionsListView; //!< for column #2
- QWidget *emptyWidget;
- QLabel* selectActionToBeExecutedLbl;
+ TQWidget *emptyWidget;
+ TQLabel* selectActionToBeExecutedLbl;
ActionToExecuteListView* actionToExecuteListView;
- QLabel *actionToExecuteLbl;
- QWidget *secondAnd3rdColumnMainWidget;
- QGridLayout *glyr;
- QGridLayout *secondAnd3rdColumnGrLyr;
- QWidgetStack *secondAnd3rdColumnStack, *secondColumnStack;
+ TQLabel *actionToExecuteLbl;
+ TQWidget *secondAnd3rdColumnMainWidget;
+ TQGridLayout *glyr;
+ TQGridLayout *secondAnd3rdColumnGrLyr;
+ TQWidgetStack *secondAnd3rdColumnStack, *secondColumnStack;
bool hideActionToExecuteListView;
};
//-------------------------------------
-KexiActionSelectionDialog::KexiActionSelectionDialog(KexiMainWindow* mainWin, QWidget *parent,
- const KexiFormEventAction::ActionData& action, const QCString& actionWidgetName)
- : KDialogBase(parent, "actionSelectorDialog", true, i18n("Assigning Action to Command Button"),
+KexiActionSelectionDialog::KexiActionSelectionDialog(KexiMainWindow* mainWin, TQWidget *tqparent,
+ const KexiFormEventAction::ActionData& action, const TQCString& actionWidgetName)
+ : KDialogBase(tqparent, "actionSelectorDialog", true, i18n("Assigning Action to Command Button"),
KDialogBase::Ok | KDialogBase::Cancel )
, d( new KexiActionSelectionDialogPrivate() )
{
@@ -404,8 +404,8 @@ KexiActionSelectionDialog::KexiActionSelectionDialog(KexiMainWindow* mainWin, QW
d->actionWidgetName = actionWidgetName;
setButtonOK( KGuiItem(i18n("Assign action", "&Assign"), "button_ok", i18n("Assign action")) );
- QWidget *mainWidget = new QWidget( this );
- mainWidget->setSizePolicy(QSizePolicy::Minimum, QSizePolicy::Minimum);
+ TQWidget *mainWidget = new TQWidget( this );
+ mainWidget->tqsetSizePolicy(TQSizePolicy::Minimum, TQSizePolicy::Minimum);
setMainWidget(mainWidget);
/* lbl 1
@@ -418,80 +418,80 @@ KexiActionSelectionDialog::KexiActionSelectionDialog(KexiMainWindow* mainWin, QW
+------------+ +-------------------------------+
\______________________________________________/
glyr
- [a]- QWidgetStack *secondAnd3rdColumnStack,
- - for displaying KActions, the stack contains d->kactionPageWidget QWidget
- - for displaying objects, the stack contains secondAnd3rdColumnMainWidget QWidget and QGridLayout *secondAnd3rdColumnGrLyr
- - kactionPageWidget contains only a QVBoxLayout and label+kactionListView
+ [a]- TQWidgetStack *secondAnd3rdColumnStack,
+ - for displaying KActions, the stack contains d->kactionPageWidget TQWidget
+ - for displaying objects, the stack contains secondAnd3rdColumnMainWidget TQWidget and TQGridLayout *secondAnd3rdColumnGrLyr
+ - kactionPageWidget contains only a TQVBoxLayout and label+kactionListView
*/
- d->glyr = new QGridLayout(mainWidget, 2, 2, KDialog::marginHint(), KDialog::spacingHint());
+ d->glyr = new TQGridLayout(mainWidget, 2, 2, KDialog::marginHint(), KDialog::spacingHint());
d->glyr->setRowStretch(1, 1);
// 1st column: action types
d->actionCategoriesListView = new ActionCategoriesListView(mainWidget);
- d->actionCategoriesListView->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Minimum);
+ d->actionCategoriesListView->tqsetSizePolicy(TQSizePolicy::Fixed, TQSizePolicy::Minimum);
d->glyr->addWidget(d->actionCategoriesListView, 1, 0);
- connect( d->actionCategoriesListView, SIGNAL(selectionChanged(QListViewItem*)),
- this, SLOT(slotActionCategorySelected(QListViewItem*)));
+ connect( d->actionCategoriesListView, TQT_SIGNAL(selectionChanged(TQListViewItem*)),
+ this, TQT_SLOT(slotActionCategorySelected(TQListViewItem*)));
- QLabel *lbl = new QLabel(d->actionCategoriesListView, i18n("Action category:"), mainWidget);
+ TQLabel *lbl = new TQLabel(d->actionCategoriesListView, i18n("Action category:"), mainWidget);
lbl->setMinimumHeight(lbl->fontMetrics().height()*2);
- lbl->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed);
- lbl->setAlignment(Qt::AlignTop|Qt::AlignLeft|Qt::WordBreak);
- d->glyr->addWidget(lbl, 0, 0, Qt::AlignTop|Qt::AlignLeft);
+ lbl->tqsetSizePolicy(TQSizePolicy::Fixed, TQSizePolicy::Fixed);
+ lbl->tqsetAlignment(TQt::AlignTop|TQt::AlignLeft|TQt::WordBreak);
+ d->glyr->addWidget(lbl, 0, 0, TQt::AlignTop|TQt::AlignLeft);
// widget stack for 2nd and 3rd column
- d->secondAnd3rdColumnStack = new QWidgetStack(mainWidget);
- d->secondAnd3rdColumnStack->setSizePolicy(QSizePolicy::Minimum, QSizePolicy::Minimum);
- d->glyr->addMultiCellWidget(d->secondAnd3rdColumnStack, 0, 1, 1, 1);//, Qt::AlignTop|Qt::AlignLeft);
+ d->secondAnd3rdColumnStack = new TQWidgetStack(mainWidget);
+ d->secondAnd3rdColumnStack->tqsetSizePolicy(TQSizePolicy::Minimum, TQSizePolicy::Minimum);
+ d->glyr->addMultiCellWidget(d->secondAnd3rdColumnStack, 0, 1, 1, 1);//, TQt::AlignTop|TQt::AlignLeft);
- d->secondAnd3rdColumnMainWidget = new QWidget(d->secondAnd3rdColumnStack);
- d->secondAnd3rdColumnMainWidget->setSizePolicy(QSizePolicy::Minimum, QSizePolicy::Minimum);
- d->secondAnd3rdColumnGrLyr = new QGridLayout(d->secondAnd3rdColumnMainWidget, 2, 2, 0, KDialog::spacingHint());
+ d->secondAnd3rdColumnMainWidget = new TQWidget(d->secondAnd3rdColumnStack);
+ d->secondAnd3rdColumnMainWidget->tqsetSizePolicy(TQSizePolicy::Minimum, TQSizePolicy::Minimum);
+ d->secondAnd3rdColumnGrLyr = new TQGridLayout(d->secondAnd3rdColumnMainWidget, 2, 2, 0, KDialog::spacingHint());
d->secondAnd3rdColumnGrLyr->setRowStretch(1, 2);
d->secondAnd3rdColumnStack->addWidget(d->secondAnd3rdColumnMainWidget);
// 2nd column: list of actions/objects
d->objectsListView = new KexiBrowser(d->secondAnd3rdColumnMainWidget, d->mainWin, 0/*features*/);
d->secondAnd3rdColumnGrLyr->addWidget(d->objectsListView, 1, 0);
- connect(d->objectsListView, SIGNAL(selectionChanged(KexiPart::Item*)),
- this, SLOT(slotItemForOpeningOrExecutingSelected(KexiPart::Item*)));
+ connect(d->objectsListView, TQT_SIGNAL(selectionChanged(KexiPart::Item*)),
+ this, TQT_SLOT(slotItemForOpeningOrExecutingSelected(KexiPart::Item*)));
- d->selectActionToBeExecutedLbl = new QLabel(d->secondAnd3rdColumnMainWidget);
- d->selectActionToBeExecutedLbl->setSizePolicy(QSizePolicy::Minimum, QSizePolicy::Fixed);
- d->selectActionToBeExecutedLbl->setAlignment(Qt::AlignTop|Qt::AlignLeft|Qt::WordBreak);
+ d->selectActionToBeExecutedLbl = new TQLabel(d->secondAnd3rdColumnMainWidget);
+ d->selectActionToBeExecutedLbl->tqsetSizePolicy(TQSizePolicy::Minimum, TQSizePolicy::Fixed);
+ d->selectActionToBeExecutedLbl->tqsetAlignment(TQt::AlignTop|TQt::AlignLeft|TQt::WordBreak);
d->selectActionToBeExecutedLbl->setMinimumHeight(d->selectActionToBeExecutedLbl->fontMetrics().height()*2);
- d->secondAnd3rdColumnGrLyr->addWidget(d->selectActionToBeExecutedLbl, 0, 0, Qt::AlignTop|Qt::AlignLeft);
+ d->secondAnd3rdColumnGrLyr->addWidget(d->selectActionToBeExecutedLbl, 0, 0, TQt::AlignTop|TQt::AlignLeft);
- d->emptyWidget = new QWidget(d->secondAnd3rdColumnStack);
+ d->emptyWidget = new TQWidget(d->secondAnd3rdColumnStack);
d->secondAnd3rdColumnStack->addWidget(d->emptyWidget);
// 3rd column: actions to execute
d->actionToExecuteListView = new ActionToExecuteListView(d->secondAnd3rdColumnMainWidget);
d->actionToExecuteListView->installEventFilter(this); //to be able to disable painting
d->actionToExecuteListView->viewport()->installEventFilter(this); //to be able to disable painting
- d->actionToExecuteListView->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Minimum);
- connect(d->actionToExecuteListView, SIGNAL(executed(QListViewItem*)),
- this, SLOT(slotActionToExecuteItemExecuted(QListViewItem*)));
- connect(d->actionToExecuteListView, SIGNAL(selectionChanged(QListViewItem*)),
- this, SLOT(slotActionToExecuteItemSelected(QListViewItem*)));
+ d->actionToExecuteListView->tqsetSizePolicy(TQSizePolicy::Fixed, TQSizePolicy::Minimum);
+ connect(d->actionToExecuteListView, TQT_SIGNAL(executed(TQListViewItem*)),
+ this, TQT_SLOT(slotActionToExecuteItemExecuted(TQListViewItem*)));
+ connect(d->actionToExecuteListView, TQT_SIGNAL(selectionChanged(TQListViewItem*)),
+ this, TQT_SLOT(slotActionToExecuteItemSelected(TQListViewItem*)));
d->secondAnd3rdColumnGrLyr->addWidget(d->actionToExecuteListView, 1, 1);
- d->actionToExecuteLbl = new QLabel(d->actionToExecuteListView,
+ d->actionToExecuteLbl = new TQLabel(d->actionToExecuteListView,
i18n("Action to execute:"), d->secondAnd3rdColumnMainWidget);
d->actionToExecuteLbl->installEventFilter(this); //to be able to disable painting
- d->actionToExecuteLbl->setSizePolicy(QSizePolicy::Minimum, QSizePolicy::Fixed);
- d->actionToExecuteLbl->setAlignment(Qt::AlignTop|Qt::AlignLeft|Qt::WordBreak);
- d->secondAnd3rdColumnGrLyr->addWidget(d->actionToExecuteLbl, 0, 1, Qt::AlignTop|Qt::AlignLeft);
+ d->actionToExecuteLbl->tqsetSizePolicy(TQSizePolicy::Minimum, TQSizePolicy::Fixed);
+ d->actionToExecuteLbl->tqsetAlignment(TQt::AlignTop|TQt::AlignLeft|TQt::WordBreak);
+ d->secondAnd3rdColumnGrLyr->addWidget(d->actionToExecuteLbl, 0, 1, TQt::AlignTop|TQt::AlignLeft);
// temporary show all sections to avoid resizing the dialog in the future
d->actionCategoriesListView->selectAction("table");
d->setActionToExecuteSectionVisible(true);
adjustSize();
- resize(QMAX(700, width()), QMAX(450, height()));
+ resize(TQMAX(700, width()), TQMAX(450, height()));
d->actionToExecuteListView->updateWidth();
bool ok;
- QString actionType, actionArg;
+ TQString actionType, actionArg;
KexiPart::Info* partInfo = action.decodeString(actionType, actionArg, ok);
if (ok) {
d->actionCategoriesListView->selectAction(actionType);
@@ -511,7 +511,7 @@ KexiActionSelectionDialog::KexiActionSelectionDialog(KexiMainWindow* mainWin, QW
KexiPart::Item *item = d->mainWin->project()->item(partInfo, actionArg);
if (d->objectsListView && item) {
d->objectsListView->selectItem(*item);
- QString actionOption( action.option );
+ TQString actionOption( action.option );
if (actionOption.isEmpty())
actionOption = "open"; // for backward compatibility
d->actionToExecuteListView->selectAction(actionOption);
@@ -530,26 +530,26 @@ KexiActionSelectionDialog::~KexiActionSelectionDialog()
delete d;
}
-void KexiActionSelectionDialog::slotKActionItemExecuted(QListViewItem*)
+void KexiActionSelectionDialog::slotKActionItemExecuted(TQListViewItem*)
{
accept();
}
-void KexiActionSelectionDialog::slotKActionItemSelected(QListViewItem*)
+void KexiActionSelectionDialog::slotKActionItemSelected(TQListViewItem*)
{
d->setActionToExecuteSectionVisible(false);
- updateOKButtonStatus();
+ updateOKButtontqStatus();
}
-void KexiActionSelectionDialog::slotCurrentFormActionItemExecuted(QListViewItem*)
+void KexiActionSelectionDialog::slotCurrentFormActionItemExecuted(TQListViewItem*)
{
accept();
}
-void KexiActionSelectionDialog::slotCurrentFormActionItemSelected(QListViewItem*)
+void KexiActionSelectionDialog::slotCurrentFormActionItemSelected(TQListViewItem*)
{
d->setActionToExecuteSectionVisible(false);
- updateOKButtonStatus();
+ updateOKButtontqStatus();
}
void KexiActionSelectionDialog::slotItemForOpeningOrExecutingSelected(KexiPart::Item* item)
@@ -557,7 +557,7 @@ void KexiActionSelectionDialog::slotItemForOpeningOrExecutingSelected(KexiPart::
d->setActionToExecuteSectionVisible(item);
}
-void KexiActionSelectionDialog::slotActionToExecuteItemExecuted(QListViewItem* item)
+void KexiActionSelectionDialog::slotActionToExecuteItemExecuted(TQListViewItem* item)
{
if (!item)
return;
@@ -566,38 +566,38 @@ void KexiActionSelectionDialog::slotActionToExecuteItemExecuted(QListViewItem* i
accept();
}
-void KexiActionSelectionDialog::slotActionToExecuteItemSelected(QListViewItem*)
+void KexiActionSelectionDialog::slotActionToExecuteItemSelected(TQListViewItem*)
{
- updateOKButtonStatus();
+ updateOKButtontqStatus();
}
-void KexiActionSelectionDialog::slotActionCategorySelected(QListViewItem* item)
+void KexiActionSelectionDialog::slotActionCategorySelected(TQListViewItem* item)
{
ActionSelectorDialogListItem *simpleItem = dynamic_cast<ActionSelectorDialogListItem*>(item);
// simple case: part-less item, e.g. kaction:
if (simpleItem) {
d->updateSelectActionToBeExecutedMessage(simpleItem->data);
- QString selectActionToBeExecutedMsg(
+ TQString selectActionToBeExecutedMsg(
i18n("&Select action to be executed after clicking \"%1\" button:")); // msg for a label
if (simpleItem->data == "kaction") {
if (!d->kactionPageWidget) {
- //create lbl+list view with a vlayout
- d->kactionPageWidget = new QWidget();
- d->kactionPageWidget->setSizePolicy(QSizePolicy::Minimum, QSizePolicy::Minimum);
- QVBoxLayout *vlyr = new QVBoxLayout(d->kactionPageWidget, 0, KDialog::spacingHint());
+ //create lbl+list view with a vtqlayout
+ d->kactionPageWidget = new TQWidget();
+ d->kactionPageWidget->tqsetSizePolicy(TQSizePolicy::Minimum, TQSizePolicy::Minimum);
+ TQVBoxLayout *vlyr = new TQVBoxLayout(d->kactionPageWidget, 0, KDialog::spacingHint());
d->kactionListView = new KActionsListView(d->kactionPageWidget, d->mainWin);
d->kactionListView->init();
- QLabel *lbl = new QLabel(d->kactionListView, selectActionToBeExecutedMsg.arg(d->actionWidgetName),
+ TQLabel *lbl = new TQLabel(d->kactionListView, selectActionToBeExecutedMsg.tqarg(d->actionWidgetName),
d->kactionPageWidget);
- lbl->setAlignment(Qt::AlignTop|Qt::AlignLeft|Qt::WordBreak);
+ lbl->tqsetAlignment(TQt::AlignTop|TQt::AlignLeft|TQt::WordBreak);
lbl->setMinimumHeight(lbl->fontMetrics().height()*2);
vlyr->addWidget(lbl);
vlyr->addWidget(d->kactionListView);
d->secondAnd3rdColumnStack->addWidget(d->kactionPageWidget);
- connect(d->kactionListView, SIGNAL(executed(QListViewItem*)),
- this, SLOT(slotKActionItemExecuted(QListViewItem*)));
- connect( d->kactionListView, SIGNAL(selectionChanged(QListViewItem*)),
- this, SLOT(slotKActionItemSelected(QListViewItem*)));
+ connect(d->kactionListView, TQT_SIGNAL(executed(TQListViewItem*)),
+ this, TQT_SLOT(slotKActionItemExecuted(TQListViewItem*)));
+ connect( d->kactionListView, TQT_SIGNAL(selectionChanged(TQListViewItem*)),
+ this, TQT_SLOT(slotKActionItemSelected(TQListViewItem*)));
}
d->setActionToExecuteSectionVisible(false);
d->raiseWidget(d->kactionPageWidget);
@@ -605,24 +605,24 @@ void KexiActionSelectionDialog::slotActionCategorySelected(QListViewItem* item)
}
else if (simpleItem->data == "currentForm") {
if (!d->currentFormActionsPageWidget) {
- //create lbl+list view with a vlayout
- d->currentFormActionsPageWidget = new QWidget();
- d->currentFormActionsPageWidget->setSizePolicy(QSizePolicy::Minimum, QSizePolicy::Minimum);
- QVBoxLayout *vlyr = new QVBoxLayout(d->currentFormActionsPageWidget, 0, KDialog::spacingHint());
+ //create lbl+list view with a vtqlayout
+ d->currentFormActionsPageWidget = new TQWidget();
+ d->currentFormActionsPageWidget->tqsetSizePolicy(TQSizePolicy::Minimum, TQSizePolicy::Minimum);
+ TQVBoxLayout *vlyr = new TQVBoxLayout(d->currentFormActionsPageWidget, 0, KDialog::spacingHint());
d->currentFormActionsListView = new CurrentFormActionsListView(
d->currentFormActionsPageWidget, d->mainWin);
d->currentFormActionsListView->init();
- QLabel *lbl = new QLabel(d->currentFormActionsListView,
- selectActionToBeExecutedMsg.arg(d->actionWidgetName), d->currentFormActionsPageWidget);
- lbl->setAlignment(Qt::AlignTop|Qt::AlignLeft|Qt::WordBreak);
+ TQLabel *lbl = new TQLabel(d->currentFormActionsListView,
+ selectActionToBeExecutedMsg.tqarg(d->actionWidgetName), d->currentFormActionsPageWidget);
+ lbl->tqsetAlignment(TQt::AlignTop|TQt::AlignLeft|TQt::WordBreak);
lbl->setMinimumHeight(lbl->fontMetrics().height()*2);
vlyr->addWidget(lbl);
vlyr->addWidget(d->currentFormActionsListView);
d->secondAnd3rdColumnStack->addWidget(d->currentFormActionsPageWidget);
- connect(d->currentFormActionsListView, SIGNAL(executed(QListViewItem*)),
- this, SLOT(slotCurrentFormActionItemExecuted(QListViewItem*)));
- connect( d->currentFormActionsListView, SIGNAL(selectionChanged(QListViewItem*)),
- this, SLOT(slotCurrentFormActionItemSelected(QListViewItem*)));
+ connect(d->currentFormActionsListView, TQT_SIGNAL(executed(TQListViewItem*)),
+ this, TQT_SLOT(slotCurrentFormActionItemExecuted(TQListViewItem*)));
+ connect( d->currentFormActionsListView, TQT_SIGNAL(selectionChanged(TQListViewItem*)),
+ this, TQT_SLOT(slotCurrentFormActionItemSelected(TQListViewItem*)));
}
d->setActionToExecuteSectionVisible(false);
d->raiseWidget(d->currentFormActionsPageWidget);
@@ -635,7 +635,7 @@ void KexiActionSelectionDialog::slotActionCategorySelected(QListViewItem* item)
d->setActionToExecuteSectionVisible(false);
}
d->actionCategoriesListView->update();
- updateOKButtonStatus();
+ updateOKButtontqStatus();
return;
}
// other case
@@ -656,7 +656,7 @@ void KexiActionSelectionDialog::slotActionCategorySelected(QListViewItem* item)
d->raiseWidget( d->secondAnd3rdColumnMainWidget );
}
d->actionCategoriesListView->update();
- updateOKButtonStatus();
+ updateOKButtontqStatus();
}
KexiMainWindow* KexiActionSelectionDialog::mainWin() const
@@ -673,14 +673,14 @@ KexiFormEventAction::ActionData KexiActionSelectionDialog::currentAction() const
if (simpleItem) {
if (simpleItem->data == "kaction") {
if (d->kactionListView->selectedItem()) {
- data.string = QString("kaction:")
+ data.string = TQString("kaction:")
+ dynamic_cast<ActionSelectorDialogListItem*>( d->kactionListView->selectedItem() )->data;
return data;
}
}
else if (simpleItem->data == "currentForm") {
if (d->currentFormActionsListView->selectedItem()) {
- data.string = QString("currentForm:")
+ data.string = TQString("currentForm:")
+ dynamic_cast<ActionSelectorDialogListItem*>(
d->currentFormActionsListView->selectedItem() )->data;
return data;
@@ -696,7 +696,7 @@ KexiFormEventAction::ActionData KexiActionSelectionDialog::currentAction() const
KexiPart::Info* partInfo = partItem ? Kexi::partManager().infoForMimeType( partItem->mimeType() ) : 0;
if (partInfo) {
// opening or executing: table:name, query:name, form:name, macro:name, script:name, etc.
- data.string = QString("%1:%2").arg(partInfo->objectName()).arg(partItem->name());
+ data.string = TQString("%1:%2").tqarg(partInfo->objectName()).tqarg(partItem->name());
data.option = actionToExecute->data;
return data;
}
@@ -705,15 +705,15 @@ KexiFormEventAction::ActionData KexiActionSelectionDialog::currentAction() const
return data; // No Action
}
-void KexiActionSelectionDialog::updateOKButtonStatus()
+void KexiActionSelectionDialog::updateOKButtontqStatus()
{
- QPushButton *btn = actionButton(Ok);
+ TQPushButton *btn = actionButton(Ok);
ActionSelectorDialogListItem *simpleItem = dynamic_cast<ActionSelectorDialogListItem*>(
d->actionCategoriesListView->selectedItem());
btn->setEnabled( (simpleItem && simpleItem->data == "noaction") || !currentAction().isEmpty() );
}
-bool KexiActionSelectionDialog::eventFilter(QObject *o, QEvent *e)
+bool KexiActionSelectionDialog::eventFilter(TQObject *o, TQEvent *e)
{
if (d->hideActionToExecuteListView)
return true;
diff --git a/kexi/plugins/forms/kexiactionselectiondialog.h b/kexi/plugins/forms/kexiactionselectiondialog.h
index 6b6a896b..a9c4d549 100644
--- a/kexi/plugins/forms/kexiactionselectiondialog.h
+++ b/kexi/plugins/forms/kexiactionselectiondialog.h
@@ -37,9 +37,10 @@ namespace KexiPart {
class KEXIFORMUTILS_EXPORT KexiActionSelectionDialog : public KDialogBase
{
Q_OBJECT
+ TQ_OBJECT
public:
- KexiActionSelectionDialog(KexiMainWindow* mainWin, QWidget *parent,
- const KexiFormEventAction::ActionData& action, const QCString& actionWidgetName);
+ KexiActionSelectionDialog(KexiMainWindow* mainWin, TQWidget *tqparent,
+ const KexiFormEventAction::ActionData& action, const TQCString& actionWidgetName);
~KexiActionSelectionDialog();
/*! \return selected action data or empty action if dialog has been rejected
@@ -49,20 +50,20 @@ class KEXIFORMUTILS_EXPORT KexiActionSelectionDialog : public KDialogBase
//! \return the \a KexiMainWindow instance.
KexiMainWindow* mainWin() const;
- virtual bool eventFilter(QObject *o, QEvent *e);
+ virtual bool eventFilter(TQObject *o, TQEvent *e);
protected slots:
- void slotActionCategorySelected(QListViewItem* item);
- void slotKActionItemExecuted(QListViewItem*);
- void slotKActionItemSelected(QListViewItem*);
- void slotActionToExecuteItemExecuted(QListViewItem* item);
- void slotActionToExecuteItemSelected(QListViewItem*);
- void slotCurrentFormActionItemExecuted(QListViewItem*);
- void slotCurrentFormActionItemSelected(QListViewItem*);
+ void slotActionCategorySelected(TQListViewItem* item);
+ void slotKActionItemExecuted(TQListViewItem*);
+ void slotKActionItemSelected(TQListViewItem*);
+ void slotActionToExecuteItemExecuted(TQListViewItem* item);
+ void slotActionToExecuteItemSelected(TQListViewItem*);
+ void slotCurrentFormActionItemExecuted(TQListViewItem*);
+ void slotCurrentFormActionItemSelected(TQListViewItem*);
void slotItemForOpeningOrExecutingSelected(KexiPart::Item* item);
protected:
- void updateOKButtonStatus();
+ void updateOKButtontqStatus();
class KexiActionSelectionDialogPrivate;
KexiActionSelectionDialogPrivate* d;
diff --git a/kexi/plugins/forms/kexiactionselectiondialog_p.h b/kexi/plugins/forms/kexiactionselectiondialog_p.h
index 51f5c369..a2579074 100644
--- a/kexi/plugins/forms/kexiactionselectiondialog_p.h
+++ b/kexi/plugins/forms/kexiactionselectiondialog_p.h
@@ -26,20 +26,21 @@
class ActionsListViewBase : public KListView
{
public:
- ActionsListViewBase(QWidget* parent);
+ ActionsListViewBase(TQWidget* tqparent);
virtual ~ActionsListViewBase();
//! \return item for action \a actionName
- virtual QListViewItem *itemForAction(const QString& actionName);
- void selectAction(const QString& actionName);
+ virtual TQListViewItem *itemForAction(const TQString& actionName);
+ void selectAction(const TQString& actionName);
};
//! @internal Used by KActionsListView and CurrentFormActionsListView (in column 2)
class KActionsListViewBase : public ActionsListViewBase
{
Q_OBJECT
+ TQ_OBJECT
public:
- KActionsListViewBase(QWidget* parent, KexiMainWindow* mainWin);
+ KActionsListViewBase(TQWidget* tqparent, KexiMainWindow* mainWin);
virtual ~KActionsListViewBase();
void init();
virtual bool isActionVisible(const char* actionName, int actionCategories) const = 0;
diff --git a/kexi/plugins/forms/kexidataawarewidgetinfo.cpp b/kexi/plugins/forms/kexidataawarewidgetinfo.cpp
index a6033c70..0947c8a1 100644
--- a/kexi/plugins/forms/kexidataawarewidgetinfo.cpp
+++ b/kexi/plugins/forms/kexidataawarewidgetinfo.cpp
@@ -26,8 +26,8 @@ KexiDataAwareWidgetInfo::KexiDataAwareWidgetInfo(KFormDesigner::WidgetFactory *f
}
KexiDataAwareWidgetInfo::KexiDataAwareWidgetInfo(KFormDesigner::WidgetFactory *f,
- const char* parentFactoryName, const char* inheritedClassName)
- : KFormDesigner::WidgetInfo(f, parentFactoryName, inheritedClassName)
+ const char* tqparentFactoryName, const char* inheritedClassName)
+ : KFormDesigner::WidgetInfo(f, tqparentFactoryName, inheritedClassName)
{
init();
}
diff --git a/kexi/plugins/forms/kexidataawarewidgetinfo.h b/kexi/plugins/forms/kexidataawarewidgetinfo.h
index 41e67d85..eddcf909 100644
--- a/kexi/plugins/forms/kexidataawarewidgetinfo.h
+++ b/kexi/plugins/forms/kexidataawarewidgetinfo.h
@@ -33,7 +33,7 @@ class KEXIFORMUTILS_EXPORT KexiDataAwareWidgetInfo : public KFormDesigner::Widge
KexiDataAwareWidgetInfo(KFormDesigner::WidgetFactory *f);
KexiDataAwareWidgetInfo(KFormDesigner::WidgetFactory *f,
- const char* parentFactoryName, const char* inheritedClassName = 0);
+ const char* tqparentFactoryName, const char* inheritedClassName = 0);
virtual ~KexiDataAwareWidgetInfo();
diff --git a/kexi/plugins/forms/kexidataprovider.cpp b/kexi/plugins/forms/kexidataprovider.cpp
index 6706f838..400e6d37 100644
--- a/kexi/plugins/forms/kexidataprovider.cpp
+++ b/kexi/plugins/forms/kexidataprovider.cpp
@@ -19,8 +19,8 @@
#include "kexidataprovider.h"
-#include <qwidget.h>
-#include <qobjectlist.h>
+#include <tqwidget.h>
+#include <tqobjectlist.h>
#include <kdebug.h>
#include <klocale.h>
@@ -46,7 +46,7 @@ KexiFormDataProvider::~KexiFormDataProvider()
delete m_duplicatedItems;
}
-void KexiFormDataProvider::setMainDataSourceWidget(QWidget* mainWidget)
+void KexiFormDataProvider::setMainDataSourceWidget(TQWidget* mainWidget)
{
m_mainWidget = mainWidget;
m_dataItems.clear();
@@ -56,15 +56,15 @@ void KexiFormDataProvider::setMainDataSourceWidget(QWidget* mainWidget)
return;
//find widgets whose will work as data items
- QObjectList *l = m_mainWidget->queryList( "QWidget" );
- QObjectListIt it( *l );
- QObject *obj;
- QDict<char> tmpSources;
+ TQObjectList *l = m_mainWidget->queryList( TQWIDGET_OBJECT_NAME_STRING );
+ TQObjectListIt it( *l );
+ TQObject *obj;
+ TQDict<char> tmpSources;
for ( ; (obj = it.current()) != 0; ++it ) {
KexiFormDataItemInterface* const formDataItem = dynamic_cast<KexiFormDataItemInterface*>(obj);
if (!formDataItem)
continue;
- if (formDataItem->parentInterface()) //item with parent interface: collect parent instead...
+ if (formDataItem->tqparentInterface()) //item with tqparent interface: collect tqparent instead...
continue;
#if 0 //! @todo reenable when subform is moved to KexiDBForm
KexiDBForm *dbForm = KexiUtils::findParent<KexiDBForm>(obj, "KexiDBForm"); //form's surface...
@@ -75,18 +75,18 @@ void KexiFormDataProvider::setMainDataSourceWidget(QWidget* mainWidget)
if (KexiUtils::findParent<KexiDBForm>(obj, "KexiDBSubForm"))
continue;
#endif
- QString dataSource( formDataItem->dataSource().lower() );
+ TQString dataSource( formDataItem->dataSource().lower() );
if (dataSource.isEmpty())
continue;
kexipluginsdbg << obj->name() << endl;
m_dataItems.append( formDataItem );
formDataItem->installListener( this );
- tmpSources.replace( dataSource, (char*)1 );
+ tmpSources.tqreplace( dataSource, (char*)1 );
}
delete l;
//now we've got a set (unique list) of field names in tmpSources
//remember it in m_usedDataSources
- for (QDictIterator<char> it(tmpSources); it.current(); ++it) {
+ for (TQDictIterator<char> it(tmpSources); it.current(); ++it) {
m_usedDataSources += it.currentKey();
}
}
@@ -106,46 +106,46 @@ void KexiFormDataProvider::fillDataItems(KexiTableItem& row, bool cursorAtNewRow
int indexForVisibleLookupValue = itemIface->columnInfo()->indexForVisibleLookupValue();
if (indexForVisibleLookupValue<0 && indexForVisibleLookupValue>=(int)row.count()) //sanity
indexForVisibleLookupValue = -1; //no
- const QVariant value(row.at(it.data()));
- QVariant visibleLookupValue;
+ const TQVariant value(row.at(it.data()));
+ TQVariant visibleLookupValue;
if (indexForVisibleLookupValue!=-1 && (int)row.size()>indexForVisibleLookupValue)
visibleLookupValue = row.at(indexForVisibleLookupValue);
kexipluginsdbg << "fill data of '" << itemIface->dataSource() << "' at idx=" << it.data()
<< " data=" << value << (indexForVisibleLookupValue!=-1
- ? QString(" SPECIAL: indexForVisibleLookupValue=%1 visibleValue=%2")
- .arg(indexForVisibleLookupValue).arg(visibleLookupValue.toString())
- : QString::null)
+ ? TQString(" SPECIAL: indexForVisibleLookupValue=%1 visibleValue=%2")
+ .tqarg(indexForVisibleLookupValue).tqarg(visibleLookupValue.toString())
+ : TQString())
<< endl;
const bool displayDefaultValue = cursorAtNewRow && (value.isNull() && visibleLookupValue.isNull())
&& !itemIface->columnInfo()->field->defaultValue().isNull()
&& !itemIface->columnInfo()->field->isAutoIncrement(); //no value to set but there is default value defined
itemIface->setValue(
displayDefaultValue ? itemIface->columnInfo()->field->defaultValue() : value,
- QVariant(), /*add*/
+ TQVariant(), /*add*/
/*!remove old*/false,
indexForVisibleLookupValue==-1 ? 0 : &visibleLookupValue //pass visible value if available
);
// now disable/enable "display default value" if needed (do it after setValue(), before setValue() turns it off)
if (itemIface->hasDisplayedDefaultValue() != displayDefaultValue)
- itemIface->setDisplayDefaultValue( dynamic_cast<QWidget*>(itemIface), displayDefaultValue );
+ itemIface->setDisplayDefaultValue( dynamic_cast<TQWidget*>(itemIface), displayDefaultValue );
}
}
void KexiFormDataProvider::fillDuplicatedDataItems(
- KexiFormDataItemInterface* item, const QVariant& value)
+ KexiFormDataItemInterface* item, const TQVariant& value)
{
if (m_disableFillDuplicatedDataItems)
return;
if (!m_duplicatedItems) {
//build (once) a set of duplicated data items (having the same fields assigned)
//so we can later check if an item is duplicated with a cost of o(1)
- QMap<KexiDB::Field*,int> tmpDuplicatedItems;
- QMapIterator<KexiDB::Field*,int> it_dup;
- for (QPtrListIterator<KexiFormDataItemInterface> it(m_dataItems); it.current(); ++it) {
+ TQMap<KexiDB::Field*,int> tmpDuplicatedItems;
+ TQMapIterator<KexiDB::Field*,int> it_dup;
+ for (TQPtrListIterator<KexiFormDataItemInterface> it(m_dataItems); it.current(); ++it) {
if (!it.current()->columnInfo() || !it.current()->columnInfo()->field)
continue;
kdDebug() << " ** " << it.current()->columnInfo()->field->name() << endl;
- it_dup = tmpDuplicatedItems.find( it.current()->columnInfo()->field );
+ it_dup = tmpDuplicatedItems.tqfind( it.current()->columnInfo()->field );
uint count;
if (it_dup==tmpDuplicatedItems.end())
count = 0;
@@ -153,7 +153,7 @@ void KexiFormDataProvider::fillDuplicatedDataItems(
count = it_dup.data();
tmpDuplicatedItems.insert( it.current()->columnInfo()->field, ++count );
}
- m_duplicatedItems = new QPtrDict<char>(101);
+ m_duplicatedItems = new TQPtrDict<char>(101);
for (it_dup = tmpDuplicatedItems.begin(); it_dup!=tmpDuplicatedItems.end(); ++it_dup) {
if (it_dup.data() > 1) {
m_duplicatedItems->insert( it_dup.key(), (char*)1 );
@@ -162,11 +162,11 @@ void KexiFormDataProvider::fillDuplicatedDataItems(
}
}
}
- if (item->columnInfo() && m_duplicatedItems->find( item->columnInfo()->field )) {
- for (QPtrListIterator<KexiFormDataItemInterface> it(m_dataItems); it.current(); ++it) {
+ if (item->columnInfo() && m_duplicatedItems->tqfind( item->columnInfo()->field )) {
+ for (TQPtrListIterator<KexiFormDataItemInterface> it(m_dataItems); it.current(); ++it) {
if (it.current()!=item && item->columnInfo()->field == it.current()->columnInfo()->field) {
kexipluginsdbg << "- setting a copy of value for item '"
- << dynamic_cast<QObject*>(it.current())->name() << "' == " << value << endl;
+ << dynamic_cast<TQObject*>(it.current())->name() << "' == " << value << endl;
it.current()->setValue( value );
}
}
@@ -183,7 +183,7 @@ bool KexiFormDataProvider::cursorAtNewRow() const
return false;
}
-void KexiFormDataProvider::invalidateDataSources( const QDict<char>& invalidSources,
+void KexiFormDataProvider::tqinvalidateDataSources( const TQDict<char>& invalidSources,
KexiDB::QuerySchema* query)
{
//fill m_fieldNumbersForDataItems mapping from data item to field number
@@ -194,16 +194,16 @@ void KexiFormDataProvider::invalidateDataSources( const QDict<char>& invalidSour
if (query) {
fieldsExpanded = query->fieldsExpanded( KexiDB::QuerySchema::WithInternalFields );
// dataFieldsCount = fieldsExpanded.count();
- QMap<KexiDB::QueryColumnInfo*,int> columnsOrder( query->columnsOrder() );
- for (QMapConstIterator<KexiDB::QueryColumnInfo*,int> it = columnsOrder.constBegin(); it!=columnsOrder.constEnd(); ++it) {
+ TQMap<KexiDB::QueryColumnInfo*,int> columnsOrder( query->columnsOrder() );
+ for (TQMapConstIterator<KexiDB::QueryColumnInfo*,int> it = columnsOrder.constBegin(); it!=columnsOrder.constEnd(); ++it) {
kexipluginsdbg << "query->columnsOrder()[ " << it.key()->field->name() << " ] = " << it.data() << endl;
}
- for (QPtrListIterator<KexiFormDataItemInterface> it(m_dataItems); it.current(); ++it) {
+ for (TQPtrListIterator<KexiFormDataItemInterface> it(m_dataItems); it.current(); ++it) {
KexiFormDataItemInterface *item = it.current();
KexiDB::QueryColumnInfo* ci = query->columnInfo( it.current()->dataSource() );
int index = ci ? columnsOrder[ ci ] : -1;
kexipluginsdbg << "query->columnsOrder()[ " << (ci ? ci->field->name() : "") << " ] = " << index
- << " (dataSource: " << item->dataSource() << ", name=" << dynamic_cast<QObject*>(item)->name() << ")" << endl;
+ << " (dataSource: " << item->dataSource() << ", name=" << dynamic_cast<TQObject*>(item)->name() << ")" << endl;
if (index!=-1 && !m_fieldNumbersForDataItems[ item ])
m_fieldNumbersForDataItems.insert( item, index );
//todo
@@ -218,26 +218,26 @@ void KexiFormDataProvider::invalidateDataSources( const QDict<char>& invalidSour
#if 0 //moved down
//in 'newIndices' let's collect new indices for every data source
- foreach(QValueList<uint>::ConstIterator, it, invalidSources) {
+ foreach(TQValueList<uint>::ConstIterator, it, invalidSources) {
//all previous indices have corresponding data source
// for (; i < (*it); i++) {
// newIndices[i] = number++;
- //kexipluginsdbg << "invalidateDataSources(): " << i << " -> " << number-1 << endl;
+ //kexipluginsdbg << "tqinvalidateDataSources(): " << i << " -> " << number-1 << endl;
// }
//this index have no corresponding data source
// newIndices[i]=-1;
KexiFormDataItemInterface *item = m_dataItems.at( *it );
if (item)
- item->setInvalidState( QString::fromLatin1("#") + i18n("NAME") + QString::fromLatin1("?") );
+ item->setInvalidState( TQString::tqfromLatin1("#") + i18n("NAME") + TQString::tqfromLatin1("?") );
m_dataItems.remove(*it);
- kexipluginsdbg << "invalidateDataSources(): " << (*it) << " -> " << -1 << endl;
+ kexipluginsdbg << "tqinvalidateDataSources(): " << (*it) << " -> " << -1 << endl;
// i++;
}
#endif
//fill remaining part of the vector
// for (; i < dataFieldsCount; i++) { //m_dataItems.count(); i++) {
//newIndices[i] = number++;
- //kexipluginsdbg << "invalidateDataSources(): " << i << " -> " << number-1 << endl;
+ //kexipluginsdbg << "tqinvalidateDataSources(): " << i << " -> " << number-1 << endl;
//}
#if 0
@@ -247,35 +247,35 @@ void KexiFormDataProvider::invalidateDataSources( const QDict<char>& invalidSour
bool ok;
const int newIndex = newIndices.at( it.data(), &ok );
if (ok && newIndex!=-1) {
- kexipluginsdbg << "invalidateDataSources(): " << it.key()->dataSource() << ": " << it.data() << " -> " << newIndex << endl;
- newFieldNumbersForDataItems.replace(it.key(), newIndex);
+ kexipluginsdbg << "tqinvalidateDataSources(): " << it.key()->dataSource() << ": " << it.data() << " -> " << newIndex << endl;
+ newFieldNumbersForDataItems.tqreplace(it.key(), newIndex);
}
else {
- kexipluginsdbg << "invalidateDataSources(): removing " << it.key()->dataSource() << endl;
+ kexipluginsdbg << "tqinvalidateDataSources(): removing " << it.key()->dataSource() << endl;
m_dataItems.remove(it.key());
- it.key()->setInvalidState( QString::fromLatin1("#") + i18n("NAME") + QString::fromLatin1("?") );
+ it.key()->setInvalidState( TQString::tqfromLatin1("#") + i18n("NAME") + TQString::tqfromLatin1("?") );
}
}
#endif
// m_fieldNumbersForDataItems = newFieldNumbersForDataItems;
//update data sources set (some of them may be removed)
- QDict<char> tmpUsedDataSources(1013);
+ TQDict<char> tmpUsedDataSources(1013);
if (query)
query->debug();
//if (query && m_dataItems.count()!=query->fieldCount()) {
- // kdWarning() << "KexiFormDataProvider::invalidateDataSources(): m_dataItems.count()!=query->fieldCount() ("
+ // kdWarning() << "KexiFormDataProvider::tqinvalidateDataSources(): m_dataItems.count()!=query->fieldCount() ("
// << m_dataItems.count() << "," << query->fieldCount() << ")" << endl;
//}
//i = 0;
m_disableFillDuplicatedDataItems = true; // temporary disable fillDuplicatedDataItems()
// because setColumnInfo() can activate it
- for (QPtrListIterator<KexiFormDataItemInterface> it(m_dataItems); it.current();) {
+ for (TQPtrListIterator<KexiFormDataItemInterface> it(m_dataItems); it.current();) {
KexiFormDataItemInterface * item = it.current();
if (invalidSources[ item->dataSource().lower() ]) {
- item->setInvalidState( QString::fromLatin1("#") + i18n("NAME") + QString::fromLatin1("?") );
+ item->setInvalidState( TQString::tqfromLatin1("#") + i18n("NAME") + TQString::tqfromLatin1("?") );
m_dataItems.remove(item);
continue;
}
@@ -283,7 +283,7 @@ void KexiFormDataProvider::invalidateDataSources( const QDict<char>& invalidSour
if (query) {
KexiDB::QueryColumnInfo *ci = fieldsExpanded[fieldNumber];
item->setColumnInfo(ci);
- kexipluginsdbg << "- item=" << dynamic_cast<QObject*>(item)->name()
+ kexipluginsdbg << "- item=" << dynamic_cast<TQObject*>(item)->name()
<< " dataSource=" << item->dataSource()
<< " field=" << ci->field->name() << endl;
const int indexForVisibleLookupValue = ci->indexForVisibleLookupValue();
@@ -304,12 +304,12 @@ void KexiFormDataProvider::invalidateDataSources( const QDict<char>& invalidSour
}
}
}
- tmpUsedDataSources.replace( item->dataSource().lower(), (char*)1 );
+ tmpUsedDataSources.tqreplace( item->dataSource().lower(), (char*)1 );
++it;
}
m_disableFillDuplicatedDataItems = false;
m_usedDataSources.clear();
- foreach_list(QDictIterator<char>, it, tmpUsedDataSources) {
+ foreach_list(TQDictIterator<char>, it, tmpUsedDataSources) {
m_usedDataSources += it.currentKey();
}
}
diff --git a/kexi/plugins/forms/kexidataprovider.h b/kexi/plugins/forms/kexidataprovider.h
index 64019842..f1e9d755 100644
--- a/kexi/plugins/forms/kexidataprovider.h
+++ b/kexi/plugins/forms/kexidataprovider.h
@@ -21,8 +21,8 @@
#define KEXIFORMDATAPROVIDER_H
#include "kexiformdataiteminterface.h"
-#include <qptrdict.h>
-#include <qdict.h>
+#include <tqptrdict.h>
+#include <tqdict.h>
class KexiTableItem;
namespace KexiDB {
@@ -50,11 +50,11 @@ class KEXIFORMUTILS_EXPORT KexiFormDataProvider : public KexiDataItemChangesList
Also find widgets whose will work as data items
(all of them must implement KexiFormDataItemInterface), so these could be
filled with data on demand. */
- void setMainDataSourceWidget(QWidget* mainWidget);
+ void setMainDataSourceWidget(TQWidget* mainWidget);
- QStringList usedDataSources() const { return m_usedDataSources; }
+ TQStringList usedDataSources() const { return m_usedDataSources; }
- //unused QPtrList<KexiFormDataItemInterface>& dataItems() { return m_dataItems; }
+ //unused TQPtrList<KexiFormDataItemInterface>& dataItems() { return m_dataItems; }
/*! Fills data items with appropriate data fetched from \a cursor.
\a newRowEditing == true means that we are at new (not yet inserted) database row. */
@@ -74,20 +74,20 @@ class KEXIFORMUTILS_EXPORT KexiFormDataProvider : public KexiDataItemChangesList
\a invalidSources is the set of data sources that should
be omitted for fillDataItems().
Used by KexiFormView::initDataSource(). */
- void invalidateDataSources( const QDict<char>& invalidSources,
+ void tqinvalidateDataSources( const TQDict<char>& invalidSources,
KexiDB::QuerySchema* query = 0 );
/*! Fills the same data provided by \a value to every data item (other than \a item)
having the same data source as \a item. This method is called immediately when
\a value is changed, so duplicated data items are quickly updated. */
- void fillDuplicatedDataItems(KexiFormDataItemInterface* item, const QVariant& value);
+ void fillDuplicatedDataItems(KexiFormDataItemInterface* item, const TQVariant& value);
protected:
- QWidget *m_mainWidget;
- QPtrDict<char> *m_duplicatedItems;
- typedef QMap<KexiFormDataItemInterface*,uint> KexiFormDataItemInterfaceToIntMap;
- QPtrList<KexiFormDataItemInterface> m_dataItems;
- QStringList m_usedDataSources;
+ TQWidget *m_mainWidget;
+ TQPtrDict<char> *m_duplicatedItems;
+ typedef TQMap<KexiFormDataItemInterface*,uint> KexiFormDataItemInterfaceToIntMap;
+ TQPtrList<KexiFormDataItemInterface> m_dataItems;
+ TQStringList m_usedDataSources;
KexiFormDataItemInterfaceToIntMap m_fieldNumbersForDataItems;
bool m_disableFillDuplicatedDataItems : 1;
};
diff --git a/kexi/plugins/forms/kexidatasourcepage.cpp b/kexi/plugins/forms/kexidatasourcepage.cpp
index 6c0de830..ce11e7d9 100644
--- a/kexi/plugins/forms/kexidatasourcepage.cpp
+++ b/kexi/plugins/forms/kexidatasourcepage.cpp
@@ -19,10 +19,10 @@
#include "kexidatasourcepage.h"
-#include <qlabel.h>
-#include <qlayout.h>
-#include <qtooltip.h>
-#include <qheader.h>
+#include <tqlabel.h>
+#include <tqlayout.h>
+#include <tqtooltip.h>
+#include <tqheader.h>
#include <kiconloader.h>
#include <klocale.h>
@@ -43,11 +43,11 @@
#include <koproperty/property.h>
#include <koproperty/utils.h>
-KexiDataSourcePage::KexiDataSourcePage(QWidget *parent, const char *name)
- : QWidget(parent, name)
+KexiDataSourcePage::KexiDataSourcePage(TQWidget *tqparent, const char *name)
+ : TQWidget(tqparent, name)
, m_insideClearDataSourceSelection(false)
{
- QVBoxLayout *vlyr = new QVBoxLayout(this);
+ TQVBoxLayout *vlyr = new TQVBoxLayout(this);
m_objectInfoLabel = new KexiObjectInfoLabel(this, "KexiObjectInfoLabel");
vlyr->addWidget(m_objectInfoLabel);
@@ -60,67 +60,67 @@ KexiDataSourcePage::KexiDataSourcePage(QWidget *parent, const char *name)
KoProperty::GroupContainer *container = new KoProperty::GroupContainer(i18n("Data Source"), this);
vlyr->addWidget(container);
- QWidget *contents = new QWidget(container);
+ TQWidget *contents = new TQWidget(container);
container->setContents(contents);
- QVBoxLayout *contentsVlyr = new QVBoxLayout(contents);
+ TQVBoxLayout *contentsVlyr = new TQVBoxLayout(contents);
- m_noDataSourceAvailableLabel = new QLabel(m_noDataSourceAvailableSingleText, contents);
- m_noDataSourceAvailableLabel->setSizePolicy(QSizePolicy::Preferred, QSizePolicy::Fixed);
+ m_noDataSourceAvailableLabel = new TQLabel(m_noDataSourceAvailableSingleText, contents);
+ m_noDataSourceAvailableLabel->tqsetSizePolicy(TQSizePolicy::Preferred, TQSizePolicy::Fixed);
m_noDataSourceAvailableLabel->setMargin(2);
- m_noDataSourceAvailableLabel->setAlignment(Qt::WordBreak | Qt::AlignBottom | Qt::AlignLeft);
+ m_noDataSourceAvailableLabel->tqsetAlignment(TQt::WordBreak | TQt::AlignBottom | TQt::AlignLeft);
contentsVlyr->addWidget(m_noDataSourceAvailableLabel);
//-Widget's Data Source
- QHBoxLayout *hlyr = new QHBoxLayout(contentsVlyr);
+ TQHBoxLayout *hlyr = new TQHBoxLayout(contentsVlyr);
#if 0
//! @todo unhide this when expression work
-// m_widgetDSLabel = new QLabel(i18n("Table Field, Query Field or Expression", "Source field or expression:"), this);
+// m_widgetDSLabel = new TQLabel(i18n("Table Field, Query Field or Expression", "Source field or expression:"), this);
#else
- m_widgetDSLabel = new QLabel(i18n("Table Field or Query Field", "Widget's data source:"), contents);
+ m_widgetDSLabel = new TQLabel(i18n("Table Field or Query Field", "Widget's data source:"), contents);
#endif
- m_widgetDSLabel->setSizePolicy(QSizePolicy::Minimum, QSizePolicy::Fixed);
+ m_widgetDSLabel->tqsetSizePolicy(TQSizePolicy::Minimum, TQSizePolicy::Fixed);
m_widgetDSLabel->setMargin(2);
m_widgetDSLabel->setMinimumHeight(IconSize(KIcon::Small)+4);
- m_widgetDSLabel->setAlignment(AlignLeft|AlignBottom);
+ m_widgetDSLabel->tqsetAlignment(AlignLeft|AlignBottom);
hlyr->addWidget(m_widgetDSLabel);
- m_clearWidgetDSButton = new KexiSmallToolButton(contents, QString::null, "clear_left", "clearWidgetDSButton");
+ m_clearWidgetDSButton = new KexiSmallToolButton(contents, TQString(), "clear_left", "clearWidgetDSButton");
m_clearWidgetDSButton->setMinimumHeight(m_widgetDSLabel->minimumHeight());
- QToolTip::add(m_clearWidgetDSButton, i18n("Clear widget's data source"));
+ TQToolTip::add(m_clearWidgetDSButton, i18n("Clear widget's data source"));
hlyr->addWidget(m_clearWidgetDSButton);
- connect(m_clearWidgetDSButton, SIGNAL(clicked()), this, SLOT(clearWidgetDataSourceSelection()));
+ connect(m_clearWidgetDSButton, TQT_SIGNAL(clicked()), this, TQT_SLOT(clearWidgetDataSourceSelection()));
m_sourceFieldCombo = new KexiFieldComboBox(contents, "sourceFieldCombo");
m_widgetDSLabel->setBuddy(m_sourceFieldCombo);
contentsVlyr->addWidget(m_sourceFieldCombo);
-/* m_dataSourceSeparator = new QFrame(contents);
- m_dataSourceSeparator->setFrameShape(QFrame::HLine);
- m_dataSourceSeparator->setFrameShadow(QFrame::Sunken);
+/* m_dataSourceSeparator = new TQFrame(contents);
+ m_dataSourceSeparator->setFrameShape(TQFrame::HLine);
+ m_dataSourceSeparator->setFrameShadow(TQFrame::Sunken);
contentsVlyr->addWidget(m_dataSourceSeparator);*/
contentsVlyr->addSpacing(8);
//- Form's Data Source
- hlyr = new QHBoxLayout(contentsVlyr);
- m_dataSourceLabel = new QLabel(i18n("Form's data source:"), contents);
- m_dataSourceLabel->setSizePolicy(QSizePolicy::Minimum, QSizePolicy::Fixed);
+ hlyr = new TQHBoxLayout(contentsVlyr);
+ m_dataSourceLabel = new TQLabel(i18n("Form's data source:"), contents);
+ m_dataSourceLabel->tqsetSizePolicy(TQSizePolicy::Minimum, TQSizePolicy::Fixed);
m_dataSourceLabel->setMargin(2);
m_dataSourceLabel->setMinimumHeight(IconSize(KIcon::Small)+4);
- m_dataSourceLabel->setAlignment(AlignLeft|AlignBottom);
+ m_dataSourceLabel->tqsetAlignment(AlignLeft|AlignBottom);
hlyr->addWidget(m_dataSourceLabel);
- m_gotoButton = new KexiSmallToolButton(contents, QString::null, "goto", "gotoButton");
+ m_gotoButton = new KexiSmallToolButton(contents, TQString(), "goto", "gotoButton");
m_gotoButton->setMinimumHeight(m_dataSourceLabel->minimumHeight());
- QToolTip::add(m_gotoButton, i18n("Go to selected form's data source"));
+ TQToolTip::add(m_gotoButton, i18n("Go to selected form's data source"));
hlyr->addWidget(m_gotoButton);
- connect(m_gotoButton, SIGNAL(clicked()), this, SLOT(slotGotoSelected()));
+ connect(m_gotoButton, TQT_SIGNAL(clicked()), this, TQT_SLOT(slotGotoSelected()));
- m_clearDSButton = new KexiSmallToolButton(contents, QString::null, "clear_left", "clearDSButton");
+ m_clearDSButton = new KexiSmallToolButton(contents, TQString(), "clear_left", "clearDSButton");
m_clearDSButton->setMinimumHeight(m_dataSourceLabel->minimumHeight());
- QToolTip::add(m_clearDSButton, i18n("Clear form's data source"));
+ TQToolTip::add(m_clearDSButton, i18n("Clear form's data source"));
hlyr->addWidget(m_clearDSButton);
- connect(m_clearDSButton, SIGNAL(clicked()), this, SLOT(clearDataSourceSelection()));
+ connect(m_clearDSButton, TQT_SIGNAL(clicked()), this, TQT_SLOT(clearDataSourceSelection()));
m_dataSourceCombo = new KexiDataSourceComboBox(contents, "dataSourceCombo");
m_dataSourceLabel->setBuddy(m_dataSourceCombo);
@@ -133,9 +133,9 @@ KexiDataSourcePage::KexiDataSourcePage(QWidget *parent, const char *name)
vlyr->addStretch();
#else
vlyr->addSpacing(fontMetrics().height());
-/* QFrame *separator = new QFrame(this);
- separator->setFrameShape(QFrame::HLine);
- separator->setFrameShadow(QFrame::Sunken);
+/* TQFrame *separator = new TQFrame(this);
+ separator->setFrameShape(TQFrame::HLine);
+ separator->setFrameShadow(TQFrame::Sunken);
vlyr->addWidget(separator);*/
/*
KPopupTitle *title = new KPopupTitle(this);
@@ -150,24 +150,24 @@ KexiDataSourcePage::KexiDataSourcePage(QWidget *parent, const char *name)
//helper info
//! @todo allow to hide such helpers by adding global option
- contents = new QWidget(container);
+ contents = new TQWidget(container);
container->setContents(contents);
- contentsVlyr = new QVBoxLayout(contents);
- hlyr = new QHBoxLayout(contentsVlyr);
- m_mousePointerLabel = new QLabel(contents);
+ contentsVlyr = new TQVBoxLayout(contents);
+ hlyr = new TQHBoxLayout(contentsVlyr);
+ m_mousePointerLabel = new TQLabel(contents);
hlyr->addWidget(m_mousePointerLabel);
m_mousePointerLabel->setPixmap( SmallIcon("mouse_pointer") );
m_mousePointerLabel->setFixedWidth( m_mousePointerLabel->pixmap() ? m_mousePointerLabel->pixmap()->width() : 0);
- m_availableFieldsDescriptionLabel = new QLabel(
+ m_availableFieldsDescriptionLabel = new TQLabel(
i18n("Select fields from the list below and drag them onto a form or click the \"Insert\" button"), contents);
- m_availableFieldsDescriptionLabel->setAlignment( Qt::AlignAuto | Qt::WordBreak );
+ m_availableFieldsDescriptionLabel->tqsetAlignment( TQt::AlignAuto | TQt::WordBreak );
hlyr->addWidget(m_availableFieldsDescriptionLabel);
//Available Fields
contentsVlyr->addSpacing(4);
- hlyr = new QHBoxLayout(contentsVlyr);
- m_availableFieldsLabel = new QLabel(i18n("Available fields:"), contents);
- m_availableFieldsLabel->setSizePolicy(QSizePolicy::Minimum, QSizePolicy::Fixed);
+ hlyr = new TQHBoxLayout(contentsVlyr);
+ m_availableFieldsLabel = new TQLabel(i18n("Available fields:"), contents);
+ m_availableFieldsLabel->tqsetSizePolicy(TQSizePolicy::Minimum, TQSizePolicy::Fixed);
m_availableFieldsLabel->setMargin(2);
m_availableFieldsLabel->setMinimumHeight(IconSize(KIcon::Small));
hlyr->addWidget(m_availableFieldsLabel);
@@ -175,27 +175,27 @@ KexiDataSourcePage::KexiDataSourcePage(QWidget *parent, const char *name)
m_addField = new KexiSmallToolButton(contents, i18n("Insert selected field into form", "Insert"),
"add_field", "addFieldButton");
m_addField->setMinimumHeight(m_availableFieldsLabel->minimumHeight());
-// m_addField->setTextPosition(QToolButton::Right);
- m_addField->setFocusPolicy(StrongFocus);
- QToolTip::add(m_addField, i18n("Insert selected fields into form"));
+// m_addField->setTextPosition(TQToolButton::Right);
+ m_addField->setFocusPolicy(TQ_StrongFocus);
+ TQToolTip::add(m_addField, i18n("Insert selected fields into form"));
hlyr->addWidget(m_addField);
- connect(m_addField, SIGNAL(clicked()), this, SLOT(slotInsertSelectedFields()));
+ connect(m_addField, TQT_SIGNAL(clicked()), this, TQT_SLOT(slotInsertSelectedFields()));
m_fieldListView = new KexiFieldListView(contents, "fieldListView",
KexiFieldListView::ShowDataTypes | KexiFieldListView::AllowMultiSelection );
- m_fieldListView->setSizePolicy(QSizePolicy(QSizePolicy::Preferred, QSizePolicy::Expanding));
+ m_fieldListView->tqsetSizePolicy(TQSizePolicy(TQSizePolicy::Preferred, TQSizePolicy::Expanding));
m_availableFieldsLabel->setBuddy(m_fieldListView);
contentsVlyr->addWidget(m_fieldListView, 1);
- connect(m_fieldListView, SIGNAL(selectionChanged()), this, SLOT(slotFieldListViewSelectionChanged()));
- connect(m_fieldListView, SIGNAL(fieldDoubleClicked(const QString&, const QString&, const QString&)),
- this, SLOT(slotFieldDoubleClicked(const QString&, const QString&, const QString&)));
+ connect(m_fieldListView, TQT_SIGNAL(selectionChanged()), this, TQT_SLOT(slotFieldListViewSelectionChanged()));
+ connect(m_fieldListView, TQT_SIGNAL(fieldDoubleClicked(const TQString&, const TQString&, const TQString&)),
+ this, TQT_SLOT(slotFieldDoubleClicked(const TQString&, const TQString&, const TQString&)));
#endif
vlyr->addStretch(1);
- connect(m_dataSourceCombo, SIGNAL(textChanged(const QString &)), this, SLOT(slotDataSourceTextChanged(const QString &)));
- connect(m_dataSourceCombo, SIGNAL(dataSourceChanged()), this, SLOT(slotDataSourceChanged()));
- connect(m_sourceFieldCombo, SIGNAL(selected()), this, SLOT(slotFieldSelected()));
+ connect(m_dataSourceCombo, TQT_SIGNAL(textChanged(const TQString &)), this, TQT_SLOT(slotDataSourceTextChanged(const TQString &)));
+ connect(m_dataSourceCombo, TQT_SIGNAL(dataSourceChanged()), this, TQT_SLOT(slotDataSourceChanged()));
+ connect(m_sourceFieldCombo, TQT_SIGNAL(selected()), this, TQT_SLOT(slotFieldSelected()));
clearDataSourceSelection();
slotFieldListViewSelectionChanged();
@@ -235,7 +235,7 @@ void KexiDataSourcePage::clearWidgetDataSourceSelection()
{
if (!m_sourceFieldCombo->currentText().isEmpty()) {
m_sourceFieldCombo->setCurrentText("");
- m_sourceFieldCombo->setFieldOrExpression(QString::null);
+ m_sourceFieldCombo->setFieldOrExpression(TQString());
slotFieldSelected();
}
m_clearWidgetDSButton->setEnabled(false);
@@ -243,7 +243,7 @@ void KexiDataSourcePage::clearWidgetDataSourceSelection()
void KexiDataSourcePage::slotGotoSelected()
{
- QCString mime = m_dataSourceCombo->selectedMimeType().latin1();
+ TQCString mime = m_dataSourceCombo->selectedMimeType().latin1();
if (mime=="kexi/table" || mime=="kexi/query") {
if (m_dataSourceCombo->isSelectionValid())
emit jumpToObjectRequested(mime, m_dataSourceCombo->selectedName().latin1());
@@ -253,7 +253,7 @@ void KexiDataSourcePage::slotGotoSelected()
void KexiDataSourcePage::slotInsertSelectedFields()
{
#ifndef KEXI_NO_AUTOFIELD_WIDGET
- QStringList selectedFieldNames(m_fieldListView->selectedFieldNames());
+ TQStringList selectedFieldNames(m_fieldListView->selectedFieldNames());
if (selectedFieldNames.isEmpty())
return;
@@ -262,17 +262,17 @@ void KexiDataSourcePage::slotInsertSelectedFields()
#endif
}
-void KexiDataSourcePage::slotFieldDoubleClicked(const QString& sourceMimeType, const QString& sourceName,
- const QString& fieldName)
+void KexiDataSourcePage::slotFieldDoubleClicked(const TQString& sourceMimeType, const TQString& sourceName,
+ const TQString& fieldName)
{
#ifndef KEXI_NO_AUTOFIELD_WIDGET
- QStringList selectedFields;
+ TQStringList selectedFields;
selectedFields.append(fieldName);
emit insertAutoFields(sourceMimeType, sourceName, selectedFields);
#endif
}
-void KexiDataSourcePage::slotDataSourceTextChanged(const QString & string)
+void KexiDataSourcePage::slotDataSourceTextChanged(const TQString & string)
{
Q_UNUSED(string);
const bool enable = m_dataSourceCombo->isSelectionValid(); //!string.isEmpty() && m_dataSourceCombo->selectedName() == string.latin1();
@@ -291,9 +291,9 @@ void KexiDataSourcePage::slotDataSourceChanged()
{
if (!m_dataSourceCombo->project())
return;
- QCString mime = m_dataSourceCombo->selectedMimeType().latin1();
+ TQCString mime = m_dataSourceCombo->selectedMimeType().latin1();
bool dataSourceFound = false;
- QCString name = m_dataSourceCombo->selectedName().latin1();
+ TQCString name = m_dataSourceCombo->selectedName().latin1();
if ((mime=="kexi/table" || mime=="kexi/query") && m_dataSourceCombo->isSelectionValid()) {
KexiDB::TableOrQuerySchema *tableOrQuery = new KexiDB::TableOrQuerySchema(
m_dataSourceCombo->project()->dbConnection(), name, mime=="kexi/table");
@@ -349,34 +349,34 @@ void KexiDataSourcePage::slotFieldSelected()
);
}
-void KexiDataSourcePage::setDataSource(const QCString& mimeType, const QCString& name)
+void KexiDataSourcePage::setDataSource(const TQCString& mimeType, const TQCString& name)
{
m_dataSourceCombo->setDataSource(mimeType, name);
}
void KexiDataSourcePage::assignPropertySet(KoProperty::Set* propertySet)
{
- QCString objectName;
- if (propertySet && propertySet->contains("name"))
+ TQCString objectName;
+ if (propertySet && propertySet->tqcontains("name"))
objectName = (*propertySet)["name"].value().toCString();
if (!objectName.isEmpty() && objectName == m_currentObjectName)
return; //the same object
m_currentObjectName = objectName;
- QCString objectClassName;
- if (propertySet && propertySet->contains("this:className"))
+ TQCString objectClassName;
+ if (propertySet && propertySet->tqcontains("this:className"))
objectClassName = (*propertySet)["this:className"].value().toCString();
/*moved if (propertySet) {
- QCString iconName;
- QString objectClassString;
- if (propertySet->contains("this:iconName"))
+ TQCString iconName;
+ TQString objectClassString;
+ if (propertySet->tqcontains("this:iconName"))
iconName = (*propertySet)["this:iconName"].value().toCString();
- if (propertySet->contains("this:classString"))
+ if (propertySet->tqcontains("this:classString"))
objectClassString = (*propertySet)["this:classString"].value().toString();
m_objectInfoLabel->setObjectName(objectName);
m_objectInfoLabel->setObjectClassIcon(iconName);
m_objectInfoLabel->setObjectClassName(objectClassString);
- if (propertySet->contains("this:className"))
+ if (propertySet->tqcontains("this:className"))
objectClassName = (*propertySet)["this:className"].value().toCString();
}*/
KexiPropertyEditorView::updateInfoLabelForPropertySet(
@@ -386,7 +386,7 @@ void KexiDataSourcePage::assignPropertySet(KoProperty::Set* propertySet)
// kdDebug() << "objectClassName=" << objectClassName << endl;
// {
/* //this is top level form's surface: data source means table or query
- QCString dataSourceMimeType, dataSource;
+ TQCString dataSourceMimeType, dataSource;
if (buffer->hasProperty("dataSourceMimeType"))
dataSourceMimeType = (*buffer)["dataSourceMimeType"].value().toCString();
if (buffer->hasProperty("dataSource"))
@@ -396,16 +396,16 @@ void KexiDataSourcePage::assignPropertySet(KoProperty::Set* propertySet)
// else {
const bool multipleSelection = objectClassName=="special:multiple";
- const bool hasDataSourceProperty = propertySet && propertySet->contains("dataSource") && !multipleSelection;
+ const bool hasDataSourceProperty = propertySet && propertySet->tqcontains("dataSource") && !multipleSelection;
if (!isForm) {
//this is a widget
- QCString dataSource;
+ TQCString dataSource;
if (hasDataSourceProperty) {
if (propertySet)
dataSource = (*propertySet)["dataSource"].value().toCString();
m_noDataSourceAvailableLabel->hide();
- m_sourceFieldCombo->setFieldOrExpression(dataSource);
+ m_sourceFieldCombo->setFieldOrExpression(dataSource.data());
m_sourceFieldCombo->setEnabled(true);
m_clearWidgetDSButton->setEnabled(!m_sourceFieldCombo->currentText().isEmpty());
m_widgetDSLabel->show();
@@ -445,7 +445,7 @@ void KexiDataSourcePage::slotFieldListViewSelectionChanged()
{
#ifndef KEXI_NO_AUTOFIELD_WIDGET
//update "add field" button's state
- for (QListViewItemIterator it(m_fieldListView); it.current(); ++it) {
+ for (TQListViewItemIterator it(m_fieldListView); it.current(); ++it) {
if (it.current()->isSelected()) {
m_addField->setEnabled(true);
return;
diff --git a/kexi/plugins/forms/kexidatasourcepage.h b/kexi/plugins/forms/kexidatasourcepage.h
index 0f113aa7..914a869b 100644
--- a/kexi/plugins/forms/kexidatasourcepage.h
+++ b/kexi/plugins/forms/kexidatasourcepage.h
@@ -19,7 +19,7 @@
#ifndef KEXIDATASOURCEPAGE_H
#define KEXIDATASOURCEPAGE_H
-#include <qwidget.h>
+#include <tqwidget.h>
#include <kexidb/field.h>
#include <kexidb/utils.h>
#include <koproperty/set.h>
@@ -30,17 +30,18 @@ class KexiDataSourceComboBox;
class KexiFieldComboBox;
class KexiFieldListView;
class KexiProject;
-class QToolButton;
-class QLabel;
-class QFrame;
+class TQToolButton;
+class TQLabel;
+class TQFrame;
//! A page within form designer's property tabbed pane, providing data source editor
-class KEXIFORMUTILS_EXPORT KexiDataSourcePage : public QWidget
+class KEXIFORMUTILS_EXPORT KexiDataSourcePage : public TQWidget
{
Q_OBJECT
+ TQ_OBJECT
public:
- KexiDataSourcePage(QWidget *parent, const char *name = 0);
+ KexiDataSourcePage(TQWidget *tqparent, const char *name = 0);
virtual ~KexiDataSourcePage();
KexiDataSourceComboBox* dataSourceCombo() const { return m_dataSourceCombo; }
@@ -53,37 +54,37 @@ class KEXIFORMUTILS_EXPORT KexiDataSourcePage : public QWidget
//! Sets data source of a currently selected form.
//! This is performed on form initialization and on activating.
- void setDataSource(const QCString& mimeType, const QCString& name);
+ void setDataSource(const TQCString& mimeType, const TQCString& name);
//! Receives a pointer to a new property \a set (from KexiFormView::managerPropertyChanged())
void assignPropertySet(KoProperty::Set* propertySet);
signals:
//! Signal emitted when helper button 'go to selected data source' is clicked.
- void jumpToObjectRequested(const QCString& mime, const QCString& name);
+ void jumpToObjectRequested(const TQCString& mime, const TQCString& name);
//! Signal emitted when form's data source has been changed. It's connected to the Form Manager.
- void formDataSourceChanged(const QCString& mime, const QCString& name);
+ void formDataSourceChanged(const TQCString& mime, const TQCString& name);
/*! Signal emitted when current widget's data source (field/expression)
has been changed. It's connected to the Form Manager.
\a caption for this field is also provided (e.g. AutoField form widget use it) */
- void dataSourceFieldOrExpressionChanged(const QString& string, const QString& caption,
+ void dataSourceFieldOrExpressionChanged(const TQString& string, const TQString& caption,
KexiDB::Field::Type type);
/*! Signal emitted when 'insert fields' button has been clicked */
- void insertAutoFields(const QString& sourceMimeType, const QString& sourceName,
- const QStringList& fields);
+ void insertAutoFields(const TQString& sourceMimeType, const TQString& sourceName,
+ const TQStringList& fields);
protected slots:
- void slotDataSourceTextChanged(const QString & string);
+ void slotDataSourceTextChanged(const TQString & string);
void slotDataSourceChanged();
void slotFieldSelected();
void slotGotoSelected();
void slotInsertSelectedFields();
void slotFieldListViewSelectionChanged();
- void slotFieldDoubleClicked(const QString& sourceMimeType, const QString& sourceName,
- const QString& fieldName);
+ void slotFieldDoubleClicked(const TQString& sourceMimeType, const TQString& sourceName,
+ const TQString& fieldName);
protected:
void updateSourceFieldWidgetsAvailability();
@@ -91,12 +92,12 @@ class KEXIFORMUTILS_EXPORT KexiDataSourcePage : public QWidget
KexiFieldComboBox *m_sourceFieldCombo;
KexiObjectInfoLabel *m_objectInfoLabel;
KexiDataSourceComboBox* m_dataSourceCombo;
- QLabel *m_dataSourceLabel, *m_noDataSourceAvailableLabel,
+ TQLabel *m_dataSourceLabel, *m_noDataSourceAvailableLabel,
*m_widgetDSLabel, *m_availableFieldsLabel,
*m_mousePointerLabel, *m_availableFieldsDescriptionLabel;
- QToolButton *m_clearWidgetDSButton, *m_clearDSButton, *m_gotoButton, *m_addField;
- QFrame *m_dataSourceSeparator;
- QString m_noDataSourceAvailableSingleText, m_noDataSourceAvailableMultiText;
+ TQToolButton *m_clearWidgetDSButton, *m_clearDSButton, *m_gotoButton, *m_addField;
+ TQFrame *m_dataSourceSeparator;
+ TQString m_noDataSourceAvailableSingleText, m_noDataSourceAvailableMultiText;
bool m_insideClearDataSourceSelection : 1;
#ifdef KEXI_NO_AUTOFIELD_WIDGET
KexiDB::TableOrQuerySchema *m_tableOrQuerySchema; //!< temp.
@@ -105,8 +106,8 @@ class KEXIFORMUTILS_EXPORT KexiDataSourcePage : public QWidget
#endif
//! Used only in assignPropertySet() to check whether we already have the set assigned
- QCString m_currentObjectName;
- //QGuardedPtr<KoProperty::Set> m_propertySet;
+ TQCString m_currentObjectName;
+ //TQGuardedPtr<KoProperty::Set> m_propertySet;
};
#endif
diff --git a/kexi/plugins/forms/kexidbfactory.cpp b/kexi/plugins/forms/kexidbfactory.cpp
index 4ab05d76..5f379e6e 100644
--- a/kexi/plugins/forms/kexidbfactory.cpp
+++ b/kexi/plugins/forms/kexidbfactory.cpp
@@ -18,11 +18,11 @@
* Boston, MA 02110-1301, USA.
*/
-#include <qpopupmenu.h>
-#include <qscrollview.h>
-#include <qcursor.h>
-#include <qpainter.h>
-#include <qstyle.h>
+#include <tqpopupmenu.h>
+#include <tqscrollview.h>
+#include <tqcursor.h>
+#include <tqpainter.h>
+#include <tqstyle.h>
#include <kgenericfactory.h>
#include <klocale.h>
@@ -69,8 +69,8 @@
//////////////////////////////////////////
-KexiDBFactory::KexiDBFactory(QObject *parent, const char *name, const QStringList &)
- : KFormDesigner::WidgetFactory(parent, name)
+KexiDBFactory::KexiDBFactory(TQObject *tqparent, const char *name, const TQStringList &)
+ : KFormDesigner::WidgetFactory(tqparent, name)
{
KFormDesigner::WidgetInfo *wi;
wi = new KexiDataAwareWidgetInfo(this);
@@ -101,7 +101,7 @@ KexiDBFactory::KexiDBFactory(QObject *parent, const char *name, const QStringLis
wi = new KexiDataAwareWidgetInfo(this, "stdwidgets", "KLineEdit");
wi->setPixmap("lineedit");
wi->setClassName("KexiDBLineEdit");
- wi->addAlternateClassName("QLineEdit", true/*override*/);
+ wi->addAlternateClassName(TQLINEEDIT_OBJECT_NAME_STRING, true/*override*/);
wi->addAlternateClassName("KLineEdit", true/*override*/);
wi->setIncludeFileName("klineedit.h");
wi->setName(i18n("Text Box"));
@@ -115,7 +115,7 @@ KexiDBFactory::KexiDBFactory(QObject *parent, const char *name, const QStringLis
wi = new KexiDataAwareWidgetInfo(this, "stdwidgets", "KTextEdit");
wi->setPixmap("textedit");
wi->setClassName("KexiDBTextEdit");
- wi->addAlternateClassName("QTextEdit", true/*override*/);
+ wi->addAlternateClassName(TQTEXTEDIT_OBJECT_NAME_STRING, true/*override*/);
wi->addAlternateClassName("KTextEdit", true/*override*/);
wi->setIncludeFileName("ktextedit.h");
wi->setName(i18n("Text Editor"));
@@ -126,10 +126,10 @@ KexiDBFactory::KexiDBFactory(QObject *parent, const char *name, const QStringLis
addClass(wi);
wi = new KFormDesigner::WidgetInfo(
- this, "containers", "QFrame" /*we're inheriting to get i18n'd strings already translated there*/);
+ this, "containers", TQFRAME_OBJECT_NAME_STRING /*we're inheriting to get i18n'd strings already translated there*/);
wi->setPixmap("frame");
wi->setClassName("KexiFrame");
- wi->addAlternateClassName("QFrame", true/*override*/);
+ wi->addAlternateClassName(TQFRAME_OBJECT_NAME_STRING, true/*override*/);
wi->setName(i18n("Frame"));
wi->setNamePrefix(
i18n("Widget name. This string will be used to name widgets of this class. "
@@ -138,10 +138,10 @@ KexiDBFactory::KexiDBFactory(QObject *parent, const char *name, const QStringLis
addClass(wi);
wi = new KexiDataAwareWidgetInfo(
- this, "stdwidgets", "QLabel" /*we're inheriting to get i18n'd strings already translated there*/);
+ this, "stdwidgets", TQLABEL_OBJECT_NAME_STRING /*we're inheriting to get i18n'd strings already translated there*/);
wi->setPixmap("label");
wi->setClassName("KexiDBLabel");
- wi->addAlternateClassName("QLabel", true/*override*/);
+ wi->addAlternateClassName(TQLABEL_OBJECT_NAME_STRING, true/*override*/);
wi->addAlternateClassName("KexiLabel", true/*override*/); //older
wi->setName(i18n("Text Label", "Label"));
wi->setNamePrefix(
@@ -184,10 +184,10 @@ KexiDBFactory::KexiDBFactory(QObject *parent, const char *name, const QStringLis
addClass(wi);
#endif
- wi = new KexiDataAwareWidgetInfo(this, "stdwidgets", "QCheckBox");
+ wi = new KexiDataAwareWidgetInfo(this, "stdwidgets", TQCHECKBOX_OBJECT_NAME_STRING);
wi->setPixmap("check");
wi->setClassName("KexiDBCheckBox");
- wi->addAlternateClassName("QCheckBox", true/*override*/);
+ wi->addAlternateClassName(TQCHECKBOX_OBJECT_NAME_STRING, true/*override*/);
wi->setName(i18n("Check Box"));
wi->setNamePrefix(
i18n("Widget name. This string will be used to name widgets of this class. "
@@ -213,11 +213,11 @@ KexiDBFactory::KexiDBFactory(QObject *parent, const char *name, const QStringLis
#if KDE_VERSION >= KDE_MAKE_VERSION(3,1,9)
KexiDataAwareWidgetInfo *wDate = new KexiDataAwareWidgetInfo(this, "stdwidgets", "KDateWidget");
#else
- KexiDataAwareWidgetInfo *wDate = new KexiDataAwareWidgetInfo(this, "stdwidgets", "QDateEdit");
+ KexiDataAwareWidgetInfo *wDate = new KexiDataAwareWidgetInfo(this, "stdwidgets", TQDATEEDIT_OBJECT_NAME_STRING);
#endif
wDate->setPixmap("dateedit");
wDate->setClassName("KexiDBDateEdit");
- wDate->addAlternateClassName("QDateEdit", true);//override
+ wDate->addAlternateClassName(TQDATEEDIT_OBJECT_NAME_STRING, true);//override
wDate->addAlternateClassName("KDateWidget", true);//override
wDate->setName(i18n("Date Widget"));
wDate->setNamePrefix(
@@ -228,11 +228,11 @@ KexiDBFactory::KexiDBFactory(QObject *parent, const char *name, const QStringLis
#if KDE_VERSION >= KDE_MAKE_VERSION(3,1,9)
KexiDataAwareWidgetInfo *wTime = new KexiDataAwareWidgetInfo(this, "stdwidgets", "KTimeWidget");
#else
- KexiDataAwareWidgetInfo *wTime = new KexiDataAwareWidgetInfo(this, "stdwidgets", "QTimeEdit");
+ KexiDataAwareWidgetInfo *wTime = new KexiDataAwareWidgetInfo(this, "stdwidgets", TQTIMEEDIT_OBJECT_NAME_STRING);
#endif
wTime->setPixmap("timeedit");
wTime->setClassName("KexiDBTimeEdit");
- wTime->addAlternateClassName("QTimeEdit", true);//override
+ wTime->addAlternateClassName(TQTIMEEDIT_OBJECT_NAME_STRING, true);//override
wTime->addAlternateClassName("KTimeWidget", true);//override
wTime->setName(i18n("Time Widget"));
wTime->setNamePrefix(
@@ -247,7 +247,7 @@ KexiDBFactory::KexiDBFactory(QObject *parent, const char *name, const QStringLis
#endif
wDateTime->setPixmap("datetimeedit");
wDateTime->setClassName("KexiDBDateTimeEdit");
- wDateTime->addAlternateClassName("QDateTimeEdit", true);//override
+ wDateTime->addAlternateClassName(TQDATETIMEEDIT_OBJECT_NAME_STRING, true);//override
wDateTime->addAlternateClassName("KDateTimeWidget", true);//override
wDateTime->setName(i18n("Date/Time Widget"));
wDateTime->setNamePrefix(
@@ -259,7 +259,7 @@ KexiDBFactory::KexiDBFactory(QObject *parent, const char *name, const QStringLis
/* KexiDataAwareWidgetInfo *wIntSpinBox = new KexiDataAwareWidgetInfo(this, "stdwidgets", "KIntSpinBox");
wIntSpinBox->setPixmap("spin");
wIntSpinBox->setClassName("KexiDBIntSpinBox");
- wIntSpinBox->addAlternateClassName("QSpinBox", true);
+ wIntSpinBox->addAlternateClassName(TQSPINBOX_OBJECT_NAME_STRING, true);
wIntSpinBox->addAlternateClassName("KIntSpinBox", true);
wIntSpinBox->setName(i18n("Integer Number Spin Box"));
wIntSpinBox->setNamePrefix(
@@ -350,14 +350,14 @@ KexiDBFactory::~KexiDBFactory()
{
}
-QWidget*
-KexiDBFactory::createWidget(const QCString &c, QWidget *p, const char *n,
+TQWidget*
+KexiDBFactory::createWidget(const TQCString &c, TQWidget *p, const char *n,
KFormDesigner::Container *container, int options)
{
kexipluginsdbg << "KexiDBFactory::createWidget() " << this << endl;
- QWidget *w=0;
- QString text( container->form()->library()->textForWidgetName(n, c) );
+ TQWidget *w=0;
+ TQString text( container->form()->library()->textForWidgetName(n, c) );
const bool designMode = options & KFormDesigner::WidgetFactory::DesignViewMode;
if(c == "KexiDBSubForm")
@@ -366,15 +366,15 @@ KexiDBFactory::createWidget(const QCString &c, QWidget *p, const char *n,
{
w = new KexiDBLineEdit(p, n);
if (designMode)
- w->setCursor(QCursor(Qt::ArrowCursor));
+ w->setCursor(TQCursor(TQt::ArrowCursor));
}
else if(c == "KexiDBTextEdit")
{
w = new KexiDBTextEdit(p, n);
if (designMode)
- w->setCursor(QCursor(Qt::ArrowCursor));
+ w->setCursor(TQCursor(TQt::ArrowCursor));
}
- else if(c == "QFrame" || c == "KexiFrame")
+ else if(c == TQFRAME_OBJECT_NAME_STRING || c == "KexiFrame")
{
w = new KexiFrame(p, n);
new KFormDesigner::Container(container, w, container);
@@ -384,7 +384,7 @@ KexiDBFactory::createWidget(const QCString &c, QWidget *p, const char *n,
#ifndef KEXI_NO_IMAGEBOX_WIDGET
else if(c == "KexiDBImageBox") {
w = new KexiDBImageBox(designMode, p, n);
- connect(w, SIGNAL(idChanged(long)), this, SLOT(slotImageBoxIdChanged(long)));
+ connect(w, TQT_SIGNAL(idChanged(long)), this, TQT_SLOT(slotImageBoxIdChanged(long)));
}
#endif
#ifndef KEXI_NO_AUTOFIELD_WIDGET
@@ -396,11 +396,11 @@ KexiDBFactory::createWidget(const QCString &c, QWidget *p, const char *n,
else if(c == "KexiDBComboBox")
w = new KexiDBComboBox(p, n, designMode);
/* else if(c == "KexiDBTimeEdit")
- w = new KexiDBTimeEdit(QTime::currentTime(), p, n);
+ w = new KexiDBTimeEdit(TQTime::currentTime(), p, n);
else if(c == "KexiDBDateEdit")
- w = new KexiDBDateEdit(QDate::currentDate(), p, n);
+ w = new KexiDBDateEdit(TQDate::tqcurrentDate(), p, n);
else if(c == "KexiDBDateTimeEdit")
- w = new KexiDBDateTimeEdit(QDateTime::currentDateTime(), p, n);*/
+ w = new KexiDBDateTimeEdit(TQDateTime::tqcurrentDateTime(), p, n);*/
// else if(c == "KexiDBIntSpinBox")
// w = new KexiDBIntSpinBox(p, n);
// else if(c == "KexiDBDoubleSpinBox")
@@ -412,10 +412,10 @@ KexiDBFactory::createWidget(const QCString &c, QWidget *p, const char *n,
}
bool
-KexiDBFactory::createMenuActions(const QCString &classname, QWidget *w, QPopupMenu *menu,
+KexiDBFactory::createMenuActions(const TQCString &classname, TQWidget *w, TQPopupMenu *menu,
KFormDesigner::Container *)
{
- if(classname == "QPushButton" || classname == "KPushButton" || classname == "KexiPushButton")
+ if(classname == TQPUSHBUTTON_OBJECT_NAME_STRING || classname == "KPushButton" || classname == "KexiPushButton")
{
/*! @todo also call createMenuActions() for inherited factory! */
m_assignAction->plug( menu );
@@ -453,7 +453,7 @@ KexiDBFactory::createCustomActions(KActionCollection* col)
}
bool
-KexiDBFactory::startEditing(const QCString &classname, QWidget *w, KFormDesigner::Container *container)
+KexiDBFactory::startEditing(const TQCString &classname, TQWidget *w, KFormDesigner::Container *container)
{
m_container = container;
if(classname == "KexiDBLineEdit")
@@ -462,7 +462,7 @@ KexiDBFactory::startEditing(const QCString &classname, QWidget *w, KFormDesigner
//! just inherited StdWidgetFactory::clearWidgetContent() should be called
KLineEdit *lineedit = static_cast<KLineEdit*>(w);
createEditor(classname, lineedit->text(), lineedit, container,
- lineedit->geometry(), lineedit->alignment(), true);
+ lineedit->tqgeometry(), lineedit->tqalignment(), true);
return true;
}
if(classname == "KexiDBTextEdit")
@@ -471,7 +471,7 @@ KexiDBFactory::startEditing(const QCString &classname, QWidget *w, KFormDesigner
//! just inherited StdWidgetFactory::clearWidgetContent() should be called
KTextEdit *textedit = static_cast<KTextEdit*>(w);
createEditor(classname, textedit->text(), textedit, container,
- textedit->geometry(), textedit->alignment(), true, true);
+ textedit->tqgeometry(), textedit->tqalignment(), true, true);
//copy a few properties
KTextEdit *ed = dynamic_cast<KTextEdit *>( editor(w) );
ed->setWrapPolicy(textedit->wrapPolicy());
@@ -489,7 +489,7 @@ KexiDBFactory::startEditing(const QCString &classname, QWidget *w, KFormDesigner
m_widget = w;
if(label->textFormat() == RichText)
{
- QString text = label->text();
+ TQString text = label->text();
if ( editRichText( label, text ) )
{
changeProperty( "textFormat", "RichText", container->form() );
@@ -497,13 +497,13 @@ KexiDBFactory::startEditing(const QCString &classname, QWidget *w, KFormDesigner
}
if ( classname == "KexiDBLabel" )
- w->resize(w->sizeHint());
+ w->resize(w->tqsizeHint());
}
else
{
createEditor(classname, label->text(), label, container,
- label->geometry(), label->alignment(),
- false, label->alignment() & Qt::WordBreak /*multiline*/);
+ label->tqgeometry(), label->tqalignment(),
+ false, label->tqalignment() & TQt::WordBreak /*multiline*/);
}
return true;
}
@@ -528,15 +528,15 @@ KexiDBFactory::startEditing(const QCString &classname, QWidget *w, KFormDesigner
else if(classname == "KexiDBAutoField") {
if(static_cast<KexiDBAutoField*>(w)->hasAutoCaption())
return false; // caption is auto, abort editing
- QLabel *label = static_cast<KexiDBAutoField*>(w)->label();
- createEditor(classname, label->text(), label, container, label->geometry(), label->alignment());
+ TQLabel *label = static_cast<KexiDBAutoField*>(w)->label();
+ createEditor(classname, label->text(), label, container, label->tqgeometry(), label->tqalignment());
return true;
}
else if (classname == "KexiDBCheckBox") {
KexiDBCheckBox *cb = static_cast<KexiDBCheckBox*>(w);
- QRect r( cb->geometry() );
- r.setLeft( r.left() + 2 + cb->style().subRect( QStyle::SR_CheckBoxIndicator, cb ).width() );
- createEditor(classname, cb->text(), cb, container, r, Qt::AlignAuto);
+ TQRect r( cb->tqgeometry() );
+ r.setLeft( r.left() + 2 + cb->tqstyle().subRect( TQStyle::SR_CheckBoxIndicator, cb ).width() );
+ createEditor(classname, cb->text(), cb, container, r, TQt::AlignAuto);
return true;
}
else if(classname == "KexiDBImageBox") {
@@ -548,13 +548,13 @@ KexiDBFactory::startEditing(const QCString &classname, QWidget *w, KFormDesigner
}
bool
-KexiDBFactory::previewWidget(const QCString &, QWidget *, KFormDesigner::Container *)
+KexiDBFactory::previewWidget(const TQCString &, TQWidget *, KFormDesigner::Container *)
{
return false;
}
bool
-KexiDBFactory::clearWidgetContent(const QCString & /*classname*/, QWidget *w)
+KexiDBFactory::clearWidgetContent(const TQCString & /*classname*/, TQWidget *w)
{
//! @todo this code should not be copied here but
//! just inherited StdWidgetFactory::clearWidgetContent() should be called
@@ -564,10 +564,10 @@ KexiDBFactory::clearWidgetContent(const QCString & /*classname*/, QWidget *w)
return true;
}
-QValueList<QCString>
-KexiDBFactory::autoSaveProperties(const QCString & /*classname*/)
+TQValueList<TQCString>
+KexiDBFactory::autoSaveProperties(const TQCString & /*classname*/)
{
- QValueList<QCString> lst;
+ TQValueList<TQCString> lst;
// if(classname == "KexiDBSubForm")
//lst << "formName";
// if(classname == "KexiDBLineEdit")
@@ -578,8 +578,8 @@ KexiDBFactory::autoSaveProperties(const QCString & /*classname*/)
}
bool
-KexiDBFactory::isPropertyVisibleInternal(const QCString& classname, QWidget *w,
- const QCString& property, bool isTopLevel)
+KexiDBFactory::isPropertyVisibleInternal(const TQCString& classname, TQWidget *w,
+ const TQCString& property, bool isTopLevel)
{
//general
if (property=="dataSource" || property=="dataSourceMimeType") {
@@ -646,7 +646,7 @@ KexiDBFactory::isPropertyVisibleInternal(const QCString& classname, QWidget *w,
}
else if(classname == "KexiDBCheckBox") {
//hide text property if the widget is a child of an autofield beause there's already "caption" for this purpose
- if (property=="text" && w && dynamic_cast<KFormDesigner::WidgetWithSubpropertiesInterface*>(w->parentWidget()))
+ if (property=="text" && w && dynamic_cast<KFormDesigner::WidgetWithSubpropertiesInterface*>(w->tqparentWidget()))
return false;
ok = property!="autoRepeat";
}
@@ -655,8 +655,8 @@ KexiDBFactory::isPropertyVisibleInternal(const QCString& classname, QWidget *w,
}
bool
-KexiDBFactory::propertySetShouldBeReloadedAfterPropertyChange(const QCString& classname,
- QWidget *w, const QCString& property)
+KexiDBFactory::propertySetShouldBeReloadedAfterPropertyChange(const TQCString& classname,
+ TQWidget *w, const TQCString& property)
{
Q_UNUSED(classname);
Q_UNUSED(w);
@@ -666,41 +666,41 @@ KexiDBFactory::propertySetShouldBeReloadedAfterPropertyChange(const QCString& cl
}
bool
-KexiDBFactory::changeText(const QString &text)
+KexiDBFactory::changeText(const TQString &text)
{
KFormDesigner::Form *form = m_container ? m_container->form() : 0;
if (!form)
return false;
if (!form->selectedWidget())
return false;
- QCString n( form->selectedWidget()->className() );
-// QWidget *w = WidgetFactory::widget();
+ TQCString n( form->selectedWidget()->className() );
+// TQWidget *w = WidgetFactory::widget();
if(n == "KexiDBAutoField") {
changeProperty("caption", text, form);
return true;
}
- //! \todo check field's geometry
+ //! \todo check field's tqgeometry
return false;
}
void
-KexiDBFactory::resizeEditor(QWidget *editor, QWidget *w, const QCString &classname)
+KexiDBFactory::resizeEditor(TQWidget *editor, TQWidget *w, const TQCString &classname)
{
- //QSize s = widget->size();
- //QPoint p = widget->pos();
+ //TQSize s = widget->size();
+ //TQPoint p = widget->pos();
if(classname == "KexiDBAutoField")
- editor->setGeometry( static_cast<KexiDBAutoField*>(w)->label()->geometry() );
+ editor->setGeometry( static_cast<KexiDBAutoField*>(w)->label()->tqgeometry() );
}
void
KexiDBFactory::slotImageBoxIdChanged(KexiBLOBBuffer::Id_t id)
{
-//old KexiFormView *formView = KexiUtils::findParent<KexiFormView>((QWidget*)m_widget, "KexiFormView");
+//old KexiFormView *formView = KexiUtils::findParent<KexiFormView>((TQWidget*)m_widget, "KexiFormView");
// (js) heh, porting to KFormDesigner::FormManager::self() singleton took me entire day of work...
KFormDesigner::Form *form = KFormDesigner::FormManager::self()->activeForm();
- KexiFormView *formView = form ? KexiUtils::findParent<KexiFormView>((QWidget*)form->widget(), "KexiFormView") : 0;
+ KexiFormView *formView = form ? KexiUtils::findParent<KexiFormView>((TQWidget*)form->widget(), "KexiFormView") : 0;
if (formView) {
changeProperty("pixmapId", (uint)/*! @todo unsafe */id, form);
//old formView->setUnsavedLocalBLOB(m_widget, id);
diff --git a/kexi/plugins/forms/kexidbfactory.h b/kexi/plugins/forms/kexidbfactory.h
index 6064a001..f15f8c39 100644
--- a/kexi/plugins/forms/kexidbfactory.h
+++ b/kexi/plugins/forms/kexidbfactory.h
@@ -34,39 +34,40 @@ namespace KFormDesigner {
class KexiDBFactory : public KFormDesigner::WidgetFactory
{
Q_OBJECT
+ TQ_OBJECT
public:
- KexiDBFactory(QObject *parent, const char *name, const QStringList &args);
+ KexiDBFactory(TQObject *tqparent, const char *name, const TQStringList &args);
virtual ~KexiDBFactory();
- virtual QWidget *createWidget(const QCString &classname, QWidget *parent, const char *name,
+ virtual TQWidget *createWidget(const TQCString &classname, TQWidget *tqparent, const char *name,
KFormDesigner::Container *container, int options = DefaultOptions );
virtual void createCustomActions(KActionCollection* col);
- virtual bool createMenuActions(const QCString &classname, QWidget *w, QPopupMenu *menu,
+ virtual bool createMenuActions(const TQCString &classname, TQWidget *w, TQPopupMenu *menu,
KFormDesigner::Container *container);
- virtual bool startEditing(const QCString &classname, QWidget *w, KFormDesigner::Container *container);
- virtual bool previewWidget(const QCString &, QWidget *, KFormDesigner::Container *);
- virtual bool clearWidgetContent(const QCString &classname, QWidget *w);
+ virtual bool startEditing(const TQCString &classname, TQWidget *w, KFormDesigner::Container *container);
+ virtual bool previewWidget(const TQCString &, TQWidget *, KFormDesigner::Container *);
+ virtual bool clearWidgetContent(const TQCString &classname, TQWidget *w);
- //virtual void saveSpecialProperty(const QString &classname, const QString &name, const QVariant &value, QWidget *w,
- //QDomElement &parentNode, QDomDocument &parent) {}
- //virtual void readSpecialProperty(const QCString &classname, QDomElement &node, QWidget *w, KFormDesigner::ObjectTreeItem *item) {}
- virtual QValueList<QCString> autoSaveProperties(const QCString &classname);
+ //virtual void saveSpecialProperty(const TQString &classname, const TQString &name, const TQVariant &value, TQWidget *w,
+ //TQDomElement &tqparentNode, TQDomDocument &tqparent) {}
+ //virtual void readSpecialProperty(const TQCString &classname, TQDomElement &node, TQWidget *w, KFormDesigner::ObjectTreeItem *item) {}
+ virtual TQValueList<TQCString> autoSaveProperties(const TQCString &classname);
protected slots:
void slotImageBoxIdChanged(long id); /*KexiBLOBBuffer::Id_t*/
protected:
- virtual bool changeText(const QString &newText);
- virtual void resizeEditor(QWidget *editor, QWidget *widget, const QCString &classname);
+ virtual bool changeText(const TQString &newText);
+ virtual void resizeEditor(TQWidget *editor, TQWidget *widget, const TQCString &classname);
- virtual bool isPropertyVisibleInternal(const QCString& classname, QWidget *w,
- const QCString& property, bool isTopLevel);
+ virtual bool isPropertyVisibleInternal(const TQCString& classname, TQWidget *w,
+ const TQCString& property, bool isTopLevel);
//! Sometimes property sets should be reloaded when a given property value changed.
- virtual bool propertySetShouldBeReloadedAfterPropertyChange(const QCString& classname, QWidget *w,
- const QCString& property);
+ virtual bool propertySetShouldBeReloadedAfterPropertyChange(const TQCString& classname, TQWidget *w,
+ const TQCString& property);
KAction* m_assignAction;
};
diff --git a/kexi/plugins/forms/kexidbtextwidgetinterface.cpp b/kexi/plugins/forms/kexidbtextwidgetinterface.cpp
index 47eabe9d..3c20510e 100644
--- a/kexi/plugins/forms/kexidbtextwidgetinterface.cpp
+++ b/kexi/plugins/forms/kexidbtextwidgetinterface.cpp
@@ -21,8 +21,8 @@
#include "kexiformdataiteminterface.h"
#include <kexidb/queryschema.h>
#include <kexiutils/utils.h>
-#include <qframe.h>
-#include <qpainter.h>
+#include <tqframe.h>
+#include <tqpainter.h>
KexiDBTextWidgetInterface::KexiDBTextWidgetInterface()
: m_autonumberDisplayParameters(0)
@@ -34,7 +34,7 @@ KexiDBTextWidgetInterface::~KexiDBTextWidgetInterface()
delete m_autonumberDisplayParameters;
}
-void KexiDBTextWidgetInterface::setColumnInfo(KexiDB::QueryColumnInfo* cinfo, QWidget *w)
+void KexiDBTextWidgetInterface::setColumnInfo(KexiDB::QueryColumnInfo* cinfo, TQWidget *w)
{
if (cinfo->field->isAutoIncrement()) {
if (!m_autonumberDisplayParameters)
@@ -43,7 +43,7 @@ void KexiDBTextWidgetInterface::setColumnInfo(KexiDB::QueryColumnInfo* cinfo, QW
}
}
-void KexiDBTextWidgetInterface::paint( QFrame *w, QPainter* p, bool textIsEmpty, int alignment, bool hasFocus )
+void KexiDBTextWidgetInterface::paint( TQFrame *w, TQPainter* p, bool textIsEmpty, int tqalignment, bool hasFocus )
{
KexiFormDataItemInterface *dataItemIface = dynamic_cast<KexiFormDataItemInterface*>(w);
KexiDB::QueryColumnInfo *columnInfo = dataItemIface ? dataItemIface->columnInfo() : 0;
@@ -53,19 +53,19 @@ void KexiDBTextWidgetInterface::paint( QFrame *w, QPainter* p, bool textIsEmpty,
if (w->hasFocus()) {
p->setPen(
KexiUtils::blendedColors(
- m_autonumberDisplayParameters->textColor, w->palette().active().base(), 1, 3));
+ m_autonumberDisplayParameters->textColor, w->tqpalette().active().base(), 1, 3));
}
KexiDisplayUtils::paintAutonumberSign(*m_autonumberDisplayParameters, p,
2 + margin + w->margin(), margin, w->width() - margin*2 -2-2,
- w->height() - margin*2 -2, alignment, hasFocus);
+ w->height() - margin*2 -2, tqalignment, hasFocus);
}
}
}
-void KexiDBTextWidgetInterface::event( QEvent * e, QWidget *w, bool textIsEmpty )
+void KexiDBTextWidgetInterface::event( TQEvent * e, TQWidget *w, bool textIsEmpty )
{
- if (e->type()==QEvent::FocusIn || e->type()==QEvent::FocusOut) {
+ if (e->type()==TQEvent::FocusIn || e->type()==TQEvent::FocusOut) {
if (m_autonumberDisplayParameters && textIsEmpty)
- w->repaint();
+ w->tqrepaint();
}
}
diff --git a/kexi/plugins/forms/kexidbtextwidgetinterface.h b/kexi/plugins/forms/kexidbtextwidgetinterface.h
index ca10fc4e..6e0299c0 100644
--- a/kexi/plugins/forms/kexidbtextwidgetinterface.h
+++ b/kexi/plugins/forms/kexidbtextwidgetinterface.h
@@ -25,7 +25,7 @@
namespace KexiDB {
class QueryColumnInfo;
}
-class QFrame;
+class TQFrame;
//! @short An interface providing common text editor's functionality
/*! Widgets (e.g. KexiDBLineEdit, KexiDBTextEdit) implementing KexiFormDataItemInterface
@@ -37,13 +37,13 @@ class KEXIFORMUTILS_EXPORT KexiDBTextWidgetInterface
~KexiDBTextWidgetInterface();
//! Called from KexiFormDataItemInterface::setColumnInfo(KexiDB::QueryColumnInfo* cinfo) implementation.
- void setColumnInfo(KexiDB::QueryColumnInfo* cinfo, QWidget *w);
+ void setColumnInfo(KexiDB::QueryColumnInfo* cinfo, TQWidget *w);
- //! Called from paintEvent( QPaintEvent *pe ) method of the data aware widget.
- void paint( QFrame *w, QPainter *p, bool textIsEmpty, int alignment, bool hasFocus );
+ //! Called from paintEvent( TQPaintEvent *pe ) method of the data aware widget.
+ void paint( TQFrame *w, TQPainter *p, bool textIsEmpty, int tqalignment, bool hasFocus );
- //! Called from event( QEvent * e ) method of the data aware widget.
- void event( QEvent * e, QWidget *w, bool textIsEmpty );
+ //! Called from event( TQEvent * e ) method of the data aware widget.
+ void event( TQEvent * e, TQWidget *w, bool textIsEmpty );
protected:
//! parameters for displaying autonumber sign
diff --git a/kexi/plugins/forms/kexiformdataiteminterface.cpp b/kexi/plugins/forms/kexiformdataiteminterface.cpp
index c87a2dab..9a861917 100644
--- a/kexi/plugins/forms/kexiformdataiteminterface.cpp
+++ b/kexi/plugins/forms/kexiformdataiteminterface.cpp
@@ -40,7 +40,7 @@ KexiFormDataItemInterface::~KexiFormDataItemInterface()
void KexiFormDataItemInterface::undoChanges()
{
// m_disable_signalValueChanged = true;
- setValueInternal(QString::null, false);
+ setValueInternal(TQString(), false);
// m_disable_signalValueChanged = false;
}
@@ -49,7 +49,7 @@ KexiDB::Field* KexiFormDataItemInterface::field() const
return m_columnInfo ? m_columnInfo->field : 0;
}
-void KexiFormDataItemInterface::setDisplayDefaultValue(QWidget* widget, bool displayDefaultValue)
+void KexiFormDataItemInterface::setDisplayDefaultValue(TQWidget* widget, bool displayDefaultValue)
{
m_displayDefaultValue = displayDefaultValue;
if (!m_displayParametersForDefaultValue) {
@@ -61,8 +61,8 @@ void KexiFormDataItemInterface::setDisplayDefaultValue(QWidget* widget, bool dis
void KexiFormDataItemInterface::cancelEditor()
{
- QWidget *parentWidget = dynamic_cast<QWidget*>(this)->parentWidget();
- KexiFormScrollView* view = KexiUtils::findParent<KexiFormScrollView>(parentWidget, "KexiFormScrollView");
+ TQWidget *tqparentWidget = dynamic_cast<TQWidget*>(this)->tqparentWidget();
+ KexiFormScrollView* view = KexiUtils::findParent<KexiFormScrollView>(tqparentWidget, "KexiFormScrollView");
if (view)
view->cancelEditor();
}
diff --git a/kexi/plugins/forms/kexiformdataiteminterface.h b/kexi/plugins/forms/kexiformdataiteminterface.h
index 99d20db4..1cb7a11f 100644
--- a/kexi/plugins/forms/kexiformdataiteminterface.h
+++ b/kexi/plugins/forms/kexiformdataiteminterface.h
@@ -22,7 +22,7 @@
#include <widget/utils/kexidisplayutils.h>
#include <kexidataiteminterface.h>
-#include <qwidget.h>
+#include <tqwidget.h>
namespace KexiDB {
class Field;
@@ -37,22 +37,22 @@ class KEXIFORMUTILS_EXPORT KexiFormDataItemInterface : public KexiDataItemInterf
//! \return the name of the data source for this widget.
//! Data source usually means here a table or query, a field name or an expression.
- inline QString dataSource() const { return m_dataSource; }
+ inline TQString dataSource() const { return m_dataSource; }
//! Sets the name of the data source for this widget.
//! Data source usually means here a table or query or field name name.
- inline void setDataSource(const QString &ds) { m_dataSource = ds; }
+ inline void setDataSource(const TQString &ds) { m_dataSource = ds; }
/*! \return the mime type of the data source for this widget.
Data source mime type means here types like "kexi/table" or "kexi/query"
in.the data source is set to object (as within form or subform) or is empty
if the data source is set to table field or query column. */
- inline QCString dataSourceMimeType() const { return m_dataSourceMimeType; }
+ inline TQCString dataSourceMimeType() const { return m_dataSourceMimeType; }
/*! Sets the mime type of the data source for this widget.
Data source usually means here a "kexi/table" or "kexi/query".
@see dataSourceMimeType() */
- inline void setDataSourceMimeType(const QCString &ds) { m_dataSourceMimeType = ds; }
+ inline void setDataSourceMimeType(const TQCString &ds) { m_dataSourceMimeType = ds; }
/*! If \a displayDefaultValue is true, the value set by KexiDataItemInterface::setValue()
is displayed in a special way. Used by KexiFormDataProvider::fillDataItems().
@@ -60,14 +60,14 @@ class KEXIFORMUTILS_EXPORT KexiFormDataItemInterface : public KexiDataItemInterf
You can reimplement this in the widget. Always call the superclass' implementation.
setDisplayDefaultValue(.., false) is called in KexiFormScrollView::valueChanged()
as a response on data change performed by user. */
- virtual void setDisplayDefaultValue(QWidget* widget, bool displayDefaultValue);
+ virtual void setDisplayDefaultValue(TQWidget* widget, bool displayDefaultValue);
/*! \return true if default value is displayed for this item. */
virtual bool hasDisplayedDefaultValue() const { return m_displayDefaultValue; }
- /*! Convenience function: casts this item to a QWidget.
- Can return 0 if the item is not a QWidget-derived object. */
- virtual QWidget* widget() { return dynamic_cast<QWidget*>(this); }
+ /*! Convenience function: casts this item to a TQWidget.
+ Can return 0 if the item is not a TQWidget-derived object. */
+ virtual TQWidget* widget() { return dynamic_cast<TQWidget*>(this); }
/*! Sets 'invalid' state, e.g. a text editor widget should display
text \a displayText and become read only to prevent entering data,
@@ -76,7 +76,7 @@ class KEXIFORMUTILS_EXPORT KexiFormDataItemInterface : public KexiDataItemInterf
Note: that even widgets that usualy do not display texts (e.g. pixmaps)
should display \a displayText too.
*/
- virtual void setInvalidState( const QString& displayText ) = 0;
+ virtual void setInvalidState( const TQString& displayText ) = 0;
/*! Changes 'read only' flag, for this widget.
Typically this flag can be passed to a widget itself,
@@ -118,7 +118,7 @@ class KEXIFORMUTILS_EXPORT KexiFormDataItemInterface : public KexiDataItemInterf
virtual void undoChanges();
/* Cancels editing of the widget's data. This method just looks for
- the (grand)parent KexiFormScrollView object and calls
+ the (grand)tqparent KexiFormScrollView object and calls
KexiFormScrollView::cancelEditor(). */
void cancelEditor();
@@ -129,11 +129,11 @@ class KEXIFORMUTILS_EXPORT KexiFormDataItemInterface : public KexiDataItemInterf
\return true if \a ke should be accepted by the widget item.
This method is used e.g. in KexiDBImageBox for Key_Escape to if the popup is visible,
so the key press won't be consumed to perform "cancel editing". */
- virtual bool keyPressed(QKeyEvent *ke) { Q_UNUSED(ke); return false; };
+ virtual bool keyPressed(TQKeyEvent *ke) { Q_UNUSED(ke); return false; };
protected:
- QString m_dataSource;
- QCString m_dataSourceMimeType;
+ TQString m_dataSource;
+ TQCString m_dataSourceMimeType;
KexiDB::QueryColumnInfo* m_columnInfo;
KexiDisplayUtils::DisplayParameters *m_displayParametersForEnteredValue; //!< used in setDisplayDefaultValue()
KexiDisplayUtils::DisplayParameters *m_displayParametersForDefaultValue; //!< used in setDisplayDefaultValue()
diff --git a/kexi/plugins/forms/kexiformeventhandler.cpp b/kexi/plugins/forms/kexiformeventhandler.cpp
index 01bca201..de2d8570 100644
--- a/kexi/plugins/forms/kexiformeventhandler.cpp
+++ b/kexi/plugins/forms/kexiformeventhandler.cpp
@@ -19,8 +19,8 @@
#include "kexiformeventhandler.h"
-#include <qwidget.h>
-#include <qobjectlist.h>
+#include <tqwidget.h>
+#include <tqobjectlist.h>
#include <kdebug.h>
#include <klocale.h>
@@ -44,19 +44,19 @@ bool KexiFormEventAction::ActionData::isEmpty() const
}
KexiPart::Info* KexiFormEventAction::ActionData::decodeString(
- QString& actionType, QString& actionArg, bool& ok) const
+ TQString& actionType, TQString& actionArg, bool& ok) const
{
- const int idx = string.find(':');
+ const int idx = string.tqfind(':');
ok = false;
if (idx==-1)
return 0;
- const QString _actionType = string.left(idx);
- const QString _actionArg = string.mid(idx+1);
+ const TQString _actionType = string.left(idx);
+ const TQString _actionArg = string.mid(idx+1);
if (_actionType.isEmpty() || _actionArg.isEmpty())
return 0;
KexiPart::Info *info = 0;
if (_actionType!="kaction" && _actionType!="currentForm") {
- info = Kexi::partManager().infoForMimeType( QString("kexi/%1").arg(_actionType) );
+ info = Kexi::partManager().infoForMimeType( TQString("kexi/%1").tqarg(_actionType) );
if (!info)
return 0;
}
@@ -68,9 +68,9 @@ KexiPart::Info* KexiFormEventAction::ActionData::decodeString(
//-------------------------------------
-KexiFormEventAction::KexiFormEventAction(KexiMainWindow *mainWin, QObject* parent,
- const QString& actionName, const QString& objectName, const QString& actionOption)
- : KAction(parent), m_mainWin(mainWin), m_actionName(actionName), m_objectName(objectName)
+KexiFormEventAction::KexiFormEventAction(KexiMainWindow *mainWin, TQObject* tqparent,
+ const TQString& actionName, const TQString& objectName, const TQString& actionOption)
+ : KAction(tqparent), m_mainWin(mainWin), m_actionName(actionName), m_objectName(objectName)
, m_actionOption(actionOption)
{
}
@@ -85,7 +85,7 @@ void KexiFormEventAction::activate()
if (!project)
return;
KexiPart::Part* part = Kexi::partManager().partForMimeType(
- QString("kexi/%1").arg(m_actionName) );
+ TQString("kexi/%1").tqarg(m_actionName) );
if (!part)
return;
KexiPart::Item* item = project->item( part->info(), m_objectName );
@@ -94,7 +94,7 @@ void KexiFormEventAction::activate()
bool actionCancelled = false;
if (m_actionOption.isEmpty()) { // backward compatibility (good defaults)
if (part->info()->isExecuteSupported())
- part->execute(item, parent());
+ part->execute(item, tqparent());
else
m_mainWin->openObject(item, Kexi::DataViewMode, actionCancelled);
}
@@ -103,7 +103,7 @@ void KexiFormEventAction::activate()
if (m_actionOption == "open")
m_mainWin->openObject(item, Kexi::DataViewMode, actionCancelled);
else if (m_actionOption == "execute")
- part->execute(item, parent());
+ part->execute(item, tqparent());
else if (m_actionOption == "print") {
if (part->info()->isPrintingSupported())
m_mainWin->printItem(item);
@@ -147,7 +147,7 @@ KexiFormEventHandler::~KexiFormEventHandler()
{
}
-void KexiFormEventHandler::setMainWidgetForEventHandling(KexiMainWindow *mainWin, QWidget* mainWidget)
+void KexiFormEventHandler::setMainWidgetForEventHandling(KexiMainWindow *mainWin, TQWidget* mainWidget)
{
m_mainWidget = mainWidget;
if (!m_mainWidget)
@@ -155,9 +155,9 @@ void KexiFormEventHandler::setMainWidgetForEventHandling(KexiMainWindow *mainWin
//find widgets whose will work as data items
//! @todo look for other widgets too
- QObjectList *l = m_mainWidget->queryList( "KexiPushButton" );
- QObjectListIt it( *l );
- QObject *obj;
+ TQObjectList *l = m_mainWidget->queryList( "KexiPushButton" );
+ TQObjectListIt it( *l );
+ TQObject *obj;
for ( ; (obj = it.current()) != 0; ++it ) {
bool ok;
KexiFormEventAction::ActionData data;
@@ -166,7 +166,7 @@ void KexiFormEventHandler::setMainWidgetForEventHandling(KexiMainWindow *mainWin
if (data.isEmpty())
continue;
- QString actionType, actionArg;
+ TQString actionType, actionArg;
KexiPart::Info* partInfo = data.decodeString(actionType, actionArg, ok);
if (!ok)
continue;
@@ -174,14 +174,14 @@ void KexiFormEventHandler::setMainWidgetForEventHandling(KexiMainWindow *mainWin
KAction *action = mainWin->actionCollection()->action( actionArg.latin1() );
if (!action)
continue;
- QObject::disconnect( obj, SIGNAL(clicked()), action, SLOT(activate()) ); //safety
- QObject::connect( obj, SIGNAL(clicked()), action, SLOT(activate()) );
+ TQObject::disconnect( obj, TQT_SIGNAL(clicked()), action, TQT_SLOT(activate()) ); //safety
+ TQObject::connect( obj, TQT_SIGNAL(clicked()), action, TQT_SLOT(activate()) );
}
else if (partInfo) { //'open or execute' action
KexiFormEventAction* action = new KexiFormEventAction(mainWin, obj, actionType, actionArg,
data.option);
- QObject::disconnect( obj, SIGNAL(clicked()), action, SLOT(activate()) );
- QObject::connect( obj, SIGNAL(clicked()), action, SLOT(activate()) );
+ TQObject::disconnect( obj, TQT_SIGNAL(clicked()), action, TQT_SLOT(activate()) );
+ TQObject::connect( obj, TQT_SIGNAL(clicked()), action, TQT_SLOT(activate()) );
}
}
delete l;
diff --git a/kexi/plugins/forms/kexiformeventhandler.h b/kexi/plugins/forms/kexiformeventhandler.h
index e92e9ff9..6e020e25 100644
--- a/kexi/plugins/forms/kexiformeventhandler.h
+++ b/kexi/plugins/forms/kexiformeventhandler.h
@@ -20,7 +20,7 @@
#ifndef KEXIFORMEVENTHANDLER_H
#define KEXIFORMEVENTHANDLER_H
-#include <qwidget.h>
+#include <tqwidget.h>
#include <kaction.h>
class KexiMainWindow;
@@ -47,10 +47,10 @@ class KEXIFORMUTILS_EXPORT KexiFormEventHandler
to appropriate actions.
For now, all of them must be KexiPushButton).
\a mainWin is used to get action list. */
- void setMainWidgetForEventHandling(KexiMainWindow *mainWin, QWidget* mainWidget);
+ void setMainWidgetForEventHandling(KexiMainWindow *mainWin, TQWidget* mainWidget);
protected:
- QWidget *m_mainWidget;
+ TQWidget *m_mainWidget;
};
//! @internal form-level action for handling "on click" actions
@@ -72,20 +72,20 @@ class KEXIFORMUTILS_EXPORT KexiFormEventAction : public KAction
\a ok is set to true on success and to false on failure. On failure no other
values are passed.
\return part info if action type is "table", "query", etc., or 0 for "kaction" type. */
- KexiPart::Info* decodeString(QString& actionType, QString& actionArg, bool& ok) const;
+ KexiPart::Info* decodeString(TQString& actionType, TQString& actionArg, bool& ok) const;
//! \return true if the action is empty
bool isEmpty() const;
- QString string; //!< action string with prefix, like "kaction:edit_copy" or "table:<tableName>"
+ TQString string; //!< action string with prefix, like "kaction:edit_copy" or "table:<tableName>"
- QString option; //!< option used when name is "table/query/etc.:\<objectName\>" is set;
+ TQString option; //!< option used when name is "table/query/etc.:\<objectName\>" is set;
//!< can be set to "open", "design", "editText", etc.
//!< @see ActionToExecuteListView::showActionsForMimeType()
};
- KexiFormEventAction(KexiMainWindow *mainWin, QObject* parent, const QString& actionName,
- const QString& objectName, const QString& actionOption);
+ KexiFormEventAction(KexiMainWindow *mainWin, TQObject* tqparent, const TQString& actionName,
+ const TQString& objectName, const TQString& actionOption);
virtual ~KexiFormEventAction();
public slots:
@@ -95,7 +95,7 @@ class KEXIFORMUTILS_EXPORT KexiFormEventAction : public KAction
private:
KexiMainWindow *m_mainWin;
- QString m_actionName, m_objectName, m_actionOption;
+ TQString m_actionName, m_objectName, m_actionOption;
};
#endif
diff --git a/kexi/plugins/forms/kexiformmanager.cpp b/kexi/plugins/forms/kexiformmanager.cpp
index 6134cfc8..9f288418 100644
--- a/kexi/plugins/forms/kexiformmanager.cpp
+++ b/kexi/plugins/forms/kexiformmanager.cpp
@@ -35,13 +35,13 @@
#include <koproperty/property.h>
#include <widget/kexicustompropertyfactory.h>
-KexiFormManager::KexiFormManager(KexiPart::Part *parent, const char* name)
- : KFormDesigner::FormManager(parent,
+KexiFormManager::KexiFormManager(KexiPart::Part *tqparent, const char* name)
+ : KFormDesigner::FormManager(tqparent,
KFormDesigner::FormManager::HideEventsInPopupMenu |
KFormDesigner::FormManager::SkipFileActions |
KFormDesigner::FormManager::HideSignalSlotConnections
, name)
- , m_part(parent)
+ , m_part(tqparent)
{
m_emitSelectionSignalsUpdatesPropertySet = true;
KexiCustomPropertyFactory::init();
@@ -56,8 +56,8 @@ KAction* KexiFormManager::action( const char* name )
KActionCollection *col = m_part->actionCollectionForMode(Kexi::DesignViewMode);
if (!col)
return 0;
- QCString n( translateName( name ).latin1() );
- KAction *a = col->action(n);
+ TQCString n( translateName( name ).latin1() );
+ KAction *a = col->action(n.data());
if (a)
return a;
KexiDBForm *dbform;
@@ -67,10 +67,10 @@ KAction* KexiFormManager::action( const char* name )
KexiFormScrollView *scrollViewWidget = dynamic_cast<KexiFormScrollView*>(dbform->dataAwareObject());
if (!scrollViewWidget)
return 0;
- KexiFormView* formViewWidget = dynamic_cast<KexiFormView*>(scrollViewWidget->parent());
+ KexiFormView* formViewWidget = dynamic_cast<KexiFormView*>(scrollViewWidget->tqparent());
if (!formViewWidget)
return 0;
- return formViewWidget->parentDialog()->mainWin()->actionCollection()->action(n);
+ return formViewWidget->tqparentDialog()->mainWin()->actionCollection()->action(n.data());
}
KexiFormView* KexiFormManager::activeFormViewWidget() const
@@ -82,7 +82,7 @@ KexiFormView* KexiFormManager::activeFormViewWidget() const
KexiFormScrollView *scrollViewWidget = dynamic_cast<KexiFormScrollView*>(dbform->dataAwareObject());
if (!scrollViewWidget)
return 0;
- return dynamic_cast<KexiFormView*>(scrollViewWidget->parent());
+ return dynamic_cast<KexiFormView*>(scrollViewWidget->tqparent());
}
void KexiFormManager::enableAction( const char* name, bool enable )
@@ -90,12 +90,12 @@ void KexiFormManager::enableAction( const char* name, bool enable )
KexiFormView* formViewWidget = activeFormViewWidget();
if (!formViewWidget)
return;
-// if (QString(name)=="layout_menu")
+// if (TQString(name)=="tqlayout_menu")
// kdDebug() << "!!!!!!!!!!! " << enable << endl;
formViewWidget->setAvailable(translateName( name ).latin1(), enable);
}
-void KexiFormManager::setFormDataSource(const QCString& mime, const QCString& name)
+void KexiFormManager::setFormDataSource(const TQCString& mime, const TQCString& name)
{
if (!activeForm())
return;
@@ -105,14 +105,14 @@ void KexiFormManager::setFormDataSource(const QCString& mime, const QCString& na
// setPropertyValueInDesignMode(formWidget, "dataSource", name);
- QCString oldDataSourceMimeType( formWidget->dataSourceMimeType() );
- QCString oldDataSource( formWidget->dataSource().latin1() );
+ TQCString oldDataSourceMimeType( formWidget->dataSourceMimeType() );
+ TQCString oldDataSource( formWidget->dataSource().latin1() );
if (mime!=oldDataSourceMimeType || name!=oldDataSource) {
- QMap<QCString, QVariant> propValues;
+ TQMap<TQCString, TQVariant> propValues;
propValues.insert("dataSource", name);
propValues.insert("dataSourceMimeType", mime);
KFormDesigner::CommandGroup *group
- = new KFormDesigner::CommandGroup(i18n("Set Form's Data Source to \"%1\"").arg(name), propertySet());
+ = new KFormDesigner::CommandGroup(i18n("Set Form's Data Source to \"%1\"").tqarg(name.data()), propertySet());
propertySet()->createPropertyCommandsInDesignMode(formWidget, propValues, group, true /*addToActiveForm*/);
}
@@ -120,17 +120,17 @@ void KexiFormManager::setFormDataSource(const QCString& mime, const QCString& na
if (activeForm()->selectedWidget() == formWidget) {
//active form is selected: just use properties system
KFormDesigner::WidgetPropertySet *set = propertySet();
- if (!set || !set->contains("dataSource"))
+ if (!set || !set->tqcontains("dataSource"))
return;
(*set)["dataSource"].setValue(name);
- if (set->contains("dataSourceMimeType"))
+ if (set->tqcontains("dataSourceMimeType"))
(*set)["dataSourceMimeType"].setValue(mime);
return;
}
//active form isn't selected: change it's data source and mime type by hand
- QCString oldDataSourceMimeType( formWidget->dataSourceMimeType() );
- QCString oldDataSource( formWidget->dataSource().latin1() );
+ TQCString oldDataSourceMimeType( formWidget->dataSourceMimeType() );
+ TQCString oldDataSource( formWidget->dataSource().latin1() );
if (mime!=oldDataSourceMimeType || name!=oldDataSource) {
formWidget->setDataSourceMimeType(mime);
@@ -138,7 +138,7 @@ void KexiFormManager::setFormDataSource(const QCString& mime, const QCString& na
emit dirty(activeForm(), true);
activeForm()->addCommand(
- new KFormDesigner::PropertyCommand(propertySet(), QString(formWidget->name()),
+ new KFormDesigner::PropertyCommand(propertySet(), TQString(formWidget->name()),
oldDataSource, name, "dataSource"),
false );
@@ -149,7 +149,7 @@ void KexiFormManager::setFormDataSource(const QCString& mime, const QCString& na
}*/
}
-void KexiFormManager::setDataSourceFieldOrExpression(const QString& string, const QString& caption,
+void KexiFormManager::setDataSourceFieldOrExpression(const TQString& string, const TQString& caption,
KexiDB::Field::Type type)
{
if (!activeForm())
@@ -159,23 +159,23 @@ void KexiFormManager::setDataSourceFieldOrExpression(const QString& string, cons
// return;
KFormDesigner::WidgetPropertySet *set = propertySet();
- if (!set || !set->contains("dataSource"))
+ if (!set || !set->tqcontains("dataSource"))
return;
(*set)["dataSource"].setValue(string);
- if (set->contains("autoCaption") && (*set)["autoCaption"].value().toBool()) {
- if (set->contains("fieldCaptionInternal"))
+ if (set->tqcontains("autoCaption") && (*set)["autoCaption"].value().toBool()) {
+ if (set->tqcontains("fieldCaptionInternal"))
(*set)["fieldCaptionInternal"].setValue(caption);
}
if (//type!=KexiDB::Field::InvalidType &&
- set->contains("widgetType") && (*set)["widgetType"].value().toString()=="Auto")
+ set->tqcontains("widgetType") && (*set)["widgetType"].value().toString()=="Auto")
{
- if (set->contains("fieldTypeInternal"))
+ if (set->tqcontains("fieldTypeInternal"))
(*set)["fieldTypeInternal"].setValue(type);
}
-/* QString oldDataSource( dataWidget->dataSource() );
+/* TQString oldDataSource( dataWidget->dataSource() );
if (string!=oldDataSource) {
dataWidget->setDataSource(string);
emit dirty(activeForm(), true);
@@ -184,8 +184,8 @@ void KexiFormManager::setDataSourceFieldOrExpression(const QString& string, cons
}*/
}
-void KexiFormManager::insertAutoFields(const QString& sourceMimeType, const QString& sourceName,
- const QStringList& fields)
+void KexiFormManager::insertAutoFields(const TQString& sourceMimeType, const TQString& sourceName,
+ const TQStringList& fields)
{
KexiFormView* formViewWidget = activeFormViewWidget();
if (!formViewWidget || !formViewWidget->form() || !formViewWidget->form()->activeContainer())
@@ -202,13 +202,13 @@ void KexiFormManager::slotHistoryCommandExecuted()
KexiDBForm* formWidget = dynamic_cast<KexiDBForm*>(activeForm()->widget());
if (!formWidget)
return;
- QPtrListIterator<KCommand> it(group->commands());
+ TQPtrListIterator<KCommand> it(group->commands());
const KFormDesigner::PropertyCommand* pc1 = dynamic_cast<const KFormDesigner::PropertyCommand*>(it.current());
++it;
const KFormDesigner::PropertyCommand* pc2 = dynamic_cast<const KFormDesigner::PropertyCommand*>(it.current());
if (pc1 && pc2 && pc1->property()=="dataSource" && pc2->property()=="dataSourceMimeType") {
- const QMap<QCString, QVariant>::const_iterator it1( pc1->oldValues().constBegin() );
- const QMap<QCString, QVariant>::const_iterator it2( pc2->oldValues().constBegin() );
+ const TQMap<TQCString, TQVariant>::const_iterator it1( pc1->oldValues().constBegin() );
+ const TQMap<TQCString, TQVariant>::const_iterator it2( pc2->oldValues().constBegin() );
if (it1.key()==formWidget->name() && it2.key()==formWidget->name())
static_cast<KexiFormPart*>(m_part)->dataSourcePage()->setDataSource(
formWidget->dataSourceMimeType(), formWidget->dataSource().latin1());
@@ -218,15 +218,15 @@ void KexiFormManager::slotHistoryCommandExecuted()
}
/*
-bool KexiFormManager::loadFormFromDomInternal(Form *form, QWidget *container, QDomDocument &inBuf)
+bool KexiFormManager::loadFormFromDomInternal(Form *form, TQWidget *container, TQDomDocument &inBuf)
{
- QMap<QCString,QString> customProperties;
+ TQMap<TQCString,TQString> customProperties;
FormIO::loadFormFromDom(myform, container, domDoc, &customProperties);
}
-bool KexiFormManager::saveFormToStringInternal(Form *form, QString &dest, int indent)
+bool KexiFormManager::saveFormToStringInternal(Form *form, TQString &dest, int indent)
{
- QMap<QCString,QString> customProperties;
+ TQMap<TQCString,TQString> customProperties;
return KFormDesigner::FormIO::saveFormToString(form, dest, indent, &customProperties);
}
diff --git a/kexi/plugins/forms/kexiformmanager.h b/kexi/plugins/forms/kexiformmanager.h
index 1cc5f0c6..d25cf78e 100644
--- a/kexi/plugins/forms/kexiformmanager.h
+++ b/kexi/plugins/forms/kexiformmanager.h
@@ -31,9 +31,10 @@ class KexiFormView;
class KEXIFORMUTILS_EXPORT KexiFormManager : public KFormDesigner::FormManager
{
Q_OBJECT
+ TQ_OBJECT
public:
- KexiFormManager(KexiPart::Part *parent, const char* name = 0);
+ KexiFormManager(KexiPart::Part *tqparent, const char* name = 0);
virtual ~KexiFormManager();
virtual KAction* action( const char* name );
@@ -41,7 +42,7 @@ class KEXIFORMUTILS_EXPORT KexiFormManager : public KFormDesigner::FormManager
public slots:
//! Receives signal from KexiDataSourcePage about changed form's data source
- void setFormDataSource(const QCString& mime, const QCString& name);
+ void setFormDataSource(const TQCString& mime, const TQCString& name);
/*! Receives signal from KexiDataSourcePage about changed widget's data source.
This is because we couldn't pass objects like KexiDB::QueryColumnInfo.
@@ -49,34 +50,34 @@ class KEXIFORMUTILS_EXPORT KexiFormManager : public KFormDesigner::FormManager
Also sets following things in KexiDBAutoField:
- caption related to the data source
- data type related to the data source */
- void setDataSourceFieldOrExpression(const QString& string, const QString& caption,
+ void setDataSourceFieldOrExpression(const TQString& string, const TQString& caption,
KexiDB::Field::Type type);
/*! Receives signal from KexiDataSourcePage and inserts autofields onto the current form. */
- void insertAutoFields(const QString& sourceMimeType, const QString& sourceName,
- const QStringList& fields);
+ void insertAutoFields(const TQString& sourceMimeType, const TQString& sourceName,
+ const TQStringList& fields);
protected slots:
void slotHistoryCommandExecuted();
protected:
- inline QString translateName( const char* name ) const;
+ inline TQString translateName( const char* name ) const;
private:
//! Helper: return active form's view widget or 0 if there's no active form having such widget
KexiFormView* activeFormViewWidget() const;
-// virtual bool loadFormFromDomInternal(Form *form, QWidget *container, QDomDocument &inBuf);
-// virtual bool saveFormToStringInternal(Form *form, QString &dest, int indent = 0);
+// virtual bool loadFormFromDomInternal(Form *form, TQWidget *container, TQDomDocument &inBuf);
+// virtual bool saveFormToStringInternal(Form *form, TQString &dest, int indent = 0);
KexiPart::Part* m_part;
};
-QString KexiFormManager::translateName( const char* name ) const
+TQString KexiFormManager::translateName( const char* name ) const
{
- QString n( name );
+ TQString n( name );
//translate to our name space:
- if (n.startsWith("align_") || n.startsWith("adjust_") || n.startsWith("layout_")
+ if (n.startsWith("align_") || n.startsWith("adjust_") || n.startsWith("tqlayout_")
|| n=="format_raise" || n=="format_raise" || n=="taborder" | n=="break_layout")
{
n.prepend("formpart_");
diff --git a/kexi/plugins/forms/kexiformpart.cpp b/kexi/plugins/forms/kexiformpart.cpp
index 8693cb5b..2486416e 100644
--- a/kexi/plugins/forms/kexiformpart.cpp
+++ b/kexi/plugins/forms/kexiformpart.cpp
@@ -71,14 +71,14 @@ class KexiFormPart::Private
delete static_cast<KFormDesigner::ObjectTreeView*>(objectTreeView);
delete static_cast<KexiDataSourcePage*>(dataSourcePage);
}
-// QGuardedPtr<KFormDesigner::FormManager> manager;
- QGuardedPtr<KFormDesigner::ObjectTreeView> objectTreeView;
- QGuardedPtr<KexiDataSourcePage> dataSourcePage;
+// TQGuardedPtr<KFormDesigner::FormManager> manager;
+ TQGuardedPtr<KFormDesigner::ObjectTreeView> objectTreeView;
+ TQGuardedPtr<KexiDataSourcePage> dataSourcePage;
KexiDataSourceComboBox *dataSourceCombo;
};
-KexiFormPart::KexiFormPart(QObject *parent, const char *name, const QStringList &l)
- : KexiPart::Part(parent, name, l)
+KexiFormPart::KexiFormPart(TQObject *tqparent, const char *name, const TQStringList &l)
+ : KexiPart::Part(tqparent, name, l)
, d(new Private())
{
// REGISTERED ID:
@@ -102,18 +102,18 @@ KexiFormPart::KexiFormPart(QObject *parent, const char *name, const QStringList
// Create and store a handle to forms' library. Reports will have their own library too.
/* @todo add configuration for supported factory groups */
- QStringList supportedFactoryGroups;
+ TQStringList supportedFactoryGroups;
supportedFactoryGroups += "kexi";
static_formsLibrary = KFormDesigner::FormManager::createWidgetLibrary(
formManager, supportedFactoryGroups);
static_formsLibrary->setAdvancedPropertiesVisible(false);
- connect(static_formsLibrary, SIGNAL(widgetCreated(QWidget*)),
- this, SLOT(slotWidgetCreatedByFormsLibrary(QWidget*)));
+ connect(static_formsLibrary, TQT_SIGNAL(widgetCreated(TQWidget*)),
+ this, TQT_SLOT(slotWidgetCreatedByFormsLibrary(TQWidget*)));
- connect(KFormDesigner::FormManager::self()->propertySet(), SIGNAL(widgetPropertyChanged(QWidget *, const QCString &, const QVariant&)),
- this, SLOT(slotPropertyChanged(QWidget *, const QCString &, const QVariant&)));
- connect(KFormDesigner::FormManager::self(), SIGNAL(autoTabStopsSet(KFormDesigner::Form*,bool)),
- this, SLOT(slotAutoTabStopsSet(KFormDesigner::Form*,bool)));
+ connect(KFormDesigner::FormManager::self()->propertySet(), TQT_SIGNAL(widgetPropertyChanged(TQWidget *, const TQCString &, const TQVariant&)),
+ this, TQT_SLOT(slotPropertyChanged(TQWidget *, const TQCString &, const TQVariant&)));
+ connect(KFormDesigner::FormManager::self(), TQT_SIGNAL(autoTabStopsSet(KFormDesigner::Form*,bool)),
+ this, TQT_SLOT(slotAutoTabStopsSet(KFormDesigner::Form*,bool)));
}
KexiFormPart::~KexiFormPart()
@@ -143,8 +143,8 @@ void KexiFormPart::initInstanceActions( int mode, KActionCollection *col )
{
if (mode==Kexi::DesignViewMode) {
KFormDesigner::FormManager::self()->createActions(col, 0);
- new KAction(i18n("Edit Tab Order..."), "tab_order", KShortcut(0), KFormDesigner::FormManager::self(), SLOT(editTabOrder()), col, "taborder");
- new KAction(i18n("Adjust Size"), "viewmagfit", KShortcut(0), KFormDesigner::FormManager::self(), SLOT(ajustWidgetSize()), col, "adjust");
+ new KAction(i18n("Edit Tab Order..."), "tab_order", KShortcut(0), KFormDesigner::FormManager::self(), TQT_SLOT(editTabOrder()), col, "taborder");
+ new KAction(i18n("Adjust Size"), "viewmagfit", KShortcut(0), KFormDesigner::FormManager::self(), TQT_SLOT(ajustWidgetSize()), col, "adjust");
}
//TODO
}
@@ -152,7 +152,7 @@ void KexiFormPart::initInstanceActions( int mode, KActionCollection *col )
void KexiFormPart::initPartActions()
{
-// new KAction(i18n("Show Form UI Code"), "show_form_ui", CTRL+Key_U, m_manager, SLOT(showFormUICode()),
+// new KAction(i18n("Show Form UI Code"), "show_form_ui", CTRL+Key_U, m_manager, TQT_SLOT(showFormUICode()),
// guiClient()->actionCollection(), "show_form_ui");
}
@@ -162,7 +162,7 @@ void KexiFormPart::initInstanceActions()
kapp->config()->setGroup("General");
if (kapp->config()->readBoolEntry("showInternalDebugger", false)) {
new KAction(i18n("Show Form UI Code"), "compfile",
- CTRL+Key_U, KFormDesigner::FormManager::self(), SLOT(showFormUICode()),
+ CTRL+Key_U, KFormDesigner::FormManager::self(), TQT_SLOT(showFormUICode()),
actionCollectionForMode(Kexi::DesignViewMode), "show_form_ui");
}
#endif
@@ -171,7 +171,7 @@ void KexiFormPart::initInstanceActions()
KFormDesigner::FormManager::self()->createActions( library(), col, (KXMLGUIClient*)col->parentGUIClient() ); //guiClient() );
//connect actions provided by widget factories
- connect( col->action("widget_assign_action"), SIGNAL(activated()), this, SLOT(slotAssignAction()));
+ connect( col->action("widget_assign_action"), TQT_SIGNAL(activated()), this, TQT_SLOT(slotAssignAction()));
createSharedAction(Kexi::DesignViewMode, i18n("Clear Widget Contents"), "editclear", 0, "formpart_clear_contents");
createSharedAction(Kexi::DesignViewMode, i18n("Edit Tab Order..."), "tab_order", 0, "formpart_taborder");
@@ -184,23 +184,23 @@ void KexiFormPart::initInstanceActions()
KActionMenu *menu = static_cast<KActionMenu*>(action);
menu->insert( createSharedAction(Kexi::DesignViewMode, i18n("&Horizontally"),
- QString::null, 0, "formpart_layout_hbox"));
+ TQString(), 0, "formpart_layout_hbox"));
menu->insert( createSharedAction(Kexi::DesignViewMode, i18n("&Vertically"),
- QString::null, 0, "formpart_layout_vbox"));
+ TQString(), 0, "formpart_layout_vbox"));
menu->insert( createSharedAction(Kexi::DesignViewMode, i18n("In &Grid"),
- QString::null, 0, "formpart_layout_grid"));
+ TQString(), 0, "formpart_layout_grid"));
#ifdef KEXI_SHOW_SPLITTER_WIDGET
menu->insert( createSharedAction(Kexi::DesignViewMode, i18n("Horizontally in &Splitter"),
- QString::null, 0, "formpart_layout_hsplitter"));
+ TQString(), 0, "formpart_layout_hsplitter"));
menu->insert( createSharedAction(Kexi::DesignViewMode, i18n("Verti&cally in Splitter"),
- QString::null, 0, "formpart_layout_vsplitter"));
+ TQString(), 0, "formpart_layout_vsplitter"));
#endif
- createSharedAction(Kexi::DesignViewMode, i18n("&Break Layout"), QString::null, 0, "formpart_break_layout");
+ createSharedAction(Kexi::DesignViewMode, i18n("&Break Layout"), TQString(), 0, "formpart_break_layout");
/*
- createSharedAction(Kexi::DesignViewMode, i18n("Lay Out Widgets &Horizontally"), QString::null, 0, "formpart_layout_hbox");
- createSharedAction(Kexi::DesignViewMode, i18n("Lay Out Widgets &Vertically"), QString::null, 0, "formpart_layout_vbox");
- createSharedAction(Kexi::DesignViewMode, i18n("Lay Out Widgets in &Grid"), QString::null, 0, "formpart_layout_grid");
+ createSharedAction(Kexi::DesignViewMode, i18n("Lay Out Widgets &Horizontally"), TQString(), 0, "formpart_layout_hbox");
+ createSharedAction(Kexi::DesignViewMode, i18n("Lay Out Widgets &Vertically"), TQString(), 0, "formpart_layout_vbox");
+ createSharedAction(Kexi::DesignViewMode, i18n("Lay Out Widgets in &Grid"), TQString(), 0, "formpart_layout_grid");
*/
createSharedAction(Kexi::DesignViewMode, i18n("Bring Widget to Front"), "raise", 0, "formpart_format_raise");
createSharedAction(Kexi::DesignViewMode, i18n("Send Widget to Back"), "lower", 0, "formpart_format_lower");
@@ -230,11 +230,11 @@ void KexiFormPart::initInstanceActions()
KexiDialogTempData*
KexiFormPart::createTempData(KexiDialogBase* dialog)
{
- return new KexiFormPart::TempData(dialog);
+ return new KexiFormPart::TempData(TQT_TQOBJECT(dialog));
}
-KexiViewBase* KexiFormPart::createView(QWidget *parent, KexiDialogBase* dialog,
- KexiPart::Item &item, int viewMode, QMap<QString,QString>*)
+KexiViewBase* KexiFormPart::createView(TQWidget *tqparent, KexiDialogBase* dialog,
+ KexiPart::Item &item, int viewMode, TQMap<TQString,TQString>*)
{
Q_UNUSED( viewMode );
@@ -243,60 +243,60 @@ KexiViewBase* KexiFormPart::createView(QWidget *parent, KexiDialogBase* dialog,
if (!win || !win->project() || !win->project()->dbConnection())
return 0;
- KexiFormView *view = new KexiFormView(win, parent, item.name().latin1(),
+ KexiFormView *view = new KexiFormView(win, tqparent, item.name().latin1(),
win->project()->dbConnection() );
return view;
}
void
-KexiFormPart::generateForm(KexiDB::FieldList *list, QDomDocument &domDoc)
+KexiFormPart::generateForm(KexiDB::FieldList *list, TQDomDocument &domDoc)
{
//this form generates a .ui from FieldList list
//basically that is a Label and a LineEdit for each field
- domDoc = QDomDocument("UI");
- QDomElement uiElement = domDoc.createElement("UI");
+ domDoc = TQDomDocument("UI");
+ TQDomElement uiElement = domDoc.createElement("UI");
domDoc.appendChild(uiElement);
uiElement.setAttribute("version", "3.1");
uiElement.setAttribute("stdsetdef", 1);
- QDomElement baseClass = domDoc.createElement("class");
+ TQDomElement baseClass = domDoc.createElement("class");
uiElement.appendChild(baseClass);
- QDomText baseClassV = domDoc.createTextNode("QWidget");
+ TQDomText baseClassV = domDoc.createTextNode(TQWIDGET_OBJECT_NAME_STRING);
baseClass.appendChild(baseClassV);
- QDomElement baseWidget = domDoc.createElement("widget");
- baseWidget.setAttribute("class", "QWidget");
+ TQDomElement baseWidget = domDoc.createElement("widget");
+ baseWidget.setAttribute("class", TQWIDGET_OBJECT_NAME_STRING);
int y=0;
for(unsigned int i=0; i < list->fieldCount(); i++)
{
- QDomElement lclass = domDoc.createElement("widget");
+ TQDomElement lclass = domDoc.createElement("widget");
baseWidget.appendChild(lclass);
- lclass.setAttribute("class", "QLabel");
- QDomElement lNameProperty = domDoc.createElement("property");
+ lclass.setAttribute("class", TQLABEL_OBJECT_NAME_STRING);
+ TQDomElement lNameProperty = domDoc.createElement("property");
lNameProperty.setAttribute("name", "name");
- QDomElement lType = domDoc.createElement("cstring");
- QDomText lClassN = domDoc.createTextNode(QString("l%1").arg(list->field(i)->name()));
+ TQDomElement lType = domDoc.createElement("cstring");
+ TQDomText lClassN = domDoc.createTextNode(TQString("l%1").tqarg(list->field(i)->name()));
lType.appendChild(lClassN);
lNameProperty.appendChild(lType);
lclass.appendChild(lNameProperty);
- QDomElement gNameProperty = domDoc.createElement("property");
+ TQDomElement gNameProperty = domDoc.createElement("property");
gNameProperty.setAttribute("name", "geometry");
- QDomElement lGType = domDoc.createElement("rect");
+ TQDomElement lGType = domDoc.createElement("rect");
- QDomElement lx = domDoc.createElement("x");
- QDomText lxV = domDoc.createTextNode("10");
+ TQDomElement lx = domDoc.createElement("x");
+ TQDomText lxV = domDoc.createTextNode("10");
lx.appendChild(lxV);
- QDomElement ly = domDoc.createElement("y");
- QDomText lyV = domDoc.createTextNode(QString::number(y + 10));
+ TQDomElement ly = domDoc.createElement("y");
+ TQDomText lyV = domDoc.createTextNode(TQString::number(y + 10));
ly.appendChild(lyV);
- QDomElement lWidth = domDoc.createElement("width");
- QDomText lWidthV = domDoc.createTextNode("100");
+ TQDomElement lWidth = domDoc.createElement("width");
+ TQDomText lWidthV = domDoc.createTextNode("100");
lWidth.appendChild(lWidthV);
- QDomElement lHeight = domDoc.createElement("height");
- QDomText lHeightV = domDoc.createTextNode("20");
+ TQDomElement lHeight = domDoc.createElement("height");
+ TQDomText lHeightV = domDoc.createTextNode("20");
lHeight.appendChild(lHeightV);
lGType.appendChild(lx);
@@ -307,10 +307,10 @@ KexiFormPart::generateForm(KexiDB::FieldList *list, QDomDocument &domDoc)
gNameProperty.appendChild(lGType);
lclass.appendChild(gNameProperty);
- QDomElement tNameProperty = domDoc.createElement("property");
+ TQDomElement tNameProperty = domDoc.createElement("property");
tNameProperty.setAttribute("name", "text");
- QDomElement lTType = domDoc.createElement("string");
- QDomText lTextV = domDoc.createTextNode(list->field(i)->name());
+ TQDomElement lTType = domDoc.createElement("string");
+ TQDomText lTextV = domDoc.createTextNode(list->field(i)->name());
lTType.appendChild(lTextV);
tNameProperty.appendChild(lTType);
lclass.appendChild(tNameProperty);
@@ -319,32 +319,32 @@ KexiFormPart::generateForm(KexiDB::FieldList *list, QDomDocument &domDoc)
///line edit!
- QDomElement vclass = domDoc.createElement("widget");
+ TQDomElement vclass = domDoc.createElement("widget");
baseWidget.appendChild(vclass);
vclass.setAttribute("class", "KLineEdit");
- QDomElement vNameProperty = domDoc.createElement("property");
+ TQDomElement vNameProperty = domDoc.createElement("property");
vNameProperty.setAttribute("name", "name");
- QDomElement vType = domDoc.createElement("cstring");
- QDomText vClassN = domDoc.createTextNode(list->field(i)->name());
+ TQDomElement vType = domDoc.createElement("cstring");
+ TQDomText vClassN = domDoc.createTextNode(list->field(i)->name());
vType.appendChild(vClassN);
vNameProperty.appendChild(vType);
vclass.appendChild(vNameProperty);
- QDomElement vgNameProperty = domDoc.createElement("property");
+ TQDomElement vgNameProperty = domDoc.createElement("property");
vgNameProperty.setAttribute("name", "geometry");
- QDomElement vGType = domDoc.createElement("rect");
+ TQDomElement vGType = domDoc.createElement("rect");
- QDomElement vx = domDoc.createElement("x");
- QDomText vxV = domDoc.createTextNode("110");
+ TQDomElement vx = domDoc.createElement("x");
+ TQDomText vxV = domDoc.createTextNode("110");
vx.appendChild(vxV);
- QDomElement vy = domDoc.createElement("y");
- QDomText vyV = domDoc.createTextNode(QString::number(y + 10));
+ TQDomElement vy = domDoc.createElement("y");
+ TQDomText vyV = domDoc.createTextNode(TQString::number(y + 10));
vy.appendChild(vyV);
- QDomElement vWidth = domDoc.createElement("width");
- QDomText vWidthV = domDoc.createTextNode("200");
+ TQDomElement vWidth = domDoc.createElement("width");
+ TQDomText vWidthV = domDoc.createTextNode("200");
vWidth.appendChild(vWidthV);
- QDomElement vHeight = domDoc.createElement("height");
- QDomText vHeightV = domDoc.createTextNode("20");
+ TQDomElement vHeight = domDoc.createElement("height");
+ TQDomText vHeightV = domDoc.createTextNode("20");
vHeight.appendChild(vHeightV);
vGType.appendChild(vx);
@@ -358,29 +358,29 @@ KexiFormPart::generateForm(KexiDB::FieldList *list, QDomDocument &domDoc)
y += 20;
}
- QDomElement lNameProperty = domDoc.createElement("property");
+ TQDomElement lNameProperty = domDoc.createElement("property");
lNameProperty.setAttribute("name", "name");
- QDomElement lType = domDoc.createElement("cstring");
- QDomText lClassN = domDoc.createTextNode("DBForm");
+ TQDomElement lType = domDoc.createElement("cstring");
+ TQDomText lClassN = domDoc.createTextNode("DBForm");
lType.appendChild(lClassN);
lNameProperty.appendChild(lType);
baseWidget.appendChild(lNameProperty);
- QDomElement wNameProperty = domDoc.createElement("property");
+ TQDomElement wNameProperty = domDoc.createElement("property");
wNameProperty.setAttribute("name", "geometry");
- QDomElement wGType = domDoc.createElement("rect");
+ TQDomElement wGType = domDoc.createElement("rect");
- QDomElement wx = domDoc.createElement("x");
- QDomText wxV = domDoc.createTextNode("0");
+ TQDomElement wx = domDoc.createElement("x");
+ TQDomText wxV = domDoc.createTextNode("0");
wx.appendChild(wxV);
- QDomElement wy = domDoc.createElement("y");
- QDomText wyV = domDoc.createTextNode("0");
+ TQDomElement wy = domDoc.createElement("y");
+ TQDomText wyV = domDoc.createTextNode("0");
wy.appendChild(wyV);
- QDomElement wWidth = domDoc.createElement("width");
- QDomText wWidthV = domDoc.createTextNode("340");
+ TQDomElement wWidth = domDoc.createElement("width");
+ TQDomText wWidthV = domDoc.createTextNode("340");
wWidth.appendChild(wWidthV);
- QDomElement wHeight = domDoc.createElement("height");
- QDomText wHeightV = domDoc.createTextNode(QString::number(y + 30));
+ TQDomElement wHeight = domDoc.createElement("height");
+ TQDomText wHeightV = domDoc.createTextNode(TQString::number(y + 30));
wHeight.appendChild(wHeightV);
wGType.appendChild(wx);
@@ -400,7 +400,7 @@ void KexiFormPart::slotAutoTabStopsSet(KFormDesigner::Form *form, bool set)
KoProperty::Property &p = (*KFormDesigner::FormManager::self()->propertySet())["autoTabStops"];
if (!p.isNull())
- p.setValue(QVariant(set, 4));
+ p.setValue(TQVariant(set, 4));
}
void KexiFormPart::slotAssignAction()
@@ -424,15 +424,15 @@ void KexiFormPart::slotAssignAction()
KexiFormScrollView *scrollViewWidget = dynamic_cast<KexiFormScrollView*>(dbform->dataAwareObject());
if (!scrollViewWidget)
return;
- KexiFormView* formViewWidget = dynamic_cast<KexiFormView*>(scrollViewWidget->parent());
+ KexiFormView* formViewWidget = dynamic_cast<KexiFormView*>(scrollViewWidget->tqparent());
if (!formViewWidget)
return;
- KexiMainWindow * mainWin = formViewWidget->parentDialog()->mainWin();
+ KexiMainWindow * mainWin = formViewWidget->tqparentDialog()->mainWin();
KexiActionSelectionDialog dlg(mainWin, dbform, data,
propSet->property("name").value().toCString());
- if(dlg.exec() == QDialog::Accepted) {
+ if(dlg.exec() == TQDialog::Accepted) {
data = dlg.currentAction();
//update property value
propSet->property("onClickAction").setValue(data.string);
@@ -440,8 +440,8 @@ void KexiFormPart::slotAssignAction()
}
}
-QString
-KexiFormPart::i18nMessage(const QCString& englishMessage, KexiDialogBase* dlg) const
+TQString
+KexiFormPart::i18nMessage(const TQCString& englishMessage, KexiDialogBase* dlg) const
{
Q_UNUSED(dlg);
if (englishMessage=="Design of object \"%1\" has been modified.")
@@ -453,21 +453,21 @@ KexiFormPart::i18nMessage(const QCString& englishMessage, KexiDialogBase* dlg) c
}
void
-KexiFormPart::slotPropertyChanged(QWidget *w, const QCString &name, const QVariant &value)
+KexiFormPart::slotPropertyChanged(TQWidget *w, const TQCString &name, const TQVariant &value)
{
Q_UNUSED( w );
if (!KFormDesigner::FormManager::self()->activeForm())
return;
if (name == "autoTabStops") {
- //QWidget *w = KFormDesigner::FormManager::self()->activeForm()->selectedWidget();
+ //TQWidget *w = KFormDesigner::FormManager::self()->activeForm()->selectedWidget();
//update autoTabStops setting at KFD::Form level
KFormDesigner::FormManager::self()->activeForm()->setAutoTabStops( value.toBool() );
}
if (KFormDesigner::FormManager::self()->activeForm()->widget() && name == "geometry") {
//fall back to sizeInternal property....
- if (KFormDesigner::FormManager::self()->propertySet()->contains("sizeInternal"))
- KFormDesigner::FormManager::self()->propertySet()->property("sizeInternal").setValue(value.toRect().size());
+ if (KFormDesigner::FormManager::self()->propertySet()->tqcontains("sizeInternal"))
+ KFormDesigner::FormManager::self()->propertySet()->property("sizeInternal").setValue(TQSize(value.toRect().size()));
}
}
@@ -488,14 +488,14 @@ void KexiFormPart::setupCustomPropertyPanelTabs(KTabWidget *tab, KexiMainWindow*
d->objectTreeView = new KFormDesigner::ObjectTreeView(0, "KexiFormPart:ObjectTreeView");
KFormDesigner::FormManager::self()->setObjectTreeView(d->objectTreeView); //important: assign to manager
d->dataSourcePage = new KexiDataSourcePage(0, "dataSourcePage");
- connect(d->dataSourcePage, SIGNAL(jumpToObjectRequested(const QCString&, const QCString&)),
- mainWin, SLOT(highlightObject(const QCString&, const QCString&)));
- connect(d->dataSourcePage, SIGNAL(formDataSourceChanged(const QCString&, const QCString&)),
- KFormDesigner::FormManager::self(), SLOT(setFormDataSource(const QCString&, const QCString&)));
- connect(d->dataSourcePage, SIGNAL(dataSourceFieldOrExpressionChanged(const QString&, const QString&, KexiDB::Field::Type)),
- KFormDesigner::FormManager::self(), SLOT(setDataSourceFieldOrExpression(const QString&, const QString&, KexiDB::Field::Type)));
- connect(d->dataSourcePage, SIGNAL(insertAutoFields(const QString&, const QString&, const QStringList&)),
- KFormDesigner::FormManager::self(), SLOT(insertAutoFields(const QString&, const QString&, const QStringList&)));
+ connect(d->dataSourcePage, TQT_SIGNAL(jumpToObjectRequested(const TQCString&, const TQCString&)),
+ mainWin, TQT_SLOT(highlightObject(const TQCString&, const TQCString&)));
+ connect(d->dataSourcePage, TQT_SIGNAL(formDataSourceChanged(const TQCString&, const TQCString&)),
+ KFormDesigner::FormManager::self(), TQT_SLOT(setFormDataSource(const TQCString&, const TQCString&)));
+ connect(d->dataSourcePage, TQT_SIGNAL(dataSourceFieldOrExpressionChanged(const TQString&, const TQString&, KexiDB::Field::Type)),
+ KFormDesigner::FormManager::self(), TQT_SLOT(setDataSourceFieldOrExpression(const TQString&, const TQString&, KexiDB::Field::Type)));
+ connect(d->dataSourcePage, TQT_SIGNAL(insertAutoFields(const TQString&, const TQString&, const TQStringList&)),
+ KFormDesigner::FormManager::self(), TQT_SLOT(insertAutoFields(const TQString&, const TQString&, const TQStringList&)));
}
KexiProject *prj = mainWin->project();
@@ -508,28 +508,28 @@ void KexiFormPart::setupCustomPropertyPanelTabs(KTabWidget *tab, KexiMainWindow*
tab->setTabToolTip( d->objectTreeView, i18n("Widgets"));
}
-void KexiFormPart::slotWidgetCreatedByFormsLibrary(QWidget* widget)
+void KexiFormPart::slotWidgetCreatedByFormsLibrary(TQWidget* widget)
{
- QStrList signalNames(widget->metaObject()->signalNames());
+ TQStrList signalNames(widget->tqmetaObject()->signalNames());
if (!signalNames.isEmpty()) {
- const char *handleDragMoveEventSignal = "handleDragMoveEvent(QDragMoveEvent*)";
- const char *handleDropEventSignal = "handleDropEvent(QDropEvent*)";
+ const char *handleDragMoveEventSignal = "handleDragMoveEvent(TQDragMoveEvent*)";
+ const char *handleDropEventSignal = "handleDropEvent(TQDropEvent*)";
- for (QStrListIterator it(signalNames); it.current(); ++it) {
+ for (TQStrListIterator it(signalNames); it.current(); ++it) {
if (0==qstrcmp(it.current(), handleDragMoveEventSignal)) {
kdDebug() << it.current() << endl;
KexiFormView *formView = KexiUtils::findParent<KexiFormView>(widget, "KexiFormView");
if (formView) {
- connect(widget, SIGNAL(handleDragMoveEvent(QDragMoveEvent*)),
- formView, SLOT(slotHandleDragMoveEvent(QDragMoveEvent*)));
+ connect(widget, TQT_SIGNAL(handleDragMoveEvent(TQDragMoveEvent*)),
+ formView, TQT_SLOT(slotHandleDragMoveEvent(TQDragMoveEvent*)));
}
}
else if (0==qstrcmp(it.current(), handleDropEventSignal)) {
kdDebug() << it.current() << endl;
KexiFormView *formView = KexiUtils::findParent<KexiFormView>(widget, "KexiFormView");
if (formView) {
- connect(widget, SIGNAL(handleDropEvent(QDropEvent*)),
- formView, SLOT(slotHandleDropEvent(QDropEvent*)));
+ connect(widget, TQT_SIGNAL(handleDropEvent(TQDropEvent*)),
+ formView, TQT_SLOT(slotHandleDropEvent(TQDropEvent*)));
}
}
}
@@ -538,8 +538,8 @@ void KexiFormPart::slotWidgetCreatedByFormsLibrary(QWidget* widget)
//----------------
-KexiFormPart::TempData::TempData(QObject* parent)
- : KexiDialogTempData(parent)
+KexiFormPart::TempData::TempData(TQObject* tqparent)
+ : KexiDialogTempData(tqparent)
{
}
diff --git a/kexi/plugins/forms/kexiformpart.h b/kexi/plugins/forms/kexiformpart.h
index 1ddbab53..df5c6b53 100644
--- a/kexi/plugins/forms/kexiformpart.h
+++ b/kexi/plugins/forms/kexiformpart.h
@@ -22,8 +22,8 @@
#ifndef KEXIFORMPART_H
#define KEXIFORMPART_H
-#include <qdom.h>
-#include <qcstring.h>
+#include <tqdom.h>
+#include <tqcstring.h>
#include <kexi.h>
#include <kexipart.h>
@@ -49,9 +49,10 @@ class KexiDataSourcePage;
class KEXIFORMUTILS_EXPORT KexiFormPart : public KexiPart::Part
{
Q_OBJECT
+ TQ_OBJECT
public:
- KexiFormPart(QObject *parent, const char *name, const QStringList &);
+ KexiFormPart(TQObject *tqparent, const char *name, const TQStringList &);
virtual ~KexiFormPart();
//! \return a pointer to Forms Widget Library.
@@ -59,33 +60,33 @@ class KEXIFORMUTILS_EXPORT KexiFormPart : public KexiPart::Part
KexiDataSourcePage* dataSourcePage() const;
- void generateForm(KexiDB::FieldList *list, QDomDocument &domDoc);
+ void generateForm(KexiDB::FieldList *list, TQDomDocument &domDoc);
class TempData : public KexiDialogTempData
{
public:
- TempData(QObject* parent);
+ TempData(TQObject* tqparent);
~TempData();
- QGuardedPtr<KFormDesigner::Form> form;
- QGuardedPtr<KFormDesigner::Form> previewForm;
- QString tempForm;
- QPoint scrollViewContentsPos; //!< to preserve contents pos after switching to other view
+ TQGuardedPtr<KFormDesigner::Form> form;
+ TQGuardedPtr<KFormDesigner::Form> previewForm;
+ TQString tempForm;
+ TQPoint scrollViewContentsPos; //!< to preserve contents pos after switching to other view
int resizeMode; //!< form's window's resize mode -one of KexiFormView::ResizeMode items
//! Used in KexiFormView::setUnsavedLocalBLOBs()
- QMap<QWidget*, KexiBLOBBuffer::Id_t> unsavedLocalBLOBs;
+ TQMap<TQWidget*, KexiBLOBBuffer::Id_t> unsavedLocalBLOBs;
//! Used when loading a form from (temporary) XML in Data View
//! to get unsaved blobs collected at design mode.
- QMap<QCString, KexiBLOBBuffer::Id_t> unsavedLocalBLOBsByName;
+ TQMap<TQCString, KexiBLOBBuffer::Id_t> unsavedLocalBLOBsByName;
};
- virtual QString i18nMessage(const QCString& englishMessage,
+ virtual TQString i18nMessage(const TQCString& englishMessage,
KexiDialogBase* dlg) const;
protected:
virtual KexiDialogTempData* createTempData(KexiDialogBase* dialog);
- virtual KexiViewBase* createView(QWidget *parent, KexiDialogBase* dialog,
- KexiPart::Item &item, int viewMode = Kexi::DataViewMode, QMap<QString,QString>* staticObjectArgs = 0);
+ virtual KexiViewBase* createView(TQWidget *tqparent, KexiDialogBase* dialog,
+ KexiPart::Item &item, int viewMode = Kexi::DataViewMode, TQMap<TQString,TQString>* staticObjectArgs = 0);
virtual void initPartActions();
virtual void initInstanceActions();
@@ -96,8 +97,8 @@ class KEXIFORMUTILS_EXPORT KexiFormPart : public KexiPart::Part
protected slots:
void slotAutoTabStopsSet(KFormDesigner::Form *form, bool set);
void slotAssignAction();
- void slotPropertyChanged(QWidget *widget, const QCString &name, const QVariant &value);
- void slotWidgetCreatedByFormsLibrary(QWidget* widget);
+ void slotPropertyChanged(TQWidget *widget, const TQCString &name, const TQVariant &value);
+ void slotWidgetCreatedByFormsLibrary(TQWidget* widget);
private:
class Private;
diff --git a/kexi/plugins/forms/kexiformscrollview.cpp b/kexi/plugins/forms/kexiformscrollview.cpp
index 351a1e3e..2ddcb123 100644
--- a/kexi/plugins/forms/kexiformscrollview.cpp
+++ b/kexi/plugins/forms/kexiformscrollview.cpp
@@ -30,8 +30,8 @@
#include <kpopupmenu.h>
#include <kdebug.h>
-KexiFormScrollView::KexiFormScrollView(QWidget *parent, bool preview)
- : KexiScrollView(parent, preview)
+KexiFormScrollView::KexiFormScrollView(TQWidget *tqparent, bool preview)
+ : KexiScrollView(tqparent, preview)
, KexiRecordNavigatorHandler()
, KexiSharedActionClient()
, KexiDataAwareObjectInterface()
@@ -49,7 +49,7 @@ KexiFormScrollView::KexiFormScrollView(QWidget *parent, bool preview)
// recordNavigator()->showEditingIndicator(true);
}
- connect(this, SIGNAL(resizingStarted()), this, SLOT(slotResizingStarted()));
+ connect(this, TQT_SIGNAL(resizingStarted()), this, TQT_SLOT(slotResizingStarted()));
m_popupMenu = new KPopupMenu(this, "contextMenu");
@@ -71,7 +71,7 @@ KexiFormScrollView::show()
#if 0 //moved to KexiFormView, OK?
//now get resize mode settings for entire form
if (m_preview) {
- KexiFormView* fv = dynamic_cast<KexiFormView*>(parent());
+ KexiFormView* fv = dynamic_cast<KexiFormView*>(tqparent());
int resizeMode = fv ? fv->resizeMode() : KexiFormView::ResizeAuto;
if (resizeMode == KexiFormView::ResizeAuto)
setResizePolicy(AutoOneFit);
@@ -150,14 +150,14 @@ void KexiFormScrollView::moveToFirstRecordRequested()
selectFirstRow();
}
-void KexiFormScrollView::clearColumnsInternal(bool repaint)
+void KexiFormScrollView::clearColumnsInternal(bool tqrepaint)
{
- Q_UNUSED( repaint );
+ Q_UNUSED( tqrepaint );
//! @todo
}
-void KexiFormScrollView::addHeaderColumn(const QString& caption, const QString& description,
- const QIconSet& icon, int width)
+void KexiFormScrollView::addHeaderColumn(const TQString& caption, const TQString& description,
+ const TQIconSet& icon, int width)
{
Q_UNUSED( caption );
Q_UNUSED( description );
@@ -197,7 +197,7 @@ void KexiFormScrollView::updateGUIAfterSorting()
//! @todo
}
-void KexiFormScrollView::createEditor(int row, int col, const QString& addText,
+void KexiFormScrollView::createEditor(int row, int col, const TQString& addText,
bool removeOld)
{
Q_UNUSED( row );
@@ -238,7 +238,7 @@ void KexiFormScrollView::createEditor(int row, int col, const QString& addText,
updateWidgetContentsSize();
//refr. current and next row
// updateContents(columnPos(0), rowPos(row), viewport()->width(), d->rowHeight*2);
-//js: warning this breaks behaviour (cursor is skipping, etc.): qApp->processEvents(500);
+//js: warning this breaks behaviour (cursor is skipping, etc.): tqApp->processEvents(500);
// ensureVisible(columnPos(m_curCol), rowPos(row+1)+d->rowHeight-1, columnWidth(m_curCol), d->rowHeight);
// m_verticalHeader->setOffset(contentsY());
@@ -288,9 +288,9 @@ KexiDataItemInterface *KexiFormScrollView::editor( int col, bool ignoreMissingEd
return 0;
}
editor->hide();
- connect(editor,SIGNAL(editRequested()),this,SLOT(slotEditRequested()));
- connect(editor,SIGNAL(cancelRequested()),this,SLOT(cancelEditor()));
- connect(editor,SIGNAL(acceptRequested()),this,SLOT(acceptEditor()));
+ connect(editor,TQT_SIGNAL(editRequested()),this,TQT_SLOT(slotEditRequested()));
+ connect(editor,TQT_SIGNAL(cancelRequested()),this,TQT_SLOT(cancelEditor()));
+ connect(editor,TQT_SIGNAL(acceptRequested()),this,TQT_SLOT(acceptEditor()));
editor->resize(columnWidth(col)-1, rowHeight()-1);
editor->installEventFilter(this);
@@ -349,7 +349,7 @@ void KexiFormScrollView::slotRowRepaintRequested(KexiTableItem& item)
}
/*void KexiFormScrollView::slotAboutToDeleteRow(KexiTableItem& item,
- KexiDB::ResultInfo* result, bool repaint)
+ KexiDB::ResultInfo* result, bool tqrepaint)
{
//! @todo
}*/
@@ -359,22 +359,22 @@ void KexiFormScrollView::slotRowRepaintRequested(KexiTableItem& item)
//! @todo
}*/
-void KexiFormScrollView::slotRowInserted(KexiTableItem *item, bool repaint)
+void KexiFormScrollView::slotRowInserted(KexiTableItem *item, bool tqrepaint)
{
Q_UNUSED( item );
- Q_UNUSED( repaint );
+ Q_UNUSED( tqrepaint );
//! @todo
}
-void KexiFormScrollView::slotRowInserted(KexiTableItem *item, uint row, bool repaint)
+void KexiFormScrollView::slotRowInserted(KexiTableItem *item, uint row, bool tqrepaint)
{
Q_UNUSED( item );
Q_UNUSED( row );
- Q_UNUSED( repaint );
+ Q_UNUSED( tqrepaint );
//! @todo
}
-void KexiFormScrollView::slotRowsDeleted( const QValueList<int> & )
+void KexiFormScrollView::slotRowsDeleted( const TQValueList<int> & )
{
//! @todo
}
@@ -394,23 +394,23 @@ int KexiFormScrollView::columns() const
KexiFormDataItemInterface *item = dynamic_cast<KexiFormDataItemInterface*>(dbFormWidget()->orderedDataAwareWidgets()->at( col ));
if (!item)
return -1;
- KexiFormDataItemInterfaceToIntMap::ConstIterator it(m_fieldNumbersForDataItems.find( item ));
+ KexiFormDataItemInterfaceToIntMap::ConstIterator it(m_fieldNumbersForDataItems.tqfind( item ));
return it!=m_fieldNumbersForDataItems.constEnd() ? it.data() : -1;
}*/
bool KexiFormScrollView::columnEditable(int col)
{
kexipluginsdbg << "KexiFormScrollView::columnEditable(" << col << ")" << endl;
- foreach_list (QPtrListIterator<KexiFormDataItemInterface>, it, m_dataItems) {
- kexipluginsdbg << (dynamic_cast<QWidget*>(it.current()) ? dynamic_cast<QWidget*>(it.current())->name() : "" )
+ foreach_list (TQPtrListIterator<KexiFormDataItemInterface>, it, m_dataItems) {
+ kexipluginsdbg << (dynamic_cast<TQWidget*>(it.current()) ? dynamic_cast<TQWidget*>(it.current())->name() : "" )
<< " " << it.current()->dataSource() << endl;
}
kexipluginsdbg << "-- focus widgets --" << endl;
- foreach_list (QPtrListIterator<QWidget>, it, *dbFormWidget()->orderedFocusWidgets()) {
+ foreach_list (TQPtrListIterator<TQWidget>, it, *dbFormWidget()->orderedFocusWidgets()) {
kexipluginsdbg << it.current()->name() << endl;
}
kexipluginsdbg << "-- data-aware widgets --" << endl;
- foreach_list (QPtrListIterator<QWidget>, it, *dbFormWidget()->orderedDataAwareWidgets()) {
+ foreach_list (TQPtrListIterator<TQWidget>, it, *dbFormWidget()->orderedDataAwareWidgets()) {
kexipluginsdbg << it.current()->name() << endl;
}
@@ -421,7 +421,7 @@ bool KexiFormScrollView::columnEditable(int col)
if (!item || item->isReadOnly())
return false;
-// KexiFormDataItemInterfaceToIntMap::ConstIterator it(m_fieldNumbersForDataItems.find( item ));
+// KexiFormDataItemInterfaceToIntMap::ConstIterator it(m_fieldNumbersForDataItems.tqfind( item ));
// return KexiDataAwareObjectInterface::columnEditable( it!=m_fieldNumbersForDataItems.constEnd() ? it.data() : -1 );
return KexiDataAwareObjectInterface::columnEditable( col );
}
@@ -432,9 +432,9 @@ void KexiFormScrollView::valueChanged(KexiDataItemInterface* item)
return;
//only signal start editing when no row editing was started already
kexipluginsdbg << "** KexiFormScrollView::valueChanged(): editedItem="
- << (dbFormWidget()->editedItem ? dbFormWidget()->editedItem->value().toString() : QString::null)
+ << (dbFormWidget()->editedItem ? dbFormWidget()->editedItem->value().toString() : TQString())
<< ", "
- << (item ? item->value().toString() : QString::null)
+ << (item ? item->value().toString() : TQString())
<< endl;
if (dbFormWidget()->editedItem!=item) {
kexipluginsdbg << "**>>> dbFormWidget()->editedItem = dynamic_cast<KexiFormDataItemInterface*>(item)" << endl;
@@ -444,7 +444,7 @@ void KexiFormScrollView::valueChanged(KexiDataItemInterface* item)
fillDuplicatedDataItems(dynamic_cast<KexiFormDataItemInterface*>(item), item->value());
//value changed: clear 'default value' mode (e.g. a blue italic text)
- dynamic_cast<KexiFormDataItemInterface*>(item)->setDisplayDefaultValue(dynamic_cast<QWidget*>(item), false);
+ dynamic_cast<KexiFormDataItemInterface*>(item)->setDisplayDefaultValue(dynamic_cast<TQWidget*>(item), false);
}
bool KexiFormScrollView::cursorAtNewRow() const
@@ -497,7 +497,7 @@ bool KexiFormScrollView::cancelEditor()
const bool displayDefaultValue = shouldDisplayDefaultValueForItem(itemIface);
// now disable/enable "display default value" if needed (do it after setValue(), before setValue() turns it off)
if (itemIface->hasDisplayedDefaultValue() != displayDefaultValue)
- itemIface->setDisplayDefaultValue( dynamic_cast<QWidget*>(itemIface), displayDefaultValue );
+ itemIface->setDisplayDefaultValue( dynamic_cast<TQWidget*>(itemIface), displayDefaultValue );
fillDuplicatedDataItems(itemIface, m_editor->value());
@@ -507,17 +507,17 @@ bool KexiFormScrollView::cancelEditor()
void KexiFormScrollView::updateAfterCancelRowEdit()
{
- for (QPtrListIterator<KexiFormDataItemInterface> it(m_dataItems); it.current(); ++it) {
- if (dynamic_cast<QWidget*>(it.current())) {
+ for (TQPtrListIterator<KexiFormDataItemInterface> it(m_dataItems); it.current(); ++it) {
+ if (dynamic_cast<TQWidget*>(it.current())) {
kexipluginsdbg << "KexiFormScrollView::updateAfterCancelRowEdit(): "
- << dynamic_cast<QWidget*>(it.current())->className() << " "
- << dynamic_cast<QWidget*>(it.current())->name() << endl;
+ << dynamic_cast<TQWidget*>(it.current())->className() << " "
+ << dynamic_cast<TQWidget*>(it.current())->name() << endl;
}
KexiFormDataItemInterface *itemIface = it.current();
const bool displayDefaultValue = shouldDisplayDefaultValueForItem(itemIface);
itemIface->undoChanges();
if (itemIface->hasDisplayedDefaultValue() != displayDefaultValue)
- itemIface->setDisplayDefaultValue( dynamic_cast<QWidget*>(itemIface), displayDefaultValue );
+ itemIface->setDisplayDefaultValue( dynamic_cast<TQWidget*>(itemIface), displayDefaultValue );
}
recordNavigator()->showEditingIndicator(false);
dbFormWidget()->editedItem = 0;
@@ -549,15 +549,15 @@ void KexiFormScrollView::refreshContentsSize()
}
}
-void KexiFormScrollView::handleDataWidgetAction(const QString& actionName)
+void KexiFormScrollView::handleDataWidgetAction(const TQString& actionName)
{
- QWidget *w = focusWidget();
+ TQWidget *w = tqfocusWidget();
KexiFormDataItemInterface *item = 0;
while (w) {
item = dynamic_cast<KexiFormDataItemInterface*>(w);
if (item)
break;
- w = w->parentWidget();
+ w = w->tqparentWidget();
}
if (item)
item->handleAction(actionName);
diff --git a/kexi/plugins/forms/kexiformscrollview.h b/kexi/plugins/forms/kexiformscrollview.h
index 12315761..cf2731d1 100644
--- a/kexi/plugins/forms/kexiformscrollview.h
+++ b/kexi/plugins/forms/kexiformscrollview.h
@@ -47,10 +47,11 @@ class KEXIFORMUTILS_EXPORT KexiFormScrollView :
public KexiFormEventHandler
{
Q_OBJECT
+ TQ_OBJECT
KEXI_DATAAWAREOBJECTINTERFACE
public:
- KexiFormScrollView(QWidget *parent, bool preview);
+ KexiFormScrollView(TQWidget *tqparent, bool preview);
virtual ~KexiFormScrollView();
void setForm(KFormDesigner::Form *form) { m_form = form; }
@@ -78,7 +79,7 @@ class KEXIFORMUTILS_EXPORT KexiFormScrollView :
dbFormWidget()->orderedDataAwareWidgets()->at( col ));
if (!item)
return -1;
- KexiFormDataItemInterfaceToIntMap::ConstIterator it(m_fieldNumbersForDataItems.find( item ));
+ KexiFormDataItemInterfaceToIntMap::ConstIterator it(m_fieldNumbersForDataItems.tqfind( item ));
return it!=m_fieldNumbersForDataItems.constEnd() ? (int)it.data() : -1;
}
@@ -93,7 +94,7 @@ class KEXIFORMUTILS_EXPORT KexiFormScrollView :
virtual int lastVisibleRow() const;
/*! \return vertical scrollbar. Implemented for KexiDataAwareObjectInterface. */
- virtual QScrollBar* verticalScrollBar() const { return KexiScrollView::verticalScrollBar(); }
+ virtual TQScrollBar* verticalScrollBar() const { return KexiScrollView::verticalScrollBar(); }
public slots:
/*! Reimplemented to update resize policy. */
@@ -141,7 +142,7 @@ class KEXIFORMUTILS_EXPORT KexiFormScrollView :
signals:
virtual void itemChanged(KexiTableItem *, int row, int col);
- virtual void itemChanged(KexiTableItem *, int row, int col, QVariant oldValue);
+ virtual void itemChanged(KexiTableItem *, int row, int col, TQVariant oldValue);
virtual void itemDeleteRequest(KexiTableItem *, int row, int col);
virtual void currentItemDeleteRequest();
virtual void newItemAppendedForAfterDeletingInSpreadSheetMode(); //!< does nothing
@@ -161,19 +162,19 @@ class KEXIFORMUTILS_EXPORT KexiFormScrollView :
virtual void slotRowRepaintRequested(KexiTableItem& item);
//! Handles KexiTableViewData::aboutToDeleteRow() signal. Prepares info for slotRowDeleted().
- virtual void slotAboutToDeleteRow(KexiTableItem& item, KexiDB::ResultInfo* result, bool repaint)
- { KexiDataAwareObjectInterface::slotAboutToDeleteRow(item, result, repaint); }
+ virtual void slotAboutToDeleteRow(KexiTableItem& item, KexiDB::ResultInfo* result, bool tqrepaint)
+ { KexiDataAwareObjectInterface::slotAboutToDeleteRow(item, result, tqrepaint); }
- //! Handles KexiTableViewData::rowDeleted() signal to repaint when needed.
+ //! Handles KexiTableViewData::rowDeleted() signal to tqrepaint when needed.
virtual void slotRowDeleted() { KexiDataAwareObjectInterface::slotRowDeleted(); }
- //! Handles KexiTableViewData::rowInserted() signal to repaint when needed.
- virtual void slotRowInserted(KexiTableItem *item, bool repaint);
+ //! Handles KexiTableViewData::rowInserted() signal to tqrepaint when needed.
+ virtual void slotRowInserted(KexiTableItem *item, bool tqrepaint);
//! Like above, not db-aware version
- virtual void slotRowInserted(KexiTableItem *item, uint row, bool repaint);
+ virtual void slotRowInserted(KexiTableItem *item, uint row, bool tqrepaint);
- virtual void slotRowsDeleted( const QValueList<int> & );
+ virtual void slotRowsDeleted( const TQValueList<int> & );
virtual void slotDataDestroying() { KexiDataAwareObjectInterface::slotDataDestroying(); }
@@ -192,11 +193,11 @@ class KEXIFORMUTILS_EXPORT KexiFormScrollView :
protected:
//! Implementation for KexiDataAwareObjectInterface
- virtual void clearColumnsInternal(bool repaint);
+ virtual void clearColumnsInternal(bool tqrepaint);
//! Implementation for KexiDataAwareObjectInterface
- virtual void addHeaderColumn(const QString& caption, const QString& description,
- const QIconSet& icon, int width);
+ virtual void addHeaderColumn(const TQString& caption, const TQString& description,
+ const TQIconSet& icon, int width);
//! Implementation for KexiDataAwareObjectInterface
virtual int currentLocalSortingOrder() const;
@@ -214,7 +215,7 @@ class KEXIFORMUTILS_EXPORT KexiFormScrollView :
virtual void updateGUIAfterSorting();
//! Implementation for KexiDataAwareObjectInterface
- virtual void createEditor(int row, int col, const QString& addText = QString::null,
+ virtual void createEditor(int row, int col, const TQString& addText = TQString(),
bool removeOld = false);
//! Implementation for KexiDataAwareObjectInterface
@@ -240,12 +241,12 @@ class KEXIFORMUTILS_EXPORT KexiFormScrollView :
/*! Implementation for KexiDataAwareObjectInterface
Implementation for KexiDataAwareObjectInterface
- Updates widget's contents size e.g. using QScrollView::resizeContents(). */
+ Updates widget's contents size e.g. using TQScrollView::resizeContents(). */
virtual void updateWidgetContentsSize();
/*! Implementation for KexiDataAwareObjectInterface
Updates scrollbars of the widget.
- QScrollView::updateScrollbars() will be usually called here. */
+ TQScrollView::updateScrollbars() will be usually called here. */
virtual void updateWidgetScrollBars();
KexiDBForm* dbFormWidget() const;
@@ -281,7 +282,7 @@ class KEXIFORMUTILS_EXPORT KexiFormScrollView :
/*! @internal
Used to invoke copy/paste/cut etc. actions at the focused widget's level. */
- void handleDataWidgetAction(const QString& actionName);
+ void handleDataWidgetAction(const TQString& actionName);
/*! @internal */
bool shouldDisplayDefaultValueForItem(KexiFormDataItemInterface* itemIface) const;
diff --git a/kexi/plugins/forms/kexiformview.cpp b/kexi/plugins/forms/kexiformview.cpp
index 7e52e5b6..9a14a0c9 100644
--- a/kexi/plugins/forms/kexiformview.cpp
+++ b/kexi/plugins/forms/kexiformview.cpp
@@ -20,8 +20,8 @@
#include "kexiformview.h"
-#include <qobjectlist.h>
-#include <qfileinfo.h>
+#include <tqobjectlist.h>
+#include <tqfileinfo.h>
#include <formeditor/form.h>
#include <formeditor/formIO.h>
@@ -60,9 +60,9 @@
//! @todo #define KEXI_SHOW_SPLITTER_WIDGET
-KexiFormView::KexiFormView(KexiMainWindow *mainWin, QWidget *parent,
+KexiFormView::KexiFormView(KexiMainWindow *mainWin, TQWidget *tqparent,
const char *name, bool /*dbAware*/)
- : KexiDataAwareView( mainWin, parent, name )
+ : KexiDataAwareView( mainWin, tqparent, name )
, m_propertySet(0)
, m_resizeMode(KexiFormView::ResizeDefault)
, m_query(0)
@@ -72,7 +72,7 @@ KexiFormView::KexiFormView(KexiMainWindow *mainWin, QWidget *parent,
{
m_delayedFormContentsResizeOnShow = 0;
- QHBoxLayout *l = new QHBoxLayout(this);
+ TQHBoxLayout *l = new TQHBoxLayout(this);
l->setAutoAdd(true);
m_scrollView = new KexiFormScrollView(this, viewMode()==Kexi::DataViewMode);
@@ -81,8 +81,8 @@ KexiFormView::KexiFormView(KexiMainWindow *mainWin, QWidget *parent,
// m_scrollView->show();
m_dbform = new KexiDBForm(m_scrollView->viewport(), m_scrollView, name/*, conn*/);
-// m_dbform->resize( m_scrollView->viewport()->size() - QSize(20, 20) );
-// m_dbform->resize(QSize(400, 300));
+// m_dbform->resize( m_scrollView->viewport()->size() - TQSize(20, 20) );
+// m_dbform->resize(TQSize(400, 300));
m_scrollView->setWidget(m_dbform);
m_scrollView->setResizingEnabled(viewMode()!=Kexi::DataViewMode);
@@ -90,68 +90,68 @@ KexiFormView::KexiFormView(KexiMainWindow *mainWin, QWidget *parent,
if (viewMode()==Kexi::DataViewMode) {
m_scrollView->recordNavigator()->setRecordHandler( m_scrollView );
- m_scrollView->viewport()->setPaletteBackgroundColor(m_dbform->palette().active().background());
-//moved to formmanager connect(formPart()->manager(), SIGNAL(noFormSelected()), SLOT(slotNoFormSelected()));
+ m_scrollView->viewport()->setPaletteBackgroundColor(m_dbform->tqpalette().active().background());
+//moved to formmanager connect(formPart()->manager(), TQT_SIGNAL(noFormSelected()), TQT_SLOT(slotNoFormSelected()));
}
else
{
- connect(KFormDesigner::FormManager::self(), SIGNAL(propertySetSwitched(KoProperty::Set*, bool, const QCString&)),
- this, SLOT(slotPropertySetSwitched(KoProperty::Set*, bool, const QCString&)));
- connect(KFormDesigner::FormManager::self(), SIGNAL(dirty(KFormDesigner::Form *, bool)),
- this, SLOT(slotDirty(KFormDesigner::Form *, bool)));
+ connect(KFormDesigner::FormManager::self(), TQT_SIGNAL(propertySetSwitched(KoProperty::Set*, bool, const TQCString&)),
+ this, TQT_SLOT(slotPropertySetSwitched(KoProperty::Set*, bool, const TQCString&)));
+ connect(KFormDesigner::FormManager::self(), TQT_SIGNAL(dirty(KFormDesigner::Form *, bool)),
+ this, TQT_SLOT(slotDirty(KFormDesigner::Form *, bool)));
- connect(m_dbform, SIGNAL(handleDragMoveEvent(QDragMoveEvent*)),
- this, SLOT(slotHandleDragMoveEvent(QDragMoveEvent*)));
- connect(m_dbform, SIGNAL(handleDropEvent(QDropEvent*)),
- this, SLOT(slotHandleDropEvent(QDropEvent*)));
+ connect(m_dbform, TQT_SIGNAL(handleDragMoveEvent(TQDragMoveEvent*)),
+ this, TQT_SLOT(slotHandleDragMoveEvent(TQDragMoveEvent*)));
+ connect(m_dbform, TQT_SIGNAL(handleDropEvent(TQDropEvent*)),
+ this, TQT_SLOT(slotHandleDropEvent(TQDropEvent*)));
// action stuff
- plugSharedAction("formpart_taborder", KFormDesigner::FormManager::self(), SLOT(editTabOrder()));
- plugSharedAction("formpart_adjust_size", KFormDesigner::FormManager::self(), SLOT(adjustWidgetSize()));
-//TODO plugSharedAction("formpart_pixmap_collection", formPart()->manager(), SLOT(editFormPixmapCollection()));
-//TODO plugSharedAction("formpart_connections", formPart()->manager(), SLOT(editConnections()));
-
- plugSharedAction("edit_copy", KFormDesigner::FormManager::self(), SLOT(copyWidget()));
- plugSharedAction("edit_cut", KFormDesigner::FormManager::self(), SLOT(cutWidget()));
- plugSharedAction("edit_paste", KFormDesigner::FormManager::self(), SLOT(pasteWidget()));
- plugSharedAction("edit_delete", KFormDesigner::FormManager::self(), SLOT(deleteWidget()));
- plugSharedAction("edit_select_all", KFormDesigner::FormManager::self(), SLOT(selectAll()));
- plugSharedAction("formpart_clear_contents", KFormDesigner::FormManager::self(), SLOT(clearWidgetContent()));
- plugSharedAction("edit_undo", KFormDesigner::FormManager::self(), SLOT(undo()));
- plugSharedAction("edit_redo", KFormDesigner::FormManager::self(), SLOT(redo()));
+ plugSharedAction("formpart_taborder", KFormDesigner::FormManager::self(), TQT_SLOT(editTabOrder()));
+ plugSharedAction("formpart_adjust_size", KFormDesigner::FormManager::self(), TQT_SLOT(adjustWidgetSize()));
+//TODO plugSharedAction("formpart_pixmap_collection", formPart()->manager(), TQT_SLOT(editFormPixmapCollection()));
+//TODO plugSharedAction("formpart_connections", formPart()->manager(), TQT_SLOT(editConnections()));
+
+ plugSharedAction("edit_copy", KFormDesigner::FormManager::self(), TQT_SLOT(copyWidget()));
+ plugSharedAction("edit_cut", KFormDesigner::FormManager::self(), TQT_SLOT(cutWidget()));
+ plugSharedAction("edit_paste", KFormDesigner::FormManager::self(), TQT_SLOT(pasteWidget()));
+ plugSharedAction("edit_delete", KFormDesigner::FormManager::self(), TQT_SLOT(deleteWidget()));
+ plugSharedAction("edit_select_all", KFormDesigner::FormManager::self(), TQT_SLOT(selectAll()));
+ plugSharedAction("formpart_clear_contents", KFormDesigner::FormManager::self(), TQT_SLOT(clearWidgetContent()));
+ plugSharedAction("edit_undo", KFormDesigner::FormManager::self(), TQT_SLOT(undo()));
+ plugSharedAction("edit_redo", KFormDesigner::FormManager::self(), TQT_SLOT(redo()));
plugSharedAction("formpart_layout_menu", KFormDesigner::FormManager::self(), 0 );
- plugSharedAction("formpart_layout_hbox", KFormDesigner::FormManager::self(), SLOT(layoutHBox()) );
- plugSharedAction("formpart_layout_vbox", KFormDesigner::FormManager::self(), SLOT(layoutVBox()) );
- plugSharedAction("formpart_layout_grid", KFormDesigner::FormManager::self(), SLOT(layoutGrid()) );
+ plugSharedAction("formpart_layout_hbox", KFormDesigner::FormManager::self(), TQT_SLOT(tqlayoutHBox()) );
+ plugSharedAction("formpart_layout_vbox", KFormDesigner::FormManager::self(), TQT_SLOT(tqlayoutVBox()) );
+ plugSharedAction("formpart_layout_grid", KFormDesigner::FormManager::self(), TQT_SLOT(tqlayoutGrid()) );
#ifdef KEXI_SHOW_SPLITTER_WIDGET
- plugSharedAction("formpart_layout_hsplitter", KFormDesigner::FormManager::self(), SLOT(layoutHSplitter()) );
- plugSharedAction("formpart_layout_vsplitter", KFormDesigner::FormManager::self(), SLOT(layoutVSplitter()) );
+ plugSharedAction("formpart_layout_hsplitter", KFormDesigner::FormManager::self(), TQT_SLOT(tqlayoutHSplitter()) );
+ plugSharedAction("formpart_layout_vsplitter", KFormDesigner::FormManager::self(), TQT_SLOT(tqlayoutVSplitter()) );
#endif
- plugSharedAction("formpart_break_layout", KFormDesigner::FormManager::self(), SLOT(breakLayout()) );
+ plugSharedAction("formpart_break_layout", KFormDesigner::FormManager::self(), TQT_SLOT(breakLayout()) );
- plugSharedAction("formpart_format_raise", KFormDesigner::FormManager::self(), SLOT(bringWidgetToFront()) );
- plugSharedAction("formpart_format_lower", KFormDesigner::FormManager::self(), SLOT(sendWidgetToBack()) );
+ plugSharedAction("formpart_format_raise", KFormDesigner::FormManager::self(), TQT_SLOT(bringWidgetToFront()) );
+ plugSharedAction("formpart_format_lower", KFormDesigner::FormManager::self(), TQT_SLOT(sendWidgetToBack()) );
plugSharedAction("other_widgets_menu", KFormDesigner::FormManager::self(), 0 );
setAvailable("other_widgets_menu", true);
plugSharedAction("formpart_align_menu", KFormDesigner::FormManager::self(), 0 );
- plugSharedAction("formpart_align_to_left", KFormDesigner::FormManager::self(),SLOT(alignWidgetsToLeft()) );
- plugSharedAction("formpart_align_to_right", KFormDesigner::FormManager::self(), SLOT(alignWidgetsToRight()) );
- plugSharedAction("formpart_align_to_top", KFormDesigner::FormManager::self(), SLOT(alignWidgetsToTop()) );
- plugSharedAction("formpart_align_to_bottom", KFormDesigner::FormManager::self(), SLOT(alignWidgetsToBottom()) );
- plugSharedAction("formpart_align_to_grid", KFormDesigner::FormManager::self(), SLOT(alignWidgetsToGrid()) );
+ plugSharedAction("formpart_align_to_left", KFormDesigner::FormManager::self(),TQT_SLOT(alignWidgetsToLeft()) );
+ plugSharedAction("formpart_align_to_right", KFormDesigner::FormManager::self(), TQT_SLOT(alignWidgetsToRight()) );
+ plugSharedAction("formpart_align_to_top", KFormDesigner::FormManager::self(), TQT_SLOT(alignWidgetsToTop()) );
+ plugSharedAction("formpart_align_to_bottom", KFormDesigner::FormManager::self(), TQT_SLOT(alignWidgetsToBottom()) );
+ plugSharedAction("formpart_align_to_grid", KFormDesigner::FormManager::self(), TQT_SLOT(alignWidgetsToGrid()) );
plugSharedAction("formpart_adjust_size_menu", KFormDesigner::FormManager::self(), 0 );
- plugSharedAction("formpart_adjust_to_fit", KFormDesigner::FormManager::self(), SLOT(adjustWidgetSize()) );
- plugSharedAction("formpart_adjust_size_grid", KFormDesigner::FormManager::self(), SLOT(adjustSizeToGrid()) );
- plugSharedAction("formpart_adjust_height_small", KFormDesigner::FormManager::self(), SLOT(adjustHeightToSmall()) );
- plugSharedAction("formpart_adjust_height_big", KFormDesigner::FormManager::self(), SLOT(adjustHeightToBig()) );
- plugSharedAction("formpart_adjust_width_small", KFormDesigner::FormManager::self(), SLOT(adjustWidthToSmall()) );
- plugSharedAction("formpart_adjust_width_big", KFormDesigner::FormManager::self(), SLOT(adjustWidthToBig()) );
-
- plugSharedAction("format_font", KFormDesigner::FormManager::self(), SLOT(changeFont()) );
+ plugSharedAction("formpart_adjust_to_fit", KFormDesigner::FormManager::self(), TQT_SLOT(adjustWidgetSize()) );
+ plugSharedAction("formpart_adjust_size_grid", KFormDesigner::FormManager::self(), TQT_SLOT(adjustSizeToGrid()) );
+ plugSharedAction("formpart_adjust_height_small", KFormDesigner::FormManager::self(), TQT_SLOT(adjustHeightToSmall()) );
+ plugSharedAction("formpart_adjust_height_big", KFormDesigner::FormManager::self(), TQT_SLOT(adjustHeightToBig()) );
+ plugSharedAction("formpart_adjust_width_small", KFormDesigner::FormManager::self(), TQT_SLOT(adjustWidthToSmall()) );
+ plugSharedAction("formpart_adjust_width_big", KFormDesigner::FormManager::self(), TQT_SLOT(adjustWidthToBig()) );
+
+ plugSharedAction("format_font", KFormDesigner::FormManager::self(), TQT_SLOT(changeFont()) );
}
initForm();
@@ -159,15 +159,15 @@ KexiFormView::KexiFormView(KexiMainWindow *mainWin, QWidget *parent,
KexiDataAwareView::init( m_scrollView, m_scrollView, m_scrollView,
/* skip data-awarness if design mode */ viewMode()==Kexi::DesignViewMode );
- connect(this, SIGNAL(focus(bool)), this, SLOT(slotFocus(bool)));
+ connect(this, TQT_SIGNAL(focus(bool)), this, TQT_SLOT(slotFocus(bool)));
/// @todo skip this if ther're no borders
-// m_dbform->resize( m_dbform->size()+QSize(m_scrollView->verticalScrollBar()->width(), m_scrollView->horizontalScrollBar()->height()) );
+// m_dbform->resize( m_dbform->size()+TQSize(m_scrollView->verticalScrollBar()->width(), m_scrollView->horizontalScrollBar()->height()) );
}
KexiFormView::~KexiFormView()
{
if (m_cursor) {
- KexiDB::Connection *conn = parentDialog()->mainWin()->project()->dbConnection();
+ KexiDB::Connection *conn = tqparentDialog()->mainWin()->project()->dbConnection();
conn->deleteCursor(m_cursor);
m_cursor = 0;
}
@@ -184,7 +184,7 @@ void
KexiFormView::deleteQuery()
{
if (m_cursor) {
- KexiDB::Connection *conn = parentDialog()->mainWin()->project()->dbConnection();
+ KexiDB::Connection *conn = tqparentDialog()->mainWin()->project()->dbConnection();
conn->deleteCursor(m_cursor);
m_cursor = 0;
}
@@ -225,17 +225,17 @@ KexiFormView::initForm()
if (viewMode()==Kexi::DesignViewMode) {
//we want to be informed about executed commands
- connect(form()->commandHistory(), SIGNAL(commandExecuted()),
- KFormDesigner::FormManager::self(), SLOT(slotHistoryCommandExecuted()));
+ connect(form()->commandHistory(), TQT_SIGNAL(commandExecuted()),
+ KFormDesigner::FormManager::self(), TQT_SLOT(slotHistoryCommandExecuted()));
}
- const bool newForm = parentDialog()->id() < 0;
+ const bool newForm = tqparentDialog()->id() < 0;
KexiDB::FieldList *fields = 0;
if (newForm) {
// Show the form wizard if this is a new Form
#ifndef NO_DSWIZARD
- KexiDataSourceWizard *w = new KexiDataSourceWizard(mainWin(), (QWidget*)mainWin(), "datasource_wizard");
+ KexiDataSourceWizard *w = new KexiDataSourceWizard(mainWin(), (TQWidget*)mainWin(), "datasource_wizard");
if(!w->exec())
fields = 0;
else
@@ -246,7 +246,7 @@ KexiFormView::initForm()
if(fields)
{
- QDomDocument dom;
+ TQDomDocument dom;
formPart()->generateForm(fields, dom);
KFormDesigner::FormIO::loadFormFromDom(form(), m_dbform, dom);
//! @todo handle errors
@@ -267,8 +267,8 @@ KexiFormView::initForm()
m_scrollView->setForm(form());
// m_dbform->updateTabStopsOrder(form());
-// QSize s = m_dbform->size();
-// QApplication::sendPostedEvents();
+// TQSize s = m_dbform->size();
+// TQApplication::sendPostedEvents();
// m_scrollView->resize( s );
// m_dbform->resize(s);
m_scrollView->refreshContentsSize();
@@ -294,9 +294,9 @@ void KexiFormView::updateAutoFieldsDataSource()
//-inherit captions
//-inherit data types
//(this data has not been stored in the form)
- QString dataSourceString( m_dbform->dataSource() );
- QCString dataSourceMimeTypeString( m_dbform->dataSourceMimeType() );
- KexiDB::Connection *conn = parentDialog()->mainWin()->project()->dbConnection();
+ TQString dataSourceString( m_dbform->dataSource() );
+ TQCString dataSourceMimeTypeString( m_dbform->dataSourceMimeType() );
+ KexiDB::Connection *conn = tqparentDialog()->mainWin()->project()->dbConnection();
KexiDB::TableOrQuerySchema tableOrQuery(
conn, dataSourceString.latin1(), dataSourceMimeTypeString=="kexi/table");
if (!tableOrQuery.table() && !tableOrQuery.query())
@@ -323,9 +323,9 @@ void KexiFormView::updateValuesForSubproperties()
//-inherit captions
//-inherit data types
//(this data has not been stored in the form)
- QString dataSourceString( m_dbform->dataSource() );
- QCString dataSourceMimeTypeString( m_dbform->dataSourceMimeType() );
- KexiDB::Connection *conn = parentDialog()->mainWin()->project()->dbConnection();
+ TQString dataSourceString( m_dbform->dataSource() );
+ TQCString dataSourceMimeTypeString( m_dbform->dataSourceMimeType() );
+ KexiDB::Connection *conn = tqparentDialog()->mainWin()->project()->dbConnection();
KexiDB::TableOrQuerySchema tableOrQuery(
conn, dataSourceString.latin1(), dataSourceMimeTypeString=="kexi/table");
if (!tableOrQuery.table() && !tableOrQuery.query())
@@ -339,22 +339,22 @@ void KexiFormView::updateValuesForSubproperties()
KFormDesigner::WidgetWithSubpropertiesInterface* subpropIface
= dynamic_cast<KFormDesigner::WidgetWithSubpropertiesInterface*>( it.current()->widget() );
if (subpropIface && subpropIface->subwidget() && it.current()->subproperties() ) {
- QWidget *subwidget = subpropIface->subwidget();
- QMap<QString, QVariant>* subprops = it.current()->subproperties();
- for (QMapConstIterator<QString, QVariant> subpropIt = subprops->constBegin(); subpropIt!=subprops->constEnd(); ++subpropIt) {
+ TQWidget *subwidget = subpropIface->subwidget();
+ TQMap<TQString, TQVariant>* subprops = it.current()->subproperties();
+ for (TQMapConstIterator<TQString, TQVariant> subpropIt = subprops->constBegin(); subpropIt!=subprops->constEnd(); ++subpropIt) {
kexipluginsdbg << "KexiFormView::loadForm(): delayed setting of the subproperty: widget="
<< it.current()->widget()->name() << " prop=" << subpropIt.key() << " val=" << subpropIt.data() << endl;
- const int count = subwidget->metaObject()->findProperty(subpropIt.key().latin1(), true);
- const QMetaProperty *meta = count!=-1 ? subwidget->metaObject()->property(count, true) : 0;
+ const int count = subwidget->tqmetaObject()->tqfindProperty(subpropIt.key().latin1(), true);
+ const TQMetaProperty *meta = count!=-1 ? subwidget->tqmetaObject()->property(count, true) : 0;
if (meta) {
// Special case: the property value of type enum (set) but is saved as a string list,
// not as int, so we need to translate it to int. It's been created as such
- // by FormIO::readPropertyValue(). Example: "alignment" property.
- if (meta->isSetType() && subpropIt.data().type()==QVariant::StringList) {
- QStrList keys;
- const QStringList list( subpropIt.data().toStringList() );
- for (QStringList::ConstIterator it = list.constBegin(); it != list.constEnd(); ++it)
+ // by FormIO::readPropertyValue(). Example: "tqalignment" property.
+ if (meta->isSetType() && subpropIt.data().type()==TQVariant::StringList) {
+ TQStrList keys;
+ const TQStringList list( subpropIt.data().toStringList() );
+ for (TQStringList::ConstIterator it = list.constBegin(); it != list.constEnd(); ++it)
keys.append((*it).latin1());
subwidget->setProperty( subpropIt.key().latin1(), meta->keysToValue(keys) );
}
@@ -369,19 +369,19 @@ void KexiFormView::updateValuesForSubproperties()
//! Used in KexiFormView::loadForm()
static void setUnsavedBLOBIdsForDataViewMode(
- QWidget* widget, const QMap<QCString, KexiBLOBBuffer::Id_t>& unsavedLocalBLOBsByName)
+ TQWidget* widget, const TQMap<TQCString, KexiBLOBBuffer::Id_t>& unsavedLocalBLOBsByName)
{
- if (-1 != widget->metaObject()->findProperty("pixmapId")) {
+ if (-1 != widget->tqmetaObject()->tqfindProperty("pixmapId")) {
const KexiBLOBBuffer::Id_t blobID = unsavedLocalBLOBsByName[ widget->name() ];
if (blobID > 0)
- widget->setProperty("pixmapId", (uint /* KexiBLOBBuffer::Id_t is unsafe and unsupported by QVariant - will be fixed in Qt4*/)blobID);
+ widget->setProperty("pixmapId", (uint /* KexiBLOBBuffer::Id_t is unsafe and unsupported by TQVariant - will be fixed in TQt4*/)blobID);
}
- const QObjectList *list = widget->children();
- if (!list)
+ const TQObjectList list = widget->childrenListObject();
+ if (list.isEmpty())
return;
- for (QObjectListIterator it(*list); it.current(); ++it) {
- if (dynamic_cast<QWidget*>(it.current()))
- setUnsavedBLOBIdsForDataViewMode(dynamic_cast<QWidget*>(it.current()), unsavedLocalBLOBsByName);
+ for (TQObjectListIterator it(list); it.current(); ++it) {
+ if (dynamic_cast<TQWidget*>(it.current()))
+ setUnsavedBLOBIdsForDataViewMode(dynamic_cast<TQWidget*>(it.current()), unsavedLocalBLOBsByName);
}
}
@@ -390,7 +390,7 @@ KexiFormView::loadForm()
{
//@todo also load m_resizeMode !
- kexipluginsdbg << "KexiFormView::loadForm() Loading the form with id : " << parentDialog()->id() << endl;
+ kexipluginsdbg << "KexiFormView::loadForm() Loading the form with id : " << tqparentDialog()->id() << endl;
// If we are previewing the Form, use the tempData instead of the form stored in the db
if(viewMode()==Kexi::DataViewMode && !tempData()->tempForm.isNull() )
{
@@ -402,7 +402,7 @@ KexiFormView::loadForm()
}
// normal load
- QString data;
+ TQString data;
loadDataBlock(data);
KFormDesigner::FormIO::loadFormFromString(form(), m_dbform, data);
@@ -414,9 +414,9 @@ KexiFormView::loadForm()
}
void
-KexiFormView::slotPropertySetSwitched(KoProperty::Set *set, bool forceReload, const QCString& propertyToSelect)
+KexiFormView::slotPropertySetSwitched(KoProperty::Set *set, bool forceReload, const TQCString& propertyToSelect)
{
-// if (set && parentDialog()!=parentDialog()->mainWin()->currentDialog())
+// if (set && tqparentDialog()!=tqparentDialog()->mainWin()->currentDialog())
if (form() != KFormDesigner::FormManager::self()->activeForm())
return; //this is not the current form view
m_propertySet = set;
@@ -441,7 +441,7 @@ KexiFormView::beforeSwitchTo(int mode, bool &dontStore)
else {
//remember our pos
tempData()->scrollViewContentsPos
- = QPoint(m_scrollView->contentsX(), m_scrollView->contentsY());
+ = TQPoint(m_scrollView->contentsX(), m_scrollView->contentsY());
}
}
@@ -454,7 +454,7 @@ KexiFormView::beforeSwitchTo(int mode, bool &dontStore)
//collect blobs from design mode by name for use in data view mode
temp->unsavedLocalBLOBsByName.clear();
- for (QMapConstIterator<QWidget*, KexiBLOBBuffer::Id_t> it = temp->unsavedLocalBLOBs.constBegin();
+ for (TQMapConstIterator<TQWidget*, KexiBLOBBuffer::Id_t> it = temp->unsavedLocalBLOBs.constBegin();
it!=temp->unsavedLocalBLOBs.constEnd(); ++it)
{
if (!it.key())
@@ -470,8 +470,8 @@ tristate
KexiFormView::afterSwitchFrom(int mode)
{
if (mode == 0 || mode == Kexi::DesignViewMode) {
- if (parentDialog()->neverSaved()) {
- m_dbform->resize(QSize(400, 300));
+ if (tqparentDialog()->neverSaved()) {
+ m_dbform->resize(TQSize(400, 300));
m_scrollView->refreshContentsSizeLater(true,true);
//m_delayedFormContentsResizeOnShow = false;
}
@@ -521,16 +521,16 @@ KexiFormView::afterSwitchFrom(int mode)
initDataSource();
//handle events for this form
- m_scrollView->setMainWidgetForEventHandling(parentDialog()->mainWin(), m_dbform);
+ m_scrollView->setMainWidgetForEventHandling(tqparentDialog()->mainWin(), m_dbform);
//set focus on 1st focusable widget which has valid dataSource property set
if (!m_dbform->orderedFocusWidgets()->isEmpty()) {
-// QWidget *www = focusWidget();
- //if (Kexi::hasParent(this, qApp->focusWidget())) {
- KexiUtils::unsetFocusWithReason(qApp->focusWidget(), QFocusEvent::Tab);
+// TQWidget *www = tqfocusWidget();
+ //if (Kexi::hasParent(this, tqApp->tqfocusWidget())) {
+ KexiUtils::unsetFocusWithReason(tqApp->tqfocusWidget(), TQFocusEvent::Tab);
//}
- QPtrListIterator<QWidget> it(*m_dbform->orderedFocusWidgets());
+ TQPtrListIterator<TQWidget> it(*m_dbform->orderedFocusWidgets());
for (;it.current(); ++it) {
KexiFormDataItemInterface *iface = dynamic_cast<KexiFormDataItemInterface*>(it.current());
if (iface)
@@ -545,7 +545,7 @@ KexiFormView::afterSwitchFrom(int mode)
it.toFirst();
it.current()->setFocus();
- KexiUtils::setFocusWithReason(it.current(), QFocusEvent::Tab);
+ KexiUtils::setFocusWithReason(it.current(), TQFocusEvent::Tab);
m_setFocusInternalOnce = it.current();
}
@@ -555,7 +555,7 @@ KexiFormView::afterSwitchFrom(int mode)
//dirty only if it's a new object
if (mode == 0)
- setDirty( parentDialog()->partItem()->neverSaved() );
+ setDirty( tqparentDialog()->partItem()->neverSaved() );
if (mode==Kexi::DataViewMode && viewMode()==Kexi::DesignViewMode) {
// slotPropertySetSwitched
@@ -568,8 +568,8 @@ KexiFormView::afterSwitchFrom(int mode)
void KexiFormView::initDataSource()
{
deleteQuery();
- QString dataSourceString( m_dbform->dataSource() );
- QCString dataSourceMimeTypeString( m_dbform->dataSourceMimeType() );
+ TQString dataSourceString( m_dbform->dataSource() );
+ TQCString dataSourceMimeTypeString( m_dbform->dataSourceMimeType() );
//! @todo also handle anonymous (not stored) queries provided as statements here
bool ok = !dataSourceString.isEmpty();
@@ -581,7 +581,7 @@ void KexiFormView::initDataSource()
KexiDB::TableSchema *tableSchema = 0;
KexiDB::Connection *conn = 0;
- QStringList sources;
+ TQStringList sources;
bool forceReadOnlyDataSource = false;
if (ok) {
@@ -590,7 +590,7 @@ void KexiFormView::initDataSource()
//collect all data-aware widgets and create query schema
m_scrollView->setMainDataSourceWidget(m_dbform);
sources = m_scrollView->usedDataSources();
- conn = parentDialog()->mainWin()->project()->dbConnection();
+ conn = tqparentDialog()->mainWin()->project()->dbConnection();
if (dataSourceMimeTypeString.isEmpty() /*table type is the default*/
|| dataSourceMimeTypeString=="kexi/table")
{
@@ -627,7 +627,7 @@ void KexiFormView::initDataSource()
}
}
- QDict<char> invalidSources(997);
+ TQDict<char> invalidSources(997);
if (ok) {
KexiDB::IndexSchema *pkey = tableSchema ? tableSchema->primaryKey() : 0;
if (pkey) {
@@ -639,10 +639,10 @@ void KexiFormView::initDataSource()
kexipluginsdbg << "KexiFormView::initDataSource(): sources=" << sources << endl;
uint index = 0;
- for (QStringList::ConstIterator it = sources.constBegin();
+ for (TQStringList::ConstIterator it = sources.constBegin();
it!=sources.constEnd(); ++it, index++) {
/*! @todo add expression support */
- QString fieldName( (*it).lower() );
+ TQString fieldName( (*it).lower() );
//remove "tablename." if it was prepended
if (tableSchema && fieldName.startsWith( tableSchema->name().lower()+"." ))
fieldName = fieldName.mid(tableSchema->name().length()+1);
@@ -673,7 +673,7 @@ void KexiFormView::initDataSource()
else {
KexiDB::debug( m_query->parameters() );
// like in KexiQueryView::executeQuery()
- QValueList<QVariant> params;
+ TQValueList<TQVariant> params;
{
KexiUtils::WaitCursorRemover remover;
params = KexiQueryParameters::getParameters(this, *conn->driver(), *m_query, ok);
@@ -681,7 +681,7 @@ void KexiFormView::initDataSource()
if (ok) //input cancelled
m_cursor = conn->executeQuery( *m_query, params );
}
- m_scrollView->invalidateDataSources( invalidSources, m_query );
+ m_scrollView->tqinvalidateDataSources( invalidSources, m_query );
ok = m_cursor!=0;
}
@@ -730,7 +730,7 @@ KexiFormView::storeNewData(const KexiDB::SchemaData& sdata, bool &cancel)
}
if (!storeData()) {
//failure: remove object's schema data to avoid garbage
- KexiDB::Connection *conn = parentDialog()->mainWin()->project()->dbConnection();
+ KexiDB::Connection *conn = tqparentDialog()->mainWin()->project()->dbConnection();
conn->removeObject( s->id() );
delete s;
return 0;
@@ -742,19 +742,19 @@ tristate
KexiFormView::storeData(bool dontAsk)
{
Q_UNUSED(dontAsk);
- kexipluginsdbg << "KexiDBForm::storeData(): " << parentDialog()->partItem()->name()
- << " [" << parentDialog()->id() << "]" << endl;
+ kexipluginsdbg << "KexiDBForm::storeData(): " << tqparentDialog()->partItem()->name()
+ << " [" << tqparentDialog()->id() << "]" << endl;
//-- first, store local BLOBs, so identifiers can be updated
//! @todo remove unused data stored previously
- KexiDB::Connection *conn = parentDialog()->mainWin()->project()->dbConnection();
+ KexiDB::Connection *conn = tqparentDialog()->mainWin()->project()->dbConnection();
KexiDB::TableSchema *blobsTable = conn->tableSchema("kexi__blobs");
if (!blobsTable) { //compatibility check for older Kexi project versions
//! @todo show message about missing kexi__blobs?
return false;
}
// Not all engines accept passing NULL to PKEY o_id, so we're omitting it.
- QStringList blobsFieldNamesWithoutID(blobsTable->names());
+ TQStringList blobsFieldNamesWithoutID(blobsTable->names());
blobsFieldNamesWithoutID.pop_front();
KexiDB::FieldList *blobsFieldsWithoutID = blobsTable->subList(blobsFieldNamesWithoutID);
@@ -767,9 +767,9 @@ KexiFormView::storeData(bool dontAsk)
}
KexiBLOBBuffer *blobBuf = KexiBLOBBuffer::self();
KexiFormView *designFormView
- = dynamic_cast<KexiFormView*>( parentDialog()->viewForMode(Kexi::DesignViewMode) );
+ = dynamic_cast<KexiFormView*>( tqparentDialog()->viewForMode(Kexi::DesignViewMode) );
if (designFormView) {
- for (QMapConstIterator<QWidget*, KexiBLOBBuffer::Id_t> it = tempData()->unsavedLocalBLOBs.constBegin();
+ for (TQMapConstIterator<TQWidget*, KexiBLOBBuffer::Id_t> it = tempData()->unsavedLocalBLOBs.constBegin();
it!=tempData()->unsavedLocalBLOBs.constEnd(); ++it)
{
if (!it.key()) {
@@ -781,12 +781,12 @@ KexiFormView::storeData(bool dontAsk)
if (!h)
continue; //no BLOB assigned
- QString originalFileName(h.originalFileName());
- QFileInfo fi(originalFileName);
- QString caption(fi.baseName().replace('_', " ").simplifyWhiteSpace());
+ TQString originalFileName(h.originalFileName());
+ TQFileInfo fi(originalFileName);
+ TQString caption(fi.baseName().tqreplace('_', " ").simplifyWhiteSpace());
if (st) {
- *st /* << NO, (pgsql doesn't support this):QVariant()*/ /*id*/
+ *st /* << NO, (pgsql doesn't support this):TQVariant()*/ /*id*/
<< h.data() << originalFileName << caption
<< h.mimeType() << (uint)/*! @todo unsafe */h.folderId();
if (!st->execute()) {
@@ -797,17 +797,17 @@ KexiFormView::storeData(bool dontAsk)
}
delete blobsFieldsWithoutID;
blobsFieldsWithoutID=0;
- const Q_ULLONG storedBLOBID = conn->lastInsertedAutoIncValue("o_id", "kexi__blobs");
- if ((Q_ULLONG)-1 == storedBLOBID) {
+ const TQ_ULLONG storedBLOBID = conn->lastInsertedAutoIncValue("o_id", "kexi__blobs");
+ if ((TQ_ULLONG)-1 == storedBLOBID) {
//! @todo show message?
return false;
}
kexipluginsdbg << " storedDataID=" << storedBLOBID << endl;
- h.setStoredWidthID((KexiBLOBBuffer::Id_t /*unsafe - will be fixed in Qt4*/)storedBLOBID);
+ h.setStoredWidthID((KexiBLOBBuffer::Id_t /*unsafe - will be fixed in TQt4*/)storedBLOBID);
//set widget's internal property so it can be saved...
- const QVariant oldStoredPixmapId( it.key()->property("storedPixmapId") );
+ const TQVariant oldStoredPixmapId( it.key()->property("storedPixmapId") );
it.key()->setProperty("storedPixmapId",
- QVariant((uint /* KexiBLOBBuffer::Id_t is unsafe and unsupported by QVariant - will be fixed in Qt4*/)storedBLOBID));
+ TQVariant((uint /* KexiBLOBBuffer::Id_t is unsafe and unsupported by TQVariant - will be fixed in TQt4*/)storedBLOBID));
KFormDesigner::ObjectTreeItem *widgetItem = designFormView->form()->objectTree()->lookup(it.key()->name()); //form()->objectTree()->lookup(it.key()->name());
if (widgetItem)
widgetItem->addModifiedProperty( "storedPixmapId", oldStoredPixmapId );
@@ -817,7 +817,7 @@ KexiFormView::storeData(bool dontAsk)
}
//-- now, save form's XML
- QString data;
+ TQString data;
if (!KFormDesigner::FormIO::saveFormToString(tempData()->form, data))
return false;
if (!storeDataBlock(data))
@@ -826,7 +826,7 @@ KexiFormView::storeData(bool dontAsk)
//all blobs are now saved
tempData()->unsavedLocalBLOBs.clear();
- tempData()->tempForm = QString::null;
+ tempData()->tempForm = TQString();
return true;
}
@@ -860,7 +860,7 @@ KexiFormView::slotWidgetSelected(KFormDesigner::Form *f, bool multiple)
setAvailable("formpart_format_raise", true);
setAvailable("formpart_format_lower", true);
- // If the widgets selected is a container, we enable layout actions
+ // If the widgets selected is a container, we enable tqlayout actions
if(!multiple)
{
KFormDesigner::ObjectTreeItem *item = f->objectTree()->lookup( f->selectedWidgets()->first()->name() );
@@ -874,7 +874,7 @@ KexiFormView::slotWidgetSelected(KFormDesigner::Form *f, bool multiple)
KFormDesigner::Container *container = f->activeContainer();
setAvailable("formpart_break_layout", container ?
- (container->layoutType() != KFormDesigner::Container::NoLayout) : false );
+ (container->tqlayoutType() != KFormDesigner::Container::NoLayout) : false );
}
void
@@ -890,7 +890,7 @@ KexiFormView::slotFormWidgetSelected(KFormDesigner::Form *f)
setAvailable("formpart_layout_hbox", true);
setAvailable("formpart_layout_vbox", true);
setAvailable("formpart_layout_grid", true);
- setAvailable("formpart_break_layout", (f->toplevelContainer()->layoutType() != KFormDesigner::Container::NoLayout));
+ setAvailable("formpart_break_layout", (f->toplevelContainer()->tqlayoutType() != KFormDesigner::Container::NoLayout));
}
void
@@ -964,22 +964,22 @@ KexiFormView::setRedoEnabled(bool enabled)
}
#endif //0
-QSize
-KexiFormView::preferredSizeHint(const QSize& otherSize)
+TQSize
+KexiFormView::preferredSizeHint(const TQSize& otherSize)
{
- if (parentDialog()->neverSaved()) {
+ if (tqparentDialog()->neverSaved()) {
//ignore otherSize if possible
-// return KexiViewBase::preferredSizeHint( (parentDialog() && parentDialog()->mdiParent()) ? QSize(10000,10000) : otherSize);
+// return KexiViewBase::preferredSizeHint( (tqparentDialog() && tqparentDialog()->mdiParent()) ? TQSize(10000,10000) : otherSize);
}
return (m_dbform->size()
- +QSize(m_scrollView->verticalScrollBar()->isVisible() ? m_scrollView->verticalScrollBar()->width()*3/2 : 10,
+ +TQSize(m_scrollView->verticalScrollBar()->isVisible() ? m_scrollView->verticalScrollBar()->width()*3/2 : 10,
m_scrollView->horizontalScrollBar()->isVisible() ? m_scrollView->horizontalScrollBar()->height()*3/2 : 10))
.expandedTo( KexiViewBase::preferredSizeHint(otherSize) );
}
void
-KexiFormView::resizeEvent( QResizeEvent *e )
+KexiFormView::resizeEvent( TQResizeEvent *e )
{
if (viewMode()==Kexi::DataViewMode) {
m_scrollView->refreshContentsSizeLater(
@@ -991,7 +991,7 @@ KexiFormView::resizeEvent( QResizeEvent *e )
m_scrollView->updateNavPanelGeometry();
if (m_delayedFormContentsResizeOnShow>0) { // && isVisible()) {
m_delayedFormContentsResizeOnShow--;
- m_dbform->resize( e->size() - QSize(30, 30) );
+ m_dbform->resize( e->size() - TQSize(30, 30) );
}
}
@@ -999,19 +999,19 @@ void
KexiFormView::setFocusInternal()
{
if (viewMode() == Kexi::DataViewMode) {
- if (m_dbform->focusWidget()) {
+ if (m_dbform->tqfocusWidget()) {
//better-looking focus
if (m_setFocusInternalOnce) {
- KexiUtils::setFocusWithReason(m_setFocusInternalOnce, QFocusEvent::Other);//Tab);
+ KexiUtils::setFocusWithReason(m_setFocusInternalOnce, TQFocusEvent::Other);//Tab);
m_setFocusInternalOnce = 0;
}
else {
- //ok? SET_FOCUS_USING_REASON(m_dbform->focusWidget(), QFocusEvent::Other);//Tab);
+ //ok? SET_FOCUS_USING_REASON(m_dbform->tqfocusWidget(), TQFocusEvent::Other);//Tab);
}
return;
}
}
- QWidget::setFocus();
+ TQWidget::setFocus();
}
void
@@ -1025,7 +1025,7 @@ KexiFormView::show()
// if (resizeMode() == KexiFormView::ResizeAuto)
if (viewMode()==Kexi::DataViewMode) {
if (resizeMode() == KexiFormView::ResizeAuto)
- m_scrollView->setResizePolicy(QScrollView::AutoOneFit);
+ m_scrollView->setResizePolicy(TQScrollView::AutoOneFit);
}
}
@@ -1042,11 +1042,11 @@ void
KexiFormView::updateDataSourcePage()
{
if (viewMode()==Kexi::DesignViewMode) {
- QCString dataSourceMimeType, dataSource;
+ TQCString dataSourceMimeType, dataSource;
KFormDesigner::WidgetPropertySet *set = KFormDesigner::FormManager::self()->propertySet();
- if (set->contains("dataSourceMimeType"))
+ if (set->tqcontains("dataSourceMimeType"))
dataSourceMimeType = (*set)["dataSourceMimeType"].value().toCString();
- if (set->contains("dataSource"))
+ if (set->tqcontains("dataSource"))
dataSource = (*set)["dataSource"].value().toCString();
formPart()->dataSourcePage()->setDataSource(dataSourceMimeType, dataSource);
@@ -1054,25 +1054,25 @@ KexiFormView::updateDataSourcePage()
}
void
-KexiFormView::slotHandleDragMoveEvent(QDragMoveEvent* e)
+KexiFormView::slotHandleDragMoveEvent(TQDragMoveEvent* e)
{
if (KexiFieldDrag::canDecodeMultiple( e )) {
e->accept(true);
- //dirty: drawRect(QRect( e->pos(), QSize(50, 20)), 2);
+ //dirty: drawRect(TQRect( e->pos(), TQSize(50, 20)), 2);
}
}
void
-KexiFormView::slotHandleDropEvent(QDropEvent* e)
+KexiFormView::slotHandleDropEvent(TQDropEvent* e)
{
- const QWidget *targetContainerWidget = dynamic_cast<const QWidget*>(sender());
+ const TQWidget *targetContainerWidget = dynamic_cast<const TQWidget*>(sender());
KFormDesigner::ObjectTreeItem *targetContainerWidgetItem = targetContainerWidget
? form()->objectTree()->lookup( targetContainerWidget->name() ) : 0;
if (targetContainerWidgetItem && targetContainerWidgetItem->container()
&& KexiFieldDrag::canDecodeMultiple( e ))
{
- QString sourceMimeType, sourceName;
- QStringList fields;
+ TQString sourceMimeType, sourceName;
+ TQStringList fields;
if (!KexiFieldDrag::decodeMultiple( e, sourceMimeType, sourceName, fields ))
return;
insertAutoFields(sourceMimeType, sourceName, fields,
@@ -1081,13 +1081,13 @@ KexiFormView::slotHandleDropEvent(QDropEvent* e)
}
void
-KexiFormView::insertAutoFields(const QString& sourceMimeType, const QString& sourceName,
- const QStringList& fields, KFormDesigner::Container* targetContainer, const QPoint& _pos)
+KexiFormView::insertAutoFields(const TQString& sourceMimeType, const TQString& sourceName,
+ const TQStringList& fields, KFormDesigner::Container* targetContainer, const TQPoint& _pos)
{
if (fields.isEmpty())
return;
- KexiDB::Connection *conn = parentDialog()->mainWin()->project()->dbConnection();
+ KexiDB::Connection *conn = tqparentDialog()->mainWin()->project()->dbConnection();
KexiDB::TableOrQuerySchema tableOrQuery(conn, sourceName.latin1(), sourceMimeType=="kexi/table");
if (!tableOrQuery.table() && !tableOrQuery.query()) {
kexipluginswarn << "KexiFormView::insertAutoFields(): no such table/query \""
@@ -1095,15 +1095,15 @@ KexiFormView::insertAutoFields(const QString& sourceMimeType, const QString& sou
return;
}
- QPoint pos(_pos);
+ TQPoint pos(_pos);
//if pos is not specified, compute a new position:
- if (pos==QPoint(-1,-1)) {
+ if (pos==TQPoint(-1,-1)) {
if (m_widgetGeometryForRecentInsertAutoFields.isValid()) {
pos = m_widgetGeometryForRecentInsertAutoFields.bottomLeft()
- + QPoint(0,form()->gridSize());
+ + TQPoint(0,form()->gridSize());
}
else {
- pos = QPoint(40, 40); //start here
+ pos = TQPoint(40, 40); //start here
}
}
@@ -1115,11 +1115,11 @@ KexiFormView::insertAutoFields(const QString& sourceMimeType, const QString& sou
// KFormDesigner::WidgetList* prevSelection = form()->selectedWidgets();
KFormDesigner::WidgetList widgetsToSelect;
KFormDesigner::CommandGroup *group = new KFormDesigner::CommandGroup(
- fields.count()==1 ? i18n("Insert AutoField widget") : i18n("Insert %1 AutoField widgets").arg(fields.count()),
+ fields.count()==1 ? i18n("Insert AutoField widget") : i18n("Insert %1 AutoField widgets").tqarg(fields.count()),
KFormDesigner::FormManager::self()->propertySet()
);
- foreach( QStringList::ConstIterator, it, fields ) {
+ foreach( TQStringList::ConstIterator, it, fields ) {
KexiDB::QueryColumnInfo* column = tableOrQuery.columnInfo(*it);
if (!column) {
kexipluginswarn << "KexiFormView::insertAutoFields(): no such field \""
@@ -1128,11 +1128,11 @@ KexiFormView::insertAutoFields(const QString& sourceMimeType, const QString& sou
}
//! todo add autolabel using field's caption or name
//KFormDesigner::Container *targetContainer;
-/* QWidget* targetContainerWidget = QApplication::widgetAt(pos, true);
+/* TQWidget* targetContainerWidget = TQApplication::widgetAt(pos, true);
while (targetContainerWidget
&& !dynamic_cast<KFormDesigner::Container*>(targetContainerWidget))
{
- targetContainerWidget = targetContainerWidget->parentWidget();
+ targetContainerWidget = targetContainerWidget->tqparentWidget();
}
if (dynamic_cast<KFormDesigner::Container*>(targetContainerWidget))
targetContainer = dynamic_cast<KFormDesigner::Container*>(targetContainerWidget);
@@ -1149,14 +1149,14 @@ KexiFormView::insertAutoFields(const QString& sourceMimeType, const QString& sou
group->addCommand(insertCmd, false/*don't exec twice*/);
KFormDesigner::ObjectTreeItem *newWidgetItem
- = form()->objectTree()->dict()->find(insertCmd->widgetName());
+ = form()->objectTree()->dict()->tqfind(insertCmd->widgetName());
KexiDBAutoField* newWidget
= newWidgetItem ? dynamic_cast<KexiDBAutoField*>(newWidgetItem->widget()) : 0;
widgetsToSelect.append(newWidget);
//#if 0
KFormDesigner::CommandGroup *subGroup
= new KFormDesigner::CommandGroup("", KFormDesigner::FormManager::self()->propertySet());
- QMap<QCString, QVariant> propValues;
+ TQMap<TQCString, TQVariant> propValues;
propValues.insert("dataSource", column->aliasOrName());
propValues.insert("fieldTypeInternal", (int)column->field->type());
propValues.insert("fieldCaptionInternal", column->captionOrAliasOrName());
@@ -1173,8 +1173,8 @@ KexiFormView::insertAutoFields(const QString& sourceMimeType, const QString& sou
// newWidget->setDataSource(column->aliasOrName());
// newWidget->setFieldTypeInternal((int)column->field->type());
// newWidget->setFieldCaptionInternal(column->captionOrAliasOrName());
- //resize again because autofield's type changed what can lead to changed sizeHint()
-// newWidget->resize(newWidget->sizeHint());
+ //resize again because autofield's type changed what can lead to changed tqsizeHint()
+// newWidget->resize(newWidget->tqsizeHint());
KFormDesigner::WidgetList list;
list.append(newWidget);
KFormDesigner::AdjustSizeCommand *adjustCommand
@@ -1191,10 +1191,10 @@ KexiFormView::insertAutoFields(const QString& sourceMimeType, const QString& sou
}
if (widgetsToSelect.last()) {
//resize form if needed
- QRect oldFormRect( m_dbform->geometry() );
- QRect newFormRect( oldFormRect );
- newFormRect.setWidth(QMAX(m_dbform->width(), widgetsToSelect.last()->geometry().right()+1));
- newFormRect.setHeight(QMAX(m_dbform->height(), widgetsToSelect.last()->geometry().bottom()+1));
+ TQRect oldFormRect( m_dbform->tqgeometry() );
+ TQRect newFormRect( oldFormRect );
+ newFormRect.setWidth(TQMAX(m_dbform->width(), widgetsToSelect.last()->tqgeometry().right()+1));
+ newFormRect.setHeight(TQMAX(m_dbform->height(), widgetsToSelect.last()->tqgeometry().bottom()+1));
if (newFormRect != oldFormRect) {
//1. resize by hand
m_dbform->setGeometry( newFormRect );
@@ -1205,8 +1205,8 @@ KexiFormView::insertAutoFields(const QString& sourceMimeType, const QString& sou
group->addCommand(resizeFormCommand, true/*will be executed on CommandGroup::execute()*/);
}
- //remember geometry of the last inserted widget
- m_widgetGeometryForRecentInsertAutoFields = widgetsToSelect.last()->geometry();
+ //remember tqgeometry of the last inserted widget
+ m_widgetGeometryForRecentInsertAutoFields = widgetsToSelect.last()->tqgeometry();
}
//eventually, add entire command group to active form
@@ -1217,11 +1217,11 @@ KexiFormView::insertAutoFields(const QString& sourceMimeType, const QString& sou
//enable proper REDO usage
group->resetAllowExecuteFlags();
- m_scrollView->repaint();
- m_scrollView->viewport()->repaint();
- m_scrollView->repaintContents();
+ m_scrollView->tqrepaint();
+ m_scrollView->viewport()->tqrepaint();
+ m_scrollView->tqrepaintContents();
m_scrollView->updateContents();
- m_scrollView->clipper()->repaint();
+ m_scrollView->clipper()->tqrepaint();
m_scrollView->refreshContentsSize();
//select all inserted widgets, if multiple
@@ -1236,7 +1236,7 @@ KexiFormView::insertAutoFields(const QString& sourceMimeType, const QString& sou
}
void
-KexiFormView::setUnsavedLocalBLOB(QWidget *widget, KexiBLOBBuffer::Id_t id)
+KexiFormView::setUnsavedLocalBLOB(TQWidget *widget, KexiBLOBBuffer::Id_t id)
{
//! @todo if there already was data assigned, remember it should be dereferenced
if (id==0)
@@ -1264,12 +1264,12 @@ void KexiFormView::updateActions(bool activated)
}*/
/*
-void KexiFormView::parentDialogDetached()
+void KexiFormView::tqparentDialogDetached()
{
m_dbform->updateTabStopsOrder(form());
}
-void KexiFormView::parentDialogAttached(KMdiChildFrm *)
+void KexiFormView::tqparentDialogAttached(KMdiChildFrm *)
{
m_dbform->updateTabStopsOrder(form());
}*/
diff --git a/kexi/plugins/forms/kexiformview.h b/kexi/plugins/forms/kexiformview.h
index 0a774556..e699afa1 100644
--- a/kexi/plugins/forms/kexiformview.h
+++ b/kexi/plugins/forms/kexiformview.h
@@ -21,7 +21,7 @@
#ifndef KEXIFORMVIEW_H
#define KEXIFORMVIEW_H
-#include <qtimer.h>
+#include <tqtimer.h>
#include <kexiviewbase.h>
#include <widget/kexidataawareview.h>
@@ -55,6 +55,7 @@ namespace KFormDesigner
class KEXIFORMUTILS_EXPORT KexiFormView : public KexiDataAwareView
{
Q_OBJECT
+ TQ_OBJECT
public:
enum ResizeMode {
@@ -64,14 +65,14 @@ class KEXIFORMUTILS_EXPORT KexiFormView : public KexiDataAwareView
NoResize = 2 /*! @todo */
};
-// KexiFormView(KexiMainWindow *win, QWidget *parent, const char *name, KexiDB::Connection *conn);
- KexiFormView(KexiMainWindow *mainWin, QWidget *parent, const char *name = 0,
+// KexiFormView(KexiMainWindow *win, TQWidget *tqparent, const char *name, KexiDB::Connection *conn);
+ KexiFormView(KexiMainWindow *mainWin, TQWidget *tqparent, const char *name = 0,
bool dbAware = true);
virtual ~KexiFormView();
// KexiDB::Connection* connection() { return m_conn; }
- virtual QSize preferredSizeHint(const QSize& otherSize);
+ virtual TQSize preferredSizeHint(const TQSize& otherSize);
int resizeMode() const { return m_resizeMode; }
@@ -89,7 +90,7 @@ class KEXIFORMUTILS_EXPORT KexiFormView : public KexiDataAwareView
Local BLOBs are retrieved KexiBLOBBuffer::self() and stored in "kexi__blobs" 'system' table.
Note that db-aware BLOBs (non local) are not handled this way.
*/
- void setUnsavedLocalBLOB(QWidget *widget, KexiBLOBBuffer::Id_t id);
+ void setUnsavedLocalBLOB(TQWidget *widget, KexiBLOBBuffer::Id_t id);
public slots:
/*! Reimplemented to update resize policy. */
@@ -102,27 +103,27 @@ class KEXIFORMUTILS_EXPORT KexiFormView : public KexiDataAwareView
so undo/redo is available for this operation.
If multiple fields are provided, they will be aligned vertically.
- If \a pos is QPoint(-1,-1) (the default), position is computed automatically
+ If \a pos is TQPoint(-1,-1) (the default), position is computed automatically
based on a position last inserted field using this method.
- If this method has not been called yet, position of QPoint(40, 40) will be set.
+ If this method has not been called yet, position of TQPoint(40, 40) will be set.
Called by:
- slotHandleDropEvent() when field(s) are dropped from the data source pane onto the form
- KexiFormManager is a used clicked "Insert fields" button on the data source pane. */
- void insertAutoFields(const QString& sourceMimeType, const QString& sourceName,
- const QStringList& fields, KFormDesigner::Container* targetContainerWidget,
- const QPoint& pos = QPoint(-1,-1));
+ void insertAutoFields(const TQString& sourceMimeType, const TQString& sourceName,
+ const TQStringList& fields, KFormDesigner::Container* targetContainerWidget,
+ const TQPoint& pos = TQPoint(-1,-1));
protected slots:
void slotPropertySetSwitched(KoProperty::Set *b, bool forceReload = false,
- const QCString& propertyToSelect = QCString());
+ const TQCString& propertyToSelect = TQCString());
void slotDirty(KFormDesigner::Form *f, bool isDirty);
void slotFocus(bool in);
- void slotHandleDragMoveEvent(QDragMoveEvent* e);
+ void slotHandleDragMoveEvent(TQDragMoveEvent* e);
//! Handles field(s) dropping from the data source pane onto the form
//! @see insertAutoFields()
- void slotHandleDropEvent(QDropEvent* e);
+ void slotHandleDropEvent(TQDropEvent* e);
//moved to formmanager void slotWidgetSelected(KFormDesigner::Form *form, bool multiple);
//moved to formmanager void slotFormWidgetSelected(KFormDesigner::Form *form);
@@ -140,7 +141,7 @@ class KEXIFORMUTILS_EXPORT KexiFormView : public KexiDataAwareView
virtual tristate storeData(bool dontAsk = false);
KexiFormPart::TempData* tempData() const {
- return dynamic_cast<KexiFormPart::TempData*>(parentDialog()->tempData()); }
+ return dynamic_cast<KexiFormPart::TempData*>(tqparentDialog()->tempData()); }
KexiFormPart* formPart() const { return dynamic_cast<KexiFormPart*>(part()); }
//moved to formmanager void disableWidgetActions();
@@ -158,7 +159,7 @@ class KEXIFORMUTILS_EXPORT KexiFormView : public KexiDataAwareView
//! Used in loadForm()
void updateValuesForSubproperties();
- virtual void resizeEvent ( QResizeEvent * );
+ virtual void resizeEvent ( TQResizeEvent * );
void initDataSource();
@@ -195,7 +196,7 @@ class KEXIFORMUTILS_EXPORT KexiFormView : public KexiDataAwareView
It is shared between subsequent Data view sessions (just reopened on switch),
but deleted and recreated from scratch when form's "dataSource" property changed
since last form viewing (m_previousDataSourceString is used for that). */
- QString m_previousDataSourceString;
+ TQString m_previousDataSourceString;
int m_resizeMode;
@@ -214,18 +215,18 @@ class KEXIFORMUTILS_EXPORT KexiFormView : public KexiDataAwareView
int m_delayedFormContentsResizeOnShow;
//! Used in setFocusInternal()
- QGuardedPtr<QWidget> m_setFocusInternalOnce;
+ TQGuardedPtr<TQWidget> m_setFocusInternalOnce;
- /*! Stores geometry of widget recently inserted using insertAutoFields() method.
+ /*! Stores tqgeometry of widget recently inserted using insertAutoFields() method.
having this information, we'r eable to compute position for a newly
inserted widget in insertAutoFields() is such position has not been specified.
(the position is specified when a widget is inserted with mouse drag & dropping
but not with clicking of 'Insert fields' button from Data Source pane) */
- QRect m_widgetGeometryForRecentInsertAutoFields;
+ TQRect m_widgetGeometryForRecentInsertAutoFields;
//! Used in setUnsavedLocalBLOBs()
-// QMap<QWidget*, KexiBLOBBuffer::Id_t> m_unsavedLocalBLOBs;
+// TQMap<TQWidget*, KexiBLOBBuffer::Id_t> m_unsavedLocalBLOBs;
};
#endif
diff --git a/kexi/plugins/forms/widgets/kexidbautofield.cpp b/kexi/plugins/forms/widgets/kexidbautofield.cpp
index 36fbdb1a..4926a334 100644
--- a/kexi/plugins/forms/widgets/kexidbautofield.cpp
+++ b/kexi/plugins/forms/widgets/kexidbautofield.cpp
@@ -21,11 +21,11 @@
#include "kexidbautofield.h"
-#include <qlabel.h>
-#include <qlayout.h>
-#include <qpainter.h>
-#include <qmetaobject.h>
-#include <qapplication.h>
+#include <tqlabel.h>
+#include <tqlayout.h>
+#include <tqpainter.h>
+#include <tqmetaobject.h>
+#include <tqapplication.h>
#include <kdebug.h>
#include <klocale.h>
@@ -57,13 +57,13 @@ class KexiDBAutoField::Private
//!< of widgetTypeForFieldType() if widgetTypeForFieldType is Auto
WidgetType widgetType_property; //!< provides widget type or Auto
LabelPosition lblPosition;
- QBoxLayout *layout;
- QLabel *label;
- QString caption;
+ TQBoxLayout *tqlayout;
+ TQLabel *label;
+ TQString caption;
KexiDB::Field::Type fieldTypeInternal;
- QString fieldCaptionInternal;
- QColor baseColor; //!< needed because for unbound mode editor==0
- QColor textColor; //!< needed because for unbound mode editor==0
+ TQString fieldCaptionInternal;
+ TQColor baseColor; //!< needed because for unbound mode editor==0
+ TQColor textColor; //!< needed because for unbound mode editor==0
bool autoCaption : 1;
bool focusPolicyChanged : 1;
bool designMode : 1;
@@ -71,9 +71,9 @@ class KexiDBAutoField::Private
//-------------------------------------
-KexiDBAutoField::KexiDBAutoField(const QString &text, WidgetType type, LabelPosition pos,
- QWidget *parent, const char *name, bool designMode)
- : QWidget(parent, name)
+KexiDBAutoField::KexiDBAutoField(const TQString &text, WidgetType type, LabelPosition pos,
+ TQWidget *tqparent, const char *name, bool designMode)
+ : TQWidget(tqparent, name)
, KexiFormDataItemInterface()
, KFormDesigner::DesignTimeDynamicChildWidgetHandler()
, d( new Private() )
@@ -82,14 +82,14 @@ KexiDBAutoField::KexiDBAutoField(const QString &text, WidgetType type, LabelPosi
init(text, type, pos);
}
-KexiDBAutoField::KexiDBAutoField(QWidget *parent, const char *name, bool designMode, LabelPosition pos)
- : QWidget(parent, name)
+KexiDBAutoField::KexiDBAutoField(TQWidget *tqparent, const char *name, bool designMode, LabelPosition pos)
+ : TQWidget(tqparent, name)
, KexiFormDataItemInterface()
, KFormDesigner::DesignTimeDynamicChildWidgetHandler()
, d( new Private() )
{
d->designMode = designMode;
- init(QString::null/*i18n("Auto Field")*/, Auto, pos);
+ init(TQString()/*i18n("Auto Field")*/, Auto, pos);
}
KexiDBAutoField::~KexiDBAutoField()
@@ -101,14 +101,14 @@ KexiDBAutoField::~KexiDBAutoField()
}
void
-KexiDBAutoField::init(const QString &text, WidgetType type, LabelPosition pos)
+KexiDBAutoField::init(const TQString &text, WidgetType type, LabelPosition pos)
{
d->fieldTypeInternal = KexiDB::Field::InvalidType;
- d->layout = 0;
+ d->tqlayout = 0;
m_subwidget = 0;
- d->label = new QLabel(text, this);
+ d->label = new TQLabel(text, this);
d->label->installEventFilter( this );
- //QFontMetrics fm( font() );
+ //TQFontMetrics fm( font() );
//d->label->setFixedWidth( fm.width("This is a test string length") );
d->autoCaption = true;
d->focusPolicyChanged = false;
@@ -116,8 +116,8 @@ KexiDBAutoField::init(const QString &text, WidgetType type, LabelPosition pos)
d->widgetType_property = (type==Auto ? Text : type); //to force "differ" to be true in setWidgetType()
setLabelPosition(pos);
setWidgetType(type);
- d->baseColor = palette().active().base();
- d->textColor = palette().active().text();
+ d->baseColor = tqpalette().active().base();
+ d->textColor = tqpalette().active().text();
}
void
@@ -142,10 +142,10 @@ void
KexiDBAutoField::createEditor()
{
if(m_subwidget) {
- delete (QWidget *)m_subwidget;
+ delete (TQWidget *)m_subwidget;
}
- QWidget *newSubwidget;
+ TQWidget *newSubwidget;
switch( d->widgetType ) {
case Text:
case Double: //! @todo setup validator
@@ -153,19 +153,19 @@ KexiDBAutoField::createEditor()
case Date:
case Time:
case DateTime:
- newSubwidget = new KexiDBLineEdit( this, QCString("KexiDBAutoField_KexiDBLineEdit:")+name() );
+ newSubwidget = new KexiDBLineEdit( this, TQCString("KexiDBAutoField_KexiDBLineEdit:")+name() );
break;
case MultiLineText:
- newSubwidget = new KexiDBTextEdit( this, QCString("KexiDBAutoField_KexiDBTextEdit:")+name() );
+ newSubwidget = new KexiDBTextEdit( this, TQCString("KexiDBAutoField_KexiDBTextEdit:")+name() );
break;
case Boolean:
- newSubwidget = new KexiDBCheckBox(dataSource(), this, QCString("KexiDBAutoField_KexiDBCheckBox:")+name());
+ newSubwidget = new KexiDBCheckBox(dataSource(), this, TQCString("KexiDBAutoField_KexiDBCheckBox:")+name());
break;
case Image:
- newSubwidget = new KexiDBImageBox(d->designMode, this, QCString("KexiDBAutoField_KexiDBImageBox:")+name());
+ newSubwidget = new KexiDBImageBox(d->designMode, this, TQCString("KexiDBAutoField_KexiDBImageBox:")+name());
break;
case ComboBox:
- newSubwidget = new KexiDBComboBox(this, QCString("KexiDBAutoField_KexiDBComboBox:")+name(), d->designMode);
+ newSubwidget = new KexiDBComboBox(this, TQCString("KexiDBAutoField_KexiDBComboBox:")+name(), d->designMode);
break;
default:
newSubwidget = 0;
@@ -176,7 +176,7 @@ KexiDBAutoField::createEditor()
setSubwidget( newSubwidget ); //this will also allow to declare subproperties, see KFormDesigner::WidgetWithSubpropertiesInterface
if(newSubwidget) {
- newSubwidget->setName( QCString("KexiDBAutoField_") + newSubwidget->className() );
+ newSubwidget->setName( TQCString("KexiDBAutoField_") + newSubwidget->className() );
dynamic_cast<KexiDataItemInterface*>(newSubwidget)->setParentDataItemInterface(this);
dynamic_cast<KexiFormDataItemInterface*>(newSubwidget)
->setColumnInfo(columnInfo()); //needed at least by KexiDBImageBox
@@ -190,11 +190,11 @@ KexiDBAutoField::createEditor()
newSubwidget->setFocusPolicy(focusPolicy());
}
else {//if focusPolicy is not changed at top level, inherit it from editor
- QWidget::setFocusPolicy(newSubwidget->focusPolicy());
+ TQWidget::setFocusPolicy(newSubwidget->focusPolicy());
}
setFocusProxy(newSubwidget); //ok?
- if (parentWidget())
- newSubwidget->setPalette( qApp->palette() );
+ if (tqparentWidget())
+ newSubwidget->setPalette( tqApp->palette() );
copyPropertiesToEditor();
// KFormDesigner::installRecursiveEventFilter(newSubwidget, this);
}
@@ -207,12 +207,12 @@ void KexiDBAutoField::copyPropertiesToEditor()
if (m_subwidget) {
// kdDebug() << "KexiDBAutoField::copyPropertiesToEditor(): base col: " << d->baseColor.name() <<
// "; text col: " << d->textColor.name() << endl;
- QPalette p( m_subwidget->palette() );
- p.setColor( QPalette::Active, QColorGroup::Base, d->baseColor );
+ TQPalette p( m_subwidget->palette() );
+ p.setColor( TQPalette::Active, TQColorGroup::Base, d->baseColor );
if(d->widgetType == Boolean)
- p.setColor( QPalette::Active, QColorGroup::Foreground, d->textColor );
+ p.setColor( TQPalette::Active, TQColorGroup::Foreground, d->textColor );
else
- p.setColor( QPalette::Active, QColorGroup::Text, d->textColor );
+ p.setColor( TQPalette::Active, TQColorGroup::Text, d->textColor );
m_subwidget->setPalette(p);
//m_subwidget->setPaletteBackgroundColor( d->baseColor );
}
@@ -222,30 +222,30 @@ void
KexiDBAutoField::setLabelPosition(LabelPosition position)
{
d->lblPosition = position;
- if(d->layout) {
- QBoxLayout *lyr = d->layout;
- d->layout = 0;
+ if(d->tqlayout) {
+ TQBoxLayout *lyr = d->tqlayout;
+ d->tqlayout = 0;
delete lyr;
}
if(m_subwidget)
m_subwidget->show();
- //! \todo support right-to-left layout where positions are inverted
+ //! \todo support right-to-left tqlayout where positions are inverted
if (position==Top || position==Left) {
- int align = d->label->alignment();
+ int align = d->label->tqalignment();
if(position == Top) {
- d->layout = (QBoxLayout*) new QVBoxLayout(this);
+ d->tqlayout = (TQBoxLayout*) new TQVBoxLayout(this);
align |= AlignVertical_Mask;
align ^= AlignVertical_Mask;
align |= AlignTop;
}
else {
- d->layout = (QBoxLayout*) new QHBoxLayout(this);
+ d->tqlayout = (TQBoxLayout*) new TQHBoxLayout(this);
align |= AlignVertical_Mask;
align ^= AlignVertical_Mask;
align |= AlignVCenter;
}
- d->label->setAlignment(align);
+ d->label->tqsetAlignment(align);
if(d->widgetType == Boolean
|| (d->widgetType == Auto && fieldTypeInternal() == KexiDB::Field::InvalidType && !d->designMode))
{
@@ -254,55 +254,55 @@ KexiDBAutoField::setLabelPosition(LabelPosition position)
else {
d->label->show();
}
- d->layout->addWidget(d->label, 0, position == Top ? int(Qt::AlignLeft) : 0);
+ d->tqlayout->addWidget(d->label, 0, position == Top ? int(TQt::AlignLeft) : 0);
if(position == Left && d->widgetType != Boolean)
- d->layout->addSpacing(KexiDBAutoField_SPACING);
- d->layout->addWidget(m_subwidget, 1);
- KexiSubwidgetInterface *subwidgetInterface = dynamic_cast<KexiSubwidgetInterface*>((QWidget*)m_subwidget);
+ d->tqlayout->addSpacing(KexiDBAutoField_SPACING);
+ d->tqlayout->addWidget(m_subwidget, 1);
+ KexiSubwidgetInterface *subwidgetInterface = dynamic_cast<KexiSubwidgetInterface*>((TQWidget*)m_subwidget);
if (subwidgetInterface) {
if (subwidgetInterface->appendStretchRequired(this))
- d->layout->addStretch(0);
+ d->tqlayout->addStretch(0);
if (subwidgetInterface->subwidgetStretchRequired(this)) {
- QSizePolicy sizePolicy( m_subwidget->sizePolicy() );
+ TQSizePolicy sizePolicy( m_subwidget->tqsizePolicy() );
if(position == Left) {
- sizePolicy.setHorData( QSizePolicy::Minimum );
- d->label->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Preferred);
+ sizePolicy.setHorData( TQSizePolicy::Minimum );
+ d->label->tqsetSizePolicy(TQSizePolicy::Fixed, TQSizePolicy::Preferred);
}
else {
- sizePolicy.setVerData( QSizePolicy::Minimum );
- d->label->setSizePolicy(QSizePolicy::Preferred, QSizePolicy::Fixed);
+ sizePolicy.setVerData( TQSizePolicy::Minimum );
+ d->label->tqsetSizePolicy(TQSizePolicy::Preferred, TQSizePolicy::Fixed);
}
- m_subwidget->setSizePolicy(sizePolicy);
+ m_subwidget->tqsetSizePolicy(sizePolicy);
}
}
// if(m_subwidget)
- // m_subwidget->setSizePolicy(...);
+ // m_subwidget->tqsetSizePolicy(...);
}
else {
- d->layout = (QBoxLayout*) new QHBoxLayout(this);
+ d->tqlayout = (TQBoxLayout*) new TQHBoxLayout(this);
d->label->hide();
- d->layout->addWidget(m_subwidget);
+ d->tqlayout->addWidget(m_subwidget);
}
- //a hack to force layout to be refreshed (any better idea for this?)
- resize(size()+QSize(1,0));
- resize(size()-QSize(1,0));
- if (dynamic_cast<KexiDBAutoField*>((QWidget*)m_subwidget)) {
+ //a hack to force tqlayout to be refreshed (any better idea for this?)
+ resize(size()+TQSize(1,0));
+ resize(size()-TQSize(1,0));
+ if (dynamic_cast<KexiDBAutoField*>((TQWidget*)m_subwidget)) {
//needed for KexiDBComboBox
- dynamic_cast<KexiDBAutoField*>((QWidget*)m_subwidget)->setLabelPosition(position);
+ dynamic_cast<KexiDBAutoField*>((TQWidget*)m_subwidget)->setLabelPosition(position);
}
}
void
-KexiDBAutoField::setInvalidState( const QString &text )
+KexiDBAutoField::setInvalidState( const TQString &text )
{
- // Widget with an invalid dataSource is just a QLabel
+ // Widget with an invalid dataSource is just a TQLabel
if (d->designMode)
return;
d->widgetType = Auto;
createEditor();
- setFocusPolicy(QWidget::NoFocus);
+ setFocusPolicy(TQ_NoFocus);
if (m_subwidget)
- m_subwidget->setFocusPolicy(QWidget::NoFocus);
+ m_subwidget->setFocusPolicy(TQ_NoFocus);
//! @todo or set this to editor's text?
d->label->setText( text );
}
@@ -310,7 +310,7 @@ KexiDBAutoField::setInvalidState( const QString &text )
bool
KexiDBAutoField::isReadOnly() const
{
- KexiFormDataItemInterface *iface = dynamic_cast<KexiFormDataItemInterface*>((QWidget*)m_subwidget);
+ KexiFormDataItemInterface *iface = dynamic_cast<KexiFormDataItemInterface*>((TQWidget*)m_subwidget);
if(iface)
return iface->isReadOnly();
else
@@ -320,33 +320,33 @@ KexiDBAutoField::isReadOnly() const
void
KexiDBAutoField::setReadOnly( bool readOnly )
{
- KexiFormDataItemInterface *iface = dynamic_cast<KexiFormDataItemInterface*>((QWidget*)m_subwidget);
+ KexiFormDataItemInterface *iface = dynamic_cast<KexiFormDataItemInterface*>((TQWidget*)m_subwidget);
if(iface)
iface->setReadOnly(readOnly);
}
void
-KexiDBAutoField::setValueInternal(const QVariant& add, bool removeOld)
+KexiDBAutoField::setValueInternal(const TQVariant& add, bool removeOld)
{
- KexiFormDataItemInterface *iface = dynamic_cast<KexiFormDataItemInterface*>((QWidget*)m_subwidget);
+ KexiFormDataItemInterface *iface = dynamic_cast<KexiFormDataItemInterface*>((TQWidget*)m_subwidget);
if(iface)
iface->setValue(m_origValue, add, removeOld);
// iface->setValueInternal(add, removeOld);
}
-QVariant
+TQVariant
KexiDBAutoField::value()
{
- KexiFormDataItemInterface *iface = dynamic_cast<KexiFormDataItemInterface*>((QWidget*)m_subwidget);
+ KexiFormDataItemInterface *iface = dynamic_cast<KexiFormDataItemInterface*>((TQWidget*)m_subwidget);
if(iface)
return iface->value();
- return QVariant();
+ return TQVariant();
}
bool
KexiDBAutoField::valueIsNull()
{
- KexiFormDataItemInterface *iface = dynamic_cast<KexiFormDataItemInterface*>((QWidget*)m_subwidget);
+ KexiFormDataItemInterface *iface = dynamic_cast<KexiFormDataItemInterface*>((TQWidget*)m_subwidget);
if(iface)
return iface->valueIsNull();
return true;
@@ -355,7 +355,7 @@ KexiDBAutoField::valueIsNull()
bool
KexiDBAutoField::valueIsEmpty()
{
- KexiFormDataItemInterface *iface = dynamic_cast<KexiFormDataItemInterface*>((QWidget*)m_subwidget);
+ KexiFormDataItemInterface *iface = dynamic_cast<KexiFormDataItemInterface*>((TQWidget*)m_subwidget);
if(iface)
return iface->valueIsEmpty();
return true;
@@ -364,7 +364,7 @@ KexiDBAutoField::valueIsEmpty()
bool
KexiDBAutoField::valueIsValid()
{
- KexiFormDataItemInterface *iface = dynamic_cast<KexiFormDataItemInterface*>((QWidget*)m_subwidget);
+ KexiFormDataItemInterface *iface = dynamic_cast<KexiFormDataItemInterface*>((TQWidget*)m_subwidget);
if(iface)
return iface->valueIsValid();
return true;
@@ -373,7 +373,7 @@ KexiDBAutoField::valueIsValid()
bool
KexiDBAutoField::valueChanged()
{
- KexiFormDataItemInterface *iface = dynamic_cast<KexiFormDataItemInterface*>((QWidget*)m_subwidget);
+ KexiFormDataItemInterface *iface = dynamic_cast<KexiFormDataItemInterface*>((TQWidget*)m_subwidget);
kexipluginsdbg << m_origValue << endl;
if(iface)
return iface->valueChanged();
@@ -384,7 +384,7 @@ void
KexiDBAutoField::installListener(KexiDataItemChangesListener* listener)
{
KexiFormDataItemInterface::installListener(listener);
- KexiFormDataItemInterface *iface = dynamic_cast<KexiFormDataItemInterface*>((QWidget*)m_subwidget);
+ KexiFormDataItemInterface *iface = dynamic_cast<KexiFormDataItemInterface*>((TQWidget*)m_subwidget);
if(iface)
iface->installListener(listener);
}
@@ -399,7 +399,7 @@ KexiDBAutoField::LabelPosition KexiDBAutoField::labelPosition() const
return d->lblPosition;
}
-QString KexiDBAutoField::caption() const
+TQString KexiDBAutoField::caption() const
{
return d->caption;
}
@@ -409,12 +409,12 @@ bool KexiDBAutoField::hasAutoCaption() const
return d->autoCaption;
}
-QWidget* KexiDBAutoField::editor() const
+TQWidget* KexiDBAutoField::editor() const
{
return m_subwidget;
}
-QLabel* KexiDBAutoField::label() const
+TQLabel* KexiDBAutoField::label() const
{
return d->label;
}
@@ -424,7 +424,7 @@ int KexiDBAutoField::fieldTypeInternal() const
return d->fieldTypeInternal;
}
-QString KexiDBAutoField::fieldCaptionInternal() const
+TQString KexiDBAutoField::fieldCaptionInternal() const
{
return d->fieldCaptionInternal;
}
@@ -432,7 +432,7 @@ QString KexiDBAutoField::fieldCaptionInternal() const
bool
KexiDBAutoField::cursorAtStart()
{
- KexiFormDataItemInterface *iface = dynamic_cast<KexiFormDataItemInterface*>((QWidget*)m_subwidget);
+ KexiFormDataItemInterface *iface = dynamic_cast<KexiFormDataItemInterface*>((TQWidget*)m_subwidget);
if(iface)
return iface->cursorAtStart();
return false;
@@ -441,7 +441,7 @@ KexiDBAutoField::cursorAtStart()
bool
KexiDBAutoField::cursorAtEnd()
{
- KexiFormDataItemInterface *iface = dynamic_cast<KexiFormDataItemInterface*>((QWidget*)m_subwidget);
+ KexiFormDataItemInterface *iface = dynamic_cast<KexiFormDataItemInterface*>((TQWidget*)m_subwidget);
if(iface)
return iface->cursorAtEnd();
return false;
@@ -450,7 +450,7 @@ KexiDBAutoField::cursorAtEnd()
void
KexiDBAutoField::clear()
{
- KexiFormDataItemInterface *iface = dynamic_cast<KexiFormDataItemInterface*>((QWidget*)m_subwidget);
+ KexiFormDataItemInterface *iface = dynamic_cast<KexiFormDataItemInterface*>((TQWidget*)m_subwidget);
if(iface)
iface->clear();
}
@@ -480,11 +480,11 @@ KexiDBAutoField::setFieldTypeInternal(int kexiDBFieldType)
}
void
-KexiDBAutoField::setFieldCaptionInternal(const QString& text)
+KexiDBAutoField::setFieldCaptionInternal(const TQString& text)
{
d->fieldCaptionInternal = text;
//change text only if autocaption is set and no columnInfo is available
- KexiFormDataItemInterface *iface = dynamic_cast<KexiFormDataItemInterface*>((QWidget*)m_subwidget);
+ KexiFormDataItemInterface *iface = dynamic_cast<KexiFormDataItemInterface*>((TQWidget*)m_subwidget);
if((!iface || !iface->columnInfo()) && d->autoCaption) {
changeText(d->fieldCaptionInternal);
}
@@ -522,7 +522,7 @@ KexiDBAutoField::setColumnInfoInternal(KexiDB::QueryColumnInfo* cinfo, KexiDB::Q
// update label's text
changeText((cinfo && d->autoCaption) ? cinfo->captionOrAliasOrName() : d->caption);
- KexiFormDataItemInterface *iface = dynamic_cast<KexiFormDataItemInterface*>((QWidget*)m_subwidget);
+ KexiFormDataItemInterface *iface = dynamic_cast<KexiFormDataItemInterface*>((TQWidget*)m_subwidget);
if(iface)
iface->setColumnInfo(visibleColumnInfo);
}
@@ -564,15 +564,15 @@ KexiDBAutoField::widgetTypeForFieldType(KexiDB::Field::Type type)
}
void
-KexiDBAutoField::changeText(const QString &text, bool beautify)
+KexiDBAutoField::changeText(const TQString &text, bool beautify)
{
- QString realText;
+ TQString realText;
bool unbound = false;
if (d->autoCaption && (d->widgetType==Auto || dataSource().isEmpty())) {
if (d->designMode)
- realText = QString::fromLatin1(name())+" "+i18n("Unbound Auto Field", "(unbound)");
+ realText = TQString::tqfromLatin1(name())+" "+i18n("Unbound Auto Field", "(unbound)");
else
- realText = QString::null;
+ realText = TQString();
unbound = true;
}
else {
@@ -584,7 +584,7 @@ KexiDBAutoField::changeText(const QString &text, bool beautify)
realText = text[0].upper() + text.mid(1);
if (d->widgetType!=Boolean) {
//! @todo ":" suffix looks weird for checkbox; remove this condition when [x] is displayed _after_ label
-//! @todo support right-to-left layout where position of ":" is inverted
+//! @todo support right-to-left tqlayout where position of ":" is inverted
realText += ": ";
}
}
@@ -594,12 +594,12 @@ KexiDBAutoField::changeText(const QString &text, bool beautify)
}
if (unbound)
- d->label->setAlignment( Qt::AlignCenter | Qt::WordBreak );
+ d->label->tqsetAlignment( TQt::AlignCenter | TQt::WordBreak );
else
- d->label->setAlignment( Qt::AlignCenter );
-// QWidget* widgetToAlterForegroundColor;
+ d->label->tqsetAlignment( TQt::AlignCenter );
+// TQWidget* widgetToAlterForegroundColor;
if(d->widgetType == Boolean) {
- static_cast<QCheckBox*>((QWidget*)m_subwidget)->setText(realText);
+ static_cast<TQCheckBox*>((TQWidget*)m_subwidget)->setText(realText);
// widgetToAlterForegroundColor = m_subwidget;
}
else {
@@ -617,7 +617,7 @@ KexiDBAutoField::changeText(const QString &text, bool beautify)
}
void
-KexiDBAutoField::setCaption(const QString &caption)
+KexiDBAutoField::setCaption(const TQString &caption)
{
d->caption = caption;
if(!d->autoCaption && !caption.isEmpty())
@@ -629,7 +629,7 @@ KexiDBAutoField::setAutoCaption(bool autoCaption)
{
d->autoCaption = autoCaption;
if(d->autoCaption) {
- //d->caption = QString::null;
+ //d->caption = TQString();
if(columnInfo()) {
changeText(columnInfo()->captionOrAliasOrName());
}
@@ -642,35 +642,35 @@ KexiDBAutoField::setAutoCaption(bool autoCaption)
}
void
-KexiDBAutoField::setDataSource( const QString &ds ) {
+KexiDBAutoField::setDataSource( const TQString &ds ) {
KexiFormDataItemInterface::setDataSource(ds);
if (ds.isEmpty()) {
setColumnInfo(0);
}
}
-QSize
-KexiDBAutoField::sizeHint() const
+TQSize
+KexiDBAutoField::tqsizeHint() const
{
if (d->lblPosition == NoLabel)
- return m_subwidget ? m_subwidget->sizeHint() : QWidget::sizeHint();
+ return m_subwidget ? m_subwidget->tqsizeHint() : TQWidget::tqsizeHint();
- QSize s1(0,0);
+ TQSize s1(0,0);
if (m_subwidget)
- s1 = m_subwidget->sizeHint();
- QSize s2(d->label->sizeHint());
+ s1 = m_subwidget->tqsizeHint();
+ TQSize s2(d->label->tqsizeHint());
if (d->lblPosition == Top)
- return QSize(QMAX(s1.width(), s2.width()), s1.height()+KexiDBAutoField_SPACING+s2.height());
+ return TQSize(TQMAX(s1.width(), s2.width()), s1.height()+KexiDBAutoField_SPACING+s2.height());
//left
- return QSize(s1.width()+KexiDBAutoField_SPACING+s2.width(), QMAX(s1.height(), s2.height()));
+ return TQSize(s1.width()+KexiDBAutoField_SPACING+s2.width(), TQMAX(s1.height(), s2.height()));
}
void
-KexiDBAutoField::setFocusPolicy( FocusPolicy policy )
+KexiDBAutoField::setFocusPolicy( TQ_FocusPolicy policy )
{
d->focusPolicyChanged = true;
- QWidget::setFocusPolicy(policy);
+ TQWidget::setFocusPolicy(policy);
d->label->setFocusPolicy(policy);
if (m_subwidget)
m_subwidget->setFocusPolicy(policy);
@@ -682,31 +682,31 @@ KexiDBAutoField::updateInformationAboutUnboundField()
if ( (d->autoCaption && (dataSource().isEmpty() || dataSourceMimeType().isEmpty()))
|| (!d->autoCaption && d->caption.isEmpty()) )
{
- d->label->setText( QString::fromLatin1(name())+" "+i18n("Unbound Auto Field", " (unbound)") );
+ d->label->setText( TQString::tqfromLatin1(name())+" "+i18n("Unbound Auto Field", " (unbound)") );
}
// else
-// d->label->setText( QString::fromLatin1(name())+" "+i18n(" (unbound)") );
+// d->label->setText( TQString::tqfromLatin1(name())+" "+i18n(" (unbound)") );
}
/*void
-KexiDBAutoField::paintEvent( QPaintEvent* pe )
+KexiDBAutoField::paintEvent( TQPaintEvent* pe )
{
- QWidget::paintEvent( pe );
+ TQWidget::paintEvent( pe );
if ( (d->autoCaption && (dataSource().isEmpty() || dataSourceMimeType().isEmpty()))
|| (!d->autoCaption && d->caption.isEmpty()) )
{
- QPainter p(this);
+ TQPainter p(this);
p.setPen( d->label->paletteForegroundColor() );
p.setClipRect(pe->rect());
p.setFont(d->label->font());
- p.drawText(rect(), Qt::AlignLeft | Qt::WordBreak,
- QString::fromLatin1(name())+" "+i18n(" (unbound)"));
+ p.drawText(rect(), TQt::AlignLeft | TQt::WordBreak,
+ TQString::tqfromLatin1(name())+" "+i18n(" (unbound)"));
}
}*/
void
-KexiDBAutoField::paletteChange( const QPalette& oldPal )
+KexiDBAutoField::paletteChange( const TQPalette& oldPal )
{
Q_UNUSED(oldPal);
d->label->setPalette( palette() );
@@ -714,35 +714,35 @@ KexiDBAutoField::paletteChange( const QPalette& oldPal )
void KexiDBAutoField::unsetPalette()
{
- QWidget::unsetPalette();
+ TQWidget::unsetPalette();
}
// ===== methods below are just proxies for the internal editor or label =====
-const QColor & KexiDBAutoField::paletteForegroundColor() const
+const TQColor & KexiDBAutoField::paletteForegroundColor() const
{
return d->textColor;
}
-void KexiDBAutoField::setPaletteForegroundColor( const QColor & color )
+void KexiDBAutoField::setPaletteForegroundColor( const TQColor & color )
{
d->textColor = color;
copyPropertiesToEditor();
}
-const QColor & KexiDBAutoField::paletteBackgroundColor() const
+const TQColor & KexiDBAutoField::paletteBackgroundColor() const
{
return d->baseColor;
}
-void KexiDBAutoField::setPaletteBackgroundColor( const QColor & color )
+void KexiDBAutoField::setPaletteBackgroundColor( const TQColor & color )
{
d->baseColor = color;
copyPropertiesToEditor();
}
-const QColor & KexiDBAutoField::foregroundLabelColor() const
+const TQColor & KexiDBAutoField::foregroundLabelColor() const
{
if(d->widgetType == Boolean)
return paletteForegroundColor();
@@ -750,17 +750,17 @@ const QColor & KexiDBAutoField::foregroundLabelColor() const
return d->label->paletteForegroundColor();
}
-void KexiDBAutoField::setForegroundLabelColor( const QColor & color )
+void KexiDBAutoField::setForegroundLabelColor( const TQColor & color )
{
if(d->widgetType == Boolean)
setPaletteForegroundColor(color);
else {
d->label->setPaletteForegroundColor(color);
- QWidget::setPaletteForegroundColor(color);
+ TQWidget::setPaletteForegroundColor(color);
}
}
-const QColor & KexiDBAutoField::backgroundLabelColor() const
+const TQColor & KexiDBAutoField::backgroundLabelColor() const
{
if(d->widgetType == Boolean)
return paletteBackgroundColor();
@@ -768,76 +768,76 @@ const QColor & KexiDBAutoField::backgroundLabelColor() const
return d->label->paletteBackgroundColor();
}
-void KexiDBAutoField::setBackgroundLabelColor( const QColor & color )
+void KexiDBAutoField::setBackgroundLabelColor( const TQColor & color )
{
if(d->widgetType == Boolean)
setPaletteBackgroundColor(color);
else {
d->label->setPaletteBackgroundColor(color);
- QWidget::setPaletteBackgroundColor(color);
+ TQWidget::setPaletteBackgroundColor(color);
}
// if (m_subwidget)
-// m_subwidget->setPalette( qApp->palette() );
+// m_subwidget->setPalette( tqApp->palette() );
}
-QVariant KexiDBAutoField::property( const char * name ) const
+TQVariant KexiDBAutoField::property( const char * name ) const
{
bool ok;
- QVariant val = KFormDesigner::WidgetWithSubpropertiesInterface::subproperty(name, ok);
+ TQVariant val = KFormDesigner::WidgetWithSubpropertiesInterface::subproperty(name, ok);
if (ok)
return val;
- return QWidget::property(name);
+ return TQWidget::property(name);
}
-bool KexiDBAutoField::setProperty( const char * name, const QVariant & value )
+bool KexiDBAutoField::setProperty( const char * name, const TQVariant & value )
{
bool ok = KFormDesigner::WidgetWithSubpropertiesInterface::setSubproperty(name, value);
if (ok)
return true;
- return QWidget::setProperty(name, value);
+ return TQWidget::setProperty(name, value);
}
-bool KexiDBAutoField::eventFilter( QObject *o, QEvent *e )
+bool KexiDBAutoField::eventFilter( TQObject *o, TQEvent *e )
{
- if (o==d->label && d->label->buddy() && e->type()==QEvent::MouseButtonRelease) {
+ if (TQT_BASE_OBJECT(o)==TQT_BASE_OBJECT(d->label) && d->label->buddy() && e->type()==TQEvent::MouseButtonRelease) {
//focus label's buddy when user clicked the label
d->label->buddy()->setFocus();
}
- return QWidget::eventFilter(o, e);
+ return TQWidget::eventFilter(o, e);
}
-void KexiDBAutoField::setDisplayDefaultValue(QWidget* widget, bool displayDefaultValue)
+void KexiDBAutoField::setDisplayDefaultValue(TQWidget* widget, bool displayDefaultValue)
{
KexiFormDataItemInterface::setDisplayDefaultValue(widget, displayDefaultValue);
- if (dynamic_cast<KexiFormDataItemInterface*>((QWidget*)m_subwidget))
- dynamic_cast<KexiFormDataItemInterface*>((QWidget*)m_subwidget)->setDisplayDefaultValue(m_subwidget, displayDefaultValue);
+ if (dynamic_cast<KexiFormDataItemInterface*>((TQWidget*)m_subwidget))
+ dynamic_cast<KexiFormDataItemInterface*>((TQWidget*)m_subwidget)->setDisplayDefaultValue(m_subwidget, displayDefaultValue);
}
void KexiDBAutoField::moveCursorToEnd()
{
- KexiDataItemInterface *iface = dynamic_cast<KexiDataItemInterface*>((QWidget*)m_subwidget);
+ KexiDataItemInterface *iface = dynamic_cast<KexiDataItemInterface*>((TQWidget*)m_subwidget);
if (iface)
iface->moveCursorToEnd();
}
void KexiDBAutoField::moveCursorToStart()
{
- KexiDataItemInterface *iface = dynamic_cast<KexiDataItemInterface*>((QWidget*)m_subwidget);
+ KexiDataItemInterface *iface = dynamic_cast<KexiDataItemInterface*>((TQWidget*)m_subwidget);
if (iface)
iface->moveCursorToStart();
}
void KexiDBAutoField::selectAll()
{
- KexiDataItemInterface *iface = dynamic_cast<KexiDataItemInterface*>((QWidget*)m_subwidget);
+ KexiDataItemInterface *iface = dynamic_cast<KexiDataItemInterface*>((TQWidget*)m_subwidget);
if (iface)
iface->selectAll();
}
-bool KexiDBAutoField::keyPressed(QKeyEvent *ke)
+bool KexiDBAutoField::keyPressed(TQKeyEvent *ke)
{
- KexiFormDataItemInterface *iface = dynamic_cast<KexiFormDataItemInterface*>((QWidget*)m_subwidget);
+ KexiFormDataItemInterface *iface = dynamic_cast<KexiFormDataItemInterface*>((TQWidget*)m_subwidget);
if (iface && iface->keyPressed(ke))
return true;
return false;
diff --git a/kexi/plugins/forms/widgets/kexidbautofield.h b/kexi/plugins/forms/widgets/kexidbautofield.h
index 981a0519..f13e701e 100644
--- a/kexi/plugins/forms/widgets/kexidbautofield.h
+++ b/kexi/plugins/forms/widgets/kexidbautofield.h
@@ -22,39 +22,40 @@
#ifndef KEXIDBAUTOFIELD_H
#define KEXIDBAUTOFIELD_H
-#include <qwidget.h>
+#include <tqwidget.h>
#include <kexidb/field.h>
#include <formeditor/container.h>
#include <formeditor/widgetwithsubpropertiesinterface.h>
#include "kexiformdataiteminterface.h"
-class QBoxLayout;
-class QLabel;
+class TQBoxLayout;
+class TQLabel;
//! Universal "Auto Field" widget for Kexi forms
/*! It acts as a container for most data-aware widgets. */
class KEXIFORMUTILS_EXPORT KexiDBAutoField :
- public QWidget,
+ public TQWidget,
public KexiFormDataItemInterface,
public KFormDesigner::DesignTimeDynamicChildWidgetHandler,
public KFormDesigner::WidgetWithSubpropertiesInterface
{
Q_OBJECT
-//'caption' is uncovered now Q_PROPERTY(QString labelCaption READ caption WRITE setCaption DESIGNABLE true)
- Q_OVERRIDE(QString caption READ caption WRITE setCaption DESIGNABLE true)
- Q_OVERRIDE(QColor paletteForegroundColor READ paletteForegroundColor WRITE setPaletteForegroundColor DESIGNABLE true RESET unsetPalette)
- Q_OVERRIDE(QColor paletteBackgroundColor READ paletteBackgroundColor WRITE setPaletteBackgroundColor DESIGNABLE true RESET unsetPalette)
- Q_PROPERTY(QColor foregroundLabelColor READ foregroundLabelColor WRITE setForegroundLabelColor DESIGNABLE true RESET unsetPalette)
- Q_PROPERTY(QColor backgroundLabelColor READ backgroundLabelColor WRITE setBackgroundLabelColor DESIGNABLE true RESET unsetPalette)
- Q_PROPERTY(bool autoCaption READ hasAutoCaption WRITE setAutoCaption DESIGNABLE true)
- Q_PROPERTY(QString dataSource READ dataSource WRITE setDataSource DESIGNABLE true)
- Q_PROPERTY(QCString dataSourceMimeType READ dataSourceMimeType WRITE setDataSourceMimeType DESIGNABLE true)
- Q_PROPERTY( bool readOnly READ isReadOnly WRITE setReadOnly )
- Q_PROPERTY(LabelPosition labelPosition READ labelPosition WRITE setLabelPosition DESIGNABLE true)
- Q_PROPERTY(WidgetType widgetType READ widgetType WRITE setWidgetType DESIGNABLE true)
+ TQ_OBJECT
+//'caption' is uncovered now TQ_PROPERTY(TQString labelCaption READ caption WRITE setCaption DESIGNABLE true)
+ TQ_OVERRIDE(TQString caption READ caption WRITE setCaption DESIGNABLE true)
+ TQ_OVERRIDE(TQColor paletteForegroundColor READ paletteForegroundColor WRITE setPaletteForegroundColor DESIGNABLE true RESET unsetPalette)
+ TQ_OVERRIDE(TQColor paletteBackgroundColor READ paletteBackgroundColor WRITE setPaletteBackgroundColor DESIGNABLE true RESET unsetPalette)
+ TQ_PROPERTY(TQColor foregroundLabelColor READ foregroundLabelColor WRITE setForegroundLabelColor DESIGNABLE true RESET unsetPalette)
+ TQ_PROPERTY(TQColor backgroundLabelColor READ backgroundLabelColor WRITE setBackgroundLabelColor DESIGNABLE true RESET unsetPalette)
+ TQ_PROPERTY(bool autoCaption READ hasAutoCaption WRITE setAutoCaption DESIGNABLE true)
+ TQ_PROPERTY(TQString dataSource READ dataSource WRITE setDataSource DESIGNABLE true)
+ TQ_PROPERTY(TQCString dataSourceMimeType READ dataSourceMimeType WRITE setDataSourceMimeType DESIGNABLE true)
+ TQ_PROPERTY( bool readOnly READ isReadOnly WRITE setReadOnly )
+ TQ_PROPERTY(LabelPosition labelPosition READ labelPosition WRITE setLabelPosition DESIGNABLE true)
+ TQ_PROPERTY(WidgetType widgetType READ widgetType WRITE setWidgetType DESIGNABLE true)
/*internal, for design time only*/
- Q_PROPERTY(int fieldTypeInternal READ fieldTypeInternal WRITE setFieldTypeInternal DESIGNABLE true STORED false)
- Q_PROPERTY(QString fieldCaptionInternal READ fieldCaptionInternal WRITE setFieldCaptionInternal DESIGNABLE true STORED false)
+ TQ_PROPERTY(int fieldTypeInternal READ fieldTypeInternal WRITE setFieldTypeInternal DESIGNABLE true STORED false)
+ TQ_PROPERTY(TQString fieldCaptionInternal READ fieldCaptionInternal WRITE setFieldCaptionInternal DESIGNABLE true STORED false)
Q_ENUMS( WidgetType LabelPosition )
public:
@@ -62,24 +63,24 @@ class KEXIFORMUTILS_EXPORT KexiDBAutoField :
MultiLineText, ComboBox, Image };
enum LabelPosition { Left = 300, Top, NoLabel };
- KexiDBAutoField(const QString &text, WidgetType type, LabelPosition pos,
- QWidget *parent = 0, const char *name = 0, bool designMode = true);
- KexiDBAutoField(QWidget *parent = 0, const char *name = 0, bool designMode = true,
+ KexiDBAutoField(const TQString &text, WidgetType type, LabelPosition pos,
+ TQWidget *tqparent = 0, const char *name = 0, bool designMode = true);
+ KexiDBAutoField(TQWidget *tqparent = 0, const char *name = 0, bool designMode = true,
LabelPosition pos = Left);
virtual ~KexiDBAutoField();
- inline QString dataSource() const { return KexiFormDataItemInterface::dataSource(); }
- inline QCString dataSourceMimeType() const { return KexiFormDataItemInterface::dataSourceMimeType(); }
- virtual void setDataSource( const QString &ds );
- virtual void setDataSourceMimeType(const QCString &ds) { KexiFormDataItemInterface::setDataSourceMimeType(ds); }
+ inline TQString dataSource() const { return KexiFormDataItemInterface::dataSource(); }
+ inline TQCString dataSourceMimeType() const { return KexiFormDataItemInterface::dataSourceMimeType(); }
+ virtual void setDataSource( const TQString &ds );
+ virtual void setDataSourceMimeType(const TQCString &ds) { KexiFormDataItemInterface::setDataSourceMimeType(ds); }
virtual void setColumnInfo(KexiDB::QueryColumnInfo* cinfo);
- virtual void setInvalidState(const QString& text);
+ virtual void setInvalidState(const TQString& text);
virtual bool isReadOnly() const;
virtual void setReadOnly( bool readOnly );
- virtual QVariant value();
+ virtual TQVariant value();
virtual bool valueIsNull();
virtual bool valueIsEmpty();
virtual bool valueIsValid();
@@ -95,8 +96,8 @@ class KEXIFORMUTILS_EXPORT KexiDBAutoField :
LabelPosition labelPosition() const;
virtual void setLabelPosition(LabelPosition position);
- QString caption() const;
- void setCaption(const QString &caption);
+ TQString caption() const;
+ void setCaption(const TQString &caption);
bool hasAutoCaption() const;
void setAutoCaption(bool autoCaption);
@@ -105,10 +106,10 @@ class KEXIFORMUTILS_EXPORT KexiDBAutoField :
is displayed in a special way. Used by KexiFormDataProvider::fillDataItems().
\a widget is equal to 'this'.
Reimplemented after KexiFormDataItemInterface. */
- virtual void setDisplayDefaultValue(QWidget* widget, bool displayDefaultValue);
+ virtual void setDisplayDefaultValue(TQWidget* widget, bool displayDefaultValue);
- QWidget* editor() const;
- QLabel* label() const;
+ TQWidget* editor() const;
+ TQLabel* label() const;
virtual bool cursorAtStart();
virtual bool cursorAtEnd();
@@ -123,56 +124,56 @@ class KEXIFORMUTILS_EXPORT KexiDBAutoField :
/*! On design time it is not possible to pass a reference to KexiDB::Field object
so we're just providing field caption. Only used when widget type is Auto.
@internal */
- void setFieldCaptionInternal(const QString& text);
+ void setFieldCaptionInternal(const TQString& text);
/*! @internal */
int fieldTypeInternal() const;
/*! @internal */
- QString fieldCaptionInternal() const;
+ TQString fieldCaptionInternal() const;
- virtual QSize sizeHint() const;
- virtual void setFocusPolicy ( FocusPolicy policy );
+ virtual TQSize tqsizeHint() const;
+ virtual void setFocusPolicy ( TQ_FocusPolicy policy );
//! Reimplemented to return internal editor's color.
- const QColor & paletteForegroundColor() const;
+ const TQColor & paletteForegroundColor() const;
//! Reimplemented to set internal editor's color.
- void setPaletteForegroundColor( const QColor & color );
+ void setPaletteForegroundColor( const TQColor & color );
//! Reimplemented to return internal editor's color.
- const QColor & paletteBackgroundColor() const;
+ const TQColor & paletteBackgroundColor() const;
//! Reimplemented to set internal editor's color.
- virtual void setPaletteBackgroundColor( const QColor & color );
+ virtual void setPaletteBackgroundColor( const TQColor & color );
//! \return label's foreground color
- const QColor & foregroundLabelColor() const;
+ const TQColor & foregroundLabelColor() const;
//! Sets label's foreground color
- virtual void setForegroundLabelColor( const QColor & color );
+ virtual void setForegroundLabelColor( const TQColor & color );
//! \return label's background color
- const QColor & backgroundLabelColor() const;
+ const TQColor & backgroundLabelColor() const;
//! Sets label's background color
- virtual void setBackgroundLabelColor( const QColor & color );
+ virtual void setBackgroundLabelColor( const TQColor & color );
//! Reimplemented to accept subproperties. @see KFormDesigner::WidgetWithSubpropertiesInterface
- virtual QVariant property( const char * name ) const;
+ virtual TQVariant property( const char * name ) const;
//! Reimplemented to accept subproperties. @see KFormDesigner::WidgetWithSubpropertiesInterface
- virtual bool setProperty( const char * name, const QVariant & value );
+ virtual bool setProperty( const char * name, const TQVariant & value );
/*! Called by the top-level form on key press event to consume widget-specific shortcuts. */
- virtual bool keyPressed(QKeyEvent *ke);
+ virtual bool keyPressed(TQKeyEvent *ke);
public slots:
virtual void unsetPalette();
protected slots:
// void slotValueChanged();
- virtual void paletteChange( const QPalette& oldPal );
+ virtual void paletteChange( const TQPalette& oldPal );
//! Implemented for KexiDataItemInterface
virtual void moveCursorToEnd();
@@ -184,17 +185,17 @@ class KEXIFORMUTILS_EXPORT KexiDBAutoField :
virtual void selectAll();
protected:
- virtual void setValueInternal(const QVariant&add, bool removeOld);
- void init(const QString &text, WidgetType type, LabelPosition pos);
+ virtual void setValueInternal(const TQVariant&add, bool removeOld);
+ void init(const TQString &text, WidgetType type, LabelPosition pos);
virtual void createEditor();
- void changeText(const QString &text, bool beautify = true);
-// virtual void paintEvent( QPaintEvent* pe );
+ void changeText(const TQString &text, bool beautify = true);
+// virtual void paintEvent( TQPaintEvent* pe );
void updateInformationAboutUnboundField();
//! internal editor can be created too late, so certain properties should be copied
void copyPropertiesToEditor();
- virtual bool eventFilter( QObject *o, QEvent *e );
+ virtual bool eventFilter( TQObject *o, TQEvent *e );
//! Used by @ref setLabelPositionInternal(LabelPosition)
void setLabelPositionInternal(LabelPosition position, bool noLabel);
diff --git a/kexi/plugins/forms/widgets/kexidbcheckbox.cpp b/kexi/plugins/forms/widgets/kexidbcheckbox.cpp
index 6b63851a..c704a985 100644
--- a/kexi/plugins/forms/widgets/kexidbcheckbox.cpp
+++ b/kexi/plugins/forms/widgets/kexidbcheckbox.cpp
@@ -23,29 +23,29 @@
#include <kexiutils/utils.h>
#include <kexidb/queryschema.h>
-KexiDBCheckBox::KexiDBCheckBox(const QString &text, QWidget *parent, const char *name)
- : QCheckBox(text, parent, name), KexiFormDataItemInterface()
+KexiDBCheckBox::KexiDBCheckBox(const TQString &text, TQWidget *tqparent, const char *name)
+ : TQCheckBox(text, tqparent, name), KexiFormDataItemInterface()
, m_invalidState(false)
, m_tristateChanged(false)
, m_tristate(TristateDefault)
{
- setFocusPolicy(QWidget::StrongFocus);
+ setFocusPolicy(TQ_StrongFocus);
updateTristate();
- connect(this, SIGNAL(stateChanged(int)), this, SLOT(slotStateChanged(int)));
+ connect(this, TQT_SIGNAL(stateChanged(int)), this, TQT_SLOT(slotStateChanged(int)));
}
KexiDBCheckBox::~KexiDBCheckBox()
{
}
-void KexiDBCheckBox::setInvalidState( const QString& displayText )
+void KexiDBCheckBox::setInvalidState( const TQString& displayText )
{
setEnabled(false);
setState(NoChange);
m_invalidState = true;
//! @todo move this to KexiDataItemInterface::setInvalidStateInternal() ?
- if (focusPolicy() & TabFocus)
- setFocusPolicy(QWidget::ClickFocus);
+ if (focusPolicy() & TQ_TabFocus)
+ setFocusPolicy(TQ_ClickFocus);
setText(displayText);
}
@@ -54,7 +54,7 @@ KexiDBCheckBox::setEnabled(bool enabled)
{
if(enabled && m_invalidState)
return;
- QCheckBox::setEnabled(enabled);
+ TQCheckBox::setEnabled(enabled);
}
void
@@ -63,7 +63,7 @@ KexiDBCheckBox::setReadOnly(bool readOnly)
setEnabled(!readOnly);
}
-void KexiDBCheckBox::setValueInternal(const QVariant &add, bool removeOld)
+void KexiDBCheckBox::setValueInternal(const TQVariant &add, bool removeOld)
{
Q_UNUSED(add);
Q_UNUSED(removeOld);
@@ -73,12 +73,12 @@ void KexiDBCheckBox::setValueInternal(const QVariant &add, bool removeOld)
setState( m_origValue.toBool() ? On : Off );
}
-QVariant
+TQVariant
KexiDBCheckBox::value()
{
if (state()==NoChange)
- return QVariant();
- return QVariant(state()==On, 1);
+ return TQVariant();
+ return TQVariant(state()==On, 1);
}
void KexiDBCheckBox::slotStateChanged(int )
@@ -101,7 +101,7 @@ bool KexiDBCheckBox::isReadOnly() const
return !isEnabled();
}
-QWidget*
+TQWidget*
KexiDBCheckBox::widget()
{
return this;
@@ -146,29 +146,29 @@ void KexiDBCheckBox::updateTristate()
{
if (m_tristate == TristateDefault) {
//! @todo the data source may be defined as NOT NULL... thus disallowing NULL state
- QCheckBox::setTristate( !dataSource().isEmpty() );
+ TQCheckBox::setTristate( !dataSource().isEmpty() );
}
else {
- QCheckBox::setTristate( m_tristate == TristateOn );
+ TQCheckBox::setTristate( m_tristate == TristateOn );
}
}
-void KexiDBCheckBox::setDataSource(const QString &ds)
+void KexiDBCheckBox::setDataSource(const TQString &ds)
{
KexiFormDataItemInterface::setDataSource(ds);
updateTristate();
}
-void KexiDBCheckBox::setDisplayDefaultValue(QWidget *widget, bool displayDefaultValue)
+void KexiDBCheckBox::setDisplayDefaultValue(TQWidget *widget, bool displayDefaultValue)
{
KexiFormDataItemInterface::setDisplayDefaultValue(widget, displayDefaultValue);
// initialize display parameters for default / entered value
KexiDisplayUtils::DisplayParameters * const params
= displayDefaultValue ? m_displayParametersForDefaultValue : m_displayParametersForEnteredValue;
// setFont(params->font);
- QPalette pal(palette());
-// pal.setColor(QPalette::Active, QColorGroup::Text, params->textColor);
- pal.setColor(QPalette::Active, QColorGroup::Foreground, params->textColor);
+ TQPalette pal(palette());
+// pal.setColor(TQPalette::Active, TQColorGroup::Text, params->textColor);
+ pal.setColor(TQPalette::Active, TQColorGroup::Foreground, params->textColor);
setPalette(pal);
}
diff --git a/kexi/plugins/forms/widgets/kexidbcheckbox.h b/kexi/plugins/forms/widgets/kexidbcheckbox.h
index d4a68bf3..8a65f33a 100644
--- a/kexi/plugins/forms/widgets/kexidbcheckbox.h
+++ b/kexi/plugins/forms/widgets/kexidbcheckbox.h
@@ -22,25 +22,26 @@
#define KexiDBCheckBox_H
#include "kexiformdataiteminterface.h"
-#include <qcheckbox.h>
+#include <tqcheckbox.h>
//! @short A db-aware check box
-class KEXIFORMUTILS_EXPORT KexiDBCheckBox : public QCheckBox, public KexiFormDataItemInterface
+class KEXIFORMUTILS_EXPORT KexiDBCheckBox : public TQCheckBox, public KexiFormDataItemInterface
{
Q_OBJECT
- Q_PROPERTY(QString dataSource READ dataSource WRITE setDataSource DESIGNABLE true)
- Q_PROPERTY(QCString dataSourceMimeType READ dataSourceMimeType WRITE setDataSourceMimeType DESIGNABLE true)
- Q_OVERRIDE( Tristate tristate READ isTristate WRITE setTristate )
+ TQ_OBJECT
+ TQ_PROPERTY(TQString dataSource READ dataSource WRITE setDataSource DESIGNABLE true)
+ TQ_PROPERTY(TQCString dataSourceMimeType READ dataSourceMimeType WRITE setDataSourceMimeType DESIGNABLE true)
+ TQ_OVERRIDE( Tristate tristate READ isTristate WRITE setTristate )
Q_ENUMS( Tristate )
public:
- KexiDBCheckBox(const QString &text, QWidget *parent, const char *name=0);
+ KexiDBCheckBox(const TQString &text, TQWidget *tqparent, const char *name=0);
virtual ~KexiDBCheckBox();
- inline QString dataSource() const { return KexiFormDataItemInterface::dataSource(); }
- inline QCString dataSourceMimeType() const { return KexiFormDataItemInterface::dataSourceMimeType(); }
- virtual QVariant value();
- virtual void setInvalidState( const QString& displayText );
+ inline TQString dataSource() const { return KexiFormDataItemInterface::dataSource(); }
+ inline TQCString dataSourceMimeType() const { return KexiFormDataItemInterface::dataSourceMimeType(); }
+ virtual TQVariant value();
+ virtual void setInvalidState( const TQString& displayText );
//! \return true if editor's value is null (not empty)
//! Used for checking if a given constraint within table of form is met.
@@ -56,7 +57,7 @@ class KEXIFORMUTILS_EXPORT KexiDBCheckBox : public QCheckBox, public KexiFormDat
virtual bool isReadOnly() const;
/*! \return the view widget of this item, e.g. line edit widget. */
- virtual QWidget* widget();
+ virtual TQWidget* widget();
virtual bool cursorAtStart();
virtual bool cursorAtEnd();
@@ -70,24 +71,24 @@ class KEXIFORMUTILS_EXPORT KexiDBCheckBox : public QCheckBox, public KexiFormDat
Tristate isTristate() const;
/*! Reimplemented after KexiFormDataItemInterface. */
- virtual void setDisplayDefaultValue(QWidget* widget, bool displayDefaultValue);
+ virtual void setDisplayDefaultValue(TQWidget* widget, bool displayDefaultValue);
public slots:
- void setDataSource(const QString &ds);
- inline void setDataSourceMimeType(const QCString &ds) { KexiFormDataItemInterface::setDataSourceMimeType(ds); }
+ void setDataSource(const TQString &ds);
+ inline void setDataSourceMimeType(const TQCString &ds) { KexiFormDataItemInterface::setDataSourceMimeType(ds); }
void slotStateChanged(int state);
//! This implementation just disables read only widget
virtual void setReadOnly( bool readOnly );
protected:
- virtual void setValueInternal(const QVariant& add, bool removeOld);
+ virtual void setValueInternal(const TQVariant& add, bool removeOld);
//! \return true in isTristate() == TristateDefault and the widget has bound data source
//! or if isTristate() == TristateOn, else false is returned.
bool isTristateInternal() const;
- //! Updates tristate in QCheckBox itself according to m_tristate.
+ //! Updates tristate in TQCheckBox itself according to m_tristate.
void updateTristate();
private:
diff --git a/kexi/plugins/forms/widgets/kexidbcombobox.cpp b/kexi/plugins/forms/widgets/kexidbcombobox.cpp
index 19366a15..a908c2fd 100644
--- a/kexi/plugins/forms/widgets/kexidbcombobox.cpp
+++ b/kexi/plugins/forms/widgets/kexidbcombobox.cpp
@@ -25,12 +25,12 @@
#include <kdebug.h>
#include <kapplication.h>
-#include <qmetaobject.h>
-#include <qpainter.h>
-#include <qstyle.h>
-#include <qdrawutil.h>
-#include <qptrdict.h>
-#include <qcursor.h>
+#include <tqmetaobject.h>
+#include <tqpainter.h>
+#include <tqstyle.h>
+#include <tqdrawutil.h>
+#include <tqptrdict.h>
+#include <tqcursor.h>
#include <kexidb/queryschema.h>
#include <widget/tableview/kexicomboboxpopup.h>
@@ -58,11 +58,11 @@ class KexiDBComboBox::Private
}
KexiComboBoxPopup *popup;
- KComboBox *paintedCombo; //!< fake combo used only to pass it as 'this' for QStyle (because styles use <static_cast>)
- QSize sizeHint; //!< A cache for KexiDBComboBox::sizeHint(),
+ KComboBox *paintedCombo; //!< fake combo used only to pass it as 'this' for TQStyle (because styles use <static_cast>)
+ TQSize tqsizeHint; //!< A cache for KexiDBComboBox::tqsizeHint(),
//!< rebuilt by KexiDBComboBox::fontChange() and KexiDBComboBox::styleChange()
KexiDB::QueryColumnInfo* visibleColumnInfo;
- QPtrDict<char> *subWidgetsWithDisabledEvents; //! used to collect subwidget and its children (if isEditable is false)
+ TQPtrDict<char> *subWidgetsWithDisabledEvents; //! used to collect subwidget and its tqchildren (if isEditable is false)
bool isEditable : 1; //!< true is the combo box is editable
bool buttonPressed : 1;
bool mouseOver : 1;
@@ -72,13 +72,13 @@ class KexiDBComboBox::Private
//-------------------------------------
-KexiDBComboBox::KexiDBComboBox(QWidget *parent, const char *name, bool designMode)
- : KexiDBAutoField(parent, name, designMode, NoLabel)
+KexiDBComboBox::KexiDBComboBox(TQWidget *tqparent, const char *name, bool designMode)
+ : KexiDBAutoField(tqparent, name, designMode, NoLabel)
, KexiComboBoxBase()
, d(new Private())
{
setMouseTracking(true);
- setFocusPolicy(WheelFocus);
+ setFocusPolicy(TQ_WheelFocus);
installEventFilter(this);
d->designMode = designMode;
d->paintedCombo = new KComboBox(this);
@@ -121,58 +121,58 @@ bool KexiDBComboBox::isEditable() const
return d->isEditable;
}
-void KexiDBComboBox::paintEvent( QPaintEvent * )
+void KexiDBComboBox::paintEvent( TQPaintEvent * )
{
- QPainter p( this );
- QColorGroup cg( palette().active() );
+ TQPainter p( this );
+ TQColorGroup cg( tqpalette().active() );
// if ( hasFocus() )
-// cg.setColor(QColorGroup::Base, cg.highlight());
+// cg.setColor(TQColorGroup::Base, cg.highlight());
// else
- cg.setColor(QColorGroup::Base, paletteBackgroundColor()); //update base color using (reimplemented) bg color
+ cg.setColor(TQColorGroup::Base, paletteBackgroundColor()); //update base color using (reimplemented) bg color
p.setPen(cg.text());
- QStyle::SFlags flags = QStyle::Style_Default;
+ TQStyle::SFlags flags = TQStyle::Style_Default;
if (isEnabled())
- flags |= QStyle::Style_Enabled;
+ flags |= TQStyle::Style_Enabled;
if (hasFocus())
- flags |= QStyle::Style_HasFocus;
+ flags |= TQStyle::Style_HasFocus;
if (d->mouseOver)
- flags |= QStyle::Style_MouseOver;
+ flags |= TQStyle::Style_MouseOver;
if ( width() < 5 || height() < 5 ) {
- qDrawShadePanel( &p, rect(), cg, FALSE, 2, &cg.brush( QColorGroup::Button ) );
+ qDrawShadePanel( &p, rect(), cg, FALSE, 2, &cg.brush( TQColorGroup::Button ) );
return;
}
-//! @todo support reverse layout
-//bool reverse = QApplication::reverseLayout();
- style().drawComplexControl( QStyle::CC_ComboBox, &p, d->paintedCombo /*this*/, rect(), cg,
- flags, (uint)QStyle::SC_All,
- (d->buttonPressed ? QStyle::SC_ComboBoxArrow : QStyle::SC_None )
+//! @todo support reverse tqlayout
+//bool reverse = TQApplication::reverseLayout();
+ tqstyle().tqdrawComplexControl( TQStyle::CC_ComboBox, &p, d->paintedCombo /*this*/, rect(), cg,
+ flags, (uint)TQStyle::SC_All,
+ (d->buttonPressed ? TQStyle::SC_ComboBoxArrow : TQStyle::SC_None )
);
if (d->isEditable) {
//if editable, editor paints itself, nothing to do
}
else { //not editable: we need to paint the current item
- QRect editorGeometry( this->editorGeometry() );
+ TQRect editorGeometry( this->editorGeometry() );
if ( hasFocus() ) {
- if (0==qstrcmp(style().name(), "windows")) //a hack
- p.fillRect( editorGeometry, cg.brush( QColorGroup::Highlight ) );
- QRect r( QStyle::visualRect( style().subRect( QStyle::SR_ComboBoxFocusRect, d->paintedCombo ), this ) );
- r = QRect(r.left()-1, r.top()-1, r.width()+2, r.height()+2); //enlare by 1 pixel each side to avoid covering by the subwidget
- style().drawPrimitive( QStyle::PE_FocusRect, &p,
- r, cg, flags | QStyle::Style_FocusAtBorder, QStyleOption(cg.highlight()));
+ if (0==qstrcmp(tqstyle().name(), "windows")) //a hack
+ p.fillRect( editorGeometry, cg.brush( TQColorGroup::Highlight ) );
+ TQRect r( TQStyle::tqvisualRect( tqstyle().subRect( TQStyle::SR_ComboBoxFocusRect, d->paintedCombo ), this ) );
+ r = TQRect(r.left()-1, r.top()-1, r.width()+2, r.height()+2); //enlare by 1 pixel each side to avoid covering by the subwidget
+ tqstyle().tqdrawPrimitive( TQStyle::PE_FocusRect, &p,
+ r, cg, flags | TQStyle::Style_FocusAtBorder, TQStyleOption(cg.highlight()));
}
//todo
}
}
-QRect KexiDBComboBox::editorGeometry() const
+TQRect KexiDBComboBox::editorGeometry() const
{
- QRect r( QStyle::visualRect(
- style().querySubControlMetrics(QStyle::CC_ComboBox, d->paintedCombo,
- QStyle::SC_ComboBoxEditField), d->paintedCombo ) );
+ TQRect r( TQStyle::tqvisualRect(
+ tqstyle().querySubControlMetrics(TQStyle::CC_ComboBox, d->paintedCombo,
+ TQStyle::SC_ComboBoxEditField), d->paintedCombo ) );
//if ((height()-r.bottom())<6)
// r.setBottom(height()-6);
@@ -185,20 +185,20 @@ void KexiDBComboBox::createEditor()
if (m_subwidget) {
m_subwidget->setGeometry( editorGeometry() );
if (!d->isEditable) {
- m_subwidget->setCursor(QCursor(Qt::ArrowCursor)); // widgets like listedit have IbeamCursor, we don't want that
-//! @todo Qt4: set transparent background, for now we're setting button color
- QPalette subwidgetPalette( m_subwidget->palette() );
- subwidgetPalette.setColor(QPalette::Active, QColorGroup::Base,
- subwidgetPalette.color(QPalette::Active, QColorGroup::Button));
+ m_subwidget->setCursor(TQCursor(TQt::ArrowCursor)); // widgets like listedit have IbeamCursor, we don't want that
+//! @todo TQt4: set transparent background, for now we're setting button color
+ TQPalette subwidgetPalette( m_subwidget->palette() );
+ subwidgetPalette.setColor(TQPalette::Active, TQColorGroup::Base,
+ subwidgetPalette.color(TQPalette::Active, TQColorGroup::Button));
m_subwidget->setPalette( subwidgetPalette );
if (d->subWidgetsWithDisabledEvents)
d->subWidgetsWithDisabledEvents->clear();
else
- d->subWidgetsWithDisabledEvents = new QPtrDict<char>();
+ d->subWidgetsWithDisabledEvents = new TQPtrDict<char>();
d->subWidgetsWithDisabledEvents->insert(m_subwidget, (char*)1);
m_subwidget->installEventFilter(this);
- QObjectList *l = m_subwidget->queryList( "QWidget" );
- for ( QObjectListIt it( *l ); it.current(); ++it ) {
+ TQObjectList *l = m_subwidget->queryList( TQWIDGET_OBJECT_NAME_STRING );
+ for ( TQObjectListIt it( *l ); it.current(); ++it ) {
d->subWidgetsWithDisabledEvents->insert(it.current(), (char*)1);
it.current()->installEventFilter(this);
}
@@ -211,34 +211,34 @@ void KexiDBComboBox::createEditor()
void KexiDBComboBox::setLabelPosition(LabelPosition position)
{
if(m_subwidget) {
- if (-1 != m_subwidget->metaObject()->findProperty("frameShape", true))
- m_subwidget->setProperty("frameShape", QVariant((int)QFrame::NoFrame));
+ if (-1 != m_subwidget->tqmetaObject()->tqfindProperty("frameShape", true))
+ m_subwidget->setProperty("frameShape", TQVariant((int)TQFrame::NoFrame));
m_subwidget->setGeometry( editorGeometry() );
}
-// KexiSubwidgetInterface *subwidgetInterface = dynamic_cast<KexiSubwidgetInterface*>((QWidget*)m_subwidget);
+// KexiSubwidgetInterface *subwidgetInterface = dynamic_cast<KexiSubwidgetInterface*>((TQWidget*)m_subwidget);
// update size policy
// if (subwidgetInterface && subwidgetInterface->subwidgetStretchRequired(this)) {
- QSizePolicy sizePolicy( this->sizePolicy() );
+ TQSizePolicy sizePolicy( this->tqsizePolicy() );
if(position == Left)
- sizePolicy.setHorData( QSizePolicy::Minimum );
+ sizePolicy.setHorData( TQSizePolicy::Minimum );
else
- sizePolicy.setVerData( QSizePolicy::Minimum );
- //m_subwidget->setSizePolicy(sizePolicy);
- setSizePolicy(sizePolicy);
+ sizePolicy.setVerData( TQSizePolicy::Minimum );
+ //m_subwidget->tqsetSizePolicy(sizePolicy);
+ tqsetSizePolicy(sizePolicy);
//}
// }
}
-QRect KexiDBComboBox::buttonGeometry() const
+TQRect KexiDBComboBox::buttonGeometry() const
{
- QRect arrowRect(
- style().querySubControlMetrics( QStyle::CC_ComboBox, d->paintedCombo, QStyle::SC_ComboBoxArrow) );
- arrowRect = QStyle::visualRect(arrowRect, d->paintedCombo);
- arrowRect.setHeight( QMAX( height() - (2 * arrowRect.y()), arrowRect.height() ) ); // a fix for Motif style
+ TQRect arrowRect(
+ tqstyle().querySubControlMetrics( TQStyle::CC_ComboBox, d->paintedCombo, TQStyle::SC_ComboBoxArrow) );
+ arrowRect = TQStyle::tqvisualRect(arrowRect, d->paintedCombo);
+ arrowRect.setHeight( TQMAX( height() - (2 * arrowRect.y()), arrowRect.height() ) ); // a fix for Motif style
return arrowRect;
}
-bool KexiDBComboBox::handleMousePressEvent(QMouseEvent *e)
+bool KexiDBComboBox::handleMousePressEvent(TQMouseEvent *e)
{
if ( e->button() != Qt::LeftButton || d->designMode )
return true;
@@ -247,19 +247,19 @@ bool KexiDBComboBox::handleMousePressEvent(QMouseEvent *e)
return;
}*/
- if ( /*count() &&*/ ( !isEditable() || buttonGeometry().contains( e->pos() ) ) ) {
+ if ( /*count() &&*/ ( !isEditable() || buttonGeometry().tqcontains( e->pos() ) ) ) {
d->buttonPressed = false;
/* if ( d->usingListBox() ) {
listBox()->blockSignals( TRUE );
- qApp->sendEvent( listBox(), e ); // trigger the listbox's autoscroll
+ tqApp->sendEvent( listBox(), e ); // trigger the listbox's autoscroll
listBox()->setCurrentItem(d->current);
listBox()->blockSignals( FALSE );
popup();
- if ( arrowRect.contains( e->pos() ) ) {
+ if ( arrowRect.tqcontains( e->pos() ) ) {
d->arrowPressed = TRUE;
d->arrowDown = TRUE;
- repaint( FALSE );
+ tqrepaint( FALSE );
}
} else {*/
showPopup();
@@ -268,12 +268,12 @@ bool KexiDBComboBox::handleMousePressEvent(QMouseEvent *e)
return false;
}
-bool KexiDBComboBox::handleKeyPressEvent(QKeyEvent *ke)
+bool KexiDBComboBox::handleKeyPressEvent(TQKeyEvent *ke)
{
const int k = ke->key();
- const bool dropDown = (ke->state() == Qt::NoButton && ((k==Qt::Key_F2 && !d->isEditable) || k==Qt::Key_F4))
- || (ke->state() == Qt::AltButton && k==Qt::Key_Down);
- const bool escPressed = ke->state() == Qt::NoButton && k==Qt::Key_Escape;
+ const bool dropDown = (ke->state() == Qt::NoButton && ((k==TQt::Key_F2 && !d->isEditable) || k==TQt::Key_F4))
+ || (ke->state() == TQt::AltButton && k==TQt::Key_Down);
+ const bool escPressed = ke->state() == Qt::NoButton && k==TQt::Key_Escape;
const bool popupVisible = popup() && popup()->isVisible();
if ((dropDown || escPressed) && popupVisible) {
popup()->hide();
@@ -285,7 +285,7 @@ bool KexiDBComboBox::handleKeyPressEvent(QKeyEvent *ke)
return true;
}
else if (popupVisible) {
- const bool enterPressed = k==Qt::Key_Enter || k==Qt::Key_Return;
+ const bool enterPressed = k==TQt::Key_Enter || k==TQt::Key_Return;
if (enterPressed/* && m_internalEditorValueChanged*/) {
acceptPopupSelection();
return true;
@@ -296,91 +296,91 @@ bool KexiDBComboBox::handleKeyPressEvent(QKeyEvent *ke)
return false;
}
-bool KexiDBComboBox::keyPressed(QKeyEvent *ke)
+bool KexiDBComboBox::keyPressed(TQKeyEvent *ke)
{
if (KexiDBAutoField::keyPressed(ke))
return true;
const int k = ke->key();
const bool popupVisible = popup() && popup()->isVisible();
- const bool escPressed = ke->state() == Qt::NoButton && k==Qt::Key_Escape;
+ const bool escPressed = ke->state() == Qt::NoButton && k==TQt::Key_Escape;
if (escPressed && popupVisible) {
popup()->hide();
return true;
}
- if (ke->state() == Qt::NoButton && (k==Qt::Key_PageDown || k==Qt::Key_PageUp) && popupVisible)
+ if (ke->state() == Qt::NoButton && (k==TQt::Key_PageDown || k==TQt::Key_PageUp) && popupVisible)
return true;
return false;
}
-void KexiDBComboBox::mousePressEvent( QMouseEvent *e )
+void KexiDBComboBox::mousePressEvent( TQMouseEvent *e )
{
if (handleMousePressEvent(e))
return;
-// QTimer::singleShot( 200, this, SLOT(internalClickTimeout()));
+// TQTimer::singleShot( 200, this, TQT_SLOT(internalClickTimeout()));
// d->shortClick = TRUE;
// }
KexiDBAutoField::mousePressEvent( e );
}
-void KexiDBComboBox::mouseDoubleClickEvent( QMouseEvent *e )
+void KexiDBComboBox::mouseDoubleClickEvent( TQMouseEvent *e )
{
mousePressEvent( e );
}
-bool KexiDBComboBox::eventFilter( QObject *o, QEvent *e )
+bool KexiDBComboBox::eventFilter( TQObject *o, TQEvent *e )
{
- if (o==this) {
- if (e->type()==QEvent::Resize) {
+ if (TQT_BASE_OBJECT(o)==TQT_BASE_OBJECT(this)) {
+ if (e->type()==TQEvent::Resize) {
d->paintedCombo->resize(size());
if (m_subwidget)
m_subwidget->setGeometry( editorGeometry() );
}
- else if (e->type()==QEvent::Enter) {
+ else if (e->type()==TQEvent::Enter) {
if (!d->isEditable
- || /*over button if editable combo*/buttonGeometry().contains( static_cast<QMouseEvent*>(e)->pos() ))
+ || /*over button if editable combo*/buttonGeometry().tqcontains( TQT_TQMOUSEEVENT(e)->pos() ))
{
d->mouseOver = true;
update();
}
}
- else if (e->type()==QEvent::MouseMove) {
+ else if (e->type()==TQEvent::MouseMove) {
if (d->isEditable) {
- const bool overButton = buttonGeometry().contains( static_cast<QMouseEvent*>(e)->pos() );
+ const bool overButton = buttonGeometry().tqcontains( TQT_TQMOUSEEVENT(e)->pos() );
if (overButton != d->mouseOver) {
d->mouseOver = overButton;
update();
}
}
}
- else if (e->type()==QEvent::Leave) {
+ else if (e->type()==TQEvent::Leave) {
d->mouseOver = false;
update();
}
- else if (e->type()==QEvent::KeyPress) {
+ else if (e->type()==TQEvent::KeyPress) {
// handle F2/F4
- if (handleKeyPressEvent(static_cast<QKeyEvent*>(e)))
+ if (handleKeyPressEvent(TQT_TQKEYEVENT(e)))
return true;
}
- else if (e->type()==QEvent::FocusOut) {
+ else if (e->type()==TQEvent::FocusOut) {
if (popup() && popup()->isVisible()) {
popup()->hide();
undoChanges();
}
}
}
- else if (!d->isEditable && d->subWidgetsWithDisabledEvents && d->subWidgetsWithDisabledEvents->find(o)) {
- if (e->type()==QEvent::MouseButtonPress) {
+ else if (!d->isEditable && d->subWidgetsWithDisabledEvents && d->subWidgetsWithDisabledEvents->tqfind(o)) {
+ if (e->type()==TQEvent::MouseButtonPress) {
// clicking the subwidget should mean the same as clicking the combo box (i.e. show the popup)
- if (handleMousePressEvent(static_cast<QMouseEvent*>(e)))
+ if (handleMousePressEvent(TQT_TQMOUSEEVENT(e)))
return true;
}
- else if (e->type()==QEvent::KeyPress) {
- if (handleKeyPressEvent(static_cast<QKeyEvent*>(e)))
+ else if (e->type()==TQEvent::KeyPress) {
+ if (handleKeyPressEvent(TQT_TQKEYEVENT(e)))
return true;
}
- return e->type()!=QEvent::Paint;
+ return e->type()!=TQEvent::Paint;
}
return KexiDBAutoField::eventFilter( o, e );
}
@@ -391,15 +391,15 @@ bool KexiDBComboBox::subwidgetStretchRequired(KexiDBAutoField* autoField) const
return true;
}
-void KexiDBComboBox::setPaletteBackgroundColor( const QColor & color )
+void KexiDBComboBox::setPaletteBackgroundColor( const TQColor & color )
{
KexiDBAutoField::setPaletteBackgroundColor(color);
- QPalette pal(palette());
- QColorGroup cg(pal.active());
- pal.setColor(QColorGroup::Base, red);
- pal.setColor(QColorGroup::Background, red);
+ TQPalette pal(palette());
+ TQColorGroup cg(pal.active());
+ pal.setColor(TQColorGroup::Base, red);
+ pal.setColor(TQColorGroup::Background, red);
pal.setActive(cg);
- QWidget::setPalette(pal);
+ TQWidget::setPalette(pal);
update();
}
@@ -439,7 +439,7 @@ void KexiDBComboBox::selectAllInInternalEditor()
selectAll();
}
-void KexiDBComboBox::setValueInternal(const QVariant& add, bool removeOld)
+void KexiDBComboBox::setValueInternal(const TQVariant& add, bool removeOld)
{
//// use KexiDBAutoField instead of KexiComboBoxBase::setValueInternal
//// expects existing popup(), but we want to have delayed creation
@@ -448,38 +448,38 @@ void KexiDBComboBox::setValueInternal(const QVariant& add, bool removeOld)
KexiComboBoxBase::setValueInternal(add, removeOld);
}
-void KexiDBComboBox::setVisibleValueInternal(const QVariant& value)
+void KexiDBComboBox::setVisibleValueInternal(const TQVariant& value)
{
- KexiFormDataItemInterface *iface = dynamic_cast<KexiFormDataItemInterface*>((QWidget*)m_subwidget);
+ KexiFormDataItemInterface *iface = dynamic_cast<KexiFormDataItemInterface*>((TQWidget*)m_subwidget);
if(iface)
- iface->setValue(value, QVariant(), false /*!removeOld*/);
+ iface->setValue(value, TQVariant(), false /*!removeOld*/);
}
-QVariant KexiDBComboBox::visibleValue()
+TQVariant KexiDBComboBox::visibleValue()
{
return KexiComboBoxBase::visibleValue();
}
-void KexiDBComboBox::setValueInInternalEditor(const QVariant& value)
+void KexiDBComboBox::setValueInInternalEditor(const TQVariant& value)
{
if (!m_setValueInInternalEditor_enabled)
return;
- KexiFormDataItemInterface *iface = dynamic_cast<KexiFormDataItemInterface*>((QWidget*)m_subwidget);
+ KexiFormDataItemInterface *iface = dynamic_cast<KexiFormDataItemInterface*>((TQWidget*)m_subwidget);
if(iface)
- iface->setValue(value, QVariant(), false/*!removeOld*/);
+ iface->setValue(value, TQVariant(), false/*!removeOld*/);
}
-QVariant KexiDBComboBox::valueFromInternalEditor()
+TQVariant KexiDBComboBox::valueFromInternalEditor()
{
return KexiDBAutoField::value();
}
-QPoint KexiDBComboBox::mapFromParentToGlobal(const QPoint& pos) const
+TQPoint KexiDBComboBox::mapFromParentToGlobal(const TQPoint& pos) const
{
// const KexiFormScrollView* view = KexiUtils::findParentConst<const KexiFormScrollView>(this, "KexiFormScrollView");
- if (!parentWidget())
- return QPoint(-1,-1);
- return parentWidget()->mapToGlobal(pos);
+ if (!tqparentWidget())
+ return TQPoint(-1,-1);
+ return tqparentWidget()->mapToGlobal(pos);
// return view->viewport()->mapToGlobal(pos);
}
@@ -488,31 +488,31 @@ int KexiDBComboBox::popupWidthHint() const
return width(); //popup() ? popup()->width() : 0;
}
-void KexiDBComboBox::fontChange( const QFont & oldFont )
+void KexiDBComboBox::fontChange( const TQFont & oldFont )
{
- d->sizeHint = QSize(); //force rebuild the cache
+ d->tqsizeHint = TQSize(); //force rebuild the cache
KexiDBAutoField::fontChange(oldFont);
}
-void KexiDBComboBox::styleChange( QStyle& oldStyle )
+void KexiDBComboBox::styleChange( TQStyle& oldStyle )
{
KexiDBAutoField::styleChange( oldStyle );
- d->sizeHint = QSize(); //force rebuild the cache
+ d->tqsizeHint = TQSize(); //force rebuild the cache
if (m_subwidget)
m_subwidget->setGeometry( editorGeometry() );
}
-QSize KexiDBComboBox::sizeHint() const
+TQSize KexiDBComboBox::tqsizeHint() const
{
- if ( isVisible() && d->sizeHint.isValid() )
- return d->sizeHint;
+ if ( isVisible() && d->tqsizeHint.isValid() )
+ return d->tqsizeHint;
- const int maxWidth = 7 * fontMetrics().width(QChar('x')) + 18;
- const int maxHeight = QMAX( fontMetrics().lineSpacing(), 14 ) + 2;
- d->sizeHint = (style().sizeFromContents(QStyle::CT_ComboBox, d->paintedCombo,
- QSize(maxWidth, maxHeight)).expandedTo(QApplication::globalStrut()));
+ const int maxWidth = 7 * fontMetrics().width(TQChar('x')) + 18;
+ const int maxHeight = TQMAX( fontMetrics().lineSpacing(), 14 ) + 2;
+ d->tqsizeHint = (tqstyle().tqsizeFromContents(TQStyle::CT_ComboBox, d->paintedCombo,
+ TQSize(maxWidth, maxHeight)).expandedTo(TQApplication::globalStrut()));
- return d->sizeHint;
+ return d->tqsizeHint;
}
void KexiDBComboBox::editRequested()
@@ -534,7 +534,7 @@ void KexiDBComboBox::slotRowAccepted(KexiTableItem *item, int row)
void KexiDBComboBox::beforeSignalValueChanged()
{
if (d->dataEnteredByHand) {
- KexiFormDataItemInterface *iface = dynamic_cast<KexiFormDataItemInterface*>((QWidget*)m_subwidget);
+ KexiFormDataItemInterface *iface = dynamic_cast<KexiFormDataItemInterface*>((TQWidget*)m_subwidget);
if (iface) {
slotInternalEditorValueChanged( iface->value() );
}
diff --git a/kexi/plugins/forms/widgets/kexidbcombobox.h b/kexi/plugins/forms/widgets/kexidbcombobox.h
index 5208d37d..2639b1f9 100644
--- a/kexi/plugins/forms/widgets/kexidbcombobox.h
+++ b/kexi/plugins/forms/widgets/kexidbcombobox.h
@@ -35,15 +35,16 @@ class KEXIFORMUTILS_EXPORT KexiDBComboBox :
public KexiDBAutoField, public KexiComboBoxBase
{
Q_OBJECT
- Q_PROPERTY( bool editable READ isEditable WRITE setEditable )
+ TQ_OBJECT
+ TQ_PROPERTY( bool editable READ isEditable WRITE setEditable )
//properties from KexiDBAutoField that should not be visible:
- Q_OVERRIDE(QColor paletteBackgroundColor READ paletteBackgroundColor WRITE setPaletteBackgroundColor DESIGNABLE true RESET unsetPalette)
- Q_OVERRIDE(QColor foregroundLabelColor DESIGNABLE false)
- Q_OVERRIDE(QColor backgroundLabelColor DESIGNABLE false)
- Q_OVERRIDE(bool autoCaption DESIGNABLE false)
+ TQ_OVERRIDE(TQColor paletteBackgroundColor READ paletteBackgroundColor WRITE setPaletteBackgroundColor DESIGNABLE true RESET unsetPalette)
+ TQ_OVERRIDE(TQColor foregroundLabelColor DESIGNABLE false)
+ TQ_OVERRIDE(TQColor backgroundLabelColor DESIGNABLE false)
+ TQ_OVERRIDE(bool autoCaption DESIGNABLE false)
public:
- KexiDBComboBox(QWidget *parent, const char *name=0, bool designMode = true);
+ KexiDBComboBox(TQWidget *tqparent, const char *name=0, bool designMode = true);
virtual ~KexiDBComboBox();
//! Implemented for KexiComboBoxBase: form has no 'related data' model (only the full database model)
@@ -53,21 +54,21 @@ class KEXIFORMUTILS_EXPORT KexiDBComboBox :
virtual KexiDB::Field *field() const { return KexiDBAutoField::field(); }
//! Implemented for KexiComboBoxBase
- virtual QVariant origValue() const { return m_origValue; }
+ virtual TQVariant origValue() const { return m_origValue; }
void setEditable(bool set);
bool isEditable() const;
virtual void setLabelPosition(LabelPosition position);
- virtual QVariant value() { return KexiComboBoxBase::value(); }
+ virtual TQVariant value() { return KexiComboBoxBase::value(); }
- virtual QVariant visibleValue();
+ virtual TQVariant visibleValue();
//! Reimpemented because to avoid taking value from the internal editor (index is taken from the popup instead)
virtual bool valueChanged();
- virtual QSize sizeHint() const;
+ virtual TQSize tqsizeHint() const;
//! Reimplemented after KexiDBAutoField: jsut sets \a cinfo without initializing a subwidget.
//! Initialization is performed by \ref setVisibleColumnInfo().
@@ -81,10 +82,10 @@ class KEXIFORMUTILS_EXPORT KexiDBComboBox :
Reimplemented. */
virtual KexiDB::QueryColumnInfo* visibleColumnInfo() const;
- const QColor & paletteBackgroundColor() const { return KexiDBAutoField::paletteBackgroundColor(); }
+ const TQColor & paletteBackgroundColor() const { return KexiDBAutoField::paletteBackgroundColor(); }
//! Reimplemented to also set 'this' widget's background color, not only subwidget's.
- virtual void setPaletteBackgroundColor( const QColor & color );
+ virtual void setPaletteBackgroundColor( const TQColor & color );
/*! Undoes changes made to this item - just resets the widget to original value.
Reimplemented after KexiFormDataItemInterface to also revert the visible value
@@ -96,37 +97,37 @@ class KEXIFORMUTILS_EXPORT KexiDBComboBox :
void slotItemSelected(KexiTableItem* item) { KexiComboBoxBase::slotItemSelected(item); }
protected slots:
- void slotInternalEditorValueChanged(const QVariant& v)
+ void slotInternalEditorValueChanged(const TQVariant& v)
{ KexiComboBoxBase::slotInternalEditorValueChanged(v); }
protected:
- QRect buttonGeometry() const;
+ TQRect buttonGeometry() const;
- virtual void paintEvent( QPaintEvent * );
+ virtual void paintEvent( TQPaintEvent * );
- virtual void mousePressEvent( QMouseEvent *e );
+ virtual void mousePressEvent( TQMouseEvent *e );
- void mouseDoubleClickEvent( QMouseEvent *e );
+ void mouseDoubleClickEvent( TQMouseEvent *e );
- virtual bool eventFilter( QObject *o, QEvent *e );
+ virtual bool eventFilter( TQObject *o, TQEvent *e );
- //! \return internal editor's geometry
- QRect editorGeometry() const;
+ //! \return internal editor's tqgeometry
+ TQRect editorGeometry() const;
//! Creates editor. Reimplemented, because if the combo box is not editable,
//! editor should not be created.
virtual void createEditor();
/*! Reimplemented */
- virtual void styleChange( QStyle& oldStyle );
+ virtual void styleChange( TQStyle& oldStyle );
/*! Reimplemented */
- virtual void fontChange( const QFont & oldFont );
+ virtual void fontChange( const TQFont & oldFont );
virtual bool subwidgetStretchRequired(KexiDBAutoField* autoField) const;
//! Implemented for KexiComboBoxBase
- virtual QWidget *internalEditor() const { return /*WidgetWithSubpropertiesInterface*/m_subwidget; }
+ virtual TQWidget *internalEditor() const { return /*WidgetWithSubpropertiesInterface*/m_subwidget; }
//! Implemented for KexiComboBoxBase. Does nothing if the widget is not editable.
virtual void moveCursorToEndInInternalEditor();
@@ -135,10 +136,10 @@ class KEXIFORMUTILS_EXPORT KexiDBComboBox :
virtual void selectAllInInternalEditor();
//! Implemented for KexiComboBoxBase
- virtual void setValueInInternalEditor(const QVariant& value);
+ virtual void setValueInInternalEditor(const TQVariant& value);
//! Implemented for KexiComboBoxBase
- virtual QVariant valueFromInternalEditor();
+ virtual TQVariant valueFromInternalEditor();
//! Implemented for KexiComboBoxBase
virtual void editRequested();
@@ -146,21 +147,21 @@ class KEXIFORMUTILS_EXPORT KexiDBComboBox :
//! Implemented for KexiComboBoxBase
virtual void acceptRequested();
- //! Implement this to return a position \a pos mapped from parent (e.g. viewport)
- //! to global coordinates. QPoint(-1, -1) should be returned if this cannot be computed.
- virtual QPoint mapFromParentToGlobal(const QPoint& pos) const;
+ //! Implement this to return a position \a pos mapped from tqparent (e.g. viewport)
+ //! to global coordinates. TQPoint(-1, -1) should be returned if this cannot be computed.
+ virtual TQPoint mapFromParentToGlobal(const TQPoint& pos) const;
//! Implement this to return a hint for popup width.
virtual int popupWidthHint() const;
- virtual void setValueInternal(const QVariant& add, bool removeOld);
+ virtual void setValueInternal(const TQVariant& add, bool removeOld);
//! Implemented to handle visible value instead of index
- virtual void setVisibleValueInternal(const QVariant& value);
+ virtual void setVisibleValueInternal(const TQVariant& value);
- bool handleMousePressEvent(QMouseEvent *e);
+ bool handleMousePressEvent(TQMouseEvent *e);
- bool handleKeyPressEvent(QKeyEvent *ke);
+ bool handleKeyPressEvent(TQKeyEvent *ke);
//! Implemented for KexiDataItemInterface
virtual void beforeSignalValueChanged();
@@ -172,7 +173,7 @@ class KEXIFORMUTILS_EXPORT KexiDBComboBox :
Used for Key_Escape to if the popup is visible,
so the key press won't be consumed to perform "cancel editing".
Also used for grabbing page down/up keys. */
- virtual bool keyPressed(QKeyEvent *ke);
+ virtual bool keyPressed(TQKeyEvent *ke);
class Private;
Private * const d;
diff --git a/kexi/plugins/forms/widgets/kexidbdateedit.cpp b/kexi/plugins/forms/widgets/kexidbdateedit.cpp
index 32584fce..9638f93a 100644
--- a/kexi/plugins/forms/widgets/kexidbdateedit.cpp
+++ b/kexi/plugins/forms/widgets/kexidbdateedit.cpp
@@ -19,8 +19,8 @@
*/
#include "kexidbdateedit.h"
-#include <qlayout.h>
-#include <qtoolbutton.h>
+#include <tqlayout.h>
+#include <tqtoolbutton.h>
#include <kpopupmenu.h>
#include <kdatepicker.h>
#include <kdatetbl.h>
@@ -28,45 +28,45 @@
#include <kexiutils/utils.h>
#include <kexidb/queryschema.h>
-KexiDBDateEdit::KexiDBDateEdit(const QDate &date, QWidget *parent, const char *name)
- : QWidget(parent, name), KexiFormDataItemInterface()
+KexiDBDateEdit::KexiDBDateEdit(const TQDate &date, TQWidget *tqparent, const char *name)
+ : TQWidget(tqparent, name), KexiFormDataItemInterface()
{
m_invalidState = false;
m_cleared = false;
m_readOnly = false;
- m_edit = new QDateEdit(date, this);
+ m_edit = new TQDateEdit(date, this);
m_edit->setAutoAdvance(true);
- m_edit->setSizePolicy(QSizePolicy::Minimum, QSizePolicy::MinimumExpanding);
- connect( m_edit, SIGNAL(valueChanged(const QDate&)), this, SLOT(slotValueChanged(const QDate&)) );
- connect( m_edit, SIGNAL(valueChanged(const QDate&)), this, SIGNAL(dateChanged(const QDate&)) );
+ m_edit->tqsetSizePolicy(TQSizePolicy::Minimum, TQSizePolicy::MinimumExpanding);
+ connect( m_edit, TQT_SIGNAL(valueChanged(const TQDate&)), this, TQT_SLOT(slotValueChanged(const TQDate&)) );
+ connect( m_edit, TQT_SIGNAL(valueChanged(const TQDate&)), this, TQT_SIGNAL(dateChanged(const TQDate&)) );
- QToolButton* btn = new QToolButton(this);
+ TQToolButton* btn = new TQToolButton(this);
btn->setText("...");
- btn->setFixedWidth( QFontMetrics(btn->font()).width(" ... ") );
+ btn->setFixedWidth( TQFontMetrics(btn->font()).width(" ... ") );
btn->setPopupDelay(1); //1 ms
-#ifdef QDateTimeEditor_HACK
- m_dte_date = KexiUtils::findFirstChild<QDateTimeEditor>(m_edit, "QDateTimeEditor");
+#ifdef TQDateTimeEditor_HACK
+ m_dte_date = KexiUtils::findFirstChild<TQDateTimeEditor>(m_edit, "TQDateTimeEditor");
#else
m_dte_date = 0;
#endif
m_datePickerPopupMenu = new KPopupMenu(0, "date_popup");
- connect(m_datePickerPopupMenu, SIGNAL(aboutToShow()), this, SLOT(slotShowDatePicker()));
- m_datePicker = new KDatePicker(m_datePickerPopupMenu, QDate::currentDate(), 0);
+ connect(m_datePickerPopupMenu, TQT_SIGNAL(aboutToShow()), this, TQT_SLOT(slotShowDatePicker()));
+ m_datePicker = new KDatePicker(m_datePickerPopupMenu, TQDate::tqcurrentDate(), 0);
KDateTable *dt = KexiUtils::findFirstChild<KDateTable>(m_datePicker, "KDateTable");
if (dt)
- connect(dt, SIGNAL(tableClicked()), this, SLOT(acceptDate()));
+ connect(dt, TQT_SIGNAL(tableClicked()), this, TQT_SLOT(acceptDate()));
m_datePicker->setCloseButton(true);
m_datePicker->installEventFilter(this);
m_datePickerPopupMenu->insertItem(m_datePicker);
btn->setPopup(m_datePickerPopupMenu);
- QHBoxLayout* layout = new QHBoxLayout(this);
- layout->addWidget(m_edit, 1);
- layout->addWidget(btn, 0);
+ TQHBoxLayout* tqlayout = new TQHBoxLayout(this);
+ tqlayout->addWidget(m_edit, 1);
+ tqlayout->addWidget(btn, 0);
setFocusProxy(m_edit);
}
@@ -75,14 +75,14 @@ KexiDBDateEdit::~KexiDBDateEdit()
{
}
-void KexiDBDateEdit::setInvalidState( const QString& )
+void KexiDBDateEdit::setInvalidState( const TQString& )
{
setEnabled(false);
setReadOnly(true);
m_invalidState = true;
//! @todo move this to KexiDataItemInterface::setInvalidStateInternal() ?
if (focusPolicy() & TabFocus)
- setFocusPolicy(QWidget::ClickFocus);
+ setFocusPolicy(TQ_ClickFocus);
}
void
@@ -91,18 +91,18 @@ KexiDBDateEdit::setEnabled(bool enabled)
// prevent the user from reenabling the widget when it is in invalid state
if(enabled && m_invalidState)
return;
- QWidget::setEnabled(enabled);
+ TQWidget::setEnabled(enabled);
}
-void KexiDBDateEdit::setValueInternal(const QVariant &add, bool removeOld)
+void KexiDBDateEdit::setValueInternal(const TQVariant &add, bool removeOld)
{
int setNumberOnFocus = -1;
- QDate d;
- QString addString(add.toString());
+ TQDate d;
+ TQString addString(add.toString());
if (removeOld) {
if (!addString.isEmpty() && addString[0].latin1()>='0' && addString[0].latin1() <='9') {
setNumberOnFocus = addString[0].latin1()-'0';
- d = QDate(setNumberOnFocus*1000, 1, 1);
+ d = TQDate(setNumberOnFocus*1000, 1, 1);
}
}
else
@@ -111,10 +111,10 @@ void KexiDBDateEdit::setValueInternal(const QVariant &add, bool removeOld)
m_edit->setDate(d);
}
-QVariant
+TQVariant
KexiDBDateEdit::value()
{
- return QVariant(m_edit->date());
+ return TQVariant(m_edit->date());
}
bool KexiDBDateEdit::valueIsNull()
@@ -139,7 +139,7 @@ void KexiDBDateEdit::setReadOnly(bool set)
m_readOnly = set;
}
-QWidget*
+TQWidget*
KexiDBDateEdit::widget()
{
return this;
@@ -147,7 +147,7 @@ KexiDBDateEdit::widget()
bool KexiDBDateEdit::cursorAtStart()
{
-#ifdef QDateTimeEditor_HACK
+#ifdef TQDateTimeEditor_HACK
return m_dte_date && m_edit->hasFocus() && m_dte_date->focusSection()==0;
#else
return false;
@@ -156,7 +156,7 @@ bool KexiDBDateEdit::cursorAtStart()
bool KexiDBDateEdit::cursorAtEnd()
{
-#ifdef QDateTimeEditor_HACK
+#ifdef TQDateTimeEditor_HACK
return m_dte_date && m_edit->hasFocus()
&& m_dte_date->focusSection()==int(m_dte_date->sectionCount()-1);
#else
@@ -166,12 +166,12 @@ bool KexiDBDateEdit::cursorAtEnd()
void KexiDBDateEdit::clear()
{
- m_edit->setDate(QDate());
+ m_edit->setDate(TQDate());
m_cleared = true;
}
void
-KexiDBDateEdit::slotValueChanged(const QDate&)
+KexiDBDateEdit::slotValueChanged(const TQDate&)
{
m_cleared = false;
}
@@ -179,7 +179,7 @@ KexiDBDateEdit::slotValueChanged(const QDate&)
void
KexiDBDateEdit::slotShowDatePicker()
{
- QDate date = m_edit->date();
+ TQDate date = m_edit->date();
m_datePicker->setDate(date);
m_datePicker->setFocus();
@@ -195,24 +195,24 @@ KexiDBDateEdit::acceptDate()
}
bool
-KexiDBDateEdit::eventFilter(QObject *o, QEvent *e)
+KexiDBDateEdit::eventFilter(TQObject *o, TQEvent *e)
{
if (o != m_datePicker)
return false;
switch (e->type()) {
- case QEvent::Hide:
+ case TQEvent::Hide:
m_datePickerPopupMenu->hide();
break;
- case QEvent::KeyPress:
- case QEvent::KeyRelease: {
- QKeyEvent *ke = (QKeyEvent *)e;
- if (ke->key()==Qt::Key_Enter || ke->key()==Qt::Key_Return) {
+ case TQEvent::KeyPress:
+ case TQEvent::KeyRelease: {
+ TQKeyEvent *ke = (TQKeyEvent *)e;
+ if (ke->key()==TQt::Key_Enter || ke->key()==TQt::Key_Return) {
//accepting picker
acceptDate();
return true;
}
- else if (ke->key()==Qt::Key_Escape) {
+ else if (ke->key()==TQt::Key_Escape) {
//canceling picker
m_datePickerPopupMenu->hide();
return true;
diff --git a/kexi/plugins/forms/widgets/kexidbdateedit.h b/kexi/plugins/forms/widgets/kexidbdateedit.h
index 2ad693a8..b611590e 100644
--- a/kexi/plugins/forms/widgets/kexidbdateedit.h
+++ b/kexi/plugins/forms/widgets/kexidbdateedit.h
@@ -22,37 +22,38 @@
#define KexiDBDateEdit_H
#include "kexiformdataiteminterface.h"
-#include <qdatetimeedit.h>
+#include <tqdatetimeedit.h>
class KPopupMenu;
class KDatePicker;
-class QDateTimeEditor;
+class TQDateTimeEditor;
//! @short A db-aware date editor
-class KEXIFORMUTILS_EXPORT KexiDBDateEdit : public QWidget, public KexiFormDataItemInterface
+class KEXIFORMUTILS_EXPORT KexiDBDateEdit : public TQWidget, public KexiFormDataItemInterface
{
Q_OBJECT
- Q_PROPERTY(QString dataSource READ dataSource WRITE setDataSource DESIGNABLE true)
- Q_PROPERTY(QCString dataSourceMimeType READ dataSourceMimeType WRITE setDataSourceMimeType DESIGNABLE true)
- // properties copied from QDateEdit
+ TQ_OBJECT
+ TQ_PROPERTY(TQString dataSource READ dataSource WRITE setDataSource DESIGNABLE true)
+ TQ_PROPERTY(TQCString dataSourceMimeType READ dataSourceMimeType WRITE setDataSourceMimeType DESIGNABLE true)
+ // properties copied from TQDateEdit
Q_ENUMS( Order )
- Q_PROPERTY( Order order READ order WRITE setOrder DESIGNABLE true)
- Q_PROPERTY( QDate date READ date WRITE setDate DESIGNABLE true)
- Q_PROPERTY( bool autoAdvance READ autoAdvance WRITE setAutoAdvance DESIGNABLE true)
- Q_PROPERTY( QDate maxValue READ maxValue WRITE setMaxValue DESIGNABLE true)
- Q_PROPERTY( QDate minValue READ minValue WRITE setMinValue DESIGNABLE true)
- Q_PROPERTY( bool readOnly READ isReadOnly WRITE setReadOnly DESIGNABLE true )
+ TQ_PROPERTY( Order order READ order WRITE setOrder DESIGNABLE true)
+ TQ_PROPERTY( TQDate date READ date WRITE setDate DESIGNABLE true)
+ TQ_PROPERTY( bool autoAdvance READ autoAdvance WRITE setAutoAdvance DESIGNABLE true)
+ TQ_PROPERTY( TQDate maxValue READ maxValue WRITE setMaxValue DESIGNABLE true)
+ TQ_PROPERTY( TQDate minValue READ minValue WRITE setMinValue DESIGNABLE true)
+ TQ_PROPERTY( bool readOnly READ isReadOnly WRITE setReadOnly DESIGNABLE true )
public:
- enum Order { DMY = QDateEdit::DMY, MDY = QDateEdit::MDY, YMD = QDateEdit::YMD, YDM = QDateEdit::YDM };
+ enum Order { DMY = TQDateEdit::DMY, MDY = TQDateEdit::MDY, YMD = TQDateEdit::YMD, YDM = TQDateEdit::YDM };
- KexiDBDateEdit(const QDate &date, QWidget *parent, const char *name=0);
+ KexiDBDateEdit(const TQDate &date, TQWidget *tqparent, const char *name=0);
virtual ~KexiDBDateEdit();
- inline QString dataSource() const { return KexiFormDataItemInterface::dataSource(); }
- inline QCString dataSourceMimeType() const { return KexiFormDataItemInterface::dataSourceMimeType(); }
- virtual QVariant value();
- virtual void setInvalidState( const QString& displayText );
+ inline TQString dataSource() const { return KexiFormDataItemInterface::dataSource(); }
+ inline TQCString dataSourceMimeType() const { return KexiFormDataItemInterface::dataSourceMimeType(); }
+ virtual TQVariant value();
+ virtual void setInvalidState( const TQString& displayText );
//! \return true if editor's value is null (not empty)
//! Used for checking if a given constraint within table of form is met.
@@ -68,7 +69,7 @@ class KEXIFORMUTILS_EXPORT KexiDBDateEdit : public QWidget, public KexiFormDataI
virtual bool isReadOnly() const;
/*! \return the view widget of this item, e.g. line edit widget. */
- virtual QWidget* widget();
+ virtual TQWidget* widget();
virtual bool cursorAtStart();
virtual bool cursorAtEnd();
@@ -77,39 +78,39 @@ class KEXIFORMUTILS_EXPORT KexiDBDateEdit : public QWidget, public KexiFormDataI
virtual void setEnabled(bool enabled);
// property functions
- inline QDate date() const { return m_edit->date(); }
- inline void setOrder(Order order) { m_edit->setOrder( (QDateEdit::Order) order); }
+ inline TQDate date() const { return m_edit->date(); }
+ inline void setOrder(Order order) { m_edit->setOrder( (TQDateEdit::Order) order); }
inline Order order() const { return (Order)m_edit->order(); }
inline void setAutoAdvance( bool advance ) { m_edit->setAutoAdvance(advance); }
inline bool autoAdvance() const { return m_edit->autoAdvance(); }
- inline void setMinValue(const QDate& d) { m_edit->setMinValue(d); }
- inline QDate minValue() const { return m_edit->minValue(); }
- inline void setMaxValue(const QDate& d) { m_edit->setMaxValue(d); }
- inline QDate maxValue() const { return m_edit->maxValue(); }
+ inline void setMinValue(const TQDate& d) { m_edit->setMinValue(d); }
+ inline TQDate minValue() const { return m_edit->minValue(); }
+ inline void setMaxValue(const TQDate& d) { m_edit->setMaxValue(d); }
+ inline TQDate maxValue() const { return m_edit->maxValue(); }
signals:
- void dateChanged(const QDate &date);
+ void dateChanged(const TQDate &date);
public slots:
- inline void setDataSource(const QString &ds) { KexiFormDataItemInterface::setDataSource(ds); }
- inline void setDataSourceMimeType(const QCString &ds) { KexiFormDataItemInterface::setDataSourceMimeType(ds); }
- inline void setDate(const QDate& date) { m_edit->setDate(date); }
+ inline void setDataSource(const TQString &ds) { KexiFormDataItemInterface::setDataSource(ds); }
+ inline void setDataSourceMimeType(const TQCString &ds) { KexiFormDataItemInterface::setDataSourceMimeType(ds); }
+ inline void setDate(const TQDate& date) { m_edit->setDate(date); }
virtual void setReadOnly(bool set);
protected slots:
- void slotValueChanged(const QDate&);
+ void slotValueChanged(const TQDate&);
void slotShowDatePicker();
void acceptDate();
protected:
- virtual void setValueInternal(const QVariant& add, bool removeOld);
- virtual bool eventFilter(QObject *o, QEvent *e);
+ virtual void setValueInternal(const TQVariant& add, bool removeOld);
+ virtual bool eventFilter(TQObject *o, TQEvent *e);
private:
KDatePicker *m_datePicker;
- QDateEdit *m_edit;
+ TQDateEdit *m_edit;
KPopupMenu *m_datePickerPopupMenu;
- QDateTimeEditor *m_dte_date;
+ TQDateTimeEditor *m_dte_date;
bool m_invalidState : 1;
bool m_cleared : 1;
bool m_readOnly : 1;
diff --git a/kexi/plugins/forms/widgets/kexidbdatetimeedit.cpp b/kexi/plugins/forms/widgets/kexidbdatetimeedit.cpp
index faaeca66..e99e4651 100644
--- a/kexi/plugins/forms/widgets/kexidbdatetimeedit.cpp
+++ b/kexi/plugins/forms/widgets/kexidbdatetimeedit.cpp
@@ -20,62 +20,62 @@
#include "kexidbdatetimeedit.h"
-#include <qtoolbutton.h>
-#include <qlayout.h>
+#include <tqtoolbutton.h>
+#include <tqlayout.h>
#include <kpopupmenu.h>
#include <kdatepicker.h>
#include <kdatetbl.h>
#include <kexiutils/utils.h>
-KexiDBDateTimeEdit::KexiDBDateTimeEdit(const QDateTime &datetime, QWidget *parent, const char *name)
- : QWidget(parent, name), KexiFormDataItemInterface()
+KexiDBDateTimeEdit::KexiDBDateTimeEdit(const TQDateTime &datetime, TQWidget *tqparent, const char *name)
+ : TQWidget(tqparent, name), KexiFormDataItemInterface()
{
m_invalidState = false;
m_cleared = false;
m_readOnly = false;
- m_dateEdit = new QDateEdit(datetime.date(), this);
+ m_dateEdit = new TQDateEdit(datetime.date(), this);
m_dateEdit->setAutoAdvance(true);
- m_dateEdit->setSizePolicy(QSizePolicy::Minimum, QSizePolicy::MinimumExpanding);
-// m_dateEdit->setFixedWidth( QFontMetrics(m_dateEdit->font()).width("8888-88-88___") );
- connect(m_dateEdit, SIGNAL(valueChanged(const QDate&)), this, SLOT(slotValueChanged()));
- connect(m_dateEdit, SIGNAL(valueChanged(const QDate&)), this, SIGNAL(dateTimeChanged()));
+ m_dateEdit->tqsetSizePolicy(TQSizePolicy::Minimum, TQSizePolicy::MinimumExpanding);
+// m_dateEdit->setFixedWidth( TQFontMetrics(m_dateEdit->font()).width("8888-88-88___") );
+ connect(m_dateEdit, TQT_SIGNAL(valueChanged(const TQDate&)), this, TQT_SLOT(slotValueChanged()));
+ connect(m_dateEdit, TQT_SIGNAL(valueChanged(const TQDate&)), this, TQT_SIGNAL(dateTimeChanged()));
- QToolButton* btn = new QToolButton(this);
+ TQToolButton* btn = new TQToolButton(this);
btn->setText("...");
- btn->setFixedWidth( QFontMetrics(btn->font()).width(" ... ") );
+ btn->setFixedWidth( TQFontMetrics(btn->font()).width(" ... ") );
btn->setPopupDelay(1); //1 ms
- m_timeEdit = new QTimeEdit(datetime.time(), this);;
+ m_timeEdit = new TQTimeEdit(datetime.time(), this);;
m_timeEdit->setAutoAdvance(true);
- m_timeEdit->setSizePolicy(QSizePolicy::Minimum, QSizePolicy::MinimumExpanding);
- connect(m_timeEdit, SIGNAL(valueChanged(const QTime&)), this, SLOT(slotValueChanged()));
- connect(m_timeEdit, SIGNAL(valueChanged(const QTime&)), this, SIGNAL(dateTimeChanged()));
+ m_timeEdit->tqsetSizePolicy(TQSizePolicy::Minimum, TQSizePolicy::MinimumExpanding);
+ connect(m_timeEdit, TQT_SIGNAL(valueChanged(const TQTime&)), this, TQT_SLOT(slotValueChanged()));
+ connect(m_timeEdit, TQT_SIGNAL(valueChanged(const TQTime&)), this, TQT_SIGNAL(dateTimeChanged()));
-#ifdef QDateTimeEditor_HACK
- m_dte_date = KexiUtils::findFirstChild<QDateTimeEditor>(m_dateEdit, "QDateTimeEditor");
- m_dte_time = KexiUtils::findFirstChild<QDateTimeEditor>(m_timeEdit, "QDateTimeEditor");
+#ifdef TQDateTimeEditor_HACK
+ m_dte_date = KexiUtils::findFirstChild<TQDateTimeEditor>(m_dateEdit, "TQDateTimeEditor");
+ m_dte_time = KexiUtils::findFirstChild<TQDateTimeEditor>(m_timeEdit, "TQDateTimeEditor");
#else
m_dte_date = 0;
#endif
m_datePickerPopupMenu = new KPopupMenu(0, "date_popup");
- connect(m_datePickerPopupMenu, SIGNAL(aboutToShow()), this, SLOT(slotShowDatePicker()));
- m_datePicker = new KDatePicker(m_datePickerPopupMenu, QDate::currentDate(), 0);
+ connect(m_datePickerPopupMenu, TQT_SIGNAL(aboutToShow()), this, TQT_SLOT(slotShowDatePicker()));
+ m_datePicker = new KDatePicker(m_datePickerPopupMenu, TQDate::tqcurrentDate(), 0);
KDateTable *dt = KexiUtils::findFirstChild<KDateTable>(m_datePicker, "KDateTable");
if (dt)
- connect(dt, SIGNAL(tableClicked()), this, SLOT(acceptDate()));
+ connect(dt, TQT_SIGNAL(tableClicked()), this, TQT_SLOT(acceptDate()));
m_datePicker->setCloseButton(true);
m_datePicker->installEventFilter(this);
m_datePickerPopupMenu->insertItem(m_datePicker);
btn->setPopup(m_datePickerPopupMenu);
- QHBoxLayout* layout = new QHBoxLayout(this);
- layout->addWidget(m_dateEdit, 0);
- layout->addWidget(btn, 0);
- layout->addWidget(m_timeEdit, 0);
- //layout->addStretch(1);
+ TQHBoxLayout* tqlayout = new TQHBoxLayout(this);
+ tqlayout->addWidget(m_dateEdit, 0);
+ tqlayout->addWidget(btn, 0);
+ tqlayout->addWidget(m_timeEdit, 0);
+ //tqlayout->addStretch(1);
setFocusProxy(m_dateEdit);
}
@@ -84,14 +84,14 @@ KexiDBDateTimeEdit::~KexiDBDateTimeEdit()
{
}
-void KexiDBDateTimeEdit::setInvalidState(const QString & /*! @todo paint this text: text*/)
+void KexiDBDateTimeEdit::setInvalidState(const TQString & /*! @todo paint this text: text*/)
{
setEnabled(false);
setReadOnly(true);
m_invalidState = true;
//! @todo move this to KexiDataItemInterface::setInvalidStateInternal() ?
if (focusPolicy() & TabFocus)
- setFocusPolicy(QWidget::ClickFocus);
+ setFocusPolicy(TQ_ClickFocus);
}
void
@@ -100,19 +100,19 @@ KexiDBDateTimeEdit::setEnabled(bool enabled)
// prevent the user from reenabling the widget when it is in invalid state
if(enabled && m_invalidState)
return;
- QWidget::setEnabled(enabled);
+ TQWidget::setEnabled(enabled);
}
-void KexiDBDateTimeEdit::setValueInternal(const QVariant &, bool )
+void KexiDBDateTimeEdit::setValueInternal(const TQVariant &, bool )
{
m_dateEdit->setDate(m_origValue.toDate());
m_timeEdit->setTime(m_origValue.toTime());
}
-QVariant
+TQVariant
KexiDBDateTimeEdit::value()
{
- return QDateTime(m_dateEdit->date(), m_timeEdit->time());
+ return TQDateTime(m_dateEdit->date(), m_timeEdit->time());
}
bool KexiDBDateTimeEdit::valueIsNull()
@@ -138,7 +138,7 @@ void KexiDBDateTimeEdit::setReadOnly(bool set)
m_readOnly = set;
}
-QWidget*
+TQWidget*
KexiDBDateTimeEdit::widget()
{
return m_dateEdit;
@@ -146,7 +146,7 @@ KexiDBDateTimeEdit::widget()
bool KexiDBDateTimeEdit::cursorAtStart()
{
-#ifdef QDateTimeEditor_HACK
+#ifdef TQDateTimeEditor_HACK
return m_dte_date && m_dateEdit->hasFocus() && m_dte_date->focusSection()==0;
#else
return false;
@@ -155,7 +155,7 @@ bool KexiDBDateTimeEdit::cursorAtStart()
bool KexiDBDateTimeEdit::cursorAtEnd()
{
-#ifdef QDateTimeEditor_HACK
+#ifdef TQDateTimeEditor_HACK
return m_dte_time && m_timeEdit->hasFocus()
&& m_dte_time->focusSection()==int(m_dte_time->sectionCount()-1);
#else
@@ -165,8 +165,8 @@ bool KexiDBDateTimeEdit::cursorAtEnd()
void KexiDBDateTimeEdit::clear()
{
- m_dateEdit->setDate(QDate());
- m_timeEdit->setTime(QTime());
+ m_dateEdit->setDate(TQDate());
+ m_timeEdit->setTime(TQTime());
m_cleared = true;
}
@@ -179,7 +179,7 @@ KexiDBDateTimeEdit::slotValueChanged()
void
KexiDBDateTimeEdit::slotShowDatePicker()
{
- QDate date = m_dateEdit->date();
+ TQDate date = m_dateEdit->date();
m_datePicker->setDate(date);
m_datePicker->setFocus();
@@ -195,24 +195,24 @@ KexiDBDateTimeEdit::acceptDate()
}
bool
-KexiDBDateTimeEdit::eventFilter(QObject *o, QEvent *e)
+KexiDBDateTimeEdit::eventFilter(TQObject *o, TQEvent *e)
{
if (o != m_datePicker)
return false;
switch (e->type()) {
- case QEvent::Hide:
+ case TQEvent::Hide:
m_datePickerPopupMenu->hide();
break;
- case QEvent::KeyPress:
- case QEvent::KeyRelease: {
- QKeyEvent *ke = (QKeyEvent *)e;
- if (ke->key()==Qt::Key_Enter || ke->key()==Qt::Key_Return) {
+ case TQEvent::KeyPress:
+ case TQEvent::KeyRelease: {
+ TQKeyEvent *ke = (TQKeyEvent *)e;
+ if (ke->key()==TQt::Key_Enter || ke->key()==TQt::Key_Return) {
//accepting picker
acceptDate();
return true;
}
- else if (ke->key()==Qt::Key_Escape) {
+ else if (ke->key()==TQt::Key_Escape) {
//canceling picker
m_datePickerPopupMenu->hide();
return true;
@@ -227,14 +227,14 @@ KexiDBDateTimeEdit::eventFilter(QObject *o, QEvent *e)
return false;
}
-QDateTime
+TQDateTime
KexiDBDateTimeEdit::dateTime() const
{
- return QDateTime(m_dateEdit->date(), m_timeEdit->time());
+ return TQDateTime(m_dateEdit->date(), m_timeEdit->time());
}
void
-KexiDBDateTimeEdit::setDateTime(const QDateTime &dt)
+KexiDBDateTimeEdit::setDateTime(const TQDateTime &dt)
{
m_dateEdit->setDate(dt.date());
m_timeEdit->setTime(dt.time());
diff --git a/kexi/plugins/forms/widgets/kexidbdatetimeedit.h b/kexi/plugins/forms/widgets/kexidbdatetimeedit.h
index 1f185b16..b5bbaec0 100644
--- a/kexi/plugins/forms/widgets/kexidbdatetimeedit.h
+++ b/kexi/plugins/forms/widgets/kexidbdatetimeedit.h
@@ -22,32 +22,33 @@
#define KexiDBDateTimeEdit_H
#include "kexiformdataiteminterface.h"
-#include <qdatetimeedit.h>
+#include <tqdatetimeedit.h>
class KDatePicker;
-class QDateTimeEditor;
+class TQDateTimeEditor;
class KPopupMenu;
//! @short A db-aware datetime editor
-class KEXIFORMUTILS_EXPORT KexiDBDateTimeEdit : public QWidget, public KexiFormDataItemInterface
+class KEXIFORMUTILS_EXPORT KexiDBDateTimeEdit : public TQWidget, public KexiFormDataItemInterface
{
Q_OBJECT
- Q_PROPERTY(QString dataSource READ dataSource WRITE setDataSource DESIGNABLE true)
- Q_PROPERTY(QCString dataSourceMimeType READ dataSourceMimeType WRITE setDataSourceMimeType DESIGNABLE true)
- // properties copied from QDateTimeEdit
- Q_PROPERTY( QDateTime dateTime READ dateTime WRITE setDateTime )
- Q_PROPERTY( bool readOnly READ isReadOnly WRITE setReadOnly DESIGNABLE true )
+ TQ_OBJECT
+ TQ_PROPERTY(TQString dataSource READ dataSource WRITE setDataSource DESIGNABLE true)
+ TQ_PROPERTY(TQCString dataSourceMimeType READ dataSourceMimeType WRITE setDataSourceMimeType DESIGNABLE true)
+ // properties copied from TQDateTimeEdit
+ TQ_PROPERTY( TQDateTime dateTime READ dateTime WRITE setDateTime )
+ TQ_PROPERTY( bool readOnly READ isReadOnly WRITE setReadOnly DESIGNABLE true )
public:
enum Order { DMY, MDY, YMD, YDM };
- KexiDBDateTimeEdit(const QDateTime &datetime, QWidget *parent, const char *name=0);
+ KexiDBDateTimeEdit(const TQDateTime &datetime, TQWidget *tqparent, const char *name=0);
virtual ~KexiDBDateTimeEdit();
- inline QString dataSource() const { return KexiFormDataItemInterface::dataSource(); }
- inline QCString dataSourceMimeType() const { return KexiFormDataItemInterface::dataSourceMimeType(); }
- virtual QVariant value();
- virtual void setInvalidState( const QString& displayText );
+ inline TQString dataSource() const { return KexiFormDataItemInterface::dataSource(); }
+ inline TQCString dataSourceMimeType() const { return KexiFormDataItemInterface::dataSourceMimeType(); }
+ virtual TQVariant value();
+ virtual void setInvalidState( const TQString& displayText );
//! \return true if editor's value is null (not empty)
//! Used for checking if a given constraint within table of form is met.
@@ -63,7 +64,7 @@ class KEXIFORMUTILS_EXPORT KexiDBDateTimeEdit : public QWidget, public KexiFormD
virtual bool isReadOnly() const;
/*! \return the view widget of this item, e.g. line edit widget. */
- virtual QWidget* widget();
+ virtual TQWidget* widget();
virtual bool cursorAtStart();
virtual bool cursorAtEnd();
@@ -72,20 +73,20 @@ class KEXIFORMUTILS_EXPORT KexiDBDateTimeEdit : public QWidget, public KexiFormD
virtual void setEnabled(bool enabled);
// property functions
- QDateTime dateTime() const;
+ TQDateTime dateTime() const;
signals:
void dateTimeChanged();
public slots:
- inline void setDataSource(const QString &ds) { KexiFormDataItemInterface::setDataSource(ds); }
- inline void setDataSourceMimeType(const QCString &ds) { KexiFormDataItemInterface::setDataSourceMimeType(ds); }
- void setDateTime(const QDateTime &dt);
+ inline void setDataSource(const TQString &ds) { KexiFormDataItemInterface::setDataSource(ds); }
+ inline void setDataSourceMimeType(const TQCString &ds) { KexiFormDataItemInterface::setDataSourceMimeType(ds); }
+ void setDateTime(const TQDateTime &dt);
virtual void setReadOnly(bool set);
protected:
- virtual void setValueInternal(const QVariant& add, bool removeOld);
- virtual bool eventFilter(QObject *o, QEvent *e);
+ virtual void setValueInternal(const TQVariant& add, bool removeOld);
+ virtual bool eventFilter(TQObject *o, TQEvent *e);
protected slots:
void slotValueChanged();
@@ -94,9 +95,9 @@ class KEXIFORMUTILS_EXPORT KexiDBDateTimeEdit : public QWidget, public KexiFormD
private:
KDatePicker *m_datePicker;
- QDateEdit* m_dateEdit;
- QTimeEdit* m_timeEdit;
- QDateTimeEditor *m_dte_date, *m_dte_time;
+ TQDateEdit* m_dateEdit;
+ TQTimeEdit* m_timeEdit;
+ TQDateTimeEditor *m_dte_date, *m_dte_time;
KPopupMenu *m_datePickerPopupMenu;
bool m_invalidState : 1;
bool m_cleared : 1;
diff --git a/kexi/plugins/forms/widgets/kexidbdoublespinbox.cpp b/kexi/plugins/forms/widgets/kexidbdoublespinbox.cpp
index 67a2c1a6..c0eb17d3 100644
--- a/kexi/plugins/forms/widgets/kexidbdoublespinbox.cpp
+++ b/kexi/plugins/forms/widgets/kexidbdoublespinbox.cpp
@@ -20,26 +20,26 @@
#include "kexidbdoublespinbox.h"
-#include <qlineedit.h>
+#include <tqlineedit.h>
-KexiDBDoubleSpinBox::KexiDBDoubleSpinBox(QWidget *parent, const char *name)
- : KDoubleSpinBox(parent, name) , KexiFormDataItemInterface()
+KexiDBDoubleSpinBox::KexiDBDoubleSpinBox(TQWidget *tqparent, const char *name)
+ : KDoubleSpinBox(tqparent, name) , KexiFormDataItemInterface()
{
- connect(this, SIGNAL(valueChanged(double)), this, SLOT(slotValueChanged()));
+ connect(this, TQT_SIGNAL(valueChanged(double)), this, TQT_SLOT(slotValueChanged()));
}
KexiDBDoubleSpinBox::~KexiDBDoubleSpinBox()
{
}
-void KexiDBDoubleSpinBox::setInvalidState( const QString& displayText )
+void KexiDBDoubleSpinBox::setInvalidState( const TQString& displayText )
{
m_invalidState = true;
setEnabled(false);
setReadOnly(true);
//! @todo move this to KexiDataItemInterface::setInvalidStateInternal() ?
if (focusPolicy() & TabFocus)
- setFocusPolicy(QWidget::ClickFocus);
+ setFocusPolicy(TQ_ClickFocus);
setSpecialValueText(displayText);
KDoubleSpinBox::setValue(minValue());
}
@@ -53,12 +53,12 @@ KexiDBDoubleSpinBox::setEnabled(bool enabled)
KDoubleSpinBox::setEnabled(enabled);
}
-void KexiDBDoubleSpinBox::setValueInternal(const QVariant&, bool )
+void KexiDBDoubleSpinBox::setValueInternal(const TQVariant&, bool )
{
KDoubleSpinBox::setValue(m_origValue.toDouble());
}
-QVariant
+TQVariant
KexiDBDoubleSpinBox::value()
{
return KDoubleSpinBox::value();
@@ -89,7 +89,7 @@ void KexiDBDoubleSpinBox::setReadOnly(bool set)
editor()->setReadOnly(set);
}
-QWidget*
+TQWidget*
KexiDBDoubleSpinBox::widget()
{
return this;
diff --git a/kexi/plugins/forms/widgets/kexidbdoublespinbox.h b/kexi/plugins/forms/widgets/kexidbdoublespinbox.h
index c6bc627d..1445980c 100644
--- a/kexi/plugins/forms/widgets/kexidbdoublespinbox.h
+++ b/kexi/plugins/forms/widgets/kexidbdoublespinbox.h
@@ -22,25 +22,26 @@
#define KexiDBDoubleSpinBox_H
#include "kexiformdataiteminterface.h"
-#include <qwidget.h>
+#include <tqwidget.h>
#include <knuminput.h>
//! @short A db-aware int spin box
class KEXIFORMUTILS_EXPORT KexiDBDoubleSpinBox : public KDoubleSpinBox, public KexiFormDataItemInterface
{
Q_OBJECT
- Q_PROPERTY(QString dataSource READ dataSource WRITE setDataSource DESIGNABLE true)
- Q_PROPERTY(QCString dataSourceMimeType READ dataSourceMimeType WRITE setDataSourceMimeType DESIGNABLE true)
- Q_PROPERTY( bool readOnly READ isReadOnly WRITE setReadOnly DESIGNABLE true )
+ TQ_OBJECT
+ TQ_PROPERTY(TQString dataSource READ dataSource WRITE setDataSource DESIGNABLE true)
+ TQ_PROPERTY(TQCString dataSourceMimeType READ dataSourceMimeType WRITE setDataSourceMimeType DESIGNABLE true)
+ TQ_PROPERTY( bool readOnly READ isReadOnly WRITE setReadOnly DESIGNABLE true )
public:
- KexiDBDoubleSpinBox(QWidget *parent, const char *name=0);
+ KexiDBDoubleSpinBox(TQWidget *tqparent, const char *name=0);
virtual ~KexiDBDoubleSpinBox();
- inline QString dataSource() const { return KexiFormDataItemInterface::dataSource(); }
- inline QCString dataSourceMimeType() const { return KexiFormDataItemInterface::dataSourceMimeType(); }
- virtual QVariant value();
- virtual void setInvalidState( const QString& displayText );
+ inline TQString dataSource() const { return KexiFormDataItemInterface::dataSource(); }
+ inline TQCString dataSourceMimeType() const { return KexiFormDataItemInterface::dataSourceMimeType(); }
+ virtual TQVariant value();
+ virtual void setInvalidState( const TQString& displayText );
//! \return true if editor's value is null (not empty)
//! Used for checking if a given constraint within table of form is met.
@@ -56,7 +57,7 @@ class KEXIFORMUTILS_EXPORT KexiDBDoubleSpinBox : public KDoubleSpinBox, public K
virtual bool isReadOnly() const;
/*! \return the view widget of this item, e.g. line edit widget. */
- virtual QWidget* widget();
+ virtual TQWidget* widget();
virtual bool cursorAtStart();
virtual bool cursorAtEnd();
@@ -64,13 +65,13 @@ class KEXIFORMUTILS_EXPORT KexiDBDoubleSpinBox : public KDoubleSpinBox, public K
public slots:
virtual void setEnabled(bool enabled);
- inline void setDataSource(const QString &ds) { KexiFormDataItemInterface::setDataSource(ds); }
- inline void setDataSourceMimeType(const QCString &ds) { KexiFormDataItemInterface::setDataSourceMimeType(ds); }
+ inline void setDataSource(const TQString &ds) { KexiFormDataItemInterface::setDataSource(ds); }
+ inline void setDataSourceMimeType(const TQCString &ds) { KexiFormDataItemInterface::setDataSourceMimeType(ds); }
void slotValueChanged();
virtual void setReadOnly(bool set);
protected:
- virtual void setValueInternal(const QVariant& add, bool removeOld);
+ virtual void setValueInternal(const TQVariant& add, bool removeOld);
private:
bool m_invalidState : 1;
diff --git a/kexi/plugins/forms/widgets/kexidbform.cpp b/kexi/plugins/forms/widgets/kexidbform.cpp
index cff12c7c..12210430 100644
--- a/kexi/plugins/forms/widgets/kexidbform.cpp
+++ b/kexi/plugins/forms/widgets/kexidbform.cpp
@@ -19,11 +19,11 @@
* Boston, MA 02110-1301, USA.
*/
-#include <qobjectlist.h>
-#include <qpainter.h>
-#include <qcursor.h>
-#include <qapplication.h>
-#include <qfocusdata.h>
+#include <tqobjectlist.h>
+#include <tqpainter.h>
+#include <tqcursor.h>
+#include <tqapplication.h>
+#include <tqfocusdata.h>
#include <kdebug.h>
@@ -55,7 +55,7 @@ class KexiDBForm::Private
}
//! \return index of data-aware widget \a widget
- int indexOfDataAwareWidget(QWidget *widget) const
+ int indexOfDataAwareWidget(TQWidget *widget) const
{
if (!dynamic_cast<KexiDataItemInterface*>(widget))
return -1;
@@ -65,8 +65,8 @@ class KexiDBForm::Private
//! \return index of data item \a item, or -1 if not found
int indexOfDataItem( KexiDataItemInterface* item ) const
{
- QMapConstIterator<KexiDataItemInterface*, uint> indicesForDataAwareWidgetsIt(
- indicesForDataAwareWidgets.find(item));
+ TQMapConstIterator<KexiDataItemInterface*, uint> indicesForDataAwareWidgetsIt(
+ indicesForDataAwareWidgets.tqfind(item));
if (indicesForDataAwareWidgetsIt == indicesForDataAwareWidgets.constEnd())
return -1;
kexipluginsdbg << "KexiDBForm: column # for item: "
@@ -75,7 +75,7 @@ class KexiDBForm::Private
}
//! Sets orderedFocusWidgetsIterator member to a position pointing to \a widget
- void setOrderedFocusWidgetsIteratorTo( QWidget *widget )
+ void setOrderedFocusWidgetsIteratorTo( TQWidget *widget )
{
if (orderedFocusWidgetsIterator.current() == widget)
return;
@@ -86,23 +86,23 @@ class KexiDBForm::Private
KexiDataAwareObjectInterface* dataAwareObject;
//! ordered list of focusable widgets (can be both data-widgets or buttons, etc.)
- QPtrList<QWidget> orderedFocusWidgets;
+ TQPtrList<TQWidget> orderedFocusWidgets;
//! ordered list of data-aware widgets
- QPtrList<QWidget> orderedDataAwareWidgets;
- QMap<KexiDataItemInterface*, uint> indicesForDataAwareWidgets; //!< a subset of orderedFocusWidgets mapped to indices
- QPtrListIterator<QWidget> orderedFocusWidgetsIterator;
- QPixmap buffer; //!< stores grabbed entire form's area for redraw
- QRect prev_rect; //!< previously selected rectangle
-// QGuardedPtr<QWidget> widgetFocusedBeforePopup;
+ TQPtrList<TQWidget> orderedDataAwareWidgets;
+ TQMap<KexiDataItemInterface*, uint> indicesForDataAwareWidgets; //!< a subset of orderedFocusWidgets mapped to indices
+ TQPtrListIterator<TQWidget> orderedFocusWidgetsIterator;
+ TQPixmap buffer; //!< stores grabbed entire form's area for redraw
+ TQRect prev_rect; //!< previously selected rectangle
+// TQGuardedPtr<TQWidget> widgetFocusedBeforePopup;
bool autoTabStops : 1;
bool popupFocused : 1; //!< used in KexiDBForm::eventFilter()
};
//========================
-KexiDBForm::KexiDBForm(QWidget *parent, KexiDataAwareObjectInterface* dataAwareObject,
+KexiDBForm::KexiDBForm(TQWidget *tqparent, KexiDataAwareObjectInterface* dataAwareObject,
const char *name/*, KexiDB::Connection *conn*/)
- : KexiDBFormBase(parent, name)
+ : KexiDBFormBase(tqparent, name)
, KexiFormDataItemInterface()
, d(new Private())
{
@@ -113,7 +113,7 @@ KexiDBForm::KexiDBForm(QWidget *parent, KexiDataAwareObjectInterface* dataAwareO
m_hasFocusableWidget = false;
kexipluginsdbg << "KexiDBForm::KexiDBForm(): " << endl;
- setCursor(QCursor(Qt::ArrowCursor)); //to avoid keeping Size cursor when moving from form's boundaries
+ setCursor(TQCursor(TQt::ArrowCursor)); //to avoid keeping Size cursor when moving from form's boundaries
setAcceptDrops( true );
}
@@ -125,48 +125,48 @@ KexiDBForm::~KexiDBForm()
KexiDataAwareObjectInterface* KexiDBForm::dataAwareObject() const { return d->dataAwareObject; }
-//repaint all children widgets
-static void repaintAll(QWidget *w)
+//tqrepaint all tqchildren widgets
+static void tqrepaintAll(TQWidget *w)
{
- QObjectList *list = w->queryList("QWidget");
- QObjectListIt it(*list);
- for (QObject *obj; (obj=it.current()); ++it ) {
- static_cast<QWidget*>(obj)->repaint();
+ TQObjectList *list = w->queryList(TQWIDGET_OBJECT_NAME_STRING);
+ TQObjectListIt it(*list);
+ for (TQObject *obj; (obj=it.current()); ++it ) {
+ TQT_TQWIDGET(obj)->tqrepaint();
}
delete list;
}
void
-KexiDBForm::drawRect(const QRect& r, int type)
+KexiDBForm::drawRect(const TQRect& r, int type)
{
- QValueList<QRect> l;
+ TQValueList<TQRect> l;
l.append(r);
drawRects(l, type);
}
void
-KexiDBForm::drawRects(const QValueList<QRect> &list, int type)
+KexiDBForm::drawRects(const TQValueList<TQRect> &list, int type)
{
- QPainter p;
- p.begin(this, true);
+ TQPainter p;
+ p.tqbegin(TQT_TQPAINTDEVICE(this), true);
bool unclipped = testWFlags( WPaintUnclipped );
setWFlags( WPaintUnclipped );
if (d->prev_rect.isValid()) {
//redraw prev. selection's rectangle
- p.drawPixmap( QPoint(d->prev_rect.x()-2, d->prev_rect.y()-2), d->buffer,
- QRect(d->prev_rect.x()-2, d->prev_rect.y()-2, d->prev_rect.width()+4, d->prev_rect.height()+4));
+ p.drawPixmap( TQPoint(d->prev_rect.x()-2, d->prev_rect.y()-2), d->buffer,
+ TQRect(d->prev_rect.x()-2, d->prev_rect.y()-2, d->prev_rect.width()+4, d->prev_rect.height()+4));
}
- p.setBrush(QBrush::NoBrush);
+ p.setBrush(TQBrush::NoBrush);
if(type == 1) // selection rect
- p.setPen(QPen(white, 1, Qt::DotLine));
+ p.setPen(TQPen(white, 1, TQt::DotLine));
else if(type == 2) // insert rect
- p.setPen(QPen(white, 2));
+ p.setPen(TQPen(white, 2));
p.setRasterOp(XorROP);
- d->prev_rect = QRect();
- QValueList<QRect>::ConstIterator endIt = list.constEnd();
- for(QValueList<QRect>::ConstIterator it = list.constBegin(); it != endIt; ++it) {
+ d->prev_rect = TQRect();
+ TQValueList<TQRect>::ConstIterator endIt = list.constEnd();
+ for(TQValueList<TQRect>::ConstIterator it = list.constBegin(); it != endIt; ++it) {
p.drawRect(*it);
if (d->prev_rect.isValid())
d->prev_rect = d->prev_rect.unite(*it);
@@ -182,59 +182,59 @@ KexiDBForm::drawRects(const QValueList<QRect> &list, int type)
void
KexiDBForm::initBuffer()
{
- repaintAll(this);
+ tqrepaintAll(this);
d->buffer.resize( width(), height() );
- d->buffer = QPixmap::grabWindow( winId() );
- d->prev_rect = QRect();
+ d->buffer = TQPixmap::grabWindow( winId() );
+ d->prev_rect = TQRect();
}
void
KexiDBForm::clearForm()
{
- QPainter p;
- p.begin(this, true);
+ TQPainter p;
+ p.tqbegin(TQT_TQPAINTDEVICE(this), true);
bool unclipped = testWFlags( WPaintUnclipped );
setWFlags( WPaintUnclipped );
//redraw entire form surface
- p.drawPixmap( QPoint(0,0), d->buffer, QRect(0,0,d->buffer.width(), d->buffer.height()) );
+ p.drawPixmap( TQPoint(0,0), d->buffer, TQRect(0,0,d->buffer.width(), d->buffer.height()) );
if (!unclipped)
clearWFlags( WPaintUnclipped );
p.end();
- repaintAll(this);
+ tqrepaintAll(this);
}
void
-KexiDBForm::highlightWidgets(QWidget *from, QWidget *to)//, const QPoint &point)
+KexiDBForm::highlightWidgets(TQWidget *from, TQWidget *to)//, const TQPoint &point)
{
- QPoint fromPoint, toPoint;
- if(from && from->parentWidget() && (from != this))
- fromPoint = from->parentWidget()->mapTo(this, from->pos());
- if(to && to->parentWidget() && (to != this))
- toPoint = to->parentWidget()->mapTo(this, to->pos());
-
- QPainter p;
- p.begin(this, true);
+ TQPoint fromPoint, toPoint;
+ if(from && from->tqparentWidget() && (from != this))
+ fromPoint = from->tqparentWidget()->mapTo(this, from->pos());
+ if(to && to->tqparentWidget() && (to != this))
+ toPoint = to->tqparentWidget()->mapTo(this, to->pos());
+
+ TQPainter p;
+ p.tqbegin(TQT_TQPAINTDEVICE(this), true);
bool unclipped = testWFlags( WPaintUnclipped );
setWFlags( WPaintUnclipped );
if (d->prev_rect.isValid()) {
//redraw prev. selection's rectangle
- p.drawPixmap( QPoint(d->prev_rect.x(), d->prev_rect.y()), d->buffer,
- QRect(d->prev_rect.x(), d->prev_rect.y(), d->prev_rect.width(), d->prev_rect.height()));
+ p.drawPixmap( TQPoint(d->prev_rect.x(), d->prev_rect.y()), d->buffer,
+ TQRect(d->prev_rect.x(), d->prev_rect.y(), d->prev_rect.width(), d->prev_rect.height()));
}
- p.setPen( QPen(Qt::red, 2) );
+ p.setPen( TQPen(TQt::red, 2) );
if(to)
{
- QPixmap pix1 = QPixmap::grabWidget(from);
- QPixmap pix2 = QPixmap::grabWidget(to);
+ TQPixmap pix1 = TQPixmap::grabWidget(from);
+ TQPixmap pix2 = TQPixmap::grabWidget(to);
if((from != this) && (to != this))
- p.drawLine( from->parentWidget()->mapTo(this, from->geometry().center()), to->parentWidget()->mapTo(this, to->geometry().center()) );
+ p.drawLine( from->tqparentWidget()->mapTo(this, from->tqgeometry().center()), to->tqparentWidget()->mapTo(this, to->tqgeometry().center()) );
p.drawPixmap(fromPoint.x(), fromPoint.y(), pix1);
p.drawPixmap(toPoint.x(), toPoint.y(), pix2);
@@ -251,7 +251,7 @@ KexiDBForm::highlightWidgets(QWidget *from, QWidget *to)//, const QPoint &point)
p.drawRoundRect(fromPoint.x(), fromPoint.y(), from->width(), from->height(), 5, 5);
if((to == this) || (from == this))
- d->prev_rect = QRect(0, 0, d->buffer.width(), d->buffer.height());
+ d->prev_rect = TQRect(0, 0, d->buffer.width(), d->buffer.height());
else if(to)
{
d->prev_rect.setX( (fromPoint.x() < toPoint.x()) ? (fromPoint.x() - 5) : (toPoint.x() - 5) );
@@ -260,21 +260,21 @@ KexiDBForm::highlightWidgets(QWidget *from, QWidget *to)//, const QPoint &point)
d->prev_rect.setBottom( (fromPoint.y() < toPoint.y()) ? (toPoint.y() + to->height() + 10) : (fromPoint.y() + from->height() + 10) ) ;
}
else
- d->prev_rect = QRect(fromPoint.x()- 5, fromPoint.y() -5, from->width() + 10, from->height() + 10);
+ d->prev_rect = TQRect(fromPoint.x()- 5, fromPoint.y() -5, from->width() + 10, from->height() + 10);
if (!unclipped)
clearWFlags( WPaintUnclipped );
p.end();
}
-QSize
-KexiDBForm::sizeHint() const
+TQSize
+KexiDBForm::tqsizeHint() const
{
//todo: find better size (user configured?)
- return QSize(400,300);
+ return TQSize(400,300);
}
-void KexiDBForm::setInvalidState( const QString& displayText )
+void KexiDBForm::setInvalidState( const TQString& displayText )
{
Q_UNUSED( displayText );
@@ -291,40 +291,40 @@ void KexiDBForm::setAutoTabStops(bool set)
d->autoTabStops = set;
}
-QPtrList<QWidget>* KexiDBForm::orderedFocusWidgets() const
+TQPtrList<TQWidget>* KexiDBForm::orderedFocusWidgets() const
{
return &d->orderedFocusWidgets;
}
-QPtrList<QWidget>* KexiDBForm::orderedDataAwareWidgets() const
+TQPtrList<TQWidget>* KexiDBForm::orderedDataAwareWidgets() const
{
return &d->orderedDataAwareWidgets;
}
void KexiDBForm::updateTabStopsOrder(KFormDesigner::Form* form)
{
- QWidget *fromWidget = 0;
- //QWidget *topLevelWidget = form->widget()->topLevelWidget();
+ TQWidget *fromWidget = 0;
+ //TQWidget *tqtopLevelWidget = form->widget()->tqtopLevelWidget();
//js form->updateTabStopsOrder(); //certain widgets can have now updated focusPolicy properties, fix this
uint numberOfDataAwareWidgets = 0;
// if (d->orderedFocusWidgets.isEmpty()) {
//generate a new list
for (KFormDesigner::ObjectTreeListIterator it(form->tabStopsIterator()); it.current(); ++it) {
- if (it.current()->widget()->focusPolicy() & QWidget::TabFocus) {
+ if (it.current()->widget()->focusPolicy() & TQ_TabFocus) {
//this widget has tab focus:
it.current()->widget()->installEventFilter(this);
- //also filter events for data-aware children of this widget (i.e. KexiDBAutoField's editors)
- QObjectList *children = it.current()->widget()->queryList("QWidget");
- for (QObjectListIt childrenIt(*children); childrenIt.current(); ++childrenIt) {
- // if (dynamic_cast<KexiFormDataItemInterface*>(childrenIt.current())) {
+ //also filter events for data-aware tqchildren of this widget (i.e. KexiDBAutoField's editors)
+ TQObjectList *tqchildren = it.current()->widget()->queryList(TQWIDGET_OBJECT_NAME_STRING);
+ for (TQObjectListIt tqchildrenIt(*tqchildren); tqchildrenIt.current(); ++tqchildrenIt) {
+ // if (dynamic_cast<KexiFormDataItemInterface*>(tqchildrenIt.current())) {
kexipluginsdbg << "KexiDBForm::updateTabStopsOrder(): also adding '"
- << childrenIt.current()->className() << " " << childrenIt.current()->name()
+ << tqchildrenIt.current()->className() << " " << tqchildrenIt.current()->name()
<< "' child to filtered widgets" << endl;
- //it.current()->widget()->installEventFilter(static_cast<QWidget*>(childrenIt.current()));
- childrenIt.current()->installEventFilter(this);
+ //it.current()->widget()->installEventFilter(TQT_TQWIDGET(tqchildrenIt.current()));
+ tqchildrenIt.current()->installEventFilter(this);
// }
}
- delete children;
+ delete tqchildren;
if (fromWidget) {
kexipluginsdbg << "KexiDBForm::updateTabStopsOrder() tab order: " << fromWidget->name()
<< " -> " << it.current()->widget()->name() << endl;
@@ -342,7 +342,7 @@ void KexiDBForm::updateTabStopsOrder(KFormDesigner::Form* form)
// /*! @todo d->indicesForDataAwareWidgets SHOULDNT BE UPDATED HERE BECAUSE
// THERE CAN BE ALSO NON-TABSTOP DATA WIDGETS!
// */
- d->indicesForDataAwareWidgets.replace(
+ d->indicesForDataAwareWidgets.tqreplace(
dataItem,
numberOfDataAwareWidgets );
numberOfDataAwareWidgets++;
@@ -353,7 +353,7 @@ void KexiDBForm::updateTabStopsOrder(KFormDesigner::Form* form)
// }
/* else {
//restore ordering
- for (QPtrListIterator<QWidget> it(d->orderedFocusWidgets); it.current(); ++it) {
+ for (TQPtrListIterator<TQWidget> it(d->orderedFocusWidgets); it.current(); ++it) {
if (fromWidget) {
kdDebug() << "KexiDBForm::updateTabStopsOrder() tab order: " << fromWidget->name()
<< " -> " << it.current()->name() << endl;
@@ -361,14 +361,14 @@ void KexiDBForm::updateTabStopsOrder(KFormDesigner::Form* form)
}
fromWidget = it.current();
}
-// SET_FOCUS_USING_REASON(focusWidget(), QFocusEvent::Tab);
+// SET_FOCUS_USING_REASON(tqfocusWidget(), TQFocusEvent::Tab);
}*/
}
void KexiDBForm::updateTabStopsOrder()
{
- for (QPtrListIterator<QWidget> it( d->orderedFocusWidgets ); it.current();) {
- if (! (it.current()->focusPolicy() & QWidget::TabFocus))
+ for (TQPtrListIterator<TQWidget> it( d->orderedFocusWidgets ); it.current();) {
+ if (! (it.current()->focusPolicy() & TQ_TabFocus))
d->orderedFocusWidgets.remove( it.current() );
else
++it;
@@ -377,7 +377,7 @@ void KexiDBForm::updateTabStopsOrder()
void KexiDBForm::updateReadOnlyFlags()
{
- for (QPtrListIterator<QWidget> it(d->orderedDataAwareWidgets); it.current(); ++it) {
+ for (TQPtrListIterator<TQWidget> it(d->orderedDataAwareWidgets); it.current(); ++it) {
KexiFormDataItemInterface* dataItem = dynamic_cast<KexiFormDataItemInterface*>( it.current() );
if (dataItem && !dataItem->dataSource().isEmpty()) {
if (dataAwareObject()->isReadOnly()) {
@@ -387,27 +387,27 @@ void KexiDBForm::updateReadOnlyFlags()
}
}
-bool KexiDBForm::eventFilter( QObject * watched, QEvent * e )
+bool KexiDBForm::eventFilter( TQObject * watched, TQEvent * e )
{
//kexipluginsdbg << e->type() << endl;
- if (e->type()==QEvent::Resize && watched == this)
+ if (e->type()==TQEvent::Resize && TQT_BASE_OBJECT(watched) == TQT_BASE_OBJECT(this))
kexipluginsdbg << "RESIZE" << endl;
- if (e->type()==QEvent::KeyPress) {
+ if (e->type()==TQEvent::KeyPress) {
if (preview()) {
- QKeyEvent *ke = static_cast<QKeyEvent*>(e);
+ TQKeyEvent *ke = TQT_TQKEYEVENT(e);
const int key = ke->key();
- bool tab = ke->state() == Qt::NoButton && key == Qt::Key_Tab;
- bool backtab = ((ke->state() == Qt::NoButton || ke->state() == Qt::ShiftButton) && key == Qt::Key_Backtab)
- || (ke->state() == Qt::ShiftButton && key == Qt::Key_Tab);
- QObject *o = watched; //focusWidget();
- QWidget* realWidget = dynamic_cast<QWidget*>(o); //will beused below (for tab/backtab handling)
+ bool tab = ke->state() == Qt::NoButton && key == TQt::Key_Tab;
+ bool backtab = ((ke->state() == Qt::NoButton || ke->state() == TQt::ShiftButton) && key == TQt::Key_Backtab)
+ || (ke->state() == TQt::ShiftButton && key == TQt::Key_Tab);
+ TQObject *o = watched; //tqfocusWidget();
+ TQWidget* realWidget = dynamic_cast<TQWidget*>(o); //will beused below (for tab/backtab handling)
if (!tab && !backtab) {
//for buttons, left/up and right/down keys act like tab/backtab (see qbutton.cpp)
- if (realWidget->inherits("QButton")) {
- if (ke->state() == Qt::NoButton && (key == Qt::Key_Right || key == Qt::Key_Down))
+ if (realWidget->inherits(TQBUTTON_OBJECT_NAME_STRING)) {
+ if (ke->state() == Qt::NoButton && (key == TQt::Key_Right || key == TQt::Key_Down))
tab = true;
- else if (ke->state() == Qt::NoButton && (key == Qt::Key_Left || key == Qt::Key_Up))
+ else if (ke->state() == Qt::NoButton && (key == TQt::Key_Left || key == TQt::Key_Up))
backtab = true;
}
}
@@ -415,21 +415,21 @@ bool KexiDBForm::eventFilter( QObject * watched, QEvent * e )
if (!tab && !backtab) {
// allow the editor widget to grab the key press event
while (true) {
- if (!o || o == dynamic_cast<QObject*>(d->dataAwareObject))
+ if (!o || o == dynamic_cast<TQObject*>(d->dataAwareObject))
break;
if (dynamic_cast<KexiFormDataItemInterface*>(o)) {
- realWidget = dynamic_cast<QWidget*>(o); //will be used below
+ realWidget = dynamic_cast<TQWidget*>(o); //will be used below
if (realWidget == this) //we have encountered 'this' form surface, give up
return false;
KexiFormDataItemInterface* dataItemIface = dynamic_cast<KexiFormDataItemInterface*>(o);
while (dataItemIface) {
if (dataItemIface->keyPressed(ke))
return false;
- dataItemIface = dynamic_cast<KexiFormDataItemInterface*>(dataItemIface->parentInterface()); //try in parent, e.g. in combobox
+ dataItemIface = dynamic_cast<KexiFormDataItemInterface*>(dataItemIface->tqparentInterface()); //try in tqparent, e.g. in combobox
}
break;
}
- o = o->parent();
+ o = o->tqparent();
}
// try to handle global shortcuts at the KexiDataAwareObjectInterface
// level (e.g. for "next record" action)
@@ -437,15 +437,15 @@ bool KexiDBForm::eventFilter( QObject * watched, QEvent * e )
int curCol = d->dataAwareObject->currentColumn();
bool moveToFirstField; //if true, we'll move focus to the first field (in tab order)
bool moveToLastField; //if true, we'll move focus to the first field (in tab order)
- if (! (ke->state() == Qt::NoButton && (key == Qt::Key_Home
- || key == Qt::Key_End || key == Qt::Key_Down || key == Qt::Key_Up))
+ if (! (ke->state() == Qt::NoButton && (key == TQt::Key_Home
+ || key == TQt::Key_End || key == TQt::Key_Down || key == TQt::Key_Up))
/* ^^ home/end/down/up are already handled by widgets */
&& d->dataAwareObject->handleKeyPress(
ke, curRow, curCol, false/*!fullRowSelection*/, &moveToFirstField, &moveToLastField))
{
if (ke->isAccepted())
return true;
- QWidget* widgetToFocus;
+ TQWidget* widgetToFocus;
if (moveToFirstField) {
widgetToFocus = d->orderedFocusWidgets.first(); //?
curCol = d->indexOfDataAwareWidget( widgetToFocus );
@@ -467,14 +467,14 @@ bool KexiDBForm::eventFilter( QObject * watched, QEvent * e )
ke->accept();
return true;
}
- if (key == Qt::Key_Delete && ke->state()==Qt::ControlButton) {
+ if (key == TQt::Key_Delete && ke->state()==TQt::ControlButton) {
//! @todo remove hardcoded shortcuts: can be reconfigured...
d->dataAwareObject->deleteCurrentRow();
return true;
}
}
// handle Esc key
- if (ke->state() == Qt::NoButton && key == Qt::Key_Escape) {
+ if (ke->state() == Qt::NoButton && key == TQt::Key_Escape) {
//cancel field editing/row editing if possible
if (d->dataAwareObject->cancelEditor())
return true;
@@ -482,29 +482,29 @@ bool KexiDBForm::eventFilter( QObject * watched, QEvent * e )
return true;
return false; // canceling not needed - pass the event to the active widget
}
- // jstaniek: Fix for Qt bug (handling e.g. Alt+2, Ctrl+2 keys on every platform)
+ // jstaniek: Fix for TQt bug (handling e.g. Alt+2, Ctrl+2 keys on every platform)
// It's important because we're using alt+2 short cut by default
// Damn! I've reported this to Trolltech in November 2004 - still not fixed.
- if (ke->isAccepted() && (ke->state() & Qt::AltButton) && ke->text()>="0" && ke->text()<="9")
+ if (ke->isAccepted() && (ke->state() & TQt::AltButton) && ke->text()>="0" && ke->text()<="9")
return true;
if (tab || backtab) {
//the watched widget can be a subwidget of a real widget, e.g. a drop down button of image box: find it
while (!KexiFormPart::library()->widgetInfoForClassName(realWidget->className()))
- realWidget = realWidget->parentWidget();
+ realWidget = realWidget->tqparentWidget();
if (!realWidget)
return true; //ignore
//the watched widget can be a subwidget of a real widget, e.g. autofield: find it
- //QWidget* realWidget = static_cast<QWidget*>(watched);
- while (dynamic_cast<KexiDataItemInterface*>(realWidget) && dynamic_cast<KexiDataItemInterface*>(realWidget)->parentInterface())
- realWidget = dynamic_cast<QWidget*>( dynamic_cast<KexiDataItemInterface*>(realWidget)->parentInterface() );
+ //TQWidget* realWidget = TQT_TQWIDGET(watched);
+ while (dynamic_cast<KexiDataItemInterface*>(realWidget) && dynamic_cast<KexiDataItemInterface*>(realWidget)->tqparentInterface())
+ realWidget = dynamic_cast<TQWidget*>( dynamic_cast<KexiDataItemInterface*>(realWidget)->tqparentInterface() );
d->setOrderedFocusWidgetsIteratorTo( realWidget );
kexipluginsdbg << realWidget->name() << endl;
// find next/prev widget to focus
- QWidget *widgetToUnfocus = realWidget;
- QWidget *widgetToFocus = 0;
+ TQWidget *widgetToUnfocus = realWidget;
+ TQWidget *widgetToFocus = 0;
bool wasAtFirstWidget = false; //used to protect against infinite loop
while (true) {
if (tab) {
@@ -533,11 +533,11 @@ bool KexiDBForm::eventFilter( QObject * watched, QEvent * e )
widgetToFocus = d->orderedFocusWidgetsIterator.current();
- QObject *pageFor_widgetToFocus = 0;
+ TQObject *pageFor_widgetToFocus = 0;
KFormDesigner::TabWidget *tabWidgetFor_widgetToFocus
= KFormDesigner::findParent<KFormDesigner::TabWidget>(
widgetToFocus, "KFormDesigner::TabWidget", pageFor_widgetToFocus);
- if (tabWidgetFor_widgetToFocus && tabWidgetFor_widgetToFocus->currentPage()!=pageFor_widgetToFocus) {
+ if (tabWidgetFor_widgetToFocus && TQT_BASE_OBJECT(tabWidgetFor_widgetToFocus->currentPage())!=TQT_BASE_OBJECT(pageFor_widgetToFocus)) {
realWidget = widgetToFocus;
continue; //the new widget to focus is placed on invisible tab page: move to next widget
}
@@ -545,21 +545,21 @@ bool KexiDBForm::eventFilter( QObject * watched, QEvent * e )
}//while
//set focus, but don't use just setFocus() because certain widgets
- //behaves differently (e.g. QLineEdit calls selectAll()) when
- //focus event's reason is QFocusEvent::Tab
+ //behaves differently (e.g. TQLineEdit calls selectAll()) when
+ //focus event's reason is TQFocusEvent::Tab
if (widgetToFocus->focusProxy())
- widgetToFocus = widgetToFocus->focusProxy();
+ widgetToFocus = TQT_TQWIDGET(widgetToFocus->focusProxy());
if (widgetToFocus && d->dataAwareObject->acceptEditor()) {
if (tab) {
//try to accept this will validate the current input (if any)
- KexiUtils::unsetFocusWithReason(widgetToUnfocus, QFocusEvent::Tab);
- KexiUtils::setFocusWithReason(widgetToFocus, QFocusEvent::Tab);
+ KexiUtils::unsetFocusWithReason(widgetToUnfocus, TQFocusEvent::Tab);
+ KexiUtils::setFocusWithReason(widgetToFocus, TQFocusEvent::Tab);
kexipluginsdbg << "focusing " << widgetToFocus->name() << endl;
}
else {//backtab
- KexiUtils::unsetFocusWithReason(widgetToUnfocus, QFocusEvent::Backtab);
+ KexiUtils::unsetFocusWithReason(widgetToUnfocus, TQFocusEvent::Backtab);
//set focus, see above note
- KexiUtils::setFocusWithReason(d->orderedFocusWidgetsIterator.current(), QFocusEvent::Backtab);
+ KexiUtils::setFocusWithReason(d->orderedFocusWidgetsIterator.current(), TQFocusEvent::Backtab);
kexipluginsdbg << "focusing " << d->orderedFocusWidgetsIterator.current()->name() << endl;
}
}
@@ -567,9 +567,9 @@ bool KexiDBForm::eventFilter( QObject * watched, QEvent * e )
}
}
}
- else if (e->type()==QEvent::FocusIn) {
+ else if (e->type()==TQEvent::FocusIn) {
bool focusDataWidget = preview();
- if (static_cast<QFocusEvent*>(e)->reason()==QFocusEvent::Popup) {
+ if (TQT_TQFOCUSEVENT(e)->reason()==TQFocusEvent::Popup) {
kdDebug() << "->>> focus IN, popup" <<endl;
focusDataWidget = !d->popupFocused;
d->popupFocused = false;
@@ -582,10 +582,10 @@ bool KexiDBForm::eventFilter( QObject * watched, QEvent * e )
if (focusDataWidget) {
kexipluginsdbg << "KexiDBForm: FocusIn: " << watched->className() << " " << watched->name() << endl;
if (d->dataAwareObject) {
- QWidget *dataItem = dynamic_cast<QWidget*>(watched);
+ TQWidget *dataItem = dynamic_cast<TQWidget*>(watched);
while (dataItem) {
while (dataItem && !dynamic_cast<KexiDataItemInterface*>(dataItem))
- dataItem = dataItem->parentWidget();
+ dataItem = dataItem->tqparentWidget();
if (!dataItem)
break;
kexipluginsdbg << "KexiDBForm: FocusIn: FOUND " << dataItem->className() << " " << dataItem->name() << endl;
@@ -600,23 +600,23 @@ bool KexiDBForm::eventFilter( QObject * watched, QEvent * e )
break;
}
else
- dataItem = dataItem->parentWidget();
+ dataItem = dataItem->tqparentWidget();
dataItem->update();
}
}
}
}
- else if (e->type()==QEvent::FocusOut) {
- if (static_cast<QFocusEvent*>(e)->reason()==QFocusEvent::Popup) {
- //d->widgetFocusedBeforePopup = (QWidget*)watched;
+ else if (e->type()==TQEvent::FocusOut) {
+ if (TQT_TQFOCUSEVENT(e)->reason()==TQFocusEvent::Popup) {
+ //d->widgetFocusedBeforePopup = (TQWidget*)watched;
d->popupFocused = true;
}
else
d->popupFocused = false;
// d->widgetFocusedBeforePopup = 0;
-// kdDebug() << "e->type()==QEvent::FocusOut " << watched->className() << " " <<watched->name() << endl;
-// UNSET_FOCUS_USING_REASON(watched, static_cast<QFocusEvent*>(e)->reason());
+// kdDebug() << "e->type()==TQEvent::FocusOut " << watched->className() << " " <<watched->name() << endl;
+// UNSET_FOCUS_USING_REASON(watched, TQT_TQFOCUSEVENT(e)->reason());
}
return KexiDBFormBase::eventFilter(watched, e);
}
@@ -645,7 +645,7 @@ void KexiDBForm::setReadOnly( bool readOnly )
d->dataAwareObject->setReadOnly( readOnly ); //???
}
-QWidget* KexiDBForm::widget()
+TQWidget* KexiDBForm::widget()
{
return this;
}
@@ -670,19 +670,19 @@ bool KexiDBForm::preview() const {
? dynamic_cast<KexiScrollView*>(d->dataAwareObject)->preview() : false;
}
-void KexiDBForm::dragMoveEvent( QDragMoveEvent *e )
+void KexiDBForm::dragMoveEvent( TQDragMoveEvent *e )
{
KexiDBFormBase::dragMoveEvent( e );
emit handleDragMoveEvent(e);
}
-void KexiDBForm::dropEvent( QDropEvent *e )
+void KexiDBForm::dropEvent( TQDropEvent *e )
{
KexiDBFormBase::dropEvent( e );
emit handleDropEvent(e);
}
-void KexiDBForm::setCursor( const QCursor & cursor )
+void KexiDBForm::setCursor( const TQCursor & cursor )
{
//js: empty, to avoid fscking problems with random cursors!
//! @todo?
@@ -691,11 +691,11 @@ void KexiDBForm::setCursor( const QCursor & cursor )
KexiDBFormBase::setCursor(cursor);
}
-//! @todo: Qt4? XORed resize rectangles instead of black widgets
+//! @todo: TQt4? XORed resize rectangles instead of black widgets
/*
-void KexiDBForm::paintEvent( QPaintEvent *e )
+void KexiDBForm::paintEvent( TQPaintEvent *e )
{
- QPainter p;
+ TQPainter p;
p.begin(this, true);
bool unclipped = testWFlags( WPaintUnclipped );
setWFlags( WPaintUnclipped );
diff --git a/kexi/plugins/forms/widgets/kexidbform.h b/kexi/plugins/forms/widgets/kexidbform.h
index 81a71bba..cbfdc8ee 100644
--- a/kexi/plugins/forms/widgets/kexidbform.h
+++ b/kexi/plugins/forms/widgets/kexidbform.h
@@ -21,7 +21,7 @@
#ifndef KEXIDBFORM_H
#define KEXIDBFORM_H
-#include <qpixmap.h>
+#include <tqpixmap.h>
#include <formeditor/form.h>
#include "../kexiformdataiteminterface.h"
@@ -30,7 +30,7 @@
#include <kexigradientwidget.h>
# define KexiDBFormBase KexiGradientWidget
#else
-# define KexiDBFormBase QWidget
+# define KexiDBFormBase TQWidget
#endif
class KexiDataAwareObjectInterface;
@@ -43,88 +43,89 @@ class KEXIFORMUTILS_EXPORT KexiDBForm :
public KexiFormDataItemInterface
{
Q_OBJECT
- Q_PROPERTY(QString dataSource READ dataSource WRITE setDataSource DESIGNABLE true)
- Q_PROPERTY(QCString dataSourceMimeType READ dataSourceMimeType WRITE setDataSourceMimeType DESIGNABLE true)
- Q_PROPERTY(bool autoTabStops READ autoTabStops WRITE setAutoTabStops DESIGNABLE true)
+ TQ_OBJECT
+ TQ_PROPERTY(TQString dataSource READ dataSource WRITE setDataSource DESIGNABLE true)
+ TQ_PROPERTY(TQCString dataSourceMimeType READ dataSourceMimeType WRITE setDataSourceMimeType DESIGNABLE true)
+ TQ_PROPERTY(bool autoTabStops READ autoTabStops WRITE setAutoTabStops DESIGNABLE true)
//original "size" property is not designable, so here's a custom (not storable) replacement
- Q_PROPERTY( QSize sizeInternal READ sizeInternal WRITE resizeInternal DESIGNABLE true STORED false )
+ TQ_PROPERTY( TQSize sizeInternal READ sizeInternal WRITE resizeInternal DESIGNABLE true STORED false )
public:
- KexiDBForm(QWidget *parent, KexiDataAwareObjectInterface* dataAwareObject, const char *name="kexi_dbform");
+ KexiDBForm(TQWidget *tqparent, KexiDataAwareObjectInterface* dataAwareObject, const char *name="kexi_dbform");
virtual ~KexiDBForm();
KexiDataAwareObjectInterface* dataAwareObject() const;
- inline QString dataSource() const { return KexiFormDataItemInterface::dataSource(); }
- inline QCString dataSourceMimeType() const { return KexiFormDataItemInterface::dataSourceMimeType(); }
+ inline TQString dataSource() const { return KexiFormDataItemInterface::dataSource(); }
+ inline TQCString dataSourceMimeType() const { return KexiFormDataItemInterface::dataSourceMimeType(); }
//! no effect
- QVariant value() { return QVariant(); }
+ TQVariant value() { return TQVariant(); }
- virtual void setInvalidState( const QString& displayText );
+ virtual void setInvalidState( const TQString& displayText );
- virtual void drawRect(const QRect& r, int type);
- virtual void drawRects(const QValueList<QRect> &list, int type);
+ virtual void drawRect(const TQRect& r, int type);
+ virtual void drawRects(const TQValueList<TQRect> &list, int type);
virtual void initBuffer();
virtual void clearForm();
- virtual void highlightWidgets(QWidget *from, QWidget *to/*, const QPoint &p*/);
+ virtual void highlightWidgets(TQWidget *from, TQWidget *to/*, const TQPoint &p*/);
- virtual QSize sizeHint() const;
+ virtual TQSize tqsizeHint() const;
bool autoTabStops() const;
- QPtrList<QWidget>* orderedFocusWidgets() const;
+ TQPtrList<TQWidget>* orderedFocusWidgets() const;
- QPtrList<QWidget>* orderedDataAwareWidgets() const;
+ TQPtrList<TQWidget>* orderedDataAwareWidgets() const;
void updateTabStopsOrder(KFormDesigner::Form* form);
void updateTabStopsOrder();
- virtual bool eventFilter ( QObject * watched, QEvent * e );
+ virtual bool eventFilter ( TQObject * watched, TQEvent * e );
virtual bool valueIsNull();
virtual bool valueIsEmpty();
virtual bool isReadOnly() const;
- virtual QWidget* widget();
+ virtual TQWidget* widget();
virtual bool cursorAtStart();
virtual bool cursorAtEnd();
virtual void clear();
bool preview() const;
- virtual void setCursor( const QCursor & cursor );
+ virtual void setCursor( const TQCursor & cursor );
public slots:
void setAutoTabStops(bool set);
- inline void setDataSource(const QString &ds) { KexiFormDataItemInterface::setDataSource(ds); }
- inline void setDataSourceMimeType(const QCString &ds) { KexiFormDataItemInterface::setDataSourceMimeType(ds); }
+ inline void setDataSource(const TQString &ds) { KexiFormDataItemInterface::setDataSource(ds); }
+ inline void setDataSourceMimeType(const TQCString &ds) { KexiFormDataItemInterface::setDataSourceMimeType(ds); }
//! This implementation just disables read only widget
virtual void setReadOnly( bool readOnly );
//! @internal for sizeInternal property
- QSize sizeInternal() const { return KexiDBFormBase::size(); }
+ TQSize sizeInternal() const { return KexiDBFormBase::size(); }
//! @internal for sizeInternal property
- void resizeInternal(const QSize& s) { KexiDBFormBase::resize(s); }
+ void resizeInternal(const TQSize& s) { KexiDBFormBase::resize(s); }
signals:
- void handleDragMoveEvent(QDragMoveEvent *e);
- void handleDropEvent(QDropEvent *e);
+ void handleDragMoveEvent(TQDragMoveEvent *e);
+ void handleDropEvent(TQDropEvent *e);
protected:
//! no effect
- virtual void setValueInternal(const QVariant&, bool) {}
+ virtual void setValueInternal(const TQVariant&, bool) {}
//! Used to emit handleDragMoveEvent() signal needed to control dragging over the container's surface
- virtual void dragMoveEvent( QDragMoveEvent *e );
+ virtual void dragMoveEvent( TQDragMoveEvent *e );
//! Used to emit handleDropEvent() signal needed to control dropping on the container's surface
- virtual void dropEvent( QDropEvent *e );
+ virtual void dropEvent( TQDropEvent *e );
//! called from KexiFormScrollView::initDataContents()
void updateReadOnlyFlags();
-// virtual void paintEvent( QPaintEvent * );
+// virtual void paintEvent( TQPaintEvent * );
//! Points to a currently edited data item.
//! It is cleared when the focus is moved to other
diff --git a/kexi/plugins/forms/widgets/kexidbimagebox.cpp b/kexi/plugins/forms/widgets/kexidbimagebox.cpp
index 82e70086..5f2f20e3 100644
--- a/kexi/plugins/forms/widgets/kexidbimagebox.cpp
+++ b/kexi/plugins/forms/widgets/kexidbimagebox.cpp
@@ -20,15 +20,15 @@
#include "kexidbimagebox.h"
-#include <qapplication.h>
-#include <qpixmap.h>
-#include <qstyle.h>
-#include <qclipboard.h>
-#include <qtooltip.h>
-#include <qimage.h>
-#include <qbuffer.h>
-#include <qfiledialog.h>
-#include <qpainter.h>
+#include <tqapplication.h>
+#include <tqpixmap.h>
+#include <tqstyle.h>
+#include <tqclipboard.h>
+#include <tqtooltip.h>
+#include <tqimage.h>
+#include <tqbuffer.h>
+#include <tqfiledialog.h>
+#include <tqpainter.h>
#include <kdebug.h>
#include <kpopupmenu.h>
@@ -51,7 +51,7 @@
#include <kexidb/queryschema.h>
#include <formeditor/widgetlibrary.h>
-#ifdef Q_WS_WIN
+#ifdef TQ_WS_WIN
#include <win32_utils.h>
#include <krecentdirs.h>
#endif
@@ -59,15 +59,15 @@
#include "kexidbutils.h"
#include "../kexiformpart.h"
-static KStaticDeleter<QPixmap> KexiDBImageBox_pmDeleter;
-static QPixmap* KexiDBImageBox_pm = 0;
-static KStaticDeleter<QPixmap> KexiDBImageBox_pmSmallDeleter;
-static QPixmap* KexiDBImageBox_pmSmall = 0;
+static KStaticDeleter<TQPixmap> KexiDBImageBox_pmDeleter;
+static TQPixmap* KexiDBImageBox_pm = 0;
+static KStaticDeleter<TQPixmap> KexiDBImageBox_pmSmallDeleter;
+static TQPixmap* KexiDBImageBox_pmSmall = 0;
-KexiDBImageBox::KexiDBImageBox( bool designMode, QWidget *parent, const char *name )
- : KexiFrame( parent, name, Qt::WNoAutoErase )
+KexiDBImageBox::KexiDBImageBox( bool designMode, TQWidget *tqparent, const char *name )
+ : KexiFrame( tqparent, name, TQt::WNoAutoErase )
, KexiFormDataItemInterface()
- , m_alignment(Qt::AlignAuto|Qt::AlignTop)
+ , m_tqalignment(TQt::AlignAuto|TQt::AlignTop)
, m_designMode(designMode)
, m_readOnly(false)
, m_scaledContents(false)
@@ -80,7 +80,7 @@ KexiDBImageBox::KexiDBImageBox( bool designMode, QWidget *parent, const char *na
, m_insideSetPalette(false)
{
installEventFilter(this);
- setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Preferred);
+ tqsetSizePolicy(TQSizePolicy::Expanding, TQSizePolicy::Preferred);
//setup popup menu
m_popupMenu = new KexiImageContextMenu(this);
@@ -91,47 +91,47 @@ KexiDBImageBox::KexiDBImageBox( bool designMode, QWidget *parent, const char *na
}
else {
m_chooser = new KexiDropDownButton(this);
- m_chooser->setFocusPolicy(StrongFocus);
+ m_chooser->setFocusPolicy(TQ_StrongFocus);
m_chooser->setPopup(m_popupMenu);
setFocusProxy(m_chooser);
m_chooser->installEventFilter(this);
-// m_chooser->setPalette(qApp->palette());
+// m_chooser->setPalette(tqApp->palette());
// hlyr->addWidget(m_chooser);
}
- setBackgroundMode(Qt::NoBackground);
- setFrameShape(QFrame::Box);
- setFrameShadow(QFrame::Plain);
- setFrameColor(Qt::black);
+ setBackgroundMode(TQt::NoBackground);
+ setFrameShape(TQFrame::Box);
+ setFrameShadow(TQFrame::Plain);
+ setFrameColor(TQt::black);
m_paletteBackgroundColorChanged = false; //set this here, not before
- connect(m_popupMenu, SIGNAL(updateActionsAvailabilityRequested(bool&, bool&)),
- this, SLOT(slotUpdateActionsAvailabilityRequested(bool&, bool&)));
- connect(m_popupMenu, SIGNAL(insertFromFileRequested(const KURL&)),
- this, SLOT(handleInsertFromFileAction(const KURL&)));
- connect(m_popupMenu, SIGNAL(saveAsRequested(const QString&)),
- this, SLOT(handleSaveAsAction(const QString&)));
- connect(m_popupMenu, SIGNAL(cutRequested()),
- this, SLOT(handleCutAction()));
- connect(m_popupMenu, SIGNAL(copyRequested()),
- this, SLOT(handleCopyAction()));
- connect(m_popupMenu, SIGNAL(pasteRequested()),
- this, SLOT(handlePasteAction()));
- connect(m_popupMenu, SIGNAL(clearRequested()),
- this, SLOT(clear()));
- connect(m_popupMenu, SIGNAL(showPropertiesRequested()),
- this, SLOT(handleShowPropertiesAction()));
-
-// connect(m_popupMenu, SIGNAL(aboutToHide()), this, SLOT(slotAboutToHidePopupMenu()));
+ connect(m_popupMenu, TQT_SIGNAL(updateActionsAvailabilityRequested(bool&, bool&)),
+ this, TQT_SLOT(slotUpdateActionsAvailabilityRequested(bool&, bool&)));
+ connect(m_popupMenu, TQT_SIGNAL(insertFromFileRequested(const KURL&)),
+ this, TQT_SLOT(handleInsertFromFileAction(const KURL&)));
+ connect(m_popupMenu, TQT_SIGNAL(saveAsRequested(const TQString&)),
+ this, TQT_SLOT(handleSaveAsAction(const TQString&)));
+ connect(m_popupMenu, TQT_SIGNAL(cutRequested()),
+ this, TQT_SLOT(handleCutAction()));
+ connect(m_popupMenu, TQT_SIGNAL(copyRequested()),
+ this, TQT_SLOT(handleCopyAction()));
+ connect(m_popupMenu, TQT_SIGNAL(pasteRequested()),
+ this, TQT_SLOT(handlePasteAction()));
+ connect(m_popupMenu, TQT_SIGNAL(clearRequested()),
+ this, TQT_SLOT(clear()));
+ connect(m_popupMenu, TQT_SIGNAL(showPropertiesRequested()),
+ this, TQT_SLOT(handleShowPropertiesAction()));
+
+// connect(m_popupMenu, TQT_SIGNAL(aboutToHide()), this, TQT_SLOT(slotAboutToHidePopupMenu()));
// if (m_chooser) {
//we couldn't use m_chooser->setPopup() because of drawing problems
-// connect(m_chooser, SIGNAL(pressed()), this, SLOT(slotChooserPressed()));
-// connect(m_chooser, SIGNAL(released()), this, SLOT(slotChooserReleased()));
-// connect(m_chooser, SIGNAL(toggled(bool)), this, SLOT(slotToggled(bool)));
+// connect(m_chooser, TQT_SIGNAL(pressed()), this, TQT_SLOT(slotChooserPressed()));
+// connect(m_chooser, TQT_SIGNAL(released()), this, TQT_SLOT(slotChooserReleased()));
+// connect(m_chooser, TQT_SIGNAL(toggled(bool)), this, TQT_SLOT(slotToggled(bool)));
// }
- setDataSource( QString::null ); //to initialize popup menu and actions availability
+ setDataSource( TQString() ); //to initialize popup menu and actions availability
}
KexiDBImageBox::~KexiDBImageBox()
@@ -143,29 +143,29 @@ KexiImageContextMenu* KexiDBImageBox::contextMenu() const
return m_popupMenu;
}
-QVariant KexiDBImageBox::value()
+TQVariant KexiDBImageBox::value()
{
if (dataSource().isEmpty()) {
//not db-aware
- return QVariant();
+ return TQVariant();
}
//db-aware mode
return m_value; //todo
- //return QVariant(); //todo
+ //return TQVariant(); //todo
}
-void KexiDBImageBox::setValueInternal( const QVariant& add, bool removeOld, bool loadPixmap )
+void KexiDBImageBox::setValueInternal( const TQVariant& add, bool removeOld, bool loadPixmap )
{
if (isReadOnly())
return;
m_popupMenu->hide();
if (removeOld)
m_value = add.toByteArray();
- else //do not add "m_origValue" to "add" as this is QByteArray
+ else //do not add "m_origValue" to "add" as this is TQByteArray
m_value = m_origValue.toByteArray();
bool ok = !m_value.isEmpty();
if (ok) {
- ///unused (m_valueMimeType is not available unless the px is inserted) QString type( KImageIO::typeForMime(m_valueMimeType) );
+ ///unused (m_valueMimeType is not available unless the px is inserted) TQString type( KImageIO::typeForMime(m_valueMimeType) );
///ok = KImageIO::canRead( type );
ok = loadPixmap ? m_pixmap.loadFromData(m_value) : true; //, type.latin1());
if (!ok) {
@@ -173,22 +173,22 @@ void KexiDBImageBox::setValueInternal( const QVariant& add, bool removeOld, bool
}
}
if (!ok) {
- m_valueMimeType = QString::null;
- m_pixmap = QPixmap();
+ m_valueMimeType = TQString();
+ m_pixmap = TQPixmap();
}
- repaint();
+ tqrepaint();
}
-void KexiDBImageBox::setInvalidState( const QString& displayText )
+void KexiDBImageBox::setInvalidState( const TQString& displayText )
{
Q_UNUSED( displayText );
-// m_pixmapLabel->setPixmap(QPixmap());
+// m_pixmapLabel->setPixmap(TQPixmap());
if (!dataSource().isEmpty()) {
- m_value = QByteArray();
+ m_value = TQByteArray();
}
-// m_pixmap = QPixmap();
-// m_originalFileName = QString::null;
+// m_pixmap = TQPixmap();
+// m_originalFileName = TQString();
//! @todo m_pixmapLabel->setText( displayText );
@@ -218,7 +218,7 @@ void KexiDBImageBox::setReadOnly(bool set)
m_readOnly = set;
}
-QPixmap KexiDBImageBox::pixmap() const
+TQPixmap KexiDBImageBox::pixmap() const
{
if (dataSource().isEmpty()) {
//not db-aware
@@ -242,7 +242,7 @@ void KexiDBImageBox::setPixmapId(uint id)
if (m_insideSetData) //avoid recursion
return;
setData(KexiBLOBBuffer::self()->objectForId( id, /*unstored*/false ));
- repaint();
+ tqrepaint();
}
uint KexiDBImageBox::storedPixmapId() const
@@ -257,7 +257,7 @@ uint KexiDBImageBox::storedPixmapId() const
void KexiDBImageBox::setStoredPixmapId(uint id)
{
setData(KexiBLOBBuffer::self()->objectForId( id, /*stored*/true ));
- repaint();
+ tqrepaint();
}
bool KexiDBImageBox::hasScaledContents() const
@@ -266,27 +266,27 @@ bool KexiDBImageBox::hasScaledContents() const
// return m_pixmapLabel->hasScaledContents();
}
-/*void KexiDBImageBox::setPixmap(const QByteArray& pixmap)
+/*void KexiDBImageBox::setPixmap(const TQByteArray& pixmap)
{
setValueInternal(pixmap, true);
-// setBackgroundMode(pixmap.isNull() ? Qt::NoBackground : Qt::PaletteBackground);
+// setBackgroundMode(pixmap.isNull() ? TQt::NoBackground : TQt::PaletteBackground);
}*/
void KexiDBImageBox::setScaledContents(bool set)
{
//todo m_pixmapLabel->setScaledContents(set);
m_scaledContents = set;
- repaint();
+ tqrepaint();
}
void KexiDBImageBox::setKeepAspectRatio(bool set)
{
m_keepAspectRatio = set;
if (m_scaledContents)
- repaint();
+ tqrepaint();
}
-QWidget* KexiDBImageBox::widget()
+TQWidget* KexiDBImageBox::widget()
{
//! @todo
// return m_pixmapLabel;
@@ -303,7 +303,7 @@ bool KexiDBImageBox::cursorAtEnd()
return true;
}
-QByteArray KexiDBImageBox::data() const
+TQByteArray KexiDBImageBox::data() const
{
if (dataSource().isEmpty()) {
//static mode
@@ -331,19 +331,19 @@ void KexiDBImageBox::handleInsertFromFileAction(const KURL& url)
if (!h)
return;
setData(h);
- repaint();
+ tqrepaint();
}
else {
//db-aware
- QString fileName( url.isLocalFile() ? url.path() : url.prettyURL() );
+ TQString fileName( url.isLocalFile() ? url.path() : url.prettyURL() );
//! @todo download the file if remote, then set fileName properly
- QFile f(fileName);
+ TQFile f(fileName);
if (!f.open(IO_ReadOnly)) {
//! @todo err msg
return;
}
- QByteArray ba = f.readAll();
+ TQByteArray ba = f.readAll();
if (f.status()!=IO_Ok) {
//! @todo err msg
f.close();
@@ -359,7 +359,7 @@ void KexiDBImageBox::handleInsertFromFileAction(const KURL& url)
}
}
-void KexiDBImageBox::handleAboutToSaveAsAction(QString& origFilename, QString& fileExtension, bool& dataIsEmpty)
+void KexiDBImageBox::handleAboutToSaveAsAction(TQString& origFilename, TQString& fileExtension, bool& dataIsEmpty)
{
if (data().isEmpty()) {
kdWarning() << "KexiDBImageBox::handleAboutToSaveAs(): no pixmap!" << endl;
@@ -369,15 +369,15 @@ void KexiDBImageBox::handleAboutToSaveAsAction(QString& origFilename, QString& f
if (dataSource().isEmpty()) { //for static images filename and mimetype can be available
origFilename = m_data.originalFileName();
if (!origFilename.isEmpty())
- origFilename = QString("/") + origFilename;
+ origFilename = TQString("/") + origFilename;
if (!m_data.mimeType().isEmpty())
fileExtension = KImageIO::typeForMime(m_data.mimeType()).lower();
}
}
-void KexiDBImageBox::handleSaveAsAction(const QString& fileName)
+void KexiDBImageBox::handleSaveAsAction(const TQString& fileName)
{
- QFile f(fileName);
+ TQFile f(fileName);
if (!f.open(IO_WriteOnly)) {
//! @todo err msg
return;
@@ -401,14 +401,14 @@ void KexiDBImageBox::handleCutAction()
void KexiDBImageBox::handleCopyAction()
{
- qApp->clipboard()->setPixmap(pixmap(), QClipboard::Clipboard);
+ tqApp->tqclipboard()->setPixmap(pixmap(), TQClipboard::Clipboard);
}
void KexiDBImageBox::handlePasteAction()
{
if (isReadOnly() || (!m_designMode && !hasFocus()))
return;
- QPixmap pm( qApp->clipboard()->pixmap(QClipboard::Clipboard) );
+ TQPixmap pm( tqApp->tqclipboard()->pixmap(TQClipboard::Clipboard) );
// if (!pm.isNull())
// setValueInternal(pm, true);
if (dataSource().isEmpty()) {
@@ -418,18 +418,18 @@ void KexiDBImageBox::handlePasteAction()
else {
//db-aware mode
m_pixmap = pm;
- QByteArray ba;
- QBuffer buffer( ba );
+ TQByteArray ba;
+ TQBuffer buffer( ba );
buffer.open( IO_WriteOnly );
if (m_pixmap.save( &buffer, "PNG" )) {// write pixmap into ba in PNG format
setValueInternal( ba, true, false/* !loadPixmap */ );
}
else {
- setValueInternal( QByteArray(), true );
+ setValueInternal( TQByteArray(), true );
}
}
- repaint();
+ tqrepaint();
if (!dataSource().isEmpty()) {
// emit pixmapChanged();
signalValueChanged();
@@ -446,16 +446,16 @@ void KexiDBImageBox::clear()
if (isReadOnly())
return;
//db-aware mode
- setValueInternal(QByteArray(), true);
- //m_pixmap = QPixmap();
+ setValueInternal(TQByteArray(), true);
+ //m_pixmap = TQPixmap();
}
-// m_originalFileName = QString::null;
+// m_originalFileName = TQString();
//! @todo emit signal for setting "dirty" flag within the design
-// m_pixmap = QPixmap(); //will be loaded on demand
- repaint();
+// m_pixmap = TQPixmap(); //will be loaded on demand
+ tqrepaint();
if (!dataSource().isEmpty()) {
// emit pixmapChanged();//valueChanged(data());
signalValueChanged();
@@ -492,7 +492,7 @@ void KexiDBImageBox::slotAboutToHidePopupMenu()
}
}*/
-void KexiDBImageBox::contextMenuEvent( QContextMenuEvent * e )
+void KexiDBImageBox::contextMenuEvent( TQContextMenuEvent * e )
{
if (popupMenuAvailable())
m_popupMenu->exec( e->globalPos(), -1 );
@@ -519,20 +519,20 @@ void KexiDBImageBox::slotToggled(bool on)
return;
}
m_chooser->disableMousePress = false;
- QRect screen = qApp->desktop()->availableGeometry( m_chooser );
- QPoint p;
- if ( QApplication::reverseLayout() ) {
- if ( (mapToGlobal( m_chooser->rect().bottomLeft() ).y() + m_popupMenu->sizeHint().height()) <= screen.height() )
+ TQRect screen = tqApp->desktop()->availableGeometry( m_chooser );
+ TQPoint p;
+ if ( TQApplication::reverseLayout() ) {
+ if ( (mapToGlobal( m_chooser->rect().bottomLeft() ).y() + m_popupMenu->tqsizeHint().height()) <= screen.height() )
p = m_chooser->mapToGlobal( m_chooser->rect().bottomRight() );
else
- p = m_chooser->mapToGlobal( m_chooser->rect().topRight() - QPoint( 0, m_popupMenu->sizeHint().height() ) );
- p.rx() -= m_popupMenu->sizeHint().width();
+ p = m_chooser->mapToGlobal( m_chooser->rect().topRight() - TQPoint( 0, m_popupMenu->tqsizeHint().height() ) );
+ p.rx() -= m_popupMenu->tqsizeHint().width();
}
else {
- if ( (m_chooser->mapToGlobal( m_chooser->rect().bottomLeft() ).y() + m_popupMenu->sizeHint().height()) <= screen.height() )
+ if ( (m_chooser->mapToGlobal( m_chooser->rect().bottomLeft() ).y() + m_popupMenu->tqsizeHint().height()) <= screen.height() )
p = m_chooser->mapToGlobal( m_chooser->rect().bottomLeft() );
else
- p = m_chooser->mapToGlobal( m_chooser->rect().topLeft() - QPoint( 0, m_popupMenu->sizeHint().height() ) );
+ p = m_chooser->mapToGlobal( m_chooser->rect().topLeft() - TQPoint( 0, m_popupMenu->tqsizeHint().height() ) );
}
if (!m_popupMenu->isVisible() && on) {
m_popupMenu->exec( p, -1 );
@@ -546,7 +546,7 @@ void KexiDBImageBox::updateActionStrings()
if (!m_popupMenu)
return;
if (m_designMode) {
-/* QString titleString( i18n("Image Box") );
+/* TQString titleString( i18n("Image Box") );
if (!dataSource().isEmpty())
titleString.prepend(dataSource() + " : ");
m_popupMenu->changeTitle(m_popupMenu->idAt(0), m_popupMenu->titlePixmap(m_popupMenu->idAt(0)), titleString);*/
@@ -561,19 +561,19 @@ void KexiDBImageBox::updateActionStrings()
if (m_chooser) {
if (popupMenuAvailable() && dataSource().isEmpty()) { //this may work in the future (see @todo below)
- QToolTip::add(m_chooser, i18n("Click to show actions for this image box"));
+ TQToolTip::add(m_chooser, i18n("Click to show actions for this image box"));
} else {
- QString beautifiedImageBoxName;
+ TQString beautifiedImageBoxName;
if (m_designMode) {
beautifiedImageBoxName = dataSource();
}
else {
- beautifiedImageBoxName = columnInfo() ? columnInfo()->captionOrAliasOrName() : QString::null;
+ beautifiedImageBoxName = columnInfo() ? columnInfo()->captionOrAliasOrName() : TQString();
/*! @todo look at makeFirstCharacterUpperCaseInCaptions setting [bool]
(see doc/dev/settings.txt) */
beautifiedImageBoxName = beautifiedImageBoxName[0].upper() + beautifiedImageBoxName.mid(1);
}
- QToolTip::add(m_chooser, i18n("Click to show actions for \"%1\" image box").arg(beautifiedImageBoxName));
+ TQToolTip::add(m_chooser, i18n("Click to show actions for \"%1\" image box").tqarg(beautifiedImageBoxName));
}
}
}
@@ -586,7 +586,7 @@ bool KexiDBImageBox::popupMenuAvailable()
return !dataSource().isEmpty();
}
-void KexiDBImageBox::setDataSource( const QString &ds )
+void KexiDBImageBox::setDataSource( const TQString &ds )
{
KexiFormDataItemInterface::setDataSource( ds );
setData(KexiBLOBBuffer::Handle());
@@ -608,96 +608,96 @@ void KexiDBImageBox::setDataSource( const QString &ds )
if (!m_lineWidthChanged) {
KexiFrame::setLineWidth( ds.isEmpty() ? 0 : 1 );
}
- if (!m_paletteBackgroundColorChanged && parentWidget()) {
+ if (!m_paletteBackgroundColorChanged && tqparentWidget()) {
KexiFrame::setPaletteBackgroundColor(
- dataSource().isEmpty() ? parentWidget()->paletteBackgroundColor() : palette().active().base() );
+ dataSource().isEmpty() ? tqparentWidget()->paletteBackgroundColor() : tqpalette().active().base() );
}
}
-QSize KexiDBImageBox::sizeHint() const
+TQSize KexiDBImageBox::tqsizeHint() const
{
if (pixmap().isNull())
- return QSize(80, 80);
+ return TQSize(80, 80);
return pixmap().size();
}
int KexiDBImageBox::realLineWidth() const
{
- if (frameShape()==QFrame::Box && (frameShadow()==QFrame::Sunken || frameShadow()==QFrame::Raised))
+ if (frameShape()==TQFrame::Box && (frameShadow()==TQFrame::Sunken || frameShadow()==TQFrame::Raised))
return 2 * lineWidth();
else
return lineWidth();
}
-void KexiDBImageBox::paintEvent( QPaintEvent *pe )
+void KexiDBImageBox::paintEvent( TQPaintEvent *pe )
{
if (!m_paintEventEnabled)
return;
- QPainter p(this);
+ TQPainter p(this);
p.setClipRect(pe->rect());
const int m = realLineWidth() + margin();
- QColor bg(eraseColor());
+ TQColor bg(eraseColor());
if (m_designMode && pixmap().isNull()) {
- QPixmap pm(size()-QSize(m, m));
- QPainter p2;
- p2.begin(&pm, this);
+ TQPixmap pm(size()-TQSize(m, m));
+ TQPainter p2;
+ p2.tqbegin(TQT_TQPAINTDEVICE(&pm), this);
p2.fillRect(0,0,width(),height(), bg);
updatePixmap();
- QPixmap *imagBoxPm;
+ TQPixmap *imagBoxPm;
const bool tooLarge = (height()-m-m) <= KexiDBImageBox_pm->height();
if (tooLarge || (width()-m-m) <= KexiDBImageBox_pm->width())
imagBoxPm = KexiDBImageBox_pmSmall;
else
imagBoxPm = KexiDBImageBox_pm;
- QImage img(imagBoxPm->convertToImage());
+ TQImage img(imagBoxPm->convertToImage());
img = KImageEffect::flatten(img, bg.dark(150),
- qGray( bg.rgb() ) <= 20 ? QColor(Qt::gray).dark(150) : bg.light(105));
+ tqGray( bg.rgb() ) <= 20 ? TQColor(TQt::gray).dark(150) : bg.light(105));
- QPixmap converted;
+ TQPixmap converted;
converted.convertFromImage(img);
// if (tooLarge)
// p2.drawPixmap(2, 2, converted);
// else
p2.drawPixmap(2, height()-m-m-imagBoxPm->height()-2, converted);
- QFont f(qApp->font());
+ TQFont f(tqApp->font());
p2.setFont(f);
p2.setPen( KexiUtils::contrastColor( bg ) );
- p2.drawText(pm.rect(), Qt::AlignCenter,
+ p2.drawText(pm.rect(), TQt::AlignCenter,
dataSource().isEmpty()
- ? QString::fromLatin1(name())+"\n"+i18n("Unbound Image Box", "(unbound)") //i18n("No Image")
+ ? TQString::tqfromLatin1(name())+"\n"+i18n("Unbound Image Box", "(unbound)") //i18n("No Image")
: dataSource());
p2.end();
bitBlt(this, m, m, &pm);
}
else {
- QSize internalSize(size());
+ TQSize internalSize(size());
if (m_chooser && m_dropDownButtonVisible && !dataSource().isEmpty())
internalSize.setWidth( internalSize.width() - m_chooser->width() );
//clearing needed here because we may need to draw a pixmap with transparency
p.fillRect(0,0,width(),height(), bg);
- KexiUtils::drawPixmap( p, m, QRect(QPoint(0,0), internalSize), pixmap(), m_alignment,
+ KexiUtils::drawPixmap( p, m, TQRect(TQPoint(0,0), internalSize), pixmap(), m_tqalignment,
m_scaledContents, m_keepAspectRatio );
}
KexiFrame::drawFrame( &p );
// if the widget is focused, draw focus indicator rect _if_ there is no chooser button
if (!m_designMode && !dataSource().isEmpty() && hasFocus() && (!m_chooser || !m_chooser->isVisible())) {
- style().drawPrimitive(
- QStyle::PE_FocusRect, &p, style().subRect(QStyle::SR_PushButtonContents, this),
- palette().active() );
+ tqstyle().tqdrawPrimitive(
+ TQStyle::PE_FocusRect, &p, tqstyle().subRect(TQStyle::SR_PushButtonContents, this),
+ tqpalette().active() );
}
}
-/* virtual void KexiDBImageBox::paletteChange ( const QPalette & oldPalette )
+/* virtual void KexiDBImageBox::paletteChange ( const TQPalette & oldPalette )
{
- QFrame::paletteChange(oldPalette);
+ TQFrame::paletteChange(oldPalette);
if (oldPalette.active().background()!=palette().active().background()) {
delete KexiDBImageBox_pm;
KexiDBImageBox_pm = 0;
- repaint();
+ tqrepaint();
}
}*/
@@ -707,19 +707,19 @@ void KexiDBImageBox::updatePixmap()
return;
if (!KexiDBImageBox_pm) {
- QString fname( locate("data", QString("kexi/pics/imagebox.png")) );
- KexiDBImageBox_pmDeleter.setObject( KexiDBImageBox_pm, new QPixmap(fname, "PNG") );
- QImage img(KexiDBImageBox_pm->convertToImage());
+ TQString fname( locate("data", TQString("kexi/pics/imagebox.png")) );
+ KexiDBImageBox_pmDeleter.setObject( KexiDBImageBox_pm, new TQPixmap(fname, "PNG") );
+ TQImage img(KexiDBImageBox_pm->convertToImage());
KexiDBImageBox_pmSmallDeleter.setObject( KexiDBImageBox_pmSmall,
- new QPixmap( img.smoothScale(img.width()/2, img.height()/2, QImage::ScaleMin) ) );
+ new TQPixmap( img.smoothScale(img.width()/2, img.height()/2, TQ_ScaleMin) ) );
}
}
-void KexiDBImageBox::setAlignment(int alignment)
+void KexiDBImageBox::tqsetAlignment(int tqalignment)
{
- m_alignment = alignment;
+ m_tqalignment = tqalignment;
if (!m_scaledContents || m_keepAspectRatio)
- repaint();
+ tqrepaint();
}
void KexiDBImageBox::setData(const KexiBLOBBuffer::Handle& handle)
@@ -733,23 +733,23 @@ void KexiDBImageBox::setData(const KexiBLOBBuffer::Handle& handle)
update();
}
-void KexiDBImageBox::resizeEvent( QResizeEvent * e )
+void KexiDBImageBox::resizeEvent( TQResizeEvent * e )
{
KexiFrame::resizeEvent(e);
if (m_chooser) {
- QSize s( m_chooser->sizeHint() );
- QSize margin( realLineWidth(), realLineWidth() );
+ TQSize s( m_chooser->tqsizeHint() );
+ TQSize margin( realLineWidth(), realLineWidth() );
s.setHeight( height() - 2*margin.height() );
s = s.boundedTo( size()-2*margin );
m_chooser->resize( s );
- m_chooser->move( QRect(QPoint(0,0), e->size() - m_chooser->size() - margin + QSize(1,1)).bottomRight() );
+ m_chooser->move( TQRect(TQPoint(0,0), e->size() - m_chooser->size() - margin + TQSize(1,1)).bottomRight() );
}
}
/*
-bool KexiDBImageBox::setProperty( const char * name, const QVariant & value )
+bool KexiDBImageBox::setProperty( const char * name, const TQVariant & value )
{
- const bool ret = QLabel::setProperty(name, value);
+ const bool ret = TQLabel::setProperty(name, value);
if (p_shadowEnabled) {
if (0==qstrcmp("indent", name) || 0==qstrcmp("font", name) || 0==qstrcmp("margin", name)
|| 0==qstrcmp("frameShadow", name) || 0==qstrcmp("frameShape", name)
@@ -770,16 +770,16 @@ void KexiDBImageBox::setColumnInfo(KexiDB::QueryColumnInfo* cinfo)
updateActionStrings();
}
-bool KexiDBImageBox::keyPressed(QKeyEvent *ke)
+bool KexiDBImageBox::keyPressed(TQKeyEvent *ke)
{
// Esc key should close the popup
- if (ke->state() == Qt::NoButton && ke->key() == Qt::Key_Escape) {
+ if (ke->state() == Qt::NoButton && ke->key() == TQt::Key_Escape) {
if (m_popupMenu->isVisible()) {
m_setFocusOnButtonAfterClosingPopup = true;
return true;
}
}
-// else if (ke->state() == Qt::ControlButton && KStdAccel::shortcut(KStdAccel::Copy).keyCodeQt() == (ke->key()|Qt::CTRL)) {
+// else if (ke->state() == TQt::ControlButton && KStdAccel::shortcut(KStdAccel::Copy).keyCodeTQt() == (ke->key()|TQt::CTRL)) {
// }
return false;
}
@@ -790,7 +790,7 @@ void KexiDBImageBox::setLineWidth( int width )
KexiFrame::setLineWidth(width);
}
-void KexiDBImageBox::setPalette( const QPalette &pal )
+void KexiDBImageBox::setPalette( const TQPalette &pal )
{
KexiFrame::setPalette(pal);
if (m_insideSetPalette)
@@ -801,13 +801,13 @@ void KexiDBImageBox::setPalette( const QPalette &pal )
m_insideSetPalette = false;
}
-void KexiDBImageBox::setPaletteBackgroundColor( const QColor & color )
+void KexiDBImageBox::setPaletteBackgroundColor( const TQColor & color )
{
- kexipluginsdbg << "KexiDBImageBox::setPaletteBackgroundColor(): " << color.name() << endl;
+ kexipluginsdbg << "KexiDBImageBox::setPaletteBackgroundColor(): " << TQString(color.name()) << endl;
m_paletteBackgroundColorChanged = true;
KexiFrame::setPaletteBackgroundColor(color);
if (m_chooser)
- m_chooser->setPalette( qApp->palette() );
+ m_chooser->setPalette( tqApp->palette() );
}
bool KexiDBImageBox::dropDownButtonVisible() const
@@ -835,33 +835,33 @@ bool KexiDBImageBox::subwidgetStretchRequired(KexiDBAutoField* autoField) const
return true;
}
-bool KexiDBImageBox::eventFilter( QObject * watched, QEvent * e )
+bool KexiDBImageBox::eventFilter( TQObject * watched, TQEvent * e )
{
- if (watched==this || watched==m_chooser) { //we're watching chooser as well because it's a focus proxy even if invisible
- if (e->type()==QEvent::FocusIn || e->type()==QEvent::FocusOut || e->type()==QEvent::MouseButtonPress) {
- update(); //to repaint focus rect
+ if (TQT_BASE_OBJECT(watched)==TQT_BASE_OBJECT(this) || TQT_BASE_OBJECT(watched)==TQT_BASE_OBJECT(m_chooser)) { //we're watching chooser as well because it's a focus proxy even if invisible
+ if (e->type()==TQEvent::FocusIn || e->type()==TQEvent::FocusOut || e->type()==TQEvent::MouseButtonPress) {
+ update(); //to tqrepaint focus rect
}
}
// hide popup menu as soon as it loses focus
- if (watched==m_popupMenu && e->type()==QEvent::FocusOut) {
+ if (TQT_BASE_OBJECT(watched)==TQT_BASE_OBJECT(m_popupMenu) && e->type()==TQEvent::FocusOut) {
m_popupMenu->hide();
}
return KexiFrame::eventFilter(watched, e);
}
-QWidget::FocusPolicy KexiDBImageBox::focusPolicy() const
+TQ_FocusPolicy KexiDBImageBox::focusPolicy() const
{
if (dataSource().isEmpty())
- return NoFocus;
+ return TQ_NoFocus;
return m_focusPolicyInternal;
}
-QWidget::FocusPolicy KexiDBImageBox::focusPolicyInternal() const
+TQ_FocusPolicy KexiDBImageBox::focusPolicyInternal() const
{
return m_focusPolicyInternal;
}
-void KexiDBImageBox::setFocusPolicy( FocusPolicy policy )
+void KexiDBImageBox::setFocusPolicy( TQ_FocusPolicy policy )
{
m_focusPolicyInternal = policy;
KexiFrame::setFocusPolicy( focusPolicy() ); //set modified policy
diff --git a/kexi/plugins/forms/widgets/kexidbimagebox.h b/kexi/plugins/forms/widgets/kexidbimagebox.h
index 3ad2f710..85b54cd5 100644
--- a/kexi/plugins/forms/widgets/kexidbimagebox.h
+++ b/kexi/plugins/forms/widgets/kexidbimagebox.h
@@ -38,46 +38,47 @@ class KEXIFORMUTILS_EXPORT KexiDBImageBox :
public KexiSubwidgetInterface
{
Q_OBJECT
- Q_PROPERTY( QString dataSource READ dataSource WRITE setDataSource )
- Q_PROPERTY( QCString dataSourceMimeType READ dataSourceMimeType WRITE setDataSourceMimeType )
- Q_PROPERTY( bool readOnly READ isReadOnly WRITE setReadOnly )
-// Q_PROPERTY( QPixmap pixmap READ pixmap WRITE setPixmap )
-// Q_PROPERTY( QByteArray pixmapData READ pixmapData WRITE setPixmapData )
- Q_PROPERTY( uint pixmapId READ pixmapId WRITE setPixmapId DESIGNABLE true STORED false )
- Q_PROPERTY( uint storedPixmapId READ storedPixmapId WRITE setStoredPixmapId DESIGNABLE false STORED true )
- Q_PROPERTY( bool scaledContents READ hasScaledContents WRITE setScaledContents )
- Q_PROPERTY( bool keepAspectRatio READ keepAspectRatio WRITE setKeepAspectRatio )
- Q_PROPERTY( Alignment alignment READ alignment WRITE setAlignment )
-// Q_PROPERTY( QString originalFileName READ originalFileName WRITE setOriginalFileName DESIGNABLE false )
-// Q_OVERRIDE( FocusPolicy focusPolicy READ focusPolicy WRITE setFocusPolicy )
- Q_PROPERTY( bool dropDownButtonVisible READ dropDownButtonVisible WRITE setDropDownButtonVisible )
- Q_OVERRIDE( int lineWidth READ lineWidth WRITE setLineWidth )
- Q_OVERRIDE( FocusPolicy focusPolicy READ focusPolicyInternal WRITE setFocusPolicy )
+ TQ_OBJECT
+ TQ_PROPERTY( TQString dataSource READ dataSource WRITE setDataSource )
+ TQ_PROPERTY( TQCString dataSourceMimeType READ dataSourceMimeType WRITE setDataSourceMimeType )
+ TQ_PROPERTY( bool readOnly READ isReadOnly WRITE setReadOnly )
+// TQ_PROPERTY( TQPixmap pixmap READ pixmap WRITE setPixmap )
+// TQ_PROPERTY( TQByteArray pixmapData READ pixmapData WRITE setPixmapData )
+ TQ_PROPERTY( uint pixmapId READ pixmapId WRITE setPixmapId DESIGNABLE true STORED false )
+ TQ_PROPERTY( uint storedPixmapId READ storedPixmapId WRITE setStoredPixmapId DESIGNABLE false STORED true )
+ TQ_PROPERTY( bool scaledContents READ hasScaledContents WRITE setScaledContents )
+ TQ_PROPERTY( bool keepAspectRatio READ keepAspectRatio WRITE setKeepAspectRatio )
+ TQ_PROPERTY( int tqalignment READ tqalignment WRITE tqsetAlignment )
+// TQ_PROPERTY( TQString originalFileName READ originalFileName WRITE setOriginalFileName DESIGNABLE false )
+// TQ_OVERRIDE( FocusPolicy focusPolicy READ focusPolicy WRITE setFocusPolicy )
+ TQ_PROPERTY( bool dropDownButtonVisible READ dropDownButtonVisible WRITE setDropDownButtonVisible )
+ TQ_OVERRIDE( int lineWidth READ lineWidth WRITE setLineWidth )
+ TQ_OVERRIDE( FocusPolicy focusPolicy READ focusPolicyInternal WRITE setFocusPolicy )
public:
- KexiDBImageBox( bool designMode, QWidget *parent, const char *name = 0 );
+ KexiDBImageBox( bool designMode, TQWidget *tqparent, const char *name = 0 );
virtual ~KexiDBImageBox();
- inline QString dataSource() const { return KexiFormDataItemInterface::dataSource(); }
- inline QCString dataSourceMimeType() const { return KexiFormDataItemInterface::dataSourceMimeType(); }
+ inline TQString dataSource() const { return KexiFormDataItemInterface::dataSource(); }
+ inline TQCString dataSourceMimeType() const { return KexiFormDataItemInterface::dataSourceMimeType(); }
- virtual QVariant value(); // { return m_value.data(); }
+ virtual TQVariant value(); // { return m_value.data(); }
-// QByteArray pixmapData() const { return m_value.data(); }
+// TQByteArray pixmapData() const { return m_value.data(); }
- QPixmap pixmap() const;
+ TQPixmap pixmap() const;
uint pixmapId() const;
uint storedPixmapId() const;
//
- virtual void setInvalidState( const QString& displayText );
+ virtual void setInvalidState( const TQString& displayText );
virtual bool valueIsNull();
virtual bool valueIsEmpty();
- virtual QWidget* widget();
+ virtual TQWidget* widget();
//! always true
virtual bool cursorAtStart();
@@ -86,7 +87,7 @@ class KEXIFORMUTILS_EXPORT KexiDBImageBox :
virtual bool cursorAtEnd();
// //! used to catch setIndent(), etc.
-// virtual bool setProperty ( const char * name, const QVariant & value );
+// virtual bool setProperty ( const char * name, const TQVariant & value );
virtual bool isReadOnly() const;
@@ -94,28 +95,28 @@ class KEXIFORMUTILS_EXPORT KexiDBImageBox :
// bool designMode() const { return m_designMode; }
- int alignment() const { return m_alignment; }
+ int tqalignment() const { return m_tqalignment; }
bool keepAspectRatio() const { return m_keepAspectRatio; }
- virtual QSize sizeHint() const;
+ virtual TQSize tqsizeHint() const;
KexiImageContextMenu *contextMenu() const;
/*! \return original file name of image loaded from a file.
This can be later reused for displaying the image within a collection (to be implemented)
or on saving the image data back to file. */
-//todo QString originalFileName() const { return m_value.originalFileName(); }
+//todo TQString originalFileName() const { return m_value.originalFileName(); }
//! Reimplemented to override behaviour of "lineWidth" property.
virtual void setLineWidth( int width );
//! Reimplemented to override behaviour of "paletteBackgroundColor"
//! and "paletteForegroundColor" properties.
- virtual void setPalette( const QPalette &pal );
+ virtual void setPalette( const TQPalette &pal );
//! Reimplemented to override behaviour of "paletteBackgroundColor" property.
- virtual void setPaletteBackgroundColor( const QColor & color );
+ virtual void setPaletteBackgroundColor( const TQColor & color );
//! \return true id drop down button should be visible (the default).
bool dropDownButtonVisible() const;
@@ -126,14 +127,14 @@ class KEXIFORMUTILS_EXPORT KexiDBImageBox :
/*! Overriden to change the policy behaviour a bit:
NoFocus is returned regardless the real focus flag
if the data source is empty (see dataSource()). */
- FocusPolicy focusPolicy() const;
+ TQ_FocusPolicy focusPolicy() const;
//! \return the internal focus policy value, i.e. the one unrelated to data source presence.
- FocusPolicy focusPolicyInternal() const;
+ TQ_FocusPolicy focusPolicyInternal() const;
/*! Sets the internal focus policy value.
"Internal" means that if there is no data source set, real policy becomes NoFocus. */
- virtual void setFocusPolicy( FocusPolicy policy );
+ virtual void setFocusPolicy( TQ_FocusPolicy policy );
public slots:
void setPixmapId(uint id);
@@ -141,23 +142,23 @@ class KEXIFORMUTILS_EXPORT KexiDBImageBox :
void setStoredPixmapId(uint id);
//! Sets the datasource to \a ds
- virtual void setDataSource( const QString &ds );
+ virtual void setDataSource( const TQString &ds );
- inline void setDataSourceMimeType(const QCString &ds) { KexiFormDataItemInterface::setDataSourceMimeType(ds); }
+ inline void setDataSourceMimeType(const TQCString &ds) { KexiFormDataItemInterface::setDataSourceMimeType(ds); }
virtual void setReadOnly(bool set);
//! Sets \a pixmapData data for this widget. If the widget has data source set,
//! the pixmap will be also placed inside of the buffer and saved later.
-//todo void setPixmapData(const QByteArray& pixmapData) { m_value.setData(pixmapData); }
+//todo void setPixmapData(const TQByteArray& pixmapData) { m_value.setData(pixmapData); }
/*! Sets original file name of image loaded from a file.
@see originalFileName() */
-//todo void setOriginalFileName(const QString& name) { m_value.setOriginalFileName(name); }
+//todo void setOriginalFileName(const TQString& name) { m_value.setOriginalFileName(name); }
void setScaledContents(bool set);
- void setAlignment(int alignment);
+ void tqsetAlignment(int tqalignment);
void setKeepAspectRatio(bool set);
@@ -176,7 +177,7 @@ class KEXIFORMUTILS_EXPORT KexiDBImageBox :
//! Used for db-aware mode. Emitted when value has been changed.
//! Actual value can be obtained using value().
// virtual void pixmapChanged();
-// virtual void valueChanged(const QByteArray& data);
+// virtual void valueChanged(const TQByteArray& data);
void idChanged(long id);
@@ -184,8 +185,8 @@ class KEXIFORMUTILS_EXPORT KexiDBImageBox :
void slotUpdateActionsAvailabilityRequested(bool& valueIsNull, bool& valueIsReadOnly);
void handleInsertFromFileAction(const KURL& url);
- void handleAboutToSaveAsAction(QString& origFilename, QString& fileExtension, bool& dataIsEmpty);
- void handleSaveAsAction(const QString& fileName);
+ void handleAboutToSaveAsAction(TQString& origFilename, TQString& fileExtension, bool& dataIsEmpty);
+ void handleSaveAsAction(const TQString& fileName);
void handleCutAction();
void handleCopyAction();
void handlePasteAction();
@@ -194,22 +195,22 @@ class KEXIFORMUTILS_EXPORT KexiDBImageBox :
protected:
//! \return data depending on the current mode (db-aware or static)
- QByteArray data() const;
+ TQByteArray data() const;
- virtual void contextMenuEvent ( QContextMenuEvent * e );
-// virtual void mousePressEvent( QMouseEvent *e );
+ virtual void contextMenuEvent ( TQContextMenuEvent * e );
+// virtual void mousePressEvent( TQMouseEvent *e );
virtual void setColumnInfo(KexiDB::QueryColumnInfo* cinfo);
- virtual void paintEvent( QPaintEvent* );
- virtual void resizeEvent( QResizeEvent* e );
- virtual bool eventFilter( QObject * watched, QEvent * e );
+ virtual void paintEvent( TQPaintEvent* );
+ virtual void resizeEvent( TQResizeEvent* e );
+ virtual bool eventFilter( TQObject * watched, TQEvent * e );
//! Sets value \a value for a widget.
- virtual void setValueInternal( const QVariant& add, bool removeOld ) {
+ virtual void setValueInternal( const TQVariant& add, bool removeOld ) {
setValueInternal( add, removeOld, true /*loadPixmap*/ );
}
//! @internal, added \a loadPixmap option used by paste().
- void setValueInternal( const QVariant& add, bool removeOld, bool loadPixmap );
+ void setValueInternal( const TQVariant& add, bool removeOld, bool loadPixmap );
//! Updates i18n'd action strings after datasource change
void updateActionStrings();
@@ -223,7 +224,7 @@ class KEXIFORMUTILS_EXPORT KexiDBImageBox :
/*! Called by top-level form on key press event.
Used for Key_Escape to if the popup is visible,
so the key press won't be consumed to perform "cancel editing". */
- virtual bool keyPressed(QKeyEvent *ke);
+ virtual bool keyPressed(TQKeyEvent *ke);
//! \return real line width, i.e. for Boxed sunken or Boxed raised
//! frames returns doubled width value.
@@ -232,33 +233,33 @@ class KEXIFORMUTILS_EXPORT KexiDBImageBox :
//! Implemented for KexiSubwidgetInterface
virtual bool subwidgetStretchRequired(KexiDBAutoField* autoField) const;
-// virtual void drawContents ( QPainter *p );
+// virtual void drawContents ( TQPainter *p );
-// virtual void fontChange( const QFont& font );
-// virtual void styleChange( QStyle& style );
+// virtual void fontChange( const TQFont& font );
+// virtual void styleChange( TQStyle& style );
// virtual void enabledChange( bool enabled );
-// virtual void paletteChange( const QPalette& pal );
+// virtual void paletteChange( const TQPalette& pal );
// virtual void frameChanged();
-// virtual void showEvent( QShowEvent* e );
+// virtual void showEvent( TQShowEvent* e );
// void updatePixmapLater();
// class ImageLabel;
// ImageLabel *m_pixmapLabel;
- QPixmap m_pixmap;
- QByteArray m_value; //!< for db-aware mode
- QString m_valueMimeType; //!< for db-aware mode
+ TQPixmap m_pixmap;
+ TQByteArray m_value; //!< for db-aware mode
+ TQString m_valueMimeType; //!< for db-aware mode
// PixmapData m_value;
KexiBLOBBuffer::Handle m_data;
-// QString m_originalFileName;
+// TQString m_originalFileName;
KexiDropDownButton *m_chooser;
KexiImageContextMenu *m_popupMenu;
//moved KActionCollection m_actionCollection;
//moved KAction *m_insertFromFileAction, *m_saveAsAction, *m_cutAction, *m_copyAction, *m_pasteAction,
// *m_deleteAction, *m_propertiesAction;
-// QTimer m_clickTimer;
- int m_alignment;
- FocusPolicy m_focusPolicyInternal; //!< Used for focusPolicyInternal()
+// TQTimer m_clickTimer;
+ int m_tqalignment;
+ TQ_FocusPolicy m_focusPolicyInternal; //!< Used for focusPolicyInternal()
bool m_designMode : 1;
bool m_readOnly : 1;
bool m_scaledContents : 1;
diff --git a/kexi/plugins/forms/widgets/kexidbintspinbox.cpp b/kexi/plugins/forms/widgets/kexidbintspinbox.cpp
index ac923347..7d5ae6ee 100644
--- a/kexi/plugins/forms/widgets/kexidbintspinbox.cpp
+++ b/kexi/plugins/forms/widgets/kexidbintspinbox.cpp
@@ -20,27 +20,27 @@
#include "kexidbintspinbox.h"
-#include <qlineedit.h>
+#include <tqlineedit.h>
#include <knumvalidator.h>
-KexiDBIntSpinBox::KexiDBIntSpinBox(QWidget *parent, const char *name)
- : KIntSpinBox(parent, name) , KexiFormDataItemInterface()
+KexiDBIntSpinBox::KexiDBIntSpinBox(TQWidget *tqparent, const char *name)
+ : KIntSpinBox(tqparent, name) , KexiFormDataItemInterface()
{
- connect(this, SIGNAL(valueChanged(int)), this, SLOT(slotValueChanged()));
+ connect(this, TQT_SIGNAL(valueChanged(int)), this, TQT_SLOT(slotValueChanged()));
}
KexiDBIntSpinBox::~KexiDBIntSpinBox()
{
}
-void KexiDBIntSpinBox::setInvalidState( const QString& displayText )
+void KexiDBIntSpinBox::setInvalidState( const TQString& displayText )
{
m_invalidState = true;
setEnabled(false);
setReadOnly(true);
//! @todo move this to KexiDataItemInterface::setInvalidStateInternal() ?
if (focusPolicy() & TabFocus)
- setFocusPolicy(QWidget::ClickFocus);
+ setFocusPolicy(TQ_ClickFocus);
setSpecialValueText(displayText);
KIntSpinBox::setValue(minValue());
}
@@ -54,12 +54,12 @@ KexiDBIntSpinBox::setEnabled(bool enabled)
KIntSpinBox::setEnabled(enabled);
}
-void KexiDBIntSpinBox::setValueInternal(const QVariant&, bool)
+void KexiDBIntSpinBox::setValueInternal(const TQVariant&, bool)
{
KIntSpinBox::setValue(m_origValue.toInt());
}
-QVariant
+TQVariant
KexiDBIntSpinBox::value()
{
return KIntSpinBox::value();
@@ -90,7 +90,7 @@ void KexiDBIntSpinBox::setReadOnly(bool set)
editor()->setReadOnly(set);
}
-QWidget*
+TQWidget*
KexiDBIntSpinBox::widget()
{
return this;
diff --git a/kexi/plugins/forms/widgets/kexidbintspinbox.h b/kexi/plugins/forms/widgets/kexidbintspinbox.h
index cddc614e..9827cd5f 100644
--- a/kexi/plugins/forms/widgets/kexidbintspinbox.h
+++ b/kexi/plugins/forms/widgets/kexidbintspinbox.h
@@ -22,25 +22,26 @@
#define KexiDBIntSpinBox_H
#include "kexiformdataiteminterface.h"
-#include <qwidget.h>
+#include <tqwidget.h>
#include <knuminput.h>
//! @short A db-aware int spin box
class KEXIFORMUTILS_EXPORT KexiDBIntSpinBox : public KIntSpinBox, public KexiFormDataItemInterface
{
Q_OBJECT
- Q_PROPERTY(QString dataSource READ dataSource WRITE setDataSource DESIGNABLE true)
- Q_PROPERTY(QCString dataSourceMimeType READ dataSourceMimeType WRITE setDataSourceMimeType DESIGNABLE true)
- Q_PROPERTY( bool readOnly READ isReadOnly WRITE setReadOnly DESIGNABLE true )
+ TQ_OBJECT
+ TQ_PROPERTY(TQString dataSource READ dataSource WRITE setDataSource DESIGNABLE true)
+ TQ_PROPERTY(TQCString dataSourceMimeType READ dataSourceMimeType WRITE setDataSourceMimeType DESIGNABLE true)
+ TQ_PROPERTY( bool readOnly READ isReadOnly WRITE setReadOnly DESIGNABLE true )
public:
- KexiDBIntSpinBox(QWidget *parent, const char *name=0);
+ KexiDBIntSpinBox(TQWidget *tqparent, const char *name=0);
virtual ~KexiDBIntSpinBox();
- inline QString dataSource() const { return KexiFormDataItemInterface::dataSource(); }
- inline QCString dataSourceMimeType() const { return KexiFormDataItemInterface::dataSourceMimeType(); }
- virtual QVariant value();
- virtual void setInvalidState( const QString& displayText );
+ inline TQString dataSource() const { return KexiFormDataItemInterface::dataSource(); }
+ inline TQCString dataSourceMimeType() const { return KexiFormDataItemInterface::dataSourceMimeType(); }
+ virtual TQVariant value();
+ virtual void setInvalidState( const TQString& displayText );
//! \return true if editor's value is null (not empty)
//! Used for checking if a given constraint within table of form is met.
@@ -56,7 +57,7 @@ class KEXIFORMUTILS_EXPORT KexiDBIntSpinBox : public KIntSpinBox, public KexiFor
virtual bool isReadOnly() const;
/*! \return the view widget of this item, e.g. line edit widget. */
- virtual QWidget* widget();
+ virtual TQWidget* widget();
virtual bool cursorAtStart();
virtual bool cursorAtEnd();
@@ -65,13 +66,13 @@ class KEXIFORMUTILS_EXPORT KexiDBIntSpinBox : public KIntSpinBox, public KexiFor
virtual void setEnabled(bool enabled);
public slots:
- inline void setDataSource(const QString &ds) { KexiFormDataItemInterface::setDataSource(ds); }
- inline void setDataSourceMimeType(const QCString &ds) { KexiFormDataItemInterface::setDataSourceMimeType(ds); }
+ inline void setDataSource(const TQString &ds) { KexiFormDataItemInterface::setDataSource(ds); }
+ inline void setDataSourceMimeType(const TQCString &ds) { KexiFormDataItemInterface::setDataSourceMimeType(ds); }
void slotValueChanged();
virtual void setReadOnly(bool set);
protected:
- virtual void setValueInternal(const QVariant& add, bool removeOld);
+ virtual void setValueInternal(const TQVariant& add, bool removeOld);
private:
bool m_invalidState : 1;
diff --git a/kexi/plugins/forms/widgets/kexidblabel.cpp b/kexi/plugins/forms/widgets/kexidblabel.cpp
index e30cc19e..db946141 100644
--- a/kexi/plugins/forms/widgets/kexidblabel.cpp
+++ b/kexi/plugins/forms/widgets/kexidblabel.cpp
@@ -20,11 +20,11 @@
#include "kexidblabel.h"
-#include <qbitmap.h>
-#include <qpainter.h>
-#include <qdrawutil.h>
-#include <qapplication.h>
-#include <qtimer.h>
+#include <tqbitmap.h>
+#include <tqpainter.h>
+#include <tqdrawutil.h>
+#include <tqapplication.h>
+#include <tqtimer.h>
#include <kdebug.h>
#include <kimageeffect.h>
@@ -41,7 +41,7 @@
#define SHADOW_THICKNESS 1
//! @internal
-class KexiDBInternalLabel : public QLabel {
+class KexiDBInternalLabel : public TQLabel {
friend class KexiDBLabel;
public:
KexiDBInternalLabel( KexiDBLabel* );
@@ -50,23 +50,23 @@ class KexiDBInternalLabel : public QLabel {
protected:
void updateFrame();
- QImage makeShadow( const QImage& textImage, const QColor &bgColor, const QRect& boundingRect );
- QRect getBounding( const QImage &image, const QRect& startRect );
-// double defaultDecay( QImage& source, int i, int j );
+ TQImage makeShadow( const TQImage& textImage, const TQColor &bgColor, const TQRect& boundingRect );
+ TQRect getBounding( const TQImage &image, const TQRect& startRect );
+// double defaultDecay( TQImage& source, int i, int j );
KPixmap getShadowPixmap();
- QRect m_shadowRect;
+ TQRect m_shadowRect;
KexiDBLabel *m_parentLabel;
};
-KexiDBInternalLabel::KexiDBInternalLabel( KexiDBLabel* parent )
- : QLabel( parent )
- , m_parentLabel(parent)
+KexiDBInternalLabel::KexiDBInternalLabel( KexiDBLabel* tqparent )
+ : TQLabel( tqparent )
+ , m_parentLabel(tqparent)
{
- int a = alignment() | Qt::WordBreak;
- a &= (0xffffff ^ Qt::AlignVertical_Mask);
- a |= Qt::AlignTop;
- setAlignment( a );
+ int a = tqalignment() | TQt::WordBreak;
+ a &= (0xffffff ^ TQt::AlignVertical_Mask);
+ a |= TQt::AlignTop;
+ tqsetAlignment( a );
updateFrame();
}
@@ -93,11 +93,11 @@ KexiDBInternalLabel::~KexiDBInternalLabel()
* --
* Christian Nitschkowski
*/
-QImage KexiDBInternalLabel::makeShadow( const QImage& textImage,
- const QColor &bgColor, const QRect& boundingRect )
+TQImage KexiDBInternalLabel::makeShadow( const TQImage& textImage,
+ const TQColor &bgColor, const TQRect& boundingRect )
{
- QImage result;
- QString origText( text() );
+ TQImage result;
+ TQString origText( text() );
// create a new image for for the shaddow
const int w = textImage.width();
@@ -119,7 +119,7 @@ QImage KexiDBInternalLabel::makeShadow( const QImage& textImage,
/*
* This is the source pixmap
*/
- QImage img = textImage.convertDepth( 32 );
+ TQImage img = textImage.convertDepth( 32 );
/*
* Resize the image if necessary
@@ -129,10 +129,10 @@ QImage KexiDBInternalLabel::makeShadow( const QImage& textImage,
}
// result.fill( 0 ); // all black
- double realOpacity = SHADOW_OPACITY + QMIN(50.0/double(256.0-qGray(bgColor.rgb())), 50.0);
+ double realOpacity = SHADOW_OPACITY + TQMIN(50.0/double(256.0-tqGray(bgColor.rgb())), 50.0);
//int _h, _s, _v;
//.getHsv( &_h, &_s, &_v );
- if (colorGroup().background()==Qt::red)//_s>=250 && _v>=250) //for colors like cyan or red, make the result more white
+ if (tqcolorGroup().background()==TQt::red)//_s>=250 && _v>=250) //for colors like cyan or red, make the result more white
realOpacity += 50.0;
result.fill( (int)realOpacity );
result.setAlphaBuffer( true );
@@ -148,26 +148,26 @@ QImage KexiDBInternalLabel::makeShadow( const QImage& textImage,
if ( ( i < 1 ) || ( j < 1 ) || ( i > img.width() - 2 ) || ( j > img.height() - 2 ) )
continue;
else
- alphaShadow = ( qGray( img.pixel( i - 1, j - 1 ) ) * SHADOW_DIAGONAL_FACTOR +
- qGray( img.pixel( i - 1, j ) ) * SHADOW_AXIS_FACTOR +
- qGray( img.pixel( i - 1, j + 1 ) ) * SHADOW_DIAGONAL_FACTOR +
- qGray( img.pixel( i , j - 1 ) ) * SHADOW_AXIS_FACTOR +
+ alphaShadow = ( tqGray( img.pixel( i - 1, j - 1 ) ) * SHADOW_DIAGONAL_FACTOR +
+ tqGray( img.pixel( i - 1, j ) ) * SHADOW_AXIS_FACTOR +
+ tqGray( img.pixel( i - 1, j + 1 ) ) * SHADOW_DIAGONAL_FACTOR +
+ tqGray( img.pixel( i , j - 1 ) ) * SHADOW_AXIS_FACTOR +
0 +
- qGray( img.pixel( i , j + 1 ) ) * SHADOW_AXIS_FACTOR +
- qGray( img.pixel( i + 1, j - 1 ) ) * SHADOW_DIAGONAL_FACTOR +
- qGray( img.pixel( i + 1, j ) ) * SHADOW_AXIS_FACTOR +
- qGray( img.pixel( i + 1, j + 1 ) ) * SHADOW_DIAGONAL_FACTOR ) / SHADOW_FACTOR;
+ tqGray( img.pixel( i , j + 1 ) ) * SHADOW_AXIS_FACTOR +
+ tqGray( img.pixel( i + 1, j - 1 ) ) * SHADOW_DIAGONAL_FACTOR +
+ tqGray( img.pixel( i + 1, j ) ) * SHADOW_AXIS_FACTOR +
+ tqGray( img.pixel( i + 1, j + 1 ) ) * SHADOW_DIAGONAL_FACTOR ) / SHADOW_FACTOR;
// update the shadow's i,j pixel.
if (alphaShadow > 0)
- result.setPixel( i, j, qRgba( bgRed, bgGreen , bgBlue,
+ result.setPixel( i, j, tqRgba( bgRed, bgGreen , bgBlue,
( int ) (( alphaShadow > realOpacity ) ? realOpacity : alphaShadow)
) );
}
/*caused too much redraw problems if (period && i % period) {
- qApp->processEvents();
+ tqApp->processEvents();
if (text() != origText) //text has been changed in the meantime: abort
- return QImage();
+ return TQImage();
}*/
}
return result;
@@ -177,25 +177,25 @@ KPixmap KexiDBInternalLabel::getShadowPixmap() {
/*!
* Backup the default color used to draw text.
*/
- const QColor textColor = colorGroup().foreground();
+ const TQColor textColor = tqcolorGroup().foreground();
/*!
* Temporary storage for the generated shadow
*/
KPixmap finalPixmap, tempPixmap;
- QImage shadowImage, tempImage;
- QPainter painter;
+ TQImage shadowImage, tempImage;
+ TQPainter painter;
- m_shadowRect = QRect();
+ m_shadowRect = TQRect();
tempPixmap.resize( size() );
- tempPixmap.fill( Qt::black );
+ tempPixmap.fill( TQt::black );
tempPixmap.setMask( tempPixmap.createHeuristicMask( true ) );
/*!
* The textcolor has to be white for creating shadows!
*/
- setPaletteForegroundColor( Qt::white );
+ setPaletteForegroundColor( TQt::white );
/*!
Draw the label "as usual" in a pixmap
@@ -211,7 +211,7 @@ KPixmap KexiDBInternalLabel::getShadowPixmap() {
* This will fit around the unmodified text.
*/
shadowImage = tempPixmap;
- tempPixmap.setMask( QBitmap() );
+ tempPixmap.setMask( TQBitmap() );
/*!
Get the first bounding rect.
@@ -225,14 +225,14 @@ KPixmap KexiDBInternalLabel::getShadowPixmap() {
* The new rect has to fit in the pixmap.
* I have to admit this isn't really nice code...
*/
- m_shadowRect.setX( QMAX( m_shadowRect.x() - ( m_shadowRect.width() / 4 ), 0 ) );
- m_shadowRect.setY( QMAX( m_shadowRect.y() - ( m_shadowRect.height() / 4 ), 0 ) );
- m_shadowRect.setBottomRight( QPoint(
- QMIN( m_shadowRect.x() + ( m_shadowRect.width() * 3 / 2 ), shadowImage.width() ),
- QMIN( m_shadowRect.y() + ( m_shadowRect.height() * 3 / 2 ), shadowImage.height() ) ) );
+ m_shadowRect.setX( TQMAX( m_shadowRect.x() - ( m_shadowRect.width() / 4 ), 0 ) );
+ m_shadowRect.setY( TQMAX( m_shadowRect.y() - ( m_shadowRect.height() / 4 ), 0 ) );
+ m_shadowRect.setBottomRight( TQPoint(
+ TQMIN( m_shadowRect.x() + ( m_shadowRect.width() * 3 / 2 ), shadowImage.width() ),
+ TQMIN( m_shadowRect.y() + ( m_shadowRect.height() * 3 / 2 ), shadowImage.height() ) ) );
shadowImage = makeShadow( shadowImage,
- qGray( colorGroup().background().rgb() ) < 127 ? Qt::white : Qt::black,
+ tqGray( tqcolorGroup().background().rgb() ) < 127 ? TQt::white : TQt::black,
m_shadowRect );
if (shadowImage.isNull())
return KPixmap();
@@ -249,8 +249,8 @@ KPixmap KexiDBInternalLabel::getShadowPixmap() {
painter.begin( &finalPixmap );
painter.fillRect( 0, 0, finalPixmap.width(), finalPixmap.height(),
palette().brush(
- isEnabled() ? QPalette::Active : QPalette::Disabled,
- QColorGroup::Background ) );
+ isEnabled() ? TQPalette::Active : TQPalette::Disabled,
+ TQColorGroup::Background ) );
painter.end();
/*!
@@ -276,7 +276,7 @@ KPixmap KexiDBInternalLabel::getShadowPixmap() {
to a new image.
I tried to copy this to a pixmap directly,
but it didn't work correctly.
- Maybe a Qt bug?
+ Maybe a TQt bug?
*/
tempImage = shadowImage.copy( m_shadowRect );
tempPixmap.convertFromImage( tempImage );
@@ -296,30 +296,30 @@ KPixmap KexiDBInternalLabel::getShadowPixmap() {
return finalPixmap;
}
-QRect KexiDBInternalLabel::getBounding( const QImage &image, const QRect& startRect ) {
- QPoint topLeft;
- QPoint bottomRight;
+TQRect KexiDBInternalLabel::getBounding( const TQImage &image, const TQRect& startRect ) {
+ TQPoint topLeft;
+ TQPoint bottomRight;
const int startX = startRect.x();
const int startY = startRect.y();
/*!
* Ugly beast to get the correct width and height
*/
- const int width = QMIN( ( startRect.bottomRight().x() > 0
- ? startRect.bottomRight().x() : QCOORD_MAX ),
+ const int width = TQMIN( ( startRect.bottomRight().x() > 0
+ ? startRect.bottomRight().x() : TQCOORD_MAX ),
image.width() );
- const int height = QMIN( ( startRect.bottomRight().y() > 0
- ? startRect.bottomRight().y() : QCOORD_MAX ),
+ const int height = TQMIN( ( startRect.bottomRight().y() > 0
+ ? startRect.bottomRight().y() : TQCOORD_MAX ),
image.height() );
/*!
Assume the first pixel has the color of the
background that has to be cut away.
- Qt uses the four corner pixels to guess the
+ TQt uses the four corner pixels to guess the
correct color, but in this case the topleft
pixel should be enough.
*/
- QRgb trans = image.pixel( 0, 0 );
+ TQRgb trans = image.pixel( 0, 0 );
for ( int y = startY; y < height; y++ ) {
for ( int x = startX; x < width; x++ ) {
@@ -361,7 +361,7 @@ QRect KexiDBInternalLabel::getBounding( const QImage &image, const QRect& startR
}
}
- return QRect(
+ return TQRect(
topLeft.x(),
topLeft.y(),
bottomRight.x() - topLeft.x(),
@@ -384,10 +384,10 @@ class KexiDBLabel::Private
}
~Private() {}
KPixmap shadowPixmap;
- QPoint shadowPosition;
+ TQPoint shadowPosition;
KexiDBInternalLabel* internalLabel;
- QTimer* timer;
- QColor frameColor;
+ TQTimer* timer;
+ TQColor frameColor;
bool pixmapDirty : 1;
bool shadowEnabled : 1;
bool resizeEvent : 1;
@@ -395,8 +395,8 @@ class KexiDBLabel::Private
//=========================================================
-KexiDBLabel::KexiDBLabel( QWidget *parent, const char *name, WFlags f )
- : QLabel( parent, name, f )
+KexiDBLabel::KexiDBLabel( TQWidget *tqparent, const char *name, WFlags f )
+ : TQLabel( tqparent, name, f )
, KexiDBTextWidgetInterface()
, KexiFormDataItemInterface()
, d( new Private() )
@@ -404,8 +404,8 @@ KexiDBLabel::KexiDBLabel( QWidget *parent, const char *name, WFlags f )
init();
}
-KexiDBLabel::KexiDBLabel( const QString& text, QWidget *parent, const char *name, WFlags f )
- : QLabel( parent, name, f )
+KexiDBLabel::KexiDBLabel( const TQString& text, TQWidget *tqparent, const char *name, WFlags f )
+ : TQLabel( tqparent, name, f )
, KexiDBTextWidgetInterface()
, KexiFormDataItemInterface()
, d( new Private() )
@@ -424,16 +424,16 @@ void KexiDBLabel::init()
m_hasFocusableWidget = false;
d->internalLabel = new KexiDBInternalLabel( this );
d->internalLabel->hide();
- d->frameColor = palette().active().foreground();
+ d->frameColor = tqpalette().active().foreground();
- setAlignment( d->internalLabel->alignment() );
+ tqsetAlignment( d->internalLabel->tqalignment() );
}
void KexiDBLabel::updatePixmapLater() {
if (d->resizeEvent) {
if (!d->timer) {
- d->timer = new QTimer(this, "KexiDBLabelTimer");
- connect(d->timer, SIGNAL(timeout()), this, SLOT(updatePixmap()));
+ d->timer = new TQTimer(this, "KexiDBLabelTimer");
+ connect(d->timer, TQT_SIGNAL(timeout()), this, TQT_SLOT(updatePixmap()));
}
d->timer->start(100, true);
d->resizeEvent = false;
@@ -453,20 +453,20 @@ void KexiDBLabel::updatePixmap() {
d->internalLabel->setText( text() );
d->internalLabel->setFixedSize( size() );
d->internalLabel->setPalette( palette() );
- d->internalLabel->setAlignment( alignment() );
-// d->shadowPixmap = KPixmap(); //parallel repaints won't hurt us cause incomplete pixmap
+ d->internalLabel->tqsetAlignment( tqalignment() );
+// d->shadowPixmap = KPixmap(); //parallel tqrepaints won't hurt us cause incomplete pixmap
KPixmap shadowPixmap = d->internalLabel->getShadowPixmap();
if (shadowPixmap.isNull())
return;
d->shadowPixmap = shadowPixmap;
d->shadowPosition = d->internalLabel->m_shadowRect.topLeft();
d->pixmapDirty = false;
- repaint();
+ tqrepaint();
}
-void KexiDBLabel::paintEvent( QPaintEvent* e )
+void KexiDBLabel::paintEvent( TQPaintEvent* e )
{
- QPainter p( this );
+ TQPainter p( this );
if ( d->shadowEnabled ) {
/*!
If required, update the pixmap-cache.
@@ -482,31 +482,31 @@ void KexiDBLabel::paintEvent( QPaintEvent* e )
the shadow has to be drawn using an offset relative to
the widgets border.
*/
- if ( !d->pixmapDirty && e->rect().contains( d->shadowPosition ) && !d->shadowPixmap.isNull()) {
- QRect clipRect = QRect(
- QMAX( e->rect().x() - d->shadowPosition.x(), 0 ),
- QMAX( e->rect().y() - d->shadowPosition.y(), 0 ),
- QMIN( e->rect().width() + d->shadowPosition.x(), d->shadowPixmap.width() ),
- QMIN( e->rect().height() + d->shadowPosition.y(), d->shadowPixmap.height() ) );
+ if ( !d->pixmapDirty && e->rect().tqcontains( d->shadowPosition ) && !d->shadowPixmap.isNull()) {
+ TQRect clipRect = TQRect(
+ TQMAX( e->rect().x() - d->shadowPosition.x(), 0 ),
+ TQMAX( e->rect().y() - d->shadowPosition.y(), 0 ),
+ TQMIN( e->rect().width() + d->shadowPosition.x(), d->shadowPixmap.width() ),
+ TQMIN( e->rect().height() + d->shadowPosition.y(), d->shadowPixmap.height() ) );
p.drawPixmap( d->internalLabel->m_shadowRect.topLeft(), d->shadowPixmap, clipRect );
}
}
- KexiDBTextWidgetInterface::paint( this, &p, text().isEmpty(), alignment(), false );
- QLabel::paintEvent( e );
+ KexiDBTextWidgetInterface::paint( this, &p, text().isEmpty(), tqalignment(), false );
+ TQLabel::paintEvent( e );
}
-void KexiDBLabel::setValueInternal( const QVariant& add, bool removeOld ) {
+void KexiDBLabel::setValueInternal( const TQVariant& add, bool removeOld ) {
if (removeOld)
setText(add.toString());
else
setText( m_origValue.toString() + add.toString() );
}
-QVariant KexiDBLabel::value() {
+TQVariant KexiDBLabel::value() {
return text();
}
-void KexiDBLabel::setInvalidState( const QString& displayText )
+void KexiDBLabel::setInvalidState( const TQString& displayText )
{
setText( displayText );
}
@@ -531,7 +531,7 @@ void KexiDBLabel::setReadOnly( bool readOnly )
Q_UNUSED(readOnly);
}
-QWidget* KexiDBLabel::widget()
+TQWidget* KexiDBLabel::widget()
{
return this;
}
@@ -548,12 +548,12 @@ bool KexiDBLabel::cursorAtEnd()
void KexiDBLabel::clear()
{
- setText(QString::null);
+ setText(TQString());
}
-bool KexiDBLabel::setProperty( const char * name, const QVariant & value )
+bool KexiDBLabel::setProperty( const char * name, const TQVariant & value )
{
- const bool ret = QLabel::setProperty(name, value);
+ const bool ret = TQLabel::setProperty(name, value);
if (d->shadowEnabled) {
if (0==qstrcmp("indent", name) || 0==qstrcmp("font", name) || 0==qstrcmp("margin", name)
|| 0==qstrcmp("frameShadow", name) || 0==qstrcmp("frameShape", name)
@@ -577,45 +577,45 @@ void KexiDBLabel::setShadowEnabled( bool state ) {
d->pixmapDirty = true;
if (state)
d->internalLabel->updateFrame();
- repaint();
+ tqrepaint();
}
-void KexiDBLabel::resizeEvent( QResizeEvent* e ) {
+void KexiDBLabel::resizeEvent( TQResizeEvent* e ) {
if (isVisible())
d->resizeEvent = true;
d->pixmapDirty = true;
- QLabel::resizeEvent( e );
+ TQLabel::resizeEvent( e );
}
-void KexiDBLabel::fontChange( const QFont& font ) {
+void KexiDBLabel::fontChange( const TQFont& font ) {
d->pixmapDirty = true;
d->internalLabel->setFont( font );
- QLabel::fontChange( font );
+ TQLabel::fontChange( font );
}
-void KexiDBLabel::styleChange( QStyle& style ) {
+void KexiDBLabel::styleChange( TQStyle& style ) {
d->pixmapDirty = true;
- QLabel::styleChange( style );
+ TQLabel::styleChange( style );
}
void KexiDBLabel::enabledChange( bool enabled ) {
d->pixmapDirty = true;
d->internalLabel->setEnabled( enabled );
- QLabel::enabledChange( enabled );
+ TQLabel::enabledChange( enabled );
}
-void KexiDBLabel::paletteChange( const QPalette& oldPal ) {
+void KexiDBLabel::paletteChange( const TQPalette& oldPal ) {
Q_UNUSED(oldPal);
d->pixmapDirty = true;
d->internalLabel->setPalette( palette() );
}
-/*const QColor & KexiDBLabel::paletteForegroundColor () const
+/*const TQColor & KexiDBLabel::paletteForegroundColor () const
{
return d->foregroundColor;
}
-void KexiDBLabel::setPaletteForegroundColor ( const QColor& color )
+void KexiDBLabel::setPaletteForegroundColor ( const TQColor& color )
{
d->foregroundColor = color;
}*/
@@ -623,20 +623,20 @@ void KexiDBLabel::setPaletteForegroundColor ( const QColor& color )
void KexiDBLabel::frameChanged() {
d->pixmapDirty = true;
d->internalLabel->updateFrame();
- QFrame::frameChanged();
+ TQFrame::frameChanged();
}
-void KexiDBLabel::showEvent( QShowEvent* e ) {
+void KexiDBLabel::showEvent( TQShowEvent* e ) {
d->pixmapDirty = true;
- QLabel::showEvent( e );
+ TQLabel::showEvent( e );
}
-void KexiDBLabel::setText( const QString& text ) {
+void KexiDBLabel::setText( const TQString& text ) {
d->pixmapDirty = true;
- QLabel::setText( text );
+ TQLabel::setText( text );
//This is necessary for KexiFormDataItemInterface
valueChanged();
- repaint();
+ tqrepaint();
}
bool KexiDBLabel::shadowEnabled() const
@@ -645,6 +645,6 @@ bool KexiDBLabel::shadowEnabled() const
}
#define ClassName KexiDBLabel
-#define SuperClassName QLabel
+#define SuperClassName TQLabel
#include "kexiframeutils_p.cpp"
#include "kexidblabel.moc"
diff --git a/kexi/plugins/forms/widgets/kexidblabel.h b/kexi/plugins/forms/widgets/kexidblabel.h
index ec4e626a..af396a12 100644
--- a/kexi/plugins/forms/widgets/kexidblabel.h
+++ b/kexi/plugins/forms/widgets/kexidblabel.h
@@ -21,8 +21,8 @@
#ifndef KEXIDBLABEL_H
#define KEXIDBLABEL_H
-#include <qimage.h>
-#include <qlabel.h>
+#include <tqimage.h>
+#include <tqlabel.h>
#include <kpixmap.h>
@@ -30,8 +30,8 @@
#include "../kexidbtextwidgetinterface.h"
#include <widget/utils/kexidisplayutils.h>
-class QPainter;
-class QTimer;
+class TQPainter;
+class TQTimer;
class KexiDBInternalLabel;
//! @short An extended, data-aware, read-only text label.
@@ -39,29 +39,30 @@ class KexiDBInternalLabel;
@author Christian Nitschkowski, Jaroslaw Staniek
*/
-class KEXIFORMUTILS_EXPORT KexiDBLabel : public QLabel, protected KexiDBTextWidgetInterface, public KexiFormDataItemInterface {
+class KEXIFORMUTILS_EXPORT KexiDBLabel : public TQLabel, protected KexiDBTextWidgetInterface, public KexiFormDataItemInterface {
Q_OBJECT
- Q_PROPERTY( QString dataSource READ dataSource WRITE setDataSource DESIGNABLE true )
- Q_PROPERTY( QCString dataSourceMimeType READ dataSourceMimeType WRITE setDataSourceMimeType DESIGNABLE true )
- Q_PROPERTY( bool shadowEnabled READ shadowEnabled WRITE setShadowEnabled DESIGNABLE true )
- Q_OVERRIDE( QPixmap pixmap DESIGNABLE false )
- Q_OVERRIDE( bool scaledContents DESIGNABLE false )
-// Q_OVERRIDE( QColor paletteForegroundColor READ paletteForegroundColor WRITE setPaletteForegroundColor DESIGNABLE true )
- Q_PROPERTY( QColor frameColor READ frameColor WRITE setFrameColor DESIGNABLE true )
+ TQ_OBJECT
+ TQ_PROPERTY( TQString dataSource READ dataSource WRITE setDataSource DESIGNABLE true )
+ TQ_PROPERTY( TQCString dataSourceMimeType READ dataSourceMimeType WRITE setDataSourceMimeType DESIGNABLE true )
+ TQ_PROPERTY( bool shadowEnabled READ shadowEnabled WRITE setShadowEnabled DESIGNABLE true )
+ TQ_OVERRIDE( TQPixmap pixmap DESIGNABLE false )
+ TQ_OVERRIDE( bool scaledContents DESIGNABLE false )
+// TQ_OVERRIDE( TQColor paletteForegroundColor READ paletteForegroundColor WRITE setPaletteForegroundColor DESIGNABLE true )
+ TQ_PROPERTY( TQColor frameColor READ frameColor WRITE setFrameColor DESIGNABLE true )
public:
- KexiDBLabel( QWidget *parent, const char *name = 0, WFlags f = 0 );
- KexiDBLabel( const QString& text, QWidget *parent, const char *name = 0, WFlags f = 0 );
+ KexiDBLabel( TQWidget *tqparent, const char *name = 0, WFlags f = 0 );
+ KexiDBLabel( const TQString& text, TQWidget *tqparent, const char *name = 0, WFlags f = 0 );
virtual ~KexiDBLabel();
- inline QString dataSource() const { return KexiFormDataItemInterface::dataSource(); }
- inline QCString dataSourceMimeType() const { return KexiFormDataItemInterface::dataSourceMimeType(); }
+ inline TQString dataSource() const { return KexiFormDataItemInterface::dataSource(); }
+ inline TQCString dataSourceMimeType() const { return KexiFormDataItemInterface::dataSourceMimeType(); }
- virtual QVariant value();
+ virtual TQVariant value();
bool shadowEnabled() const;
- virtual void setInvalidState( const QString& displayText );
+ virtual void setInvalidState( const TQString& displayText );
virtual bool valueIsNull();
@@ -70,7 +71,7 @@ class KEXIFORMUTILS_EXPORT KexiDBLabel : public QLabel, protected KexiDBTextWidg
//! always true
virtual bool isReadOnly() const;
- virtual QWidget* widget();
+ virtual TQWidget* widget();
//! always false
virtual bool cursorAtStart();
@@ -81,29 +82,29 @@ class KEXIFORMUTILS_EXPORT KexiDBLabel : public QLabel, protected KexiDBTextWidg
virtual void clear();
//! used to catch setIndent(), etc.
- virtual bool setProperty ( const char * name, const QVariant & value );
+ virtual bool setProperty ( const char * name, const TQVariant & value );
- virtual const QColor& frameColor() const;
+ virtual const TQColor& frameColor() const;
-// const QColor & paletteForegroundColor() const;
+// const TQColor & paletteForegroundColor() const;
public slots:
//! Sets the datasource to \a ds
- inline void setDataSource( const QString &ds ) { KexiFormDataItemInterface::setDataSource( ds ); }
+ inline void setDataSource( const TQString &ds ) { KexiFormDataItemInterface::setDataSource( ds ); }
- inline void setDataSourceMimeType(const QCString &ds) { KexiFormDataItemInterface::setDataSourceMimeType(ds); }
+ inline void setDataSourceMimeType(const TQCString &ds) { KexiFormDataItemInterface::setDataSourceMimeType(ds); }
- virtual void setText( const QString& text );
+ virtual void setText( const TQString& text );
/*! Enable/Disable the shadow effect.
- KexiDBLabel acts just like a normal QLabel when shadow is disabled. */
+ KexiDBLabel acts just like a normal TQLabel when shadow is disabled. */
void setShadowEnabled( bool state );
- virtual void setPalette( const QPalette &pal );
+ virtual void setPalette( const TQPalette &pal );
- virtual void setFrameColor(const QColor& color);
+ virtual void setFrameColor(const TQColor& color);
-// void setPaletteForegroundColor( const QColor& color );
+// void setPaletteForegroundColor( const TQColor& color );
protected slots:
//! empty
@@ -113,23 +114,23 @@ class KEXIFORMUTILS_EXPORT KexiDBLabel : public QLabel, protected KexiDBTextWidg
protected:
void init();
virtual void setColumnInfo(KexiDB::QueryColumnInfo* cinfo);
- virtual void paintEvent( QPaintEvent* );
- virtual void resizeEvent( QResizeEvent* e );
+ virtual void paintEvent( TQPaintEvent* );
+ virtual void resizeEvent( TQResizeEvent* e );
//! Sets value \a value for a widget.
- virtual void setValueInternal( const QVariant& add, bool removeOld );
+ virtual void setValueInternal( const TQVariant& add, bool removeOld );
- virtual void fontChange( const QFont& font );
- virtual void styleChange( QStyle& style );
+ virtual void fontChange( const TQFont& font );
+ virtual void styleChange( TQStyle& style );
virtual void enabledChange( bool enabled );
- virtual void paletteChange( const QPalette& oldPal );
+ virtual void paletteChange( const TQPalette& oldPal );
virtual void frameChanged();
- virtual void showEvent( QShowEvent* e );
+ virtual void showEvent( TQShowEvent* e );
//! Reimplemented to paint using real frame color instead of froeground.
//! Also allows to paint more types of frame.
- virtual void drawFrame( QPainter * );
+ virtual void drawFrame( TQPainter * );
void updatePixmapLater();
diff --git a/kexi/plugins/forms/widgets/kexidblineedit.cpp b/kexi/plugins/forms/widgets/kexidblineedit.cpp
index 3897a8cb..0b1709e1 100644
--- a/kexi/plugins/forms/widgets/kexidblineedit.cpp
+++ b/kexi/plugins/forms/widgets/kexidblineedit.cpp
@@ -25,8 +25,8 @@
#include <knumvalidator.h>
#include <kdatetbl.h>
-#include <qpopupmenu.h>
-#include <qpainter.h>
+#include <tqpopupmenu.h>
+#include <tqpainter.h>
#include <kexiutils/utils.h>
#include <kexidb/queryschema.h>
@@ -37,37 +37,37 @@
//#define USE_KLineEdit_setReadOnly
//! @internal A validator used for read only flag to disable editing
-class KexiDBLineEdit_ReadOnlyValidator : public QValidator
+class KexiDBLineEdit_ReadOnlyValidator : public TQValidator
{
public:
- KexiDBLineEdit_ReadOnlyValidator( QObject * parent )
- : QValidator(parent)
+ KexiDBLineEdit_ReadOnlyValidator( TQObject * tqparent )
+ : TQValidator(tqparent)
{
}
~KexiDBLineEdit_ReadOnlyValidator() {}
- virtual State validate( QString &, int & ) const { return Invalid; }
+ virtual State validate( TQString &, int & ) const { return Invalid; }
};
//-----
-KexiDBLineEdit::KexiDBLineEdit(QWidget *parent, const char *name)
- : KLineEdit(parent, name)
+KexiDBLineEdit::KexiDBLineEdit(TQWidget *tqparent, const char *name)
+ : KLineEdit(tqparent, name)
, KexiDBTextWidgetInterface()
, KexiFormDataItemInterface()
//moved , m_dateFormatter(0)
//moved , m_timeFormatter(0)
- , m_menuExtender(this, this)
+ , m_menuExtender(TQT_TQOBJECT(this), this)
, m_internalReadOnly(false)
, m_slotTextChanged_enabled(true)
{
#ifdef USE_KLineEdit_setReadOnly
//! @todo reenable as an app aption
- QPalette p(widget->palette());
+ TQPalette p(widget->palette());
p.setColor( lighterGrayBackgroundColor(palette()) );
widget->setPalette(p);
#endif
- connect(this, SIGNAL(textChanged(const QString&)), this, SLOT(slotTextChanged(const QString&)));
+ connect(this, TQT_SIGNAL(textChanged(const TQString&)), this, TQT_SLOT(slotTextChanged(const TQString&)));
}
KexiDBLineEdit::~KexiDBLineEdit()
@@ -76,19 +76,19 @@ KexiDBLineEdit::~KexiDBLineEdit()
//moved delete m_timeFormatter;
}
-void KexiDBLineEdit::setInvalidState( const QString& displayText )
+void KexiDBLineEdit::setInvalidState( const TQString& displayText )
{
KLineEdit::setReadOnly(true);
//! @todo move this to KexiDataItemInterface::setInvalidStateInternal() ?
- if (focusPolicy() & TabFocus)
- setFocusPolicy(QWidget::ClickFocus);
+ if (focusPolicy() & TQ_TabFocus)
+ setFocusPolicy(TQ_ClickFocus);
setText(displayText);
}
-void KexiDBLineEdit::setValueInternal(const QVariant& add, bool removeOld)
+void KexiDBLineEdit::setValueInternal(const TQVariant& add, bool removeOld)
{
#if 0 //moved to KexiTextFormatter
- QVariant value;
+ TQVariant value;
if (removeOld)
value = add;
else {
@@ -106,15 +106,15 @@ void KexiDBLineEdit::setValueInternal(const QVariant& add, bool removeOld)
return;
}
else if (t == KexiDB::Field::Date) {
- setText( dateFormatter()->dateToString( value.toString().isEmpty() ? QDate() : value.toDate() ) );
+ setText( dateFormatter()->dateToString( value.toString().isEmpty() ? TQDate() : value.toDate() ) );
setCursorPosition(0); //ok?
return;
}
else if (t == KexiDB::Field::Time) {
setText(
timeFormatter()->timeToString(
- //hack to avoid converting null variant to valid QTime(0,0,0)
- value.toString().isEmpty() ? value.toTime() : QTime(99,0,0)
+ //hack to avoid converting null variant to valid TQTime(0,0,0)
+ value.toString().isEmpty() ? value.toTime() : TQTime(99,0,0)
)
);
setCursorPosition(0); //ok?
@@ -122,7 +122,7 @@ void KexiDBLineEdit::setValueInternal(const QVariant& add, bool removeOld)
}
else if (t == KexiDB::Field::DateTime) {
if (value.toString().isEmpty() ) {
- setText( QString::null );
+ setText( TQString() );
}
else {
setText(
@@ -136,18 +136,18 @@ void KexiDBLineEdit::setValueInternal(const QVariant& add, bool removeOld)
}
#endif
m_slotTextChanged_enabled = false;
- setText( m_textFormatter.valueToText(removeOld ? QVariant() : m_origValue, add.toString()) );
+ setText( m_textFormatter.valueToText(removeOld ? TQVariant() : m_origValue, add.toString()) );
// setText( value.toString() );
setCursorPosition(0); //ok?
m_slotTextChanged_enabled = true;
}
-QVariant KexiDBLineEdit::value()
+TQVariant KexiDBLineEdit::value()
{
return m_textFormatter.textToValue( text() );
#if 0 // moved to KexiTextFormatter
if (! m_columnInfo)
- return QVariant();
+ return TQVariant();
const KexiDB::Field::Type t = m_columnInfo->field->type();
switch (t) {
case KexiDB::Field::Text:
@@ -163,7 +163,7 @@ QVariant KexiDBLineEdit::value()
return text().toLongLong();
case KexiDB::Field::Boolean:
//! @todo temporary solution for booleans!
- return text() == "1" ? QVariant(true,1) : QVariant(false,0);
+ return text() == "1" ? TQVariant(true,1) : TQVariant(false,0);
case KexiDB::Field::Date:
return dateFormatter()->stringToVariant( text() );
case KexiDB::Field::Time:
@@ -175,14 +175,14 @@ QVariant KexiDBLineEdit::value()
case KexiDB::Field::Double:
return text().toDouble();
default:
- return QVariant();
+ return TQVariant();
}
//! @todo more data types!
return text();
#endif
}
-void KexiDBLineEdit::slotTextChanged(const QString&)
+void KexiDBLineEdit::slotTextChanged(const TQString&)
{
if (!m_slotTextChanged_enabled)
return;
@@ -254,7 +254,7 @@ void KexiDBLineEdit::setReadOnly( bool readOnly )
if (m_internalReadOnly) {
m_readWriteValidator = validator();
if (!m_readOnlyValidator)
- m_readOnlyValidator = new KexiDBLineEdit_ReadOnlyValidator(this);
+ m_readOnlyValidator = new KexiDBLineEdit_ReadOnlyValidator(TQT_TQOBJECT(this));
setValidator( m_readOnlyValidator );
}
else {
@@ -265,15 +265,15 @@ void KexiDBLineEdit::setReadOnly( bool readOnly )
#endif
}
-QPopupMenu * KexiDBLineEdit::createPopupMenu()
+TQPopupMenu * KexiDBLineEdit::createPopupMenu()
{
- QPopupMenu *contextMenu = KLineEdit::createPopupMenu();
+ TQPopupMenu *contextMenu = KLineEdit::createPopupMenu();
m_menuExtender.createTitle(contextMenu);
return contextMenu;
}
-QWidget* KexiDBLineEdit::widget()
+TQWidget* KexiDBLineEdit::widget()
{
return this;
}
@@ -303,7 +303,7 @@ void KexiDBLineEdit::setColumnInfo(KexiDB::QueryColumnInfo* cinfo)
if (!cinfo)
return;
-//! @todo handle input mask (via QLineEdit::setInputMask()) using a special KexiDB::FieldInputMask class
+//! @todo handle input tqmask (via TQLineEdit::setInputMask()) using a special KexiDB::FieldInputMask class
setValidator( new KexiDB::FieldValidator(*cinfo->field, this) );
#if 0 // moved to KexiTextFormatter
@@ -321,7 +321,7 @@ void KexiDBLineEdit::setColumnInfo(KexiDB::QueryColumnInfo* cinfo)
dateTimeInputMask( *dateFormatter(), *timeFormatter() ) );
}
#endif
- const QString inputMask( m_textFormatter.inputMask() );
+ const TQString inputMask( m_textFormatter.inputMask() );
if (!inputMask.isEmpty())
setInputMask( inputMask );
@@ -329,26 +329,26 @@ void KexiDBLineEdit::setColumnInfo(KexiDB::QueryColumnInfo* cinfo)
}
/*todo
-void KexiDBLineEdit::paint( QPainter *p )
+void KexiDBLineEdit::paint( TQPainter *p )
{
- KexiDBTextWidgetInterface::paint( this, &p, text().isEmpty(), alignment(), hasFocus() );
+ KexiDBTextWidgetInterface::paint( this, &p, text().isEmpty(), tqalignment(), hasFocus() );
}*/
-void KexiDBLineEdit::paintEvent ( QPaintEvent *pe )
+void KexiDBLineEdit::paintEvent ( TQPaintEvent *pe )
{
KLineEdit::paintEvent( pe );
- QPainter p(this);
- KexiDBTextWidgetInterface::paint( this, &p, text().isEmpty(), alignment(), hasFocus() );
+ TQPainter p(this);
+ KexiDBTextWidgetInterface::paint( this, &p, text().isEmpty(), tqalignment(), hasFocus() );
}
-bool KexiDBLineEdit::event( QEvent * e )
+bool KexiDBLineEdit::event( TQEvent * e )
{
const bool ret = KLineEdit::event( e );
KexiDBTextWidgetInterface::event(e, this, text().isEmpty());
- if (e->type()==QEvent::FocusOut) {
- QFocusEvent *fe = static_cast<QFocusEvent *>(e);
-// if (fe->reason()!=QFocusEvent::ActiveWindow && fe->reason()!=QFocusEvent::Popup) {
- if (fe->reason()==QFocusEvent::Tab || fe->reason()==QFocusEvent::Backtab) {
+ if (e->type()==TQEvent::FocusOut) {
+ TQFocusEvent *fe = TQT_TQFOCUSEVENT(e);
+// if (fe->reason()!=TQFocusEvent::ActiveWindow && fe->reason()!=TQFocusEvent::Popup) {
+ if (fe->reason()==TQFocusEvent::Tab || fe->reason()==TQFocusEvent::Backtab) {
//display aligned to left after loosing the focus (only if this is tab/backtab event)
//! @todo add option to set cursor at the beginning
setCursorPosition(0); //ok?
@@ -362,7 +362,7 @@ bool KexiDBLineEdit::appendStretchRequired(KexiDBAutoField* autoField) const
return KexiDBAutoField::Top == autoField->labelPosition();
}
-void KexiDBLineEdit::handleAction(const QString& actionName)
+void KexiDBLineEdit::handleAction(const TQString& actionName)
{
if (actionName=="edit_copy") {
copy();
@@ -376,15 +376,15 @@ void KexiDBLineEdit::handleAction(const QString& actionName)
//! @todo ?
}
-void KexiDBLineEdit::setDisplayDefaultValue(QWidget *widget, bool displayDefaultValue)
+void KexiDBLineEdit::setDisplayDefaultValue(TQWidget *widget, bool displayDefaultValue)
{
KexiFormDataItemInterface::setDisplayDefaultValue(widget, displayDefaultValue);
// initialize display parameters for default / entered value
KexiDisplayUtils::DisplayParameters * const params
= displayDefaultValue ? m_displayParametersForDefaultValue : m_displayParametersForEnteredValue;
setFont(params->font);
- QPalette pal(palette());
- pal.setColor(QPalette::Active, QColorGroup::Text, params->textColor);
+ TQPalette pal(palette());
+ pal.setColor(TQPalette::Active, TQColorGroup::Text, params->textColor);
setPalette(pal);
}
@@ -408,7 +408,7 @@ void KexiDBLineEdit::selectAll()
KLineEdit::selectAll();
}
-bool KexiDBLineEdit::keyPressed(QKeyEvent *ke)
+bool KexiDBLineEdit::keyPressed(TQKeyEvent *ke)
{
Q_UNUSED(ke);
return false;
diff --git a/kexi/plugins/forms/widgets/kexidblineedit.h b/kexi/plugins/forms/widgets/kexidblineedit.h
index 5f0262b2..4457a8d0 100644
--- a/kexi/plugins/forms/widgets/kexidblineedit.h
+++ b/kexi/plugins/forms/widgets/kexidblineedit.h
@@ -22,7 +22,7 @@
#define KexiDBLineEdit_H
#include <klineedit.h>
-#include <qvalidator.h>
+#include <tqvalidator.h>
#include "kexiformdataiteminterface.h"
#include "kexidbtextwidgetinterface.h"
@@ -34,11 +34,11 @@ class KexiDBWidgetContextMenuExtender;
/*! @internal Utility: alter background color to be a blended color
of the background and base (usually lighter gray). Used for read-only mode. */
-void setLighterGrayBackgroundColor(QWidget* widget);
+void setLighterGrayBackgroundColor(TQWidget* widget);
//! @short Line edit widget for Kexi forms
/*! Handles many data types. User input is validated by using validators
- and/or input masks.
+ and/or input tqmasks.
*/
class KEXIFORMUTILS_EXPORT KexiDBLineEdit :
public KLineEdit,
@@ -47,18 +47,19 @@ class KEXIFORMUTILS_EXPORT KexiDBLineEdit :
public KexiSubwidgetInterface
{
Q_OBJECT
- Q_PROPERTY(QString dataSource READ dataSource WRITE setDataSource DESIGNABLE true)
- Q_PROPERTY(QCString dataSourceMimeType READ dataSourceMimeType WRITE setDataSourceMimeType DESIGNABLE true)
- Q_OVERRIDE(bool readOnly READ isReadOnly WRITE setReadOnly DESIGNABLE true)
+ TQ_OBJECT
+ TQ_PROPERTY(TQString dataSource READ dataSource WRITE setDataSource DESIGNABLE true)
+ TQ_PROPERTY(TQCString dataSourceMimeType READ dataSourceMimeType WRITE setDataSourceMimeType DESIGNABLE true)
+ TQ_OVERRIDE(bool readOnly READ isReadOnly WRITE setReadOnly DESIGNABLE true)
public:
- KexiDBLineEdit(QWidget *parent, const char *name=0);
+ KexiDBLineEdit(TQWidget *tqparent, const char *name=0);
virtual ~KexiDBLineEdit();
- inline QString dataSource() const { return KexiFormDataItemInterface::dataSource(); }
- inline QCString dataSourceMimeType() const { return KexiFormDataItemInterface::dataSourceMimeType(); }
- virtual QVariant value();
- virtual void setInvalidState( const QString& displayText );
+ inline TQString dataSource() const { return KexiFormDataItemInterface::dataSource(); }
+ inline TQCString dataSourceMimeType() const { return KexiFormDataItemInterface::dataSourceMimeType(); }
+ virtual TQVariant value();
+ virtual void setInvalidState( const TQString& displayText );
//! \return true if editor's value is null (not empty)
//! Used for checking if a given constraint within table of form is met.
@@ -80,10 +81,10 @@ class KEXIFORMUTILS_EXPORT KexiDBLineEdit :
is displayed in a special way. Used by KexiFormDataProvider::fillDataItems().
\a widget is equal to 'this'.
Reimplemented after KexiFormDataItemInterface. */
- virtual void setDisplayDefaultValue(QWidget* widget, bool displayDefaultValue);
+ virtual void setDisplayDefaultValue(TQWidget* widget, bool displayDefaultValue);
/*! \return the view widget of this item, e.g. line edit widget. */
- virtual QWidget* widget();
+ virtual TQWidget* widget();
virtual bool cursorAtStart();
virtual bool cursorAtEnd();
@@ -94,14 +95,14 @@ class KEXIFORMUTILS_EXPORT KexiDBLineEdit :
/*! Handles action having standard name \a actionName.
Action could be: "edit_copy", "edit_paste", etc.
Reimplemented after KexiDataItemChangesListener. */
- virtual void handleAction(const QString& actionName);
+ virtual void handleAction(const TQString& actionName);
/*! Called by top-level form on key press event to consume widget-specific shortcuts. */
- virtual bool keyPressed(QKeyEvent *ke);
+ virtual bool keyPressed(TQKeyEvent *ke);
public slots:
- inline void setDataSource(const QString &ds) { KexiFormDataItemInterface::setDataSource(ds); }
- inline void setDataSourceMimeType(const QCString &ds) { KexiFormDataItemInterface::setDataSourceMimeType(ds); }
+ inline void setDataSource(const TQString &ds) { KexiFormDataItemInterface::setDataSource(ds); }
+ inline void setDataSourceMimeType(const TQCString &ds) { KexiFormDataItemInterface::setDataSourceMimeType(ds); }
virtual void setReadOnly( bool readOnly );
//! Reimplemented, so "undo" means the same as "cancelEditor" action
@@ -117,12 +118,12 @@ class KEXIFORMUTILS_EXPORT KexiDBLineEdit :
virtual void selectAll();
protected slots:
- void slotTextChanged(const QString&);
+ void slotTextChanged(const TQString&);
protected:
- virtual void paintEvent ( QPaintEvent * );
- virtual void setValueInternal(const QVariant& add, bool removeOld);
- virtual bool event ( QEvent * );
+ virtual void paintEvent ( TQPaintEvent * );
+ virtual void setValueInternal(const TQVariant& add, bool removeOld);
+ virtual bool event ( TQEvent * );
#if 0
//moved to KexiTextFormatter
@@ -135,7 +136,7 @@ class KEXIFORMUTILS_EXPORT KexiDBLineEdit :
}
#endif
- virtual QPopupMenu * createPopupMenu();
+ virtual TQPopupMenu * createPopupMenu();
//! Implemented for KexiSubwidgetInterface
virtual bool appendStretchRequired(KexiDBAutoField* autoField) const;
@@ -151,10 +152,10 @@ class KEXIFORMUTILS_EXPORT KexiDBLineEdit :
KexiTextFormatter m_textFormatter;
//! Used for read only flag to disable editing
- QGuardedPtr<const QValidator> m_readOnlyValidator;
+ TQGuardedPtr<const TQValidator> m_readOnlyValidator;
//! Used to remember the previous validator used forf r/w mode, after setting the read only flag
- QGuardedPtr<const QValidator> m_readWriteValidator;
+ TQGuardedPtr<const TQValidator> m_readWriteValidator;
//! Used for extending context menu
KexiDBWidgetContextMenuExtender m_menuExtender;
diff --git a/kexi/plugins/forms/widgets/kexidbsubform.cpp b/kexi/plugins/forms/widgets/kexidbsubform.cpp
index 8d1971a9..8cb4f795 100644
--- a/kexi/plugins/forms/widgets/kexidbsubform.cpp
+++ b/kexi/plugins/forms/widgets/kexidbsubform.cpp
@@ -29,38 +29,38 @@
#include <formeditor/container.h>
#include <formeditor/formmanager.h>
-KexiDBSubForm::KexiDBSubForm(KFormDesigner::Form *parentForm, QWidget *parent, const char *name)
-: QScrollView(parent, name), m_parentForm(parentForm), m_form(0), m_widget(0)
+KexiDBSubForm::KexiDBSubForm(KFormDesigner::Form *tqparentForm, TQWidget *tqparent, const char *name)
+: TQScrollView(tqparent, name), m_parentForm(tqparentForm), m_form(0), m_widget(0)
{
- setFrameStyle(QFrame::WinPanel | QFrame::Sunken);
- viewport()->setPaletteBackgroundColor(colorGroup().mid());
+ setFrameStyle(TQFrame::WinPanel | TQFrame::Sunken);
+ viewport()->setPaletteBackgroundColor(tqcolorGroup().mid());
}
/*
void
-KexiDBSubForm::paintEvent(QPaintEvent *ev)
+KexiDBSubForm::paintEvent(TQPaintEvent *ev)
{
- QScrollView::paintEvent(ev);
- QPainter p;
+ TQScrollView::paintEvent(ev);
+ TQPainter p;
setWFlags(WPaintUnclipped);
- QString txt("Subform");
- QFont f = font();
+ TQString txt("Subform");
+ TQFont f = font();
f.setPointSize(f.pointSize() * 3);
- QFontMetrics fm(f);
+ TQFontMetrics fm(f);
const int txtw = fm.width(txt), txth = fm.height();
p.begin(this, true);
p.setPen(black);
p.setFont(f);
- p.drawText(width()/2, height()/2, txt, Qt::AlignCenter|Qt::AlignVCenter);
+ p.drawText(width()/2, height()/2, txt, TQt::AlignCenter|TQt::AlignVCenter);
p.end();
clearWFlags( WPaintUnclipped );
}
*/
void
-KexiDBSubForm::setFormName(const QString &name)
+KexiDBSubForm::setFormName(const TQString &name)
{
if(m_formName==name)
return;
@@ -74,12 +74,12 @@ KexiDBSubForm::setFormName(const QString &name)
return;
}
- QWidget *pw = parentWidget();
+ TQWidget *pw = tqparentWidget();
KexiFormView *view = 0;
- QStringList list;
+ TQStringList list;
while(pw) {
if(pw->isA("KexiDBSubForm")) {
- if(list.contains(pw->name())) {
+ if(list.tqcontains(pw->name())) {
//! @todo error message
return; // Be sure to don't run into a endless-loop cause of recursive subforms.
}
@@ -87,18 +87,18 @@ KexiDBSubForm::setFormName(const QString &name)
}
else if(! view && pw->isA("KexiFormView"))
view = static_cast<KexiFormView*>(pw); // we need a KexiFormView*
- pw = pw->parentWidget();
+ pw = pw->tqparentWidget();
}
- if (!view || !view->parentDialog() || !view->parentDialog()->mainWin()
- || !view->parentDialog()->mainWin()->project()->dbConnection())
+ if (!view || !view->tqparentDialog() || !view->tqparentDialog()->mainWin()
+ || !view->tqparentDialog()->mainWin()->project()->dbConnection())
return;
- KexiDB::Connection *conn = view->parentDialog()->mainWin()->project()->dbConnection();
+ KexiDB::Connection *conn = view->tqparentDialog()->mainWin()->project()->dbConnection();
// we check if there is a form with this name
int id = KexiDB::idForObjectName(*conn, name, KexiPart::FormObjectType);
- if((id == 0) || (id == view->parentDialog()->id())) // == our form
+ if((id == 0) || (id == view->tqparentDialog()->id())) // == our form
return; // because of recursion when loading
// we create the container widget
@@ -110,22 +110,22 @@ KexiDBSubForm::setFormName(const QString &name)
m_form->createToplevel(m_widget);
// and load the sub form
- QString data;
- tristate res = conn->loadDataBlock(id, data, QString::null);
+ TQString data;
+ tristate res = conn->loadDataBlock(id, data, TQString());
if (res == true)
res = KFormDesigner::FormIO::loadFormFromString(m_form, m_widget, data);
if(res != true) {
delete m_widget;
m_widget = 0;
updateScrollBars();
- m_formName = QString::null;
+ m_formName = TQString();
return;
}
m_form->setDesignMode(false);
// Install event filters on the whole newly created form
- KFormDesigner::ObjectTreeItem *tree = m_parentForm->objectTree()->lookup(QObject::name());
- KFormDesigner::installRecursiveEventFilter(this, tree->eventEater());
+ KFormDesigner::ObjectTreeItem *tree = m_parentForm->objectTree()->lookup(TQT_TQOBJECT(this)->name());
+ KFormDesigner::installRecursiveEventFilter(TQT_TQOBJECT(this), tree->eventEater());
}
#include "kexidbsubform.moc"
diff --git a/kexi/plugins/forms/widgets/kexidbsubform.h b/kexi/plugins/forms/widgets/kexidbsubform.h
index 5b73f860..ea2bdbd3 100644
--- a/kexi/plugins/forms/widgets/kexidbsubform.h
+++ b/kexi/plugins/forms/widgets/kexidbsubform.h
@@ -21,32 +21,33 @@
#ifndef KexiDBSubForm_H
#define KexiDBSubForm_H
-#include <qscrollview.h>
+#include <tqscrollview.h>
#include <formeditor/form.h>
//! @short A form embedded as a widget inside other form
-class KEXIFORMUTILS_EXPORT KexiDBSubForm : public QScrollView
+class KEXIFORMUTILS_EXPORT KexiDBSubForm : public TQScrollView
{
Q_OBJECT
- Q_PROPERTY(QString formName READ formName WRITE setFormName DESIGNABLE true)
+ TQ_OBJECT
+ TQ_PROPERTY(TQString formName READ formName WRITE setFormName DESIGNABLE true)
public:
- KexiDBSubForm(KFormDesigner::Form *parentForm, QWidget *parent, const char *name);
+ KexiDBSubForm(KFormDesigner::Form *tqparentForm, TQWidget *tqparent, const char *name);
~KexiDBSubForm() {}
//! \return the name of the subform to display inside this widget
- QString formName() const { return m_formName; }
+ TQString formName() const { return m_formName; }
//! Sets the name of the subform to display inside this widget
- void setFormName(const QString &name);
+ void setFormName(const TQString &name);
- //void paintEvent(QPaintEvent *ev);
+ //void paintEvent(TQPaintEvent *ev);
private:
KFormDesigner::Form *m_parentForm;
KFormDesigner::Form *m_form;
- QWidget *m_widget;
- QString m_formName;
+ TQWidget *m_widget;
+ TQString m_formName;
};
#endif
diff --git a/kexi/plugins/forms/widgets/kexidbtextedit.cpp b/kexi/plugins/forms/widgets/kexidbtextedit.cpp
index 8541fc01..6f6aa89d 100644
--- a/kexi/plugins/forms/widgets/kexidbtextedit.cpp
+++ b/kexi/plugins/forms/widgets/kexidbtextedit.cpp
@@ -26,16 +26,16 @@
#include <kstdaccel.h>
#include <kdebug.h>
-#include <qpainter.h>
+#include <tqpainter.h>
-KexiDBTextEdit::KexiDBTextEdit(QWidget *parent, const char *name)
- : KTextEdit(parent, name)
+KexiDBTextEdit::KexiDBTextEdit(TQWidget *tqparent, const char *name)
+ : KTextEdit(tqparent, name)
, KexiDBTextWidgetInterface()
, KexiFormDataItemInterface()
- , m_menuExtender(this, this)
+ , m_menuExtender(TQT_TQOBJECT(this), this)
, m_slotTextChanged_enabled(true)
{
- connect(this, SIGNAL(textChanged()), this, SLOT(slotTextChanged()));
+ connect(this, TQT_SIGNAL(textChanged()), this, TQT_SLOT(slotTextChanged()));
installEventFilter(this);
}
@@ -43,16 +43,16 @@ KexiDBTextEdit::~KexiDBTextEdit()
{
}
-void KexiDBTextEdit::setInvalidState( const QString& displayText )
+void KexiDBTextEdit::setInvalidState( const TQString& displayText )
{
setReadOnly(true);
//! @todo move this to KexiDataItemInterface::setInvalidStateInternal() ?
- if (focusPolicy() & TabFocus)
- setFocusPolicy(QWidget::ClickFocus);
+ if (focusPolicy() & TQ_TabFocus)
+ setFocusPolicy(TQ_ClickFocus);
KTextEdit::setText(displayText);
}
-void KexiDBTextEdit::setValueInternal(const QVariant& add, bool removeOld)
+void KexiDBTextEdit::setValueInternal(const TQVariant& add, bool removeOld)
{
if (m_columnInfo && m_columnInfo->field->type()==KexiDB::Field::Boolean) {
//! @todo temporary solution for booleans!
@@ -66,7 +66,7 @@ void KexiDBTextEdit::setValueInternal(const QVariant& add, bool removeOld)
}
}
-QVariant KexiDBTextEdit::value()
+TQVariant KexiDBTextEdit::value()
{
return text();
}
@@ -96,20 +96,20 @@ bool KexiDBTextEdit::isReadOnly() const
void KexiDBTextEdit::setReadOnly( bool readOnly )
{
KTextEdit::setReadOnly( readOnly );
- QPalette p = palette();
- QColor c(readOnly ? lighterGrayBackgroundColor(kapp->palette()) : p.color(QPalette::Normal, QColorGroup::Base));
+ TQPalette p = palette();
+ TQColor c(readOnly ? lighterGrayBackgroundColor(kapp->palette()) : p.color(TQPalette::Normal, TQColorGroup::Base));
setPaper( c );
- p.setColor(QColorGroup::Base, c);
- p.setColor(QColorGroup::Background, c);
+ p.setColor(TQColorGroup::Base, c);
+ p.setColor(TQColorGroup::Background, c);
setPalette( p );
}
-void KexiDBTextEdit::setText( const QString & text, const QString & context )
+void KexiDBTextEdit::setText( const TQString & text, const TQString & context )
{
KTextEdit::setText(text, context);
}
-QWidget* KexiDBTextEdit::widget()
+TQWidget* KexiDBTextEdit::widget()
{
return this;
}
@@ -130,7 +130,7 @@ bool KexiDBTextEdit::cursorAtEnd()
void KexiDBTextEdit::clear()
{
- setText(QString::null, QString::null);
+ setText(TQString(), TQString());
}
void KexiDBTextEdit::setColumnInfo(KexiDB::QueryColumnInfo* cinfo)
@@ -141,16 +141,16 @@ void KexiDBTextEdit::setColumnInfo(KexiDB::QueryColumnInfo* cinfo)
KexiDBTextWidgetInterface::setColumnInfo(m_columnInfo, this);
}
-void KexiDBTextEdit::paintEvent ( QPaintEvent *pe )
+void KexiDBTextEdit::paintEvent ( TQPaintEvent *pe )
{
KTextEdit::paintEvent( pe );
- QPainter p(this);
- KexiDBTextWidgetInterface::paint( this, &p, text().isEmpty(), alignment(), hasFocus() );
+ TQPainter p(this);
+ KexiDBTextWidgetInterface::paint( this, &p, text().isEmpty(), tqalignment(), hasFocus() );
}
-QPopupMenu * KexiDBTextEdit::createPopupMenu(const QPoint & pos)
+TQPopupMenu * KexiDBTextEdit::createPopupMenu(const TQPoint & pos)
{
- QPopupMenu *contextMenu = KTextEdit::createPopupMenu(pos);
+ TQPopupMenu *contextMenu = KTextEdit::createPopupMenu(pos);
m_menuExtender.createTitle(contextMenu);
return contextMenu;
}
@@ -160,21 +160,21 @@ void KexiDBTextEdit::undo()
cancelEditor();
}
-void KexiDBTextEdit::setDisplayDefaultValue(QWidget* widget, bool displayDefaultValue)
+void KexiDBTextEdit::setDisplayDefaultValue(TQWidget* widget, bool displayDefaultValue)
{
KexiFormDataItemInterface::setDisplayDefaultValue(widget, displayDefaultValue);
// initialize display parameters for default / entered value
KexiDisplayUtils::DisplayParameters * const params
= displayDefaultValue ? m_displayParametersForDefaultValue : m_displayParametersForEnteredValue;
- QPalette pal(palette());
- pal.setColor(QPalette::Active, QColorGroup::Text, params->textColor);
+ TQPalette pal(palette());
+ pal.setColor(TQPalette::Active, TQColorGroup::Text, params->textColor);
setPalette(pal);
setFont(params->font);
//! @todo support rich text...
/* m_slotTextChanged_enabled = false;
//for rich text...
- const QString origText( text() );
- KTextEdit::setText(QString::null);
+ const TQString origText( text() );
+ KTextEdit::setText(TQString());
setCurrentFont(params->font);
setColor(params->textColor);
KTextEdit::setText(origText);
@@ -196,7 +196,7 @@ void KexiDBTextEdit::selectAll()
KTextEdit::selectAll();
}
-void KexiDBTextEdit::keyPressEvent( QKeyEvent *ke )
+void KexiDBTextEdit::keyPressEvent( TQKeyEvent *ke )
{
// for instance, Windows uses Ctrl+Tab for moving between tabs, so do not steal this shortcut
if (KStdAccel::tabNext().contains( KKey(ke) ) || KStdAccel::tabPrev().contains( KKey(ke) )) {
diff --git a/kexi/plugins/forms/widgets/kexidbtextedit.h b/kexi/plugins/forms/widgets/kexidbtextedit.h
index a380b070..c6f64136 100644
--- a/kexi/plugins/forms/widgets/kexidbtextedit.h
+++ b/kexi/plugins/forms/widgets/kexidbtextedit.h
@@ -33,17 +33,18 @@ class KEXIFORMUTILS_EXPORT KexiDBTextEdit :
public KexiFormDataItemInterface
{
Q_OBJECT
- Q_PROPERTY(QString dataSource READ dataSource WRITE setDataSource DESIGNABLE true)
- Q_PROPERTY(QCString dataSourceMimeType READ dataSourceMimeType WRITE setDataSourceMimeType DESIGNABLE true)
+ TQ_OBJECT
+ TQ_PROPERTY(TQString dataSource READ dataSource WRITE setDataSource DESIGNABLE true)
+ TQ_PROPERTY(TQCString dataSourceMimeType READ dataSourceMimeType WRITE setDataSourceMimeType DESIGNABLE true)
public:
- KexiDBTextEdit(QWidget *parent, const char *name=0);
+ KexiDBTextEdit(TQWidget *tqparent, const char *name=0);
virtual ~KexiDBTextEdit();
- inline QString dataSource() const { return KexiFormDataItemInterface::dataSource(); }
- inline QCString dataSourceMimeType() const { return KexiFormDataItemInterface::dataSourceMimeType(); }
- virtual QVariant value();
- virtual void setInvalidState( const QString& displayText );
+ inline TQString dataSource() const { return KexiFormDataItemInterface::dataSource(); }
+ inline TQCString dataSourceMimeType() const { return KexiFormDataItemInterface::dataSourceMimeType(); }
+ virtual TQVariant value();
+ virtual void setInvalidState( const TQString& displayText );
//! \return true if editor's value is null (not empty)
//! Used for checking if a given constraint within table of form is met.
@@ -59,7 +60,7 @@ class KEXIFORMUTILS_EXPORT KexiDBTextEdit :
virtual bool isReadOnly() const;
/*! \return the view widget of this item, e.g. line edit widget. */
- virtual QWidget* widget();
+ virtual TQWidget* widget();
virtual bool cursorAtStart();
virtual bool cursorAtEnd();
@@ -71,16 +72,16 @@ class KEXIFORMUTILS_EXPORT KexiDBTextEdit :
is displayed in a special way. Used by KexiFormDataProvider::fillDataItems().
\a widget is equal to 'this'.
Reimplemented after KexiFormDataItemInterface. */
- virtual void setDisplayDefaultValue(QWidget* widget, bool displayDefaultValue);
+ virtual void setDisplayDefaultValue(TQWidget* widget, bool displayDefaultValue);
//! Windows uses Ctrl+Tab for moving between tabs, so do not steal this shortcut
- virtual void keyPressEvent( QKeyEvent *ke );
+ virtual void keyPressEvent( TQKeyEvent *ke );
public slots:
- inline void setDataSource(const QString &ds) { KexiFormDataItemInterface::setDataSource(ds); }
- inline void setDataSourceMimeType(const QCString &ds) { KexiFormDataItemInterface::setDataSourceMimeType(ds); }
+ inline void setDataSource(const TQString &ds) { KexiFormDataItemInterface::setDataSource(ds); }
+ inline void setDataSourceMimeType(const TQCString &ds) { KexiFormDataItemInterface::setDataSourceMimeType(ds); }
virtual void setReadOnly( bool readOnly );
- virtual void setText( const QString & text, const QString & context );
+ virtual void setText( const TQString & text, const TQString & context );
//! Reimplemented, so "undo" means the same as "cancelEditor" action
//! @todo enable "real" undo internally so user can use ctrl+z while editing
@@ -99,9 +100,9 @@ class KEXIFORMUTILS_EXPORT KexiDBTextEdit :
void slotTextChanged();
protected:
- virtual void paintEvent ( QPaintEvent * );
- virtual void setValueInternal(const QVariant& add, bool removeOld);
- QPopupMenu * createPopupMenu(const QPoint & pos);
+ virtual void paintEvent ( TQPaintEvent * );
+ virtual void setValueInternal(const TQVariant& add, bool removeOld);
+ TQPopupMenu * createPopupMenu(const TQPoint & pos);
//! Used for extending context menu
KexiDBWidgetContextMenuExtender m_menuExtender;
diff --git a/kexi/plugins/forms/widgets/kexidbtimeedit.cpp b/kexi/plugins/forms/widgets/kexidbtimeedit.cpp
index 82e61b83..f2546a44 100644
--- a/kexi/plugins/forms/widgets/kexidbtimeedit.cpp
+++ b/kexi/plugins/forms/widgets/kexidbtimeedit.cpp
@@ -20,43 +20,43 @@
#include "kexidbtimeedit.h"
-#include <qtoolbutton.h>
-#include <qlayout.h>
-#include <qpainter.h>
+#include <tqtoolbutton.h>
+#include <tqlayout.h>
+#include <tqpainter.h>
#include <kpopupmenu.h>
#include <kdatepicker.h>
#include <kdatetbl.h>
#include <kexiutils/utils.h>
-KexiDBTimeEdit::KexiDBTimeEdit(const QTime &time, QWidget *parent, const char *name)
- : QTimeEdit(time, parent, name), KexiFormDataItemInterface()
+KexiDBTimeEdit::KexiDBTimeEdit(const TQTime &time, TQWidget *tqparent, const char *name)
+ : TQTimeEdit(time, tqparent, name), KexiFormDataItemInterface()
{
m_invalidState = false;
setAutoAdvance(true);
m_cleared = false;
-#ifdef QDateTimeEditor_HACK
- m_dte_time = KexiUtils::findFirstChild<QDateTimeEditor>(this, "QDateTimeEditor");
+#ifdef TQDateTimeEditor_HACK
+ m_dte_time = KexiUtils::findFirstChild<TQDateTimeEditor>(this, "TQDateTimeEditor");
#else
m_dte_time = 0;
#endif
- connect(this, SIGNAL(valueChanged(const QTime&)), this, SLOT(slotValueChanged(const QTime&)));
+ connect(this, TQT_SIGNAL(valueChanged(const TQTime&)), this, TQT_SLOT(slotValueChanged(const TQTime&)));
}
KexiDBTimeEdit::~KexiDBTimeEdit()
{
}
-void KexiDBTimeEdit::setInvalidState( const QString&)
+void KexiDBTimeEdit::setInvalidState( const TQString&)
{
setEnabled(false);
setReadOnly(true);
m_invalidState = true;
//! @todo move this to KexiDataItemInterface::setInvalidStateInternal() ?
if (focusPolicy() & TabFocus)
- setFocusPolicy(QWidget::ClickFocus);
+ setFocusPolicy(TQ_ClickFocus);
}
void
@@ -65,20 +65,20 @@ KexiDBTimeEdit::setEnabled(bool enabled)
// prevent the user from reenabling the widget when it is in invalid state
if(enabled && m_invalidState)
return;
- QTimeEdit::setEnabled(enabled);
+ TQTimeEdit::setEnabled(enabled);
}
-void KexiDBTimeEdit::setValueInternal(const QVariant &add, bool removeOld)
+void KexiDBTimeEdit::setValueInternal(const TQVariant &add, bool removeOld)
{
m_cleared = !m_origValue.isValid();
int setNumberOnFocus = -1;
- QTime t;
- QString addString(add.toString());
+ TQTime t;
+ TQString addString(add.toString());
if (removeOld) {
if (!addString.isEmpty() && addString[0].latin1()>='0' && addString[0].latin1() <='9') {
setNumberOnFocus = addString[0].latin1()-'0';
- t = QTime(setNumberOnFocus, 0, 0);
+ t = TQTime(setNumberOnFocus, 0, 0);
}
}
else
@@ -87,11 +87,11 @@ void KexiDBTimeEdit::setValueInternal(const QVariant &add, bool removeOld)
setTime(t);
}
-QVariant
+TQVariant
KexiDBTimeEdit::value()
{
- //QDateTime - a hack needed because QVariant(QTime) has broken isNull()
- return QVariant(QDateTime( m_cleared ? QDate() : QDate(0,1,2)/*nevermind*/, time()));
+ //TQDateTime - a hack needed because TQVariant(TQTime) has broken isNull()
+ return TQVariant(TQDateTime( m_cleared ? TQDate() : TQDate(0,1,2)/*nevermind*/, time()));
}
bool KexiDBTimeEdit::valueIsNull()
@@ -116,7 +116,7 @@ void KexiDBTimeEdit::setReadOnly(bool set)
m_readOnly = set;
}
-QWidget*
+TQWidget*
KexiDBTimeEdit::widget()
{
return this;
@@ -124,7 +124,7 @@ KexiDBTimeEdit::widget()
bool KexiDBTimeEdit::cursorAtStart()
{
-#ifdef QDateTimeEditor_HACK
+#ifdef TQDateTimeEditor_HACK
return m_dte_time && hasFocus() && m_dte_time->focusSection()==0;
#else
return false;
@@ -133,7 +133,7 @@ bool KexiDBTimeEdit::cursorAtStart()
bool KexiDBTimeEdit::cursorAtEnd()
{
-#ifdef QDateTimeEditor_HACK
+#ifdef TQDateTimeEditor_HACK
return m_dte_time && hasFocus()
&& m_dte_time->focusSection()==int(m_dte_time->sectionCount()-1);
#else
@@ -143,12 +143,12 @@ bool KexiDBTimeEdit::cursorAtEnd()
void KexiDBTimeEdit::clear()
{
- setTime(QTime());
+ setTime(TQTime());
m_cleared = true;
}
void
-KexiDBTimeEdit::slotValueChanged(const QTime&)
+KexiDBTimeEdit::slotValueChanged(const TQTime&)
{
m_cleared = false;
}
diff --git a/kexi/plugins/forms/widgets/kexidbtimeedit.h b/kexi/plugins/forms/widgets/kexidbtimeedit.h
index 9665b1f9..6b29a7ac 100644
--- a/kexi/plugins/forms/widgets/kexidbtimeedit.h
+++ b/kexi/plugins/forms/widgets/kexidbtimeedit.h
@@ -23,26 +23,27 @@
#include "kexiformdataiteminterface.h"
#include "kexidbtextwidgetinterface.h"
-#include <qdatetimeedit.h>
+#include <tqdatetimeedit.h>
-class QDateTimeEditor;
+class TQDateTimeEditor;
//! @short A db-aware time editor
-class KEXIFORMUTILS_EXPORT KexiDBTimeEdit : public QTimeEdit, public KexiFormDataItemInterface
+class KEXIFORMUTILS_EXPORT KexiDBTimeEdit : public TQTimeEdit, public KexiFormDataItemInterface
{
Q_OBJECT
- Q_PROPERTY(QString dataSource READ dataSource WRITE setDataSource DESIGNABLE true)
- Q_PROPERTY(QCString dataSourceMimeType READ dataSourceMimeType WRITE setDataSourceMimeType DESIGNABLE true)
- Q_PROPERTY( bool readOnly READ isReadOnly WRITE setReadOnly DESIGNABLE true )
+ TQ_OBJECT
+ TQ_PROPERTY(TQString dataSource READ dataSource WRITE setDataSource DESIGNABLE true)
+ TQ_PROPERTY(TQCString dataSourceMimeType READ dataSourceMimeType WRITE setDataSourceMimeType DESIGNABLE true)
+ TQ_PROPERTY( bool readOnly READ isReadOnly WRITE setReadOnly DESIGNABLE true )
public:
- KexiDBTimeEdit(const QTime &time, QWidget *parent, const char *name=0);
+ KexiDBTimeEdit(const TQTime &time, TQWidget *tqparent, const char *name=0);
virtual ~KexiDBTimeEdit();
- inline QString dataSource() const { return KexiFormDataItemInterface::dataSource(); }
- inline QCString dataSourceMimeType() const { return KexiFormDataItemInterface::dataSourceMimeType(); }
- virtual QVariant value();
- virtual void setInvalidState( const QString& displayText );
+ inline TQString dataSource() const { return KexiFormDataItemInterface::dataSource(); }
+ inline TQCString dataSourceMimeType() const { return KexiFormDataItemInterface::dataSourceMimeType(); }
+ virtual TQVariant value();
+ virtual void setInvalidState( const TQString& displayText );
//! \return true if editor's value is null (not empty)
//! Used for checking if a given constraint within table of form is met.
@@ -58,7 +59,7 @@ class KEXIFORMUTILS_EXPORT KexiDBTimeEdit : public QTimeEdit, public KexiFormDat
virtual bool isReadOnly() const;
/*! \return the view widget of this item, e.g. line edit widget. */
- virtual QWidget* widget();
+ virtual TQWidget* widget();
virtual bool cursorAtStart();
virtual bool cursorAtEnd();
@@ -67,18 +68,18 @@ class KEXIFORMUTILS_EXPORT KexiDBTimeEdit : public QTimeEdit, public KexiFormDat
virtual void setEnabled(bool enabled);
public slots:
- inline void setDataSource(const QString &ds) { KexiFormDataItemInterface::setDataSource(ds); }
- inline void setDataSourceMimeType(const QCString &ds) { KexiFormDataItemInterface::setDataSourceMimeType(ds); }
+ inline void setDataSource(const TQString &ds) { KexiFormDataItemInterface::setDataSource(ds); }
+ inline void setDataSourceMimeType(const TQCString &ds) { KexiFormDataItemInterface::setDataSourceMimeType(ds); }
virtual void setReadOnly(bool set);
protected slots:
- void slotValueChanged(const QTime&);
+ void slotValueChanged(const TQTime&);
protected:
- virtual void setValueInternal(const QVariant& add, bool removeOld);
+ virtual void setValueInternal(const TQVariant& add, bool removeOld);
private:
- QDateTimeEditor* m_dte_time;
+ TQDateTimeEditor* m_dte_time;
bool m_invalidState : 1;
bool m_cleared : 1;
bool m_readOnly : 1;
diff --git a/kexi/plugins/forms/widgets/kexidbutils.cpp b/kexi/plugins/forms/widgets/kexidbutils.cpp
index 0c08d64c..ba9f2aec 100644
--- a/kexi/plugins/forms/widgets/kexidbutils.cpp
+++ b/kexi/plugins/forms/widgets/kexidbutils.cpp
@@ -30,15 +30,15 @@
#include <widget/utils/kexicontextmenuutils.h>
-QColor lighterGrayBackgroundColor(const QPalette& palette)
+TQColor lighterGrayBackgroundColor(const TQPalette& palette)
{
return KexiUtils::blendedColors(palette.active().background(), palette.active().base(), 1, 2);
}
//-------
-KexiDBWidgetContextMenuExtender::KexiDBWidgetContextMenuExtender( QObject* parent, KexiDataItemInterface* iface )
- : QObject(parent)
+KexiDBWidgetContextMenuExtender::KexiDBWidgetContextMenuExtender( TQObject* tqparent, KexiDataItemInterface* iface )
+ : TQObject(tqparent)
, m_iface(iface)
, m_contextMenuHasTitle(false)
{
@@ -48,7 +48,7 @@ KexiDBWidgetContextMenuExtender::~KexiDBWidgetContextMenuExtender()
{
}
-void KexiDBWidgetContextMenuExtender::createTitle(QPopupMenu *menu)
+void KexiDBWidgetContextMenuExtender::createTitle(TQPopupMenu *menu)
{
if (!menu)
return;
@@ -56,9 +56,9 @@ void KexiDBWidgetContextMenuExtender::createTitle(QPopupMenu *menu)
KPopupTitle *titleItem = new KPopupTitle();
const int id = m_contextMenu->insertItem(titleItem, -1, 0);
m_contextMenu->setItemEnabled(id, false);
- QString icon;
- if (dynamic_cast<QWidget*>(m_iface))
- icon = KexiFormPart::library()->iconName(dynamic_cast<QWidget*>(m_iface)->className());
+ TQString icon;
+ if (dynamic_cast<TQWidget*>(m_iface))
+ icon = KexiFormPart::library()->iconName(dynamic_cast<TQWidget*>(m_iface)->className());
m_contextMenuHasTitle = m_iface->columnInfo() ?
KexiContextMenuUtils::updateTitle(m_contextMenu,
diff --git a/kexi/plugins/forms/widgets/kexidbutils.h b/kexi/plugins/forms/widgets/kexidbutils.h
index 386f1ee5..06f49406 100644
--- a/kexi/plugins/forms/widgets/kexidbutils.h
+++ b/kexi/plugins/forms/widgets/kexidbutils.h
@@ -20,36 +20,36 @@
#ifndef KDBWIDGETS_UTILS_H
#define KDBWIDGETS_UTILS_H
-#include <qpopupmenu.h>
+#include <tqpopupmenu.h>
#include <kexidataiteminterface.h>
-QColor lighterGrayBackgroundColor(const QPalette& palette);
+TQColor lighterGrayBackgroundColor(const TQPalette& palette);
//! @short Used for extending editor widgets' context menu.
/*! @internal This is performed by adding a title and disabling editing
actions when "read only" flag is true. */
-class KexiDBWidgetContextMenuExtender : public QObject
+class KexiDBWidgetContextMenuExtender : public TQObject
{
public:
- KexiDBWidgetContextMenuExtender( QObject* parent, KexiDataItemInterface* iface );
+ KexiDBWidgetContextMenuExtender( TQObject* tqparent, KexiDataItemInterface* iface );
~KexiDBWidgetContextMenuExtender();
//! Creates title for context menu \a menu
- void createTitle(QPopupMenu *menu);
+ void createTitle(TQPopupMenu *menu);
//! Enables or disables context menu actions that can modify the value.
//! The menu has to be previously provided by createTitle().
void updatePopupMenuActions();
/*! Updates title for context menu based on data item \a iface caption or name
- Used in createTitle(QPopupMenu *menu) and KexiDBImageBox.
+ Used in createTitle(TQPopupMenu *menu) and KexiDBImageBox.
\return true is the title has been added. */
- static bool updateContextMenuTitleForDataItem(QPopupMenu *menu, KexiDataItemInterface* iface,
- const QString& icon = QString::null);
+ static bool updateContextMenuTitleForDataItem(TQPopupMenu *menu, KexiDataItemInterface* iface,
+ const TQString& icon = TQString());
protected:
KexiDataItemInterface* m_iface;
- QGuardedPtr<QPopupMenu> m_contextMenu;
+ TQGuardedPtr<TQPopupMenu> m_contextMenu;
bool m_contextMenuHasTitle; //!< true if KPopupTitle has been added to the context menu.
};
diff --git a/kexi/plugins/forms/widgets/kexiframe.cpp b/kexi/plugins/forms/widgets/kexiframe.cpp
index b49386da..b33581d7 100644
--- a/kexi/plugins/forms/widgets/kexiframe.cpp
+++ b/kexi/plugins/forms/widgets/kexiframe.cpp
@@ -19,8 +19,8 @@
#include "kexiframe.h"
-#include <qpainter.h>
-#include <qdrawutil.h>
+#include <tqpainter.h>
+#include <tqdrawutil.h>
#include <kexiutils/utils.h>
//! @internal
@@ -33,7 +33,7 @@ class KexiFrame::Private
~Private()
{
}
- QColor frameColor;
+ TQColor frameColor;
#if 0
//todo
KexiFrame::Shape frameShape;
@@ -43,15 +43,15 @@ class KexiFrame::Private
//=========================================================
-KexiFrame::KexiFrame( QWidget * parent, const char * name, WFlags f )
- : QFrame(parent, name, f)
+KexiFrame::KexiFrame( TQWidget * tqparent, const char * name, WFlags f )
+ : TQFrame(tqparent, name, f)
, d( new Private() )
{
//defaults
- d->frameColor = palette().active().foreground();
+ d->frameColor = tqpalette().active().foreground();
//! @todo obtain these defaults from current template's style...
setLineWidth(2);
- setFrameStyle(QFrame::StyledPanel|QFrame::Raised);
+ setFrameStyle(TQFrame::StyledPanel|TQFrame::Raised);
}
KexiFrame::~KexiFrame()
@@ -59,19 +59,19 @@ KexiFrame::~KexiFrame()
delete d;
}
-void KexiFrame::dragMoveEvent( QDragMoveEvent *e )
+void KexiFrame::dragMoveEvent( TQDragMoveEvent *e )
{
- QFrame::dragMoveEvent(e);
+ TQFrame::dragMoveEvent(e);
emit handleDragMoveEvent(e);
}
-void KexiFrame::dropEvent( QDropEvent *e )
+void KexiFrame::dropEvent( TQDropEvent *e )
{
- QFrame::dropEvent(e);
+ TQFrame::dropEvent(e);
emit handleDropEvent(e);
}
#define ClassName KexiFrame
-#define SuperClassName QFrame
+#define SuperClassName TQFrame
#include "kexiframeutils_p.cpp"
#include "kexiframe.moc"
diff --git a/kexi/plugins/forms/widgets/kexiframe.h b/kexi/plugins/forms/widgets/kexiframe.h
index 8d60d597..d960cefd 100644
--- a/kexi/plugins/forms/widgets/kexiframe.h
+++ b/kexi/plugins/forms/widgets/kexiframe.h
@@ -20,62 +20,63 @@
#ifndef KexiFrame_H
#define KexiFrame_H
-#include <qframe.h>
+#include <tqframe.h>
//! @short Frame widget for Kexi forms
-class KEXIFORMUTILS_EXPORT KexiFrame : public QFrame
+class KEXIFORMUTILS_EXPORT KexiFrame : public TQFrame
{
Q_OBJECT
+ TQ_OBJECT
//todo Q_ENUMS( Shape Shadow )
- Q_PROPERTY( QColor frameColor READ frameColor WRITE setFrameColor DESIGNABLE true )
-//todo Q_OVERRIDE( Shape frameShape READ frameShape WRITE setFrameShape )
-//todo Q_OVERRIDE( Shadow frameShadow READ frameShadow WRITE setFrameShadow )
+ TQ_PROPERTY( TQColor frameColor READ frameColor WRITE setFrameColor DESIGNABLE true )
+//todo TQ_OVERRIDE( Shape frameShape READ frameShape WRITE setFrameShape )
+//todo TQ_OVERRIDE( Shadow frameShadow READ frameShadow WRITE setFrameShadow )
public:
- KexiFrame( QWidget * parent, const char * name = 0, WFlags f = 0 );
+ KexiFrame( TQWidget * tqparent, const char * name = 0, WFlags f = 0 );
virtual ~KexiFrame();
- virtual const QColor& frameColor() const;
+ virtual const TQColor& frameColor() const;
#if 0
//! @todo more options
enum Shadow {
- NoShadow = QFrame::Plain,
- Raised = QFrame::Raised,
- Sunken = QFrame::Sunken
+ NoShadow = TQFrame::Plain,
+ Raised = TQFrame::Raised,
+ Sunken = TQFrame::Sunken
};
//! @todo more options
- enum Shape { NoFrame = QFrame::NoFrame, //!< no frame
- Box = QFrame::Box, //!< rectangular box
- Panel = QFrame::Panel, //!< rectangular panel
- StyledPanel = QFrame::StyledPanel, //!< rectangular panel depending on the GUI style
- GroupBoxPanel = QFrame::GroupBoxPanel //!< rectangular group-box-like panel depending on the GUI style
+ enum Shape { NoFrame = TQFrame::NoFrame, //!< no frame
+ Box = TQFrame::Box, //!< rectangular box
+ Panel = TQFrame::Panel, //!< rectangular panel
+ StyledPanel = TQFrame::StyledPanel, //!< rectangular panel depending on the GUI style
+ GroupBoxPanel = TQFrame::GroupBoxPanel //!< rectangular group-box-like panel depending on the GUI style
};
Shape frameShape() const;
- void setFrameShape( KexiFrame::Shape shape );
+ void setFrameShape( KexiFrame::Shape tqshape );
Shadow frameShadow() const;
void setFrameShadow( KexiFrame::Shadow shadow );
#endif
//! Used to emit handleDragMoveEvent() signal needed to control dragging over the container's surface
- virtual void dragMoveEvent( QDragMoveEvent *e );
+ virtual void dragMoveEvent( TQDragMoveEvent *e );
//! Used to emit handleDropEvent() signal needed to control dropping on the container's surface
- virtual void dropEvent( QDropEvent *e );
+ virtual void dropEvent( TQDropEvent *e );
public slots:
- virtual void setPalette( const QPalette &pal );
- virtual void setFrameColor(const QColor& color);
+ virtual void setPalette( const TQPalette &pal );
+ virtual void setFrameColor(const TQColor& color);
signals:
//! Needed to control dragging over the container's surface
- void handleDragMoveEvent(QDragMoveEvent *e);
+ void handleDragMoveEvent(TQDragMoveEvent *e);
//! Needed to control dropping on the container's surface
- void handleDropEvent(QDropEvent *e);
+ void handleDropEvent(TQDropEvent *e);
protected:
- virtual void drawFrame( QPainter * );
+ virtual void drawFrame( TQPainter * );
class Private;
Private *d;
diff --git a/kexi/plugins/forms/widgets/kexiframeutils_p.cpp b/kexi/plugins/forms/widgets/kexiframeutils_p.cpp
index 11b8650a..331909ee 100644
--- a/kexi/plugins/forms/widgets/kexiframeutils_p.cpp
+++ b/kexi/plugins/forms/widgets/kexiframeutils_p.cpp
@@ -20,13 +20,13 @@
/* This file is included by KexiDBLabel and KexiFrame */
//! @todo add more frame types
-void ClassName::drawFrame( QPainter *p )
+void ClassName::drawFrame( TQPainter *p )
{
- if (frameShape() == QFrame::Box) {
+ if (frameShape() == TQFrame::Box) {
if ( frameShadow() == Plain )
qDrawPlainRect( p, frameRect(), d->frameColor, lineWidth() );
else
- qDrawShadeRect( p, frameRect(), colorGroup(), frameShadow() == QFrame::Sunken,
+ qDrawShadeRect( p, frameRect(), tqcolorGroup(), frameShadow() == TQFrame::Sunken,
lineWidth(), midLineWidth() );
}
else {
@@ -34,28 +34,28 @@ void ClassName::drawFrame( QPainter *p )
}
}
-void ClassName::setPalette( const QPalette &pal )
+void ClassName::setPalette( const TQPalette &pal )
{
- QPalette pal2(pal);
- QColorGroup cg( pal2.active() );
- cg.setColor(QColorGroup::Light, KexiUtils::bleachedColor( d->frameColor, 150 ));
- cg.setColor(QColorGroup::Mid, d->frameColor);
- cg.setColor(QColorGroup::Dark, d->frameColor.dark(150));
+ TQPalette pal2(pal);
+ TQColorGroup cg( pal2.active() );
+ cg.setColor(TQColorGroup::Light, KexiUtils::bleachedColor( d->frameColor, 150 ));
+ cg.setColor(TQColorGroup::Mid, d->frameColor);
+ cg.setColor(TQColorGroup::Dark, d->frameColor.dark(150));
pal2.setActive(cg);
- QColorGroup cg2( pal2.inactive() );
- cg2.setColor(QColorGroup::Light, cg.light() );
- cg2.setColor(QColorGroup::Mid, cg.mid());
- cg2.setColor(QColorGroup::Dark, cg.dark());
+ TQColorGroup cg2( pal2.inactive() );
+ cg2.setColor(TQColorGroup::Light, cg.light() );
+ cg2.setColor(TQColorGroup::Mid, cg.mid());
+ cg2.setColor(TQColorGroup::Dark, cg.dark());
pal2.setInactive(cg2);
SuperClassName::setPalette(pal2);
}
-const QColor& ClassName::frameColor() const
+const TQColor& ClassName::frameColor() const
{
return d->frameColor;
}
-void ClassName::setFrameColor(const QColor& color)
+void ClassName::setFrameColor(const TQColor& color)
{
d->frameColor = color;
//update light and dark colors
@@ -69,9 +69,9 @@ ClassName::Shape ClassName::frameShape() const
return d->frameShape;
}
-void ClassName::setFrameShape( ClassName::Shape shape )
+void ClassName::setFrameShape( ClassName::Shape tqshape )
{
- d->frameShape = shape;
+ d->frameShape = tqshape;
update();
}
@@ -88,33 +88,33 @@ void ClassName::setFrameShadow( ClassName::Shadow shadow )
#endif
#if 0
-void QFrame::drawFrame( QPainter *p )
+void TQFrame::drawFrame( TQPainter *p )
{
- QPoint p1, p2;
- QRect r = frameRect();
+ TQPoint p1, p2;
+ TQRect r = frameRect();
int type = fstyle & MShape;
int cstyle = fstyle & MShadow;
-#ifdef QT_NO_DRAWUTIL
+#ifdef TQT_NO_DRAWUTIL
p->setPen( black ); // ####
p->drawRect( r ); //### a bit too simple
#else
- const QColorGroup & g = colorGroup();
+ const TQColorGroup & g = tqcolorGroup();
-#ifndef QT_NO_STYLE
- QStyleOption opt(lineWidth(),midLineWidth());
+#ifndef TQT_NO_STYLE
+ TQStyleOption opt(lineWidth(),midLineWidth());
- QStyle::SFlags flags = QStyle::Style_Default;
+ TQStyle::SFlags flags = TQStyle::Style_Default;
if (isEnabled())
- flags |= QStyle::Style_Enabled;
+ flags |= TQStyle::Style_Enabled;
if (cstyle == Sunken)
- flags |= QStyle::Style_Sunken;
+ flags |= TQStyle::Style_Sunken;
else if (cstyle == Raised)
- flags |= QStyle::Style_Raised;
+ flags |= TQStyle::Style_Raised;
if (hasFocus())
- flags |= QStyle::Style_HasFocus;
+ flags |= TQStyle::Style_HasFocus;
if (hasMouse())
- flags |= QStyle::Style_MouseOver;
-#endif // QT_NO_STYLE
+ flags |= TQStyle::Style_MouseOver;
+#endif // TQT_NO_STYLE
switch ( type ) {
@@ -127,60 +127,60 @@ void QFrame::drawFrame( QPainter *p )
break;
case LineEditPanel:
- style().drawPrimitive( QStyle::PE_PanelLineEdit, p, r, g, flags, opt );
+ style().drawPrimitive( TQStyle::PE_PanelLineEdit, p, r, g, flags, opt );
break;
case GroupBoxPanel:
- style().drawPrimitive( QStyle::PE_PanelGroupBox, p, r, g, flags, opt );
+ style().drawPrimitive( TQStyle::PE_PanelGroupBox, p, r, g, flags, opt );
break;
case TabWidgetPanel:
- style().drawPrimitive( QStyle::PE_PanelTabWidget, p, r, g, flags, opt );
+ style().drawPrimitive( TQStyle::PE_PanelTabWidget, p, r, g, flags, opt );
break;
case MenuBarPanel:
-#ifndef QT_NO_STYLE
- style().drawPrimitive(QStyle::PE_PanelMenuBar, p, r, g, flags, opt);
+#ifndef TQT_NO_STYLE
+ style().drawPrimitive(TQStyle::PE_PanelMenuBar, p, r, g, flags, opt);
break;
-#endif // fall through to Panel if QT_NO_STYLE
+#endif // fall through to Panel if TQT_NO_STYLE
case ToolBarPanel:
-#ifndef QT_NO_STYLE
- style().drawPrimitive( QStyle::PE_PanelDockWindow, p, rect(), g, flags, opt);
+#ifndef TQT_NO_STYLE
+ style().drawPrimitive( TQStyle::PE_PanelDockWindow, p, rect(), g, flags, opt);
break;
-#endif // fall through to Panel if QT_NO_STYLE
+#endif // fall through to Panel if TQT_NO_STYLE
case StyledPanel:
-#ifndef QT_NO_STYLE
+#ifndef TQT_NO_STYLE
if ( cstyle == Plain )
qDrawPlainRect( p, r, g.foreground(), lwidth );
else
- style().drawPrimitive(QStyle::PE_Panel, p, r, g, flags, opt);
+ style().drawPrimitive(TQStyle::PE_Panel, p, r, g, flags, opt);
break;
-#endif // fall through to Panel if QT_NO_STYLE
+#endif // fall through to Panel if TQT_NO_STYLE
case PopupPanel:
-#ifndef QT_NO_STYLE
+#ifndef TQT_NO_STYLE
{
- int vextra = style().pixelMetric(QStyle::PM_PopupMenuFrameVerticalExtra, this),
- hextra = style().pixelMetric(QStyle::PM_PopupMenuFrameHorizontalExtra, this);
+ int vextra = style().tqpixelMetric(TQStyle::PM_PopupMenuFrameVerticalExtra, this),
+ hextra = style().tqpixelMetric(TQStyle::PM_PopupMenuFrameHorizontalExtra, this);
if(vextra > 0 || hextra > 0) {
- QRect fr = frameRect();
+ TQRect fr = frameRect();
int fw = frameWidth();
if(vextra > 0) {
- style().drawControl(QStyle::CE_PopupMenuVerticalExtra, p, this,
- QRect(fr.x() + fw, fr.y() + fw, fr.width() - (fw*2), vextra),
+ style().tqdrawControl(TQStyle::CE_PopupMenuVerticalExtra, p, this,
+ TQRect(fr.x() + fw, fr.y() + fw, fr.width() - (fw*2), vextra),
g, flags, opt);
- style().drawControl(QStyle::CE_PopupMenuVerticalExtra, p, this,
- QRect(fr.x() + fw, fr.bottom() - fw - vextra, fr.width() - (fw*2), vextra),
+ style().tqdrawControl(TQStyle::CE_PopupMenuVerticalExtra, p, this,
+ TQRect(fr.x() + fw, fr.bottom() - fw - vextra, fr.width() - (fw*2), vextra),
g, flags, opt);
}
if(hextra > 0) {
- style().drawControl(QStyle::CE_PopupMenuHorizontalExtra, p, this,
- QRect(fr.x() + fw, fr.y() + fw + vextra, hextra, fr.height() - (fw*2) - vextra),
+ style().tqdrawControl(TQStyle::CE_PopupMenuHorizontalExtra, p, this,
+ TQRect(fr.x() + fw, fr.y() + fw + vextra, hextra, fr.height() - (fw*2) - vextra),
g, flags, opt);
- style().drawControl(QStyle::CE_PopupMenuHorizontalExtra, p, this,
- QRect(fr.right() - fw - hextra, fr.y() + fw + vextra, hextra, fr.height() - (fw*2) - vextra),
+ style().tqdrawControl(TQStyle::CE_PopupMenuHorizontalExtra, p, this,
+ TQRect(fr.right() - fw - hextra, fr.y() + fw + vextra, hextra, fr.height() - (fw*2) - vextra),
g, flags, opt);
}
}
@@ -188,10 +188,10 @@ void QFrame::drawFrame( QPainter *p )
if ( cstyle == Plain )
qDrawPlainRect( p, r, g.foreground(), lwidth );
else
- style().drawPrimitive(QStyle::PE_PanelPopup, p, r, g, flags, opt);
+ style().drawPrimitive(TQStyle::PE_PanelPopup, p, r, g, flags, opt);
break;
}
-#endif // fall through to Panel if QT_NO_STYLE
+#endif // fall through to Panel if TQT_NO_STYLE
case Panel:
if ( cstyle == Plain )
@@ -209,16 +209,16 @@ void QFrame::drawFrame( QPainter *p )
case HLine:
case VLine:
if ( type == HLine ) {
- p1 = QPoint( r.x(), r.height()/2 );
- p2 = QPoint( r.x()+r.width(), p1.y() );
+ p1 = TQPoint( r.x(), r.height()/2 );
+ p2 = TQPoint( r.x()+r.width(), p1.y() );
}
else {
- p1 = QPoint( r.x()+r.width()/2, 0 );
- p2 = QPoint( p1.x(), r.height() );
+ p1 = TQPoint( r.x()+r.width()/2, 0 );
+ p2 = TQPoint( p1.x(), r.height() );
}
if ( cstyle == Plain ) {
- QPen oldPen = p->pen();
- p->setPen( QPen(g.foreground(),lwidth) );
+ TQPen oldPen = p->pen();
+ p->setPen( TQPen(g.foreground(),lwidth) );
p->drawLine( p1, p2 );
p->setPen( oldPen );
}
@@ -227,6 +227,6 @@ void QFrame::drawFrame( QPainter *p )
lwidth, midLineWidth() );
break;
}
-#endif // QT_NO_DRAWUTIL
+#endif // TQT_NO_DRAWUTIL
#endif
diff --git a/kexi/plugins/forms/widgets/kexipushbutton.cpp b/kexi/plugins/forms/widgets/kexipushbutton.cpp
index acfda0a4..95d0b92e 100644
--- a/kexi/plugins/forms/widgets/kexipushbutton.cpp
+++ b/kexi/plugins/forms/widgets/kexipushbutton.cpp
@@ -20,8 +20,8 @@
#include "kexipushbutton.h"
-KexiPushButton::KexiPushButton( const QString & text, QWidget * parent, const char * name )
-: KPushButton(text, parent, name)
+KexiPushButton::KexiPushButton( const TQString & text, TQWidget * tqparent, const char * name )
+: KPushButton(text, tqparent, name)
{
}
diff --git a/kexi/plugins/forms/widgets/kexipushbutton.h b/kexi/plugins/forms/widgets/kexipushbutton.h
index 12c01631..3dd8f0a9 100644
--- a/kexi/plugins/forms/widgets/kexipushbutton.h
+++ b/kexi/plugins/forms/widgets/kexipushbutton.h
@@ -28,25 +28,26 @@
class KEXIFORMUTILS_EXPORT KexiPushButton : public KPushButton
{
Q_OBJECT
- Q_PROPERTY(QString onClickAction READ onClickAction WRITE setOnClickAction DESIGNABLE true)
- Q_PROPERTY(QString onClickActionOption READ onClickActionOption WRITE setOnClickActionOption DESIGNABLE true)
+ TQ_OBJECT
+ TQ_PROPERTY(TQString onClickAction READ onClickAction WRITE setOnClickAction DESIGNABLE true)
+ TQ_PROPERTY(TQString onClickActionOption READ onClickActionOption WRITE setOnClickActionOption DESIGNABLE true)
public:
- KexiPushButton( const QString & text, QWidget * parent, const char * name = 0 );
+ KexiPushButton( const TQString & text, TQWidget * tqparent, const char * name = 0 );
~KexiPushButton();
public slots:
//! action string for "on click" event
//! @see KexiFormPart::slotAssignAction()
//! @see KexiFormEventAction::ActionData
- QString onClickAction() const { return m_onClickActionData.string; }
- void setOnClickAction(const QString& actionString) { m_onClickActionData.string = actionString; }
+ TQString onClickAction() const { return m_onClickActionData.string; }
+ void setOnClickAction(const TQString& actionString) { m_onClickActionData.string = actionString; }
//! action option allowing to select whether the object should be opened in data view mode or printed, etc.
//! @see KexiFormPart::slotAssignAction()
//! @see KexiFormEventAction::ActionData
- QString onClickActionOption() const { return m_onClickActionData.option; }
- void setOnClickActionOption(const QString& option) { m_onClickActionData.option = option; }
+ TQString onClickActionOption() const { return m_onClickActionData.option; }
+ void setOnClickActionOption(const TQString& option) { m_onClickActionData.option = option; }
protected:
KexiFormEventAction::ActionData m_onClickActionData;