diff options
author | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2011-06-25 05:28:35 +0000 |
---|---|---|
committer | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2011-06-25 05:28:35 +0000 |
commit | f008adb5a77e094eaf6abf3fc0f36958e66896a5 (patch) | |
tree | 8e9244c4d4957c36be81e15b566b4aa5ea26c982 /kexi/widget | |
parent | 1210f27b660efb7b37ff43ec68763e85a403471f (diff) | |
download | koffice-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/widget')
123 files changed, 4042 insertions, 3951 deletions
diff --git a/kexi/widget/kexibrowser.cpp b/kexi/widget/kexibrowser.cpp index ca637cd2..a4ec402f 100644 --- a/kexi/widget/kexibrowser.cpp +++ b/kexi/widget/kexibrowser.cpp @@ -22,12 +22,12 @@ #include "kexibrowser_p.h" #include "kexibrowseritem.h" -#include <qheader.h> -#include <qpoint.h> -#include <qpixmapcache.h> -#include <qtoolbutton.h> -#include <qtooltip.h> -#include <qwhatsthis.h> +#include <tqheader.h> +#include <tqpoint.h> +#include <tqpixmapcache.h> +#include <tqtoolbutton.h> +#include <tqtooltip.h> +#include <tqwhatsthis.h> #include <kapplication.h> #include <kiconloader.h> @@ -53,23 +53,23 @@ #include <kexidb/utils.h> /* -class KexiBrowserView : public QWidget +class KexiBrowserView : public TQWidget { KexiBrowserView*( }; KexiBrowserView::KexiBrowserView(KexiMainWindow *mainWin) - : QWidget(mainWin, "KexiBrowserView") + : TQWidget(mainWin, "KexiBrowserView") { - QVBoxLayout *lyr = new QVBoxLayout(this); + TQVBoxLayout *lyr = new TQVBoxLayout(this); KexiFlowLayout *buttons_flyr = new KexiFlowLayout(lyr); m_browser = KexiBrowser(this, mainWin); lyr->addWidget(m_browser); setFocusProxy(m_browser); }*/ -KexiBrowser::KexiBrowser(QWidget* parent, KexiMainWindow *mainWin, int features) - : QWidget(parent, "KexiBrowser") +KexiBrowser::KexiBrowser(TQWidget* tqparent, KexiMainWindow *mainWin, int features) + : TQWidget(tqparent, "KexiBrowser") , m_mainWin(mainWin) , m_features(features) , m_actions( new KActionCollection(this) ) @@ -84,14 +84,14 @@ KexiBrowser::KexiBrowser(QWidget* parent, KexiMainWindow *mainWin, int features) setCaption(i18n("Project Navigator")); setIcon(*m_mainWin->icon()); - QVBoxLayout *lyr = new QVBoxLayout(this); + TQVBoxLayout *lyr = new TQVBoxLayout(this); KexiFlowLayout *buttons_flyr = new KexiFlowLayout(lyr); m_list = new KexiBrowserListView(this); lyr->addWidget(m_list); m_list->installEventFilter(this); m_list->renameLineEdit()->installEventFilter(this); - connect( kapp, SIGNAL( settingsChanged(int) ), SLOT( slotSettingsChanged(int) ) ); + connect( kapp, TQT_SIGNAL( settingsChanged(int) ), TQT_SLOT( slotSettingsChanged(int) ) ); slotSettingsChanged(0); m_list->header()->hide(); @@ -101,30 +101,30 @@ KexiBrowser::KexiBrowser(QWidget* parent, KexiMainWindow *mainWin, int features) m_list->sort(); m_list->setAllColumnsShowFocus(true); m_list->setTooltipColumn(0); - m_list->renameLineEdit()->setValidator( new KexiUtils::IdentifierValidator(this) ); - m_list->setResizeMode(QListView::LastColumn); - connect(m_list, SIGNAL(contextMenu(KListView *, QListViewItem *, const QPoint &)), - this, SLOT(slotContextMenu(KListView*, QListViewItem *, const QPoint&))); - connect(m_list, SIGNAL(selectionChanged(QListViewItem*)), this, - SLOT(slotSelectionChanged(QListViewItem*))); + m_list->renameLineEdit()->setValidator( new KexiUtils::IdentifierValidator(TQT_TQOBJECT(this)) ); + m_list->setResizeMode(TQListView::LastColumn); + connect(m_list, TQT_SIGNAL(contextMenu(KListView *, TQListViewItem *, const TQPoint &)), + TQT_TQOBJECT(this), TQT_SLOT(slotContextMenu(KListView*, TQListViewItem *, const TQPoint&))); + connect(m_list, TQT_SIGNAL(selectionChanged(TQListViewItem*)), this, + TQT_SLOT(slotSelectionChanged(TQListViewItem*))); KConfig *config = kapp->config(); config->setGroup("MainWindow"); if ((m_features & SingleClickOpensItemOptionEnabled) && config->readBoolEntry("SingleClickOpensItem", false)) { - connect(m_list, SIGNAL(executed(QListViewItem*)), this, - SLOT(slotExecuteItem(QListViewItem*))); + connect(m_list, TQT_SIGNAL(executed(TQListViewItem*)), this, + TQT_SLOT(slotExecuteItem(TQListViewItem*))); } else { - connect(m_list, SIGNAL(doubleClicked(QListViewItem*)), this, - SLOT(slotExecuteItem(QListViewItem*))); + connect(m_list, TQT_SIGNAL(doubleClicked(TQListViewItem*)), this, + TQT_SLOT(slotExecuteItem(TQListViewItem*))); m_list->enableExecuteArea = false; } // actions - m_openAction = new KAction(i18n("&Open"), "fileopen", 0/*Qt::Key_Enter conflict!*/, this, - SLOT(slotOpenObject()), this, "open_object"); + m_openAction = new KAction(i18n("&Open"), "fileopen", 0/*TQt::Key_Enter conflict!*/, TQT_TQOBJECT(this), + TQT_SLOT(slotOpenObject()), TQT_TQOBJECT(this), "open_object"); m_openAction->setToolTip(i18n("Open object")); m_openAction->setWhatsThis(i18n("Opens object selected in the list")); @@ -145,21 +145,21 @@ KexiBrowser::KexiBrowser(QWidget* parent, KexiMainWindow *mainWin, int features) m_newObjectPopup = 0; } else { - m_deleteAction = new KAction(i18n("&Delete"), "editdelete", 0/*Qt::Key_Delete*/, - this, SLOT(slotRemove()), m_actions, "edit_delete"); + m_deleteAction = new KAction(i18n("&Delete"), "editdelete", 0/*TQt::Key_Delete*/, + TQT_TQOBJECT(this), TQT_SLOT(slotRemove()), m_actions, "edit_delete"); //! @todo 1.1: just add "Delete" tooltip and what's this - m_deleteAction->setToolTip(i18n("&Delete").replace("&","")); + m_deleteAction->setToolTip(i18n("&Delete").tqreplace("&","")); m_renameAction = new KAction(i18n("&Rename"), "", 0, - this, SLOT(slotRename()), m_actions, "edit_rename"); + TQT_TQOBJECT(this), TQT_SLOT(slotRename()), m_actions, "edit_rename"); #ifdef KEXI_SHOW_UNIMPLEMENTED - //todo plugSharedAction("edit_cut",SLOT(slotCut())); - //todo plugSharedAction("edit_copy",SLOT(slotCopy())); - //todo plugSharedAction("edit_paste",SLOT(slotPaste())); + //todo plugSharedAction("edit_cut",TQT_SLOT(slotCut())); + //todo plugSharedAction("edit_copy",TQT_SLOT(slotCopy())); + //todo plugSharedAction("edit_paste",TQT_SLOT(slotPaste())); #endif - m_designAction = new KAction(i18n("&Design"), "edit", 0/*Qt::CTRL + Qt::Key_Enter conflict!*/, this, - SLOT(slotDesignObject()), this, "design_object"); + m_designAction = new KAction(i18n("&Design"), "edit", 0/*TQt::CTRL + TQt::Key_Enter conflict!*/, TQT_TQOBJECT(this), + TQT_SLOT(slotDesignObject()), TQT_TQOBJECT(this), "design_object"); m_designAction->setToolTip(i18n("Design object")); m_designAction->setWhatsThis(i18n("Starts designing of the object selected in the list")); if (m_features & Toolbar) { @@ -167,21 +167,21 @@ KexiBrowser::KexiBrowser(QWidget* parent, KexiMainWindow *mainWin, int features) buttons_flyr->add(btn); } - m_editTextAction = new KAction(i18n("Open in &Text View"), "", 0, this, - SLOT(slotEditTextObject()), this, "editText_object"); + m_editTextAction = new KAction(i18n("Open in &Text View"), "", 0, TQT_TQOBJECT(this), + TQT_SLOT(slotEditTextObject()), TQT_TQOBJECT(this), "editText_object"); m_editTextAction->setToolTip(i18n("Open object in text view")); m_editTextAction->setWhatsThis(i18n("Opens selected object in the list in text view")); - m_newObjectAction = new KAction("", "filenew", 0, this, SLOT(slotNewObject()), this, "new_object"); + m_newObjectAction = new KAction("", "filenew", 0, TQT_TQOBJECT(this), TQT_SLOT(slotNewObject()), TQT_TQOBJECT(this), "new_object"); if (m_features & Toolbar) { - m_newObjectToolButton = new KexiSmallToolButton(this, "", QIconSet(), "new_object"); + m_newObjectToolButton = new KexiSmallToolButton(this, "", TQIconSet(), "new_object"); m_newObjectPopup = new KPopupMenu(this, "newObjectPopup"); - connect(m_newObjectPopup, SIGNAL(aboutToShow()), this, SLOT(slotNewObjectPopupAboutToShow())); + connect(m_newObjectPopup, TQT_SIGNAL(aboutToShow()), TQT_TQOBJECT(this), TQT_SLOT(slotNewObjectPopupAboutToShow())); // KexiPart::Part* part = Kexi::partManager().part("kexi/table"); // m_newObjectPopup->insertItem( SmallIconSet(part->info()->createItemIcon()), part->instanceName() ); m_newObjectToolButton->setPopup(m_newObjectPopup); - m_newObjectToolButton->setPopupDelay(QApplication::startDragTime()); - connect(m_newObjectToolButton, SIGNAL(clicked()), this, SLOT(slotNewObject())); + m_newObjectToolButton->setPopupDelay(TQApplication::startDragTime()); + connect(m_newObjectToolButton, TQT_SIGNAL(clicked()), TQT_TQOBJECT(this), TQT_SLOT(slotNewObject())); buttons_flyr->add(m_newObjectToolButton); m_deleteObjectToolButton = new KexiSmallToolButton(this, m_deleteAction); @@ -190,22 +190,22 @@ KexiBrowser::KexiBrowser(QWidget* parent, KexiMainWindow *mainWin, int features) } } - m_executeAction = new KAction(i18n("Execute"), "player_play", 0, this, - SLOT(slotExecuteObject()), this, "data_execute"); + m_executeAction = new KAction(i18n("Execute"), "player_play", 0, TQT_TQOBJECT(this), + TQT_SLOT(slotExecuteObject()), TQT_TQOBJECT(this), "data_execute"); m_exportActionMenu = new KActionMenu(i18n("Export")); m_dataExportAction = new KAction(i18n("Export->To File as Data &Table... ", "To &File as Data Table..."), - "table", 0, this, SLOT(slotExportAsDataTable()), this, "exportAsDataTable"); + "table", 0, TQT_TQOBJECT(this), TQT_SLOT(slotExportAsDataTable()), TQT_TQOBJECT(this), "exportAsDataTable"); m_dataExportAction->setWhatsThis( i18n("Exports data from the currently selected table or query data to a file.")); m_exportActionMenu->insert( m_dataExportAction ); - m_printAction = new KAction(i18n("&Print..."), "fileprint", 0, this, - SLOT(slotPrintItem()), this, "printItem"); + m_printAction = new KAction(i18n("&Print..."), "fileprint", 0, TQT_TQOBJECT(this), + TQT_SLOT(slotPrintItem()), TQT_TQOBJECT(this), "printItem"); m_printAction->setWhatsThis( i18n("Prints data from the currently selected table or query.")); - m_pageSetupAction = new KAction(i18n("Page Setup..."), "", 0, this, - SLOT(slotPageSetupForItem()), this, "pageSetupForItem"); + m_pageSetupAction = new KAction(i18n("Page Setup..."), "", 0, TQT_TQOBJECT(this), + TQT_SLOT(slotPageSetupForItem()), TQT_TQOBJECT(this), "pageSetupForItem"); m_pageSetupAction->setWhatsThis( i18n("Shows page setup for printing the active table or query.")); @@ -288,8 +288,8 @@ KexiBrowser::~KexiBrowser() { } -void KexiBrowser::setProject(KexiProject* prj, const QString& itemsMimeType, - QString* partManagerErrorMessages) +void KexiBrowser::setProject(KexiProject* prj, const TQString& itemsMimeType, + TQString* partManagerErrorMessages) { clear(); m_itemsMimeType = itemsMimeType; @@ -333,16 +333,16 @@ void KexiBrowser::setProject(KexiProject* prj, const QString& itemsMimeType, } else { //add this error to the list that will be displayed later - QString msg, details; + TQString msg, details; KexiDB::getHTMLErrorMesage(&Kexi::partManager(), msg, details); if (!msg.isEmpty() && partManagerErrorMessages) { if (partManagerErrorMessages->isEmpty()) { - *partManagerErrorMessages = QString("<qt><p>") + *partManagerErrorMessages = TQString("<qt><p>") +i18n("Errors encountered during loading plugins:")+"<ul>"; } - partManagerErrorMessages->append( QString("<li>") + msg ); + partManagerErrorMessages->append( TQString("<li>") + msg ); if (!details.isEmpty()) - partManagerErrorMessages->append(QString("<br>")+details); + partManagerErrorMessages->append(TQString("<br>")+details); partManagerErrorMessages->append("</li>"); } } @@ -351,7 +351,7 @@ void KexiBrowser::setProject(KexiProject* prj, const QString& itemsMimeType, partManagerErrorMessages->append("</ul></p>"); } -QString KexiBrowser::itemsMimeType() const +TQString KexiBrowser::itemsMimeType() const { return m_itemsMimeType; } @@ -370,18 +370,18 @@ KexiBrowserItem *KexiBrowser::addGroup(KexiPart::Info& info) KexiBrowserItem* KexiBrowser::addItem(KexiPart::Item& item) { //part object for this item - KexiBrowserItem *parent = item.mimeType().isEmpty() ? 0 : m_baseItems.find(item.mimeType().lower()); - return addItem(item, parent, parent->info()); + KexiBrowserItem *tqparent = item.mimeType().isEmpty() ? 0 : m_baseItems.tqfind(item.mimeType().lower()); + return addItem(item, tqparent, tqparent->info()); } -KexiBrowserItem* KexiBrowser::addItem(KexiPart::Item& item, KexiBrowserItem *parent, KexiPart::Info* info) +KexiBrowserItem* KexiBrowser::addItem(KexiPart::Item& item, KexiBrowserItem *tqparent, KexiPart::Info* info) { -// if (!parent) //TODO: add "Other" part group for that +// if (!tqparent) //TODO: add "Other" part group for that // return 0; -// kdDebug() << "KexiBrowser::addItem() found parent:" << parent << endl; +// kdDebug() << "KexiBrowser::addItem() found tqparent:" << tqparent << endl; KexiBrowserItem *bitem; - if (parent) - bitem = new KexiBrowserItem(parent, info, &item); + if (tqparent) + bitem = new KexiBrowserItem(tqparent, info, &item); else bitem = new KexiBrowserItem(m_list, info, &item); m_normalItems.insert(item.identifier(), bitem); @@ -397,10 +397,10 @@ KexiBrowser::slotRemoveItem(const KexiPart::Item &item) KexiBrowserItem *it = static_cast<KexiBrowserItem*>(m_list->selectedItem()); - QListViewItem *new_item_to_select = 0; + TQListViewItem *new_item_to_select = 0; if (it==to_remove) {//compute item to select if current one will be removed new_item_to_select = it->itemBelow();//nearest item to select - if (!new_item_to_select || new_item_to_select->parent()!=it->parent()) { + if (!new_item_to_select || new_item_to_select->tqparent()!=it->tqparent()) { new_item_to_select = it->itemAbove(); } } @@ -411,7 +411,7 @@ KexiBrowser::slotRemoveItem(const KexiPart::Item &item) } void -KexiBrowser::slotContextMenu(KListView* /*list*/, QListViewItem *item, const QPoint &pos) +KexiBrowser::slotContextMenu(KListView* /*list*/, TQListViewItem *item, const TQPoint &pos) { if(!item || !(m_features & ContextMenus)) return; @@ -420,8 +420,8 @@ KexiBrowser::slotContextMenu(KListView* /*list*/, QListViewItem *item, const QPo if (bit->item()) { pm = m_itemPopup; //update popup title - QString title_text = bit->text(0).stripWhiteSpace(); - KexiBrowserItem *par_it = static_cast<KexiBrowserItem*>(bit->parent()); + TQString title_text = bit->text(0).stripWhiteSpace(); + KexiBrowserItem *par_it = static_cast<KexiBrowserItem*>(bit->tqparent()); KexiPart::Part* par_part = 0; if (par_it && par_it->info() && ((par_part = Kexi::partManager().part(par_it->info()))) && !par_part->instanceCaption().isEmpty()) { //add part type name @@ -431,23 +431,23 @@ KexiBrowser::slotContextMenu(KListView* /*list*/, QListViewItem *item, const QPo } else if (m_partPopup) { pm = m_partPopup; - QString title_text = bit->text(0).stripWhiteSpace(); + TQString title_text = bit->text(0).stripWhiteSpace(); pm->changeTitle(m_partPopupTitle_id, *bit->pixmap(0), title_text); /* KexiPart::Part* part = Kexi::partManager().part(bit->info()); if (part) - m_newObjectAction->setText(i18n("&Create Object: %1...").arg( part->instanceName() )); + m_newObjectAction->setText(i18n("&Create Object: %1...").tqarg( part->instanceName() )); else m_newObjectAction->setText(i18n("&Create Object...")); m_newObjectAction->setIconSet( SmallIconSet(bit->info()->itemIcon()) );*/ m_list->setCurrentItem(item); - m_list->repaintItem(item); + m_list->tqrepaintItem(item); } if (pm) pm->exec(pos); } void -KexiBrowser::slotExecuteItem(QListViewItem *vitem) +KexiBrowser::slotExecuteItem(TQListViewItem *vitem) { // kdDebug() << "KexiBrowser::slotExecuteItem()" << endl; KexiBrowserItem *it = static_cast<KexiBrowserItem*>(vitem); @@ -464,14 +464,14 @@ KexiBrowser::slotExecuteItem(QListViewItem *vitem) } void -KexiBrowser::slotSelectionChanged(QListViewItem* i) +KexiBrowser::slotSelectionChanged(TQListViewItem* i) { KexiBrowserItem *it = static_cast<KexiBrowserItem*>(i); if (!it) return; KexiPart::Part* part = Kexi::partManager().part(it->info()); if (!part) { - it = static_cast<KexiBrowserItem*>(it->parent()); + it = static_cast<KexiBrowserItem*>(it->tqparent()); if (it) { part = Kexi::partManager().part(it->info()); } @@ -523,14 +523,14 @@ KexiBrowser::slotSelectionChanged(QListViewItem* i) m_prevSelectedPart = part; if (part) { if (m_newObjectAction) { - m_newObjectAction->setText(i18n("&Create Object: %1...").arg( part->instanceCaption() )); + m_newObjectAction->setText(i18n("&Create Object: %1...").tqarg( part->instanceCaption() )); m_newObjectAction->setIcon( part->info()->createItemIcon() ); if (m_features & Toolbar) { m_newObjectToolButton->setIconSet( part->info()->createItemIcon() ); - QToolTip::add(m_newObjectToolButton, - i18n("Create object: %1").arg( part->instanceCaption().lower() )); - QWhatsThis::add(m_newObjectToolButton, - i18n("Creates a new object: %1").arg( part->instanceCaption().lower() )); + TQToolTip::add(m_newObjectToolButton, + i18n("Create object: %1").tqarg( part->instanceCaption().lower() )); + TQWhatsThis::add(m_newObjectToolButton, + i18n("Creates a new object: %1").tqarg( part->instanceCaption().lower() )); } } } else { @@ -540,8 +540,8 @@ KexiBrowser::slotSelectionChanged(QListViewItem* i) // m_newObjectToolbarAction->setText(m_newObjectAction->text()); if (m_features & Toolbar) { m_newObjectToolButton->setIconSet( "filenew" ); - QToolTip::add(m_newObjectToolButton, i18n("Create object")); - QWhatsThis::add(m_newObjectToolButton, i18n("Creates a new object")); + TQToolTip::add(m_newObjectToolButton, i18n("Create object")); + TQWhatsThis::add(m_newObjectToolButton, i18n("Creates a new object")); } } } @@ -549,56 +549,56 @@ KexiBrowser::slotSelectionChanged(QListViewItem* i) emit selectionChanged(it ? it->item() : 0); } -void KexiBrowser::installEventFilter ( const QObject * filterObj ) +void KexiBrowser::installEventFilter ( const TQObject * filterObj ) { if (!filterObj) return; - m_list->installEventFilter ( filterObj ); - QWidget::installEventFilter ( filterObj ); + m_list->installEventFilter ( const_cast<TQObject*>(filterObj) ); + TQWidget::installEventFilter ( const_cast<TQObject*>(filterObj) ); } -bool KexiBrowser::eventFilter ( QObject *o, QEvent * e ) +bool KexiBrowser::eventFilter ( TQObject *o, TQEvent * e ) { - if (o==m_list && e->type()==QEvent::Resize) { + if (TQT_BASE_OBJECT(o)==TQT_BASE_OBJECT(m_list) && e->type()==TQEvent::Resize) { kdDebug() << "resize!" << endl; } - if (o==m_list->renameLineEdit()) { - if (e->type()==QEvent::Hide) + if (TQT_BASE_OBJECT(o)==TQT_BASE_OBJECT(m_list->renameLineEdit())) { + if (e->type()==TQEvent::Hide) itemRenameDone(); } - else if (e->type()==QEvent::KeyPress) { - QKeyEvent *ke = static_cast<QKeyEvent*>(e); - if (ke->key()==Qt::Key_Enter || ke->key()==Qt::Key_Return) { - if (0==(ke->state() & (Qt::ShiftButton|Qt::ControlButton|Qt::AltButton))) { - QListViewItem *it = m_list->selectedItem(); + else if (e->type()==TQEvent::KeyPress) { + TQKeyEvent *ke = TQT_TQKEYEVENT(e); + if (ke->key()==TQt::Key_Enter || ke->key()==TQt::Key_Return) { + if (0==(ke->state() & (TQt::ShiftButton|TQt::ControlButton|TQt::AltButton))) { + TQListViewItem *it = m_list->selectedItem(); if (it) slotExecuteItem(it); } - else if (Qt::ControlButton==(ke->state() & (Qt::ShiftButton|Qt::ControlButton|Qt::AltButton))) { + else if (TQt::ControlButton==(ke->state() & (TQt::ShiftButton|TQt::ControlButton|TQt::AltButton))) { slotDesignObject(); } } } - else if (e->type()==QEvent::AccelOverride) { - QKeyEvent *ke = static_cast<QKeyEvent*>(e); + else if (e->type()==TQEvent::AccelOverride) { + TQKeyEvent *ke = TQT_TQKEYEVENT(e); //override delete action - if (ke->key()==Qt::Key_Delete && ke->state()==Qt::NoButton) { + if (ke->key()==TQt::Key_Delete && ke->state()==Qt::NoButton) { slotRemove(); ke->accept(); return true; } //override rename action - if (ke->key()==Qt::Key_F2 && ke->state()==Qt::NoButton) { + if (ke->key()==TQt::Key_F2 && ke->state()==Qt::NoButton) { slotRename(); ke->accept(); return true; } -/* else if (ke->key()==Qt::Key_Enter || ke->key()==Qt::Key_Return) { +/* else if (ke->key()==TQt::Key_Enter || ke->key()==TQt::Key_Return) { if (ke->state()==ControlButton) { slotDesignObject(); } else if (ke->state()==0 && !m_list->renameLineEdit()->isVisible()) { - QListViewItem *it = m_list->selectedItem(); + TQListViewItem *it = m_list->selectedItem(); if (it) slotExecuteItem(it); } @@ -695,7 +695,7 @@ void KexiBrowser::itemRenameDone() KexiBrowserItem *it = static_cast<KexiBrowserItem*>(m_list->selectedItem()); if (!it) return; - QString txt = it->text(0).stripWhiteSpace(); + TQString txt = it->text(0).stripWhiteSpace(); bool ok = it->item()->name().lower()!=txt.lower(); //the new name must be different if (ok) { /* TODO */ @@ -710,7 +710,7 @@ void KexiBrowser::itemRenameDone() m_list->nameEndsWithAsterisk = false; } it->setText(0, txt); - it->parent()->sort(); + it->tqparent()->sort(); setFocus(); } @@ -749,7 +749,7 @@ void KexiBrowser::selectItem(KexiPart::Item& item) void KexiBrowser::clearSelection() { m_list->clearSelection(); - QListViewItem *item = m_list->firstChild(); + TQListViewItem *item = m_list->firstChild(); if (item) { m_list->ensureItemVisible(item); } @@ -763,7 +763,7 @@ void KexiBrowser::slotNewObjectPopupAboutToShow() for (KexiPart::PartInfoListIterator it(*list); it.current(); ++it) { //add an item to "New object" toolbar popup KAction *action = m_mainWin->actionCollection()->action( - KexiPart::nameForCreateAction(*it.current()) ); + TQString(KexiPart::nameForCreateAction(*it.current())) ); if (action) { action->plug(m_newObjectPopup); } @@ -798,7 +798,7 @@ KexiPart::Item* KexiBrowser::selectedPartItem() const return it ? it->item() : 0; } -bool KexiBrowser::actionEnabled(const QCString& actionName) const +bool KexiBrowser::actionEnabled(const TQCString& actionName) const { if (actionName=="project_export_data_table" && (m_features & ContextMenus)) return m_itemPopup->isItemVisible(m_exportActionMenu_id); @@ -852,8 +852,8 @@ void KexiBrowser::clear() } //-------------------------------------------- -KexiBrowserListView::KexiBrowserListView(QWidget *parent) - : KListView(parent, "KexiBrowserListView") +KexiBrowserListView::KexiBrowserListView(TQWidget *tqparent) + : KListView(tqparent, "KexiBrowserListView") , nameEndsWithAsterisk(false) , enableExecuteArea(true) { @@ -863,7 +863,7 @@ KexiBrowserListView::~KexiBrowserListView() { } -void KexiBrowserListView::rename(QListViewItem *item, int c) +void KexiBrowserListView::rename(TQListViewItem *item, int c) { if (renameLineEdit()->isVisible()) return; @@ -881,7 +881,7 @@ void KexiBrowserListView::rename(QListViewItem *item, int c) } } -bool KexiBrowserListView::isExecuteArea( const QPoint& point ) +bool KexiBrowserListView::isExecuteArea( const TQPoint& point ) { return enableExecuteArea && KListView::isExecuteArea(point); } diff --git a/kexi/widget/kexibrowser.h b/kexi/widget/kexibrowser.h index 1bdc5d25..df51197a 100644 --- a/kexi/widget/kexibrowser.h +++ b/kexi/widget/kexibrowser.h @@ -22,10 +22,10 @@ #define KEXIBROWSER_H #include <klistview.h> -#include <qasciidict.h> -#include <qintdict.h> +#include <tqasciidict.h> +#include <tqintdict.h> -class QListViewItem; +class TQListViewItem; class KIconLoader; class KPopupMenu; class KAction; @@ -48,9 +48,10 @@ namespace KexiPart class KexiProject; //! @short The Main Kexi navigator widget -class KEXIEXTWIDGETS_EXPORT KexiBrowser : public QWidget +class KEXIEXTWIDGETS_EXPORT KexiBrowser : public TQWidget { Q_OBJECT + TQ_OBJECT public: enum Features { @@ -62,29 +63,29 @@ class KEXIEXTWIDGETS_EXPORT KexiBrowser : public QWidget | SingleClickOpensItemOptionEnabled //!< the default }; - KexiBrowser(QWidget* parent, KexiMainWindow *mainWin, int features = DefaultFeatures); + KexiBrowser(TQWidget* tqparent, KexiMainWindow *mainWin, int features = DefaultFeatures); virtual ~KexiBrowser(); /*! Sets project \a prj for this browser. If \a partManagerErrorMessages is not NULL it will be set to error message if there's a problem with loading any KexiPart. If \a itemsMimeType is empty (the default), items of all mime types are displayed, - items for only one mime type are displayed. In the latter case, no group (parent) + items for only one mime type are displayed. In the latter case, no group (tqparent) items are displayed. Previous items are removed. */ - void setProject(KexiProject* prj, const QString& itemsMimeType = QString::null, - QString* partManagerErrorMessages = 0); + void setProject(KexiProject* prj, const TQString& itemsMimeType = TQString(), + TQString* partManagerErrorMessages = 0); /*! \return items' mime type previously set by setProject. Returns empty string if setProject() was not executed yet or itemsMimeType argument of setProject() was empty (i.e. all mime types are displayed). */ - QString itemsMimeType() const; + TQString itemsMimeType() const; KexiPart::Item* selectedPartItem() const; - void installEventFilter ( const QObject * filterObj ); - virtual bool eventFilter ( QObject *o, QEvent * e ); + void installEventFilter ( const TQObject * filterObj ); + virtual bool eventFilter ( TQObject *o, TQEvent * e ); - bool actionEnabled(const QCString& actionName) const; + bool actionEnabled(const TQCString& actionName) const; public slots: KexiBrowserItem* addGroup(KexiPart::Info& info); @@ -115,7 +116,7 @@ class KEXIEXTWIDGETS_EXPORT KexiBrowser : public QWidget void removeItem( KexiPart::Item* ); - void renameItem( KexiPart::Item *item, const QString& _newName, bool &succes ); + void renameItem( KexiPart::Item *item, const TQString& _newName, bool &succes ); void selectionChanged( KexiPart::Item* item ); @@ -128,9 +129,9 @@ class KEXIEXTWIDGETS_EXPORT KexiBrowser : public QWidget void pageSetupForItem( KexiPart::Item* ); protected slots: - void slotContextMenu(KListView*, QListViewItem *i, const QPoint &point); - void slotExecuteItem(QListViewItem *item); - void slotSelectionChanged(QListViewItem* i); + void slotContextMenu(KListView*, TQListViewItem *i, const TQPoint &point); + void slotExecuteItem(TQListViewItem *item); + void slotSelectionChanged(TQListViewItem* i); void slotSettingsChanged(int); void slotNewObjectPopupAboutToShow(); @@ -150,14 +151,14 @@ class KEXIEXTWIDGETS_EXPORT KexiBrowser : public QWidget protected: void itemRenameDone(); - KexiBrowserItem* addItem(KexiPart::Item& item, KexiBrowserItem *parent, KexiPart::Info* info); + KexiBrowserItem* addItem(KexiPart::Item& item, KexiBrowserItem *tqparent, KexiPart::Info* info); KexiMainWindow *m_mainWin; int m_features; KexiBrowserListView *m_list; KActionCollection *m_actions; - QAsciiDict<KexiBrowserItem> m_baseItems; - QIntDict<KexiBrowserItem> m_normalItems; + TQAsciiDict<KexiBrowserItem> m_baseItems; + TQIntDict<KexiBrowserItem> m_normalItems; KPopupMenu *m_itemPopup, *m_partPopup; KAction *m_deleteAction, *m_renameAction, *m_newObjectAction, // *m_newObjectToolbarAction, @@ -175,7 +176,7 @@ class KEXIEXTWIDGETS_EXPORT KexiBrowser : public QWidget KexiPart::Part *m_prevSelectedPart; KToolBar *m_toolbar; KexiSmallToolButton *m_newObjectToolButton, *m_deleteObjectToolButton; - QString m_itemsMimeType; + TQString m_itemsMimeType; bool m_singleClick : 1; bool m_readOnly : 1; }; diff --git a/kexi/widget/kexibrowser_p.h b/kexi/widget/kexibrowser_p.h index b5610d24..4459daab 100644 --- a/kexi/widget/kexibrowser_p.h +++ b/kexi/widget/kexibrowser_p.h @@ -27,16 +27,17 @@ class KexiBrowserListView : public KListView { Q_OBJECT + TQ_OBJECT public: - KexiBrowserListView(QWidget *parent); + KexiBrowserListView(TQWidget *tqparent); ~KexiBrowserListView(); - virtual bool isExecuteArea( const QPoint& point ); + virtual bool isExecuteArea( const TQPoint& point ); bool nameEndsWithAsterisk : 1; bool enableExecuteArea : 1; //!< used in isExecuteArea() public slots: - virtual void rename(QListViewItem *item, int c); + virtual void rename(TQListViewItem *item, int c); protected: }; diff --git a/kexi/widget/kexibrowseritem.cpp b/kexi/widget/kexibrowseritem.cpp index 087039f0..24f1d46c 100644 --- a/kexi/widget/kexibrowseritem.cpp +++ b/kexi/widget/kexibrowseritem.cpp @@ -24,8 +24,8 @@ #include <kiconloader.h> #include <core/kexipartinfo.h> -KexiBrowserItem::KexiBrowserItem(KListView *parent, KexiPart::Info *i) - : KListViewItem(parent, i->groupName()) +KexiBrowserItem::KexiBrowserItem(KListView *tqparent, KexiPart::Info *i) + : KListViewItem(tqparent, i->groupName()) , m_info(i) , m_item(0) { @@ -36,8 +36,8 @@ KexiBrowserItem::KexiBrowserItem(KListView *parent, KexiPart::Info *i) m_fifoSorting = 1; //because this is top level item } -KexiBrowserItem::KexiBrowserItem(KListViewItem *parent, KexiPart::Info *i, KexiPart::Item *item) - : KListViewItem(parent, item->name()) +KexiBrowserItem::KexiBrowserItem(KListViewItem *tqparent, KexiPart::Info *i, KexiPart::Item *item) + : KListViewItem(tqparent, item->name()) , m_info(i) , m_item(item) { @@ -45,8 +45,8 @@ KexiBrowserItem::KexiBrowserItem(KListViewItem *parent, KexiPart::Info *i, KexiP initItem(); } -KexiBrowserItem::KexiBrowserItem(KListView *parent, KexiPart::Info *i, KexiPart::Item *item) - : KListViewItem(parent, item->name()) +KexiBrowserItem::KexiBrowserItem(KListView *tqparent, KexiPart::Info *i, KexiPart::Item *item) + : KListViewItem(tqparent, item->name()) , m_info(i) , m_item(item) { @@ -63,8 +63,8 @@ void KexiBrowserItem::initItem() m_fifoSorting = 0; int sortKey = 0; // set sorting key with FIFO order - if (parent()) { - sortKey = parent()->childCount(); + if (tqparent()) { + sortKey = tqparent()->childCount(); } else if (listView()) { sortKey = listView()->childCount(); } @@ -83,7 +83,7 @@ KexiBrowserItem::clearChildren() } } -QString KexiBrowserItem::key( int column, bool ascending ) const +TQString KexiBrowserItem::key( int column, bool ascending ) const { // kdDebug() << "KexiBrowserItem::key() : " << (m_fifoSorting ? m_sortKey : KListViewItem::key(column,ascending)) << endl; return m_fifoSorting ? m_sortKey : KListViewItem::key(column,ascending); diff --git a/kexi/widget/kexibrowseritem.h b/kexi/widget/kexibrowseritem.h index 12c2fef6..a46f5a8d 100644 --- a/kexi/widget/kexibrowseritem.h +++ b/kexi/widget/kexibrowseritem.h @@ -22,7 +22,7 @@ #define KEXIBROWSERITEM_H #include <klistview.h> -#include <qstring.h> +#include <tqstring.h> #include <core/kexipartitem.h> @@ -37,14 +37,14 @@ class KEXIEXTWIDGETS_EXPORT KexiBrowserItem : public KListViewItem { public: //! Creates group item for part \a i - KexiBrowserItem(KListView *parent, KexiPart::Info *i); + KexiBrowserItem(KListView *tqparent, KexiPart::Info *i); - //! Creates item for object \a item defined by part \a i for \a parent - KexiBrowserItem(KListViewItem *parent, KexiPart::Info *i, KexiPart::Item *item); + //! Creates item for object \a item defined by part \a i for \a tqparent + KexiBrowserItem(KListViewItem *tqparent, KexiPart::Info *i, KexiPart::Item *item); - //! Creates item for object \a item defined by part \a i, without parent + //! Creates item for object \a item defined by part \a i, without tqparent //! (used in a case when KexiBrowser::itemsMimeType() is not empty) - KexiBrowserItem(KListView *parent, KexiPart::Info *i, KexiPart::Item *item); + KexiBrowserItem(KListView *tqparent, KexiPart::Info *i, KexiPart::Item *item); virtual ~KexiBrowserItem(); @@ -53,17 +53,17 @@ class KEXIEXTWIDGETS_EXPORT KexiBrowserItem : public KListViewItem //! \return part info; should not be null. KexiPart::Info *info() const { return m_info; } - //! \return part item. Can be null if the browser item is a "folder", i.e. a parent node. + //! \return part item. Can be null if the browser item is a "folder", i.e. a tqparent node. KexiPart::Item* item() const { return m_item; } protected: void initItem(); - virtual QString key( int column, bool ascending ) const; + virtual TQString key( int column, bool ascending ) const; KexiPart::Info *m_info; KexiPart::Item *m_item; - QString m_sortKey; + TQString m_sortKey; bool m_fifoSorting : 1; }; diff --git a/kexi/widget/kexicharencodingcombobox.cpp b/kexi/widget/kexicharencodingcombobox.cpp index c1f50542..1b66f6a8 100644 --- a/kexi/widget/kexicharencodingcombobox.cpp +++ b/kexi/widget/kexicharencodingcombobox.cpp @@ -19,7 +19,7 @@ #include "kexicharencodingcombobox.h" -#include <qtextcodec.h> +#include <tqtextcodec.h> #include <kdebug.h> #include <klocale.h> @@ -27,25 +27,25 @@ #include <kcharsets.h> KexiCharacterEncodingComboBox::KexiCharacterEncodingComboBox( - QWidget* parent, const QString& selectedEncoding ) - : KComboBox( parent, "KexiCharacterEncodingComboBox" ) + TQWidget* tqparent, const TQString& selectedEncoding ) + : KComboBox( tqparent, "KexiCharacterEncodingComboBox" ) , m_defaultEncodingAdded(false) { - QString defaultEncoding(QString::fromLatin1(KGlobal::locale()->encoding())); - QString defaultEncodingDescriptiveName; + TQString defaultEncoding(TQString::tqfromLatin1(KGlobal::locale()->encoding())); + TQString defaultEncodingDescriptiveName; - QString _selectedEncoding = selectedEncoding; + TQString _selectedEncoding = selectedEncoding; if (_selectedEncoding.isEmpty()) - _selectedEncoding = QString::fromLatin1(KGlobal::locale()->encoding()); + _selectedEncoding = TQString::tqfromLatin1(KGlobal::locale()->encoding()); - QStringList descEncodings(KGlobal::charsets()->descriptiveEncodingNames()); - QStringList::ConstIterator it = descEncodings.constBegin(); + TQStringList descEncodings(KGlobal::charsets()->descriptiveEncodingNames()); + TQStringList::ConstIterator it = descEncodings.constBegin(); for (uint id = 0; it!=descEncodings.constEnd(); ++it) { bool found = false; - QString name( KGlobal::charsets()->encodingForName( *it ) ); - QTextCodec *codecForEnc = KGlobal::charsets()->codecForName(name, found); + TQString name( KGlobal::charsets()->encodingForName( *it ) ); + TQTextCodec *codecForEnc = KGlobal::charsets()->codecForName(name, found); if (found) { insertItem(*it); if (codecForEnc->name() == defaultEncoding || name == defaultEncoding) { @@ -65,8 +65,8 @@ KexiCharacterEncodingComboBox::KexiCharacterEncodingComboBox( //prepend default encoding, if present if (!defaultEncodingDescriptiveName.isEmpty()) { m_defaultEncodingAdded = true; - QString desc = i18n("Text encoding: Default", "Default: %1") - .arg(defaultEncodingDescriptiveName); + TQString desc = i18n("Text encoding: Default", "Default: %1") + .tqarg(defaultEncodingDescriptiveName); insertItem( desc, 0 ); if (_selectedEncoding==defaultEncoding) { setCurrentItem(0); @@ -81,19 +81,19 @@ KexiCharacterEncodingComboBox::~KexiCharacterEncodingComboBox() { } -QString KexiCharacterEncodingComboBox::selectedEncoding() const +TQString KexiCharacterEncodingComboBox::selectedEncoding() const { if (defaultEncodingSelected()) { - return QString::fromLatin1(KGlobal::locale()->encoding()); + return TQString::tqfromLatin1(KGlobal::locale()->encoding()); } else { return KGlobal::charsets()->encodingForName( currentText() ); } } -void KexiCharacterEncodingComboBox::setSelectedEncoding(const QString& encodingName) +void KexiCharacterEncodingComboBox::setSelectedEncoding(const TQString& encodingName) { - QString desc = m_encodingDescriptionForName[encodingName]; + TQString desc = m_encodingDescriptionForName[encodingName]; if (desc.isEmpty()) { kdWarning() << "KexiCharacterEncodingComboBox::setSelectedEncoding(): " "no such encoding \"" << encodingName << "\"" << endl; diff --git a/kexi/widget/kexicharencodingcombobox.h b/kexi/widget/kexicharencodingcombobox.h index 9af5a69f..fd147cec 100644 --- a/kexi/widget/kexicharencodingcombobox.h +++ b/kexi/widget/kexicharencodingcombobox.h @@ -20,7 +20,7 @@ #ifndef KEXICHARENCODINGCOMBO_H #define KEXICHARENCODINGCOMBO_H -#include <qmap.h> +#include <tqmap.h> #include <kcombobox.h> /*! @short Combobox widget providing a list of possible character encodings. @@ -30,18 +30,18 @@ class KEXIEXTWIDGETS_EXPORT KexiCharacterEncodingComboBox : public KComboBox public: //! Constructs a new combobox. \a selectedEncoding can be provided to preselect encoding. //! If it is not provided, default encoding is selected for current system settings. - KexiCharacterEncodingComboBox( QWidget* parent = 0, - const QString& selectedEncoding = QString::null ); + KexiCharacterEncodingComboBox( TQWidget* tqparent = 0, + const TQString& selectedEncoding = TQString() ); ~KexiCharacterEncodingComboBox(); - QString selectedEncoding() const; - void setSelectedEncoding(const QString& encodingName); + TQString selectedEncoding() const; + void setSelectedEncoding(const TQString& encodingName); //! Selects default encoding, if present void selectDefaultEncoding(); bool defaultEncodingSelected() const; protected: - QMap<QString,QString> m_encodingDescriptionForName; + TQMap<TQString,TQString> m_encodingDescriptionForName; bool m_defaultEncodingAdded : 1; }; diff --git a/kexi/widget/kexicustompropertyfactory.cpp b/kexi/widget/kexicustompropertyfactory.cpp index 3df9e233..e89727d0 100644 --- a/kexi/widget/kexicustompropertyfactory.cpp +++ b/kexi/widget/kexicustompropertyfactory.cpp @@ -29,15 +29,15 @@ using namespace KoProperty; class PixmapIdCustomProperty : public CustomProperty { public: - PixmapIdCustomProperty(Property *parent) - : CustomProperty(parent) { + PixmapIdCustomProperty(Property *tqparent) + : CustomProperty(tqparent) { } virtual ~PixmapIdCustomProperty() {}; - virtual void setValue(const QVariant &value, bool rememberOldValue) { + virtual void setValue(const TQVariant &value, bool rememberOldValue) { Q_UNUSED( value ); Q_UNUSED( rememberOldValue); } - virtual QVariant value() const { return m_property->value(); } + virtual TQVariant value() const { return m_property->value(); } virtual bool handleValue() const { return false; //m_property->type()==KexiCustomPropertyFactory::PixmapData; } @@ -47,27 +47,27 @@ class PixmapIdCustomProperty : public CustomProperty class IdentifierCustomProperty : public CustomProperty { public: - IdentifierCustomProperty(Property *parent) - : CustomProperty(parent) { + IdentifierCustomProperty(Property *tqparent) + : CustomProperty(tqparent) { } virtual ~IdentifierCustomProperty() {}; - virtual void setValue(const QVariant &value, bool rememberOldValue) + virtual void setValue(const TQVariant &value, bool rememberOldValue) { Q_UNUSED(rememberOldValue); if (!value.toString().isEmpty()) m_value = KexiUtils::string2Identifier(value.toString()).lower(); } - virtual QVariant value() const { return m_value; } + virtual TQVariant value() const { return m_value; } virtual bool handleValue() const { return true; } - QString m_value; + TQString m_value; }; //--------------- -KexiCustomPropertyFactory::KexiCustomPropertyFactory(QObject* parent) -: CustomPropertyFactory(parent) +KexiCustomPropertyFactory::KexiCustomPropertyFactory(TQObject* tqparent) +: CustomPropertyFactory(tqparent) { } @@ -75,13 +75,13 @@ KexiCustomPropertyFactory::~KexiCustomPropertyFactory() { } -CustomProperty* KexiCustomPropertyFactory::createCustomProperty(Property *parent) +CustomProperty* KexiCustomPropertyFactory::createCustomProperty(Property *tqparent) { - const int type = parent->type(); + const int type = tqparent->type(); if (type==(int)KexiCustomPropertyFactory::PixmapId) - return new PixmapIdCustomProperty(parent); + return new PixmapIdCustomProperty(tqparent); else if (type==(int)KexiCustomPropertyFactory::Identifier) - return new IdentifierCustomProperty(parent); + return new IdentifierCustomProperty(tqparent); return 0; } @@ -103,7 +103,7 @@ void KexiCustomPropertyFactory::init() // register custom editors and properties KexiCustomPropertyFactory *factory = new KexiCustomPropertyFactory(KoProperty::FactoryManager::self()); - QValueList<int> types; + TQValueList<int> types; types << KexiCustomPropertyFactory::PixmapId << KexiCustomPropertyFactory::Identifier; KoProperty::FactoryManager::self()->registerFactoryForProperties(types, factory); KoProperty::FactoryManager::self()->registerFactoryForEditors(types, factory); diff --git a/kexi/widget/kexicustompropertyfactory.h b/kexi/widget/kexicustompropertyfactory.h index c6e6e973..d1550947 100644 --- a/kexi/widget/kexicustompropertyfactory.h +++ b/kexi/widget/kexicustompropertyfactory.h @@ -35,10 +35,10 @@ class KEXIEXTWIDGETS_EXPORT KexiCustomPropertyFactory : public KoProperty::Custo //! Called once to register all propert and editor types provided by this factory. static void init(); - KexiCustomPropertyFactory(QObject* parent); + KexiCustomPropertyFactory(TQObject* tqparent); virtual ~KexiCustomPropertyFactory(); - virtual KoProperty::CustomProperty* createCustomProperty(KoProperty::Property *parent); + virtual KoProperty::CustomProperty* createCustomProperty(KoProperty::Property *tqparent); virtual KoProperty::Widget* createCustomWidget(KoProperty::Property *prop); }; diff --git a/kexi/widget/kexicustompropertyfactory_p.cpp b/kexi/widget/kexicustompropertyfactory_p.cpp index 0e0a054d..f5fbb90a 100644 --- a/kexi/widget/kexicustompropertyfactory_p.cpp +++ b/kexi/widget/kexicustompropertyfactory_p.cpp @@ -19,7 +19,7 @@ #include "kexicustompropertyfactory_p.h" -#include <qlineedit.h> +#include <tqlineedit.h> #include <kdebug.h> #include <koproperty/property.h> #include <kexiutils/identifier.h> @@ -27,8 +27,8 @@ using namespace KoProperty; KexiImagePropertyEdit::KexiImagePropertyEdit( - Property *property, QWidget *parent, const char *name) - : PixmapEdit(property, parent, name) + Property *property, TQWidget *tqparent, const char *name) + : PixmapEdit(property, tqparent, name) , m_id(0) { } @@ -39,7 +39,7 @@ KexiImagePropertyEdit::~KexiImagePropertyEdit() void KexiImagePropertyEdit::selectPixmap() { - QString fileName( PixmapEdit::selectPixmapFileName() ); + TQString fileName( PixmapEdit::selectPixmapFileName() ); if (fileName.isEmpty()) return; KexiBLOBBuffer::Handle h(KexiBLOBBuffer::self()->insertPixmap( KURL(fileName) )); @@ -49,28 +49,28 @@ void KexiImagePropertyEdit::selectPixmap() return; ObjectTreeItem *item = m_manager->activeForm()->objectTree()->lookup(m_manager->activeForm()->selectedWidget()->name()); - QString name = item ? item->pixmapName(property()->name()) : ""; - PixmapCollectionChooser dialog( m_manager->activeForm()->pixmapCollection(), name, topLevelWidget() ); - if(dialog.exec() == QDialog::Accepted) { + TQString name = item ? item->pixmapName(property()->name()) : ""; + PixmapCollectionChooser dialog( m_manager->activeForm()->pixmapCollection(), name, tqtopLevelWidget() ); + if(dialog.exec() == TQDialog::Accepted) { setValue(dialog.pixmap(), true); item->setPixmapName(property()->name(), dialog.pixmapName()); } #endif } -QVariant KexiImagePropertyEdit::value() const +TQVariant KexiImagePropertyEdit::value() const { return (uint)/*! @todo unsafe*/m_id; } -void KexiImagePropertyEdit::setValue(const QVariant &value, bool emitChange) +void KexiImagePropertyEdit::setValue(const TQVariant &value, bool emitChange) { m_id = value.toInt(); PixmapEdit::setValue(KexiBLOBBuffer::self()->objectForId(m_id).pixmap(), emitChange); } -void KexiImagePropertyEdit::drawViewer(QPainter *p, const QColorGroup &cg, const QRect &r, - const QVariant &value) +void KexiImagePropertyEdit::drawViewer(TQPainter *p, const TQColorGroup &cg, const TQRect &r, + const TQVariant &value) { KexiBLOBBuffer::Handle h( KexiBLOBBuffer::self()->objectForId(value.toInt()) ); PixmapEdit::drawViewer(p, cg, r, h.pixmap()); @@ -79,29 +79,29 @@ void KexiImagePropertyEdit::drawViewer(QPainter *p, const QColorGroup &cg, const //---------------------------------------------------------------- KexiIdentifierPropertyEdit::KexiIdentifierPropertyEdit( - Property *property, QWidget *parent, const char *name) - : StringEdit(property, parent, name) + Property *property, TQWidget *tqparent, const char *name) + : StringEdit(property, tqparent, name) { m_edit->setValidator( - new KexiUtils::IdentifierValidator(m_edit, "KexiIdentifierPropertyEdit Validator") ); + new KexiUtils::IdentifierValidator(TQT_TQOBJECT(m_edit), "KexiIdentifierPropertyEdit Validator") ); } KexiIdentifierPropertyEdit::~KexiIdentifierPropertyEdit() { } -void KexiIdentifierPropertyEdit::setValue(const QVariant &value, bool emitChange) +void KexiIdentifierPropertyEdit::setValue(const TQVariant &value, bool emitChange) { - QString string(value.toString()); + TQString string(value.toString()); if (string.isEmpty()) { kdWarning() << "KexiIdentifierPropertyEdit::setValue(): " "Value cannot be empty. This call has no effect." << endl; return; } - QString identifier( KexiUtils::string2Identifier(string) ); + TQString identifier( KexiUtils::string2Identifier(string) ); if (identifier!=string) - kdDebug() << QString("KexiIdentifierPropertyEdit::setValue(): " - "String \"%1\" converted to identifier \"%2\".").arg(string).arg(identifier) << endl; + kdDebug() << TQString("KexiIdentifierPropertyEdit::setValue(): " + "String \"%1\" converted to identifier \"%2\".").tqarg(string).tqarg(identifier) << endl; StringEdit::setValue( identifier, emitChange ); } diff --git a/kexi/widget/kexicustompropertyfactory_p.h b/kexi/widget/kexicustompropertyfactory_p.h index f1ec4b0f..49a4066b 100644 --- a/kexi/widget/kexicustompropertyfactory_p.h +++ b/kexi/widget/kexicustompropertyfactory_p.h @@ -28,16 +28,17 @@ class KexiImagePropertyEdit : public KoProperty::PixmapEdit { Q_OBJECT + TQ_OBJECT public: KexiImagePropertyEdit(KoProperty::Property *property, - QWidget *parent=0, const char *name=0); + TQWidget *tqparent=0, const char *name=0); virtual ~KexiImagePropertyEdit(); - virtual QVariant value() const; - virtual void setValue(const QVariant &value, bool emitChange=true); - virtual void drawViewer(QPainter *p, const QColorGroup &cg, const QRect &r, - const QVariant &value); + virtual TQVariant value() const; + virtual void setValue(const TQVariant &value, bool emitChange=true); + virtual void drawViewer(TQPainter *p, const TQColorGroup &cg, const TQRect &r, + const TQVariant &value); public slots: virtual void selectPixmap(); @@ -56,16 +57,17 @@ class KexiImagePropertyEdit : public KoProperty::PixmapEdit class KexiIdentifierPropertyEdit : public KoProperty::StringEdit { Q_OBJECT + TQ_OBJECT public: KexiIdentifierPropertyEdit(KoProperty::Property *property, - QWidget *parent=0, const char *name=0); + TQWidget *tqparent=0, const char *name=0); virtual ~KexiIdentifierPropertyEdit(); /*! Reimplemented: sets \a value but it is converted to identifier using KexiUtils::string2Identifier(). If \a value is null or empty string, this method has no effect. */ - virtual void setValue(const QVariant &value, bool emitChange=true); + virtual void setValue(const TQVariant &value, bool emitChange=true); }; #endif diff --git a/kexi/widget/kexidataawareview.cpp b/kexi/widget/kexidataawareview.cpp index 418f0aa1..c22c0dbb 100644 --- a/kexi/widget/kexidataawareview.cpp +++ b/kexi/widget/kexidataawareview.cpp @@ -23,12 +23,12 @@ #include <utils/kexisharedactionclient.h> #include <core/keximainwindow.h> -#include <qlayout.h> +#include <tqlayout.h> #include <kpopupmenu.h> -KexiDataAwareView::KexiDataAwareView(KexiMainWindow *mainWin, QWidget *parent, const char *name) - : KexiViewBase(mainWin, parent, name) +KexiDataAwareView::KexiDataAwareView(KexiMainWindow *mainWin, TQWidget *tqparent, const char *name) + : KexiViewBase(mainWin, tqparent, name) , KexiSearchAndReplaceViewInterface() , m_internalView(0) , m_actionClient(0) @@ -36,7 +36,7 @@ KexiDataAwareView::KexiDataAwareView(KexiMainWindow *mainWin, QWidget *parent, c { } -void KexiDataAwareView::init( QWidget* viewWidget, KexiSharedActionClient* actionClient, +void KexiDataAwareView::init( TQWidget* viewWidget, KexiSharedActionClient* actionClient, KexiDataAwareObjectInterface* dataAwareObject, bool noDataAware ) { m_internalView = viewWidget; @@ -45,23 +45,23 @@ void KexiDataAwareView::init( QWidget* viewWidget, KexiSharedActionClient* actio setViewWidget(m_internalView, true); if (!noDataAware) { - m_dataAwareObject->connectCellSelectedSignal(this, SLOT(slotCellSelected(int,int))); + m_dataAwareObject->connectCellSelectedSignal(TQT_TQOBJECT(this), TQT_SLOT(slotCellSelected(int,int))); //! before closing - we'are accepting editing - connect(this, SIGNAL(closing(bool&)), this, SLOT(slotClosing(bool&))); + connect(TQT_TQOBJECT(this), TQT_SIGNAL(closing(bool&)), TQT_TQOBJECT(this), TQT_SLOT(slotClosing(bool&))); //! updating actions on start/stop editing - m_dataAwareObject->connectRowEditStartedSignal(this, SLOT(slotUpdateRowActions(int))); - m_dataAwareObject->connectRowEditTerminatedSignal(this, SLOT(slotUpdateRowActions(int))); - m_dataAwareObject->connectReloadActionsSignal(this, SLOT(reloadActions())); + m_dataAwareObject->connectRowEditStartedSignal(TQT_TQOBJECT(this), TQT_SLOT(slotUpdateRowActions(int))); + m_dataAwareObject->connectRowEditTerminatedSignal(TQT_TQOBJECT(this), TQT_SLOT(slotUpdateRowActions(int))); + m_dataAwareObject->connectReloadActionsSignal(TQT_TQOBJECT(this), TQT_SLOT(reloadActions())); } - QVBoxLayout *box = new QVBoxLayout(this); + TQVBoxLayout *box = new TQVBoxLayout(this); box->addWidget(m_internalView); - setMinimumSize(m_internalView->minimumSizeHint().width(), - m_internalView->minimumSizeHint().height()); - resize( preferredSizeHint( m_internalView->sizeHint() ) ); + setMinimumSize(m_internalView->tqminimumSizeHint().width(), + m_internalView->tqminimumSizeHint().height()); + resize( preferredSizeHint( m_internalView->tqsizeHint() ) ); setFocusProxy(m_internalView); if (!noDataAware) { @@ -72,37 +72,37 @@ void KexiDataAwareView::init( QWidget* viewWidget, KexiSharedActionClient* actio void KexiDataAwareView::initActions() { - plugSharedAction("edit_delete_row", this, SLOT(deleteCurrentRow())); + plugSharedAction("edit_delete_row", TQT_TQOBJECT(this), TQT_SLOT(deleteCurrentRow())); m_actionClient->plugSharedAction(sharedAction("edit_delete_row")); //for proper shortcut - plugSharedAction("edit_delete", this, SLOT(deleteAndStartEditCurrentCell())); + plugSharedAction("edit_delete", TQT_TQOBJECT(this), TQT_SLOT(deleteAndStartEditCurrentCell())); m_actionClient->plugSharedAction(sharedAction("edit_delete")); //for proper shortcut - plugSharedAction("edit_edititem", this, SLOT(startEditOrToggleValue())); + plugSharedAction("edit_edititem", TQT_TQOBJECT(this), TQT_SLOT(startEditOrToggleValue())); m_actionClient->plugSharedAction(sharedAction("edit_edititem")); //for proper shortcut - plugSharedAction("data_save_row", this, SLOT(acceptRowEdit())); + plugSharedAction("data_save_row", TQT_TQOBJECT(this), TQT_SLOT(acceptRowEdit())); m_actionClient->plugSharedAction(sharedAction("data_save_row")); //for proper shortcut - plugSharedAction("data_cancel_row_changes", this, SLOT(cancelRowEdit())); + plugSharedAction("data_cancel_row_changes", TQT_TQOBJECT(this), TQT_SLOT(cancelRowEdit())); m_actionClient->plugSharedAction(sharedAction("data_cancel_row_changes")); //for proper shortcut if (m_dataAwareObject->isSortingEnabled()) { - plugSharedAction("data_sort_az", this, SLOT(sortAscending())); - plugSharedAction("data_sort_za", this, SLOT(sortDescending())); + plugSharedAction("data_sort_az", TQT_TQOBJECT(this), TQT_SLOT(sortAscending())); + plugSharedAction("data_sort_za", TQT_TQOBJECT(this), TQT_SLOT(sortDescending())); } m_actionClient->plugSharedAction(sharedAction("edit_insert_empty_row")); //for proper shortcut setAvailable("data_sort_az", m_dataAwareObject->isSortingEnabled()); setAvailable("data_sort_za", m_dataAwareObject->isSortingEnabled()); -//! \todo plugSharedAction("data_filter", this, SLOT(???())); +//! \todo plugSharedAction("data_filter", TQT_TQOBJECT(this), TQT_SLOT(???())); - plugSharedAction("data_go_to_first_record", this, SLOT(slotGoToFirstRow())); - plugSharedAction("data_go_to_previous_record", this, SLOT(slotGoToPreviusRow())); - plugSharedAction("data_go_to_next_record", this, SLOT(slotGoToNextRow())); - plugSharedAction("data_go_to_last_record", this, SLOT(slotGoToLastRow())); - plugSharedAction("data_go_to_new_record", this, SLOT(slotGoToNewRow())); + plugSharedAction("data_go_to_first_record", TQT_TQOBJECT(this), TQT_SLOT(slotGoToFirstRow())); + plugSharedAction("data_go_to_previous_record", TQT_TQOBJECT(this), TQT_SLOT(slotGoToPreviusRow())); + plugSharedAction("data_go_to_next_record", TQT_TQOBJECT(this), TQT_SLOT(slotGoToNextRow())); + plugSharedAction("data_go_to_last_record", TQT_TQOBJECT(this), TQT_SLOT(slotGoToLastRow())); + plugSharedAction("data_go_to_new_record", TQT_TQOBJECT(this), TQT_SLOT(slotGoToNewRow())); //! \todo update availability setAvailable("data_go_to_first_record", true); @@ -111,31 +111,31 @@ void KexiDataAwareView::initActions() setAvailable("data_go_to_last_record", true); setAvailable("data_go_to_new_record", true); - plugSharedAction("edit_copy", this, SLOT(copySelection())); + plugSharedAction("edit_copy", TQT_TQOBJECT(this), TQT_SLOT(copySelection())); m_actionClient->plugSharedAction(sharedAction("edit_copy")); //for proper shortcut - plugSharedAction("edit_cut", this, SLOT(cutSelection())); + plugSharedAction("edit_cut", TQT_TQOBJECT(this), TQT_SLOT(cutSelection())); m_actionClient->plugSharedAction(sharedAction("edit_cut")); //for proper shortcut - plugSharedAction("edit_paste", this, SLOT(paste())); + plugSharedAction("edit_paste", TQT_TQOBJECT(this), TQT_SLOT(paste())); m_actionClient->plugSharedAction(sharedAction("edit_paste")); //for proper shortcut -// plugSharedAction("edit_find", this, SLOT(editFind())); -// m_actionClient->plugSharedAction(sharedAction("edit_find")); //for proper shortcut +// plugSharedAction("edit_tqfind", TQT_TQOBJECT(this), TQT_SLOT(editFind())); +// m_actionClient->plugSharedAction(sharedAction("edit_tqfind")); //for proper shortcut -// plugSharedAction("edit_findnext", this, SLOT(editFindNext())); +// plugSharedAction("edit_findnext", TQT_TQOBJECT(this), TQT_SLOT(editFindNext())); // m_actionClient->plugSharedAction(sharedAction("edit_findnext")); //for proper shortcut -// plugSharedAction("edit_findprevious", this, SLOT(editFindPrevious())); +// plugSharedAction("edit_findprevious", TQT_TQOBJECT(this), TQT_SLOT(editFindPrevious())); // m_actionClient->plugSharedAction(sharedAction("edit_findprev")); //for proper shortcut -//! @todo plugSharedAction("edit_replace", this, SLOT(editReplace())); -//! @todo m_actionClient->plugSharedAction(sharedAction("edit_replace")); //for proper shortcut +//! @todo plugSharedAction("edit_tqreplace", TQT_TQOBJECT(this), TQT_SLOT(editReplace())); +//! @todo m_actionClient->plugSharedAction(sharedAction("edit_tqreplace")); //for proper shortcut -// setAvailable("edit_find", true); +// setAvailable("edit_tqfind", true); // setAvailable("edit_findnext", true); // setAvailable("edit_findprevious", true); -//! @todo setAvailable("edit_replace", true); +//! @todo setAvailable("edit_tqreplace", true); } void KexiDataAwareView::slotUpdateRowActions(int row) @@ -160,19 +160,19 @@ void KexiDataAwareView::slotUpdateRowActions(int row) setAvailable("data_sort_za", sorting); } -QWidget* KexiDataAwareView::mainWidget() +TQWidget* KexiDataAwareView::mainWidget() { return m_internalView; } -QSize KexiDataAwareView::minimumSizeHint() const +TQSize KexiDataAwareView::tqminimumSizeHint() const { - return m_internalView ? m_internalView->minimumSizeHint() : QSize(0,0);//KexiViewBase::minimumSizeHint(); + return m_internalView ? m_internalView->tqminimumSizeHint() : TQSize(0,0);//KexiViewBase::tqminimumSizeHint(); } -QSize KexiDataAwareView::sizeHint() const +TQSize KexiDataAwareView::tqsizeHint() const { - return m_internalView ? m_internalView->sizeHint() : QSize(0,0);//KexiViewBase::sizeHint(); + return m_internalView ? m_internalView->tqsizeHint() : TQSize(0,0);//KexiViewBase::tqsizeHint(); } void KexiDataAwareView::updateActions(bool activated) @@ -188,7 +188,7 @@ void KexiDataAwareView::reloadActions() //warning FIXME Move this to the table part /* kdDebug()<<"INIT ACTIONS***********************************************************************"<<endl; - new KAction(i18n("Filter"), "filter", 0, this, SLOT(filter()), actionCollection(), "tablepart_filter"); + new KAction(i18n("Filter"), "filter", 0, TQT_TQOBJECT(this), TQT_SLOT(filter()), actionCollection(), "tablepart_filter"); setXMLFile("kexidatatableui.rc"); */ m_dataAwareObject->contextMenu()->clear(); @@ -200,11 +200,11 @@ void KexiDataAwareView::reloadActions() bool separatorNeeded = true; unplugSharedAction("edit_clear_table"); - plugSharedAction("edit_clear_table", this, SLOT(deleteAllRows())); + plugSharedAction("edit_clear_table", TQT_TQOBJECT(this), TQT_SLOT(deleteAllRows())); if (m_dataAwareObject->isEmptyRowInsertingEnabled()) { unplugSharedAction("edit_insert_empty_row"); - plugSharedAction("edit_insert_empty_row", m_internalView, SLOT(insertEmptyRow())); + plugSharedAction("edit_insert_empty_row", TQT_TQOBJECT(m_internalView), TQT_SLOT(insertEmptyRow())); if (separatorNeeded) m_dataAwareObject->contextMenu()->insertSeparator(); plugSharedAction("edit_insert_empty_row", m_dataAwareObject->contextMenu()); @@ -241,7 +241,7 @@ void KexiDataAwareView::slotCellSelected(int /*col*/, int row) void KexiDataAwareView::deleteAllRows() { - m_dataAwareObject->deleteAllRows(true/*ask*/, true/*repaint*/); + m_dataAwareObject->deleteAllRows(true/*ask*/, true/*tqrepaint*/); } void KexiDataAwareView::deleteCurrentRow() @@ -306,8 +306,8 @@ void KexiDataAwareView::slotGoToNextRow() { m_dataAwareObject->selectNextRow(); void KexiDataAwareView::slotGoToLastRow() { m_dataAwareObject->selectLastRow(); } void KexiDataAwareView::slotGoToNewRow() { m_dataAwareObject->addNewRecordRequested(); } -bool KexiDataAwareView::setupFindAndReplace(QStringList& columnNames, QStringList& columnCaptions, - QString& currentColumnName) +bool KexiDataAwareView::setupFindAndReplace(TQStringList& columnNames, TQStringList& columnCaptions, + TQString& currentColumnName) { if (!dataAwareObject() || !dataAwareObject()->data()) return false; @@ -329,7 +329,7 @@ bool KexiDataAwareView::setupFindAndReplace(QStringList& columnNames, QStringLis return true; } -tristate KexiDataAwareView::find(const QVariant& valueToFind, +tristate KexiDataAwareView::tqfind(const TQVariant& valueToFind, const KexiSearchAndReplaceViewInterface::Options& options, bool next) { if (!dataAwareObject() || !dataAwareObject()->data()) @@ -337,8 +337,8 @@ tristate KexiDataAwareView::find(const QVariant& valueToFind, // const KexiDataAwareObjectInterface::FindAndReplaceOptions options(dlg->options()); /* if (res == KexiFindDialog::Find) {*/ -// QVariant valueToFind(dlg->valueToFind()); - return dataAwareObject()->find( valueToFind, options, next ); +// TQVariant valueToFind(dlg->valueToFind()); + return dataAwareObject()->tqfind( valueToFind, options, next ); /* //! @todo result... @@ -352,8 +352,8 @@ tristate KexiDataAwareView::find(const QVariant& valueToFind, */ } -tristate KexiDataAwareView::findNextAndReplace(const QVariant& valueToFind, - const QVariant& replacement, +tristate KexiDataAwareView::findNextAndReplace(const TQVariant& valueToFind, + const TQVariant& replacement, const KexiSearchAndReplaceViewInterface::Options& options, bool replaceAll) { if (!dataAwareObject() || !dataAwareObject()->data()) diff --git a/kexi/widget/kexidataawareview.h b/kexi/widget/kexidataawareview.h index 8f1d369f..31a43445 100644 --- a/kexi/widget/kexidataawareview.h +++ b/kexi/widget/kexidataawareview.h @@ -42,32 +42,33 @@ class KEXIEXTWIDGETS_EXPORT KexiDataAwareView : public KexiViewBase, public KexiSearchAndReplaceViewInterface { Q_OBJECT + TQ_OBJECT public: - KexiDataAwareView(KexiMainWindow *mainWin, QWidget *parent, const char *name = 0); + KexiDataAwareView(KexiMainWindow *mainWin, TQWidget *tqparent, const char *name = 0); - QWidget* mainWidget(); + TQWidget* mainWidget(); - virtual QSize minimumSizeHint() const; + virtual TQSize tqminimumSizeHint() const; - virtual QSize sizeHint() const; + virtual TQSize tqsizeHint() const; KexiDataAwareObjectInterface* dataAwareObject() const { return m_dataAwareObject; } - /*! Sets up data for find/replace dialog, based on view's data model. + /*! Sets up data for tqfind/replace dialog, based on view's data model. Implemented for KexiSearchAndReplaceViewInterface. */ - virtual bool setupFindAndReplace(QStringList& columnNames, QStringList& columnCaptions, - QString& currentColumnName); + virtual bool setupFindAndReplace(TQStringList& columnNames, TQStringList& columnCaptions, + TQString& currentColumnName); /*! Finds \a valueToFind within the view. Implemented for KexiSearchAndReplaceViewInterface. */ - virtual tristate find(const QVariant& valueToFind, + virtual tristate tqfind(const TQVariant& valueToFind, const KexiSearchAndReplaceViewInterface::Options& options, bool next); /*! Finds \a valueToFind within the view and replaces with \a replacement. Implemented for KexiSearchAndReplaceViewInterface. */ - virtual tristate findNextAndReplace(const QVariant& valueToFind, - const QVariant& replacement, + virtual tristate findNextAndReplace(const TQVariant& valueToFind, + const TQVariant& replacement, const KexiSearchAndReplaceViewInterface::Options& options, bool replaceAll); public slots: @@ -94,14 +95,14 @@ class KEXIEXTWIDGETS_EXPORT KexiDataAwareView : public KexiViewBase, void editReplace();*/ protected slots: -// void slotCellSelected(const QVariant& v); //!< @internal +// void slotCellSelected(const TQVariant& v); //!< @internal void slotCellSelected(int col, int row); void reloadActions(); void slotUpdateRowActions(int row); void slotClosing(bool& cancel); protected: - void init( QWidget* viewWidget, KexiSharedActionClient* actionClient, + void init( TQWidget* viewWidget, KexiSharedActionClient* actionClient, KexiDataAwareObjectInterface* dataAwareObject, // temporary, for KexiFormView in design mode bool noDataAware = false @@ -109,7 +110,7 @@ class KEXIEXTWIDGETS_EXPORT KexiDataAwareView : public KexiViewBase, void initActions(); virtual void updateActions(bool activated); - QWidget* m_internalView; + TQWidget* m_internalView; KexiSharedActionClient* m_actionClient; KexiDataAwareObjectInterface* m_dataAwareObject; }; diff --git a/kexi/widget/kexidatasourcecombobox.cpp b/kexi/widget/kexidatasourcecombobox.cpp index 77dc771f..77895e24 100644 --- a/kexi/widget/kexidatasourcecombobox.cpp +++ b/kexi/widget/kexidatasourcecombobox.cpp @@ -34,7 +34,7 @@ #include <kexidb/connection.h> #ifdef KEXI_SHOW_UNIMPLEMENTED -#define ADD_DEFINEQUERY_ROW +#define ADD_DEFINETQUERY_ROW #endif //! @internal @@ -50,7 +50,7 @@ class KexiDataSourceComboBox::Private } int firstTableIndex() const { int index = 1; //skip empty row -#ifdef ADD_DEFINEQUERY_ROW +#ifdef ADD_DEFINETQUERY_ROW index++; /*skip 'define query' row*/ #endif return index; @@ -59,8 +59,8 @@ class KexiDataSourceComboBox::Private return firstTableIndex() + tablesCount; } - QGuardedPtr<KexiProject> prj; - QPixmap tableIcon, queryIcon; + TQGuardedPtr<KexiProject> prj; + TQPixmap tableIcon, queryIcon; int tablesCount; int prevIndex; //!< Used in slotActivated() bool showTables : 1; @@ -69,15 +69,15 @@ class KexiDataSourceComboBox::Private //------------------------ -KexiDataSourceComboBox::KexiDataSourceComboBox(QWidget *parent, const char *name) - : KComboBox(true/*rw*/, parent, name) +KexiDataSourceComboBox::KexiDataSourceComboBox(TQWidget *tqparent, const char *name) + : KComboBox(true/*rw*/, tqparent, name) , d(new Private()) { setInsertionPolicy(NoInsertion); setCompletionMode(KGlobalSettings::CompletionPopupAuto); setSizeLimit( 16 ); - connect(this, SIGNAL(activated(int)), this, SLOT(slotActivated(int))); - connect(this, SIGNAL(returnPressed(const QString &)), this, SLOT(slotReturnPressed(const QString &))); + connect(this, TQT_SIGNAL(activated(int)), this, TQT_SLOT(slotActivated(int))); + connect(this, TQT_SIGNAL(returnPressed(const TQString &)), this, TQT_SLOT(slotReturnPressed(const TQString &))); d->tableIcon = SmallIcon("table"); d->queryIcon = SmallIcon("query"); @@ -110,12 +110,12 @@ void KexiDataSourceComboBox::setProject(KexiProject *prj, bool showTables, bool return; //needed for updating contents of the combo box - connect(d->prj, SIGNAL(newItemStored(KexiPart::Item&)), - this, SLOT(slotNewItemStored(KexiPart::Item&))); - connect(d->prj, SIGNAL(itemRemoved(const KexiPart::Item&)), - this, SLOT(slotItemRemoved(const KexiPart::Item&))); - connect(d->prj, SIGNAL(itemRenamed(const KexiPart::Item&, const QCString&)), - this, SLOT(slotItemRenamed(const KexiPart::Item&, const QCString&))); + connect(d->prj, TQT_SIGNAL(newItemStored(KexiPart::Item&)), + this, TQT_SLOT(slotNewItemStored(KexiPart::Item&))); + connect(d->prj, TQT_SIGNAL(itemRemoved(const KexiPart::Item&)), + this, TQT_SLOT(slotItemRemoved(const KexiPart::Item&))); + connect(d->prj, TQT_SIGNAL(itemRenamed(const KexiPart::Item&, const TQCString&)), + this, TQT_SLOT(slotItemRenamed(const KexiPart::Item&, const TQCString&))); KexiDB::Connection *conn = d->prj->dbConnection(); if (!conn) @@ -123,7 +123,7 @@ void KexiDataSourceComboBox::setProject(KexiProject *prj, bool showTables, bool //special item: empty insertItem(""); -#ifdef ADD_DEFINEQUERY_ROW +#ifdef ADD_DEFINETQUERY_ROW //special item: define query insertItem(i18n("Define Query...")); #endif @@ -162,7 +162,7 @@ void KexiDataSourceComboBox::setProject(KexiProject *prj, bool showTables, bool setCurrentItem(0); } -void KexiDataSourceComboBox::setDataSource(const QString& mimeType, const QString& name) +void KexiDataSourceComboBox::setDataSource(const TQString& mimeType, const TQString& name) { if (name.isEmpty()) { clearEdit(); @@ -172,7 +172,7 @@ void KexiDataSourceComboBox::setDataSource(const QString& mimeType, const QStrin return; } - QString mt(mimeType); + TQString mt(mimeType); if (mimeType.isEmpty()) mt="kexi/table"; int i = findItem(mt, name); @@ -190,11 +190,11 @@ void KexiDataSourceComboBox::setDataSource(const QString& mimeType, const QStrin void KexiDataSourceComboBox::slotNewItemStored(KexiPart::Item& item) { - QString name(item.name()); + TQString name(item.name()); //insert a new item, maintaining sort order and splitting to tables and queries if (item.mimeType()=="kexi/table") { int i = 1; /*skip empty row*/ -#ifdef ADD_DEFINEQUERY_ROW +#ifdef ADD_DEFINETQUERY_ROW i++; /*skip 'define query' row*/ #endif for (; i < d->firstQueryIndex() && name>=text(i); i++) @@ -212,12 +212,12 @@ void KexiDataSourceComboBox::slotNewItemStored(KexiPart::Item& item) } } -int KexiDataSourceComboBox::findItem(const QString& mimeType, const QString& name) +int KexiDataSourceComboBox::findItem(const TQString& mimeType, const TQString& name) { int i, end; if (mimeType=="kexi/table") { i = 0; -#ifdef ADD_DEFINEQUERY_ROW +#ifdef ADD_DEFINETQUERY_ROW i++; //skip 'define query' #endif end = d->firstQueryIndex(); @@ -229,7 +229,7 @@ int KexiDataSourceComboBox::findItem(const QString& mimeType, const QString& nam else return -1; - QString nameString(name); + TQString nameString(name); for (; i<end; i++) if (text(i)==nameString) @@ -257,13 +257,13 @@ void KexiDataSourceComboBox::slotItemRemoved(const KexiPart::Item& item) #endif } -void KexiDataSourceComboBox::slotItemRenamed(const KexiPart::Item& item, const QCString& oldName) +void KexiDataSourceComboBox::slotItemRenamed(const KexiPart::Item& item, const TQCString& oldName) { - const int i = findItem(item.mimeType(), QString(oldName)); + const int i = findItem(item.mimeType(), TQString(oldName)); if (i==-1) return; changeItem(item.name(), i); - completionObject()->removeItem(QString(oldName)); + completionObject()->removeItem(TQString(oldName)); completionObject()->addItem(item.name()); setCurrentText(oldName); //still keep old name } @@ -276,7 +276,7 @@ void KexiDataSourceComboBox::slotActivated( int index ) } } -QString KexiDataSourceComboBox::selectedMimeType() const +TQString KexiDataSourceComboBox::selectedMimeType() const { if (selectedName().isEmpty()) return ""; @@ -288,7 +288,7 @@ QString KexiDataSourceComboBox::selectedMimeType() const return ""; } -QString KexiDataSourceComboBox::selectedName() const +TQString KexiDataSourceComboBox::selectedName() const { if (isSelectionValid()) return text(currentItem()); @@ -301,7 +301,7 @@ bool KexiDataSourceComboBox::isSelectionValid() const return index >= d->firstTableIndex() && index < count() && text(index)==currentText(); } -void KexiDataSourceComboBox::slotReturnPressed(const QString & text) +void KexiDataSourceComboBox::slotReturnPressed(const TQString & text) { //text is available: select item for this text: bool changed = false; @@ -310,7 +310,7 @@ void KexiDataSourceComboBox::slotReturnPressed(const QString & text) changed = true; } else { - QListBoxItem *item = listBox()->findItem( text, Qt::ExactMatch ); + TQListBoxItem *item = listBox()->tqfindItem( text, TQt::ExactMatch ); if (item) { int index = listBox()->index( item ); //if (index < d->firstTableIndex()) @@ -324,7 +324,7 @@ void KexiDataSourceComboBox::slotReturnPressed(const QString & text) emit dataSourceChanged(); } -void KexiDataSourceComboBox::focusOutEvent( QFocusEvent *e ) +void KexiDataSourceComboBox::focusOutEvent( TQFocusEvent *e ) { KComboBox::focusOutEvent( e ); slotReturnPressed(currentText()); diff --git a/kexi/widget/kexidatasourcecombobox.h b/kexi/widget/kexidatasourcecombobox.h index 01a02d03..6f9f58ed 100644 --- a/kexi/widget/kexidatasourcecombobox.h +++ b/kexi/widget/kexidatasourcecombobox.h @@ -34,9 +34,10 @@ namespace KexiPart { class KEXIEXTWIDGETS_EXPORT KexiDataSourceComboBox : public KComboBox { Q_OBJECT + TQ_OBJECT public: - KexiDataSourceComboBox(QWidget *parent, const char *name=0); + KexiDataSourceComboBox(TQWidget *tqparent, const char *name=0); ~KexiDataSourceComboBox(); //! \return global project that is used to retrieve schema informationm for this combo box. @@ -44,18 +45,18 @@ class KEXIEXTWIDGETS_EXPORT KexiDataSourceComboBox : public KComboBox //! \return name of selected table or query. Can return null string. //! You should use isSelectionValid() to check validity of the input. - QString selectedMimeType() const; + TQString selectedMimeType() const; //! \return name of selected table or query. Can return null string or nonexisting name, //! so you should use isSelectionValid() to check validity of the input. - QString selectedName() const; + TQString selectedName() const; //! \return true if current selection is valid bool isSelectionValid() const; /*! \return index of item of mime type \a mimeType and name \a name. Returs -1 of no such item exists. */ - int findItem(const QString& mimeType, const QString& name); + int findItem(const TQString& mimeType, const TQString& name); public slots: //! Sets global project that is used to retrieve schema informationm for this combo box. @@ -64,7 +65,7 @@ class KEXIEXTWIDGETS_EXPORT KexiDataSourceComboBox : public KComboBox /*! Sets item for data source described by \a mimeType and \a name. If \a mimeType is empty, either "kexi/table" and "kexi/query" are tried. */ - void setDataSource(const QString& mimeType, const QString& name); + void setDataSource(const TQString& mimeType, const TQString& name); signals: //! Emitted whenever data source changes. @@ -74,12 +75,12 @@ class KEXIEXTWIDGETS_EXPORT KexiDataSourceComboBox : public KComboBox protected slots: void slotNewItemStored(KexiPart::Item& item); void slotItemRemoved(const KexiPart::Item& item); - void slotItemRenamed(const KexiPart::Item& item, const QCString& oldName); + void slotItemRenamed(const KexiPart::Item& item, const TQCString& oldName); void slotActivated( int index ); - void slotReturnPressed(const QString & text); + void slotReturnPressed(const TQString & text); protected: - virtual void focusOutEvent( QFocusEvent *e ); + virtual void focusOutEvent( TQFocusEvent *e ); class Private; Private *d; diff --git a/kexi/widget/kexidatatable.cpp b/kexi/widget/kexidatatable.cpp index b9a0aeb2..e0f2dd1b 100644 --- a/kexi/widget/kexidatatable.cpp +++ b/kexi/widget/kexidatatable.cpp @@ -20,8 +20,8 @@ */ -#include <qlayout.h> -#include <qlabel.h> +#include <tqlayout.h> +#include <tqlabel.h> #include <kiconloader.h> #include <klocale.h> @@ -34,25 +34,25 @@ #include "kexidatatable.h" #include "kexidialogbase.h" -KexiDataTable::KexiDataTable(KexiMainWindow *mainWin, QWidget *parent, +KexiDataTable::KexiDataTable(KexiMainWindow *mainWin, TQWidget *tqparent, const char *name, bool dbAware) -// : KexiViewBase(mainWin, parent, name) - : KexiDataAwareView( mainWin, parent, name ) +// : KexiViewBase(mainWin, tqparent, name) + : KexiDataAwareView( mainWin, tqparent, name ) { KexiTableView *view; if (dbAware) view = new KexiDataTableView(this, - QString("%1_datatableview").arg(name ? name : "KexiDataTableView").latin1()); + TQString("%1_datatableview").tqarg(name ? name : "KexiDataTableView").latin1()); else view = new KexiTableView(0, this, - QString("%1_tableview").arg(name ? name : "KexiTableView").latin1()); + TQString("%1_tableview").tqarg(name ? name : "KexiTableView").latin1()); KexiDataAwareView::init( view, view, view ); } -KexiDataTable::KexiDataTable(KexiMainWindow *mainWin, QWidget *parent, +KexiDataTable::KexiDataTable(KexiMainWindow *mainWin, TQWidget *tqparent, KexiDB::Cursor *cursor, const char *name) - : KexiDataAwareView( mainWin, parent, name ) + : KexiDataAwareView( mainWin, tqparent, name ) { KexiTableView *view = new KexiDataTableView(this, "view", cursor); KexiDataAwareView::init( view, view, view ); diff --git a/kexi/widget/kexidatatable.h b/kexi/widget/kexidatatable.h index 9fb73225..ccc5c6c3 100644 --- a/kexi/widget/kexidatatable.h +++ b/kexi/widget/kexidatatable.h @@ -44,6 +44,7 @@ namespace KexiDB class KEXIEXTWIDGETS_EXPORT KexiDataTable : public KexiDataAwareView { Q_OBJECT + TQ_OBJECT public: /*! CTOR1: Creates, empty table view that can be initialized later @@ -53,12 +54,12 @@ class KEXIEXTWIDGETS_EXPORT KexiDataTable : public KexiDataAwareView Otherwise, table will be not-db-aware, and KexiTableView is used internally. In the latter case, data can be set by calling tableView()->setData(KexiTableViewData* data). */ - KexiDataTable(KexiMainWindow *mainWin, QWidget *parent, const char *name = 0, + KexiDataTable(KexiMainWindow *mainWin, TQWidget *tqparent, const char *name = 0, bool dbAware = true); /*! CTOR2: Creates db-aware, table view initialized with \a cursor. KexiDataTableView is used internally. */ - KexiDataTable(KexiMainWindow *mainWin, QWidget *parent, + KexiDataTable(KexiMainWindow *mainWin, TQWidget *tqparent, KexiDB::Cursor *cursor, const char *name = 0); virtual ~KexiDataTable(); diff --git a/kexi/widget/kexidbconnectionwidget.cpp b/kexi/widget/kexidbconnectionwidget.cpp index 5b1b4538..a048e929 100644 --- a/kexi/widget/kexidbconnectionwidget.cpp +++ b/kexi/widget/kexidbconnectionwidget.cpp @@ -35,16 +35,16 @@ #include <ktextedit.h> #include <kprogress.h> -#include <qlabel.h> -#include <qcheckbox.h> -#include <qbuttongroup.h> -#include <qwidgetstack.h> -#include <qlayout.h> -#include <qvbox.h> -#include <qtooltip.h> -#include <qwhatsthis.h> -#include <qthread.h> -#include <qradiobutton.h> +#include <tqlabel.h> +#include <tqcheckbox.h> +#include <tqbuttongroup.h> +#include <tqwidgetstack.h> +#include <tqlayout.h> +#include <tqvbox.h> +#include <tqtooltip.h> +#include <tqwhatsthis.h> +#include <tqthread.h> +#include <tqradiobutton.h> //! Templorary hides db list //! @todo reenable this when implemented @@ -65,13 +65,13 @@ class KexiDBConnectionWidget::Private //--------- -KexiDBConnectionWidget::KexiDBConnectionWidget( QWidget* parent, const char* name ) - : KexiDBConnectionWidgetBase( parent, name ) +KexiDBConnectionWidget::KexiDBConnectionWidget( TQWidget* tqparent, const char* name ) + : KexiDBConnectionWidgetBase( tqparent, name ) , d(new Private()) { iconLabel->setPixmap(DesktopIcon("network")); - QVBoxLayout *driversComboLyr = new QVBoxLayout(frmEngine); + TQVBoxLayout *driversComboLyr = new TQVBoxLayout(frmEngine); m_driversCombo = new KexiDBDriverComboBox(frmEngine, Kexi::driverManager().driversInfo(), KexiDBDriverComboBox::ShowServerDrivers); lblEngine->setBuddy( m_driversCombo ); @@ -82,11 +82,11 @@ KexiDBConnectionWidget::KexiDBConnectionWidget( QWidget* parent, const char* na btnLoadDBList->hide(); #endif btnLoadDBList->setIconSet(SmallIconSet("reload")); - QToolTip::add(btnLoadDBList, i18n("Load database list from the server")); - QWhatsThis::add(btnLoadDBList, + TQToolTip::add(btnLoadDBList, i18n("Load database list from the server")); + TQWhatsThis::add(btnLoadDBList, i18n("Loads database list from the server, so you can select one using the \"Name\" combo box.")); - QHBoxLayout *hbox = new QHBoxLayout(frmBottom); + TQHBoxLayout *hbox = new TQHBoxLayout(frmBottom); hbox->addStretch(2); d->btnSaveChanges = new KPushButton(KGuiItem(i18n("Save Changes"), "filesave", i18n("Save all changes made to this connection information"), @@ -94,21 +94,21 @@ KexiDBConnectionWidget::KexiDBConnectionWidget( QWidget* parent, const char* na frmBottom, "savechanges"); hbox->addWidget( d->btnSaveChanges ); hbox->addSpacing( KDialogBase::spacingHint() ); - QWidget::setTabOrder(titleEdit, d->btnSaveChanges); - d->btnSaveChanges->setSizePolicy( QSizePolicy::Fixed, QSizePolicy::Fixed ); + TQWidget::setTabOrder(titleEdit, d->btnSaveChanges); + d->btnSaveChanges->tqsetSizePolicy( TQSizePolicy::Fixed, TQSizePolicy::Fixed ); d->btnTestConnection = new KPushButton(KGuiItem(i18n("&Test Connection"), "", i18n("Test database connection"), i18n("Tests database connection. You can ensure that valid connection information is provided.")), frmBottom, "testConnection"); hbox->addWidget( d->btnTestConnection ); - QWidget::setTabOrder(d->btnSaveChanges, d->btnTestConnection); - d->btnTestConnection->setSizePolicy( QSizePolicy::Fixed, QSizePolicy::Fixed ); + TQWidget::setTabOrder(d->btnSaveChanges, d->btnTestConnection); + d->btnTestConnection->tqsetSizePolicy( TQSizePolicy::Fixed, TQSizePolicy::Fixed ); - connect( locationBGrp, SIGNAL(clicked(int)), this, SLOT(slotLocationBGrpClicked(int)) ); - connect( chkPortDefault, SIGNAL(toggled(bool)), this , SLOT(slotCBToggled(bool)) ); - connect( btnLoadDBList, SIGNAL(clicked()), this, SIGNAL(loadDBList()) ); - connect( d->btnSaveChanges, SIGNAL(clicked()), this, SIGNAL(saveChanges()) ); + connect( locationBGrp, TQT_SIGNAL(clicked(int)), this, TQT_SLOT(slotLocationBGrpClicked(int)) ); + connect( chkPortDefault, TQT_SIGNAL(toggled(bool)), this , TQT_SLOT(slotCBToggled(bool)) ); + connect( btnLoadDBList, TQT_SIGNAL(clicked()), this, TQT_SIGNAL(loadDBList()) ); + connect( d->btnSaveChanges, TQT_SIGNAL(clicked()), this, TQT_SIGNAL(saveChanges()) ); } KexiDBConnectionWidget::~KexiDBConnectionWidget() @@ -120,7 +120,7 @@ bool KexiDBConnectionWidget::connectionOnly() const { return d->connectionOnly; } void KexiDBConnectionWidget::setDataInternal(const KexiProjectData& data, bool connectionOnly, - const QString& shortcutFileName) + const TQString& shortcutFileName) { m_data = data; d->connectionOnly = connectionOnly; @@ -166,7 +166,7 @@ void KexiDBConnectionWidget::setDataInternal(const KexiProjectData& data, bool c // chkSavePassword->hide(); } else { - if (!QFileInfo(shortcutFileName).isWritable()) { + if (!TQFileInfo(shortcutFileName).isWritable()) { d->btnSaveChanges->setEnabled(false); } } @@ -175,12 +175,12 @@ void KexiDBConnectionWidget::setDataInternal(const KexiProjectData& data, bool c adjustSize(); } -void KexiDBConnectionWidget::setData(const KexiProjectData& data, const QString& shortcutFileName) +void KexiDBConnectionWidget::setData(const KexiProjectData& data, const TQString& shortcutFileName) { setDataInternal(data, false /*!connectionOnly*/, shortcutFileName); } -void KexiDBConnectionWidget::setData(const KexiDB::ConnectionData& data, const QString& shortcutFileName) +void KexiDBConnectionWidget::setData(const KexiDB::ConnectionData& data, const TQString& shortcutFileName) { KexiProjectData pdata(data); setDataInternal(pdata, true /*connectionOnly*/, shortcutFileName); @@ -221,30 +221,30 @@ void KexiDBConnectionWidget::slotCBToggled(bool on) //----------- -KexiDBConnectionTabWidget::KexiDBConnectionTabWidget( QWidget* parent, const char* name ) - : KTabWidget( parent, name ) +KexiDBConnectionTabWidget::KexiDBConnectionTabWidget( TQWidget* tqparent, const char* name ) + : KTabWidget( tqparent, name ) { mainWidget = new KexiDBConnectionWidget( this, "mainWidget" ); - mainWidget->layout()->setMargin(KDialog::marginHint()); + mainWidget->tqlayout()->setMargin(KDialog::marginHint()); addTab( mainWidget, i18n("Parameters") ); -// QVBox *page2 = new QVBox(this); +// TQVBox *page2 = new TQVBox(this); // page2->setMargin(KDialog::marginHint()); // page2->setSpacing(KDialog::spacingHint()); -// QLabel *lbl = new QLabel(i18n("&Description:"), page2); +// TQLabel *lbl = new TQLabel(i18n("&Description:"), page2); // m_descriptionEdit = new KTextEdit(page2); // lbl->setBuddy(m_descriptionEdit); detailsWidget = new KexiDBConnectionWidgetDetailsBase(this, "detailsWidget"); addTab( detailsWidget, i18n("Details") ); - connect( mainWidget->testConnectionButton(), SIGNAL(clicked()), this, SLOT(slotTestConnection()) ); + connect( mainWidget->testConnectionButton(), TQT_SIGNAL(clicked()), this, TQT_SLOT(slotTestConnection()) ); } KexiDBConnectionTabWidget::~KexiDBConnectionTabWidget() { } -void KexiDBConnectionTabWidget::setData(const KexiProjectData& data, const QString& shortcutFileName) +void KexiDBConnectionTabWidget::setData(const KexiProjectData& data, const TQString& shortcutFileName) { mainWidget->setData( data, shortcutFileName ); detailsWidget->chkUseSocket->setChecked( data.constConnectionData()->useLocalSocketFile ); @@ -256,7 +256,7 @@ void KexiDBConnectionTabWidget::setData(const KexiProjectData& data, const QStri } void KexiDBConnectionTabWidget::setData(const KexiDB::ConnectionData& data, - const QString& shortcutFileName) + const TQString& shortcutFileName) { mainWidget->setData( data, shortcutFileName ); detailsWidget->chkUseSocket->setChecked( data.useLocalSocketFile ); @@ -277,23 +277,23 @@ KexiProjectData KexiDBConnectionTabWidget::currentProjectData() // if (d->isDatabaseShortcut) { if (mainWidget->connectionOnly()) { data.connectionData()->caption = mainWidget->titleEdit->text(); - data.setCaption( QString::null ); + data.setCaption( TQString() ); data.connectionData()->description = detailsWidget->descriptionEdit->text(); - data.setDatabaseName( QString::null ); + data.setDatabaseName( TQString() ); } else { - data.connectionData()->caption = QString::null; /* connection name is not specified... */ + data.connectionData()->caption = TQString(); /* connection name is not specified... */ data.setCaption( mainWidget->titleEdit->text() ); data.setDescription( detailsWidget->descriptionEdit->text() ); data.setDatabaseName( mainWidget->nameCombo->currentText() ); } // } /* else { - data.setCaption( QString::null ); + data.setCaption( TQString() ); data.connectionData()->connName = config.readEntry("caption"); - data.setDescription( QString::null ); + data.setDescription( TQString() ); data.connectionData()->description = config.readEntry("comment"); - data.setDatabaseName( QString::null ); + data.setDatabaseName( TQString() ); }*/ data.connectionData()->driverName = mainWidget->driversCombo()->selectedDriverName(); @@ -303,11 +303,11 @@ KexiProjectData KexiDBConnectionTabWidget::currentProjectData() }*/ data.connectionData()->hostName = (mainWidget->remotehostRBtn->isChecked()/*remote*/) ? mainWidget->hostEdit->text() - : QString::null; + : TQString(); data.connectionData()->port = mainWidget->chkPortDefault->isChecked() ? 0 : mainWidget->customPortEdit->value(); data.connectionData()->localSocketFileName = detailsWidget->chkSocketDefault->isChecked() - ? QString::null : detailsWidget->customSocketEdit->url(); + ? TQString() : detailsWidget->customSocketEdit->url(); data.connectionData()->useLocalSocketFile = detailsWidget->chkUseSocket->isChecked(); //UNSAFE!!!! data.connectionData()->userName = mainWidget->userEdit->text(); @@ -337,7 +337,7 @@ void KexiDBConnectionTabWidget::slotTestConnection() //! @todo set proper help ctxt ID KexiDBConnectionDialog::KexiDBConnectionDialog(const KexiProjectData& data, - const QString& shortcutFileName, const KGuiItem& acceptButtonGuiItem) + const TQString& shortcutFileName, const KGuiItem& acceptButtonGuiItem) : KDialogBase(0, "dlg", true, i18n("Open Database"), KDialogBase::User1|KDialogBase::Cancel|KDialogBase::Help, KDialogBase::User1, false, @@ -352,7 +352,7 @@ KexiDBConnectionDialog::KexiDBConnectionDialog(const KexiProjectData& data, } KexiDBConnectionDialog::KexiDBConnectionDialog(const KexiDB::ConnectionData& data, - const QString& shortcutFileName, const KGuiItem& acceptButtonGuiItem) + const TQString& shortcutFileName, const KGuiItem& acceptButtonGuiItem) : KDialogBase(0, "dlg", true, i18n("Connect to a Database Server"), KDialogBase::User1|KDialogBase::Cancel|KDialogBase::Help, KDialogBase::User1, false, @@ -372,10 +372,10 @@ KexiDBConnectionDialog::~KexiDBConnectionDialog() void KexiDBConnectionDialog::init() { - connect( this, SIGNAL(user1Clicked()), this, SLOT(accept())); + connect( this, TQT_SIGNAL(user1Clicked()), this, TQT_SLOT(accept())); setMainWidget(tabWidget); - connect(tabWidget->mainWidget, SIGNAL(saveChanges()), this, SIGNAL(saveChanges())); - connect(tabWidget, SIGNAL(testConnection()), this, SIGNAL(testConnection())); + connect(tabWidget->mainWidget, TQT_SIGNAL(saveChanges()), this, TQT_SIGNAL(saveChanges())); + connect(tabWidget, TQT_SIGNAL(testConnection()), this, TQT_SIGNAL(testConnection())); adjustSize(); resize(width(), tabWidget->height()); diff --git a/kexi/widget/kexidbconnectionwidget.h b/kexi/widget/kexidbconnectionwidget.h index dd8559e5..72c49c89 100644 --- a/kexi/widget/kexidbconnectionwidget.h +++ b/kexi/widget/kexidbconnectionwidget.h @@ -36,20 +36,21 @@ class KexiDBConnectionTabWidget; class KEXIEXTWIDGETS_EXPORT KexiDBConnectionWidget : public KexiDBConnectionWidgetBase { Q_OBJECT + TQ_OBJECT public: - KexiDBConnectionWidget( QWidget* parent = 0, const char* name = 0 ); + KexiDBConnectionWidget( TQWidget* tqparent = 0, const char* name = 0 ); virtual ~KexiDBConnectionWidget(); /*! Sets project data \a data. \a shortcutFileName is only used to check if the file is writable (if no, "save changes" button will be disabled). */ - void setData(const KexiProjectData& data, const QString& shortcutFileName = QString::null); + void setData(const KexiProjectData& data, const TQString& shortcutFileName = TQString()); /*! Sets connection data \a data. \a shortcutFileName is only used to check if the file is writable (if no, "save changes" button will be disabled). */ - void setData(const KexiDB::ConnectionData& data, const QString& shortcutFileName = QString::null); + void setData(const KexiDB::ConnectionData& data, const TQString& shortcutFileName = TQString()); KexiProjectData data(); @@ -77,7 +78,7 @@ class KEXIEXTWIDGETS_EXPORT KexiDBConnectionWidget : public KexiDBConnectionWidg protected: void setDataInternal(const KexiProjectData& data, bool connectionOnly, - const QString& shortcutFileName); + const TQString& shortcutFileName); KexiProjectData m_data; KexiDBDriverComboBox *m_driversCombo; @@ -91,16 +92,17 @@ class KEXIEXTWIDGETS_EXPORT KexiDBConnectionWidget : public KexiDBConnectionWidg class KEXIEXTWIDGETS_EXPORT KexiDBConnectionTabWidget : public KTabWidget { Q_OBJECT + TQ_OBJECT public: - KexiDBConnectionTabWidget( QWidget* parent = 0, const char* name = 0 ); + KexiDBConnectionTabWidget( TQWidget* tqparent = 0, const char* name = 0 ); virtual ~KexiDBConnectionTabWidget(); /*! Sets connection data \a data. \a shortcutFileName is only used to check if the file is writable (if no, "save changes" button will be disabled). */ - void setData(const KexiProjectData& data, const QString& shortcutFileName = QString::null); - void setData(const KexiDB::ConnectionData& data, const QString& shortcutFileName = QString::null); + void setData(const KexiProjectData& data, const TQString& shortcutFileName = TQString()); + void setData(const KexiDB::ConnectionData& data, const TQString& shortcutFileName = TQString()); KexiProjectData currentProjectData(); //! \return true if 'save password' option is selected @@ -123,6 +125,7 @@ class KEXIEXTWIDGETS_EXPORT KexiDBConnectionTabWidget : public KTabWidget class KEXIEXTWIDGETS_EXPORT KexiDBConnectionDialog : public KDialogBase { Q_OBJECT + TQ_OBJECT public: /*! Creates a new connection dialog for project data \a data. @@ -134,7 +137,7 @@ class KEXIEXTWIDGETS_EXPORT KexiDBConnectionDialog : public KDialogBase If \a shortcutFileName is empty, the button will be hidden. \a acceptButtonGuiItem allows to override default "Open" button's appearance. */ KexiDBConnectionDialog(const KexiProjectData& data, - const QString& shortcutFileName = QString::null, + const TQString& shortcutFileName = TQString(), const KGuiItem& acceptButtonGuiItem = KGuiItem("")); /*! Creates a new connection dialog for connection data \a data. @@ -144,7 +147,7 @@ class KEXIEXTWIDGETS_EXPORT KexiDBConnectionDialog : public KDialogBase The shortcut file is in .KEXIC format. See above constructor for more details. */ KexiDBConnectionDialog(const KexiDB::ConnectionData& data, - const QString& shortcutFileName = QString::null, + const TQString& shortcutFileName = TQString(), const KGuiItem& acceptButtonGuiItem = KGuiItem("")); ~KexiDBConnectionDialog(); diff --git a/kexi/widget/kexidbconnectionwidgetbase.ui b/kexi/widget/kexidbconnectionwidgetbase.ui index 70fcddca..fc488852 100644 --- a/kexi/widget/kexidbconnectionwidgetbase.ui +++ b/kexi/widget/kexidbconnectionwidgetbase.ui @@ -1,6 +1,6 @@ <!DOCTYPE UI><UI version="3.3" stdsetdef="1"> <class>KexiDBConnectionWidgetBase</class> -<widget class="QWidget"> +<widget class="TQWidget"> <property name="name"> <cstring>KexiDBConnectionWidgetBase</cstring> </property> @@ -19,15 +19,15 @@ <property name="margin"> <number>0</number> </property> - <widget class="QLayoutWidget" row="0" column="0" rowspan="3" colspan="1"> + <widget class="TQLayoutWidget" row="0" column="0" rowspan="3" colspan="1"> <property name="name"> - <cstring>layout7</cstring> + <cstring>tqlayout7</cstring> </property> <vbox> <property name="name"> <cstring>unnamed</cstring> </property> - <widget class="QLabel"> + <widget class="TQLabel"> <property name="name"> <cstring>iconLabel</cstring> </property> @@ -39,7 +39,7 @@ <verstretch>0</verstretch> </sizepolicy> </property> - <property name="minimumSize"> + <property name="tqminimumSize"> <size> <width>48</width> <height>48</height> @@ -56,7 +56,7 @@ <property name="sizeType"> <enum>Expanding</enum> </property> - <property name="sizeHint"> + <property name="tqsizeHint"> <size> <width>20</width> <height>331</height> @@ -75,14 +75,14 @@ <property name="sizeType"> <enum>MinimumExpanding</enum> </property> - <property name="sizeHint"> + <property name="tqsizeHint"> <size> <width>20</width> <height>4</height> </size> </property> </spacer> - <widget class="QButtonGroup" row="0" column="1"> + <widget class="TQButtonGroup" row="0" column="1"> <property name="name"> <cstring>locationBGrp</cstring> </property> @@ -111,7 +111,7 @@ <property name="sizeType"> <enum>Expanding</enum> </property> - <property name="sizeHint"> + <property name="tqsizeHint"> <size> <width>41</width> <height>20</height> @@ -126,7 +126,7 @@ <number>0</number> </property> </widget> - <widget class="QLabel" row="3" column="0" rowspan="1" colspan="2"> + <widget class="TQLabel" row="3" column="0" rowspan="1" colspan="2"> <property name="name"> <cstring>portLbl</cstring> </property> @@ -139,7 +139,7 @@ <cstring>hostEdit</cstring> </property> </widget> - <widget class="QRadioButton" row="1" column="0" rowspan="1" colspan="3"> + <widget class="TQRadioButton" row="1" column="0" rowspan="1" colspan="3"> <property name="name"> <cstring>localhostRBtn</cstring> </property> @@ -163,14 +163,14 @@ <property name="sizeType"> <enum>Expanding</enum> </property> - <property name="sizeHint"> + <property name="tqsizeHint"> <size> <width>90</width> <height>20</height> </size> </property> </spacer> - <widget class="QLabel" row="2" column="0" rowspan="1" colspan="2"> + <widget class="TQLabel" row="2" column="0" rowspan="1" colspan="2"> <property name="name"> <cstring>hostLbl</cstring> </property> @@ -181,7 +181,7 @@ <cstring>hostEdit</cstring> </property> </widget> - <widget class="QCheckBox" row="3" column="2" rowspan="1" colspan="2"> + <widget class="TQCheckBox" row="3" column="2" rowspan="1" colspan="2"> <property name="name"> <cstring>chkPortDefault</cstring> </property> @@ -193,7 +193,7 @@ <number>2</number> </property> </widget> - <widget class="QRadioButton" row="1" column="3" rowspan="1" colspan="2"> + <widget class="TQRadioButton" row="1" column="3" rowspan="1" colspan="2"> <property name="name"> <cstring>remotehostRBtn</cstring> </property> @@ -204,7 +204,7 @@ <number>1</number> </property> </widget> - <widget class="QLabel" row="0" column="0"> + <widget class="TQLabel" row="0" column="0"> <property name="name"> <cstring>lblEngine</cstring> </property> @@ -218,7 +218,7 @@ <cstring></cstring> </property> </widget> - <widget class="QFrame" row="0" column="1" rowspan="1" colspan="6"> + <widget class="TQFrame" row="0" column="1" rowspan="1" colspan="6"> <property name="name"> <cstring>frmEngine</cstring> </property> @@ -231,7 +231,7 @@ </widget> </grid> </widget> - <widget class="QGroupBox" row="1" column="1"> + <widget class="TQGroupBox" row="1" column="1"> <property name="name"> <cstring>authenticationGBox</cstring> </property> @@ -250,7 +250,7 @@ <property name="name"> <cstring>unnamed</cstring> </property> - <widget class="QLabel" row="0" column="0"> + <widget class="TQLabel" row="0" column="0"> <property name="name"> <cstring>userLbl</cstring> </property> @@ -266,7 +266,7 @@ <cstring>userEdit</cstring> </property> </widget> - <widget class="QLabel" row="1" column="0"> + <widget class="TQLabel" row="1" column="0"> <property name="name"> <cstring>passwordLbl</cstring> </property> @@ -285,7 +285,7 @@ <enum>Password</enum> </property> </widget> - <widget class="QCheckBox" row="2" column="1"> + <widget class="TQCheckBox" row="2" column="1"> <property name="name"> <cstring>chkSavePassword</cstring> </property> @@ -295,7 +295,7 @@ </widget> </grid> </widget> - <widget class="QGroupBox" row="2" column="1"> + <widget class="TQGroupBox" row="2" column="1"> <property name="name"> <cstring>dbGroupBox</cstring> </property> @@ -314,7 +314,7 @@ <property name="name"> <cstring>unnamed</cstring> </property> - <widget class="QLabel" row="0" column="0"> + <widget class="TQLabel" row="0" column="0"> <property name="name"> <cstring>nameLabel</cstring> </property> @@ -330,14 +330,14 @@ <cstring>titleEdit</cstring> </property> </widget> - <widget class="QLabel" row="1" column="0"> + <widget class="TQLabel" row="1" column="0"> <property name="name"> <cstring>titleLabel</cstring> </property> <property name="text"> <string>&Title (optional):</string> </property> - <property name="alignment"> + <property name="tqalignment"> <set>AlignTop</set> </property> <property name="buddy" stdset="0"> @@ -356,7 +356,7 @@ <verstretch>0</verstretch> </sizepolicy> </property> - <property name="maximumSize"> + <property name="tqmaximumSize"> <size> <width>32</width> <height>32767</height> @@ -393,9 +393,9 @@ </widget> </grid> </widget> - <widget class="QLayoutWidget" row="3" column="0" rowspan="1" colspan="2"> + <widget class="TQLayoutWidget" row="3" column="0" rowspan="1" colspan="2"> <property name="name"> - <cstring>layout5</cstring> + <cstring>tqlayout5</cstring> </property> <hbox> <property name="name"> @@ -411,14 +411,14 @@ <property name="sizeType"> <enum>Minimum</enum> </property> - <property name="sizeHint"> + <property name="tqsizeHint"> <size> <width>80</width> <height>20</height> </size> </property> </spacer> - <widget class="QFrame"> + <widget class="TQFrame"> <property name="name"> <cstring>frmBottom</cstring> </property> @@ -449,7 +449,7 @@ <tabstop>titleEdit</tabstop> <tabstop>frmEngine</tabstop> </tabstops> -<layoutdefaults spacing="6" margin="11"/> +<tqlayoutdefaults spacing="6" margin="11"/> <includehints> <includehint>knuminput.h</includehint> <includehint>knuminput.h</includehint> diff --git a/kexi/widget/kexidbconnectionwidgetdetailsbase.ui b/kexi/widget/kexidbconnectionwidgetdetailsbase.ui index b729c9bc..6c173b42 100644 --- a/kexi/widget/kexidbconnectionwidgetdetailsbase.ui +++ b/kexi/widget/kexidbconnectionwidgetdetailsbase.ui @@ -1,6 +1,6 @@ <!DOCTYPE UI><UI version="3.2" stdsetdef="1"> <class>KexiDBConnectionWidgetDetailsBase</class> -<widget class="QWidget"> +<widget class="TQWidget"> <property name="name"> <cstring>KexiDBConnectionWidgetDetailsBase</cstring> </property> @@ -16,9 +16,9 @@ <property name="name"> <cstring>unnamed</cstring> </property> - <widget class="QLayoutWidget" row="1" column="0"> + <widget class="TQLayoutWidget" row="1" column="0"> <property name="name"> - <cstring>layout8</cstring> + <cstring>tqlayout8</cstring> </property> <grid> <property name="name"> @@ -30,7 +30,7 @@ <property name="spacing"> <number>0</number> </property> - <widget class="QCheckBox" row="0" column="0"> + <widget class="TQCheckBox" row="0" column="0"> <property name="name"> <cstring>chkUseSocket</cstring> </property> @@ -38,9 +38,9 @@ <string>Use socket &file instead of TCP/IP port:</string> </property> </widget> - <widget class="QLayoutWidget" row="1" column="0" rowspan="1" colspan="2"> + <widget class="TQLayoutWidget" row="1" column="0" rowspan="1" colspan="2"> <property name="name"> - <cstring>layout6</cstring> + <cstring>tqlayout6</cstring> </property> <hbox> <property name="name"> @@ -62,14 +62,14 @@ <property name="sizeType"> <enum>Fixed</enum> </property> - <property name="sizeHint"> + <property name="tqsizeHint"> <size> <width>16</width> <height>20</height> </size> </property> </spacer> - <widget class="QCheckBox"> + <widget class="TQCheckBox"> <property name="name"> <cstring>chkSocketDefault</cstring> </property> @@ -114,7 +114,7 @@ <property name="sizeType"> <enum>Expanding</enum> </property> - <property name="sizeHint"> + <property name="tqsizeHint"> <size> <width>129</width> <height>20</height> @@ -123,9 +123,9 @@ </spacer> </grid> </widget> - <widget class="QLayoutWidget" row="0" column="0"> + <widget class="TQLayoutWidget" row="0" column="0"> <property name="name"> - <cstring>layout9</cstring> + <cstring>tqlayout9</cstring> </property> <grid> <property name="name"> @@ -142,7 +142,7 @@ <cstring>descriptionEdit</cstring> </property> </widget> - <widget class="QLabel" row="0" column="0"> + <widget class="TQLabel" row="0" column="0"> <property name="name"> <cstring>textLabel1_2</cstring> </property> @@ -182,10 +182,10 @@ <includes> <include location="local" impldecl="in implementation">kexidbconnectionwidgetdetailsbase.ui.h</include> </includes> -<slots> +<Q_SLOTS> <slot access="protected">slotCBToggled( bool on )</slot> -</slots> -<layoutdefaults spacing="6" margin="11"/> +</Q_SLOTS> +<tqlayoutdefaults spacing="6" margin="11"/> <includehints> <includehint>kurlrequester.h</includehint> <includehint>klineedit.h</includehint> diff --git a/kexi/widget/kexidbdrivercombobox.cpp b/kexi/widget/kexidbdrivercombobox.cpp index e3431531..8026106d 100644 --- a/kexi/widget/kexidbdrivercombobox.cpp +++ b/kexi/widget/kexidbdrivercombobox.cpp @@ -19,17 +19,17 @@ #include "kexidbdrivercombobox.h" -#include <qlistbox.h> +#include <tqlistbox.h> #include <kiconloader.h> -KexiDBDriverComboBox::KexiDBDriverComboBox(QWidget* parent, const KexiDB::Driver::InfoMap& driversInfo, +KexiDBDriverComboBox::KexiDBDriverComboBox(TQWidget* tqparent, const KexiDB::Driver::InfoMap& driversInfo, Options options) - : KComboBox(parent, "KexiDBDriverComboBox") + : KComboBox(tqparent, "KexiDBDriverComboBox") { //retrieve list of drivers and sort it: file-based first, then server-based - QStringList captionsForFileBasedDrivers, captionsForServerBasedDrivers; - QMap<QString,QString> fileBasedDriversDict, serverBasedDriversDict; //a map from caption to name + TQStringList captionsForFileBasedDrivers, captionsForServerBasedDrivers; + TQMap<TQString,TQString> fileBasedDriversDict, serverBasedDriversDict; //a map from caption to name foreach(KexiDB::Driver::InfoMap::ConstIterator, it, driversInfo) { if (it.data().fileBased) { captionsForFileBasedDrivers += it.data().caption; @@ -44,7 +44,7 @@ KexiDBDriverComboBox::KexiDBDriverComboBox(QWidget* parent, const KexiDB::Driver captionsForServerBasedDrivers.sort(); //insert file-based if (options & ShowFileDrivers) { - foreach(QStringList::ConstIterator, it, captionsForFileBasedDrivers) { + foreach(TQStringList::ConstIterator, it, captionsForFileBasedDrivers) { const KexiDB::Driver::Info& info = driversInfo[ fileBasedDriversDict[ *it ] ]; //! @todo change this if better icon is available insertItem( SmallIcon("gear"), info.caption ); @@ -53,7 +53,7 @@ KexiDBDriverComboBox::KexiDBDriverComboBox(QWidget* parent, const KexiDB::Driver } //insert server-based if (options & ShowServerDrivers) { - foreach(QStringList::ConstIterator, it, captionsForServerBasedDrivers) { + foreach(TQStringList::ConstIterator, it, captionsForServerBasedDrivers) { const KexiDB::Driver::Info& info = driversInfo[ serverBasedDriversDict[ *it ] ]; //! @todo change this if better icon is available insertItem( SmallIcon("gear"), info.caption ); @@ -72,17 +72,17 @@ KexiDBDriverComboBox::~KexiDBDriverComboBox() { } -QString KexiDBDriverComboBox::selectedDriverName() const +TQString KexiDBDriverComboBox::selectedDriverName() const { - QMapConstIterator<QString,QString> it( m_driversMap.find( text( currentItem() ) ) ); + TQMapConstIterator<TQString,TQString> it( m_driversMap.tqfind( text( currentItem() ) ) ); if (it==m_driversMap.constEnd()) - return QString::null; + return TQString(); return it.data(); } -void KexiDBDriverComboBox::setDriverName(const QString& driverName) +void KexiDBDriverComboBox::setDriverName(const TQString& driverName) { - int index = m_driverNames.findIndex( driverName.lower() ); + int index = m_driverNames.tqfindIndex( driverName.lower() ); if (index==-1) { return; } diff --git a/kexi/widget/kexidbdrivercombobox.h b/kexi/widget/kexidbdrivercombobox.h index 981b67c3..cdd18f76 100644 --- a/kexi/widget/kexidbdrivercombobox.h +++ b/kexi/widget/kexidbdrivercombobox.h @@ -20,8 +20,8 @@ #ifndef KEXIDBDRIVERCOMBOBOX_H #define KEXIDBDRIVERCOMBOBOX_H -#include <qwidget.h> -#include <qmap.h> +#include <tqwidget.h> +#include <tqmap.h> #include <kcombobox.h> @@ -47,6 +47,7 @@ A more complete example can be found in class KEXIEXTWIDGETS_EXPORT KexiDBDriverComboBox : public KComboBox { Q_OBJECT + TQ_OBJECT public: enum Options { @@ -64,7 +65,7 @@ class KEXIEXTWIDGETS_EXPORT KexiDBDriverComboBox : public KComboBox If \a includeFileBasedDrivers is set to false, then only those drivers that are for database servers (those which have X-Kexi-DriverType=Network in their .desktop file) are shown. */ - KexiDBDriverComboBox(QWidget* parent, const KexiDB::Driver::InfoMap& driversInfo, + KexiDBDriverComboBox(TQWidget* tqparent, const KexiDB::Driver::InfoMap& driversInfo, Options options = ShowAll ); ~KexiDBDriverComboBox(); @@ -76,13 +77,13 @@ class KEXIEXTWIDGETS_EXPORT KexiDBDriverComboBox : public KComboBox was false, this won't include the file based drivers either. \return a list of names of drivers that were found */ - QStringList driverNames() const { return m_driverNames; } + TQStringList driverNames() const { return m_driverNames; } /*! Get the name of the currrently selected driver. If the combobox is empty, - QString::null will be returned. + TQString() will be returned. \return the name of the currently selected driver */ - QString selectedDriverName() const; + TQString selectedDriverName() const; /*! Set the currrently selected driver. @@ -91,11 +92,11 @@ class KEXIEXTWIDGETS_EXPORT KexiDBDriverComboBox : public KComboBox is case insensitive. */ - void setDriverName(const QString& driverName); + void setDriverName(const TQString& driverName); protected: - QMap<QString,QString> m_driversMap; - QStringList m_driverNames; + TQMap<TQString,TQString> m_driversMap; + TQStringList m_driverNames; }; #endif diff --git a/kexi/widget/kexidswelcome.cpp b/kexi/widget/kexidswelcome.cpp index 957132a1..ca2480f6 100644 --- a/kexi/widget/kexidswelcome.cpp +++ b/kexi/widget/kexidswelcome.cpp @@ -17,9 +17,9 @@ * Boston, MA 02110-1301, USA. */ -#include <qlayout.h> -#include <qcheckbox.h> -#include <qpushbutton.h> +#include <tqlayout.h> +#include <tqcheckbox.h> +#include <tqpushbutton.h> #include <klocale.h> #include <kiconloader.h> @@ -30,22 +30,22 @@ #include "kexidatasourcewizard.h" #include "kexidswelcome.h" -KexiDSWelcome::KexiDSWelcome(KexiDataSourceWizard *parent) - : QWidget(parent) +KexiDSWelcome::KexiDSWelcome(KexiDataSourceWizard *tqparent) + : TQWidget(tqparent) { - m_wiz = parent; + m_wiz = tqparent; KexiDSPixmap *pic = new KexiDSPixmap(this); - QLabel *lText = new QLabel(i18n("Kexi can help you with creation of %2 using data sources in almost no time with the \"%1 Wizard\""), this); - lText->setAlignment(AlignTop | AlignLeft | WordBreak); - QCheckBox *useWizard = new QCheckBox(i18n("Create %1 using the \"%1 Wizard\""), this); - connect(useWizard, SIGNAL(toggled(bool)), this, SLOT(setUseWizard(bool))); + TQLabel *lText = new TQLabel(i18n("Kexi can help you with creation of %2 using data sources in almost no time with the \"%1 Wizard\""), this); + lText->tqsetAlignment(AlignTop | AlignLeft | WordBreak); + TQCheckBox *useWizard = new TQCheckBox(i18n("Create %1 using the \"%1 Wizard\""), this); + connect(useWizard, TQT_SIGNAL(toggled(bool)), this, TQT_SLOT(setUseWizard(bool))); useWizard->setChecked(true); - QSpacerItem *spacer = new QSpacerItem(320, 220); - QCheckBox *dontShow = new QCheckBox(i18n("Do not show this wizard again"), this); + TQSpacerItem *spacer = new TQSpacerItem(320, 220); + TQCheckBox *dontShow = new TQCheckBox(i18n("Do not show this wizard again"), this); - QGridLayout *g = new QGridLayout(this); + TQGridLayout *g = new TQGridLayout(this); g->addMultiCellWidget(pic, 0, 4, 0, 0); g->addWidget(lText, 0, 1); @@ -57,7 +57,7 @@ KexiDSWelcome::KexiDSWelcome(KexiDataSourceWizard *parent) void KexiDSWelcome::setUseWizard(bool use) { -#if KDE_IS_VERSION(3,1,9) && !defined(Q_WS_WIN) +#if KDE_IS_VERSION(3,1,9) && !defined(TQ_WS_WIN) bool useIcons = KGlobalSettings::showIconsOnPushButtons(); #else bool useIcons = true; diff --git a/kexi/widget/kexidswelcome.h b/kexi/widget/kexidswelcome.h index 23cb64fe..dc7cbd14 100644 --- a/kexi/widget/kexidswelcome.h +++ b/kexi/widget/kexidswelcome.h @@ -20,7 +20,7 @@ #ifndef KEXIDSWELCOME_H #define KEXIDSWELCOME_H -#include <qwidget.h> +#include <tqwidget.h> class KexiDataSourceWizard; @@ -29,12 +29,13 @@ class KexiDataSourceWizard; * it is the greeting page per default, where people * can choose whether they want to use the wizard or not. */ -class KEXIEXTWIDGETS_EXPORT KexiDSWelcome : public QWidget +class KEXIEXTWIDGETS_EXPORT KexiDSWelcome : public TQWidget { Q_OBJECT + TQ_OBJECT public: - KexiDSWelcome(KexiDataSourceWizard *parent); + KexiDSWelcome(KexiDataSourceWizard *tqparent); ~KexiDSWelcome(); protected slots: diff --git a/kexi/widget/kexieditor.cpp b/kexi/widget/kexieditor.cpp index f482584e..82af06a3 100644 --- a/kexi/widget/kexieditor.cpp +++ b/kexi/widget/kexieditor.cpp @@ -23,8 +23,8 @@ #include <keximainwindow.h> -#include <qlayout.h> -#include <qframe.h> +#include <tqlayout.h> +#include <tqframe.h> #include <klocale.h> #include <kdebug.h> @@ -50,19 +50,19 @@ copy and paste to the editor. */ class KexiEditorSharedActionConnector : public KexiSharedActionConnector { public: - KexiEditorSharedActionConnector( KexiActionProxy* proxy, QObject* obj ) + KexiEditorSharedActionConnector( KexiActionProxy* proxy, TQObject* obj ) : KexiSharedActionConnector( proxy, obj ) { #ifdef KTEXTEDIT_BASED_SQL_EDITOR - plugSharedAction("edit_cut", SLOT(cut())); - plugSharedAction("edit_copy", SLOT(copy())); - plugSharedAction("edit_paste", SLOT(paste())); - plugSharedAction("edit_clear", SLOT(clear())); - plugSharedAction("edit_undo", SLOT(undo())); - plugSharedAction("edit_redo", SLOT(redo())); - plugSharedAction("edit_select_all", SLOT(selectAll())); + plugSharedAction("edit_cut", TQT_SLOT(cut())); + plugSharedAction("edit_copy", TQT_SLOT(copy())); + plugSharedAction("edit_paste", TQT_SLOT(paste())); + plugSharedAction("edit_clear", TQT_SLOT(clear())); + plugSharedAction("edit_undo", TQT_SLOT(undo())); + plugSharedAction("edit_redo", TQT_SLOT(redo())); + plugSharedAction("edit_select_all", TQT_SLOT(selectAll())); #else - QValueList<QCString> actions; + TQValueList<TQCString> actions; actions << "edit_cut" << "edit_copy" << "edit_paste" << "edit_clear" << "edit_undo" << "edit_redo" << "edit_select_all"; plugSharedActionsToExternalGUI(actions, dynamic_cast<KXMLGUIClient*>(obj)); @@ -81,47 +81,47 @@ class KexiEditorPrivate { #endif }; -KexiEditor::KexiEditor(KexiMainWindow *mainWin, QWidget *parent, const char *name) - : KexiViewBase(mainWin, parent, name) +KexiEditor::KexiEditor(KexiMainWindow *mainWin, TQWidget *tqparent, const char *name) + : KexiViewBase(mainWin, tqparent, name) , d(new KexiEditorPrivate()) { - QVBoxLayout *layout = new QVBoxLayout(this); + TQVBoxLayout *tqlayout = new TQVBoxLayout(this); #ifdef KTEXTEDIT_BASED_SQL_EDITOR - d->view = new KTextEdit( "", QString::null, this, "kexi_editor" ); + d->view = new KTextEdit( "", TQString(), this, "kexi_editor" ); //adjust font - connect(d->view, SIGNAL(textChanged()), this, SIGNAL(textChanged())); - QFont f("Courier"); - f.setStyleStrategy(QFont::PreferAntialias); + connect(d->view, TQT_SIGNAL(textChanged()), this, TQT_SIGNAL(textChanged())); + TQFont f("Courier"); + f.setStyleStrategy(TQFont::PreferAntialias); f.setPointSize(d->view->font().pointSize()); d->view->setFont( f ); d->view->setCheckSpellingEnabled(false); #else - QFrame *fr = new QFrame(this); - fr->setFrameStyle(QFrame::Sunken|QFrame::WinPanel); - layout->addWidget(fr); - layout = new QVBoxLayout(fr); - layout->setMargin( 2 ); + TQFrame *fr = new TQFrame(this); + fr->setFrameStyle(TQFrame::Sunken|TQFrame::WinPanel); + tqlayout->addWidget(fr); + tqlayout = new TQVBoxLayout(fr); + tqlayout->setMargin( 2 ); - d->doc = KTextEditor::EditorChooser::createDocument(fr); + d->doc = KTextEditor::EditorChooser::createDocument(TQT_TQOBJECT(fr)); if (!d->doc) return; d->view = d->doc->createView(fr, 0L); KTextEditor::PopupMenuInterface *popupInt = dynamic_cast<KTextEditor::PopupMenuInterface*>( d->view ); if(popupInt) { - QPopupMenu *pop = (QPopupMenu*) mainWin->factory()->container("edit", mainWin); + TQPopupMenu *pop = (TQPopupMenu*) mainWin->factory()->container("edit", mainWin); if(pop) { //plugSharedAction("edit_undo", pop); popupInt->installPopup(pop); } } - connect(d->doc, SIGNAL(textChanged()), this, SIGNAL(textChanged())); + connect(d->doc, TQT_SIGNAL(textChanged()), this, TQT_SIGNAL(textChanged())); #endif - KexiEditorSharedActionConnector c(this, d->view); + KexiEditorSharedActionConnector c(this, TQT_TQOBJECT(d->view)); d->view->installEventFilter(this); - layout->addWidget(d->view); + tqlayout->addWidget(d->view); setViewWidget(d->view, true/*focus*/); d->view->show(); } @@ -145,19 +145,19 @@ bool KexiEditor::isAdvancedEditor() #endif } -QString KexiEditor::text() +TQString KexiEditor::text() { #ifdef KTEXTEDIT_BASED_SQL_EDITOR return d->view->text(); #else if (!d->doc) - return QString::null; + return TQString(); KTextEditor::EditInterface *eIface = KTextEditor::editInterface(d->doc); return eIface->text(); #endif } -void KexiEditor::setText(const QString &text) +void KexiEditor::setText(const TQString &text) { #ifdef KTEXTEDIT_BASED_SQL_EDITOR const bool was_dirty = m_parentView ? m_parentView->dirty() : dirty(); @@ -176,14 +176,14 @@ void KexiEditor::setText(const QString &text) #endif } -void KexiEditor::setHighlightMode(const QString& highlightmodename) +void KexiEditor::setHighlightMode(const TQString& highlightmodename) { #ifdef KTEXTEDIT_BASED_SQL_EDITOR #else KTextEditor::HighlightingInterface *hl = KTextEditor::highlightingInterface( d->doc ); for(uint i = 0; i < hl->hlModeCount(); i++) { //kdDebug() << "hlmode("<<i<<"): " << hl->hlModeName(i) << endl; - if (hl->hlModeName(i).contains(highlightmodename, false)) { + if (hl->hlModeName(i).tqcontains(highlightmodename, false)) { hl->setHlMode(i); return; } diff --git a/kexi/widget/kexieditor.h b/kexi/widget/kexieditor.h index fce5f45b..022b0dd9 100644 --- a/kexi/widget/kexieditor.h +++ b/kexi/widget/kexieditor.h @@ -22,7 +22,7 @@ #ifndef KEXIEDITOR_H #define KEXIEDITOR_H -#include <qwidget.h> +#include <tqwidget.h> #include "kexiviewbase.h" class KTextEdit; @@ -39,6 +39,7 @@ namespace KTextEditor class KEXIEXTWIDGETS_EXPORT KexiEditor : public KexiViewBase { Q_OBJECT + TQ_OBJECT public: @@ -47,12 +48,12 @@ class KEXIEXTWIDGETS_EXPORT KexiEditor : public KexiViewBase * * \param mainWin The \a KexiMainWindow instance this KexiEditor * belongs too. - * \param parent The parent \a QWidget this KexiEditor is child - * of. You don't need to free the KexiEditor cause Qt + * \param tqparent The tqparent \a TQWidget this KexiEditor is child + * of. You don't need to free the KexiEditor cause TQt * will handle that for us. * \param name The name this KexiEditor has. Used only for debugging. */ - KexiEditor(KexiMainWindow *mainWin, QWidget *parent, const char *name = 0); + KexiEditor(KexiMainWindow *mainWin, TQWidget *tqparent, const char *name = 0); /** * Destructor. @@ -68,7 +69,7 @@ class KEXIEXTWIDGETS_EXPORT KexiEditor : public KexiViewBase /** * \return the text displayed in the editor-widget. */ - QString text(); + TQString text(); /** * Set the highlight-mode to \p highlightmodename . If @@ -78,7 +79,7 @@ class KEXIEXTWIDGETS_EXPORT KexiEditor : public KexiViewBase * of string like e.g. "python", "kjs" or "sql" * KTextEditor supports. */ - void setHighlightMode(const QString& highlightmodename); + void setHighlightMode(const TQString& highlightmodename); /** * Find row and column for this \p character and jump to the @@ -100,7 +101,7 @@ class KEXIEXTWIDGETS_EXPORT KexiEditor : public KexiViewBase public slots: /*! Sets editor's text to \a text. 'Dirty' flag remains unchanged. Undo/redo buffer is cleared.*/ - void setText(const QString &text); + void setText(const TQString &text); /*! Display the configuration-dialog. Only avaiable if isAdvancedEditor() returns true. */ void slotConfigureEditor(); diff --git a/kexi/widget/kexifieldcombobox.cpp b/kexi/widget/kexifieldcombobox.cpp index c0355e9c..fcf81036 100644 --- a/kexi/widget/kexifieldcombobox.cpp +++ b/kexi/widget/kexifieldcombobox.cpp @@ -19,16 +19,16 @@ #include "kexifieldcombobox.h" -#include <qheader.h> -#include <qlayout.h> -#include <qlabel.h> -#include <qpushbutton.h> -#include <qcursor.h> -#include <qpoint.h> -#include <qapplication.h> -#include <qbitmap.h> -#include <qstyle.h> -#include <qlistbox.h> +#include <tqheader.h> +#include <tqlayout.h> +#include <tqlabel.h> +#include <tqpushbutton.h> +#include <tqcursor.h> +#include <tqpoint.h> +#include <tqapplication.h> +#include <tqbitmap.h> +#include <tqstyle.h> +#include <tqlistbox.h> #include <kdebug.h> #include <kiconloader.h> @@ -59,26 +59,26 @@ class KexiFieldComboBox::Private { // delete schema; } - QGuardedPtr<KexiProject> prj; + TQGuardedPtr<KexiProject> prj; // KexiDB::TableOrQuerySchema* schema; - QPixmap keyIcon, noIcon; - QString tableOrQueryName; - QString fieldOrExpression; - QMap<QString, QString> captions; + TQPixmap keyIcon, noIcon; + TQString tableOrQueryName; + TQString fieldOrExpression; + TQMap<TQString, TQString> captions; bool table : 1; }; //------------------------ -KexiFieldComboBox::KexiFieldComboBox(QWidget *parent, const char *name) - : KComboBox(true/*rw*/, parent, name) +KexiFieldComboBox::KexiFieldComboBox(TQWidget *tqparent, const char *name) + : KComboBox(true/*rw*/, tqparent, name) , d(new Private()) { setInsertionPolicy(NoInsertion); setCompletionMode(KGlobalSettings::CompletionPopupAuto); setSizeLimit( 16 ); - connect(this, SIGNAL(activated(int)), this, SLOT(slotActivated(int))); - connect(this, SIGNAL(returnPressed(const QString &)), this, SLOT(slotReturnPressed(const QString &))); + connect(this, TQT_SIGNAL(activated(int)), this, TQT_SLOT(slotActivated(int))); + connect(this, TQT_SIGNAL(returnPressed(const TQString &)), this, TQT_SLOT(slotReturnPressed(const TQString &))); // setAcceptDrops(true); // viewport()->setAcceptDrops(true); @@ -102,7 +102,7 @@ KexiProject* KexiFieldComboBox::project() const return d->prj; } -void KexiFieldComboBox::setTableOrQuery(const QString& name, bool table) +void KexiFieldComboBox::setTableOrQuery(const TQString& name, bool table) { d->tableOrQueryName = name; d->table = table; @@ -127,7 +127,7 @@ void KexiFieldComboBox::setTableOrQuery(const QString& name, bool table) (colinfo && (colinfo->field->isPrimaryKey() || colinfo->field->isUniqueKey())) ? d->keyIcon : d->noIcon - , colinfo->aliasOrName()); + , TQString(colinfo->aliasOrName())); completionObject()->addItem(colinfo->aliasOrName()); //store user-friendly caption (used by fieldOrExpressionCaption()) d->captions.insert( colinfo->aliasOrName(), colinfo->captionOrAliasOrName() ); @@ -137,7 +137,7 @@ void KexiFieldComboBox::setTableOrQuery(const QString& name, bool table) setFieldOrExpression(d->fieldOrExpression); } -QString KexiFieldComboBox::tableOrQueryName() const +TQString KexiFieldComboBox::tableOrQueryName() const { return d->tableOrQueryName; } @@ -147,15 +147,15 @@ bool KexiFieldComboBox::isTableAssigned() const return d->table; } -void KexiFieldComboBox::setFieldOrExpression(const QString& string) +void KexiFieldComboBox::setFieldOrExpression(const TQString& string) { - const QString name(string); //string.stripWhiteSpace().lower()); - const int pos = name.find('.'); + const TQString name(string); //string.stripWhiteSpace().lower()); + const int pos = name.tqfind('.'); if (pos==-1) { d->fieldOrExpression = name; } else { - QString objectName = name.left(pos); + TQString objectName = name.left(pos); if (d->tableOrQueryName!=objectName) { d->fieldOrExpression = name; setCurrentItem(0); @@ -167,7 +167,7 @@ void KexiFieldComboBox::setFieldOrExpression(const QString& string) d->fieldOrExpression = name.mid(pos+1); } - QListBoxItem *item = listBox()->findItem(d->fieldOrExpression); + TQListBoxItem *item = listBox()->tqfindItem(d->fieldOrExpression); if (!item) { setCurrentItem(0); setCurrentText(d->fieldOrExpression); @@ -181,13 +181,13 @@ void KexiFieldComboBox::setFieldOrExpression(int index) { index++; //skip 1st empty item if (index>=count()) { - kexiwarn << QString("KexiFieldComboBox::setFieldOrExpression(int index): index %1 " - "out of range (0..%2)").arg(index).arg(count()-1) << endl; + kexiwarn << TQString("KexiFieldComboBox::setFieldOrExpression(int index): index %1 " + "out of range (0..%2)").tqarg(index).tqarg(count()-1) << endl; index = -1; } if (index<=0) { setCurrentItem(0); - d->fieldOrExpression = QString::null; + d->fieldOrExpression = TQString(); } else { setCurrentItem(index); @@ -195,7 +195,7 @@ void KexiFieldComboBox::setFieldOrExpression(int index) } } -QString KexiFieldComboBox::fieldOrExpression() const +TQString KexiFieldComboBox::fieldOrExpression() const { return d->fieldOrExpression; } @@ -209,7 +209,7 @@ int KexiFieldComboBox::indexOfField() const return currentItem()>0 ? (currentItem()-1) : -1; } -QString KexiFieldComboBox::fieldOrExpressionCaption() const +TQString KexiFieldComboBox::fieldOrExpressionCaption() const { return d->captions[ d->fieldOrExpression ]; } @@ -220,7 +220,7 @@ void KexiFieldComboBox::slotActivated(int i) emit selected(); } -void KexiFieldComboBox::slotReturnPressed(const QString & text) +void KexiFieldComboBox::slotReturnPressed(const TQString & text) { //text is available: select item for this text: int index; @@ -228,7 +228,7 @@ void KexiFieldComboBox::slotReturnPressed(const QString & text) index = 0; } else { - QListBoxItem *item = listBox()->findItem( text, Qt::ExactMatch ); + TQListBoxItem *item = listBox()->tqfindItem( text, TQt::ExactMatch ); if (!item) return; index = listBox()->index( item ); @@ -239,11 +239,11 @@ void KexiFieldComboBox::slotReturnPressed(const QString & text) slotActivated( index ); } -void KexiFieldComboBox::focusOutEvent( QFocusEvent *e ) +void KexiFieldComboBox::focusOutEvent( TQFocusEvent *e ) { KComboBox::focusOutEvent( e ); // accept changes if the focus is moved - if (!KexiUtils::hasParent(this, focusWidget())) //(a check needed because drop-down listbox also causes a focusout) + if (!KexiUtils::hasParent(TQT_TQOBJECT(this), TQT_TQOBJECT(tqfocusWidget()))) //(a check needed because drop-down listbox also causes a focusout) slotReturnPressed(currentText()); } diff --git a/kexi/widget/kexifieldcombobox.h b/kexi/widget/kexifieldcombobox.h index 238168d2..9619f407 100644 --- a/kexi/widget/kexifieldcombobox.h +++ b/kexi/widget/kexifieldcombobox.h @@ -20,7 +20,7 @@ #ifndef KEXIFIELDCOMBOBOX_H #define KEXIFIELDCOMBOBOX_H -#include <qpixmap.h> +#include <tqpixmap.h> #include <kcombobox.h> namespace KexiDB { @@ -34,9 +34,10 @@ class KexiProject; class KEXIEXTWIDGETS_EXPORT KexiFieldComboBox : public KComboBox { Q_OBJECT + TQ_OBJECT public: - KexiFieldComboBox(QWidget *parent, const char *name = 0); + KexiFieldComboBox(TQWidget *tqparent, const char *name = 0); virtual ~KexiFieldComboBox(); // /*! Sets table or query schema \a schema. @@ -52,13 +53,13 @@ class KEXIEXTWIDGETS_EXPORT KexiFieldComboBox : public KComboBox //! Sets global project that is used to retrieve schema informationm for this combo box. void setProject(KexiProject *prj); - void setTableOrQuery(const QString& name, bool table); - QString tableOrQueryName() const; + void setTableOrQuery(const TQString& name, bool table); + TQString tableOrQueryName() const; bool isTableAssigned() const; - void setFieldOrExpression(const QString& string); + void setFieldOrExpression(const TQString& string); void setFieldOrExpression(int index); - QString fieldOrExpression() const; - QString fieldOrExpressionCaption() const; + TQString fieldOrExpression() const; + TQString fieldOrExpressionCaption() const; /*! \return index of selected table or query field. -1 is returned if there is nothing selected or expression is selected @@ -70,10 +71,10 @@ class KEXIEXTWIDGETS_EXPORT KexiFieldComboBox : public KComboBox protected slots: void slotActivated(int); - void slotReturnPressed(const QString & text); + void slotReturnPressed(const TQString & text); protected: - virtual void focusOutEvent( QFocusEvent *e ); + virtual void focusOutEvent( TQFocusEvent *e ); class Private; Private *d; diff --git a/kexi/widget/kexifieldlistview.cpp b/kexi/widget/kexifieldlistview.cpp index 84b577a6..e9796abf 100644 --- a/kexi/widget/kexifieldlistview.cpp +++ b/kexi/widget/kexifieldlistview.cpp @@ -19,15 +19,15 @@ #include "kexifieldlistview.h" -#include <qheader.h> -#include <qlayout.h> -#include <qlabel.h> -#include <qpushbutton.h> -#include <qcursor.h> -#include <qpoint.h> -#include <qapplication.h> -#include <qbitmap.h> -#include <qstyle.h> +#include <tqheader.h> +#include <tqlayout.h> +#include <tqlabel.h> +#include <tqpushbutton.h> +#include <tqcursor.h> +#include <tqpoint.h> +#include <tqapplication.h> +#include <tqbitmap.h> +#include <tqstyle.h> #include <kdebug.h> #include <kiconloader.h> @@ -42,8 +42,8 @@ #include <kexidragobjects.h> #include <kexiutils/utils.h> -KexiFieldListView::KexiFieldListView(QWidget *parent, const char *name, int options) - : KListView(parent, name) +KexiFieldListView::KexiFieldListView(TQWidget *tqparent, const char *name, int options) + : KListView(tqparent, name) , m_schema(0) , m_keyIcon(SmallIcon("key")) , m_noIcon(KexiUtils::emptyIcon(KIcon::Small)) @@ -59,14 +59,14 @@ KexiFieldListView::KexiFieldListView(QWidget *parent, const char *name, int opti if (m_options & ShowDataTypes) addColumn(i18n("Data Type")); if (m_options & AllowMultiSelection) - setSelectionMode(QListView::Extended); - setResizeMode(QListView::LastColumn); + setSelectionMode(TQListView::Extended); + setResizeMode(TQListView::LastColumn); // header()->hide(); setSorting(-1, true); // disable sorting setDragEnabled(true); - connect(this, SIGNAL(doubleClicked(QListViewItem*, const QPoint &, int)), - this, SLOT(slotDoubleClicked(QListViewItem*))); + connect(this, TQT_SIGNAL(doubleClicked(TQListViewItem*, const TQPoint &, int)), + this, TQT_SLOT(slotDoubleClicked(TQListViewItem*))); } KexiFieldListView::~KexiFieldListView() @@ -117,16 +117,16 @@ void KexiFieldListView::setSchema(KexiDB::TableOrQuerySchema* schema) } #if 0 -QSize KexiFieldListView::sizeHint() +TQSize KexiFieldListView::tqsizeHint() { - QFontMetrics fm(font()); + TQFontMetrics fm(font()); kdDebug() << m_table->name() << " cw=" << columnWidth(1) + fm.width("i") << ", " << fm.width(m_table->name()+" ") << endl; - QSize s( - QMAX( columnWidth(1) + fm.width("i"), fm.width(m_table->name()+" ")), + TQSize s( + TQMAX( columnWidth(1) + fm.width("i"), fm.width(m_table->name()+" ")), childCount()*firstChild()->totalHeight() + 4 ); -// QSize s( columnWidth(1), childCount()*firstChild()->totalHeight() + 3*firstChild()->totalHeight()/10); +// TQSize s( columnWidth(1), childCount()*firstChild()->totalHeight() + 3*firstChild()->totalHeight()/10); return s; } @@ -137,11 +137,11 @@ void KexiFieldListView::setReadOnly(bool b) } #endif -QDragObject* KexiFieldListView::dragObject() +TQDragObject* KexiFieldListView::dragObject() { if (!schema()) return 0; - const QStringList selectedFields( selectedFieldNames() ); + const TQStringList selectedFields( selectedFieldNames() ); return new KexiFieldDrag(m_schema->table() ? "kexi/table" : "kexi/query", m_schema->name(), selectedFields, this, "KexiFieldDrag"); /* if (selectedItem()) { @@ -151,12 +151,12 @@ QDragObject* KexiFieldListView::dragObject() }*/ } -QStringList KexiFieldListView::selectedFieldNames() const +TQStringList KexiFieldListView::selectedFieldNames() const { if (!schema()) - return QStringList(); - QStringList selectedFields; - for (QListViewItem *item = firstChild(); item; item = item->nextSibling()) { + return TQStringList(); + TQStringList selectedFields; + for (TQListViewItem *item = firstChild(); item; item = item->nextSibling()) { if (item->isSelected()) { //! @todo what about query fields/aliases? it.current()->text(0) can be not enough if (item == m_allColumnsItem && m_allColumnsItem) @@ -168,7 +168,7 @@ QStringList KexiFieldListView::selectedFieldNames() const return selectedFields; } -void KexiFieldListView::slotDoubleClicked(QListViewItem* item) +void KexiFieldListView::slotDoubleClicked(TQListViewItem* item) { if (schema() && item) { //! @todo what about query fields/aliases? it.current()->text(0) can be not enough diff --git a/kexi/widget/kexifieldlistview.h b/kexi/widget/kexifieldlistview.h index fcbe1c5f..e133aeae 100644 --- a/kexi/widget/kexifieldlistview.h +++ b/kexi/widget/kexifieldlistview.h @@ -20,8 +20,8 @@ #ifndef KEXIFIELDLISTVIEW_H #define KEXIFIELDLISTVIEW_H -#include <qframe.h> -#include <qpixmap.h> +#include <tqframe.h> +#include <tqpixmap.h> #include <klistview.h> class KListViewItem; @@ -35,6 +35,7 @@ namespace KexiDB { class KEXIEXTWIDGETS_EXPORT KexiFieldListView : public KListView { Q_OBJECT + TQ_OBJECT public: //! Flags used to alter list's behaviour and appearance @@ -44,7 +45,7 @@ class KEXIEXTWIDGETS_EXPORT KexiFieldListView : public KListView AllowMultiSelection = 4 //!< if set, multiple selection is allowed }; - KexiFieldListView(QWidget *parent, const char *name = 0, + KexiFieldListView(TQWidget *tqparent, const char *name = 0, int options = ShowDataTypes | AllowMultiSelection ); virtual ~KexiFieldListView(); @@ -56,25 +57,25 @@ class KEXIEXTWIDGETS_EXPORT KexiFieldListView : public KListView KexiDB::TableOrQuerySchema* schema() const { return m_schema; } /*! \return list of selected field names. */ - QStringList selectedFieldNames() const; + TQStringList selectedFieldNames() const; // void setReadOnly(bool); -// virtual QSize sizeHint(); +// virtual TQSize tqsizeHint(); signals: /*! Emitted when a field is double clicked */ - void fieldDoubleClicked(const QString& sourceMimeType, const QString& sourceName, - const QString& fieldName); + void fieldDoubleClicked(const TQString& sourceMimeType, const TQString& sourceName, + const TQString& fieldName); protected slots: - void slotDoubleClicked(QListViewItem* item); + void slotDoubleClicked(TQListViewItem* item); protected: - virtual QDragObject *dragObject(); + virtual TQDragObject *dragObject(); KexiDB::TableOrQuerySchema* m_schema; - QPixmap m_keyIcon; //!< a small "primary key" icon for 0-th column - QPixmap m_noIcon; //!< blank icon of the same size as m_keyIcon + TQPixmap m_keyIcon; //!< a small "primary key" icon for 0-th column + TQPixmap m_noIcon; //!< blank icon of the same size as m_keyIcon int m_options; KListViewItem *m_allColumnsItem; }; diff --git a/kexi/widget/kexifilterdlg.cpp b/kexi/widget/kexifilterdlg.cpp index 6f847e61..aec34dc4 100644 --- a/kexi/widget/kexifilterdlg.cpp +++ b/kexi/widget/kexifilterdlg.cpp @@ -17,11 +17,11 @@ * Boston, MA 02110-1301, USA. */ -#include <qlistview.h> -#include <qpushbutton.h> -#include <qlayout.h> -#include <qheader.h> -#include <qstringlist.h> +#include <tqlistview.h> +#include <tqpushbutton.h> +#include <tqlayout.h> +#include <tqheader.h> +#include <tqstringlist.h> #include "kexiproject.h" #include "kexiprojecthandler.h" @@ -30,52 +30,52 @@ #include "kexifilterdlg.h" #include "kexiquerydesignersqleditor.h" -KexiFilterDlg::KexiFilterDlg(KexiProject *project, QWidget *parent, const char *name) - : QDialog(parent, name) +KexiFilterDlg::KexiFilterDlg(KexiProject *project, TQWidget *tqparent, const char *name) + : TQDialog(tqparent, name) { m_project = project; - QHBoxLayout *lbraces = new QHBoxLayout(0, 0, 4); + TQHBoxLayout *lbraces = new TQHBoxLayout(0, 0, 4); - QPushButton *bsBO = createMiniButton("["); - QPushButton *bBO = createMiniButton("("); - QPushButton *bBC = createMiniButton(")"); - QPushButton *bsBC = createMiniButton("]"); + TQPushButton *bsBO = createMiniButton("["); + TQPushButton *bBO = createMiniButton("("); + TQPushButton *bBC = createMiniButton(")"); + TQPushButton *bsBC = createMiniButton("]"); lbraces->addWidget(bsBO); lbraces->addWidget(bBO); lbraces->addWidget(bBC); lbraces->addWidget(bsBC); - QHBoxLayout *lcond = new QHBoxLayout(0, 0, 4); - QPushButton *blt = createMiniButton("<"); - QPushButton *beq = createMiniButton("="); - QPushButton *bgt = createMiniButton(">"); - QPushButton *bp = createMiniButton("%"); + TQHBoxLayout *lcond = new TQHBoxLayout(0, 0, 4); + TQPushButton *blt = createMiniButton("<"); + TQPushButton *beq = createMiniButton("="); + TQPushButton *bgt = createMiniButton(">"); + TQPushButton *bp = createMiniButton("%"); lcond->addWidget(blt); lcond->addWidget(beq); lcond->addWidget(bgt); lcond->addWidget(bp); - QHBoxLayout *lbool = new QHBoxLayout(0, 0, 4); - QPushButton *bAnd = new QPushButton("AND", this); + TQHBoxLayout *lbool = new TQHBoxLayout(0, 0, 4); + TQPushButton *bAnd = new TQPushButton("AND", this); bAnd->setFlat(true); - QPushButton *bOr = new QPushButton("OR", this); + TQPushButton *bOr = new TQPushButton("OR", this); bOr->setFlat(true); - QPushButton *bLike = new QPushButton("LIKE", this); + TQPushButton *bLike = new TQPushButton("LIKE", this); bLike->setFlat(true); lbool->addWidget(bLike); lbool->addWidget(bAnd); lbool->addWidget(bOr); - m_catalog = new QListView(this); + m_catalog = new TQListView(this); m_catalog->addColumn("a"); m_catalog->header()->hide(); KexiQueryDesignerSQLEditor *e = new KexiQueryDesignerSQLEditor(this); - setupCatalog(QString("kexi/table")); + setupCatalog(TQString("kexi/table")); - QGridLayout *g = new QGridLayout(this); + TQGridLayout *g = new TQGridLayout(this); g->setSpacing(6); g->addMultiCellWidget(e, 0, 0, 0, 2); g->addItem(lbraces, 1, 0); @@ -84,44 +84,44 @@ KexiFilterDlg::KexiFilterDlg(KexiProject *project, QWidget *parent, const char * g->addMultiCellWidget(m_catalog, 2, 2, 0, 2); } -QPushButton* -KexiFilterDlg::createMiniButton(const QString &text) +TQPushButton* +KexiFilterDlg::createMiniButton(const TQString &text) { - QPushButton *p = new QPushButton(text, this); + TQPushButton *p = new TQPushButton(text, this); p->setFlat(true); - p->setMaximumSize(QSize(20, 300)); + p->setMaximumSize(TQSize(20, 300)); return p; } void -KexiFilterDlg::setupCatalog(const QStringList &mimes) +KexiFilterDlg::setupCatalog(const TQStringList &mimes) { m_catalog->clear(); m_catalog->setRootIsDecorated(true); - QStringList::ConstIterator it, end( mimes.constEnd() ); + TQStringList::ConstIterator it, end( mimes.constEnd() ); for( it = mimes.constBegin(); it != end; ++it) { KexiProjectHandler *h = m_project->handlerForMime(*it); if(h) { - QListViewItem *base = new QListViewItem(m_catalog, h->name()); + TQListViewItem *base = new TQListViewItem(m_catalog, h->name()); base->setPixmap(0, h->groupPixmap()); - QDictIterator<KexiProjectHandlerItem> iit(*h->items()); // See QDictIterator + TQDictIterator<KexiProjectHandlerItem> iit(*h->items()); // See TQDictIterator for(; iit.current(); ++iit ) { - QListViewItem *bi = new QListViewItem(base, iit.current()->name()); + TQListViewItem *bi = new TQListViewItem(base, iit.current()->name()); bi->setPixmap(0, h->itemPixmap()); KexiDataProvider *prov=KEXIDATAPROVIDER(h); if(prov) { - QStringList fields = prov->fields(0, iit.current()->identifier()); - QStringList::ConstIterator fit, end( fields.constEnd() ); + TQStringList fields = prov->fields(0, iit.current()->identifier()); + TQStringList::ConstIterator fit, end( fields.constEnd() ); for( fit = fields.constBegin(); fit != end; ++fit) { - QListViewItem *bif = new QListViewItem(bi, (*fit)); + TQListViewItem *bif = new TQListViewItem(bi, (*fit)); } } } @@ -130,15 +130,15 @@ KexiFilterDlg::setupCatalog(const QStringList &mimes) } void -KexiFilterDlg::setupCatalog(const QString &mime) +KexiFilterDlg::setupCatalog(const TQString &mime) { - QStringList l; + TQStringList l; l.append(mime); setupCatalog(l); } void -KexiFilterDlg::insert(QListViewItem *) +KexiFilterDlg::insert(TQListViewItem *) { } diff --git a/kexi/widget/kexifilterdlg.h b/kexi/widget/kexifilterdlg.h index e5544888..4a3d7e79 100644 --- a/kexi/widget/kexifilterdlg.h +++ b/kexi/widget/kexifilterdlg.h @@ -20,30 +20,31 @@ #ifndef KEXIFILTERDLG_H #define KEXIFILTERDLG_H -#include <qdialog.h> +#include <tqdialog.h> -class QPushButton; -class QListView; -class QListViewItem; +class TQPushButton; +class TQListView; +class TQListViewItem; class KexiProject; -class KEXIEXTWIDGETS_EXPORT KexiFilterDlg : public QDialog +class KEXIEXTWIDGETS_EXPORT KexiFilterDlg : public TQDialog { Q_OBJECT + TQ_OBJECT public: - KexiFilterDlg(KexiProject *p, QWidget *parent=0, const char *name=0); + KexiFilterDlg(KexiProject *p, TQWidget *tqparent=0, const char *name=0); ~KexiFilterDlg(); - QPushButton *createMiniButton(const QString &text); - void setupCatalog(const QStringList &mimes); - void setupCatalog(const QString &mime); + TQPushButton *createMiniButton(const TQString &text); + void setupCatalog(const TQStringList &mimes); + void setupCatalog(const TQString &mime); protected slots: - void insert(QListViewItem *); + void insert(TQListViewItem *); protected: - QListView *m_catalog; + TQListView *m_catalog; KexiProject *m_project; }; diff --git a/kexi/widget/kexiprjtypeselector.cpp b/kexi/widget/kexiprjtypeselector.cpp index 71dafc6c..94a62e0a 100644 --- a/kexi/widget/kexiprjtypeselector.cpp +++ b/kexi/widget/kexiprjtypeselector.cpp @@ -18,15 +18,15 @@ */ #include "kexiprjtypeselector.h" -#include <qlabel.h> +#include <tqlabel.h> #include <kiconloader.h> #include <kmimetype.h> #include <kexidb/driver.h> -KexiPrjTypeSelector::KexiPrjTypeSelector( QWidget* parent ) - : KexiPrjTypeSelectorBase( parent, "KexiPrjTypeSelector" ) +KexiPrjTypeSelector::KexiPrjTypeSelector( TQWidget* tqparent ) + : KexiPrjTypeSelectorBase( tqparent, "KexiPrjTypeSelector" ) { - QString none; + TQString none; icon_file->setPixmap( KGlobal::iconLoader()->loadIcon( KMimeType::mimeType( KexiDB::Driver::defaultFileBasedDriverMimeType() )->icon(none,0), KIcon::Desktop, 48 diff --git a/kexi/widget/kexiprjtypeselector.h b/kexi/widget/kexiprjtypeselector.h index efb8a294..13e46484 100644 --- a/kexi/widget/kexiprjtypeselector.h +++ b/kexi/widget/kexiprjtypeselector.h @@ -26,9 +26,10 @@ class KEXIEXTWIDGETS_EXPORT KexiPrjTypeSelector : public KexiPrjTypeSelectorBase { Q_OBJECT + TQ_OBJECT public: - KexiPrjTypeSelector( QWidget* parent = 0 ); + KexiPrjTypeSelector( TQWidget* tqparent = 0 ); ~KexiPrjTypeSelector(); protected slots: diff --git a/kexi/widget/kexiprjtypeselectorbase.ui b/kexi/widget/kexiprjtypeselectorbase.ui index a8031909..069a89b0 100644 --- a/kexi/widget/kexiprjtypeselectorbase.ui +++ b/kexi/widget/kexiprjtypeselectorbase.ui @@ -1,6 +1,6 @@ <!DOCTYPE UI><UI version="3.3" stdsetdef="1"> <class>KexiPrjTypeSelectorBase</class> -<widget class="QWidget"> +<widget class="TQWidget"> <property name="name"> <cstring>KexiPrjTypeSelectorBase</cstring> </property> @@ -19,7 +19,7 @@ <property name="margin"> <number>0</number> </property> - <widget class="QButtonGroup"> + <widget class="TQButtonGroup"> <property name="name"> <cstring>buttonGroup</cstring> </property> @@ -45,7 +45,7 @@ <property name="margin"> <number>0</number> </property> - <widget class="QRadioButton" row="1" column="1"> + <widget class="TQRadioButton" row="1" column="1"> <property name="name"> <cstring>option_server</cstring> </property> @@ -56,7 +56,7 @@ <number>2</number> </property> </widget> - <widget class="QRadioButton" row="0" column="1"> + <widget class="TQRadioButton" row="0" column="1"> <property name="name"> <cstring>option_file</cstring> </property> @@ -70,7 +70,7 @@ <number>1</number> </property> </widget> - <widget class="QLabel" row="0" column="0"> + <widget class="TQLabel" row="0" column="0"> <property name="name"> <cstring>icon_file</cstring> </property> @@ -88,11 +88,11 @@ <property name="scaledContents"> <bool>true</bool> </property> - <property name="alignment"> + <property name="tqalignment"> <set>AlignVCenter|AlignLeft</set> </property> </widget> - <widget class="QLabel" row="1" column="0"> + <widget class="TQLabel" row="1" column="0"> <property name="name"> <cstring>icon_server</cstring> </property> @@ -110,11 +110,11 @@ <property name="scaledContents"> <bool>true</bool> </property> - <property name="alignment"> + <property name="tqalignment"> <set>AlignVCenter|AlignLeft</set> </property> </widget> - <widget class="QFrame" row="2" column="1"> + <widget class="TQFrame" row="2" column="1"> <property name="name"> <cstring>frame_server</cstring> </property> @@ -152,11 +152,11 @@ <includes> <include location="local" impldecl="in implementation">kexiprjtypeselectorbase.ui.h</include> </includes> -<slots> +<Q_SLOTS> <slot access="protected" specifier="non virtual">slotSelectionChanged( int id )</slot> -</slots> +</Q_SLOTS> <functions> <function access="private" specifier="non virtual">init()</function> </functions> -<layoutdefaults spacing="6" margin="11"/> +<tqlayoutdefaults spacing="6" margin="11"/> </UI> diff --git a/kexi/widget/kexiprjtypeselectorbase.ui.h b/kexi/widget/kexiprjtypeselectorbase.ui.h index 03f1301f..f63529ae 100644 --- a/kexi/widget/kexiprjtypeselectorbase.ui.h +++ b/kexi/widget/kexiprjtypeselectorbase.ui.h @@ -2,7 +2,7 @@ ** ui.h extension file, included from the uic-generated form implementation. ** ** If you want to add, delete, or rename functions or slots, use -** Qt Designer to update this file, preserving your code. +** TQt Designer to update this file, preserving your code. ** ** You should not define a constructor or destructor in this file. ** Instead, write your code in functions called init() and destroy(). diff --git a/kexi/widget/kexipropertyeditorview.cpp b/kexi/widget/kexipropertyeditorview.cpp index 5225a7af..801f17b2 100644 --- a/kexi/widget/kexipropertyeditorview.cpp +++ b/kexi/widget/kexipropertyeditorview.cpp @@ -27,20 +27,20 @@ #include <klocale.h> #include <kiconloader.h> -#include <qlayout.h> -#include <qlabel.h> +#include <tqlayout.h> +#include <tqlabel.h> -KexiObjectInfoLabel::KexiObjectInfoLabel(QWidget* parent, const char* name) - : QWidget(parent, name) +KexiObjectInfoLabel::KexiObjectInfoLabel(TQWidget* tqparent, const char* name) + : TQWidget(tqparent, name) { - QHBoxLayout *hlyr = new QHBoxLayout(this); - m_objectIconLabel = new QLabel(this); + TQHBoxLayout *hlyr = new TQHBoxLayout(this); + m_objectIconLabel = new TQLabel(this); m_objectIconLabel->setMargin(2); setFixedHeight( IconSize(KIcon::Small) + 2 + 2 ); hlyr->addWidget(m_objectIconLabel); - m_objectNameLabel = new QLabel(this); + m_objectNameLabel = new TQLabel(this); m_objectNameLabel->setMargin(2); - m_objectNameLabel->setSizePolicy(QSizePolicy::Minimum, QSizePolicy::Preferred); + m_objectNameLabel->tqsetSizePolicy(TQSizePolicy::Minimum, TQSizePolicy::Preferred); hlyr->addWidget(m_objectNameLabel); } @@ -48,7 +48,7 @@ KexiObjectInfoLabel::~KexiObjectInfoLabel() { } -void KexiObjectInfoLabel::setObjectClassIcon(const QString& name) +void KexiObjectInfoLabel::setObjectClassIcon(const TQString& name) { m_classIcon = name; if (m_classIcon.isEmpty()) @@ -58,13 +58,13 @@ void KexiObjectInfoLabel::setObjectClassIcon(const QString& name) m_objectIconLabel->setPixmap( SmallIcon(name) ); } -void KexiObjectInfoLabel::setObjectClassName(const QString& name) +void KexiObjectInfoLabel::setObjectClassName(const TQString& name) { m_className = name; updateName(); } -void KexiObjectInfoLabel::setObjectName(const QString& name) +void KexiObjectInfoLabel::setObjectName(const TQString& name) { m_objectName = name; updateName(); @@ -72,15 +72,15 @@ void KexiObjectInfoLabel::setObjectName(const QString& name) void KexiObjectInfoLabel::updateName() { - QString txt( m_className ); + TQString txt( m_className ); if (txt.isEmpty()) txt = m_objectName; else if (!m_objectName.isEmpty()) - txt += QString(" \"%1\"").arg(m_objectName); + txt += TQString(" \"%1\"").tqarg(m_objectName); m_objectNameLabel->setText(txt); } -void KexiObjectInfoLabel::setBuddy( QWidget * buddy ) +void KexiObjectInfoLabel::setBuddy( TQWidget * buddy ) { m_objectNameLabel->setBuddy(buddy); } @@ -95,47 +95,47 @@ class KexiPropertyEditorView::Private { } KoProperty::Editor *editor; -// QLabel *objectIcon; -// QString iconName; -// QLabel *objectClassName; +// TQLabel *objectIcon; +// TQString iconName; +// TQLabel *objectClassName; KexiObjectInfoLabel *objectInfoLabel; }; //------------------------------ -KexiPropertyEditorView::KexiPropertyEditorView(KexiMainWindow *mainWin, QWidget* parent) - : QWidget(parent, "KexiPropertyEditorView") +KexiPropertyEditorView::KexiPropertyEditorView(KexiMainWindow *mainWin, TQWidget* tqparent) + : TQWidget(tqparent, "KexiPropertyEditorView") , d(new Private()) { setCaption(i18n("Properties")); //TODO: set a nice icon setIcon(*mainWin->icon()); - QVBoxLayout *lyr = new QVBoxLayout(this); + TQVBoxLayout *lyr = new TQVBoxLayout(this); //add object class info d->objectInfoLabel = new KexiObjectInfoLabel(this, "KexiObjectInfoLabel"); lyr->addWidget(d->objectInfoLabel); /* - QHBoxLayout *vlyr = new QHBoxLayout(lyr); - d->objectIcon = new QLabel(this); + TQHBoxLayout *vlyr = new TQHBoxLayout(lyr); + d->objectIcon = new TQLabel(this); d->objectIcon->setMargin(2); d->objectIcon->setFixedHeight( IconSize(KIcon::Small) + 2 + 2 ); vlyr->addWidget(d->objectIcon); - d->objectClassName = new QLabel(this); + d->objectClassName = new TQLabel(this); d->objectClassName->setMargin(2); - d->objectClassName->setSizePolicy(QSizePolicy::Minimum, QSizePolicy::Preferred); + d->objectClassName->tqsetSizePolicy(TQSizePolicy::Minimum, TQSizePolicy::Preferred); vlyr->addWidget(d->objectClassName);*/ d->editor = new KoProperty::Editor(this, true /*AutoSync*/, "propeditor"); lyr->addWidget(d->editor); setFocusProxy(d->editor); d->objectInfoLabel->setBuddy(d->editor); - setFocusPolicy(WheelFocus); + setFocusPolicy(TQ_WheelFocus); - connect(d->editor, SIGNAL(propertySetChanged(KoProperty::Set*)), - this, SLOT(slotPropertySetChanged(KoProperty::Set*))); + connect(d->editor, TQT_SIGNAL(propertySetChanged(KoProperty::Set*)), + this, TQT_SLOT(slotPropertySetChanged(KoProperty::Set*))); // d->iconName = "dummy"; slotPropertySetChanged(0); @@ -146,24 +146,24 @@ KexiPropertyEditorView::~KexiPropertyEditorView() delete d; } -QSize KexiPropertyEditorView::sizeHint() const +TQSize KexiPropertyEditorView::tqsizeHint() const { - return QSize(200,200);//m_editor->sizeHint(); + return TQSize(200,200);//m_editor->tqsizeHint(); } -QSize KexiPropertyEditorView::minimumSizeHint() const +TQSize KexiPropertyEditorView::tqminimumSizeHint() const { - return QSize(200,200);//m_editor->sizeHint(); + return TQSize(200,200);//m_editor->tqsizeHint(); } -/*void KexiPropertyEditorView::setGeometry ( const QRect &r ) +/*void KexiPropertyEditorView::setGeometry ( const TQRect &r ) { - QWidget::setGeometry(r); + TQWidget::setGeometry(r); } void KexiPropertyEditorView::resize ( int w, int h ) { - QWidget::resize( w, h ); + TQWidget::resize( w, h ); }*/ KoProperty::Editor *KexiPropertyEditorView::editor() const @@ -179,23 +179,23 @@ KoProperty::Editor *KexiPropertyEditorView::editor() const hidden. */ void KexiPropertyEditorView::updateInfoLabelForPropertySet(KexiObjectInfoLabel *infoLabel, - KoProperty::Set* set, const QString& textToDisplayForNullSet) + KoProperty::Set* set, const TQString& textToDisplayForNullSet) { - QString className, iconName, objectName; + TQString className, iconName, objectName; if (set) { - if (set->contains("this:classString")) + if (set->tqcontains("this:classString")) className = (*set)["this:classString"].value().toString(); - if (set->contains("this:iconName")) + if (set->tqcontains("this:iconName")) iconName = (*set)["this:iconName"].value().toString(); - const bool useCaptionAsObjectName = set->contains("this:useCaptionAsObjectName") + const bool useCaptionAsObjectName = set->tqcontains("this:useCaptionAsObjectName") && (*set)["this:useCaptionAsObjectName"].value().toBool(); - if (set->contains(useCaptionAsObjectName ? "caption" : "name")) + if (set->tqcontains(useCaptionAsObjectName ? "caption" : "name")) objectName = (*set)[useCaptionAsObjectName ? "caption" : "name"].value().toString(); } if (!set || objectName.isEmpty()) { objectName = textToDisplayForNullSet; - className = QString::null; - iconName = QString::null; + className = TQString(); + iconName = TQString(); } if (className.isEmpty() && objectName.isEmpty()) diff --git a/kexi/widget/kexipropertyeditorview.h b/kexi/widget/kexipropertyeditorview.h index 77dab6c8..79adb9e0 100644 --- a/kexi/widget/kexipropertyeditorview.h +++ b/kexi/widget/kexipropertyeditorview.h @@ -22,9 +22,9 @@ #define KEXIPROPERTYEDITORVIEW_H //#include "kexiviewbase.h" -#include <qwidget.h> +#include <tqwidget.h> -class QLabel; +class TQLabel; class KexiMainWindow; namespace KoProperty { @@ -44,25 +44,25 @@ namespace KoProperty { - [button_icon] Button "quit" - [label_icon] Label "welcome" */ -class KEXIEXTWIDGETS_EXPORT KexiObjectInfoLabel : public QWidget +class KEXIEXTWIDGETS_EXPORT KexiObjectInfoLabel : public TQWidget { public: - KexiObjectInfoLabel(QWidget* parent, const char* name = 0); + KexiObjectInfoLabel(TQWidget* tqparent, const char* name = 0); ~KexiObjectInfoLabel(); - void setObjectClassIcon(const QString& name); - QString objectClassIcon() const { return m_classIcon; } - void setObjectClassName(const QString& name); - QString objectClassName() const { return m_className; } - void setObjectName(const QString& name); - QString objectName() const { return m_objectName; } - void setBuddy( QWidget * buddy ); + void setObjectClassIcon(const TQString& name); + TQString objectClassIcon() const { return m_classIcon; } + void setObjectClassName(const TQString& name); + TQString objectClassName() const { return m_className; } + void setObjectName(const TQString& name); + TQString objectName() const { return m_objectName; } + void setBuddy( TQWidget * buddy ); protected: void updateName(); - QString m_className; - QString m_classIcon, m_objectName; - QLabel *m_objectIconLabel, *m_objectNameLabel; + TQString m_className; + TQString m_classIcon, m_objectName; + TQLabel *m_objectIconLabel, *m_objectNameLabel; }; //! @short The container (acts as a dock window) for KexiPropertyEditor. @@ -79,12 +79,13 @@ class KEXIEXTWIDGETS_EXPORT KexiObjectInfoLabel : public QWidget property instead of "name" - this can be usable when we know that "caption" properties are available for a given type of objects (this is the case for Table Designer fields) */ -class KEXIEXTWIDGETS_EXPORT KexiPropertyEditorView : public QWidget +class KEXIEXTWIDGETS_EXPORT KexiPropertyEditorView : public TQWidget { Q_OBJECT + TQ_OBJECT public: - KexiPropertyEditorView(KexiMainWindow *mainWin, QWidget* parent); + KexiPropertyEditorView(KexiMainWindow *mainWin, TQWidget* tqparent); virtual ~KexiPropertyEditorView(); /*! Helper function. Updates \a infoLabel widget by reusing properties provided @@ -96,14 +97,14 @@ class KEXIEXTWIDGETS_EXPORT KexiPropertyEditorView : public QWidget hidden. */ static void updateInfoLabelForPropertySet( KexiObjectInfoLabel *infoLabel, KoProperty::Set* set, - const QString& textToDisplayForNullSet = QString::null); + const TQString& textToDisplayForNullSet = TQString()); - virtual QSize sizeHint() const; - virtual QSize minimumSizeHint() const; + virtual TQSize tqsizeHint() const; + virtual TQSize tqminimumSizeHint() const; KoProperty::Editor *editor() const; // public slots: -// virtual void setGeometry( const QRect &r ); +// virtual void setGeometry( const TQRect &r ); // virtual void resize( int w, int h ); protected slots: diff --git a/kexi/widget/kexiquerydesignersqleditor.cpp b/kexi/widget/kexiquerydesignersqleditor.cpp index 3ff57989..1c68138f 100644 --- a/kexi/widget/kexiquerydesignersqleditor.cpp +++ b/kexi/widget/kexiquerydesignersqleditor.cpp @@ -22,8 +22,8 @@ #include "kexiquerydesignersqleditor.h" KexiQueryDesignerSQLEditor::KexiQueryDesignerSQLEditor( - KexiMainWindow *mainWin, QWidget *parent, const char *name) - : KexiEditor(mainWin, parent, name) + KexiMainWindow *mainWin, TQWidget *tqparent, const char *name) + : KexiEditor(mainWin, tqparent, name) { setHighlightMode("sql"); } diff --git a/kexi/widget/kexiquerydesignersqleditor.h b/kexi/widget/kexiquerydesignersqleditor.h index a34dbc7a..9b1f9f9b 100644 --- a/kexi/widget/kexiquerydesignersqleditor.h +++ b/kexi/widget/kexiquerydesignersqleditor.h @@ -19,8 +19,8 @@ * Boston, MA 02110-1301, USA. */ -#ifndef KEXIQUERYDESIGNERSQLEDITOR_H -#define KEXIQUERYDESIGNERSQLEDITOR_H +#ifndef KEXITQUERYDESIGNERSQLEDITOR_H +#define KEXITQUERYDESIGNERSQLEDITOR_H #include "kexieditor.h" @@ -30,9 +30,10 @@ class KEXIEXTWIDGETS_EXPORT KexiQueryDesignerSQLEditor : public KexiEditor { Q_OBJECT + TQ_OBJECT public: - KexiQueryDesignerSQLEditor(KexiMainWindow *mainWin, QWidget *parent, const char *name = 0); + KexiQueryDesignerSQLEditor(KexiMainWindow *mainWin, TQWidget *tqparent, const char *name = 0); virtual ~KexiQueryDesignerSQLEditor(); }; diff --git a/kexi/widget/kexiqueryparameters.cpp b/kexi/widget/kexiqueryparameters.cpp index 449c265c..bcef819f 100644 --- a/kexi/widget/kexiqueryparameters.cpp +++ b/kexi/widget/kexiqueryparameters.cpp @@ -29,14 +29,14 @@ #include "utils/kexidatetimeformatter.h" //static -QValueList<QVariant> KexiQueryParameters::getParameters(QWidget *parent, +TQValueList<TQVariant> KexiQueryParameters::getParameters(TQWidget *tqparent, const KexiDB::Driver &driver, KexiDB::QuerySchema& querySchema, bool &ok) { Q_UNUSED(driver); ok = false; const KexiDB::QuerySchemaParameterList params( querySchema.parameters() ); - QValueList<QVariant> values; - const QString caption( i18n("Enter Query Parameter Value", "Enter Parameter Value") ); + TQValueList<TQVariant> values; + const TQString caption( i18n("Enter Query Parameter Value", "Enter Parameter Value") ); foreach(KexiDB::QuerySchemaParameterListConstIterator, it, params) { switch ((*it).type) { case KexiDB::Field::Byte: @@ -48,53 +48,53 @@ QValueList<QVariant> KexiQueryParameters::getParameters(QWidget *parent, //! @todo add support for unsigned parameter here KexiDB::getLimitsForType((*it).type, minValue, maxValue); const int result = KInputDialog::getInteger( - caption, (*it).message, 0, minValue, maxValue, 1/*step*/, 10/*base*/, &ok, parent); + caption, (*it).message, 0, minValue, maxValue, 1/*step*/, 10/*base*/, &ok, tqparent); if (!ok) - return QValueList<QVariant>(); //cancelled + return TQValueList<TQVariant>(); //cancelled values.append(result); break; } case KexiDB::Field::Boolean: { - QStringList list; + TQStringList list; list << i18n("Boolean True - Yes", "Yes") << i18n("Boolean False - No", "No"); - const QString result = KInputDialog::getItem( - caption, (*it).message, list, 0/*current*/, false /*!editable*/, &ok, parent); + const TQString result = KInputDialog::getItem( + caption, (*it).message, list, 0/*current*/, false /*!editable*/, &ok, tqparent); if (!ok || result.isEmpty()) - return QValueList<QVariant>(); //cancelled - values.append( QVariant( result==list.first(), 1 ) ); + return TQValueList<TQVariant>(); //cancelled + values.append( TQVariant( result==list.first(), 1 ) ); break; } case KexiDB::Field::Date: { KexiDateFormatter df; - const QString result = KInputDialog::getText( - caption, (*it).message, QString::null, &ok, parent, 0/*name*/, + const TQString result = KInputDialog::getText( + caption, (*it).message, TQString(), &ok, tqparent, 0/*name*/, //! @todo add validator 0/*validator*/, df.inputMask() ); if (!ok) - return QValueList<QVariant>(); //cancelled + return TQValueList<TQVariant>(); //cancelled values.append( df.stringToDate(result) ); break; } case KexiDB::Field::DateTime: { KexiDateFormatter df; KexiTimeFormatter tf; - const QString result = KInputDialog::getText( - caption, (*it).message, QString::null, &ok, parent, 0/*name*/, + const TQString result = KInputDialog::getText( + caption, (*it).message, TQString(), &ok, tqparent, 0/*name*/, //! @todo add validator 0/*validator*/, dateTimeInputMask(df, tf) ); if (!ok) - return QValueList<QVariant>(); //cancelled + return TQValueList<TQVariant>(); //cancelled values.append( stringToDateTime(df, tf, result) ); break; } case KexiDB::Field::Time: { KexiTimeFormatter tf; - const QString result = KInputDialog::getText( - caption, (*it).message, QString::null, &ok, parent, 0/*name*/, + const TQString result = KInputDialog::getText( + caption, (*it).message, TQString(), &ok, tqparent, 0/*name*/, //! @todo add validator 0/*validator*/, tf.inputMask() ); if (!ok) - return QValueList<QVariant>(); //cancelled + return TQValueList<TQVariant>(); //cancelled values.append( tf.stringToTime(result) ); break; } @@ -102,35 +102,35 @@ QValueList<QVariant> KexiQueryParameters::getParameters(QWidget *parent, case KexiDB::Field::Double: { // KInputDialog::getDouble() does not work well, use getText and double validator KDoubleValidator validator(0); - const QString textResult = KInputDialog::getText( caption, (*it).message, QString::null, &ok, - parent, 0, &validator); + const TQString textResult = KInputDialog::getText( caption, (*it).message, TQString(), &ok, + tqparent, 0, &validator); if (!ok || textResult.isEmpty()) - return QValueList<QVariant>(); //cancelled + return TQValueList<TQVariant>(); //cancelled //! @todo this value will be still rounded: consider storing them as a decimal type -//! (e.g. using a special Q_LLONG+decimalplace class) +//! (e.g. using a special TQ_LLONG+decimalplace class) const double result = textResult.toDouble(&ok); //this is also good for float (to avoid rounding) if (!ok) - return QValueList<QVariant>(); + return TQValueList<TQVariant>(); values.append( result ); break; } case KexiDB::Field::Text: case KexiDB::Field::LongText: { - const QString result = KInputDialog::getText( - caption, (*it).message, QString::null, &ok, parent); + const TQString result = KInputDialog::getText( + caption, (*it).message, TQString(), &ok, tqparent); if (!ok) - return QValueList<QVariant>(); //cancelled + return TQValueList<TQVariant>(); //cancelled values.append( result ); break; } case KexiDB::Field::BLOB: { //! @todo BLOB input unsupported - values.append( QByteArray() ); + values.append( TQByteArray() ); } default: kexiwarn << "KexiQueryParameters::getParameters() unsupported type " << KexiDB::Field::typeName((*it).type) << " for parameter \"" << (*it).message << "\" - aborting query execution!" << endl; - return QValueList<QVariant>(); + return TQValueList<TQVariant>(); } } ok = true; diff --git a/kexi/widget/kexiqueryparameters.h b/kexi/widget/kexiqueryparameters.h index 40251b71..b80a37ad 100644 --- a/kexi/widget/kexiqueryparameters.h +++ b/kexi/widget/kexiqueryparameters.h @@ -17,8 +17,8 @@ * Boston, MA 02110-1301, USA. */ -#ifndef KEXIQUERYPARAMETERS_H -#define KEXIQUERYPARAMETERS_H +#ifndef KEXITQUERYPARAMETERS_H +#define KEXITQUERYPARAMETERS_H #include <kexidb/queryschema.h> @@ -37,7 +37,7 @@ class KEXIEXTWIDGETS_EXPORT KexiQueryParameters //! @todo support defaults //! @todo support validation rules, e.g. min/max value, unsigned //! @todo support Enum type (list of strings, need support for keys and user-visible strings) - static QValueList<QVariant> getParameters(QWidget *parent, const KexiDB::Driver &driver, + static TQValueList<TQVariant> getParameters(TQWidget *tqparent, const KexiDB::Driver &driver, KexiDB::QuerySchema& querySchema, bool &ok); }; diff --git a/kexi/widget/kexiscrollview.cpp b/kexi/widget/kexiscrollview.cpp index 1cf47378..569d61f8 100644 --- a/kexi/widget/kexiscrollview.cpp +++ b/kexi/widget/kexiscrollview.cpp @@ -19,10 +19,10 @@ */ #include "kexiscrollview.h" -#include <qcursor.h> -#include <qobjectlist.h> -#include <qpainter.h> -#include <qpixmap.h> +#include <tqcursor.h> +#include <tqobjectlist.h> +#include <tqpainter.h> +#include <tqpixmap.h> #include <kdebug.h> #include <kstaticdeleter.h> @@ -36,31 +36,31 @@ class KexiScrollViewData { public: - QPixmap horizontalOuterAreaPixmapBuffer; - QPixmap verticalOuterAreaPixmapBuffer; + TQPixmap horizontalOuterAreaPixmapBuffer; + TQPixmap verticalOuterAreaPixmapBuffer; }; // @todo warning: not reentrant! static KStaticDeleter<KexiScrollViewData> KexiScrollView_data_deleter; KexiScrollViewData* KexiScrollView_data = 0; -KexiScrollView::KexiScrollView(QWidget *parent, bool preview) - : QScrollView(parent, "kexiscrollview", WStaticContents) +KexiScrollView::KexiScrollView(TQWidget *tqparent, bool preview) + : TQScrollView(tqparent, "kexiscrollview", WStaticContents) , m_widget(0) , m_helpFont(font()) , m_preview(preview) , m_scrollViewNavPanel(0) { - setFrameStyle(QFrame::WinPanel | QFrame::Sunken); - viewport()->setPaletteBackgroundColor(colorGroup().mid()); - QColor fc = palette().active().foreground(), + setFrameStyle(TQFrame::WinPanel | TQFrame::Sunken); + viewport()->setPaletteBackgroundColor(tqcolorGroup().mid()); + TQColor fc = tqpalette().active().foreground(), bc = viewport()->paletteBackgroundColor(); m_helpColor = KexiUtils::blendedColors(fc, bc, 1, 2); -// m_helpColor = QColor((fc.red()+bc.red()*2)/3, (fc.green()+bc.green()*2)/3, +// m_helpColor = TQColor((fc.red()+bc.red()*2)/3, (fc.green()+bc.green()*2)/3, // (fc.blue()+bc.blue()*2)/3); m_helpFont.setPointSize( m_helpFont.pointSize() * 3 ); - setFocusPolicy(WheelFocus); + setFocusPolicy(TQ_WheelFocus); //initial resize mode is always manual; //will be changed on show(), if needed @@ -73,14 +73,14 @@ KexiScrollView::KexiScrollView(QWidget *parent, bool preview) m_gridSize = 0; m_outerAreaVisible = true; - connect(&m_delayedResize, SIGNAL(timeout()), this, SLOT(refreshContentsSize())); + connect(&m_delayedResize, TQT_SIGNAL(timeout()), this, TQT_SLOT(refreshContentsSize())); m_smodeSet = false; if (m_preview) { refreshContentsSizeLater(true, true); //! @todo allow to hide navigator updateScrollBars(); m_scrollViewNavPanel = new KexiRecordNavigator(this, leftMargin(), "nav"); - m_scrollViewNavPanel->setSizePolicy(QSizePolicy::Minimum,QSizePolicy::Preferred); + m_scrollViewNavPanel->tqsetSizePolicy(TQSizePolicy::Minimum,TQSizePolicy::Preferred); } } @@ -89,7 +89,7 @@ KexiScrollView::~KexiScrollView() } void -KexiScrollView::setWidget(QWidget *w) +KexiScrollView::setWidget(TQWidget *w) { addChild(w); m_widget = w; @@ -127,9 +127,9 @@ KexiScrollView::refreshContentsSizeLater(bool horizontal, bool vertical) m_hsmode = hScrollBarMode(); } // if (vertical) - setVScrollBarMode(QScrollView::AlwaysOff); + setVScrollBarMode(TQScrollView::AlwaysOff); //if (horizontal) - setHScrollBarMode(QScrollView::AlwaysOff); + setHScrollBarMode(TQScrollView::AlwaysOff); updateScrollBars(); m_delayedResize.start( 100, true ); } @@ -152,9 +152,9 @@ KexiScrollView::refreshContentsSize() // Ensure there is always space to resize Form int w = contentsWidth(), h = contentsHeight(); bool change = false; - const int delta_x = QMAX( (KexiScrollView_data ? + const int delta_x = TQMAX( (KexiScrollView_data ? KexiScrollView_data->verticalOuterAreaPixmapBuffer.width() : 0), 300); - const int delta_y = QMAX( (KexiScrollView_data ? + const int delta_y = TQMAX( (KexiScrollView_data ? KexiScrollView_data->horizontalOuterAreaPixmapBuffer.height() : 0), 300); if((m_widget->width() + delta_x * 2 / 3) > w) { w = m_widget->width() + delta_x; @@ -173,11 +173,11 @@ KexiScrollView::refreshContentsSize() change = true; } if (change) { - repaint(); - viewport()->repaint(); - repaintContents(); + tqrepaint(); + viewport()->tqrepaint(); + tqrepaintContents(); updateContents(0, 0, 2000,2000); - clipper()->repaint(); + clipper()->tqrepaint(); resizeContents(w, h); } @@ -199,22 +199,22 @@ KexiScrollView::updateNavPanelGeometry() } void -KexiScrollView::contentsMousePressEvent(QMouseEvent *ev) +KexiScrollView::contentsMousePressEvent(TQMouseEvent *ev) { if(!m_widget) return; - QRect r3(0, 0, m_widget->width() + 4, m_widget->height() + 4); - if(!r3.contains(ev->pos())) // clicked outside form + TQRect r3(0, 0, m_widget->width() + 4, m_widget->height() + 4); + if(!r3.tqcontains(ev->pos())) // clicked outside form //m_form->resetSelection(); emit outerAreaClicked(); if(!m_enableResizing) return; - QRect r(m_widget->width(), 0, 4, m_widget->height() + 4); // right limit - QRect r2(0, m_widget->height(), m_widget->width() + 4, 4); // bottom limit - if(r.contains(ev->pos()) || r2.contains(ev->pos())) + TQRect r(m_widget->width(), 0, 4, m_widget->height() + 4); // right limit + TQRect r2(0, m_widget->height(), m_widget->width() + 4, 4); // bottom limit + if(r.tqcontains(ev->pos()) || r2.tqcontains(ev->pos())) { m_resizing = true; emit resizingStarted(); @@ -222,7 +222,7 @@ KexiScrollView::contentsMousePressEvent(QMouseEvent *ev) } void -KexiScrollView::contentsMouseReleaseEvent(QMouseEvent *) +KexiScrollView::contentsMouseReleaseEvent(TQMouseEvent *) { if(m_resizing) { m_resizing = false; @@ -233,7 +233,7 @@ KexiScrollView::contentsMouseReleaseEvent(QMouseEvent *) } void -KexiScrollView::contentsMouseMoveEvent(QMouseEvent *ev) +KexiScrollView::contentsMouseMoveEvent(TQMouseEvent *ev) { if(!m_widget || !m_enableResizing) return; @@ -253,17 +253,17 @@ KexiScrollView::contentsMouseMoveEvent(QMouseEvent *ev) tmpy = contentsY(); // we look for the max widget right() (or bottom()), which would be the limit for form resizing (not to hide widgets) - QObjectList *list = m_widget->queryList("QWidget", 0, true, false /* not recursive*/); - for(QObject *o = list->first(); o; o = list->next()) + TQObjectList *list = m_widget->queryList(TQWIDGET_OBJECT_NAME_STRING, 0, true, false /* not recursive*/); + for(TQObject *o = list->first(); o; o = list->next()) { - QWidget *w = (QWidget*)o; - tmpx = QMAX(tmpx, (w->geometry().right() + 10)); - tmpy = QMAX(tmpy, (w->geometry().bottom() + 10)); + TQWidget *w = (TQWidget*)o; + tmpx = TQMAX(tmpx, (w->tqgeometry().right() + 10)); + tmpy = TQMAX(tmpy, (w->tqgeometry().bottom() + 10)); } delete list; int neww = -1, newh; - if(cursor().shape() == QCursor::SizeHorCursor) + if(cursor().shape() == TQCursor::SizeHorCursor) { if(m_snapToGrid) neww = int( float(tmpx) / float(m_gridSize) + 0.5 ) * m_gridSize; @@ -271,7 +271,7 @@ KexiScrollView::contentsMouseMoveEvent(QMouseEvent *ev) neww = tmpx; newh = m_widget->height(); } - else if(cursor().shape() == QCursor::SizeVerCursor) + else if(cursor().shape() == TQCursor::SizeVerCursor) { neww = m_widget->width(); if(m_snapToGrid) @@ -279,7 +279,7 @@ KexiScrollView::contentsMouseMoveEvent(QMouseEvent *ev) else newh = tmpy; } - else if(cursor().shape() == QCursor::SizeFDiagCursor) + else if(cursor().shape() == TQCursor::SizeFDiagCursor) { if(m_snapToGrid) { neww = int( float(tmpx) / float(m_gridSize) + 0.5 ) * m_gridSize; @@ -290,7 +290,7 @@ KexiScrollView::contentsMouseMoveEvent(QMouseEvent *ev) } } //needs update? - if (neww!=-1 && m_widget->size() != QSize(neww, newh)) { + if (neww!=-1 && m_widget->size() != TQSize(neww, newh)) { m_widget->resize( neww, newh ); refreshContentsSize(); updateContents(); @@ -298,46 +298,46 @@ KexiScrollView::contentsMouseMoveEvent(QMouseEvent *ev) } else // update mouse cursor { - QPoint p = ev->pos(); - QRect r(m_widget->width(), 0, 4, m_widget->height()); // right - QRect r2(0, m_widget->height(), m_widget->width(), 4); // bottom - QRect r3(m_widget->width(), m_widget->height(), 4, 4); // bottom-right corner - - if(r.contains(p)) - setCursor(QCursor::SizeHorCursor); - else if(r2.contains(p)) - setCursor(QCursor::SizeVerCursor); - else if(r3.contains(p)) - setCursor(QCursor::SizeFDiagCursor); + TQPoint p = ev->pos(); + TQRect r(m_widget->width(), 0, 4, m_widget->height()); // right + TQRect r2(0, m_widget->height(), m_widget->width(), 4); // bottom + TQRect r3(m_widget->width(), m_widget->height(), 4, 4); // bottom-right corner + + if(r.tqcontains(p)) + setCursor(TQCursor::SizeHorCursor); + else if(r2.tqcontains(p)) + setCursor(TQCursor::SizeVerCursor); + else if(r3.tqcontains(p)) + setCursor(TQCursor::SizeFDiagCursor); else unsetCursor(); } } void -KexiScrollView::setupPixmapBuffer(QPixmap& pixmap, const QString& text, int lines) +KexiScrollView::setupPixmapBuffer(TQPixmap& pixmap, const TQString& text, int lines) { Q_UNUSED( lines ); - QFontMetrics fm(m_helpFont); - const int flags = Qt::AlignCenter|Qt::AlignTop; - QRect rect(fm.boundingRect(0,0,1000,1000,flags,text)); + TQFontMetrics fm(m_helpFont); + const int flags = TQt::AlignCenter|TQt::AlignTop; + TQRect rect(fm.boundingRect(0,0,1000,1000,flags,text)); const int txtw = rect.width(), txth = rect.height();//fm.width(text), txth = fm.height()*lines; - pixmap = QPixmap(txtw, txth); + pixmap = TQPixmap(txtw, txth); if (!pixmap.isNull()) { //create pixmap once pixmap.fill( viewport()->paletteBackgroundColor() ); - QPainter pb(&pixmap, this); + TQPainter pb(&pixmap, this); pb.setPen(m_helpColor); pb.setFont(m_helpFont); - pb.drawText(0, 0, txtw, txth, Qt::AlignCenter|Qt::AlignTop, text); + pb.drawText(0, 0, txtw, txth, TQt::AlignCenter|TQt::AlignTop, text); } } void -KexiScrollView::drawContents( QPainter * p, int clipx, int clipy, int clipw, int cliph ) +KexiScrollView::drawContents( TQPainter * p, int clipx, int clipy, int clipw, int cliph ) { - QScrollView::drawContents(p, clipx, clipy, clipw, cliph); + TQScrollView::drawContents(p, clipx, clipy, clipw, cliph); if (m_widget) { if(m_preview || !m_outerAreaVisible) return; @@ -345,7 +345,7 @@ KexiScrollView::drawContents( QPainter * p, int clipx, int clipy, int clipw, int //draw right and bottom borders const int wx = childX(m_widget); const int wy = childY(m_widget); - p->setPen(palette().active().foreground()); + p->setPen(tqpalette().active().foreground()); p->drawLine(wx+m_widget->width(), wy, wx+m_widget->width(), wy+m_widget->height()); p->drawLine(wx, wy+m_widget->height(), wx+m_widget->width(), wy+m_widget->height()); //kdDebug() << "KexiScrollView::drawContents() " << wy+m_widget->height() << endl; @@ -363,14 +363,14 @@ KexiScrollView::drawContents( QPainter * p, int clipx, int clipy, int clipw, int { if (m_widget->height()>(KexiScrollView_data->verticalOuterAreaPixmapBuffer.height()+20)) { p->drawPixmap( - QMAX( m_widget->width(), KexiScrollView_data->verticalOuterAreaPixmapBuffer.width() + 20 ) + 20, - QMAX( (m_widget->height() - KexiScrollView_data->verticalOuterAreaPixmapBuffer.height())/2, 20 ), + TQMAX( m_widget->width(), KexiScrollView_data->verticalOuterAreaPixmapBuffer.width() + 20 ) + 20, + TQMAX( (m_widget->height() - KexiScrollView_data->verticalOuterAreaPixmapBuffer.height())/2, 20 ), KexiScrollView_data->verticalOuterAreaPixmapBuffer ); } p->drawPixmap( - QMAX( (m_widget->width() - KexiScrollView_data->horizontalOuterAreaPixmapBuffer.width())/2, 20 ), - QMAX( m_widget->height(), KexiScrollView_data->horizontalOuterAreaPixmapBuffer.height() + 20 ) + 20, + TQMAX( (m_widget->width() - KexiScrollView_data->horizontalOuterAreaPixmapBuffer.width())/2, 20 ), + TQMAX( m_widget->height(), KexiScrollView_data->horizontalOuterAreaPixmapBuffer.height() + 20 ) + 20, KexiScrollView_data->horizontalOuterAreaPixmapBuffer ); } @@ -378,14 +378,14 @@ KexiScrollView::drawContents( QPainter * p, int clipx, int clipy, int clipw, int } void -KexiScrollView::leaveEvent( QEvent *e ) +KexiScrollView::leaveEvent( TQEvent *e ) { - QWidget::leaveEvent(e); + TQWidget::leaveEvent(e); m_widget->update(); //update form elements on too fast mouse move } void -KexiScrollView::setHBarGeometry( QScrollBar & hbar, int x, int y, int w, int h ) +KexiScrollView::setHBarGeometry( TQScrollBar & hbar, int x, int y, int w, int h ) { /*todo*/ // kdDebug(44021)<<"KexiScrollView::setHBarGeometry"<<endl; diff --git a/kexi/widget/kexiscrollview.h b/kexi/widget/kexiscrollview.h index c313f2d7..92615cf3 100644 --- a/kexi/widget/kexiscrollview.h +++ b/kexi/widget/kexiscrollview.h @@ -21,25 +21,26 @@ #ifndef KEXISCROLLVIEW_H #define KEXISCROLLVIEW_H -#include <qscrollview.h> -#include <qtimer.h> +#include <tqscrollview.h> +#include <tqtimer.h> -class QColor; -class QFont; +class TQColor; +class TQFont; class KexiRecordNavigator; //! The scrollview which includes KexiDBForm /*! It allows to resize its m_widget, following snapToGrid setting. Its contents is resized so the widget can always be resized. */ -class KEXIEXTWIDGETS_EXPORT KexiScrollView : public QScrollView +class KEXIEXTWIDGETS_EXPORT KexiScrollView : public TQScrollView { Q_OBJECT + TQ_OBJECT public: - KexiScrollView(QWidget *parent, bool preview); + KexiScrollView(TQWidget *tqparent, bool preview); virtual ~KexiScrollView(); - void setWidget(QWidget *w); + void setWidget(TQWidget *w); void setSnapToGrid(bool enable, int gridSize=10); void setResizingEnabled(bool enabled) { m_enableResizing = enabled; } @@ -64,24 +65,24 @@ class KEXIEXTWIDGETS_EXPORT KexiScrollView : public QScrollView void resizingEnded(); protected: - virtual void contentsMousePressEvent(QMouseEvent * ev); - virtual void contentsMouseReleaseEvent(QMouseEvent * ev); - virtual void contentsMouseMoveEvent(QMouseEvent * ev); - virtual void drawContents( QPainter * p, int clipx, int clipy, int clipw, int cliph ); - virtual void leaveEvent( QEvent *e ); - virtual void setHBarGeometry( QScrollBar & hbar, int x, int y, int w, int h ); - void setupPixmapBuffer(QPixmap& pixmap, const QString& text, int lines); + virtual void contentsMousePressEvent(TQMouseEvent * ev); + virtual void contentsMouseReleaseEvent(TQMouseEvent * ev); + virtual void contentsMouseMoveEvent(TQMouseEvent * ev); + virtual void drawContents( TQPainter * p, int clipx, int clipy, int clipw, int cliph ); + virtual void leaveEvent( TQEvent *e ); + virtual void setHBarGeometry( TQScrollBar & hbar, int x, int y, int w, int h ); + void setupPixmapBuffer(TQPixmap& pixmap, const TQString& text, int lines); bool m_resizing; bool m_enableResizing; - QWidget *m_widget; + TQWidget *m_widget; int m_gridSize; - QFont m_helpFont; - QColor m_helpColor; - QTimer m_delayedResize; + TQFont m_helpFont; + TQColor m_helpColor; + TQTimer m_delayedResize; //! for refreshContentsSizeLater() - QScrollView::ScrollBarMode m_vsmode, m_hsmode; + TQScrollView::ScrollBarMode m_vsmode, m_hsmode; bool m_snapToGrid : 1; bool m_preview : 1; bool m_smodeSet : 1; diff --git a/kexi/widget/kexisectionheader.cpp b/kexi/widget/kexisectionheader.cpp index 42c5031e..7bc3fe5f 100644 --- a/kexi/widget/kexisectionheader.cpp +++ b/kexi/widget/kexisectionheader.cpp @@ -21,21 +21,21 @@ #include "kexiviewbase.h" #include <kexiutils/utils.h> -#include <qlabel.h> -#include <qlayout.h> -#include <qhbox.h> -#include <qtooltip.h> +#include <tqlabel.h> +#include <tqlayout.h> +#include <tqhbox.h> +#include <tqtooltip.h> #include <kiconloader.h> #include <kpushbutton.h> -class KexiSectionHeader::BoxLayout : public QBoxLayout +class KexiSectionHeader::BoxLayout : public TQBoxLayout { public: - BoxLayout( KexiSectionHeader* parent, Direction d, int margin = 0, + BoxLayout( KexiSectionHeader* tqparent, Direction d, int margin = 0, int spacing = -1, const char * name = 0 ); - virtual void addItem( QLayoutItem * item ); - QGuardedPtr<KexiViewBase> view; + virtual void addItem( TQLayoutItem * item ); + TQGuardedPtr<KexiViewBase> view; }; //========================== @@ -49,24 +49,24 @@ class KexiSectionHeaderPrivate } Qt::Orientation orientation; - QLabel *lbl; + TQLabel *lbl; KexiSectionHeader::BoxLayout *lyr; - QHBox *lbl_b; + TQHBox *lbl_b; }; //========================== -KexiSectionHeader::KexiSectionHeader(const QString &caption, Orientation o, QWidget* parent ) - : QWidget(parent, "KexiSectionHeader") +KexiSectionHeader::KexiSectionHeader(const TQString &caption, Qt::Orientation o, TQWidget* tqparent ) + : TQWidget(tqparent, "KexiSectionHeader") , d( new KexiSectionHeaderPrivate() ) { d->orientation = o; - d->lyr = new BoxLayout( this, d->orientation==Vertical ? QBoxLayout::TopToBottom : QBoxLayout::LeftToRight ); + d->lyr = new BoxLayout( this, d->orientation==Qt::Vertical ? TQBoxLayout::TopToBottom : TQBoxLayout::LeftToRight ); d->lyr->setAutoAdd(true); - d->lbl_b = new QHBox(this); - d->lbl = new QLabel(QString(" ")+caption, d->lbl_b); - d->lbl->setSizePolicy(QSizePolicy::Minimum, QSizePolicy::Preferred); - d->lbl->setFocusPolicy(StrongFocus); + d->lbl_b = new TQHBox(this); + d->lbl = new TQLabel(TQString(" ")+caption, d->lbl_b); + d->lbl->tqsetSizePolicy(TQSizePolicy::Minimum, TQSizePolicy::Preferred); + d->lbl->setFocusPolicy(TQ_StrongFocus); d->lbl->installEventFilter(this); installEventFilter(this); setCaption(caption); @@ -77,55 +77,55 @@ KexiSectionHeader::~KexiSectionHeader() delete d; } -void KexiSectionHeader::addButton(const QString& icon, const QString& toolTip, - const QObject * receiver, const char * member) +void KexiSectionHeader::addButton(const TQString& icon, const TQString& toolTip, + const TQObject * receiver, const char * member) { KPushButton *btn = new KPushButton(d->lbl_b); btn->setFlat(true); - btn->setFocusPolicy(NoFocus); - btn->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Preferred); + btn->setFocusPolicy(TQ_NoFocus); + btn->tqsetSizePolicy(TQSizePolicy::Fixed, TQSizePolicy::Preferred); if (receiver && member) { - connect(btn, SIGNAL(clicked()), receiver, member); + connect(btn, TQT_SIGNAL(clicked()), receiver, member); } if (!icon.isEmpty()) { - QIconSet iset = SmallIconSet(icon); + TQIconSet iset = SmallIconSet(icon); btn->setIconSet( iset ); - QFontMetrics fm(d->lbl->font()); - btn->setMaximumHeight( QMAX(fm.height(), 16) ); + TQFontMetrics fm(d->lbl->font()); + btn->setMaximumHeight( TQMAX(fm.height(), 16) ); } if (!toolTip.isEmpty()) { - QToolTip::add(btn, toolTip); + TQToolTip::add(btn, toolTip); } } -bool KexiSectionHeader::eventFilter( QObject *o, QEvent *e ) +bool KexiSectionHeader::eventFilter( TQObject *o, TQEvent *e ) { - if (o == d->lbl && e->type()==QEvent::MouseButtonRelease) {//|| e->type()==QEvent::FocusOut) {// && o->inherits("QWidget")) { + if (TQT_BASE_OBJECT(o) == TQT_BASE_OBJECT(d->lbl) && e->type()==TQEvent::MouseButtonRelease) {//|| e->type()==TQEvent::FocusOut) {// && o->inherits(TQWIDGET_OBJECT_NAME_STRING)) { if (d->lyr->view) d->lyr->view->setFocus(); -// if (KexiUtils::hasParent( this, static_cast<QWidget*>(o))) { -// d->lbl->setPaletteBackgroundColor( e->type()==QEvent::FocusIn ? red : blue); +// if (KexiUtils::hasParent( this, static_cast<TQWidget*>(o))) { +// d->lbl->setPaletteBackgroundColor( e->type()==TQEvent::FocusIn ? red : blue); // } } - return QWidget::eventFilter(o,e); + return TQWidget::eventFilter(o,e); } void KexiSectionHeader::slotFocus(bool in) { - in = in || focusWidget()==this; + in = in || tqfocusWidget()==this; d->lbl->setPaletteBackgroundColor( - in ? palette().active().color(QColorGroup::Highlight) : palette().active().color(QColorGroup::Background) ); + in ? tqpalette().active().color(TQColorGroup::Highlight) : tqpalette().active().color(TQColorGroup::Background) ); d->lbl->setPaletteForegroundColor( - in ? palette().active().color(QColorGroup::HighlightedText) : palette().active().color(QColorGroup::Foreground) ); + in ? tqpalette().active().color(TQColorGroup::HighlightedText) : tqpalette().active().color(TQColorGroup::Foreground) ); } -QSize KexiSectionHeader::sizeHint() const +TQSize KexiSectionHeader::tqsizeHint() const { if (!d->lyr->view) - return QWidget::sizeHint(); - QSize s = d->lyr->view->sizeHint(); - return QSize(s.width(), d->lbl->sizeHint().height() + s.height()); + return TQWidget::tqsizeHint(); + TQSize s = d->lyr->view->tqsizeHint(); + return TQSize(s.width(), d->lbl->tqsizeHint().height() + s.height()); } /*void KexiSectionHeader::setFocus() @@ -133,25 +133,25 @@ QSize KexiSectionHeader::sizeHint() const if (d->lyr->view) d->lyr->view->setFocus(); else - QWidget::setFocus(); + TQWidget::setFocus(); }*/ //====================== -KexiSectionHeader::BoxLayout::BoxLayout( KexiSectionHeader* parent, Direction d, int margin, int spacing, const char * name ) - : QBoxLayout(parent, d, margin, spacing, name ) +KexiSectionHeader::BoxLayout::BoxLayout( KexiSectionHeader* tqparent, Direction d, int margin, int spacing, const char * name ) + : TQBoxLayout(tqparent, d, margin, spacing, name ) { } -void KexiSectionHeader::BoxLayout::addItem( QLayoutItem * item ) +void KexiSectionHeader::BoxLayout::addItem( TQLayoutItem * item ) { - QBoxLayout::addItem( item ); + TQBoxLayout::addItem( item ); if (item->widget()) { item->widget()->installEventFilter( mainWidget() ); if (item->widget()->inherits("KexiViewBase")) { view = static_cast<KexiViewBase*>(item->widget()); KexiSectionHeader *sh = static_cast<KexiSectionHeader*>(mainWidget()); - connect(view,SIGNAL(focus(bool)),sh,SLOT(slotFocus(bool))); + connect(view,TQT_SIGNAL(focus(bool)),sh,TQT_SLOT(slotFocus(bool))); sh->d->lbl->setBuddy(item->widget()); } } diff --git a/kexi/widget/kexisectionheader.h b/kexi/widget/kexisectionheader.h index b842f6ff..9e8d1215 100644 --- a/kexi/widget/kexisectionheader.h +++ b/kexi/widget/kexisectionheader.h @@ -20,27 +20,28 @@ #ifndef KEXISECTIONHEADER_H #define KEXISECTIONHEADER_H -#include <qwidget.h> +#include <tqwidget.h> class KexiSectionHeaderPrivate; -class KEXIEXTWIDGETS_EXPORT KexiSectionHeader : public QWidget +class KEXIEXTWIDGETS_EXPORT KexiSectionHeader : public TQWidget { Q_OBJECT + TQ_OBJECT public: class BoxLayout; - KexiSectionHeader(const QString &caption, Orientation o, - QWidget* parent = 0 ); + KexiSectionHeader(const TQString &caption, Qt::Orientation o, + TQWidget* tqparent = 0 ); virtual ~KexiSectionHeader(); - void addButton(const QString& icon, const QString& toolTip, - const QObject * receiver, const char * member); + void addButton(const TQString& icon, const TQString& toolTip, + const TQObject * receiver, const char * member); - virtual bool eventFilter( QObject *o, QEvent *e ); + virtual bool eventFilter( TQObject *o, TQEvent *e ); - virtual QSize sizeHint() const; + virtual TQSize tqsizeHint() const; public slots: void slotFocus(bool in); diff --git a/kexi/widget/kexismalltoolbutton.cpp b/kexi/widget/kexismalltoolbutton.cpp index 085d4847..94a088a0 100644 --- a/kexi/widget/kexismalltoolbutton.cpp +++ b/kexi/widget/kexismalltoolbutton.cpp @@ -19,38 +19,38 @@ #include "kexismalltoolbutton.h" -#include <qtooltip.h> -#include <qwhatsthis.h> -#include <qstyle.h> +#include <tqtooltip.h> +#include <tqwhatsthis.h> +#include <tqstyle.h> #include <kiconloader.h> #include <kglobalsettings.h> #include <core/kexi.h> -KexiSmallToolButton::KexiSmallToolButton(QWidget* parent, const QString& text, - const QString& icon, const char* name) - : QToolButton(parent, name) +KexiSmallToolButton::KexiSmallToolButton(TQWidget* tqparent, const TQString& text, + const TQString& icon, const char* name) + : TQToolButton(tqparent, name) { init(); update(text, SmallIconSet(icon)); } -KexiSmallToolButton::KexiSmallToolButton(QWidget* parent, const QString& text, - const QIconSet& iconSet, const char* name) - : QToolButton(parent, name) +KexiSmallToolButton::KexiSmallToolButton(TQWidget* tqparent, const TQString& text, + const TQIconSet& iconSet, const char* name) + : TQToolButton(tqparent, name) { init(); update(text, iconSet); } -KexiSmallToolButton::KexiSmallToolButton(QWidget* parent, KAction* action) - : QToolButton(parent, action->name()) +KexiSmallToolButton::KexiSmallToolButton(TQWidget* tqparent, KAction* action) + : TQToolButton(tqparent, action->name()) , m_action(action) { init(); - connect(this, SIGNAL(clicked()), action, SLOT(activate())); - connect(action, SIGNAL(enabled(bool)), this, SLOT(setEnabled(bool))); + connect(this, TQT_SIGNAL(clicked()), action, TQT_SLOT(activate())); + connect(action, TQT_SIGNAL(enabled(bool)), this, TQT_SLOT(setEnabled(bool))); updateAction(); } @@ -64,21 +64,21 @@ void KexiSmallToolButton::updateAction() return; update(m_action->text(), m_action->iconSet(KIcon::Small)); setAccel(m_action->shortcut()); - QToolTip::add(this, m_action->toolTip()); - QWhatsThis::add(this, m_action->whatsThis()); + TQToolTip::add(this, m_action->toolTip()); + TQWhatsThis::add(this, m_action->whatsThis()); } void KexiSmallToolButton::init() { - setPaletteBackgroundColor(palette().active().background()); - setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Preferred); - QFont f(KGlobalSettings::toolBarFont()); + setPaletteBackgroundColor(tqpalette().active().background()); + tqsetSizePolicy(TQSizePolicy::Fixed, TQSizePolicy::Preferred); + TQFont f(KGlobalSettings::toolBarFont()); f.setPixelSize(Kexi::smallFont().pixelSize()); setFont(f); setAutoRaise(true); } -void KexiSmallToolButton::update(const QString& text, const QIconSet& iconSet, bool tipToo) +void KexiSmallToolButton::update(const TQString& text, const TQIconSet& iconSet, bool tipToo) { int width = 0; if (text.isEmpty()) { @@ -86,47 +86,47 @@ void KexiSmallToolButton::update(const QString& text, const QIconSet& iconSet, b setUsesTextLabel(false); } else { - width += QFontMetrics(font()).width(text+" "); + width += TQFontMetrics(font()).width(text+" "); setUsesTextLabel(true); - setTextPosition(QToolButton::Right); - QToolButton::setTextLabel(text, tipToo); + setTextPosition(TQToolButton::Right); + TQToolButton::setTextLabel(text, tipToo); } if (!iconSet.isNull()) { width += IconSize(KIcon::Small); - QToolButton::setIconSet(iconSet); + TQToolButton::setIconSet(iconSet); } setFixedWidth( width ); } -void KexiSmallToolButton::setIconSet( const QIconSet& iconSet ) +void KexiSmallToolButton::setIconSet( const TQIconSet& iconSet ) { update(textLabel(), iconSet); } -void KexiSmallToolButton::setIconSet( const QString& icon ) +void KexiSmallToolButton::setIconSet( const TQString& icon ) { setIconSet( SmallIconSet(icon) ); } -void KexiSmallToolButton::setTextLabel( const QString & newLabel, bool tipToo ) +void KexiSmallToolButton::setTextLabel( const TQString & newLabel, bool tipToo ) { Q_UNUSED( tipToo ); update(newLabel, iconSet()); } -void KexiSmallToolButton::drawButton( QPainter *_painter ) +void KexiSmallToolButton::drawButton( TQPainter *_painter ) { - QToolButton::drawButton(_painter); - if (QToolButton::popup()) { - QStyle::SFlags arrowFlags = QStyle::Style_Default; + TQToolButton::drawButton(_painter); + if (TQToolButton::popup()) { + TQStyle::SFlags arrowFlags = TQStyle::Style_Default; if (isDown()) - arrowFlags |= QStyle::Style_Down; + arrowFlags |= TQStyle::Style_Down; if (isEnabled()) - arrowFlags |= QStyle::Style_Enabled; - style().drawPrimitive(QStyle::PE_ArrowDown, _painter, - QRect(width()-7, height()-7, 5, 5), colorGroup(), - arrowFlags, QStyleOption() ); + arrowFlags |= TQStyle::Style_Enabled; + tqstyle().tqdrawPrimitive(TQStyle::PE_ArrowDown, _painter, + TQRect(width()-7, height()-7, 5, 5), tqcolorGroup(), + arrowFlags, TQStyleOption() ); } } diff --git a/kexi/widget/kexismalltoolbutton.h b/kexi/widget/kexismalltoolbutton.h index 59af7cfa..90ba7e5e 100644 --- a/kexi/widget/kexismalltoolbutton.h +++ b/kexi/widget/kexismalltoolbutton.h @@ -20,40 +20,41 @@ #ifndef KEXISMALLTOOLBUTTON_H #define KEXISMALLTOOLBUTTON_H -#include <qtoolbutton.h> +#include <tqtoolbutton.h> #include <kaction.h> -class QIconSet; +class TQIconSet; //! A small tool button with icon and optional text -class KEXIEXTWIDGETS_EXPORT KexiSmallToolButton : public QToolButton +class KEXIEXTWIDGETS_EXPORT KexiSmallToolButton : public TQToolButton { Q_OBJECT + TQ_OBJECT public: - KexiSmallToolButton(QWidget* parent, const QString& text, - const QString& icon = QString::null, const char* name = 0); + KexiSmallToolButton(TQWidget* tqparent, const TQString& text, + const TQString& icon = TQString(), const char* name = 0); - KexiSmallToolButton(QWidget* parent, const QString& text, - const QIconSet& iconSet, const char* name = 0); + KexiSmallToolButton(TQWidget* tqparent, const TQString& text, + const TQIconSet& iconSet, const char* name = 0); - KexiSmallToolButton(QWidget* parent, KAction *action); + KexiSmallToolButton(TQWidget* tqparent, KAction *action); virtual ~KexiSmallToolButton(); void updateAction(); - virtual void setIconSet( const QIconSet& iconSet ); - virtual void setIconSet( const QString& icon ); - virtual void setTextLabel( const QString & newLabel, bool tipToo ); - virtual void setTextLabel( const QString & newLabel ) { setTextLabel(newLabel, false); } + virtual void setIconSet( const TQIconSet& iconSet ); + virtual void setIconSet( const TQString& icon ); + virtual void setTextLabel( const TQString & newLabel, bool tipToo ); + virtual void setTextLabel( const TQString & newLabel ) { setTextLabel(newLabel, false); } protected: - void update(const QString& text, const QIconSet& iconSet, bool tipToo = false); + void update(const TQString& text, const TQIconSet& iconSet, bool tipToo = false); void init(); - virtual void drawButton( QPainter *_painter ); + virtual void drawButton( TQPainter *_painter ); - QGuardedPtr<KAction> m_action; + TQGuardedPtr<KAction> m_action; }; #endif diff --git a/kexi/widget/pixmapcollection.cpp b/kexi/widget/pixmapcollection.cpp index 7f9718d6..fbcf91de 100644 --- a/kexi/widget/pixmapcollection.cpp +++ b/kexi/widget/pixmapcollection.cpp @@ -17,12 +17,12 @@ * Boston, MA 02110-1301, USA. */ -#include <qpixmap.h> -#include <qlayout.h> -#include <qlabel.h> -#include <qstringlist.h> -#include <qtoolbutton.h> -#include <qdom.h> +#include <tqpixmap.h> +#include <tqlayout.h> +#include <tqlabel.h> +#include <tqstringlist.h> +#include <tqtoolbutton.h> +#include <tqdom.h> #include <kapplication.h> #include <kiconloader.h> @@ -40,61 +40,61 @@ #include "pixmapcollection.h" /// Pixmap Collection -PixmapCollection::PixmapCollection(const QString &collectionName, QObject *parent, const char *name) - : QObject(parent, name) +PixmapCollection::PixmapCollection(const TQString &collectionName, TQObject *tqparent, const char *name) + : TQObject(tqparent, name) { m_name = collectionName; } -QString +TQString PixmapCollection::addPixmapPath(const KURL &url) { - QString name = url.filename(); - while(m_pixmaps.contains(name)) + TQString name = url.filename(); + while(m_pixmaps.tqcontains(name)) { bool ok; int num = name.right(1).toInt(&ok, 10); if(ok) - name = name.left(name.length()-1) + QString::number(num+1); + name = name.left(name.length()-1) + TQString::number(num+1); else name += "2"; } - m_pixmaps.insert(name, qMakePair(url.path(), 0)); + m_pixmaps.insert(name, tqMakePair(url.path(), 0)); return name; } -QString -PixmapCollection::addPixmapName(const QString &icon, int size) +TQString +PixmapCollection::addPixmapName(const TQString &icon, int size) { - QString name = icon; - while(m_pixmaps.contains(name)) + TQString name = icon; + while(m_pixmaps.tqcontains(name)) { bool ok; int num = name.right(1).toInt(&ok, 10); if(ok) - name = name.left(name.length()-1) + QString::number(num+1); + name = name.left(name.length()-1) + TQString::number(num+1); else name += "2"; } - m_pixmaps.insert(name, qMakePair(icon, size)); + m_pixmaps.insert(name, tqMakePair(icon, size)); return name; } void -PixmapCollection::removePixmap(const QString &name) +PixmapCollection::removePixmap(const TQString &name) { m_pixmaps.remove(name); } -QPixmap -PixmapCollection::getPixmap(const QString &name) +TQPixmap +PixmapCollection::getPixmap(const TQString &name) { - if(!m_pixmaps.contains(name)) + if(!m_pixmaps.tqcontains(name)) { kdDebug() << " The icon " << name << " you requested is not in the collection" << endl; - return QPixmap(); + return TQPixmap(); } if(m_pixmaps[name].second != 0) @@ -102,81 +102,81 @@ PixmapCollection::getPixmap(const QString &name) return kapp->iconLoader()->loadIcon(m_pixmaps[name].first, KIcon::NoGroup, m_pixmaps[name].second); } else - return QPixmap(m_pixmaps[name].first); + return TQPixmap(m_pixmaps[name].first); } bool -PixmapCollection::contains(const QString &name) +PixmapCollection::tqcontains(const TQString &name) { - return m_pixmaps.contains(name); + return m_pixmaps.tqcontains(name); } void -PixmapCollection::save(QDomNode parentNode) +PixmapCollection::save(TQDomNode tqparentNode) { if(m_pixmaps.isEmpty()) return; - QDomDocument domDoc = parentNode.ownerDocument(); - QDomElement collection = domDoc.createElement("collection"); - parentNode.appendChild(collection); + TQDomDocument domDoc = tqparentNode.ownerDocument(); + TQDomElement collection = domDoc.createElement("collection"); + tqparentNode.appendChild(collection); PixmapMap::ConstIterator it; PixmapMap::ConstIterator endIt = m_pixmaps.constEnd(); for(it = m_pixmaps.constBegin(); it != endIt; ++it) { - QDomElement item = domDoc.createElement("pixmap"); + TQDomElement item = domDoc.createElement("pixmap"); collection.appendChild(item); item.setAttribute("name", it.key()); if(it.data().second != 0) - item.setAttribute("size", QString::number(it.data().second)); + item.setAttribute("size", TQString::number(it.data().second)); - QString text = it.data().first; - QDomText textNode = domDoc.createTextNode(text); + TQString text = it.data().first; + TQDomText textNode = domDoc.createTextNode(text); item.appendChild(textNode); } } void -PixmapCollection::load(QDomNode node) +PixmapCollection::load(TQDomNode node) { - QDomDocument domDoc = node.ownerDocument(); - for(QDomNode n = node.firstChild(); !n.isNull(); n = n.nextSibling()) + TQDomDocument domDoc = node.ownerDocument(); + for(TQDomNode n = node.firstChild(); !n.isNull(); n = n.nextSibling()) { - QDomElement el = n.toElement(); - QPair<QString, int> pair = qMakePair(el.text(), el.attribute("size").toInt()); + TQDomElement el = n.toElement(); + TQPair<TQString, int> pair = tqMakePair(el.text(), el.attribute("size").toInt()); m_pixmaps[el.attribute("name")] = pair; } } //// A dialog to load a KDE icon by its name -LoadIconDialog::LoadIconDialog(QWidget *parent) -: KDialogBase(parent, "loadicon_dialog", true, i18n("Load KDE Icon by Name"), Ok|Cancel, Ok, false) +LoadIconDialog::LoadIconDialog(TQWidget *tqparent) +: KDialogBase(tqparent, "loadicon_dialog", true, i18n("Load KDE Icon by Name"), Ok|Cancel, Ok, false) { - QFrame *frame = makeMainWidget(); - QGridLayout *l = new QGridLayout(frame, 2, 3, 0, 6); + TQFrame *frame = makeMainWidget(); + TQGridLayout *l = new TQGridLayout(frame, 2, 3, 0, 6); // Name input - QLabel *name = new QLabel(i18n("&Name:"), frame); + TQLabel *name = new TQLabel(i18n("&Name:"), frame); l->addWidget(name, 0, 0); - name->setAlignment(Qt::AlignRight|Qt::AlignVCenter); + name->tqsetAlignment(TQt::AlignRight|TQt::AlignVCenter); m_nameInput = new KLineEdit("kexi", frame); l->addWidget(m_nameInput, 0, 1); name->setBuddy(m_nameInput); // Choose size - QLabel *size = new QLabel(i18n("&Size:"), frame); + TQLabel *size = new TQLabel(i18n("&Size:"), frame); l->addWidget(size, 1, 0); - size->setAlignment(Qt::AlignRight|Qt::AlignVCenter); + size->tqsetAlignment(TQt::AlignRight|TQt::AlignVCenter); KComboBox *combo = new KComboBox(frame); l->addWidget(combo, 1, 1); size->setBuddy(combo); - QStringList list; + TQStringList list; list << i18n("Small") << i18n("Medium") << i18n("Large") << i18n("Huge"); combo->insertStringList(list); combo->setCurrentItem(2); - connect(combo, SIGNAL(activated(int)), this, SLOT(changeIconSize(int))); + connect(combo, TQT_SIGNAL(activated(int)), this, TQT_SLOT(changeIconSize(int))); // Icon chooser button @@ -184,18 +184,18 @@ LoadIconDialog::LoadIconDialog(QWidget *parent) m_button->setIcon("kexi"); m_button->setIconSize(KIcon::SizeMedium); l->addMultiCellWidget(m_button, 0, 1, 2, 2); - connect(m_button, SIGNAL(iconChanged(QString)), this, SLOT(updateIconName(QString))); - connect(m_nameInput, SIGNAL(textChanged(const QString &)), this, SLOT(setIcon(const QString &))); + connect(m_button, TQT_SIGNAL(iconChanged(TQString)), this, TQT_SLOT(updateIconName(TQString))); + connect(m_nameInput, TQT_SIGNAL(textChanged(const TQString &)), this, TQT_SLOT(setIcon(const TQString &))); } void -LoadIconDialog::updateIconName(QString icon) +LoadIconDialog::updateIconName(TQString icon) { m_nameInput->setText(icon); } void -LoadIconDialog::setIcon(const QString &icon) +LoadIconDialog::setIcon(const TQString &icon) { m_button->setIcon(icon); } @@ -210,7 +210,7 @@ LoadIconDialog::changeIconSize(int index) //case 1: size = KIcon::SizeSmallMedium; break; case 1: size = KIcon::SizeMedium; break; case 2: size = KIcon::SizeLarge; break; -#if !defined(Q_WS_WIN) && KDE_IS_VERSION(3,1,9) +#if !defined(TQ_WS_WIN) && KDE_IS_VERSION(3,1,9) case 3: size = KIcon::SizeHuge; break; #endif default:; @@ -224,54 +224,54 @@ int LoadIconDialog::iconSize() return m_button->iconSize(); } -QString LoadIconDialog::iconName() +TQString LoadIconDialog::iconName() { return m_button->icon(); } /// Pixmap Collection Editor Dialog -PixmapCollectionEditor::PixmapCollectionEditor(PixmapCollection *collection, QWidget *parent) -: KDialogBase(parent, "pixcollection_dialog", true, - i18n("Edit Pixmap Collection: %1").arg(collection->collectionName()), Close, Close, false) +PixmapCollectionEditor::PixmapCollectionEditor(PixmapCollection *collection, TQWidget *tqparent) +: KDialogBase(tqparent, "pixcollection_dialog", true, + i18n("Edit Pixmap Collection: %1").tqarg(collection->collectionName()), Close, Close, false) { m_collection = collection; - QFrame *frame = makeMainWidget(); - QHBoxLayout *l = new QHBoxLayout(frame, 0, 6); - setInitialSize(QSize(400, 200), true); + TQFrame *frame = makeMainWidget(); + TQHBoxLayout *l = new TQHBoxLayout(frame, 0, 6); + setInitialSize(TQSize(400, 200), true); //// Setup the icon toolbar ///////////////// - QVBoxLayout *vlayout = new QVBoxLayout(l, 3); - QToolButton *newItemPath = new QToolButton(frame); + TQVBoxLayout *vtqlayout = new TQVBoxLayout(l, 3); + TQToolButton *newItemPath = new TQToolButton(frame); newItemPath->setIconSet(BarIconSet("fileopen")); newItemPath->setTextLabel(i18n("&Add File"), true); - vlayout->addWidget(newItemPath); + vtqlayout->addWidget(newItemPath); m_buttons.insert(BNewItemPath, newItemPath); - connect(newItemPath, SIGNAL(clicked()), this, SLOT(newItemByPath())); + connect(newItemPath, TQT_SIGNAL(clicked()), this, TQT_SLOT(newItemByPath())); - QToolButton *newItemName = new QToolButton(frame); + TQToolButton *newItemName = new TQToolButton(frame); newItemName->setIconSet(BarIconSet("icons")); newItemName->setTextLabel(i18n("&Add an Icon"), true); - vlayout->addWidget(newItemName); + vtqlayout->addWidget(newItemName); m_buttons.insert(BNewItemName, newItemName); - connect(newItemName, SIGNAL(clicked()), this, SLOT(newItemByName())); + connect(newItemName, TQT_SIGNAL(clicked()), this, TQT_SLOT(newItemByName())); - QToolButton *delItem = new QToolButton(frame); + TQToolButton *delItem = new TQToolButton(frame); delItem->setIconSet(BarIconSet("edit_remove")); delItem->setTextLabel(i18n("&Remove Selected Item"), true); - vlayout->addWidget(delItem); + vtqlayout->addWidget(delItem); m_buttons.insert(BDelItem, delItem); - connect(delItem, SIGNAL(clicked()), this, SLOT(removeItem())); - vlayout->addStretch(); + connect(delItem, TQT_SIGNAL(clicked()), this, TQT_SLOT(removeItem())); + vtqlayout->addStretch(); // Setup the iconView m_iconView = new KIconView(frame, "pixcollection_iconView"); m_iconView->resize(100,100); - m_iconView->setArrangement(QIconView::LeftToRight); + m_iconView->setArrangement(TQIconView::LeftToRight); m_iconView->setAutoArrange(true); m_iconView->setMode(KIconView::Select); l->addWidget(m_iconView); - connect(m_iconView, SIGNAL(contextMenuRequested(QIconViewItem*, const QPoint&)), this, SLOT(displayMenu(QIconViewItem*, const QPoint&))); - connect(m_iconView, SIGNAL(itemRenamed(QIconViewItem*, const QString &)), this, SLOT(renameCollectionItem(QIconViewItem*, const QString&))); + connect(m_iconView, TQT_SIGNAL(contextMenuRequested(TQIconViewItem*, const TQPoint&)), this, TQT_SLOT(displayMenu(TQIconViewItem*, const TQPoint&))); + connect(m_iconView, TQT_SIGNAL(itemRenamed(TQIconViewItem*, const TQString &)), this, TQT_SLOT(renameCollectionItem(TQIconViewItem*, const TQString&))); PixmapMap::ConstIterator it; PixmapMap::ConstIterator endIt = collection->m_pixmaps.end(); @@ -282,13 +282,13 @@ PixmapCollectionEditor::PixmapCollectionEditor(PixmapCollection *collection, QWi void PixmapCollectionEditor::newItemByName() { - LoadIconDialog d(parentWidget()); - if(d.exec()== QDialog::Accepted) + LoadIconDialog d(tqparentWidget()); + if(d.exec()== TQDialog::Accepted) { if(d.iconName().isEmpty()) return; - QString name = m_collection->addPixmapName(d.iconName(), d.iconSize()); + TQString name = m_collection->addPixmapName(d.iconName(), d.iconSize()); createIconViewItem(name); } } @@ -296,23 +296,23 @@ PixmapCollectionEditor::newItemByName() void PixmapCollectionEditor::newItemByPath() { - KURL url = KFileDialog::getImageOpenURL("::kexi", parentWidget()); + KURL url = KFileDialog::getImageOpenURL("::kexi", tqparentWidget()); if(url.isEmpty()) return; - QString name = m_collection->addPixmapPath(url); + TQString name = m_collection->addPixmapPath(url); createIconViewItem(name); } void PixmapCollectionEditor::removeItem() { - QIconViewItem *item = m_iconView->currentItem(); + TQIconViewItem *item = m_iconView->currentItem(); if( !item ) return; - int confirm = KMessageBox::questionYesNo(parentWidget(), QString("<qt>")+ + int confirm = KMessageBox::questionYesNo(tqparentWidget(), TQString("<qt>")+ i18n("Do you want to remove item \"%1\" from collection \"%2\"?") - .arg(item->text()).arg(m_collection->collectionName()) + "</qt>"); + .tqarg(item->text()).tqarg(m_collection->collectionName()) + "</qt>"); if(confirm == KMessageBox::No) return; @@ -328,60 +328,60 @@ PixmapCollectionEditor::renameItem() } void -PixmapCollectionEditor::createIconViewItem(const QString &name) +PixmapCollectionEditor::createIconViewItem(const TQString &name) { PixmapIconViewItem *item = new PixmapIconViewItem(m_iconView, name, getPixmap(name)); item->setRenameEnabled(true); } -QPixmap -PixmapCollectionEditor::getPixmap(const QString &name) +TQPixmap +PixmapCollectionEditor::getPixmap(const TQString &name) { - QPixmap pixmap = m_collection->getPixmap(name); + TQPixmap pixmap = m_collection->getPixmap(name); if((pixmap.width() <= 48) && (pixmap.height() <= 48)) return pixmap; KPixmapIO io; - QImage image = io.convertToImage(pixmap); - pixmap = io.convertToPixmap(image.scale(48, 48, QImage::ScaleMin)); + TQImage image = io.convertToImage(pixmap); + pixmap = io.convertToPixmap(image.scale(48, 48, TQ_ScaleMin)); return pixmap; } void -PixmapCollectionEditor::renameCollectionItem(QIconViewItem *it, const QString &name) +PixmapCollectionEditor::renameCollectionItem(TQIconViewItem *it, const TQString &name) { PixmapIconViewItem *item = static_cast<PixmapIconViewItem*>(it); - if(!m_collection->m_pixmaps.contains(item->name())) + if(!m_collection->m_pixmaps.tqcontains(item->name())) return; // We just rename the collection item - QPair<QString, int> pair = m_collection->m_pixmaps[item->name()]; + TQPair<TQString, int> pair = m_collection->m_pixmaps[item->name()]; m_collection->m_pixmaps.remove(item->name()); m_collection->m_pixmaps[name] = pair; item->setName(name); } void -PixmapCollectionEditor::displayMenu(QIconViewItem *it, const QPoint &p) +PixmapCollectionEditor::displayMenu(TQIconViewItem *it, const TQPoint &p) { if(!it) return; KPopupMenu *menu = new KPopupMenu(); - menu->insertItem(SmallIconSet("edit"), i18n("Rename Item"), this, SLOT(renameItem())); - menu->insertItem(SmallIconSet("remove"), i18n("Remove Item"), this, SLOT(removeItem())); + menu->insertItem(SmallIconSet("edit"), i18n("Rename Item"), this, TQT_SLOT(renameItem())); + menu->insertItem(SmallIconSet("remove"), i18n("Remove Item"), this, TQT_SLOT(removeItem())); menu->exec(p); } //// A Dialog to choose a pixmap from the PixmapCollection -PixmapCollectionChooser::PixmapCollectionChooser(PixmapCollection *collection, const QString &selectedItem, QWidget *parent) -: KDialogBase(parent, "pixchoose_dialog", true, i18n("Select Pixmap From %1").arg(collection->collectionName()), +PixmapCollectionChooser::PixmapCollectionChooser(PixmapCollection *collection, const TQString &selectedItem, TQWidget *tqparent) +: KDialogBase(tqparent, "pixchoose_dialog", true, i18n("Select Pixmap From %1").tqarg(collection->collectionName()), User1|Ok|Cancel, Ok, false, KGuiItem(i18n("Edit Collection..."))) { m_collection = collection; - setInitialSize(QSize(400, 200), true); + setInitialSize(TQSize(400, 200), true); m_iconView = new KIconView(this, "pixchooser_iconView"); setMainWidget(m_iconView); - m_iconView->setArrangement(QIconView::LeftToRight); + m_iconView->setArrangement(TQIconView::LeftToRight); m_iconView->setAutoArrange(true); m_iconView->setMode(KIconView::Select); @@ -390,44 +390,44 @@ PixmapCollectionChooser::PixmapCollectionChooser(PixmapCollection *collection, c for(it = collection->m_pixmaps.constBegin(); it != endIt; ++it) new PixmapIconViewItem(m_iconView, it.key(), getPixmap(it.key())); - QIconViewItem *item = m_iconView->findItem(selectedItem, Qt::ExactMatch); + TQIconViewItem *item = m_iconView->tqfindItem(selectedItem, TQt::ExactMatch); if(item && !selectedItem.isEmpty()) m_iconView->setCurrentItem(item); } -QPixmap +TQPixmap PixmapCollectionChooser::pixmap() { if(! m_iconView->currentItem()) - return QPixmap(); - QString name = m_iconView->currentItem()->text(); + return TQPixmap(); + TQString name = m_iconView->currentItem()->text(); return m_collection->getPixmap(name); } -QString +TQString PixmapCollectionChooser::pixmapName() { - return m_iconView->currentItem() ? m_iconView->currentItem()->text() : QString(""); + return m_iconView->currentItem() ? m_iconView->currentItem()->text() : TQString(""); } -QPixmap -PixmapCollectionChooser::getPixmap(const QString &name) +TQPixmap +PixmapCollectionChooser::getPixmap(const TQString &name) { - QPixmap pixmap = m_collection->getPixmap(name); + TQPixmap pixmap = m_collection->getPixmap(name); if((pixmap.width() <= 48) && (pixmap.height() <= 48)) return pixmap; // We scale the pixmap down to 48x48 to fit in the iconView KPixmapIO io; - QImage image = io.convertToImage(pixmap); - pixmap = io.convertToPixmap(image.scale(48, 48, QImage::ScaleMin)); + TQImage image = io.convertToImage(pixmap); + pixmap = io.convertToPixmap(image.scale(48, 48, TQ_ScaleMin)); return pixmap; } void PixmapCollectionChooser::slotUser1() { - PixmapCollectionEditor dialog(m_collection, parentWidget()); + PixmapCollectionEditor dialog(m_collection, tqparentWidget()); dialog.exec(); m_iconView->clear(); diff --git a/kexi/widget/pixmapcollection.h b/kexi/widget/pixmapcollection.h index a46a2043..53637e28 100644 --- a/kexi/widget/pixmapcollection.h +++ b/kexi/widget/pixmapcollection.h @@ -20,52 +20,53 @@ #ifndef KFORMDESIGNERPIXMAPCOLLECTION_H #define KFORMDESIGNERPIXMAPCOLLECTION_H -#include <qobject.h> -#include <qmap.h> -#include <qpair.h> -#include <qintdict.h> -#include <qtoolbutton.h> +#include <tqobject.h> +#include <tqmap.h> +#include <tqpair.h> +#include <tqintdict.h> +#include <tqtoolbutton.h> #include <kicontheme.h> #include <kdialogbase.h> #include <kiconview.h> #include <kurl.h> -class QPixmap; +class TQPixmap; class KIconView; class KIconButton; class KLineEdit; -class QDomNode; +class TQDomNode; -typedef QMap<QString, QPair<QString, int> > PixmapMap; +typedef TQMap<TQString, TQPair<TQString, int> > PixmapMap; //! A class that store pixmaps (by path or by name for KDE icons) -class KEXIEXTWIDGETS_EXPORT PixmapCollection : public QObject +class KEXIEXTWIDGETS_EXPORT PixmapCollection : public TQObject { Q_OBJECT + TQ_OBJECT public: - PixmapCollection(const QString &collectionName, QObject *parent = 0, const char *name = 0); + PixmapCollection(const TQString &collectionName, TQObject *tqparent = 0, const char *name = 0); ~PixmapCollection() {;} - QString addPixmapPath(const KURL &url); - QString addPixmapName(const QString &name, int size = KIcon::SizeMedium); - void removePixmap(const QString &name); + TQString addPixmapPath(const KURL &url); + TQString addPixmapName(const TQString &name, int size = KIcon::SizeMedium); + void removePixmap(const TQString &name); - bool contains(const QString &name); - QPixmap getPixmap(const QString &name); + bool tqcontains(const TQString &name); + TQPixmap getPixmap(const TQString &name); - void save(QDomNode parentNode); - void load(QDomNode node); + void save(TQDomNode tqparentNode); + void load(TQDomNode node); - QString collectionName() {return m_name; } + TQString collectionName() {return m_name; } signals: - void itemRenamed(const QString &oldName, const QString &newName); - void itemRemoved(const QString &name); + void itemRenamed(const TQString &oldName, const TQString &newName); + void itemRemoved(const TQString &name); protected: - QString m_name; + TQString m_name; PixmapMap m_pixmaps; friend class PixmapCollectionEditor; @@ -76,27 +77,28 @@ class KEXIEXTWIDGETS_EXPORT PixmapCollection : public QObject class KEXIEXTWIDGETS_EXPORT PixmapCollectionEditor : public KDialogBase { Q_OBJECT + TQ_OBJECT public: - PixmapCollectionEditor(PixmapCollection *collection, QWidget *parent = 0); + PixmapCollectionEditor(PixmapCollection *collection, TQWidget *tqparent = 0); ~PixmapCollectionEditor() {;} protected: - QPixmap getPixmap(const QString &name); - void createIconViewItem(const QString &name); + TQPixmap getPixmap(const TQString &name); + void createIconViewItem(const TQString &name); protected slots: void newItemByPath(); void newItemByName(); void removeItem(); void renameItem(); - void renameCollectionItem(QIconViewItem *item, const QString &name); - void displayMenu(QIconViewItem *item, const QPoint &p); + void renameCollectionItem(TQIconViewItem *item, const TQString &name); + void displayMenu(TQIconViewItem *item, const TQPoint &p); private: enum { BNewItemPath = 101, BNewItemName, BDelItem}; KIconView *m_iconView; - QIntDict<QToolButton> m_buttons; + TQIntDict<TQToolButton> m_buttons; PixmapCollection *m_collection; }; @@ -104,16 +106,17 @@ class KEXIEXTWIDGETS_EXPORT PixmapCollectionEditor : public KDialogBase class KEXIEXTWIDGETS_EXPORT PixmapCollectionChooser : public KDialogBase { Q_OBJECT + TQ_OBJECT public: - PixmapCollectionChooser(PixmapCollection *collection, const QString &selectedItem, QWidget *parent = 0); + PixmapCollectionChooser(PixmapCollection *collection, const TQString &selectedItem, TQWidget *tqparent = 0); ~PixmapCollectionChooser() {;} - QPixmap pixmap(); - QString pixmapName(); + TQPixmap pixmap(); + TQString pixmapName(); protected: - QPixmap getPixmap(const QString &name); + TQPixmap getPixmap(const TQString &name); protected slots: virtual void slotUser1(); @@ -126,18 +129,19 @@ class KEXIEXTWIDGETS_EXPORT PixmapCollectionChooser : public KDialogBase class KEXIEXTWIDGETS_EXPORT LoadIconDialog : public KDialogBase { Q_OBJECT + TQ_OBJECT public: - LoadIconDialog(QWidget *parent = 0); + LoadIconDialog(TQWidget *tqparent = 0); ~LoadIconDialog() {;} int iconSize(); - QString iconName(); + TQString iconName(); protected slots: void changeIconSize(int); - void updateIconName(QString); - void setIcon(const QString &); + void updateIconName(TQString); + void setIcon(const TQString &); private: KLineEdit *m_nameInput; @@ -148,15 +152,15 @@ class KEXIEXTWIDGETS_EXPORT LoadIconDialog : public KDialogBase class KEXIEXTWIDGETS_EXPORT PixmapIconViewItem : public KIconViewItem { public: - PixmapIconViewItem(KIconView *parent, const QString &text, const QPixmap &icon) - : KIconViewItem(parent, text, icon) { m_name = text; } + PixmapIconViewItem(KIconView *tqparent, const TQString &text, const TQPixmap &icon) + : KIconViewItem(tqparent, text, icon) { m_name = text; } ~PixmapIconViewItem() {;} - void setName(const QString &name) { m_name = name; } - QString name() { return m_name;} + void setName(const TQString &name) { m_name = name; } + TQString name() { return m_name;} private: - QString m_name; + TQString m_name; }; #endif diff --git a/kexi/widget/relations/kexirelationview.cpp b/kexi/widget/relations/kexirelationview.cpp index 9d68a755..ae35334b 100644 --- a/kexi/widget/relations/kexirelationview.cpp +++ b/kexi/widget/relations/kexirelationview.cpp @@ -20,15 +20,15 @@ #include <kdebug.h> -#include <qstringlist.h> -#include <qlayout.h> -#include <qlabel.h> -#include <qheader.h> -#include <qevent.h> -#include <qpainter.h> -#include <qstyle.h> -#include <qlineedit.h> -#include <qpopupmenu.h> +#include <tqstringlist.h> +#include <tqlayout.h> +#include <tqlabel.h> +#include <tqheader.h> +#include <tqevent.h> +#include <tqpainter.h> +#include <tqstyle.h> +#include <tqlineedit.h> +#include <tqpopupmenu.h> #include <klocale.h> #include <kaction.h> @@ -45,20 +45,20 @@ #include "kexirelationviewconnection.h" #include <kexi.h> -KexiRelationView::KexiRelationView(QWidget *parent, const char *name) - : QScrollView(parent, name, WStaticContents) +KexiRelationView::KexiRelationView(TQWidget *tqparent, const char *name) + : TQScrollView(tqparent, name, WStaticContents) { // m_relation=relation; // m_relation->incUsageCount(); m_selectedConnection = 0; m_readOnly=false; m_focusedTableView = 0; - setFrameStyle(QFrame::WinPanel | QFrame::Sunken); + setFrameStyle(TQFrame::WinPanel | TQFrame::Sunken); -// connect(relation, SIGNAL(relationListUpdated(QObject *)), this, SLOT(slotListUpdate(QObject *))); +// connect(relation, TQT_SIGNAL(relationListUpdated(TQObject *)), this, TQT_SLOT(slotListUpdate(TQObject *))); - viewport()->setPaletteBackgroundColor(colorGroup().mid()); - setFocusPolicy(WheelFocus); + viewport()->setPaletteBackgroundColor(tqcolorGroup().mid()); + setFocusPolicy(TQ_WheelFocus); setResizePolicy(Manual); /*MOVED TO KexiRelationDialog //actions @@ -70,18 +70,18 @@ KexiRelationView::KexiRelationView(QWidget *parent, const char *name) plugSharedAction("edit_delete", i18n("Hide Table"), m_tableQueryPopup); plugSharedAction("edit_delete",m_connectionPopup); - plugSharedAction("edit_delete",this, SLOT(removeSelectedObject())); + plugSharedAction("edit_delete",this, TQT_SLOT(removeSelectedObject())); */ #if 0 m_removeSelectedTableQueryAction = new KAction(i18n("&Hide Selected Table/Query"), "editdelete", "", - this, SLOT(removeSelectedTableQuery()), parent->actionCollection(), "relationsview_removeSelectedTableQuery"); + this, TQT_SLOT(removeSelectedTableQuery()), tqparent->actionCollection(), "relationsview_removeSelectedTableQuery"); m_removeSelectedConnectionAction = new KAction(i18n("&Remove Selected Relationship"), "button_cancel", "", - this, SLOT(removeSelectedConnection()), parent->actionCollection(), "relationsview_removeSelectedConnection"); + this, TQT_SLOT(removeSelectedConnection()), tqparent->actionCollection(), "relationsview_removeSelectedConnection"); m_openSelectedTableQueryAction = new KAction(i18n("&Open Selected Table/Query"), "", "", - this, SLOT(openSelectedTableQuery()), 0/*parent->actionCollection()*/, "relationsview_openSelectedTableQuery"); + this, TQT_SLOT(openSelectedTableQuery()), 0/*tqparent->actionCollection()*/, "relationsview_openSelectedTableQuery"); #endif -// invalidateActions(); +// tqinvalidateActions(); #if 0 @@ -91,10 +91,10 @@ KexiRelationView::KexiRelationView(QWidget *parent, const char *name) m_removeSelectedTableQueryAction->plug( m_popup ); m_removeSelectedConnectionAction->plug( m_popup ); - invalidateActions(); + tqinvalidateActions(); #endif - setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding, true); + tqsetSizePolicy(TQSizePolicy::Expanding, TQSizePolicy::Expanding, true); } KexiRelationView::~KexiRelationView() @@ -116,11 +116,11 @@ KexiRelationView::containerForTable(KexiDB::TableSchema* tableSchema) KexiRelationViewTableContainer * KexiRelationView::tableContainer(KexiDB::TableSchema *t) const { - return t ? m_tables.find(t->name()) : 0; + return t ? m_tables.tqfind(t->name()) : 0; } KexiRelationViewTableContainer* -KexiRelationView::addTableContainer(KexiDB::TableSchema *t, const QRect &rect) +KexiRelationView::addTableContainer(KexiDB::TableSchema *t, const TQRect &rect) { if(!t) return 0; @@ -137,22 +137,22 @@ KexiRelationView::addTableContainer(KexiDB::TableSchema *t, const QRect &rect) /*! @todo what about query? */ new KexiDB::TableOrQuerySchema(t) ); - connect(c, SIGNAL(endDrag()), this, SLOT(slotTableViewEndDrag())); - connect(c, SIGNAL(gotFocus()), this, SLOT(slotTableViewGotFocus())); -// connect(c, SIGNAL(headerContextMenuRequest(const QPoint&)), -// this, SLOT(tableHeaderContextMenuRequest(const QPoint&))); - connect(c, SIGNAL(contextMenuRequest(const QPoint&)), - this, SIGNAL(tableContextMenuRequest(const QPoint&))); + connect(c, TQT_SIGNAL(endDrag()), this, TQT_SLOT(slotTableViewEndDrag())); + connect(c, TQT_SIGNAL(gotFocus()), this, TQT_SLOT(slotTableViewGotFocus())); +// connect(c, TQT_SIGNAL(headerContextMenuRequest(const TQPoint&)), +// this, TQT_SLOT(tableHeaderContextMenuRequest(const TQPoint&))); + connect(c, TQT_SIGNAL(contextMenuRequest(const TQPoint&)), + this, TQT_SIGNAL(tableContextMenuRequest(const TQPoint&))); addChild(c, 100,100); if (rect.isValid()) {//predefined size - QSize finalSize = c->size().expandedTo( c->sizeHint() ); - QRect r = rect; - r.setSize( finalSize + QSize(0,10) ); + TQSize finalSize = c->size().expandedTo( c->tqsizeHint() ); + TQRect r = rect; + r.setSize( finalSize + TQSize(0,10) ); moveChild( c, rect.left(), rect.top() ); //we're doing this instead of setGeometry(rect) //because the geomenty might be saved on other system with bigger fonts :) - c->resize(c->sizeHint()); + c->resize(c->tqsizeHint()); // c->setGeometry(r); //TODO @@ -164,14 +164,14 @@ KexiRelationView::addTableContainer(KexiDB::TableSchema *t, const QRect &rect) updateGeometry(); if (!rect.isValid()) { c->updateGeometry(); - c->resize(c->sizeHint()); + c->resize(c->tqsizeHint()); } int x, y; if(m_tables.count() > 0) { int place = -10; - QDictIterator<KexiRelationViewTableContainer> it(m_tables); + TQDictIterator<KexiRelationViewTableContainer> it(m_tables); for(; it.current(); ++it) { int right = (*it)->x() + (*it)->width(); @@ -187,7 +187,7 @@ KexiRelationView::addTableContainer(KexiDB::TableSchema *t, const QRect &rect) } y = 5; - QPoint p = viewportToContents(QPoint(x, y)); + TQPoint p = viewportToContents(TQPoint(x, y)); recalculateSize(p.x() + c->width(), p.y() + c->height()); if (!rect.isValid()) { moveChild(c, x, y); @@ -195,8 +195,8 @@ KexiRelationView::addTableContainer(KexiDB::TableSchema *t, const QRect &rect) m_tables.insert(t->name(), c); - connect(c, SIGNAL(moved(KexiRelationViewTableContainer *)), this, - SLOT(containerMoved(KexiRelationViewTableContainer *))); + connect(c, TQT_SIGNAL(moved(KexiRelationViewTableContainer *)), this, + TQT_SLOT(containerMoved(KexiRelationViewTableContainer *))); if (hasFocus()) //ok? c->setFocus(); @@ -240,10 +240,10 @@ KexiRelationView::addConnection(const SourceConnection& _conn) KexiRelationViewTableContainer *tmp = master; master = details; details = tmp; - QString tmp_masterTable = conn.masterTable; + TQString tmp_masterTable = conn.masterTable; conn.masterTable = conn.detailsTable; conn.detailsTable = tmp_masterTable; - QString tmp_masterField = conn.masterField; + TQString tmp_masterField = conn.masterField; conn.masterField = conn.detailsField; conn.detailsField = tmp_masterField; } @@ -275,12 +275,12 @@ KexiRelationView::addConnection(const SourceConnection& _conn) } void -KexiRelationView::drawContents(QPainter *p, int cx, int cy, int cw, int ch) +KexiRelationView::drawContents(TQPainter *p, int cx, int cy, int cw, int ch) { KexiRelationViewConnection *cview; // p->translate(0, (double)contentsY()); - QRect clipping(cx, cy, cw, ch); + TQRect clipping(cx, cy, cw, ch); for(cview = m_connectionViews.first(); cview; cview = m_connectionViews.next()) { if(clipping.intersects(cview->oldRect() | cview->connectionRect())) @@ -289,7 +289,7 @@ KexiRelationView::drawContents(QPainter *p, int cx, int cy, int cw, int ch) } void -KexiRelationView::slotTableScrolling(const QString& table) +KexiRelationView::slotTableScrolling(const TQString& table) { KexiRelationViewTableContainer *c = m_tables[table]; @@ -301,7 +301,7 @@ void KexiRelationView::containerMoved(KexiRelationViewTableContainer *c) { KexiRelationViewConnection *cview; - QRect r; + TQRect r; for (ConnectionListIterator it(m_connectionViews); ((cview=it.current())); ++it) { //! @todo optimize if(cview->masterTable() == c || cview->detailsTable() == c @@ -320,10 +320,10 @@ KexiRelationView::containerMoved(KexiRelationViewTableContainer *c) //didn't work well: updateContents(r); updateContents(); -// QRect w(c->x() - 5, c->y() - 5, c->width() + 5, c->height() + 5); +// TQRect w(c->x() - 5, c->y() - 5, c->width() + 5, c->height() + 5); // updateContents(w); - QPoint p = viewportToContents(QPoint(c->x(), c->y())); + TQPoint p = viewportToContents(TQPoint(c->x(), c->y())); recalculateSize(p.x() + c->width(), p.y() + c->height()); emit tablePositionChanged(c); @@ -334,19 +334,19 @@ KexiRelationView::setReadOnly(bool b) { m_readOnly=b; //TODO -// invalidateActions(); +// tqinvalidateActions(); /* TableList::Iterator it, end( m_tables.end() ); for ( it=m_tables.begin(); it != end; ++it) { // (*it)->setReadOnly(b); -#ifndef Q_WS_WIN +#ifndef TQ_WS_WIN #warning readonly needed #endif }*/ } void -KexiRelationView::slotListUpdate(QObject *) +KexiRelationView::slotListUpdate(TQObject *) { #if 0 if(s != this) @@ -368,7 +368,7 @@ KexiRelationView::slotListUpdate(QObject *) } void -KexiRelationView::contentsMousePressEvent(QMouseEvent *ev) +KexiRelationView::contentsMousePressEvent(TQMouseEvent *ev) { KexiRelationViewConnection *cview; for(cview = m_connectionViews.first(); cview; cview = m_connectionViews.next()) @@ -381,11 +381,11 @@ KexiRelationView::contentsMousePressEvent(QMouseEvent *ev) updateContents(cview->connectionRect()); m_selectedConnection = cview; emit connectionViewGotFocus(); -// invalidateActions(); +// tqinvalidateActions(); - if(ev->button() == RightButton) {//show popup + if(ev->button() == Qt::RightButton) {//show popup kdDebug() << "KexiRelationView::contentsMousePressEvent(): context" << endl; -// QPopupMenu m; +// TQPopupMenu m; // m_removeSelectedTableQueryAction->plug( &m ); // m_removeSelectedConnectionAction->plug( &m ); emit connectionContextMenuRequest( ev->globalPos() ); @@ -395,9 +395,9 @@ KexiRelationView::contentsMousePressEvent(QMouseEvent *ev) } //connection not found clearSelection(); -// invalidateActions(); - if(ev->button() == RightButton) {//show popup on view background area -// QPopupMenu m; +// tqinvalidateActions(); + if(ev->button() == Qt::RightButton) {//show popup on view background area +// TQPopupMenu m; // m_removeSelectedConnectionAction->plug( &m ); emit emptyAreaContextMenuRequest( ev->globalPos() ); // executePopup(ev->globalPos()); @@ -406,7 +406,7 @@ KexiRelationView::contentsMousePressEvent(QMouseEvent *ev) emit emptyAreaGotFocus(); } setFocus(); -// QScrollView::contentsMousePressEvent(ev); +// TQScrollView::contentsMousePressEvent(ev); } void KexiRelationView::clearSelection() @@ -415,18 +415,18 @@ void KexiRelationView::clearSelection() m_focusedTableView->unsetFocus(); m_focusedTableView = 0; // setFocus(); -// invalidateActions(); +// tqinvalidateActions(); } if (m_selectedConnection) { m_selectedConnection->setSelected(false); updateContents(m_selectedConnection->connectionRect()); m_selectedConnection = 0; -// invalidateActions(); +// tqinvalidateActions(); } } void -KexiRelationView::keyPressEvent(QKeyEvent *ev) +KexiRelationView::keyPressEvent(TQKeyEvent *ev) { kdDebug() << "KexiRelationView::keyPressEvent()" << endl; @@ -467,14 +467,14 @@ void KexiRelationView::stretchExpandSize() { int max_x=-1, max_y=-1; - QDictIterator<KexiRelationViewTableContainer> it(m_tables); + TQDictIterator<KexiRelationViewTableContainer> it(m_tables); for (;it.current(); ++it) { if (it.current()->right()>max_x) max_x = it.current()->right(); if (it.current()->bottom()>max_y) max_y = it.current()->bottom(); } - QPoint p = viewportToContents(QPoint(max_x, max_y) + QPoint(3,3)); //3 pixels margin + TQPoint p = viewportToContents(TQPoint(max_x, max_y) + TQPoint(3,3)); //3 pixels margin resizeContents(p.x(), p.y()); } @@ -516,7 +516,7 @@ KexiRelationView::removeSelectedObject() #endif delete m_selectedConnection; m_selectedConnection = 0; -// invalidateActions(); +// tqinvalidateActions(); } else if (m_focusedTableView) { KexiRelationViewTableContainer *tmp = m_focusedTableView; @@ -531,7 +531,7 @@ KexiRelationView::hideTable(KexiRelationViewTableContainer* tableView) /*! @todo what about query? */ KexiDB::TableSchema *ts = tableView->schema()->table(); //for all connections: find and remove all connected with this table - QPtrListIterator<KexiRelationViewConnection> it(m_connectionViews); + TQPtrListIterator<KexiRelationViewConnection> it(m_connectionViews); for (;it.current();) { if (it.current()->masterTable() == tableView || it.current()->detailsTable() == tableView) @@ -554,7 +554,7 @@ KexiRelationView::hideAllTablesExcept( KexiDB::TableSchema::List* tables ) //! @todo what about queries? for (TablesDictIterator it(m_tables); it.current();) { KexiDB::TableSchema *table = it.current()->schema()->table(); - if (!table || tables->findRef( table )!=-1) { + if (!table || tables->tqfindRef( table )!=-1) { ++it; continue; } @@ -580,13 +580,13 @@ void KexiRelationView::slotTableViewGotFocus() // if (m_focusedTableView) // m_focusedTableView->unsetFocus(); m_focusedTableView = (KexiRelationViewTableContainer*)sender(); -// invalidateActions(); +// tqinvalidateActions(); emit tableViewGotFocus(); } -QSize KexiRelationView::sizeHint() const +TQSize KexiRelationView::tqsizeHint() const { - return QSize(QScrollView::sizeHint());//.width(), 600); + return TQSize(TQScrollView::tqsizeHint());//.width(), 600); } void KexiRelationView::clear() @@ -609,24 +609,24 @@ void KexiRelationView::removeAllConnections() /* -void KexiRelationView::tableHeaderContextMenuRequest(const QPoint& pos) +void KexiRelationView::tableHeaderContextMenuRequest(const TQPoint& pos) { if (m_focusedTableView != sender()) return; kdDebug() << "HEADER CTXT MENU!" <<endl; - invalidateActions(); + tqinvalidateActions(); m_tableQueryPopup->exec(pos); } //! Invalidates all actions availability -void KexiRelationView::invalidateActions() +void KexiRelationView::tqinvalidateActions() { setAvailable("edit_delete", m_selectedConnection || m_focusedTableView); } -void KexiRelationView::executePopup( QPoint pos ) +void KexiRelationView::executePopup( TQPoint pos ) { - if (pos==QPoint(-1,-1)) { + if (pos==TQPoint(-1,-1)) { pos = mapToGlobal( m_focusedTableView ? m_focusedTableView->pos() + m_focusedTableView->rect().center() : rect().center() ); } if (m_focusedTableView) diff --git a/kexi/widget/relations/kexirelationview.h b/kexi/widget/relations/kexirelationview.h index 2de6620d..b5d1785d 100644 --- a/kexi/widget/relations/kexirelationview.h +++ b/kexi/widget/relations/kexirelationview.h @@ -21,16 +21,16 @@ #ifndef KEXIRELATIONVIEW_H #define KEXIRELATIONVIEW_H -#include <qguardedptr.h> -#include <qscrollview.h> -#include <qptrlist.h> -#include <qdict.h> +#include <tqguardedptr.h> +#include <tqscrollview.h> +#include <tqptrlist.h> +#include <tqdict.h> #include <kexidb/tableschema.h> #include "kexirelationviewconnection.h" -class QFrame; +class TQFrame; class KexiRelationViewTable; class KexiRelationViewTableContainer; @@ -43,17 +43,17 @@ namespace KexiDB class Connection; } -typedef QDict<KexiRelationViewTableContainer> TablesDict; -typedef QDictIterator<KexiRelationViewTableContainer> TablesDictIterator; -typedef QPtrList<KexiRelationViewConnection> ConnectionList; -typedef QPtrListIterator<KexiRelationViewConnection> ConnectionListIterator; +typedef TQDict<KexiRelationViewTableContainer> TablesDict; +typedef TQDictIterator<KexiRelationViewTableContainer> TablesDictIterator; +typedef TQPtrList<KexiRelationViewConnection> ConnectionList; +typedef TQPtrListIterator<KexiRelationViewConnection> ConnectionListIterator; struct SourceConnection { - QString masterTable; - QString detailsTable; - QString masterField; - QString detailsField; + TQString masterTable; + TQString detailsTable; + TQString masterField; + TQString detailsField; }; /*! @short provides a view for displaying relations between database tables. @@ -65,23 +65,24 @@ struct SourceConnection The class is for displaying only - retrieving data and updating data on the backend side is implemented in KexiRelationWidget, and more specifically in: Kexi Relation Part and Kexi Query Part. */ -class KEXIRELATIONSVIEW_EXPORT KexiRelationView : public QScrollView +class KEXIRELATIONSVIEW_EXPORT KexiRelationView : public TQScrollView { Q_OBJECT + TQ_OBJECT public: - KexiRelationView(QWidget *parent, const char *name=0); + KexiRelationView(TQWidget *tqparent, const char *name=0); virtual ~KexiRelationView(); //! \return a dictionary of added tables TablesDict* tables() { return &m_tables; } /*! Adds a table \a t to the area. This changes only visual representation. - If \a rect is valid, table widget geometry will be initialized. + If \a rect is valid, table widget tqgeometry will be initialized. \return added table container or 0 on failure. */ KexiRelationViewTableContainer* addTableContainer(KexiDB::TableSchema *t, - const QRect &rect = QRect()); + const TQRect &rect = TQRect()); /*! \return table container for table \a t. */ KexiRelationViewTableContainer * tableContainer(KexiDB::TableSchema *t) const; @@ -95,16 +96,16 @@ class KEXIRELATIONSVIEW_EXPORT KexiRelationView : public QScrollView inline KexiRelationViewTableContainer* focusedTableView() const { return m_focusedTableView; } - virtual QSize sizeHint() const; + virtual TQSize tqsizeHint() const; const ConnectionList* connections() const { return &m_connectionViews; } // KexiRelationViewTableContainer* containerForTable(KexiDB::TableSchema* tableSchema); signals: - void tableContextMenuRequest( const QPoint& pos ); - void connectionContextMenuRequest( const QPoint& pos ); - void emptyAreaContextMenuRequest( const QPoint& pos ); + void tableContextMenuRequest( const TQPoint& pos ); + void connectionContextMenuRequest( const TQPoint& pos ); + void emptyAreaContextMenuRequest( const TQPoint& pos ); void tableViewGotFocus(); void connectionViewGotFocus(); void emptyAreaGotFocus(); @@ -126,7 +127,7 @@ class KEXIRELATIONSVIEW_EXPORT KexiRelationView : public QScrollView /*! Hides all tables except \a tables. */ void hideAllTablesExcept( KexiDB::TableSchema::List* tables ); - void slotTableScrolling(const QString&); + void slotTableScrolling(const TQString&); //! removes selected table or connection void removeSelectedObject(); @@ -134,7 +135,7 @@ class KEXIRELATIONSVIEW_EXPORT KexiRelationView : public QScrollView protected slots: void containerMoved(KexiRelationViewTableContainer *c); - void slotListUpdate(QObject *s); + void slotListUpdate(TQObject *s); void slotTableViewEndDrag(); void slotTableViewGotFocus(); @@ -142,15 +143,15 @@ class KEXIRELATIONSVIEW_EXPORT KexiRelationView : public QScrollView // /*! executes popup menu at \a pos, or, // if \a pos not specified: at center of selected table view (if any selected), // or at center point of the relations view. */ -// void executePopup( QPoint pos = QPoint(-1,-1) ); +// void executePopup( TQPoint pos = TQPoint(-1,-1) ); - void drawContents(QPainter *p, int cx, int cy, int cw, int ch); - void contentsMousePressEvent(QMouseEvent *ev); - virtual void keyPressEvent(QKeyEvent *ev); + void drawContents(TQPainter *p, int cx, int cy, int cw, int ch); + void contentsMousePressEvent(TQMouseEvent *ev); + virtual void keyPressEvent(TQKeyEvent *ev); void recalculateSize(int width, int height); void stretchExpandSize(); -// void invalidateActions(); +// void tqinvalidateActions(); // void clearTableSelection(); // void clearConnSelection(); @@ -161,7 +162,7 @@ class KEXIRELATIONSVIEW_EXPORT KexiRelationView : public QScrollView bool m_readOnly; ConnectionList m_connectionViews; KexiRelationViewConnection* m_selectedConnection; - QGuardedPtr<KexiRelationViewTableContainer> m_focusedTableView; + TQGuardedPtr<KexiRelationViewTableContainer> m_focusedTableView; }; #endif diff --git a/kexi/widget/relations/kexirelationviewconnection.cpp b/kexi/widget/relations/kexirelationviewconnection.cpp index 2c27de87..7c813298 100644 --- a/kexi/widget/relations/kexirelationviewconnection.cpp +++ b/kexi/widget/relations/kexirelationviewconnection.cpp @@ -18,11 +18,11 @@ * Boston, MA 02110-1301, USA. */ -#include <qpainter.h> -#include <qpixmap.h> -#include <qcolor.h> -#include <qapplication.h> -#include <qpointarray.h> +#include <tqpainter.h> +#include <tqpixmap.h> +#include <tqcolor.h> +#include <tqapplication.h> +#include <tqpointarray.h> #include <kdebug.h> @@ -40,9 +40,9 @@ KexiRelationViewConnection::KexiRelationViewConnection( KexiRelationViewTableContainer *masterTbl, KexiRelationViewTableContainer *detailsTbl, - SourceConnection &c, KexiRelationView *parent) + SourceConnection &c, KexiRelationView *tqparent) { - m_parent = parent; + m_parent = tqparent; // kdDebug() << "KexiRelationViewConnection::KexiRelationViewConnection()" << endl; m_masterTable = masterTbl; @@ -65,22 +65,22 @@ KexiRelationViewConnection::~KexiRelationViewConnection() } void -KexiRelationViewConnection::drawConnection(QPainter *p) +KexiRelationViewConnection::drawConnection(TQPainter *p) { - p->setPen(m_parent->palette().active().foreground()); + p->setPen(m_parent->tqpalette().active().foreground()); int sx = m_masterTable->x() + m_masterTable->width() + m_parent->contentsX(); int sy = m_masterTable->globalY(m_masterField); int rx = m_detailsTable->x() + m_parent->contentsX(); int ry = m_detailsTable->globalY(m_detailsField); - QFont f( Kexi::smallFont( m_parent ) ); - QFontMetrics fm(f); + TQFont f( Kexi::smallFont( m_parent ) ); + TQFontMetrics fm(f); int side1x=0, side1y=sy - fm.height(), sideNx=0, sideNy=ry - fm.height(); //! @todo details char can be also just a '1' for some cases - QChar sideNChar(0x221E); //infinity char + TQChar sideNChar(0x221E); //infinity char uint sideNCharWidth = 2+2+ fm.width( sideNChar ); - QChar side1Char('1'); + TQChar side1Char('1'); uint side1CharWidth = 2+2+ fm.width( side1Char ); p->setBrush(p->pen().color()); @@ -88,11 +88,11 @@ KexiRelationViewConnection::drawConnection(QPainter *p) { //det. side p->drawLine(rx - sideNCharWidth, ry, rx, ry); - QPointArray pa(3); + TQPointArray pa(3); pa.setPoint(0, rx - 4, ry - 3); pa.setPoint(1, rx - 4, ry + 3); pa.setPoint(2, rx - 1, ry); - p->drawPolygon(pa, true); + p->tqdrawPolygon(pa, true); //master side p->drawLine(sx, sy - 1, sx + side1CharWidth -1, sy - 1); @@ -105,10 +105,10 @@ KexiRelationViewConnection::drawConnection(QPainter *p) sideNx = rx - sideNCharWidth - 1; // sideNy = ry - 6; - QPen pen(p->pen()); + TQPen pen(p->pen()); if(m_selected) { - QPen pen(p->pen()); + TQPen pen(p->pen()); pen.setWidth(2); p->setPen(pen); } @@ -117,7 +117,7 @@ KexiRelationViewConnection::drawConnection(QPainter *p) if(m_selected) { - QPen pen(p->pen()); + TQPen pen(p->pen()); pen.setWidth(1); p->setPen(pen); } @@ -130,11 +130,11 @@ KexiRelationViewConnection::drawConnection(QPainter *p) //det. side p->drawLine(lx, ry, lx + sideNCharWidth, ry); - QPointArray pa(3); + TQPointArray pa(3); pa.setPoint(0, lx + 3, ry - 3); pa.setPoint(1, lx + 3, ry + 3); pa.setPoint(2, lx, ry); - p->drawPolygon(pa, true); + p->tqdrawPolygon(pa, true); // p->drawLine(lx, ry, lx + 8, ry); // p->drawPoint(lx + 1, ry - 1); @@ -154,7 +154,7 @@ KexiRelationViewConnection::drawConnection(QPainter *p) if(m_selected) { - QPen pen(p->pen()); + TQPen pen(p->pen()); pen.setWidth(2); p->setPen(pen); } @@ -163,20 +163,20 @@ KexiRelationViewConnection::drawConnection(QPainter *p) if(m_selected) { - QPen pen(p->pen()); + TQPen pen(p->pen()); pen.setWidth(1); p->setPen(pen); } } - p->drawText(side1x, side1y, side1CharWidth, fm.height(), Qt::AlignCenter, side1Char); - p->drawText(sideNx, sideNy, sideNCharWidth, fm.height(), Qt::AlignCenter, sideNChar); - //p->drawRect(QRect(connectionRect().topLeft(), QSize(50,50))); -// p->drawPixmap(side1, QPixmap(r1_xpm)); -// p->drawPixmap(sideN, QPixmap(rn_xpm)); + p->drawText(side1x, side1y, side1CharWidth, fm.height(), TQt::AlignCenter, side1Char); + p->drawText(sideNx, sideNy, sideNCharWidth, fm.height(), TQt::AlignCenter, sideNChar); + //p->drawRect(TQRect(connectionRect().topLeft(), TQSize(50,50))); +// p->drawPixmap(side1, TQPixmap(r1_xpm)); +// p->drawPixmap(sideN, TQPixmap(rn_xpm)); } -const QRect +const TQRect KexiRelationViewConnection::connectionRect() { int sx = m_masterTable->x() + m_parent->contentsX(); @@ -200,15 +200,15 @@ KexiRelationViewConnection::connectionRect() } - int dx = QABS((leftX + width) - rightX); - int dy = QABS(sy - ry) + 2; + int dx = TQABS((leftX + width) - rightX); + int dy = TQABS(sy - ry) + 2; - int top = QMIN(sy, ry); + int top = TQMIN(sy, ry); int left = leftX + width; -// return QRect(sx - 1, sy - 1, (rx + m_detailsTable->width()) - sx + 1, ry - sy + 1); - QRect rect(left - 150, top - 150, dx + 150, dy + 150); +// return TQRect(sx - 1, sy - 1, (rx + m_detailsTable->width()) - sx + 1, ry - sy + 1); + TQRect rect(left - 150, top - 150, dx + 150, dy + 150); // kdDebug() << "KexiRelationViewConnection::connectionRect():" << m_oldRect << "," << rect << endl; m_oldRect = rect; @@ -217,11 +217,11 @@ KexiRelationViewConnection::connectionRect() } bool -KexiRelationViewConnection::matchesPoint(const QPoint &p, int tolerance) +KexiRelationViewConnection::matchesPoint(const TQPoint &p, int tolerance) { - QRect we = connectionRect(); + TQRect we = connectionRect(); - if(!we.contains(p)) + if(!we.tqcontains(p)) return false; /** get our coordinats @@ -282,17 +282,17 @@ KexiRelationViewConnection::matchesPoint(const QPoint &p, int tolerance) return false; } -QString +TQString KexiRelationViewConnection::toString() const { - QString str; + TQString str; /*! @todo what about query? */ if (m_masterTable && m_masterTable->schema()->table()) { - str += (QString(m_masterTable->schema()->name()) + "." + m_masterField); + str += (TQString(m_masterTable->schema()->name()) + "." + m_masterField); } if (m_detailsTable && m_detailsTable->schema()->table()) { str += " - "; - str += (QString(m_detailsTable->schema()->name()) + "." + m_detailsField); + str += (TQString(m_detailsTable->schema()->name()) + "." + m_detailsField); } return str; } diff --git a/kexi/widget/relations/kexirelationviewconnection.h b/kexi/widget/relations/kexirelationviewconnection.h index 699fdf4f..7b596210 100644 --- a/kexi/widget/relations/kexirelationviewconnection.h +++ b/kexi/widget/relations/kexirelationviewconnection.h @@ -21,10 +21,10 @@ #ifndef KEXIRELATIONVIEWCONNECTION_H #define KEXIRELATIONVIEWCONNECTION_H -#include <qstring.h> -#include <qguardedptr.h> +#include <tqstring.h> +#include <tqguardedptr.h> -class QPainter; +class TQPainter; class KexiRelationViewTableContainer; class KexiRelationView; @@ -33,7 +33,7 @@ class KEXIRELATIONSVIEW_EXPORT KexiRelationViewConnection public: KexiRelationViewConnection(KexiRelationViewTableContainer *masterTbl, - KexiRelationViewTableContainer *detailsTbl, struct SourceConnection &s, KexiRelationView *parent); + KexiRelationViewTableContainer *detailsTbl, struct SourceConnection &s, KexiRelationView *tqparent); ~KexiRelationViewConnection(); @@ -43,33 +43,33 @@ class KEXIRELATIONSVIEW_EXPORT KexiRelationViewConnection http://www.c-plusplus.de ;) */ - void drawConnection(QPainter *p); + void drawConnection(TQPainter *p); bool selected() { return m_selected; } void setSelected(bool s) { m_selected = s; } - const QRect connectionRect(); - const QRect oldRect() const { return m_oldRect; } + const TQRect connectionRect(); + const TQRect oldRect() const { return m_oldRect; } KexiRelationViewTableContainer *masterTable() { return m_masterTable; } KexiRelationViewTableContainer *detailsTable() { return m_detailsTable; } - QString masterField() const { return m_masterField; } - QString detailsField() const { return m_detailsField; } + TQString masterField() const { return m_masterField; } + TQString detailsField() const { return m_detailsField; } - bool matchesPoint(const QPoint &p, int tolerance=3); + bool matchesPoint(const TQPoint &p, int tolerance=3); // SourceConnection connection() { return m_conn; } - QString toString() const; + TQString toString() const; private: - QGuardedPtr<KexiRelationViewTableContainer> m_masterTable; - QGuardedPtr<KexiRelationViewTableContainer> m_detailsTable; - QString m_masterField; - QString m_detailsField; - QRect m_oldRect; + TQGuardedPtr<KexiRelationViewTableContainer> m_masterTable; + TQGuardedPtr<KexiRelationViewTableContainer> m_detailsTable; + TQString m_masterField; + TQString m_detailsField; + TQRect m_oldRect; bool m_selected; - QGuardedPtr<KexiRelationView> m_parent; + TQGuardedPtr<KexiRelationView> m_parent; }; #endif diff --git a/kexi/widget/relations/kexirelationviewtable.cpp b/kexi/widget/relations/kexirelationviewtable.cpp index 97beaa87..c850d722 100644 --- a/kexi/widget/relations/kexirelationviewtable.cpp +++ b/kexi/widget/relations/kexirelationviewtable.cpp @@ -20,15 +20,15 @@ #include <stdlib.h> -#include <qheader.h> -#include <qlayout.h> -#include <qlabel.h> -#include <qpushbutton.h> -#include <qcursor.h> -#include <qpoint.h> -#include <qapplication.h> -#include <qbitmap.h> -#include <qstyle.h> +#include <tqheader.h> +#include <tqlayout.h> +#include <tqlabel.h> +#include <tqpushbutton.h> +#include <tqcursor.h> +#include <tqpoint.h> +#include <tqapplication.h> +#include <tqbitmap.h> +#include <tqstyle.h> #include <kdebug.h> #include <kiconloader.h> @@ -43,10 +43,10 @@ #include "kexirelationview.h" KexiRelationViewTableContainer::KexiRelationViewTableContainer( - KexiRelationView *parent, KexiDB::TableOrQuerySchema *schema) - : QFrame(parent,"KexiRelationViewTableContainer" ) + KexiRelationView *tqparent, KexiDB::TableOrQuerySchema *schema) + : TQFrame(tqparent,"KexiRelationViewTableContainer" ) // , m_table(t) - , m_parent(parent) + , m_parent(tqparent) // , m_mousePressed(false) { @@ -54,29 +54,29 @@ KexiRelationViewTableContainer::KexiRelationViewTableContainer( //js: resize(100, 150); //setMouseTracking(true); - setFrameStyle( QFrame::WinPanel | QFrame::Raised ); + setFrameStyle( TQFrame::WinPanel | TQFrame::Raised ); - QVBoxLayout *lyr = new QVBoxLayout(this,4,1); //js: using Q*BoxLayout is a good idea + TQVBoxLayout *lyr = new TQVBoxLayout(this,4,1); //js: using Q*BoxLayout is a good idea m_tableHeader = new KexiRelationViewTableContainerHeader(schema->name(), this); m_tableHeader->unsetFocus(); - m_tableHeader->setSizePolicy(QSizePolicy(QSizePolicy::Minimum, QSizePolicy::Fixed)); + m_tableHeader->tqsetSizePolicy(TQSizePolicy(TQSizePolicy::Minimum, TQSizePolicy::Fixed)); lyr->addWidget(m_tableHeader); - connect(m_tableHeader,SIGNAL(moved()),this,SLOT(moved())); - connect(m_tableHeader, SIGNAL(endDrag()), this, SIGNAL(endDrag())); + connect(m_tableHeader,TQT_SIGNAL(moved()),this,TQT_SLOT(moved())); + connect(m_tableHeader, TQT_SIGNAL(endDrag()), this, TQT_SIGNAL(endDrag())); - m_tableView = new KexiRelationViewTable(schema, parent, this, "KexiRelationViewTable"); + m_tableView = new KexiRelationViewTable(schema, tqparent, this, "KexiRelationViewTable"); //m_tableHeader->setFocusProxy( m_tableView ); - m_tableView->setSizePolicy(QSizePolicy(QSizePolicy::Minimum, QSizePolicy::Minimum)); + m_tableView->tqsetSizePolicy(TQSizePolicy(TQSizePolicy::Minimum, TQSizePolicy::Minimum)); - m_tableView->setMaximumSize( m_tableView->sizeHint() ); + m_tableView->setMaximumSize( m_tableView->tqsizeHint() ); -// m_tableView->resize( m_tableView->sizeHint() ); +// m_tableView->resize( m_tableView->tqsizeHint() ); lyr->addWidget(m_tableView, 0); - connect(m_tableView, SIGNAL(tableScrolling()), this, SLOT(moved())); - connect(m_tableView, SIGNAL(contextMenu(KListView*, QListViewItem*, const QPoint&)), - this, SLOT(slotContextMenu(KListView*, QListViewItem*, const QPoint&))); + connect(m_tableView, TQT_SIGNAL(tableScrolling()), this, TQT_SLOT(moved())); + connect(m_tableView, TQT_SIGNAL(contextMenu(KListView*, TQListViewItem*, const TQPoint&)), + this, TQT_SLOT(slotContextMenu(KListView*, TQListViewItem*, const TQPoint&))); } KexiRelationViewTableContainer::~KexiRelationViewTableContainer() @@ -88,7 +88,7 @@ KexiDB::TableOrQuerySchema* KexiRelationViewTableContainer::schema() const return m_tableView->schema(); } -void KexiRelationViewTableContainer::slotContextMenu(KListView *, QListViewItem *, const QPoint &p) +void KexiRelationViewTableContainer::slotContextMenu(KListView *, TQListViewItem *, const TQPoint &p) { // m_parent->executePopup(p); emit contextMenuRequest( p ); @@ -99,24 +99,24 @@ void KexiRelationViewTableContainer::moved() { emit moved(this); } -int KexiRelationViewTableContainer::globalY(const QString &field) +int KexiRelationViewTableContainer::globalY(const TQString &field) { // kdDebug() << "KexiRelationViewTableContainer::globalY()" << endl; -// QPoint o = mapFromGlobal(QPoint(0, (m_tableView->globalY(field))/*+m_parent->contentsY()*/)); +// TQPoint o = mapFromGlobal(TQPoint(0, (m_tableView->globalY(field))/*+m_parent->contentsY()*/)); - QPoint o(0, (m_tableView->globalY(field)) + m_parent->contentsY()); + TQPoint o(0, (m_tableView->globalY(field)) + m_parent->contentsY()); // kdDebug() << "KexiRelationViewTableContainer::globalY() db2" << endl; return m_parent->viewport()->mapFromGlobal(o).y(); } #if 0//js -QSize KexiRelationViewTableContainer::sizeHint() +TQSize KexiRelationViewTableContainer::tqsizeHint() { -#ifdef Q_WS_WIN - QSize s = m_tableView->sizeHint() - + QSize( 2 * 5 , m_tableHeader->height() + 2 * 5 ); +#ifdef TQ_WS_WIN + TQSize s = m_tableView->tqsizeHint() + + TQSize( 2 * 5 , m_tableHeader->height() + 2 * 5 ); #else - QSize s = m_tableView->sizeHint(); + TQSize s = m_tableView->tqsizeHint(); s.setWidth(s.width() + 4); s.setHeight(m_tableHeader->height() + s.height()); #endif @@ -134,13 +134,13 @@ void KexiRelationViewTableContainer::setFocus() } m_tableHeader->setFocus(); m_tableView->setFocus(); -/* QPalette p = qApp->palette(); - p.setColor( QPalette::Active, QColorGroup::Highlight, KGlobalSettings::highlightColor() ); - p.setColor( QPalette::Active, QColorGroup::HighlightedText, KGlobalSettings::highlightedTextColor() ); +/* TQPalette p = tqApp->palette(); + p.setColor( TQPalette::Active, TQColorGroup::Highlight, KGlobalSettings::highlightColor() ); + p.setColor( TQPalette::Active, TQColorGroup::HighlightedText, KGlobalSettings::highlightedTextColor() ); m_tableView->setPalette(p);*/ raise(); - repaint(); + tqrepaint(); emit gotFocus(); } @@ -155,18 +155,18 @@ void KexiRelationViewTableContainer::unsetFocus() m_tableView->clearSelection(); // m_tableView->unsetPalette(); -/* QPalette p = m_tableView->palette(); -// p.setColor( QPalette::Active, QColorGroup::Highlight, KGlobalSettings::highlightColor() ); -// p.setColor( QPalette::Active, QColorGroup::HighlightedText, KGlobalSettings::highlightedTextColor() ); - p.setColor( QPalette::Active, QColorGroup::Highlight, p.color(QPalette::Active, QColorGroup::Background ) ); -// p.setColor( QPalette::Active, QColorGroup::Highlight, gray ); - p.setColor( QPalette::Active, QColorGroup::HighlightedText, p.color(QPalette::Active, QColorGroup::Foreground ) ); -// p.setColor( QPalette::Active, QColorGroup::Highlight, green ); -// p.setColor( QPalette::Active, QColorGroup::HighlightedText, blue ); +/* TQPalette p = m_tableView->palette(); +// p.setColor( TQPalette::Active, TQColorGroup::Highlight, KGlobalSettings::highlightColor() ); +// p.setColor( TQPalette::Active, TQColorGroup::HighlightedText, KGlobalSettings::highlightedTextColor() ); + p.setColor( TQPalette::Active, TQColorGroup::Highlight, p.color(TQPalette::Active, TQColorGroup::Background ) ); +// p.setColor( TQPalette::Active, TQColorGroup::Highlight, gray ); + p.setColor( TQPalette::Active, TQColorGroup::HighlightedText, p.color(TQPalette::Active, TQColorGroup::Foreground ) ); +// p.setColor( TQPalette::Active, TQColorGroup::Highlight, green ); +// p.setColor( TQPalette::Active, TQColorGroup::HighlightedText, blue ); m_tableView->setPalette(p);*/ clearFocus(); - repaint(); + tqrepaint(); } @@ -176,8 +176,8 @@ void KexiRelationViewTableContainer::unsetFocus() //BEGIN KexiRelatoinViewTableContainerHeader KexiRelationViewTableContainerHeader::KexiRelationViewTableContainerHeader( - const QString& text,QWidget *parent) - :QLabel(text,parent),m_dragging(false) + const TQString& text,TQWidget *tqparent) + :TQLabel(text,tqparent),m_dragging(false) { setMargin(1); m_activeBG = KGlobalSettings::activeTitleColor(); @@ -204,17 +204,17 @@ void KexiRelationViewTableContainerHeader::unsetFocus() setPaletteForegroundColor(m_inactiveFG); } -bool KexiRelationViewTableContainerHeader::eventFilter(QObject *, QEvent *ev) +bool KexiRelationViewTableContainerHeader::eventFilter(TQObject *, TQEvent *ev) { - if (ev->type()==QEvent::MouseMove) + if (ev->type()==TQEvent::MouseMove) { - if (m_dragging && static_cast<QMouseEvent*>(ev)->state()==Qt::LeftButton) { + if (m_dragging && TQT_TQMOUSEEVENT(ev)->state()==Qt::LeftButton) { int diffX,diffY; - diffX=static_cast<QMouseEvent*>(ev)->globalPos().x()-m_grabX; - diffY=static_cast<QMouseEvent*>(ev)->globalPos().y()-m_grabY; + diffX=TQT_TQMOUSEEVENT(ev)->globalPos().x()-m_grabX; + diffY=TQT_TQMOUSEEVENT(ev)->globalPos().y()-m_grabY; if ((abs(diffX)>2) || (abs(diffY)>2)) { - QPoint newPos=parentWidget()->pos()+QPoint(diffX,diffY); + TQPoint newPos=tqparentWidget()->pos()+TQPoint(diffX,diffY); //correct the x position if (newPos.x()<0) { m_offsetX+=newPos.x(); @@ -244,9 +244,9 @@ bool KexiRelationViewTableContainerHeader::eventFilter(QObject *, QEvent *ev) } //move and update helpers - parentWidget()->move(newPos); - m_grabX=static_cast<QMouseEvent*>(ev)->globalPos().x(); - m_grabY=static_cast<QMouseEvent*>(ev)->globalPos().y(); + tqparentWidget()->move(newPos); + m_grabX=TQT_TQMOUSEEVENT(ev)->globalPos().x(); + m_grabY=TQT_TQMOUSEEVENT(ev)->globalPos().y(); // kdDebug()<<"HEADER:emitting moved"<<endl; emit moved(); } @@ -256,9 +256,9 @@ bool KexiRelationViewTableContainerHeader::eventFilter(QObject *, QEvent *ev) return false; } -void KexiRelationViewTableContainerHeader::mousePressEvent(QMouseEvent *ev) { +void KexiRelationViewTableContainerHeader::mousePressEvent(TQMouseEvent *ev) { kdDebug()<<"KexiRelationViewTableContainerHeader::Mouse Press Event"<<endl; - parentWidget()->setFocus(); + tqparentWidget()->setFocus(); ev->accept(); if (ev->button()==Qt::LeftButton) { m_dragging=true; @@ -266,20 +266,20 @@ void KexiRelationViewTableContainerHeader::mousePressEvent(QMouseEvent *ev) { m_grabY=ev->globalPos().y(); m_offsetX=0; m_offsetY=0; - setCursor(Qt::SizeAllCursor); + setCursor(TQt::SizeAllCursor); return; } if (ev->button()==Qt::RightButton) { - emit static_cast<KexiRelationViewTableContainer*>(parentWidget()) + emit static_cast<KexiRelationViewTableContainer*>(tqparentWidget()) ->contextMenuRequest(ev->globalPos()); } -// QLabel::mousePressEvent(ev); +// TQLabel::mousePressEvent(ev); } -void KexiRelationViewTableContainerHeader::mouseReleaseEvent(QMouseEvent *ev) { +void KexiRelationViewTableContainerHeader::mouseReleaseEvent(TQMouseEvent *ev) { kdDebug()<<"KexiRelationViewTableContainerHeader::Mouse Release Event"<<endl; if (m_dragging && ev->button() & Qt::LeftButton) { - setCursor(Qt::ArrowCursor); + setCursor(TQt::ArrowCursor); m_dragging=false; emit endDrag(); } @@ -292,37 +292,37 @@ void KexiRelationViewTableContainerHeader::mouseReleaseEvent(QMouseEvent *ev) { //===================================================================================== KexiRelationViewTable::KexiRelationViewTable(KexiDB::TableOrQuerySchema* tableOrQuerySchema, - KexiRelationView *view, QWidget *parent, const char *name) - : KexiFieldListView(parent, name, KexiFieldListView::ShowAsterisk) + KexiRelationView *view, TQWidget *tqparent, const char *name) + : KexiFieldListView(tqparent, name, KexiFieldListView::ShowAsterisk) , m_view(view) { setSchema(tableOrQuerySchema); header()->hide(); - connect(this, SIGNAL(dropped(QDropEvent *, QListViewItem *)), this, SLOT(slotDropped(QDropEvent *))); - connect(this, SIGNAL(contentsMoving(int, int)), this, SLOT(slotContentsMoving(int,int))); + connect(this, TQT_SIGNAL(dropped(TQDropEvent *, TQListViewItem *)), this, TQT_SLOT(slotDropped(TQDropEvent *))); + connect(this, TQT_SIGNAL(contentsMoving(int, int)), this, TQT_SLOT(slotContentsMoving(int,int))); } KexiRelationViewTable::~KexiRelationViewTable() { } -QSize KexiRelationViewTable::sizeHint() const +TQSize KexiRelationViewTable::tqsizeHint() const { - QFontMetrics fm(fontMetrics()); + TQFontMetrics fm(fontMetrics()); // kdDebug() << schema()->name() << " cw=" << columnWidth(0) + fm.width("i") // << ", " << fm.width(schema()->name()+" ") << endl; int maxWidth = -1; const int iconWidth = IconSize(KIcon::Small) + fm.width("i")+20; - for (QListViewItem *item = firstChild(); item; item = item->nextSibling()) - maxWidth = QMAX(maxWidth, iconWidth + fm.width(item->text(0))); + for (TQListViewItem *item = firstChild(); item; item = item->nextSibling()) + maxWidth = TQMAX(maxWidth, iconWidth + fm.width(item->text(0))); - const uint rowCount = QMIN( 8, childCount() ); + const uint rowCount = TQMIN( 8, childCount() ); - QSize s( - QMAX( maxWidth, fm.width(schema()->name()+" ")), + TQSize s( + TQMAX( maxWidth, fm.width(schema()->name()+" ")), rowCount*firstChild()->totalHeight() + 4 ); return s; } @@ -336,58 +336,58 @@ void KexiRelationViewTable::setReadOnly(bool b) #endif int -KexiRelationViewTable::globalY(const QString &item) +KexiRelationViewTable::globalY(const TQString &item) { - QListViewItem *i = findItem(item, 0); + TQListViewItem *i = tqfindItem(item, 0); if (!i) return -1; - int y = itemRect(i).y() + (itemRect(i).height() / 2); + int y = tqitemRect(i).y() + (tqitemRect(i).height() / 2); if (contentsY() > itemPos(i)) y = 0; else if (y == 0) y = height(); - return mapToGlobal(QPoint(0, y)).y(); + return mapToGlobal(TQPoint(0, y)).y(); } bool -KexiRelationViewTable::acceptDrag(QDropEvent *ev) const +KexiRelationViewTable::acceptDrag(TQDropEvent *ev) const { // kdDebug() << "KexiRelationViewTable::acceptDrag()" << endl; - QListViewItem *receiver = itemAt(ev->pos() - QPoint(0,contentsY())); + TQListViewItem *receiver = itemAt(ev->pos() - TQPoint(0,contentsY())); if (!receiver || !KexiFieldDrag::canDecodeSingle(ev)) return false; - QString sourceMimeType; - QString srcTable; - QString srcField; + TQString sourceMimeType; + TQString srcTable; + TQString srcField; if (!KexiFieldDrag::decodeSingle(ev,sourceMimeType,srcTable,srcField)) return false; if (sourceMimeType!="kexi/table" && sourceMimeType=="kexi/query") return false; - QString f = receiver->text(0).stripWhiteSpace(); - if (!srcField.stripWhiteSpace().startsWith("*") && !f.startsWith("*") && ev->source() != (QWidget*)this) + TQString f = receiver->text(0).stripWhiteSpace(); + if (!srcField.stripWhiteSpace().startsWith("*") && !f.startsWith("*") && ev->source() != (TQWidget*)this) return true; return false; } void -KexiRelationViewTable::slotDropped(QDropEvent *ev) +KexiRelationViewTable::slotDropped(TQDropEvent *ev) { - QListViewItem *recever = itemAt(ev->pos() - QPoint(0,contentsY())); + TQListViewItem *recever = itemAt(ev->pos() - TQPoint(0,contentsY())); if (!recever || !KexiFieldDrag::canDecodeSingle(ev)) { ev->ignore(); return; } - QString sourceMimeType; - QString srcTable; - QString srcField; + TQString sourceMimeType; + TQString srcTable; + TQString srcField; if (!KexiFieldDrag::decodeSingle(ev,sourceMimeType,srcTable,srcField)) return; if (sourceMimeType!="kexi/table" && sourceMimeType=="kexi/query") return; // kdDebug() << "KexiRelationViewTable::slotDropped() srcfield: " << srcField << endl; - QString rcvField = recever->text(0); + TQString rcvField = recever->text(0); SourceConnection s; s.masterTable = srcTable; @@ -408,22 +408,22 @@ KexiRelationViewTable::slotContentsMoving(int,int) emit tableScrolling(); } -void KexiRelationViewTable::contentsMousePressEvent(QMouseEvent *ev) +void KexiRelationViewTable::contentsMousePressEvent(TQMouseEvent *ev) { - parentWidget()->setFocus(); + tqparentWidget()->setFocus(); setFocus(); KListView::contentsMousePressEvent(ev); // if (ev->button()==Qt::RightButton) -// static_cast<KexiRelationView*>(parentWidget())->executePopup(ev->pos()); +// static_cast<KexiRelationView*>(tqparentWidget())->executePopup(ev->pos()); } -QRect KexiRelationViewTable::drawItemHighlighter(QPainter *painter, QListViewItem *item) +TQRect KexiRelationViewTable::drawItemHighlighter(TQPainter *painter, TQListViewItem *item) { if (painter) { - style().drawPrimitive(QStyle::PE_FocusRect, painter, itemRect(item), colorGroup(), - QStyle::Style_FocusAtBorder); + tqstyle().tqdrawPrimitive(TQStyle::PE_FocusRect, painter, tqitemRect(item), tqcolorGroup(), + TQStyle::Style_FocusAtBorder); } - return itemRect(item); + return tqitemRect(item); } #include "kexirelationviewtable.moc" diff --git a/kexi/widget/relations/kexirelationviewtable.h b/kexi/widget/relations/kexirelationviewtable.h index cc90e16d..deabc2e0 100644 --- a/kexi/widget/relations/kexirelationviewtable.h +++ b/kexi/widget/relations/kexirelationviewtable.h @@ -21,9 +21,9 @@ #ifndef KEXIRELATIONVIEWTABLE_H #define KEXIRELATIONVIEWTABLE_H -#include <qframe.h> -#include <qstringlist.h> -#include <qlabel.h> +#include <tqframe.h> +#include <tqstringlist.h> +#include <tqlabel.h> #include <klistview.h> #include <widget/kexifieldlistview.h> @@ -37,18 +37,19 @@ namespace KexiDB class TableOrQuerySchema; } -class KEXIRELATIONSVIEW_EXPORT KexiRelationViewTableContainer : public QFrame +class KEXIRELATIONSVIEW_EXPORT KexiRelationViewTableContainer : public TQFrame { Q_OBJECT + TQ_OBJECT public: -// KexiRelationViewTableContainer(KexiRelationView *parent, KexiDB::TableSchema *t); +// KexiRelationViewTableContainer(KexiRelationView *tqparent, KexiDB::TableSchema *t); KexiRelationViewTableContainer( - KexiRelationView *parent, KexiDB::TableOrQuerySchema *schema); + KexiRelationView *tqparent, KexiDB::TableOrQuerySchema *schema); virtual ~KexiRelationViewTableContainer(); - int globalY(const QString &field); + int globalY(const TQString &field); // KexiDB::TableSchema *table(); KexiRelationViewTable* tableView() const { return m_tableView; } @@ -61,7 +62,7 @@ class KEXIRELATIONSVIEW_EXPORT KexiRelationViewTableContainer : public QFrame void moved(KexiRelationViewTableContainer *); void endDrag(); void gotFocus(); - void contextMenuRequest(const QPoint& pos); + void contextMenuRequest(const TQPoint& pos); public slots: virtual void setFocus(); @@ -69,7 +70,7 @@ class KEXIRELATIONSVIEW_EXPORT KexiRelationViewTableContainer : public QFrame protected slots: void moved(); - void slotContextMenu(KListView *lv, QListViewItem *i, const QPoint& p); + void slotContextMenu(KListView *lv, TQListViewItem *i, const TQPoint& p); protected: // KexiDB::TableSchema *m_table; @@ -84,53 +85,55 @@ class KEXIRELATIONSVIEW_EXPORT KexiRelationViewTableContainer : public QFrame class KEXIRELATIONSVIEW_EXPORT KexiRelationViewTableItem : public KListViewItem { public: - KexiRelationViewTableItem(QListView *parent, QListViewItem *after, - QString key, QString field); - virtual void paintFocus ( QPainter * p, const QColorGroup & cg, const QRect & r ); + KexiRelationViewTableItem(TQListView *tqparent, TQListViewItem *after, + TQString key, TQString field); + virtual void paintFocus ( TQPainter * p, const TQColorGroup & cg, const TQRect & r ); };*/ class KEXIRELATIONSVIEW_EXPORT KexiRelationViewTable : public KexiFieldListView { Q_OBJECT + TQ_OBJECT public: KexiRelationViewTable(KexiDB::TableOrQuerySchema* tableOrQuerySchema, - KexiRelationView *view, QWidget *parent, const char *name = 0); -// KexiRelationViewTable(QWidget *parent, KexiRelationView *view, KexiDB::TableSchema *t, const char *name=0); + KexiRelationView *view, TQWidget *tqparent, const char *name = 0); +// KexiRelationViewTable(TQWidget *tqparent, KexiRelationView *view, KexiDB::TableSchema *t, const char *name=0); virtual ~KexiRelationViewTable(); // KexiDB::TableSchema *table() const { return m_table; }; - int globalY(const QString &item); + int globalY(const TQString &item); // void setReadOnly(bool); - virtual QSize sizeHint() const; + virtual TQSize tqsizeHint() const; signals: void tableScrolling(); protected slots: - void slotDropped(QDropEvent *e); + void slotDropped(TQDropEvent *e); void slotContentsMoving(int, int); -// void slotItemDoubleClicked( QListViewItem *i, const QPoint &, int ); +// void slotItemDoubleClicked( TQListViewItem *i, const TQPoint &, int ); protected: - virtual void contentsMousePressEvent( QMouseEvent * e ); - virtual bool acceptDrag(QDropEvent *e) const; -//moved virtual QDragObject *dragObject(); - virtual QRect drawItemHighlighter(QPainter *painter, QListViewItem *item); + virtual void contentsMousePressEvent( TQMouseEvent * e ); + virtual bool acceptDrag(TQDropEvent *e) const; +//moved virtual TQDragObject *dragObject(); + virtual TQRect drawItemHighlighter(TQPainter *painter, TQListViewItem *item); private: -// QStringList m_fieldList; +// TQStringList m_fieldList; // KexiDB::TableSchema *m_table; KexiRelationView *m_view; -// QPixmap m_keyIcon, m_noIcon; +// TQPixmap m_keyIcon, m_noIcon; }; -class KEXIRELATIONSVIEW_EXPORT KexiRelationViewTableContainerHeader : public QLabel +class KEXIRELATIONSVIEW_EXPORT KexiRelationViewTableContainerHeader : public TQLabel { Q_OBJECT + TQ_OBJECT public: - KexiRelationViewTableContainerHeader(const QString& text,QWidget *parent); + KexiRelationViewTableContainerHeader(const TQString& text,TQWidget *tqparent); virtual ~KexiRelationViewTableContainerHeader(); virtual void setFocus(); @@ -141,9 +144,9 @@ class KEXIRELATIONSVIEW_EXPORT KexiRelationViewTableContainerHeader : public QLa void endDrag(); protected: - bool eventFilter(QObject *obj, QEvent *ev); - void mousePressEvent(QMouseEvent *ev); - void mouseReleaseEvent(QMouseEvent *ev); + bool eventFilter(TQObject *obj, TQEvent *ev); + void mousePressEvent(TQMouseEvent *ev); + void mouseReleaseEvent(TQMouseEvent *ev); bool m_dragging; int m_grabX; @@ -151,7 +154,7 @@ class KEXIRELATIONSVIEW_EXPORT KexiRelationViewTableContainerHeader : public QLa int m_offsetX; int m_offsetY; - QColor m_activeBG, m_activeFG, m_inactiveBG, m_inactiveFG; + TQColor m_activeBG, m_activeFG, m_inactiveBG, m_inactiveFG; }; #endif diff --git a/kexi/widget/relations/kexirelationwidget.cpp b/kexi/widget/relations/kexirelationwidget.cpp index 14ec4ce0..7ef5a961 100644 --- a/kexi/widget/relations/kexirelationwidget.cpp +++ b/kexi/widget/relations/kexirelationwidget.cpp @@ -21,10 +21,10 @@ #include "kexirelationwidget.h" -#include <qlayout.h> -#include <qlistbox.h> -#include <qpushbutton.h> -#include <qtimer.h> +#include <tqlayout.h> +#include <tqlistbox.h> +#include <tqpushbutton.h> +#include <tqtimer.h> #include <kcombobox.h> #include <klocale.h> @@ -41,31 +41,31 @@ #include "kexirelationviewtable.h" #include "kexirelationviewconnection.h" -KexiRelationWidget::KexiRelationWidget(KexiMainWindow *win, QWidget *parent, +KexiRelationWidget::KexiRelationWidget(KexiMainWindow *win, TQWidget *tqparent, const char *name) - : KexiViewBase(win, parent, name) + : KexiViewBase(win, tqparent, name) , m_win(win) { m_conn = m_win->project()->dbConnection(); - QHBoxLayout *hlyr = new QHBoxLayout(0); - QGridLayout *g = new QGridLayout(this); + TQHBoxLayout *hlyr = new TQHBoxLayout(0); + TQGridLayout *g = new TQGridLayout(this); g->addLayout( hlyr, 0, 0 ); m_tableCombo = new KComboBox(this, "tables_combo"); - m_tableCombo->setMinimumWidth(QFontMetrics(font()).width("w")*20); - QLabel *lbl = new QLabel(m_tableCombo, i18n("Table")+": ", this); + m_tableCombo->setMinimumWidth(TQFontMetrics(font()).width("w")*20); + TQLabel *lbl = new TQLabel(m_tableCombo, i18n("Table")+": ", this); lbl->setIndent(3); - m_tableCombo->setInsertionPolicy(QComboBox::NoInsertion); + m_tableCombo->setInsertionPolicy(TQComboBox::NoInsertion); hlyr->addWidget(lbl); hlyr->addWidget(m_tableCombo); - m_tableCombo->setSizePolicy(QSizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::Preferred)); + m_tableCombo->tqsetSizePolicy(TQSizePolicy(TQSizePolicy::MinimumExpanding, TQSizePolicy::Preferred)); fillTablesCombo(); m_btnAdd = new KPushButton(i18n("&Add"), this); hlyr->addWidget(m_btnAdd); hlyr->addStretch(1); - connect(m_btnAdd, SIGNAL(clicked()), this, SLOT(slotAddTable())); + connect(m_btnAdd, TQT_SIGNAL(clicked()), TQT_TQOBJECT(this), TQT_SLOT(slotAddTable())); m_relationView = new KexiRelationView(this, "relation_view"); setViewWidget(m_relationView); @@ -75,50 +75,50 @@ KexiRelationWidget::KexiRelationWidget(KexiMainWindow *win, QWidget *parent, //actions m_tableQueryPopup = new KPopupMenu(this, "m_popup"); m_tableQueryPopupTitleID = m_tableQueryPopup->insertTitle(SmallIcon("table"), ""); - connect(m_tableQueryPopup, SIGNAL(aboutToShow()), this, SLOT(aboutToShowPopupMenu())); + connect(m_tableQueryPopup, TQT_SIGNAL(aboutToShow()), TQT_TQOBJECT(this), TQT_SLOT(aboutToShowPopupMenu())); m_connectionPopup = new KPopupMenu(this, "m_connectionPopup"); m_connectionPopupTitleID = m_connectionPopup->insertTitle(""); - connect(m_connectionPopup, SIGNAL(aboutToShow()), this, SLOT(aboutToShowPopupMenu())); + connect(m_connectionPopup, TQT_SIGNAL(aboutToShow()), TQT_TQOBJECT(this), TQT_SLOT(aboutToShowPopupMenu())); m_areaPopup = new KPopupMenu(this, "m_areaPopup"); m_openSelectedTableAction = new KAction(i18n("&Open Table"), SmallIcon("fileopen"), KShortcut(), - this, SLOT(openSelectedTable()), this, "relationsview_openTable"); + TQT_TQOBJECT(this), TQT_SLOT(openSelectedTable()), TQT_TQOBJECT(this), "relationsview_openTable"); m_openSelectedTableAction->plug( m_tableQueryPopup ); m_designSelectedTableAction = new KAction(i18n("&Design Table"), SmallIcon("edit"), KShortcut(), - this, SLOT(designSelectedTable()), this, "relationsview_designTable"); + TQT_TQOBJECT(this), TQT_SLOT(designSelectedTable()), TQT_TQOBJECT(this), "relationsview_designTable"); m_designSelectedTableAction->plug( m_tableQueryPopup ); m_tableQueryPopup->insertSeparator(); KAction* hide_action = plugSharedAction("edit_delete", i18n("&Hide Table"), m_tableQueryPopup); - hide_action->setIconSet(QIconSet()); + hide_action->setIconSet(TQIconSet()); plugSharedAction("edit_delete",m_connectionPopup); - plugSharedAction("edit_delete",this, SLOT(removeSelectedObject())); - - connect(m_relationView, SIGNAL(tableViewGotFocus()), - this, SLOT(tableViewGotFocus())); - connect(m_relationView, SIGNAL(connectionViewGotFocus()), - this, SLOT(connectionViewGotFocus())); - connect(m_relationView, SIGNAL(emptyAreaGotFocus()), - this, SLOT(emptyAreaGotFocus())); - connect(m_relationView, SIGNAL(tableContextMenuRequest( const QPoint& )), - this, SLOT(tableContextMenuRequest( const QPoint& ))); - connect(m_relationView, SIGNAL(connectionContextMenuRequest( const QPoint& )), - this, SLOT(connectionContextMenuRequest( const QPoint& ))); - connect(m_relationView, SIGNAL(tableHidden(KexiDB::TableSchema&)), - this, SLOT(slotTableHidden(KexiDB::TableSchema&))); - connect(m_relationView, SIGNAL(tablePositionChanged(KexiRelationViewTableContainer*)), - this, SIGNAL(tablePositionChanged(KexiRelationViewTableContainer*))); - connect(m_relationView, SIGNAL(aboutConnectionRemove(KexiRelationViewConnection*)), - this, SIGNAL(aboutConnectionRemove(KexiRelationViewConnection*))); + plugSharedAction("edit_delete",TQT_TQOBJECT(this), TQT_SLOT(removeSelectedObject())); + + connect(m_relationView, TQT_SIGNAL(tableViewGotFocus()), + TQT_TQOBJECT(this), TQT_SLOT(tableViewGotFocus())); + connect(m_relationView, TQT_SIGNAL(connectionViewGotFocus()), + TQT_TQOBJECT(this), TQT_SLOT(connectionViewGotFocus())); + connect(m_relationView, TQT_SIGNAL(emptyAreaGotFocus()), + TQT_TQOBJECT(this), TQT_SLOT(emptyAreaGotFocus())); + connect(m_relationView, TQT_SIGNAL(tableContextMenuRequest( const TQPoint& )), + TQT_TQOBJECT(this), TQT_SLOT(tableContextMenuRequest( const TQPoint& ))); + connect(m_relationView, TQT_SIGNAL(connectionContextMenuRequest( const TQPoint& )), + TQT_TQOBJECT(this), TQT_SLOT(connectionContextMenuRequest( const TQPoint& ))); + connect(m_relationView, TQT_SIGNAL(tableHidden(KexiDB::TableSchema&)), + TQT_TQOBJECT(this), TQT_SLOT(slotTableHidden(KexiDB::TableSchema&))); + connect(m_relationView, TQT_SIGNAL(tablePositionChanged(KexiRelationViewTableContainer*)), + TQT_TQOBJECT(this), TQT_SIGNAL(tablePositionChanged(KexiRelationViewTableContainer*))); + connect(m_relationView, TQT_SIGNAL(aboutConnectionRemove(KexiRelationViewConnection*)), + TQT_TQOBJECT(this), TQT_SIGNAL(aboutConnectionRemove(KexiRelationViewConnection*))); #if 0 if(!embedd) { /*todo setContextHelp(i18n("Relations"), i18n("To create a relationship simply drag the source field onto the target field. " - "An arrowhead is used to show which table is the parent (master) and which table is the child (slave) in the relationship."));*/ + "An arrowhead is used to show which table is the tqparent (master) and which table is the child (slave) in the relationship."));*/ } #endif // else @@ -126,10 +126,10 @@ KexiRelationWidget::KexiRelationWidget(KexiMainWindow *win, QWidget *parent, #ifdef TESTING_KexiRelationWidget for (int i=0;i<(int)m_db->tableNames().count();i++) - QTimer::singleShot(100,this,SLOT(slotAddTable())); + TQTimer::singleShot(100,this,TQT_SLOT(slotAddTable())); #endif - invalidateActions(); + tqinvalidateActions(); } KexiRelationWidget::~KexiRelationWidget() @@ -141,9 +141,9 @@ TablesDict* KexiRelationWidget::tables() const return m_relationView->tables(); } -KexiRelationViewTableContainer* KexiRelationWidget::table(const QString& name) const +KexiRelationViewTableContainer* KexiRelationWidget::table(const TQString& name) const { - return m_relationView->tables()->find( name ); + return m_relationView->tables()->tqfind( name ); } const ConnectionList* KexiRelationWidget::connections() const @@ -156,13 +156,13 @@ KexiRelationWidget::slotAddTable() { if (m_tableCombo->currentItem()==-1) return; - QString tname = m_tableCombo->text(m_tableCombo->currentItem()); + TQString tname = m_tableCombo->text(m_tableCombo->currentItem()); KexiDB::TableSchema *t = m_conn->tableSchema(tname); addTable(t); } void -KexiRelationWidget::addTable(KexiDB::TableSchema *t, const QRect &rect) +KexiRelationWidget::addTable(KexiDB::TableSchema *t, const TQRect &rect) { if (!t) return; @@ -171,11 +171,11 @@ KexiRelationWidget::addTable(KexiDB::TableSchema *t, const QRect &rect) kdDebug() << "KexiRelationWidget::slotAddTable(): adding table " << t->name() << endl; if (!c) return; - connect(c->tableView(), SIGNAL(doubleClicked(QListViewItem*,const QPoint&,int)), - this, SLOT(slotTableFieldDoubleClicked(QListViewItem*,const QPoint&,int))); + connect(c->tableView(), TQT_SIGNAL(doubleClicked(TQListViewItem*,const TQPoint&,int)), + TQT_TQOBJECT(this), TQT_SLOT(slotTableFieldDoubleClicked(TQListViewItem*,const TQPoint&,int))); } - const QString tname = t->name().lower(); + const TQString tname = t->name().lower(); const int count = m_tableCombo->count(); int i = 0; for (; i < count; i++ ) { @@ -207,7 +207,7 @@ KexiRelationWidget::addConnection(const SourceConnection& conn) } void -KexiRelationWidget::addTable(const QString& t) +KexiRelationWidget::addTable(const TQString& t) { for(int i=0; i < m_tableCombo->count(); i++) { @@ -221,53 +221,53 @@ KexiRelationWidget::addTable(const QString& t) void KexiRelationWidget::tableViewGotFocus() { -// if (m_relationView->focusedTableView == sender()) +// if (m_relationView->focusedTableView == TQT_TQOBJECT(const_cast<TQT_BASE_OBJECT_NAME*>(sender()))) // return; // kdDebug() << "GOT FOCUS!" <<endl; // clearSelection(); // if (m_focusedTableView) // m_focusedTableView->unsetFocus(); -// m_focusedTableView = (KexiRelationViewTableContainer*)sender(); - invalidateActions(); +// m_focusedTableView = (KexiRelationViewTableContainer*)TQT_TQOBJECT(const_cast<TQT_BASE_OBJECT_NAME*>(sender())); + tqinvalidateActions(); } void KexiRelationWidget::connectionViewGotFocus() { - invalidateActions(); + tqinvalidateActions(); } void KexiRelationWidget::emptyAreaGotFocus() { - invalidateActions(); + tqinvalidateActions(); } -void KexiRelationWidget::tableContextMenuRequest(const QPoint& pos) +void KexiRelationWidget::tableContextMenuRequest(const TQPoint& pos) { - invalidateActions(); + tqinvalidateActions(); executePopup( pos ); } -void KexiRelationWidget::connectionContextMenuRequest(const QPoint& pos) +void KexiRelationWidget::connectionContextMenuRequest(const TQPoint& pos) { - invalidateActions(); + tqinvalidateActions(); executePopup( pos ); // m_connectionPopup->exec(pos); } -void KexiRelationWidget::emptyAreaContextMenuRequest( const QPoint& /*pos*/ ) +void KexiRelationWidget::emptyAreaContextMenuRequest( const TQPoint& /*pos*/ ) { - invalidateActions(); + tqinvalidateActions(); //TODO } -void KexiRelationWidget::invalidateActions() +void KexiRelationWidget::tqinvalidateActions() { setAvailable("edit_delete", m_relationView->selectedConnection() || m_relationView->focusedTableView()); } -void KexiRelationWidget::executePopup( QPoint pos ) +void KexiRelationWidget::executePopup( TQPoint pos ) { - if (pos==QPoint(-1,-1)) { + if (pos==TQPoint(-1,-1)) { pos = mapToGlobal( m_relationView->focusedTableView() ? m_relationView->focusedTableView()->pos() + m_relationView->focusedTableView()->rect().center() : rect().center() ); } @@ -302,14 +302,14 @@ void KexiRelationWidget::designSelectedTable() Kexi::DesignViewMode, openingCancelled); } -QSize KexiRelationWidget::sizeHint() const +TQSize KexiRelationWidget::tqsizeHint() const { - return m_relationView->sizeHint(); + return m_relationView->tqsizeHint(); } void KexiRelationWidget::slotTableHidden(KexiDB::TableSchema &table) { - const QString &t = table.name().lower(); + const TQString &t = table.name().lower(); int i; for (i=0; i<m_tableCombo->count() && t > m_tableCombo->text(i).lower(); i++) ; @@ -328,7 +328,7 @@ void KexiRelationWidget::aboutToShowPopupMenu() /*! @todo what about query? */ if (m_relationView->focusedTableView() && m_relationView->focusedTableView()->schema()->table()) { m_tableQueryPopup->changeTitle(m_tableQueryPopupTitleID, SmallIcon("table"), - QString(m_relationView->focusedTableView()->schema()->name()) + " : " + i18n("Table")); + TQString(m_relationView->focusedTableView()->schema()->name()) + " : " + i18n("Table")); } else if (m_relationView->selectedConnection()) { m_connectionPopup->changeTitle( m_connectionPopupTitleID, @@ -337,12 +337,12 @@ void KexiRelationWidget::aboutToShowPopupMenu() } void -KexiRelationWidget::slotTableFieldDoubleClicked(QListViewItem *i,const QPoint&,int) +KexiRelationWidget::slotTableFieldDoubleClicked(TQListViewItem *i,const TQPoint&,int) { - if (!sender()->isA("KexiRelationViewTable")) + if (!TQT_TQOBJECT(const_cast<TQT_BASE_OBJECT_NAME*>(sender()))->isA("KexiRelationViewTable")) return; - const KexiRelationViewTable* t = static_cast<const KexiRelationViewTable*>(sender()); - const QStringList selectedFieldNames( t->selectedFieldNames() ); + const KexiRelationViewTable* t = static_cast<const KexiRelationViewTable*>(TQT_TQWIDGET(const_cast<TQT_BASE_OBJECT_NAME*>(sender()))); + const TQStringList selectedFieldNames( t->selectedFieldNames() ); if (selectedFieldNames.count()==1) emit tableFieldDoubleClicked( t->schema()->table(), selectedFieldNames.first() ); } @@ -364,26 +364,26 @@ void KexiRelationWidget::fillTablesCombo() { m_tableCombo->clear(); - QStringList tmp = m_conn->tableNames(); + TQStringList tmp = m_conn->tableNames(); tmp.sort(); m_tableCombo->insertStringList(tmp); } void -KexiRelationWidget::objectCreated(const QCString &mime, const QCString& name) +KexiRelationWidget::objectCreated(const TQCString &mime, const TQCString& name) { if (mime=="kexi/table" || mime=="kexi/query") { //! @todo query? - m_tableCombo->insertItem(QString(name)); + m_tableCombo->insertItem(TQString(name)); m_tableCombo->listBox()->sort(); } } void -KexiRelationWidget::objectDeleted(const QCString &mime, const QCString& name) +KexiRelationWidget::objectDeleted(const TQCString &mime, const TQCString& name) { if (mime=="kexi/table" || mime=="kexi/query") { - QString strName(name); + TQString strName(name); for (int i=0; i<m_tableCombo->count(); i++) { //! @todo query? if (m_tableCombo->text(i)==strName) { @@ -401,14 +401,14 @@ KexiRelationWidget::objectDeleted(const QCString &mime, const QCString& name) } void -KexiRelationWidget::objectRenamed(const QCString &mime, const QCString& name, const QCString& newName) +KexiRelationWidget::objectRenamed(const TQCString &mime, const TQCString& name, const TQCString& newName) { if (mime=="kexi/table" || mime=="kexi/query") { - QString strName(name); + TQString strName(name); for (int i=0; i<m_tableCombo->count(); i++) { //! @todo query? if (m_tableCombo->text(i)==strName) { - m_tableCombo->changeItem(QString(newName), i); + m_tableCombo->changeItem(TQString(newName), i); m_tableCombo->listBox()->sort(); break; } diff --git a/kexi/widget/relations/kexirelationwidget.h b/kexi/widget/relations/kexirelationwidget.h index 3beb0b34..869dbf11 100644 --- a/kexi/widget/relations/kexirelationwidget.h +++ b/kexi/widget/relations/kexirelationwidget.h @@ -21,7 +21,7 @@ #ifndef KEXIRELATIONWIDGET_H #define KEXIRELATIONWIDGET_H -//#include <qwidget.h> +//#include <tqwidget.h> //#include "kexiactionproxy.h" #include "kexiviewbase.h" #include "kexirelationview.h" @@ -30,7 +30,7 @@ class KComboBox; class KPushButton; class KPopupMenu; class KAction; -class QListViewItem; +class TQListViewItem; class KexiMainWindow; @@ -44,40 +44,41 @@ namespace KexiDB class KEXIRELATIONSVIEW_EXPORT KexiRelationWidget : public KexiViewBase { Q_OBJECT + TQ_OBJECT public: - KexiRelationWidget(KexiMainWindow *win, QWidget *parent, const char *name=0); + KexiRelationWidget(KexiMainWindow *win, TQWidget *tqparent, const char *name=0); virtual ~KexiRelationWidget(); //! \return a dictionary of added tables TablesDict* tables() const; - KexiRelationViewTableContainer* table(const QString& name) const; + KexiRelationViewTableContainer* table(const TQString& name) const; const ConnectionList* connections() const; // KexiRelationView *relationView() const { return m_relationView; } - void addTable(const QString& t); + void addTable(const TQString& t); // void openTable(KexiDB::TableSchema* table, bool designMode); - virtual QSize sizeHint() const; + virtual TQSize tqsizeHint() const; /*! Used to add newly created object information to the combo box. */ - void objectCreated(const QCString &mime, const QCString& name); - void objectDeleted(const QCString &mime, const QCString& name); - void objectRenamed(const QCString &mime, const QCString& name, const QCString& newName); + void objectCreated(const TQCString &mime, const TQCString& name); + void objectDeleted(const TQCString &mime, const TQCString& name); + void objectRenamed(const TQCString &mime, const TQCString& name, const TQCString& newName); signals: void tableAdded(KexiDB::TableSchema& t); void tableHidden(KexiDB::TableSchema& t); void tablePositionChanged(KexiRelationViewTableContainer*); void aboutConnectionRemove(KexiRelationViewConnection*); - void tableFieldDoubleClicked( KexiDB::TableSchema* table, const QString& fieldName ); + void tableFieldDoubleClicked( KexiDB::TableSchema* table, const TQString& fieldName ); public slots: /*! Adds a table \a t to the area. This changes only visual representation. - If \a rect is valid, table widget rgeometry will be initialized. + If \a rect is valid, table widget rtqgeometry will be initialized. */ - void addTable(KexiDB::TableSchema *t, const QRect &rect = QRect()); + void addTable(KexiDB::TableSchema *t, const TQRect &rect = TQRect()); //! Adds a connection \a con to the area. This changes only visual representation. void addConnection(const SourceConnection& conn); @@ -98,23 +99,23 @@ class KEXIRELATIONSVIEW_EXPORT KexiRelationWidget : public KexiViewBase void tableViewGotFocus(); void connectionViewGotFocus(); void emptyAreaGotFocus(); - void tableContextMenuRequest(const QPoint& pos); - void connectionContextMenuRequest(const QPoint& pos); - void emptyAreaContextMenuRequest( const QPoint& pos ); + void tableContextMenuRequest(const TQPoint& pos); + void connectionContextMenuRequest(const TQPoint& pos); + void emptyAreaContextMenuRequest( const TQPoint& pos ); void openSelectedTable(); void designSelectedTable(); void slotTableHidden(KexiDB::TableSchema &table); void aboutToShowPopupMenu(); - void slotTableFieldDoubleClicked(QListViewItem *i,const QPoint&,int); + void slotTableFieldDoubleClicked(TQListViewItem *i,const TQPoint&,int); protected: /*! executes popup menu at \a pos, or, if \a pos not specified: at center of selected table view (if any selected), or at center point of the relations view. */ - void executePopup( QPoint pos = QPoint(-1,-1) ); + void executePopup( TQPoint pos = TQPoint(-1,-1) ); //! Invalidates all actions availability. - void invalidateActions(); + void tqinvalidateActions(); //! Fills table's combo box with all available table names. void fillTablesCombo(); diff --git a/kexi/widget/tableview/kexiblobtableedit.cpp b/kexi/widget/tableview/kexiblobtableedit.cpp index db0799a4..0d19981a 100644 --- a/kexi/widget/tableview/kexiblobtableedit.cpp +++ b/kexi/widget/tableview/kexiblobtableedit.cpp @@ -22,20 +22,20 @@ #include <stdlib.h> -#include <qdatastream.h> -#include <qfile.h> -#include <qpopupmenu.h> -#include <qtextedit.h> -#include <qlayout.h> -#include <qstatusbar.h> -#include <qlabel.h> -#include <qpixmap.h> -#include <qimage.h> -#include <qpainter.h> -#include <qtooltip.h> -#include <qapplication.h> -#include <qclipboard.h> -#include <qbuffer.h> +#include <tqdatastream.h> +#include <tqfile.h> +#include <tqpopupmenu.h> +#include <tqtextedit.h> +#include <tqlayout.h> +#include <tqstatusbar.h> +#include <tqlabel.h> +#include <tqpixmap.h> +#include <tqimage.h> +#include <tqpainter.h> +#include <tqtooltip.h> +#include <tqapplication.h> +#include <tqclipboard.h> +#include <tqbuffer.h> #include <kdebug.h> #include <ktempfile.h> @@ -70,9 +70,9 @@ public: { } - QByteArray value; + TQByteArray value; KexiDropDownButton *button; - QSize totalSize; + TQSize totalSize; KexiImageContextMenu *popup; bool readOnly : 1; //!< cached for slotUpdateActionsAvailabilityRequested() bool setValueInternalEnabled : 1; //!< used to disable KexiBlobTableEdit::setValueInternal() @@ -80,17 +80,17 @@ public: //====================================================== -KexiBlobTableEdit::KexiBlobTableEdit(KexiTableViewColumn &column, QWidget *parent) - : KexiTableEdit(column, parent) +KexiBlobTableEdit::KexiBlobTableEdit(KexiTableViewColumn &column, TQWidget *tqparent) + : KexiTableEdit(column, tqparent) , d ( new Private() ) { setName("KexiBlobTableEdit"); // m_proc = 0; // m_content = 0; m_hasFocusableWidget = false; - d->button = new KexiDropDownButton( parentWidget() /*usually a viewport*/ ); + d->button = new KexiDropDownButton( tqparentWidget() /*usually a viewport*/ ); d->button->hide(); - QToolTip::add(d->button, i18n("Click to show available actions for this cell")); + TQToolTip::add(d->button, i18n("Click to show available actions for this cell")); d->popup = new KexiImageContextMenu(this); d->popup->installEventFilter(this); @@ -101,25 +101,25 @@ KexiBlobTableEdit::KexiBlobTableEdit(KexiTableViewColumn &column, QWidget *paren d->button->setPopup( d->popup ); //force edit requested to start editing... (this will call slotUpdateActionsAvailabilityRequested()) - //connect(d->popup, SIGNAL(aboutToShow()), this, SIGNAL(editRequested())); - - connect(d->popup, SIGNAL(updateActionsAvailabilityRequested(bool&, bool&)), - this, SLOT(slotUpdateActionsAvailabilityRequested(bool&, bool&))); - - connect(d->popup, SIGNAL(insertFromFileRequested(const KURL&)), - this, SLOT(handleInsertFromFileAction(const KURL&))); - connect(d->popup, SIGNAL(saveAsRequested(const QString&)), - this, SLOT(handleSaveAsAction(const QString&))); - connect(d->popup, SIGNAL(cutRequested()), - this, SLOT(handleCutAction())); - connect(d->popup, SIGNAL(copyRequested()), - this, SLOT(handleCopyAction())); - connect(d->popup, SIGNAL(pasteRequested()), - this, SLOT(handlePasteAction())); - connect(d->popup, SIGNAL(clearRequested()), - this, SLOT(clear())); - connect(d->popup, SIGNAL(showPropertiesRequested()), - this, SLOT(handleShowPropertiesAction())); + //connect(d->popup, TQT_SIGNAL(aboutToShow()), this, TQT_SIGNAL(editRequested())); + + connect(d->popup, TQT_SIGNAL(updateActionsAvailabilityRequested(bool&, bool&)), + this, TQT_SLOT(slotUpdateActionsAvailabilityRequested(bool&, bool&))); + + connect(d->popup, TQT_SIGNAL(insertFromFileRequested(const KURL&)), + this, TQT_SLOT(handleInsertFromFileAction(const KURL&))); + connect(d->popup, TQT_SIGNAL(saveAsRequested(const TQString&)), + this, TQT_SLOT(handleSaveAsAction(const TQString&))); + connect(d->popup, TQT_SIGNAL(cutRequested()), + this, TQT_SLOT(handleCutAction())); + connect(d->popup, TQT_SIGNAL(copyRequested()), + this, TQT_SLOT(handleCopyAction())); + connect(d->popup, TQT_SIGNAL(pasteRequested()), + this, TQT_SLOT(handlePasteAction())); + connect(d->popup, TQT_SIGNAL(clearRequested()), + this, TQT_SLOT(clear())); + connect(d->popup, TQT_SIGNAL(showPropertiesRequested()), + this, TQT_SLOT(handleShowPropertiesAction())); } KexiBlobTableEdit::~KexiBlobTableEdit() @@ -138,17 +138,17 @@ KexiBlobTableEdit::~KexiBlobTableEdit() } //! initializes this editor with \a add value -void KexiBlobTableEdit::setValueInternal(const QVariant& add, bool removeOld) +void KexiBlobTableEdit::setValueInternal(const TQVariant& add, bool removeOld) { if (!d->setValueInternalEnabled) return; if (removeOld) d->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 d->value = m_origValue.toByteArray(); #if 0 //todo? - QByteArray val = m_origValue.toByteArray(); + TQByteArray val = m_origValue.toByteArray(); kdDebug() << "KexiBlobTableEdit: Size of BLOB: " << val.size() << endl; m_tempFile = new KTempFile(); m_tempFile->setAutoDelete(true); @@ -161,7 +161,7 @@ void KexiBlobTableEdit::setValueInternal(const QVariant& add, bool removeOld) KMimeMagicResult* mmr = KMimeMagic::self()->findFileType(m_tempFile->name()); kdDebug() << "KexiBlobTableEdit: Mimetype = " << mmr->mimeType() << endl; - setViewWidget( new QWidget(this) ); + setViewWidget( new TQWidget(this) ); #endif } @@ -178,7 +178,7 @@ bool KexiBlobTableEdit::valueIsEmpty() return d->value.isEmpty(); } -QVariant +TQVariant KexiBlobTableEdit::value() { return d->value; @@ -188,23 +188,23 @@ KexiBlobTableEdit::value() if(m_content && m_content->isModified()) { - return QVariant(m_content->text()); + return TQVariant(m_content->text()); } - QByteArray value; - QFile f( m_tempFile->name() ); + TQByteArray value; + TQFile f( m_tempFile->name() ); f.open(IO_ReadOnly); - QDataStream stream(&f); + TQDataStream stream(&f); char* data = (char*) malloc(f.size()); value.resize(f.size()); stream.readRawBytes(data, f.size()); value.duplicate(data, f.size()); free(data); kdDebug() << "KexiBlobTableEdit: Size of BLOB: " << value.size() << endl; - return QVariant(value); + return TQVariant(value); #endif } -void KexiBlobTableEdit::paintFocusBorders( QPainter *p, QVariant &, int x, int y, int w, int h ) +void KexiBlobTableEdit::paintFocusBorders( TQPainter *p, TQVariant &, int x, int y, int w, int h ) { // d->currentEditorWidth = w; if (!d->readOnly && w > d->button->width()) @@ -213,21 +213,21 @@ void KexiBlobTableEdit::paintFocusBorders( QPainter *p, QVariant &, int x, int y } void -KexiBlobTableEdit::setupContents( QPainter *p, bool focused, const QVariant& val, - QString &txt, int &align, int &x, int &y_offset, int &w, int &h ) +KexiBlobTableEdit::setupContents( TQPainter *p, bool focused, const TQVariant& val, + TQString &txt, int &align, int &x, int &y_offset, int &w, int &h ) { Q_UNUSED(focused); Q_UNUSED(txt); Q_UNUSED(align); //! @todo optimize: load to m_pixmap, downsize - QPixmap pixmap; + TQPixmap pixmap; x = 0; w -= 1; //a place for border h -= 1; //a place for border - if (p && val.canCast(QVariant::ByteArray) && pixmap.loadFromData(val.toByteArray())) { - KexiUtils::drawPixmap( *p, 0/*lineWidth*/, QRect(x, y_offset, w, h), - pixmap, Qt::AlignCenter, true/*scaledContents*/, true/*keepAspectRatio*/); + if (p && val.canCast(TQVariant::ByteArray) && pixmap.loadFromData(val.toByteArray())) { + KexiUtils::drawPixmap( *p, 0/*lineWidth*/, TQRect(x, y_offset, w, h), + pixmap, TQt::AlignCenter, true/*scaledContents*/, true/*keepAspectRatio*/); } } @@ -246,15 +246,15 @@ void KexiBlobTableEdit::handleInsertFromFileAction(const KURL& url) if (isReadOnly()) return; - 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(); @@ -267,7 +267,7 @@ void KexiBlobTableEdit::handleInsertFromFileAction(const KURL& url) //emit acceptRequested(); } -void KexiBlobTableEdit::handleAboutToSaveAsAction(QString& origFilename, QString& fileExtension, bool& dataIsEmpty) +void KexiBlobTableEdit::handleAboutToSaveAsAction(TQString& origFilename, TQString& fileExtension, bool& dataIsEmpty) { Q_UNUSED(origFilename); Q_UNUSED(fileExtension); @@ -275,9 +275,9 @@ void KexiBlobTableEdit::handleAboutToSaveAsAction(QString& origFilename, QString //! @todo no fname stored for now } -void KexiBlobTableEdit::handleSaveAsAction(const QString& fileName) +void KexiBlobTableEdit::handleSaveAsAction(const TQString& fileName) { - QFile f(fileName); + TQFile f(fileName); if (!f.open(IO_WriteOnly)) { //! @todo err msg return; @@ -304,39 +304,39 @@ void KexiBlobTableEdit::handleCopyAction() executeCopyAction(d->value); } -void KexiBlobTableEdit::executeCopyAction(const QByteArray& data) +void KexiBlobTableEdit::executeCopyAction(const TQByteArray& data) { - QPixmap pixmap; + TQPixmap pixmap; if (!pixmap.loadFromData(data)) return; - qApp->clipboard()->setPixmap(pixmap, QClipboard::Clipboard); + tqApp->tqclipboard()->setPixmap(pixmap, TQClipboard::Clipboard); } void KexiBlobTableEdit::handlePasteAction() { if (isReadOnly()) return; - QPixmap pm( qApp->clipboard()->pixmap(QClipboard::Clipboard) ); - QByteArray ba; - QBuffer buffer( ba ); + TQPixmap pm( tqApp->tqclipboard()->pixmap(TQClipboard::Clipboard) ); + TQByteArray ba; + TQBuffer buffer( ba ); buffer.open( IO_WriteOnly ); if (pm.save( &buffer, "PNG" )) {// write pixmap into ba in PNG format setValueInternal( ba, true ); } else { - setValueInternal( QByteArray(), true ); + setValueInternal( TQByteArray(), true ); } signalEditRequested(); //emit acceptRequested(); - repaintRelatedCell(); + tqrepaintRelatedCell(); } void KexiBlobTableEdit::clear() { - setValueInternal( QByteArray(), true ); + setValueInternal( TQByteArray(), true ); signalEditRequested(); //emit acceptRequested(); - repaintRelatedCell(); + tqrepaintRelatedCell(); } void KexiBlobTableEdit::handleShowPropertiesAction() @@ -344,7 +344,7 @@ void KexiBlobTableEdit::handleShowPropertiesAction() //! @todo } -void KexiBlobTableEdit::showFocus( const QRect& r, bool readOnly ) +void KexiBlobTableEdit::showFocus( const TQRect& r, bool readOnly ) { d->readOnly = readOnly; //cache for slotUpdateActionsAvailabilityRequested() // d->button->move( pos().x()+ width(), pos().y() ); @@ -358,13 +358,13 @@ void KexiBlobTableEdit::showFocus( const QRect& r, bool readOnly ) void KexiBlobTableEdit::resize(int w, int h) { - d->totalSize = QSize(w,h); + d->totalSize = TQSize(w,h); const int addWidth = d->readOnly ? 0 : d->button->width(); - QWidget::resize(w - addWidth, h); + TQWidget::resize(w - addWidth, h); if (!d->readOnly) d->button->resize( h, h ); m_rightMarginWhenFocused = m_rightMargin + addWidth; - QRect r( pos().x(), pos().y(), w+1, h+1 ); + TQRect r( pos().x(), pos().y(), w+1, h+1 ); r.moveBy(m_scrollView->contentsX(),m_scrollView->contentsY()); updateFocus( r ); //todo if (d->popup) { @@ -372,7 +372,7 @@ void KexiBlobTableEdit::resize(int w, int h) //todo } } -void KexiBlobTableEdit::updateFocus( const QRect& r ) +void KexiBlobTableEdit::updateFocus( const TQRect& r ) { if (!d->readOnly) { if (d->button->width() > r.width()) @@ -387,7 +387,7 @@ void KexiBlobTableEdit::hideFocus() d->button->hide(); } -QSize KexiBlobTableEdit::totalSize() const +TQSize KexiBlobTableEdit::totalSize() const { return d->totalSize; } @@ -406,20 +406,20 @@ void KexiBlobTableEdit::signalEditRequested() d->setValueInternalEnabled = true; } -bool KexiBlobTableEdit::handleKeyPress( QKeyEvent* ke, bool editorActive ) +bool KexiBlobTableEdit::handleKeyPress( TQKeyEvent* ke, bool editorActive ) { Q_UNUSED(editorActive); const int k = ke->key(); KKey kkey(ke); if (!d->readOnly) { - if ((ke->state()==Qt::NoButton && k==Qt::Key_F4) - || (ke->state()==Qt::AltButton && k==Qt::Key_Down)) { + if ((ke->state()==Qt::NoButton && k==TQt::Key_F4) + || (ke->state()==TQt::AltButton && k==TQt::Key_Down)) { d->button->animateClick(); - QMouseEvent me( QEvent::MouseButtonPress, QPoint(2,2), Qt::LeftButton, Qt::NoButton ); - QApplication::sendEvent( d->button, &me ); + TQMouseEvent me( TQEvent::MouseButtonPress, TQPoint(2,2), Qt::LeftButton, Qt::NoButton ); + TQApplication::sendEvent( d->button, &me ); } - else if ((ke->state()==NoButton && (k==Qt::Key_F2 || k==Qt::Key_Space || k==Qt::Key_Enter || k==Qt::Key_Return))) { + else if ((ke->state()==Qt::NoButton && (k==TQt::Key_F2 || k==TQt::Key_Space || k==TQt::Key_Enter || k==TQt::Key_Return))) { d->popup->insertFromFile(); } else @@ -436,13 +436,13 @@ bool KexiBlobTableEdit::handleDoubleClick() return true; } -void KexiBlobTableEdit::handleCopyAction(const QVariant& value, const QVariant& visibleValue) +void KexiBlobTableEdit::handleCopyAction(const TQVariant& value, const TQVariant& visibleValue) { Q_UNUSED(visibleValue); executeCopyAction(value.toByteArray()); } -void KexiBlobTableEdit::handleAction(const QString& actionName) +void KexiBlobTableEdit::handleAction(const TQString& actionName) { if (actionName=="edit_paste") { d->popup->paste(); @@ -453,18 +453,18 @@ void KexiBlobTableEdit::handleAction(const QString& actionName) } } -bool KexiBlobTableEdit::eventFilter( QObject *o, QEvent *e ) +bool KexiBlobTableEdit::eventFilter( TQObject *o, TQEvent *e ) { - if (o == d->popup && e->type()==QEvent::KeyPress) { - QKeyEvent* ke = static_cast<QKeyEvent*>(e); + if (TQT_BASE_OBJECT(o) == TQT_BASE_OBJECT(d->popup) && e->type()==TQEvent::KeyPress) { + TQKeyEvent* ke = TQT_TQKEYEVENT(e); const int state = ke->state(); const int k = ke->key(); - if ( (state==Qt::NoButton && (k==Qt::Key_Tab || k==Qt::Key_Left || k==Qt::Key_Right)) - || (state==Qt::ShiftButton && k==Qt::Key_Backtab) + if ( (state==Qt::NoButton && (k==TQt::Key_Tab || k==TQt::Key_Left || k==TQt::Key_Right)) + || (state==TQt::ShiftButton && k==TQt::Key_Backtab) ) { d->popup->hide(); - QApplication::sendEvent( this, ke ); //re-send to move cursor + TQApplication::sendEvent( this, ke ); //re-send to move cursor return true; } } @@ -485,13 +485,13 @@ public: { } //! We've no editor widget that would store current value, so we do this here - QVariant currentValue; + TQVariant currentValue; - QCache<QPixmap> pixmapCache; + TQCache<TQPixmap> pixmapCache; }; -KexiKIconTableEdit::KexiKIconTableEdit(KexiTableViewColumn &column, QWidget *parent) - : KexiTableEdit(column, parent) +KexiKIconTableEdit::KexiKIconTableEdit(KexiTableViewColumn &column, TQWidget *tqparent) + : KexiTableEdit(column, tqparent) , d( new Private() ) { setName("KexiKIconTableEdit"); @@ -509,7 +509,7 @@ void KexiKIconTableEdit::init() d->pixmapCache.setAutoDelete(true); } -void KexiKIconTableEdit::setValueInternal(const QVariant& /*add*/, bool /*removeOld*/) +void KexiKIconTableEdit::setValueInternal(const TQVariant& /*add*/, bool /*removeOld*/) { d->currentValue = m_origValue; } @@ -524,14 +524,14 @@ bool KexiKIconTableEdit::valueIsEmpty() return d->currentValue.isNull(); } -QVariant KexiKIconTableEdit::value() +TQVariant KexiKIconTableEdit::value() { return d->currentValue; } void KexiKIconTableEdit::clear() { - d->currentValue = QVariant(); + d->currentValue = TQVariant(); } bool KexiKIconTableEdit::cursorAtStart() @@ -544,22 +544,22 @@ bool KexiKIconTableEdit::cursorAtEnd() return true; } -void KexiKIconTableEdit::setupContents( QPainter *p, bool /*focused*/, const QVariant& val, - QString &/*txt*/, int &/*align*/, int &/*x*/, int &y_offset, int &w, int &h ) +void KexiKIconTableEdit::setupContents( TQPainter *p, bool /*focused*/, const TQVariant& val, + TQString &/*txt*/, int &/*align*/, int &/*x*/, int &y_offset, int &w, int &h ) { Q_UNUSED( y_offset ); #if 0 -#ifdef Q_WS_WIN +#ifdef TQ_WS_WIN y_offset = -1; #else y_offset = 0; #endif - int s = QMAX(h - 5, 12); - s = QMIN( h-3, s ); - s = QMIN( w-3, s );//avoid too large box - QRect r( QMAX( w/2 - s/2, 0 ) , h/2 - s/2 /*- 1*/, s, s); - p->setPen(QPen(colorGroup().text(), 1)); + int s = TQMAX(h - 5, 12); + s = TQMIN( h-3, s ); + s = TQMIN( w-3, s );//avoid too large box + TQRect r( TQMAX( w/2 - s/2, 0 ) , h/2 - s/2 /*- 1*/, s, s); + p->setPen(TQPen(tqcolorGroup().text(), 1)); p->drawRect(r); if (val.asBool()) { p->drawLine(r.x(), r.y(), r.right(), r.bottom()); @@ -567,14 +567,14 @@ void KexiKIconTableEdit::setupContents( QPainter *p, bool /*focused*/, const QVa } #endif - QString key = val.toString(); - QPixmap *pix = 0; + TQString key = val.toString(); + TQPixmap *pix = 0; if (!key.isEmpty() && !(pix = d->pixmapCache[ key ])) { //cache pixmap - QPixmap pm = KGlobal::iconLoader()->loadIcon( key, KIcon::Small, + TQPixmap pm = KGlobal::iconLoader()->loadIcon( key, KIcon::Small, 0, KIcon::DefaultState, 0L, true/*canReturnNull*/ ); if (!pm.isNull()) { - pix = new QPixmap(pm); + pix = new TQPixmap(pm); d->pixmapCache.insert(key, pix); } } @@ -584,7 +584,7 @@ void KexiKIconTableEdit::setupContents( QPainter *p, bool /*focused*/, const QVa } } -void KexiKIconTableEdit::handleCopyAction(const QVariant& value, const QVariant& visibleValue) +void KexiKIconTableEdit::handleCopyAction(const TQVariant& value, const TQVariant& visibleValue) { Q_UNUSED(value); Q_UNUSED(visibleValue); diff --git a/kexi/widget/tableview/kexiblobtableedit.h b/kexi/widget/tableview/kexiblobtableedit.h index a44559be..fb64c21d 100644 --- a/kexi/widget/tableview/kexiblobtableedit.h +++ b/kexi/widget/tableview/kexiblobtableedit.h @@ -21,8 +21,8 @@ #ifndef _KEXIBLOBTABLEEDIT_H_ #define _KEXIBLOBTABLEEDIT_H_ -#include <qcstring.h> -#include <qcache.h> +#include <tqcstring.h> +#include <tqcache.h> #include <kurl.h> @@ -31,19 +31,20 @@ class KTempFile; class KProcess; -class QTextEdit; +class TQTextEdit; class KexiBlobTableEdit : public KexiTableEdit { Q_OBJECT + TQ_OBJECT public: - KexiBlobTableEdit(KexiTableViewColumn &column, QWidget *parent=0); + KexiBlobTableEdit(KexiTableViewColumn &column, TQWidget *tqparent=0); virtual ~KexiBlobTableEdit(); bool valueIsNull(); bool valueIsEmpty(); - virtual QVariant value(); + virtual TQVariant value(); virtual bool cursorAtStart(); virtual bool cursorAtEnd(); @@ -51,17 +52,17 @@ class KexiBlobTableEdit : public KexiTableEdit /*! Reimplemented: resizes a view(). */ virtual void resize(int w, int h); - virtual void showFocus( const QRect& r, bool readOnly ); + virtual void showFocus( const TQRect& r, bool readOnly ); virtual void hideFocus(); /*! \return total size of this editor, including popup button. */ - virtual QSize totalSize() const; + virtual TQSize totalSize() const; - virtual void paintFocusBorders( QPainter *p, QVariant &, int x, int y, int w, int h ); + virtual void paintFocusBorders( TQPainter *p, TQVariant &, int x, int y, int w, int h ); /*! Reimplemented to handle the key events. */ - virtual bool handleKeyPress( QKeyEvent* ke, bool editorActive ); + virtual bool handleKeyPress( TQKeyEvent* ke, bool editorActive ); /*! Handles double click request coming from the table view. \return true if it has been consumed. @@ -70,22 +71,22 @@ class KexiBlobTableEdit : public KexiTableEdit /*! Handles action having standard name \a actionName. Action could be: "edit_cut", "edit_paste", etc. */ - virtual void handleAction(const QString& actionName); + virtual void handleAction(const TQString& actionName); /*! Handles copy action for value. The \a value is copied to clipboard in format appropriate for the editor's impementation, e.g. for image cell it can be a pixmap. \a visibleValue is unused here. Reimplemented after KexiTableEdit. */ - virtual void handleCopyAction(const QVariant& value, const QVariant& visibleValue); + virtual void handleCopyAction(const TQVariant& value, const TQVariant& visibleValue); - virtual void setupContents( QPainter *p, bool focused, const QVariant& val, - QString &txt, int &align, int &x, int &y_offset, int &w, int &h ); + virtual void setupContents( TQPainter *p, bool focused, const TQVariant& val, + TQString &txt, int &align, int &x, int &y_offset, int &w, int &h ); protected slots: 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(); @@ -94,26 +95,26 @@ class KexiBlobTableEdit : public KexiTableEdit protected: //! initializes this editor with \a add value - virtual void setValueInternal(const QVariant& add, bool removeOld); + virtual void setValueInternal(const TQVariant& add, bool removeOld); - //todo QString openWithDlg(const QString& file); - //todo void execute(const QString& app, const QString& file); + //todo TQString openWithDlg(const TQString& file); + //todo void execute(const TQString& app, const TQString& file); //! @internal - void updateFocus( const QRect& r ); + void updateFocus( const TQRect& r ); void signalEditRequested(); //! @internal - void executeCopyAction(const QByteArray& data); + void executeCopyAction(const TQByteArray& data); - virtual bool eventFilter( QObject *o, QEvent *e ); + virtual bool eventFilter( TQObject *o, TQEvent *e ); class Private; Private *d; //todo KTempFile* m_tempFile; //todo KProcess* m_proc; -//todo QTextEdit *m_content; +//todo TQTextEdit *m_content; }; KEXI_DECLARE_CELLEDITOR_FACTORY_ITEM(KexiBlobEditorFactoryItem) @@ -128,7 +129,7 @@ KEXI_DECLARE_CELLEDITOR_FACTORY_ITEM(KexiBlobEditorFactoryItem) class KexiKIconTableEdit : public KexiTableEdit { public: - KexiKIconTableEdit(KexiTableViewColumn &column, QWidget *parent=0); + KexiKIconTableEdit(KexiTableViewColumn &column, TQWidget *tqparent=0); virtual ~KexiKIconTableEdit(); @@ -140,23 +141,23 @@ class KexiKIconTableEdit : public KexiTableEdit //! (check this with KexiDB::Field::hasEmptyProperty()), virtual bool valueIsEmpty(); - virtual QVariant value(); + virtual TQVariant value(); virtual bool cursorAtStart(); virtual bool cursorAtEnd(); virtual void clear(); - virtual void setupContents( QPainter *p, bool focused, const QVariant& val, - QString &txt, int &align, int &x, int &y_offset, int &w, int &h ); + virtual void setupContents( TQPainter *p, bool focused, const TQVariant& val, + TQString &txt, int &align, int &x, int &y_offset, int &w, int &h ); /*! Handles copy action for value. Does nothing. \a visibleValue is unused here. Reimplemented after KexiTableEdit. */ - virtual void handleCopyAction(const QVariant& value, const QVariant& visibleValue); + virtual void handleCopyAction(const TQVariant& value, const TQVariant& visibleValue); protected: //! initializes this editor with \a add value - virtual void setValueInternal(const QVariant& add, bool removeOld); + virtual void setValueInternal(const TQVariant& add, bool removeOld); void showHintButton(); void init(); diff --git a/kexi/widget/tableview/kexibooltableedit.cpp b/kexi/widget/tableview/kexibooltableedit.cpp index 7b7bc0ac..e85d0c73 100644 --- a/kexi/widget/tableview/kexibooltableedit.cpp +++ b/kexi/widget/tableview/kexibooltableedit.cpp @@ -21,9 +21,9 @@ #include <kexidb/field.h> -#include <qpainter.h> -#include <qapplication.h> -#include <qclipboard.h> +#include <tqpainter.h> +#include <tqapplication.h> +#include <tqclipboard.h> #include <kglobal.h> #include <klocale.h> @@ -31,8 +31,8 @@ #include <kglobalsettings.h> -KexiBoolTableEdit::KexiBoolTableEdit(KexiTableViewColumn &column, QWidget *parent) - : KexiTableEdit(column, parent) +KexiBoolTableEdit::KexiBoolTableEdit(KexiTableViewColumn &column, TQWidget *tqparent) + : KexiTableEdit(column, tqparent) { setName("KexiBoolTableEdit"); kdDebug() << "KexiBoolTableEdit: m_origValue.typeName()==" << m_origValue.typeName() << endl; @@ -46,7 +46,7 @@ KexiBoolTableEdit::~KexiBoolTableEdit() { } -void KexiBoolTableEdit::setValueInternal(const QVariant& /*add*/, bool /*removeOld*/) +void KexiBoolTableEdit::setValueInternal(const TQVariant& /*add*/, bool /*removeOld*/) { m_currentValue = m_origValue; //nothing to do more... @@ -62,7 +62,7 @@ bool KexiBoolTableEdit::valueIsEmpty() return m_currentValue.isNull(); } -QVariant KexiBoolTableEdit::value() +TQVariant KexiBoolTableEdit::value() { // ok = true; return m_currentValue; @@ -71,9 +71,9 @@ QVariant KexiBoolTableEdit::value() void KexiBoolTableEdit::clear() { if (field()->isNotNull()) - m_currentValue = QVariant(false, 0); + m_currentValue = TQVariant(false, 0); else - m_currentValue = QVariant(); + m_currentValue = TQVariant(); } bool KexiBoolTableEdit::cursorAtStart() @@ -86,14 +86,14 @@ bool KexiBoolTableEdit::cursorAtEnd() return true; } -void KexiBoolTableEdit::setupContents( QPainter *p, bool focused, const QVariant& val, - QString &txt, int &align, int &x, int &y_offset, int &w, int &h ) +void KexiBoolTableEdit::setupContents( TQPainter *p, bool focused, const TQVariant& val, + TQString &txt, int &align, int &x, int &y_offset, int &w, int &h ) { Q_UNUSED(focused); Q_UNUSED(txt); Q_UNUSED(align); Q_UNUSED(x); -#ifdef Q_WS_WIN +#ifdef TQ_WS_WIN // x = 1; y_offset = -1; #else @@ -101,14 +101,14 @@ void KexiBoolTableEdit::setupContents( QPainter *p, bool focused, const QVariant y_offset = 0; #endif if (p) { - int s = QMAX(h - 5, 12); - s = QMIN( h-3, s ); - s = QMIN( w-3, s );//avoid too large box - QRect r( QMAX( w/2 - s/2, 0 ) , h/2 - s/2 /*- 1*/, s, s); -//already set ouotside: p->setPen(QPen(colorGroup().text(), 1)); + int s = TQMAX(h - 5, 12); + s = TQMIN( h-3, s ); + s = TQMIN( w-3, s );//avoid too large box + TQRect r( TQMAX( w/2 - s/2, 0 ) , h/2 - s/2 /*- 1*/, s, s); +//already set ouotside: p->setPen(TQPen(tqcolorGroup().text(), 1)); p->drawRect(r); if (val.isNull()) { // && !field()->isNotNull()) { - p->drawText( r, Qt::AlignCenter, "?" ); + p->drawText( r, TQt::AlignCenter, "?" ); } else if (val.toBool()) { p->drawLine(r.x(), r.y(), r.right(), r.bottom()); @@ -120,53 +120,53 @@ void KexiBoolTableEdit::setupContents( QPainter *p, bool focused, const QVariant void KexiBoolTableEdit::clickedOnContents() { if (field()->isNotNull()) - m_currentValue = QVariant( !m_currentValue.toBool(), 0 ); + m_currentValue = TQVariant( !m_currentValue.toBool(), 0 ); else { // null allowed: use the cycle: true -> false -> null if (m_currentValue.isNull()) - m_currentValue = QVariant( true, 1 ); + m_currentValue = TQVariant( true, 1 ); else - m_currentValue = m_currentValue.toBool() ? QVariant( false, 1 ) : QVariant(); + m_currentValue = m_currentValue.toBool() ? TQVariant( false, 1 ) : TQVariant(); } } -void KexiBoolTableEdit::handleAction(const QString& actionName) +void KexiBoolTableEdit::handleAction(const TQString& actionName) { if (actionName=="edit_paste") { emit editRequested(); bool ok; - const int value = qApp->clipboard()->text( QClipboard::Clipboard ).toInt(&ok); + const int value = tqApp->tqclipboard()->text( TQClipboard::Clipboard ).toInt(&ok); if (ok) { - m_currentValue = (value==0) ? QVariant(false, 0) : QVariant(true, 1); + m_currentValue = (value==0) ? TQVariant(false, 0) : TQVariant(true, 1); } else { m_currentValue = field()->isNotNull() - ? QVariant(0, false)/*0 instead of NULL - handle case when null is not allowed*/ - : QVariant(); + ? TQVariant(0, false)/*0 instead of NULL - handle case when null is not allowed*/ + : TQVariant(); } - repaintRelatedCell(); + tqrepaintRelatedCell(); } else if (actionName=="edit_cut") { emit editRequested(); //! @todo handle defaultValue... m_currentValue = field()->isNotNull() - ? QVariant(0, false)/*0 instead of NULL - handle case when null is not allowed*/ - : QVariant(); - handleCopyAction(m_origValue, QVariant()); - repaintRelatedCell(); + ? TQVariant(0, false)/*0 instead of NULL - handle case when null is not allowed*/ + : TQVariant(); + handleCopyAction(m_origValue, TQVariant()); + tqrepaintRelatedCell(); } } -void KexiBoolTableEdit::handleCopyAction(const QVariant& value, const QVariant& visibleValue) +void KexiBoolTableEdit::handleCopyAction(const TQVariant& value, const TQVariant& visibleValue) { Q_UNUSED(visibleValue); - if (value.type()==QVariant::Bool) - qApp->clipboard()->setText(value.toBool() ? "1" : "0"); + if (value.type()==TQVariant::Bool) + tqApp->clipboard()->setText(value.toBool() ? "1" : "0"); else - qApp->clipboard()->setText(QString::null); + tqApp->clipboard()->setText(TQString()); } -int KexiBoolTableEdit::widthForValue( QVariant &val, const QFontMetrics &fm ) +int KexiBoolTableEdit::widthForValue( TQVariant &val, const TQFontMetrics &fm ) { Q_UNUSED(fm); return val.toPixmap().width(); diff --git a/kexi/widget/tableview/kexibooltableedit.h b/kexi/widget/tableview/kexibooltableedit.h index 3320a573..3fc87d58 100644 --- a/kexi/widget/tableview/kexibooltableedit.h +++ b/kexi/widget/tableview/kexibooltableedit.h @@ -20,7 +20,7 @@ #ifndef KEXIBOOLTABLEEDIT_H #define KEXIBOOLTABLEEDIT_H -#include <qvariant.h> +#include <tqvariant.h> #include "kexitableedit.h" #include "kexicelleditorfactory.h" @@ -30,9 +30,10 @@ class KexiBoolTableEdit : public KexiTableEdit { Q_OBJECT + TQ_OBJECT public: - KexiBoolTableEdit(KexiTableViewColumn &column, QWidget *parent=0); + KexiBoolTableEdit(KexiTableViewColumn &column, TQWidget *tqparent=0); virtual ~KexiBoolTableEdit(); @@ -44,39 +45,39 @@ class KexiBoolTableEdit : public KexiTableEdit //! (check this with KexiDB::Field::hasEmptyProperty()), virtual bool valueIsEmpty(); - virtual QVariant value(); + virtual TQVariant value(); virtual bool cursorAtStart(); virtual bool cursorAtEnd(); virtual void clear(); - virtual void setupContents( QPainter *p, bool focused, const QVariant& val, - QString &txt, int &align, int &x, int &y_offset, int &w, int &h ); + virtual void setupContents( TQPainter *p, bool focused, const TQVariant& val, + TQString &txt, int &align, int &x, int &y_offset, int &w, int &h ); virtual void clickedOnContents(); /*! Handles action having standard name \a actionName. Action could be: "edit_cut", "edit_paste", etc. */ - virtual void handleAction(const QString& actionName); + virtual void handleAction(const TQString& actionName); /*! Handles copy action for value. Copies empty string for null, "1" for true, "0" for false. \a visibleValue is unused here. Reimplemented after KexiTableEdit. */ - virtual void handleCopyAction(const QVariant& value, const QVariant& visibleValue); + virtual void handleCopyAction(const TQVariant& value, const TQVariant& visibleValue); /*! \return width of \a value. Reimplemented after KexiTableEdit. */ - virtual int widthForValue( QVariant &val, const QFontMetrics &fm ); + virtual int widthForValue( TQVariant &val, const TQFontMetrics &fm ); protected slots: protected: //! initializes this editor with \a add value - virtual void setValueInternal(const QVariant& add, bool removeOld); + virtual void setValueInternal(const TQVariant& add, bool removeOld); void showHintButton(); //! We've no editor widget that would store current value, so we do this here - QVariant m_currentValue; + TQVariant m_currentValue; signals: void hintClicked(); diff --git a/kexi/widget/tableview/kexicelleditorfactory.cpp b/kexi/widget/tableview/kexicelleditorfactory.cpp index a20eac07..e0e9ec03 100644 --- a/kexi/widget/tableview/kexicelleditorfactory.cpp +++ b/kexi/widget/tableview/kexicelleditorfactory.cpp @@ -19,8 +19,8 @@ #include "kexicelleditorfactory.h" -#include <qptrdict.h> -#include <qintdict.h> +#include <tqptrdict.h> +#include <tqintdict.h> #include <kstaticdeleter.h> #include <kexidb/indexschema.h> @@ -60,15 +60,15 @@ class KexiCellEditorFactoryPrivate } ~KexiCellEditorFactoryPrivate() {} - QString key(uint type, const QString& subType) const + TQString key(uint type, const TQString& subType) const { - QString key = QString::number(type); + TQString key = TQString::number(type); if (!subType.isEmpty()) - key += (QString(" ") + subType); + key += (TQString(" ") + subType); return key; } - void registerItem( KexiCellEditorFactoryItem& item, uint type, const QString& subType = QString::null ) + void registerItem( KexiCellEditorFactoryItem& item, uint type, const TQString& subType = TQString() ) { if (!items[ &item ]) items.insert( &item, &item ); @@ -76,20 +76,20 @@ class KexiCellEditorFactoryPrivate items_by_type.insert( key(type, subType), &item ); } - KexiCellEditorFactoryItem *findItem(uint type, const QString& subType) + KexiCellEditorFactoryItem *findItem(uint type, const TQString& subType) { KexiCellEditorFactoryItem *item = items_by_type[ key(type, subType) ]; if (item) return item; - item = items_by_type[ key(type, QString::null) ]; + item = items_by_type[ key(type, TQString()) ]; if (item) return item; - return items_by_type[ key( KexiDB::Field::InvalidType, QString::null ) ]; + return items_by_type[ key( KexiDB::Field::InvalidType, TQString() ) ]; } - QPtrDict<KexiCellEditorFactoryItem> items; //!< list of editor factory items (for later destroy) + TQPtrDict<KexiCellEditorFactoryItem> items; //!< list of editor factory items (for later destroy) - QDict<KexiCellEditorFactoryItem> items_by_type; //!< editor factory items accessed by a key + TQDict<KexiCellEditorFactoryItem> items_by_type; //!< editor factory items accessed by a key }; static KStaticDeleter<KexiCellEditorFactoryPrivate> KexiCellEditorFactory_deleter; @@ -124,7 +124,7 @@ void KexiCellEditorFactory::init() KexiCellEditorFactory_static->registerItem( *new KexiInputEditorFactoryItem(), KexiDB::Field::InvalidType ); } -void KexiCellEditorFactory::registerItem( KexiCellEditorFactoryItem& item, uint type, const QString& subType ) +void KexiCellEditorFactory::registerItem( KexiCellEditorFactoryItem& item, uint type, const TQString& subType ) { init(); KexiCellEditorFactory_static->registerItem( item, type, subType ); @@ -146,7 +146,7 @@ static bool hasEnumType( const KexiTableViewColumn &column ) return true; } -KexiTableEdit* KexiCellEditorFactory::createEditor(KexiTableViewColumn &column, QWidget* parent) +KexiTableEdit* KexiCellEditorFactory::createEditor(KexiTableViewColumn &column, TQWidget* tqparent) { init(); KexiDB::Field *realField; @@ -176,7 +176,7 @@ KexiTableEdit* KexiCellEditorFactory::createEditor(KexiTableViewColumn &column, KexiDB::IndexSchema::ListIterator it = table->indicesIterator(); for (;it.current();++it) { KexiDB::IndexSchema *idx = it.current(); - if (idx->fields()->findRef(&f)!=-1) { + if (idx->fields()->tqfindRef(&f)!=-1) { //find details-side rel. for this index KexiDB::Relationship *rel = idx->detailsRelationships()->first(); if (rel) { @@ -187,10 +187,10 @@ KexiTableEdit* KexiCellEditorFactory::createEditor(KexiTableViewColumn &column, } #endif - return item->createEditor(column, parent); + return item->createEditor(column, tqparent); } -KexiCellEditorFactoryItem* KexiCellEditorFactory::item( uint type, const QString& subType ) +KexiCellEditorFactoryItem* KexiCellEditorFactory::item( uint type, const TQString& subType ) { init(); return KexiCellEditorFactory_static->findItem(type, subType); diff --git a/kexi/widget/tableview/kexicelleditorfactory.h b/kexi/widget/tableview/kexicelleditorfactory.h index 1b68cb8d..26b48bb6 100644 --- a/kexi/widget/tableview/kexicelleditorfactory.h +++ b/kexi/widget/tableview/kexicelleditorfactory.h @@ -20,8 +20,8 @@ #ifndef KEXICELLEDITORFACTORY_H #define KEXICELLEDITORFACTORY_H -#include <qvariant.h> -#include <qwidget.h> +#include <tqvariant.h> +#include <tqwidget.h> #include <kexidb/field.h> @@ -44,17 +44,17 @@ class KEXIDATATABLE_EXPORT KexiCellEditorFactory Once registered, \a item object will be owned by the factory, so you shouldn't care about deleting it. */ static void registerItem( KexiCellEditorFactoryItem& item, uint type, - const QString& subType = QString::null ); + const TQString& subType = TQString() ); /*! \return item for \a type and (optional) \a subType. If no item found, the one with empty subtype is tried. If still no item found, the default is tried. Eventually, may return NULL. */ - static KexiCellEditorFactoryItem* item( uint type, const QString& subType = QString::null ); + static KexiCellEditorFactoryItem* item( uint type, const TQString& subType = TQString() ); -// static KexiTableEdit* createEditor(KexiDB::Field &f, QScrollView* parent = 0); - /*! Creates a new editor for \a column. If \a parent is of QScrollView, the new editor - will be created inside parent->viewport() instead. */ - static KexiTableEdit* createEditor(KexiTableViewColumn &column, QWidget* parent = 0); +// static KexiTableEdit* createEditor(KexiDB::Field &f, TQScrollView* tqparent = 0); + /*! Creates a new editor for \a column. If \a tqparent is of TQScrollView, the new editor + will be created inside tqparent->viewport() instead. */ + static KexiTableEdit* createEditor(KexiTableViewColumn &column, TQWidget* tqparent = 0); protected: static void init(); @@ -66,13 +66,13 @@ class KEXIDATATABLE_EXPORT KexiCellEditorFactoryItem public: KexiCellEditorFactoryItem(); virtual ~KexiCellEditorFactoryItem(); - QString className() { return m_className; } + TQString className() { return m_className; } protected: -// virtual KexiTableEdit* createEditor(KexiDB::Field &f, QScrollView* parent = 0) = 0; - virtual KexiTableEdit* createEditor(KexiTableViewColumn &column, QWidget* parent = 0) = 0; +// virtual KexiTableEdit* createEditor(KexiDB::Field &f, TQScrollView* tqparent = 0) = 0; + virtual KexiTableEdit* createEditor(KexiTableViewColumn &column, TQWidget* tqparent = 0) = 0; - QString m_className; + TQString m_className; friend class KexiCellEditorFactory; }; diff --git a/kexi/widget/tableview/kexicomboboxbase.cpp b/kexi/widget/tableview/kexicomboboxbase.cpp index 2d6d52ac..19cf0b99 100644 --- a/kexi/widget/tableview/kexicomboboxbase.cpp +++ b/kexi/widget/tableview/kexicomboboxbase.cpp @@ -18,10 +18,10 @@ * Boston, MA 02110-1301, USA. */ -#include <qlayout.h> -#include <qstyle.h> -#include <qwindowsstyle.h> -#include <qpainter.h> +#include <tqlayout.h> +#include <tqstyle.h> +#include <tqwindowsstyle.h> +#include <tqpainter.h> #include "kexicomboboxbase.h" #include <widget/utils/kexicomboboxdropdownbutton.h> @@ -72,7 +72,7 @@ int KexiComboBoxBase::rowToHighlightForLookupTable() const bool ok; const int rowUid = origValue().toInt(); //! @todo for now we're assuming the id is INTEGER - KexiTableViewData *tvData = popup()->tableView()->data(); + KexiTableViewData *tvData = popup()->tableView()->KexiDataAwareObjectInterface::data(); const int boundColumn = lookupFieldSchema->boundColumn(); KexiTableViewData::Iterator it(tvData->iterator()); int row=0; @@ -86,15 +86,15 @@ int KexiComboBoxBase::rowToHighlightForLookupTable() const return row; } -void KexiComboBoxBase::setValueInternal(const QVariant& add_, bool removeOld) +void KexiComboBoxBase::setValueInternal(const TQVariant& add_, bool removeOld) { Q_UNUSED(removeOld); m_mouseBtnPressedWhenPopupVisible = false; m_updatePopupSelectionOnShow = true; - QString add(add_.toString()); + TQString add(add_.toString()); if (add.isEmpty()) { KexiTableViewData *relData = column() ? column()->relatedData() : 0; - QVariant valueToSet; + TQVariant valueToSet; bool hasValueToSet = true; int rowToHighlight = -1; KexiDB::LookupFieldSchema *lookupFieldSchema = this->lookupFieldSchema(); @@ -113,7 +113,7 @@ void KexiComboBoxBase::setValueInternal(const QVariant& add_, bool removeOld) const int rowToHighlight = rowToHighlightForLookupTable(); popup()->tableView()->setHighlightedRow(rowToHighlight); - const int visibleColumn = lookupFieldSchema->visibleColumn( popup()->tableView()->data()->columnsCount() ); + const int visibleColumn = lookupFieldSchema->visibleColumn( popup()->tableView()->KexiDataAwareObjectInterface::data()->columnsCount() ); if (m_setVisibleValueOnSetValueInternal && -1!=visibleColumn) { //only for table views KexiTableItem *it = popup()->tableView()->highlightedItem(); @@ -165,7 +165,7 @@ void KexiComboBoxBase::setValueInternal(const QVariant& add_, bool removeOld) } } -KexiTableItem* KexiComboBoxBase::selectItemForEnteredValueInLookupTable(const QVariant& v) +KexiTableItem* KexiComboBoxBase::selectItemForEnteredValueInLookupTable(const TQVariant& v) { KexiDB::LookupFieldSchema *lookupFieldSchema = this->lookupFieldSchema(); if (!popup() || !lookupFieldSchema) @@ -173,9 +173,9 @@ KexiTableItem* KexiComboBoxBase::selectItemForEnteredValueInLookupTable(const QV //-not effective for large sets: please cache it! //.stripWhiteSpace() is not generic! - const bool valueIsText = v.type()==QVariant::String || v.type()==QVariant::CString; //most common case - const QString txt( valueIsText ? v.toString().stripWhiteSpace().lower() : QString::null ); - KexiTableViewData *lookupData = popup()->tableView()->data(); + const bool valueIsText = v.type()==TQVariant::String || v.type()==TQVariant::CString; //most common case + const TQString txt( valueIsText ? v.toString().stripWhiteSpace().lower() : TQString() ); + KexiTableViewData *lookupData = popup()->tableView()->KexiDataAwareObjectInterface::data(); const int visibleColumn = lookupFieldSchema->visibleColumn( lookupData->columnsCount() ); if (-1 == visibleColumn) return 0; @@ -204,17 +204,17 @@ KexiTableItem* KexiComboBoxBase::selectItemForEnteredValueInLookupTable(const QV return it.current(); } -QString KexiComboBoxBase::valueForString(const QString& str, int* row, +TQString KexiComboBoxBase::valueForString(const TQString& str, int* row, uint lookInColumn, uint returnFromColumn, bool allowNulls) { KexiTableViewData *relData = column() ? column()->relatedData() : 0; if (!relData) - return QString::null; //safety + return TQString(); //safety //use 'related table data' model //-not effective for large sets: please cache it! //.stripWhiteSpace() is not generic! - const QString txt = str.stripWhiteSpace().lower(); + const TQString txt = str.stripWhiteSpace().lower(); KexiTableViewData::Iterator it( relData->iterator() ); for (*row = 0;it.current();++it, (*row)++) { if (it.current()->at(lookInColumn).toString().stripWhiteSpace().lower()==txt) @@ -230,11 +230,11 @@ QString KexiComboBoxBase::valueForString(const QString& str, int* row, kexiwarn << "KexiComboBoxBase::valueForString(): no related row found, ID will be painted!" << endl; if (allowNulls) - return QString::null; + return TQString(); return str; //for sanity but it's weird to show id to the user } -QVariant KexiComboBoxBase::value() +TQVariant KexiComboBoxBase::value() { KexiTableViewData *relData = column() ? column()->relatedData() : 0; KexiDB::LookupFieldSchema *lookupFieldSchema = 0; @@ -248,7 +248,7 @@ QVariant KexiComboBoxBase::value() else { //use 'related table data' model KexiTableItem *it = popup() ? popup()->tableView()->selectedItem() : 0; - return it ? it->at(0) : origValue();//QVariant(); + return it ? it->at(0) : origValue();//TQVariant(); } } else if ((lookupFieldSchema = this->lookupFieldSchema())) @@ -259,41 +259,41 @@ QVariant KexiComboBoxBase::value() if (/*!it &&*/ m_internalEditorValueChanged && !m_userEnteredValue.toString().isEmpty()) { // //try to select a row using the user-entered text if (!popup()) { - QVariant prevUserEnteredValue = m_userEnteredValue; + TQVariant prevUserEnteredValue = m_userEnteredValue; createPopup(false); m_userEnteredValue = prevUserEnteredValue; } it = selectItemForEnteredValueInLookupTable( m_userEnteredValue ); } - return it ? it->at( lookupFieldSchema->boundColumn() ) : QVariant(); + return it ? it->at( lookupFieldSchema->boundColumn() ) : TQVariant(); } else if (popup()) { //use 'enum hints' model const int row = popup()->tableView()->currentRow(); if (row>=0) - return QVariant( row ); + return TQVariant( row ); } if (valueFromInternalEditor().toString().isEmpty()) - return QVariant(); + return TQVariant(); /*! \todo don't return just 1st row, but use autocompletion feature and: show message box if entered text does not match! */ return origValue(); //unchanged } -QVariant KexiComboBoxBase::visibleValueForLookupField() +TQVariant KexiComboBoxBase::visibleValueForLookupField() { KexiDB::LookupFieldSchema *lookupFieldSchema = this->lookupFieldSchema(); if (!popup() || !lookupFieldSchema) - return QVariant(); - const int visibleColumn = lookupFieldSchema->visibleColumn( popup()->tableView()->data()->columnsCount() ); + return TQVariant(); + const int visibleColumn = lookupFieldSchema->visibleColumn( popup()->tableView()->KexiDataAwareObjectInterface::data()->columnsCount() ); if (-1 == visibleColumn) - return QVariant(); + return TQVariant(); KexiTableItem *it = popup()->tableView()->selectedItem(); - return it ? it->at( QMIN( (uint)visibleColumn, it->count()-1)/*sanity*/ ) : QVariant(); + return it ? it->at( TQMIN( (uint)visibleColumn, it->count()-1)/*sanity*/ ) : TQVariant(); } -QVariant KexiComboBoxBase::visibleValue() +TQVariant KexiComboBoxBase::visibleValue() { return m_visibleValue; } @@ -302,7 +302,7 @@ void KexiComboBoxBase::clear() { if (popup()) popup()->hide(); - slotInternalEditorValueChanged(QVariant()); + slotInternalEditorValueChanged(TQVariant()); } tristate KexiComboBoxBase::valueChangedInternal() @@ -332,7 +332,7 @@ tristate KexiComboBoxBase::valueChangedInternal() bool KexiComboBoxBase::valueIsNull() { // bool ok; - QVariant v( value() ); + TQVariant v( value() ); return v.isNull(); // return !ok || v.isNull(); } @@ -352,15 +352,15 @@ void KexiComboBoxBase::createPopup(bool show) if (!field()) return; m_insideCreatePopup = true; - QWidget* thisWidget = dynamic_cast<QWidget*>(this); - QWidget *widgetToFocus = internalEditor() ? internalEditor() : thisWidget; + TQWidget* thisWidget = dynamic_cast<TQWidget*>(this); + TQWidget *widgetToFocus = internalEditor() ? internalEditor() : thisWidget; if (!popup()) { setPopup( column() ? new KexiComboBoxPopup(thisWidget, *column()) : new KexiComboBoxPopup(thisWidget, *field()) ); - QObject::connect(popup(), SIGNAL(rowAccepted(KexiTableItem*,int)), - thisWidget, SLOT(slotRowAccepted(KexiTableItem*,int))); - QObject::connect(popup()->tableView(), SIGNAL(itemSelected(KexiTableItem*)), - thisWidget, SLOT(slotItemSelected(KexiTableItem*))); + TQObject::connect(popup(), TQT_SIGNAL(rowAccepted(KexiTableItem*,int)), + thisWidget, TQT_SLOT(slotRowAccepted(KexiTableItem*,int))); + TQObject::connect(popup()->tableView(), TQT_SIGNAL(itemSelected(KexiTableItem*)), + thisWidget, TQT_SLOT(slotItemSelected(KexiTableItem*))); popup()->setFocusProxy( widgetToFocus ); popup()->tableView()->setFocusProxy( widgetToFocus ); @@ -376,10 +376,10 @@ void KexiComboBoxBase::createPopup(bool show) if (show && internalEditor() && !internalEditor()->isVisible()) /*emit*/editRequested(); - QPoint posMappedToGlobal = mapFromParentToGlobal(thisWidget->pos()); - if (posMappedToGlobal != QPoint(-1,-1)) { + TQPoint posMappedToGlobal = mapFromParentToGlobal(thisWidget->pos()); + if (posMappedToGlobal != TQPoint(-1,-1)) { //! todo alter the position to fit the popup within screen boundaries - popup()->move( posMappedToGlobal + QPoint(0, thisWidget->height()) ); + popup()->move( posMappedToGlobal + TQPoint(0, thisWidget->height()) ); //to avoid flickering: first resize to 0-height, then show and resize back to prev. height const int w = popupWidthHint(); popup()->resize(w, 0); @@ -403,8 +403,8 @@ void KexiComboBoxBase::createPopup(bool show) m_selectAllInInternalEditor_enabled = show; m_setValueInInternalEditor_enabled = show; if (rowToHighlight==-1) { - rowToHighlight = QMAX( popup()->tableView()->highlightedRow(), 0); - setValueInInternalEditor(QVariant()); + rowToHighlight = TQMAX( popup()->tableView()->highlightedRow(), 0); + setValueInInternalEditor(TQVariant()); } popup()->tableView()->selectRow( rowToHighlight ); popup()->tableView()->setHighlightedRow( rowToHighlight ); @@ -457,11 +457,11 @@ void KexiComboBoxBase::slotItemSelected(KexiTableItem*) { kexidbg << "KexiComboBoxBase::slotItemSelected(): m_visibleValue = " << m_visibleValue << endl; - QVariant valueToSet; + TQVariant valueToSet; KexiTableViewData *relData = column() ? column()->relatedData() : 0; KexiDB::LookupFieldSchema *lookupFieldSchema = this->lookupFieldSchema(); - m_visibleValue = lookupFieldSchema ? visibleValueForLookupField() : QVariant(); + m_visibleValue = lookupFieldSchema ? visibleValueForLookupField() : TQVariant(); if (relData) { //use 'related table data' model @@ -471,9 +471,9 @@ void KexiComboBoxBase::slotItemSelected(KexiTableItem*) } else if (lookupFieldSchema) { KexiTableItem *item = popup()->tableView()->selectedItem(); - const int visibleColumn = lookupFieldSchema->visibleColumn( popup()->tableView()->data()->columnsCount() ); + const int visibleColumn = lookupFieldSchema->visibleColumn( popup()->tableView()->KexiDataAwareObjectInterface::data()->columnsCount() ); if (item && visibleColumn!=-1 /* && (int)item->size() >= visibleColumn --already checked*/) { - valueToSet = item->at( QMIN( (uint)visibleColumn, item->count()-1)/*sanity*/ ); + valueToSet = item->at( TQMIN( (uint)visibleColumn, item->count()-1)/*sanity*/ ); } } else { @@ -481,8 +481,8 @@ void KexiComboBoxBase::slotItemSelected(KexiTableItem*) valueToSet = field()->enumHint( popup()->tableView()->currentRow() ); if (valueToSet.toString().isEmpty() && !m_insideCreatePopup) { clear(); - QWidget* thisWidget = dynamic_cast<QWidget*>(this); - thisWidget->parentWidget()->setFocus(); + TQWidget* thisWidget = dynamic_cast<TQWidget*>(this); + thisWidget->tqparentWidget()->setFocus(); return; } } @@ -495,7 +495,7 @@ void KexiComboBoxBase::slotItemSelected(KexiTableItem*) m_updatePopupSelectionOnShow = false; } -void KexiComboBoxBase::slotInternalEditorValueChanged(const QVariant& v) +void KexiComboBoxBase::slotInternalEditorValueChanged(const TQVariant& v) { if (!m_slotInternalEditorValueChanged_enabled) return; @@ -509,24 +509,24 @@ void KexiComboBoxBase::slotInternalEditorValueChanged(const QVariant& v) } } -void KexiComboBoxBase::setValueOrTextInInternalEditor(const QVariant& value) +void KexiComboBoxBase::setValueOrTextInInternalEditor(const TQVariant& value) { if (!m_setValueOrTextInInternalEditor_enabled) return; setValueInInternalEditor( value ); //this text is not entered by hand: - m_userEnteredValue = QVariant(); + m_userEnteredValue = TQVariant(); m_internalEditorValueChanged = false; } -bool KexiComboBoxBase::handleKeyPressForPopup( QKeyEvent *ke ) +bool KexiComboBoxBase::handleKeyPressForPopup( TQKeyEvent *ke ) { const int k = ke->key(); int highlightedOrSelectedRow = popup() ? popup()->tableView()->highlightedRow() : -1; if (popup() && highlightedOrSelectedRow < 0) highlightedOrSelectedRow = popup()->tableView()->currentRow(); - const bool enterPressed = k==Qt::Key_Enter || k==Qt::Key_Return; + const bool enterPressed = k==TQt::Key_Enter || k==TQt::Key_Return; // The editor may be active but the pull down menu not existant/visible, // e.g. when the user has pressed a normal button to activate the editor @@ -536,37 +536,37 @@ bool KexiComboBoxBase::handleKeyPressForPopup( QKeyEvent *ke ) } switch (k) { - case Qt::Key_Up: + case TQt::Key_Up: popup()->tableView()->setHighlightedRow( - QMAX(highlightedOrSelectedRow-1, 0) ); + TQMAX(highlightedOrSelectedRow-1, 0) ); updateTextForHighlightedRow(); return true; - case Qt::Key_Down: + case TQt::Key_Down: popup()->tableView()->setHighlightedRow( - QMIN(highlightedOrSelectedRow+1, popup()->tableView()->rows()-1) ); + TQMIN(highlightedOrSelectedRow+1, popup()->tableView()->rows()-1) ); updateTextForHighlightedRow(); return true; - case Qt::Key_PageUp: + case TQt::Key_PageUp: popup()->tableView()->setHighlightedRow( - QMAX(highlightedOrSelectedRow-popup()->tableView()->rowsPerPage(), 0) ); + TQMAX(highlightedOrSelectedRow-popup()->tableView()->rowsPerPage(), 0) ); updateTextForHighlightedRow(); return true; - case Qt::Key_PageDown: + case TQt::Key_PageDown: popup()->tableView()->setHighlightedRow( - QMIN(highlightedOrSelectedRow+popup()->tableView()->rowsPerPage(), + TQMIN(highlightedOrSelectedRow+popup()->tableView()->rowsPerPage(), popup()->tableView()->rows()-1) ); updateTextForHighlightedRow(); return true; - case Qt::Key_Home: + case TQt::Key_Home: popup()->tableView()->setHighlightedRow( 0 ); updateTextForHighlightedRow(); return true; - case Qt::Key_End: + case TQt::Key_End: popup()->tableView()->setHighlightedRow( popup()->tableView()->rows()-1 ); updateTextForHighlightedRow(); return true; - case Qt::Key_Enter: - case Qt::Key_Return: //accept + case TQt::Key_Enter: + case TQt::Key_Return: //accept //select row that is highlighted if (popup()->tableView()->highlightedRow()>=0) popup()->tableView()->selectRow( popup()->tableView()->highlightedRow() ); diff --git a/kexi/widget/tableview/kexicomboboxbase.h b/kexi/widget/tableview/kexicomboboxbase.h index 1433ab0f..f36dd822 100644 --- a/kexi/widget/tableview/kexicomboboxbase.h +++ b/kexi/widget/tableview/kexicomboboxbase.h @@ -47,12 +47,12 @@ class KEXIDATATABLE_EXPORT KexiComboBoxBase virtual KexiDB::Field *field() const = 0; //! \return the original value - virtual QVariant origValue() const = 0; + virtual TQVariant origValue() const = 0; //! Note: Generally in current implementation this is integer > 0; may be null if no value is set - virtual QVariant value(); + virtual TQVariant value(); - virtual QVariant visibleValue(); + virtual TQVariant visibleValue(); //! Reimplement this and call this impl.: used to clear internal editor virtual void clear(); @@ -75,29 +75,29 @@ class KEXIDATATABLE_EXPORT KexiComboBoxBase virtual void slotItemSelected(KexiTableItem*); //! Call this from slot - void slotInternalEditorValueChanged(const QVariant &v); + void slotInternalEditorValueChanged(const TQVariant &v); //! Implement this to return the internal editor - virtual QWidget *internalEditor() const = 0; + virtual TQWidget *internalEditor() const = 0; protected: - virtual void setValueInternal(const QVariant& add, bool removeOld); + virtual void setValueInternal(const TQVariant& add, bool removeOld); //! Used to select row item for an user-entered value \a v. //! Only for "lookup table" mode. - KexiTableItem* selectItemForEnteredValueInLookupTable(const QVariant& v); + KexiTableItem* selectItemForEnteredValueInLookupTable(const TQVariant& v); /*! \return value from \a returnFromColumn related to \a str value from column \a lookInColumn. If \a allowNulls is true, NULL is returend if no matched column found, else: \a str is returned. Example: lookInColumn=0, returnFromColumn=1 --returns user-visible string for column #1 for id-column #0 */ - QString valueForString(const QString& str, int* row, uint lookInColumn, + TQString valueForString(const TQString& str, int* row, uint lookInColumn, uint returnFromColumn, bool allowNulls = false); //! sets \a value for the line edit without setting a flag (m_userEnteredValue) that indicates that //! the text has been entered by hand (by a user) - void setValueOrTextInInternalEditor(const QVariant& value); //QString& text); + void setValueOrTextInInternalEditor(const TQVariant& value); //TQString& text); //! \return lookup field schema for this combo box, if present and if is valid (i.e. has defined row source) KexiDB::LookupFieldSchema* lookupFieldSchema() const; @@ -111,10 +111,10 @@ class KEXIDATATABLE_EXPORT KexiComboBoxBase virtual void selectAllInInternalEditor() = 0; //! Implement this to perform "set value" in the internal editor - virtual void setValueInInternalEditor(const QVariant& value) = 0; + virtual void setValueInInternalEditor(const TQVariant& value) = 0; //! Implement this to return value from the internal editor - virtual QVariant valueFromInternalEditor() = 0; + virtual TQVariant valueFromInternalEditor() = 0; //! Implement this as signal virtual void editRequested() = 0; @@ -122,9 +122,9 @@ class KEXIDATATABLE_EXPORT KexiComboBoxBase //! Implement this as signal virtual void acceptRequested() = 0; - //! 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 = 0; + //! 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 = 0; //! Implement this to return a hint for popup width. virtual int popupWidthHint() const = 0; @@ -136,20 +136,20 @@ class KEXIDATATABLE_EXPORT KexiComboBoxBase virtual KexiComboBoxPopup *popup() const = 0; virtual void setPopup(KexiComboBoxPopup *popup) = 0; - virtual QVariant visibleValueForLookupField(); + virtual TQVariant visibleValueForLookupField(); void updateTextForHighlightedRow(); - bool handleKeyPressForPopup( QKeyEvent *ke ); + bool handleKeyPressForPopup( TQKeyEvent *ke ); void acceptPopupSelection(); //! Used by KexiDBComboBox. void undoChanges(); - QVariant m_visibleValue; + TQVariant m_visibleValue; - QVariant m_userEnteredValue; //!< value (usually a text) entered by hand (by the user) + TQVariant m_userEnteredValue; //!< value (usually a text) entered by hand (by the user) bool m_internalEditorValueChanged : 1; //!< true if user has text or other value inside editor bool m_slotInternalEditorValueChanged_enabled : 1; //!< Used in slotInternalEditorValueChanged() diff --git a/kexi/widget/tableview/kexicomboboxpopup.cpp b/kexi/widget/tableview/kexicomboboxpopup.cpp index 5cd65d0d..65edd806 100644 --- a/kexi/widget/tableview/kexicomboboxpopup.cpp +++ b/kexi/widget/tableview/kexicomboboxpopup.cpp @@ -30,16 +30,16 @@ #include <kdebug.h> -#include <qlayout.h> -#include <qevent.h> +#include <tqlayout.h> +#include <tqevent.h> /*! @internal Helper for KexiComboBoxPopup. */ class KexiComboBoxPopup_KexiTableView : public KexiDataTableView { public: - KexiComboBoxPopup_KexiTableView(QWidget* parent=0) - : KexiDataTableView(parent, "KexiComboBoxPopup_tv") + KexiComboBoxPopup_KexiTableView(TQWidget* tqparent=0) + : KexiDataTableView(tqparent, "KexiComboBoxPopup_tv") { init(); } @@ -56,8 +56,8 @@ class KexiComboBoxPopup_KexiTableView : public KexiDataTableView a.rowHighlightingEnabled = true; a.rowMouseOverHighlightingEnabled = true; a.persistentSelections = false; - a.rowMouseOverHighlightingColor = colorGroup().highlight(); - a.rowMouseOverHighlightingTextColor = colorGroup().highlightedText(); + a.rowMouseOverHighlightingColor = tqcolorGroup().highlight(); + a.rowMouseOverHighlightingTextColor = tqcolorGroup().highlightedText(); a.rowHighlightingTextColor = a.rowMouseOverHighlightingTextColor; a.gridEnabled = false; setAppearance(a); @@ -68,7 +68,7 @@ class KexiComboBoxPopup_KexiTableView : public KexiDataTableView setContextMenuEnabled( false ); setScrollbarToolTipsEnabled( false ); installEventFilter(this); - setBottomMarginInternal( - horizontalScrollBar()->sizeHint().height() ); + setBottomMarginInternal( - horizontalScrollBar()->tqsizeHint().height() ); } virtual void setData( KexiTableViewData *data, bool owner = true ) { KexiTableView::setData( data, owner ); } @@ -103,16 +103,16 @@ class KexiComboBoxPopupPrivate const int KexiComboBoxPopup::defaultMaxRows = 8; -KexiComboBoxPopup::KexiComboBoxPopup(QWidget* parent, KexiTableViewColumn &column) - : QFrame( parent, "KexiComboBoxPopup", WType_Popup ) +KexiComboBoxPopup::KexiComboBoxPopup(TQWidget* tqparent, KexiTableViewColumn &column) + : TQFrame( tqparent, "KexiComboBoxPopup", WType_Popup ) { init(); //setup tv data setData(&column, 0); } -KexiComboBoxPopup::KexiComboBoxPopup(QWidget* parent, KexiDB::Field &field) - : QFrame( parent, "KexiComboBoxPopup", WType_Popup ) +KexiComboBoxPopup::KexiComboBoxPopup(TQWidget* tqparent, KexiDB::Field &field) + : TQFrame( tqparent, "KexiComboBoxPopup", WType_Popup ) { init(); //setup tv data @@ -127,21 +127,21 @@ KexiComboBoxPopup::~KexiComboBoxPopup() void KexiComboBoxPopup::init() { d = new KexiComboBoxPopupPrivate(); - setPaletteBackgroundColor(palette().color(QPalette::Active,QColorGroup::Base)); + setPaletteBackgroundColor(palette().color(TQPalette::Active,TQColorGroup::Base)); setLineWidth( 1 ); setFrameStyle( Box | Plain ); d->tv = new KexiComboBoxPopup_KexiTableView(this); installEventFilter(this); - connect(d->tv, SIGNAL(itemReturnPressed(KexiTableItem*,int,int)), - this, SLOT(slotTVItemAccepted(KexiTableItem*,int,int))); + connect(d->tv, TQT_SIGNAL(itemReturnPressed(KexiTableItem*,int,int)), + this, TQT_SLOT(slotTVItemAccepted(KexiTableItem*,int,int))); - connect(d->tv, SIGNAL(itemMouseReleased(KexiTableItem*,int,int)), - this, SLOT(slotTVItemAccepted(KexiTableItem*,int,int))); + connect(d->tv, TQT_SIGNAL(itemMouseReleased(KexiTableItem*,int,int)), + this, TQT_SLOT(slotTVItemAccepted(KexiTableItem*,int,int))); - connect(d->tv, SIGNAL(itemDblClicked(KexiTableItem*,int,int)), - this, SLOT(slotTVItemAccepted(KexiTableItem*,int,int))); + connect(d->tv, TQT_SIGNAL(itemDblClicked(KexiTableItem*,int,int)), + this, TQT_SLOT(slotTVItemAccepted(KexiTableItem*,int,int))); } void KexiComboBoxPopup::setData(KexiTableViewColumn *column, KexiDB::Field *field) @@ -166,7 +166,7 @@ void KexiComboBoxPopup::setData(KexiTableViewColumn *column, KexiDB::Field *fiel delete d->privateQuery; d->privateQuery = 0; if (lookupFieldSchema) { - const QValueList<uint> visibleColumns( lookupFieldSchema->visibleColumns() ); + const TQValueList<uint> visibleColumns( lookupFieldSchema->visibleColumns() ); const bool multipleLookupColumnJoined = visibleColumns.count() > 1; //! @todo support more RowSourceType's, not only table and query KexiDB::Cursor *cursor = 0; @@ -211,7 +211,7 @@ void KexiComboBoxPopup::setData(KexiTableViewColumn *column, KexiDB::Field *fiel uint fieldsExpandedSize( fieldsExpanded.size() ); KexiDB::BaseExpr *expr = 0; int count = visibleColumns.count(); - for (QValueList<uint>::ConstIterator it( visibleColumns.at(count-1) ); count>0; count--, --it) { + for (TQValueList<uint>::ConstIterator it( visibleColumns.at(count-1) ); count>0; count--, --it) { KexiDB::QueryColumnInfo *ci = ((*it) < fieldsExpandedSize) ? fieldsExpanded.at( *it ) : 0; if (!ci) { kdWarning() << "KexiComboBoxPopup::setData(): " << *it << " >= fieldsExpandedSize" << endl; @@ -254,11 +254,11 @@ void KexiComboBoxPopup::setData(KexiTableViewColumn *column, KexiDB::Field *fiel //! @todo errmsg return; - if (d->tv->data()) - d->tv->data()->disconnect( this ); + if (d->tv->KexiDataAwareObjectInterface::data()) + d->tv->KexiDataAwareObjectInterface::data()->disconnect( this ); d->tv->setData( cursor ); - connect( d->tv, SIGNAL(dataRefreshed()), this, SLOT(slotDataReloadRequested())); + connect( d->tv, TQT_SIGNAL(dataRefreshed()), this, TQT_SLOT(slotDataReloadRequested())); updateSize(); return; } @@ -272,10 +272,10 @@ void KexiComboBoxPopup::setData(KexiTableViewColumn *column, KexiDB::Field *fiel d->int_f = new KexiDB::Field(field->name(), KexiDB::Field::Text); KexiTableViewData *data = new KexiTableViewData(); data->addColumn( new KexiTableViewColumn( *d->int_f ) ); - QValueVector<QString> hints = field->enumHints(); + TQValueVector<TQString> hints = field->enumHints(); for(uint i=0; i < hints.size(); i++) { KexiTableItem *item = data->createItem();//new KexiTableItem(1); - (*item)[0]=QVariant(hints[i]); + (*item)[0]=TQVariant(hints[i]); kdDebug() << "added: '" << hints[i] <<"'"<<endl; data->append( item ); } @@ -284,25 +284,25 @@ void KexiComboBoxPopup::setData(KexiTableViewColumn *column, KexiDB::Field *fiel void KexiComboBoxPopup::setDataInternal( KexiTableViewData *data, bool owner ) { - if (d->tv->data()) - d->tv->data()->disconnect( this ); + if (d->tv->KexiDataAwareObjectInterface::data()) + d->tv->KexiDataAwareObjectInterface::data()->disconnect( this ); d->tv->setData( data, owner ); - connect( d->tv, SIGNAL(dataRefreshed()), this, SLOT(slotDataReloadRequested())); + connect( d->tv, TQT_SIGNAL(dataRefreshed()), this, TQT_SLOT(slotDataReloadRequested())); updateSize(); } void KexiComboBoxPopup::updateSize(int minWidth) { - const int rows = QMIN( d->max_rows, d->tv->rows() ); + const int rows = TQMIN( d->max_rows, d->tv->rows() ); d->tv->adjustColumnWidthToContents(-1); - KexiTableEdit *te = dynamic_cast<KexiTableEdit*>(parentWidget()); - const int width = QMAX( d->tv->tableSize().width(), - (te ? te->totalSize().width() : (parentWidget()?parentWidget()->width():0/*sanity*/)) ); + KexiTableEdit *te = dynamic_cast<KexiTableEdit*>(tqparentWidget()); + const int width = TQMAX( d->tv->tableSize().width(), + (te ? te->totalSize().width() : (tqparentWidget()?tqparentWidget()->width():0/*sanity*/)) ); kexidbg << "KexiComboBoxPopup::updateSize(): size=" << size() << endl; - resize( QMAX(minWidth, width)/*+(d->tv->columns()>1?2:0)*/ /*(d->updateSizeCalled?0:1)*/, d->tv->rowHeight() * rows +2 ); + resize( TQMAX(minWidth, width)/*+(d->tv->columns()>1?2:0)*/ /*(d->updateSizeCalled?0:1)*/, d->tv->rowHeight() * rows +2 ); kexidbg << "KexiComboBoxPopup::updateSize(): size after=" << size() << endl; //stretch the last column @@ -320,7 +320,7 @@ void KexiComboBoxPopup::resize( int w, int h ) d->tv->verticalScrollBar()->hide(); d->tv->move(1,1); d->tv->resize( w-2, h-2 ); - QFrame::resize(w,h); + TQFrame::resize(w,h); update(); updateGeometry(); } @@ -341,19 +341,19 @@ void KexiComboBoxPopup::slotTVItemAccepted(KexiTableItem *item, int row, int) emit rowAccepted(item, row); } -bool KexiComboBoxPopup::eventFilter( QObject *o, QEvent *e ) +bool KexiComboBoxPopup::eventFilter( TQObject *o, TQEvent *e ) { - if (o==this && e->type()==QEvent::Hide) { + if (TQT_BASE_OBJECT(o)==TQT_BASE_OBJECT(this) && e->type()==TQEvent::Hide) { emit hidden(); } - else if (e->type()==QEvent::MouseButtonPress) { - kdDebug() << "QEvent::MousePress" << endl; + else if (e->type()==TQEvent::MouseButtonPress) { + kdDebug() << "TQEvent::MousePress" << endl; } - else if (o==d->tv) { - if (e->type()==QEvent::KeyPress) { - QKeyEvent *ke = static_cast<QKeyEvent*>(e); + else if (TQT_BASE_OBJECT(o)==TQT_BASE_OBJECT(d->tv)) { + if (e->type()==TQEvent::KeyPress) { + TQKeyEvent *ke = TQT_TQKEYEVENT(e); const int k = ke->key(); - if ((ke->state()==NoButton && (k==Key_Escape || k==Key_F4)) + if ((ke->state()==Qt::NoButton && (k==Key_Escape || k==Key_F4)) || (ke->state()==AltButton && k==Key_Up)) { hide(); @@ -362,7 +362,7 @@ bool KexiComboBoxPopup::eventFilter( QObject *o, QEvent *e ) } } } - return QFrame::eventFilter( o, e ); + return TQFrame::eventFilter( o, e ); } void KexiComboBoxPopup::slotDataReloadRequested() diff --git a/kexi/widget/tableview/kexicomboboxpopup.h b/kexi/widget/tableview/kexicomboboxpopup.h index 42a15404..d78955b2 100644 --- a/kexi/widget/tableview/kexicomboboxpopup.h +++ b/kexi/widget/tableview/kexicomboboxpopup.h @@ -20,7 +20,7 @@ #ifndef KEXICOMBOBOXPOPUP_H #define KEXICOMBOBOXPOPUP_H -#include <qframe.h> +#include <tqframe.h> class KexiComboBoxPopupPrivate; class KexiTableView; @@ -32,19 +32,20 @@ namespace KexiDB { } //! Internal class for displaying popup table view -class KexiComboBoxPopup : public QFrame +class KexiComboBoxPopup : public TQFrame { Q_OBJECT + TQ_OBJECT public: //js TODO: more ctors! /*! Constructor for creating a popup using definition from \a column. If the column is lookup column, it's definition is used to display one or more column within the popup. Otherwise column.field() is used to display single-column data. */ - KexiComboBoxPopup(QWidget* parent, KexiTableViewColumn &column); + KexiComboBoxPopup(TQWidget* tqparent, KexiTableViewColumn &column); /*! Alternative constructor supporting lookup fields and enum hints. */ - KexiComboBoxPopup(QWidget* parent, KexiDB::Field &field); + KexiComboBoxPopup(TQWidget* tqparent, KexiDB::Field &field); virtual ~KexiComboBoxPopup(); @@ -59,7 +60,7 @@ class KexiComboBoxPopup : public QFrame /*! Default maximum number of rows for KexiComboBoxPopup objects. */ static const int defaultMaxRows; - virtual bool eventFilter( QObject *o, QEvent *e ); + virtual bool eventFilter( TQObject *o, TQEvent *e ); signals: void rowAccepted(KexiTableItem *item, int row); diff --git a/kexi/widget/tableview/kexicomboboxtableedit.cpp b/kexi/widget/tableview/kexicomboboxtableedit.cpp index 75815a8a..ba61e305 100644 --- a/kexi/widget/tableview/kexicomboboxtableedit.cpp +++ b/kexi/widget/tableview/kexicomboboxtableedit.cpp @@ -18,12 +18,12 @@ * Boston, MA 02110-1301, USA. */ -#include <qlayout.h> -#include <qstyle.h> -#include <qwindowsstyle.h> -#include <qpainter.h> -#include <qapplication.h> -#include <qclipboard.h> +#include <tqlayout.h> +#include <tqstyle.h> +#include <tqwindowsstyle.h> +#include <tqpainter.h> +#include <tqapplication.h> +#include <tqclipboard.h> #include "kexicomboboxtableedit.h" #include <widget/utils/kexicomboboxdropdownbutton.h> @@ -54,41 +54,41 @@ public: KPushButton *button; KexiComboBoxPopup *popup; int currentEditorWidth; - QSize totalSize; + TQSize totalSize; KexiTableViewColumn* visibleTableViewColumn; KexiTableEdit* internalEditor; }; //====================================================== -KexiComboBoxTableEdit::KexiComboBoxTableEdit(KexiTableViewColumn &column, QWidget *parent) - : KexiInputTableEdit(column, parent) +KexiComboBoxTableEdit::KexiComboBoxTableEdit(KexiTableViewColumn &column, TQWidget *tqparent) + : KexiInputTableEdit(column, tqparent) , KexiComboBoxBase() , d(new Private()) { setName("KexiComboBoxTableEdit"); m_setVisibleValueOnSetValueInternal = true; - d->button = new KexiComboBoxDropDownButton( parentWidget() /*usually a viewport*/ ); + d->button = new KexiComboBoxDropDownButton( tqparentWidget() /*usually a viewport*/ ); d->button->hide(); - d->button->setFocusPolicy( NoFocus ); - connect(d->button, SIGNAL(clicked()), this, SLOT(slotButtonClicked())); + d->button->setFocusPolicy( TQ_NoFocus ); + connect(d->button, TQT_SIGNAL(clicked()), this, TQT_SLOT(slotButtonClicked())); - connect(m_lineedit, SIGNAL(textChanged(const QString&)), this, SLOT(slotLineEditTextChanged(const QString&))); + connect(m_lineedit, TQT_SIGNAL(textChanged(const TQString&)), this, TQT_SLOT(slotLineEditTextChanged(const TQString&))); // m_lineedit = new KLineEdit(this, "lineedit"); // m_lineedit->setFrame(false); -// m_lineedit->setFrameStyle( QFrame::Plain | QFrame::Box ); +// m_lineedit->setFrameStyle( TQFrame::Plain | TQFrame::Box ); // m_lineedit->setLineWidth( 1 ); // if (f.isNumericType()) { -// m_lineedit->setAlignment(AlignRight); +// m_lineedit->tqsetAlignment(AlignRight); // } // setView( m_lineedit ); -// layout->addWidget(m_view); +// tqlayout->addWidget(m_view); // m_combo->setEditable( true ); // m_combo->clear(); // m_combo->insertStringList(f.enumHints()); -// QStringList::ConstIterator it, end( f.enumHints().constEnd() ); +// TQStringList::ConstIterator it, end( f.enumHints().constEnd() ); // for ( it = f.enumHints().constBegin(); it != end; ++it) { // if(!hints.at(i).isEmpty()) // m_combo->insertItem(hints.at(i)); @@ -138,7 +138,7 @@ void KexiComboBoxTableEdit::setPopup(KexiComboBoxPopup *popup) d->popup = popup; } -void KexiComboBoxTableEdit::showFocus( const QRect& r, bool readOnly ) +void KexiComboBoxTableEdit::showFocus( const TQRect& r, bool readOnly ) { // d->button->move( pos().x()+ width(), pos().y() ); updateFocus( r ); @@ -151,13 +151,13 @@ void KexiComboBoxTableEdit::showFocus( const QRect& r, bool readOnly ) void KexiComboBoxTableEdit::resize(int w, int h) { - d->totalSize = QSize(w,h); + d->totalSize = TQSize(w,h); if (!column()->isReadOnly()) { d->button->resize( h, h ); - QWidget::resize(w - d->button->width(), h); + TQWidget::resize(w - d->button->width(), h); } m_rightMarginWhenFocused = m_rightMargin + (column()->isReadOnly() ? 0 : d->button->width()); - QRect r( pos().x(), pos().y(), w+1, h+1 ); + TQRect r( pos().x(), pos().y(), w+1, h+1 ); if (m_scrollView) r.moveBy(m_scrollView->contentsX(), m_scrollView->contentsY()); updateFocus( r ); @@ -167,7 +167,7 @@ void KexiComboBoxTableEdit::resize(int w, int h) } // internal -void KexiComboBoxTableEdit::updateFocus( const QRect& r ) +void KexiComboBoxTableEdit::updateFocus( const TQRect& r ) { if (!column()->isReadOnly()) { if (d->button->width() > r.width()) @@ -182,14 +182,14 @@ void KexiComboBoxTableEdit::hideFocus() d->button->hide(); } -QVariant KexiComboBoxTableEdit::visibleValue() +TQVariant KexiComboBoxTableEdit::visibleValue() { return KexiComboBoxBase::visibleValue(); /* KexiDB::LookupFieldSchema *lookupFieldSchema = this->lookupFieldSchema(); if (!popup() || !lookupFieldSchema) - return QVariant(); + return TQVariant(); KexiTableItem *it = popup()->tableView()->selectedItem(); - return it ? it->at( lookupFieldSchema->visibleColumn() ) : QVariant();*/ + return it ? it->at( lookupFieldSchema->visibleColumn() ) : TQVariant();*/ } void KexiComboBoxTableEdit::clear() @@ -206,7 +206,7 @@ bool KexiComboBoxTableEdit::valueChanged() return res == true; } -void KexiComboBoxTableEdit::paintFocusBorders( QPainter *p, QVariant &, int x, int y, int w, int h ) +void KexiComboBoxTableEdit::paintFocusBorders( TQPainter *p, TQVariant &, int x, int y, int w, int h ) { // d->currentEditorWidth = w; if (!column()->isReadOnly()) { @@ -216,8 +216,8 @@ void KexiComboBoxTableEdit::paintFocusBorders( QPainter *p, QVariant &, int x, i p->drawRect(x, y, w, h); } -void KexiComboBoxTableEdit::setupContents( QPainter *p, bool focused, const QVariant& val, - QString &txt, int &align, int &x, int &y_offset, int &w, int &h ) +void KexiComboBoxTableEdit::setupContents( TQPainter *p, bool focused, const TQVariant& val, + TQString &txt, int &align, int &x, int &y_offset, int &w, int &h ) { if (d->internalEditor) { d->internalEditor->setupContents( p, focused, val, txt, align, x, y_offset, w, h ); @@ -295,18 +295,18 @@ void KexiComboBoxTableEdit::show() } } -bool KexiComboBoxTableEdit::handleKeyPress( QKeyEvent *ke, bool editorActive ) +bool KexiComboBoxTableEdit::handleKeyPress( TQKeyEvent *ke, bool editorActive ) { const int k = ke->key(); - if ((ke->state()==NoButton && k==Qt::Key_F4) - || (ke->state()==AltButton && k==Qt::Key_Down)) + if ((ke->state()==Qt::NoButton && k==TQt::Key_F4) + || (ke->state()==AltButton && k==TQt::Key_Down)) { //show popup slotButtonClicked(); return true; } else if (editorActive) { - 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) { createPopup(false); selectItemForEnteredValueInLookupTable( m_userEnteredValue ); @@ -319,52 +319,52 @@ bool KexiComboBoxTableEdit::handleKeyPress( QKeyEvent *ke, bool editorActive ) return false; } -void KexiComboBoxTableEdit::slotLineEditTextChanged(const QString& s) +void KexiComboBoxTableEdit::slotLineEditTextChanged(const TQString& s) { slotInternalEditorValueChanged(s); } -int KexiComboBoxTableEdit::widthForValue( QVariant &val, const QFontMetrics &fm ) +int KexiComboBoxTableEdit::widthForValue( TQVariant &val, const TQFontMetrics &fm ) { KexiTableViewData *relData = column() ? column()->relatedData() : 0; if (lookupFieldSchema() || relData) { // in 'lookupFieldSchema' or or 'related table data' model // we're assuming val is already the text, not the index //! @todo ok? - return QMAX(KEXITV_MINIMUM_COLUMN_WIDTH, fm.width(val.toString())); + return TQMAX(KEXITV_MINIMUM_COLUMN_WIDTH, fm.width(val.toString())); } //use 'enum hints' model - QValueVector<QString> hints = field()->enumHints(); + TQValueVector<TQString> hints = field()->enumHints(); bool ok; int idx = val.toInt(&ok); if (!ok || idx < 0 || idx > int(hints.size()-1)) return KEXITV_MINIMUM_COLUMN_WIDTH; - QString txt = hints.at( idx, &ok ); + TQString txt = hints.at( idx, &ok ); if (!ok) return KEXITV_MINIMUM_COLUMN_WIDTH; return fm.width( txt ); } -bool KexiComboBoxTableEdit::eventFilter( QObject *o, QEvent *e ) +bool KexiComboBoxTableEdit::eventFilter( TQObject *o, TQEvent *e ) { - if (!column()->isReadOnly() && e->type()==QEvent::MouseButtonPress && m_scrollView) { - QPoint gp = static_cast<QMouseEvent*>(e)->globalPos() - + QPoint(m_scrollView->childX(d->button), m_scrollView->childY(d->button)); - QRect r(d->button->mapToGlobal(d->button->geometry().topLeft()), - d->button->mapToGlobal(d->button->geometry().bottomRight())); - if (o==popup() && popup()->isVisible() && r.contains( gp )) { + if (!column()->isReadOnly() && e->type()==TQEvent::MouseButtonPress && m_scrollView) { + TQPoint gp = TQT_TQMOUSEEVENT(e)->globalPos() + + TQPoint(m_scrollView->childX(d->button), m_scrollView->childY(d->button)); + TQRect r(d->button->mapToGlobal(d->button->tqgeometry().topLeft()), + d->button->mapToGlobal(d->button->tqgeometry().bottomRight())); + if (TQT_BASE_OBJECT(o)==TQT_BASE_OBJECT(popup()) && popup()->isVisible() && r.tqcontains( gp )) { m_mouseBtnPressedWhenPopupVisible = true; } } return false; } -QSize KexiComboBoxTableEdit::totalSize() const +TQSize KexiComboBoxTableEdit::totalSize() const { return d->totalSize; } -QWidget *KexiComboBoxTableEdit::internalEditor() const +TQWidget *KexiComboBoxTableEdit::internalEditor() const { return m_lineedit; } @@ -394,37 +394,37 @@ void KexiComboBoxTableEdit::selectAll() m_lineedit->selectAll(); } -void KexiComboBoxTableEdit::setValueInInternalEditor(const QVariant& value) +void KexiComboBoxTableEdit::setValueInInternalEditor(const TQVariant& value) { m_lineedit->setText(value.toString()); } -QVariant KexiComboBoxTableEdit::valueFromInternalEditor() +TQVariant KexiComboBoxTableEdit::valueFromInternalEditor() { return m_lineedit->text(); } -QPoint KexiComboBoxTableEdit::mapFromParentToGlobal(const QPoint& pos) const +TQPoint KexiComboBoxTableEdit::mapFromParentToGlobal(const TQPoint& pos) const { KexiTableView *tv = dynamic_cast<KexiTableView*>(m_scrollView); if (!tv) - return QPoint(-1,-1); + return TQPoint(-1,-1); return tv->viewport()->mapToGlobal(pos); } int KexiComboBoxTableEdit::popupWidthHint() const { - return m_lineedit->width() + m_leftMargin + m_rightMarginWhenFocused; //QMAX(popup()->width(), d->currentEditorWidth); + return m_lineedit->width() + m_leftMargin + m_rightMarginWhenFocused; //TQMAX(popup()->width(), d->currentEditorWidth); } -void KexiComboBoxTableEdit::handleCopyAction(const QVariant& value, const QVariant& visibleValue) +void KexiComboBoxTableEdit::handleCopyAction(const TQVariant& value, const TQVariant& visibleValue) { Q_UNUSED(value); //! @todo does not work with BLOBs! - qApp->clipboard()->setText( visibleValue.toString() ); + tqApp->clipboard()->setText( visibleValue.toString() ); } -void KexiComboBoxTableEdit::handleAction(const QString& actionName) +void KexiComboBoxTableEdit::handleAction(const TQString& actionName) { const bool alreadyVisible = m_lineedit->isVisible(); @@ -434,7 +434,7 @@ void KexiComboBoxTableEdit::handleAction(const QString& actionName) m_lineedit->clear(); } //! @todo does not work with BLOBs! - setValueInInternalEditor( qApp->clipboard()->text() ); + setValueInInternalEditor( tqApp->tqclipboard()->text() ); } else KexiInputTableEdit::handleAction(actionName); diff --git a/kexi/widget/tableview/kexicomboboxtableedit.h b/kexi/widget/tableview/kexicomboboxtableedit.h index 713fa55e..7b8a7339 100644 --- a/kexi/widget/tableview/kexicomboboxtableedit.h +++ b/kexi/widget/tableview/kexicomboboxtableedit.h @@ -37,9 +37,10 @@ class KexiTableViewColumn; class KexiComboBoxTableEdit : public KexiInputTableEdit, public KexiComboBoxBase { Q_OBJECT + TQ_OBJECT public: - KexiComboBoxTableEdit(KexiTableViewColumn &column, QWidget *parent=0); + KexiComboBoxTableEdit(KexiTableViewColumn &column, TQWidget *tqparent=0); virtual ~KexiComboBoxTableEdit(); //! Implemented for KexiComboBoxBase @@ -49,55 +50,55 @@ class KexiComboBoxTableEdit : public KexiInputTableEdit, public KexiComboBoxBase virtual KexiDB::Field *field() const { return m_column->field(); } //! Implemented for KexiComboBoxBase - virtual QVariant origValue() const { return m_origValue; } + virtual TQVariant origValue() const { return m_origValue; } - virtual void setValueInternal(const QVariant& add, bool removeOld) + virtual void setValueInternal(const TQVariant& add, bool removeOld) { KexiComboBoxBase::setValueInternal(add, removeOld); } - virtual QVariant value() { return KexiComboBoxBase::value(); } + virtual TQVariant value() { return KexiComboBoxBase::value(); } virtual void clear(); virtual bool valueChanged(); - virtual QVariant visibleValue(); + virtual TQVariant visibleValue(); /*! Reimplemented: resizes a view(). */ virtual void resize(int w, int h); - virtual void showFocus( const QRect& r, bool readOnly ); + virtual void showFocus( const TQRect& r, bool readOnly ); virtual void hideFocus(); - virtual void paintFocusBorders( QPainter *p, QVariant &cal, int x, int y, int w, int h ); + virtual void paintFocusBorders( TQPainter *p, TQVariant &cal, int x, int y, int w, int h ); /*! Setups contents of the cell. As a special case, if there is lookup field schema defined, \a val already contains the visible value (usually the text) set by \ref KexiTableView::paintcell(), so there is noo need to lookup the value in the combo box's popup. */ - virtual void setupContents( QPainter *p, bool focused, const QVariant& val, - QString &txt, int &align, int &x, int &y_offset, int &w, int &h ); + virtual void setupContents( TQPainter *p, bool focused, const TQVariant& val, + TQString &txt, int &align, int &x, int &y_offset, int &w, int &h ); /*! Used to handle key press events for the item. */ - virtual bool handleKeyPress( QKeyEvent *ke, bool editorActive ); + virtual bool handleKeyPress( TQKeyEvent *ke, bool editorActive ); - virtual int widthForValue( QVariant &val, const QFontMetrics &fm ); + virtual int widthForValue( TQVariant &val, const TQFontMetrics &fm ); virtual void hide(); virtual void show(); /*! \return total size of this editor, including popup button. */ - virtual QSize totalSize() const; + virtual TQSize totalSize() const; virtual void createInternalEditor(KexiDB::QuerySchema& schema); /*! Reimplemented after KexiInputTableEdit. */ - virtual void handleAction(const QString& actionName); + virtual void handleAction(const TQString& actionName); /*! Reimplemented after KexiInputTableEdit. For a special case (combo box), \a visibleValue can be provided, so it can be copied to the clipboard instead of unreadable \a value. */ - virtual void handleCopyAction(const QVariant& value, const QVariant& visibleValue); + virtual void handleCopyAction(const TQVariant& value, const TQVariant& visibleValue); public slots: //! Implemented for KexiDataItemInterface @@ -113,19 +114,19 @@ class KexiComboBoxTableEdit : public KexiInputTableEdit, public KexiComboBoxBase void slotButtonClicked(); void slotRowAccepted(KexiTableItem *item, int row) { KexiComboBoxBase::slotRowAccepted(item, row); } void slotItemSelected(KexiTableItem* item) { KexiComboBoxBase::slotItemSelected(item); } - void slotInternalEditorValueChanged(const QVariant& v) + void slotInternalEditorValueChanged(const TQVariant& v) { KexiComboBoxBase::slotInternalEditorValueChanged(v); } - void slotLineEditTextChanged(const QString& s); + void slotLineEditTextChanged(const TQString& s); void slotPopupHidden(); protected: //! internal - void updateFocus( const QRect& r ); + void updateFocus( const TQRect& r ); - virtual bool eventFilter( QObject *o, QEvent *e ); + virtual bool eventFilter( TQObject *o, TQEvent *e ); //! Implemented for KexiComboBoxBase - virtual QWidget *internalEditor() const; + virtual TQWidget *internalEditor() const; //! Implemented for KexiComboBoxBase virtual void moveCursorToEndInInternalEditor(); @@ -134,10 +135,10 @@ class KexiComboBoxTableEdit : public KexiInputTableEdit, public KexiComboBoxBase 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() { KexiInputTableEdit::editRequested(); } @@ -146,7 +147,7 @@ class KexiComboBoxTableEdit : public KexiInputTableEdit, public KexiComboBoxBase virtual void acceptRequested() { KexiInputTableEdit::acceptRequested(); } //! Implemented for KexiComboBoxBase - virtual QPoint mapFromParentToGlobal(const QPoint& pos) const; + virtual TQPoint mapFromParentToGlobal(const TQPoint& pos) const; //! Implemented for KexiComboBoxBase virtual int popupWidthHint() const; diff --git a/kexi/widget/tableview/kexidataawareobjectiface.cpp b/kexi/widget/tableview/kexidataawareobjectiface.cpp index 59edbed3..5c90eb06 100644 --- a/kexi/widget/tableview/kexidataawareobjectiface.cpp +++ b/kexi/widget/tableview/kexidataawareobjectiface.cpp @@ -25,9 +25,9 @@ #include "kexidataawareobjectiface.h" -#include <qscrollview.h> -#include <qlabel.h> -#include <qtooltip.h> +#include <tqscrollview.h> +#include <tqlabel.h> +#include <tqtooltip.h> #include <kmessagebox.h> @@ -79,13 +79,13 @@ KexiDataAwareObjectInterface::KexiDataAwareObjectInterface() m_recentSearchDirection = KexiSearchAndReplaceViewInterface::Options::DefaultSearchDirection; // setup scrollbar tooltip and related members - m_scrollBarTip = new QLabel("",0, "vScrollBarToolTip", - Qt::WStyle_Customize |Qt::WStyle_NoBorder|Qt::WX11BypassWM|Qt::WStyle_StaysOnTop|Qt::WStyle_Tool); - m_scrollBarTip->setPalette(QToolTip::palette()); + m_scrollBarTip = new TQLabel("",0, "vScrollBarToolTip", + TQt::WStyle_Customize |TQt::WStyle_NoBorder|TQt::WX11BypassWM|TQt::WStyle_StaysOnTop|TQt::WStyle_Tool); + m_scrollBarTip->setPalette(TQToolTip::palette()); m_scrollBarTip->setMargin(2); m_scrollBarTip->setIndent(0); - m_scrollBarTip->setAlignment(Qt::AlignCenter); - m_scrollBarTip->setFrameStyle( QFrame::Plain | QFrame::Box ); + m_scrollBarTip->tqsetAlignment(TQt::AlignCenter); + m_scrollBarTip->setFrameStyle( TQFrame::Plain | TQFrame::Box ); m_scrollBarTip->setLineWidth(1); clearVariables(); @@ -142,7 +142,7 @@ void KexiDataAwareObjectInterface::setData( KexiTableViewData *data, bool owner wid=KEXI_DEFAULT_DATA_COLUMN_WIDTH;//default col width in pixels //! @todo add col width configuration and storage addHeaderColumn(it.current()->isHeaderTextVisible() - ? it.current()->captionAliasOrName() : QString::null, + ? it.current()->captionAliasOrName() : TQString(), f->description(), it.current()->icon(), wid); } } @@ -158,29 +158,29 @@ void KexiDataAwareObjectInterface::setData( KexiTableViewData *data, bool owner if (m_data && !theSameData) { //! @todo: store sorting settings? setSorting(-1); -// connect(m_data, SIGNAL(refreshRequested()), this, SLOT(slotRefreshRequested())); - connectToReloadDataSlot(m_data, SIGNAL(reloadRequested())); - QObject* thisObject = dynamic_cast<QObject*>(this); +// connect(m_data, TQT_SIGNAL(refreshRequested()), this, TQT_SLOT(slotRefreshRequested())); + connectToReloadDataSlot(m_data, TQT_SIGNAL(reloadRequested())); + TQObject* thisObject = dynamic_cast<TQObject*>(this); if (thisObject) { - QObject::connect(m_data, SIGNAL(destroying()), thisObject, SLOT(slotDataDestroying())); - QObject::connect(m_data, SIGNAL(rowsDeleted( const QValueList<int> & )), - thisObject, SLOT(slotRowsDeleted( const QValueList<int> & ))); - QObject::connect(m_data, SIGNAL(aboutToDeleteRow(KexiTableItem&,KexiDB::ResultInfo*,bool)), - thisObject, SLOT(slotAboutToDeleteRow(KexiTableItem&,KexiDB::ResultInfo*,bool))); - QObject::connect(m_data, SIGNAL(rowDeleted()), thisObject, SLOT(slotRowDeleted())); - QObject::connect(m_data, SIGNAL(rowInserted(KexiTableItem*,bool)), - thisObject, SLOT(slotRowInserted(KexiTableItem*,bool))); - QObject::connect(m_data, SIGNAL(rowInserted(KexiTableItem*,uint,bool)), - thisObject, SLOT(slotRowInserted(KexiTableItem*,uint,bool))); //not db-aware - QObject::connect(m_data, SIGNAL(rowRepaintRequested(KexiTableItem&)), - thisObject, SLOT(slotRowRepaintRequested(KexiTableItem&))); + TQObject::connect(m_data, TQT_SIGNAL(destroying()), thisObject, TQT_SLOT(slotDataDestroying())); + TQObject::connect(m_data, TQT_SIGNAL(rowsDeleted( const TQValueList<int> & )), + thisObject, TQT_SLOT(slotRowsDeleted( const TQValueList<int> & ))); + TQObject::connect(m_data, TQT_SIGNAL(aboutToDeleteRow(KexiTableItem&,KexiDB::ResultInfo*,bool)), + thisObject, TQT_SLOT(slotAboutToDeleteRow(KexiTableItem&,KexiDB::ResultInfo*,bool))); + TQObject::connect(m_data, TQT_SIGNAL(rowDeleted()), thisObject, TQT_SLOT(slotRowDeleted())); + TQObject::connect(m_data, TQT_SIGNAL(rowInserted(KexiTableItem*,bool)), + thisObject, TQT_SLOT(slotRowInserted(KexiTableItem*,bool))); + TQObject::connect(m_data, TQT_SIGNAL(rowInserted(KexiTableItem*,uint,bool)), + thisObject, TQT_SLOT(slotRowInserted(KexiTableItem*,uint,bool))); //not db-aware + TQObject::connect(m_data, TQT_SIGNAL(rowRepaintRequested(KexiTableItem&)), + thisObject, TQT_SLOT(slotRowRepaintRequested(KexiTableItem&))); // setup scrollbar's tooltip - QObject::connect(verticalScrollBar(),SIGNAL(sliderReleased()), - thisObject,SLOT(vScrollBarSliderReleased())); - QObject::connect(verticalScrollBar(),SIGNAL(valueChanged(int)), - thisObject,SLOT(vScrollBarValueChanged(int))); - QObject::connect(&m_scrollBarTipTimer,SIGNAL(timeout()), - thisObject,SLOT(scrollBarTipTimeout())); + TQObject::connect(verticalScrollBar(),TQT_SIGNAL(sliderReleased()), + thisObject,TQT_SLOT(vScrollBarSliderReleased())); + TQObject::connect(verticalScrollBar(),TQT_SIGNAL(valueChanged(int)), + thisObject,TQT_SLOT(vScrollBarValueChanged(int))); + TQObject::connect(&m_scrollBarTipTimer,TQT_SIGNAL(timeout()), + thisObject,TQT_SLOT(scrollBarTipTimeout())); } } @@ -214,7 +214,7 @@ void KexiDataAwareObjectInterface::setData( KexiTableViewData *data, bool owner void KexiDataAwareObjectInterface::initDataContents() { m_editor = 0; -// QSize s(tableSize()); +// TQSize s(tableSize()); // resizeContents(s.width(),s.height()); m_navPanel->setRecordCount(rows()); @@ -306,7 +306,7 @@ bool KexiDataAwareObjectInterface::sort() return true; } if (m_currentItem != m_insertItem) { - m_curRow = m_data->findRef(m_currentItem); + m_curRow = m_data->tqfindRef(m_currentItem); int jump = m_curRow - oldRow; if (jump<0) (*m_itemIterator) -= -jump; @@ -440,20 +440,20 @@ void KexiDataAwareObjectInterface::setSpreadSheetMode() void KexiDataAwareObjectInterface::selectNextRow() { - selectRow( QMIN( rows() - 1 +(isInsertingEnabled()?1:0), m_curRow + 1 ) ); + selectRow( TQMIN( rows() - 1 +(isInsertingEnabled()?1:0), m_curRow + 1 ) ); } void KexiDataAwareObjectInterface::selectPrevPage() { selectRow( - QMAX( 0, m_curRow - rowsPerPage() ) + TQMAX( 0, m_curRow - rowsPerPage() ) ); } void KexiDataAwareObjectInterface::selectNextPage() { selectRow( - QMIN( + TQMIN( rows() - 1 + (isInsertingEnabled()?1:0), m_curRow + rowsPerPage() ) @@ -480,7 +480,7 @@ void KexiDataAwareObjectInterface::selectRow(int row) void KexiDataAwareObjectInterface::selectPrevRow() { - selectRow( QMAX( 0, m_curRow - 1 ) ); + selectRow( TQMAX( 0, m_curRow - 1 ) ); } void KexiDataAwareObjectInterface::clearSelection() @@ -524,23 +524,23 @@ void KexiDataAwareObjectInterface::setCursorPosition(int row, int col/*=-1*/, bo if(col>=0) { - newcol = QMAX(0, col); - newcol = QMIN(columns() - 1, newcol); + newcol = TQMAX(0, col); + newcol = TQMIN(columns() - 1, newcol); } else { newcol = m_curCol; //no changes - newcol = QMAX(0, newcol); //may not be < 0 ! + newcol = TQMAX(0, newcol); //may not be < 0 ! } - newrow = QMAX(0, row); - newrow = QMIN(rows() - 1 + (isInsertingEnabled()?1:0), newrow); + newrow = TQMAX(0, row); + newrow = TQMIN(rows() - 1 + (isInsertingEnabled()?1:0), newrow); // d->pCurrentItem = itemAt(d->curRow); // kdDebug(44021) << "setCursorPosition(): d->curRow=" << d->curRow << " oldRow=" << oldRow << " d->curCol=" << d->curCol << " oldCol=" << oldCol << endl; if ( forceSet || m_curRow != newrow || m_curCol != newcol ) { - kexidbg << "setCursorPosition(): " <<QString("old:%1,%2 new:%3,%4").arg(m_curCol) - .arg(m_curRow).arg(newcol).arg(newrow) << endl; + kexidbg << "setCursorPosition(): " <<TQString("old:%1,%2 new:%3,%4").tqarg(m_curCol) + .tqarg(m_curRow).tqarg(newcol).tqarg(newrow) << endl; // cursor moved: get rid of editor if (m_editor) { @@ -549,7 +549,7 @@ void KexiDataAwareObjectInterface::setCursorPosition(int row, int col/*=-1*/, bo return; } //update row num. again - newrow = QMIN( rows() - 1 + (isInsertingEnabled()?1:0), newrow); + newrow = TQMIN( rows() - 1 + (isInsertingEnabled()?1:0), newrow); } } if (m_errorMessagePopup) { @@ -574,7 +574,7 @@ void KexiDataAwareObjectInterface::setCursorPosition(int row, int col/*=-1*/, bo return; } //update row number, because number of rows changed - newrow = QMIN( rows() - 1 + (isInsertingEnabled()?1:0), newrow); + newrow = TQMIN( rows() - 1 + (isInsertingEnabled()?1:0), newrow); m_navPanel->setCurrentRecordNumber(newrow+1); //refresh } @@ -621,7 +621,7 @@ void KexiDataAwareObjectInterface::setCursorPosition(int row, int col/*=-1*/, bo // //quite clever: ensure the cell is visible: // ensureCellVisible(m_curRow, m_curCol); -// QPoint pcenter = QRect( columnPos(d->curCol), rowPos(d->curRow), columnWidth(d->curCol), rh).center(); +// TQPoint pcenter = TQRect( columnPos(d->curCol), rowPos(d->curRow), columnWidth(d->curCol), rh).center(); // ensureVisible(pcenter.x(), pcenter.y(), columnWidth(d->curCol)/2, rh/2); // ensureVisible(columnPos(d->curCol), rowPos(d->curRow) - contentsY(), columnWidth(d->curCol), rh); @@ -644,8 +644,8 @@ void KexiDataAwareObjectInterface::setCursorPosition(int row, int col/*=-1*/, bo m_currentItem = m_insertItem; } else { - kdDebug(44021) << QString("NOW item at %1 (%2) is current") - .arg(m_curRow).arg((ulong)itemAt(m_curRow)) << endl; + kdDebug(44021) << TQString("NOW item at %1 (%2) is current") + .tqarg(m_curRow).tqarg((ulong)itemAt(m_curRow)) << endl; //NOT EFFECTIVE!!!!!!!!!!! //set item iterator if (!newRowInserted && isInsertingEnabled() && m_currentItem == m_insertItem && m_curRow == (rows()-1)) { @@ -710,7 +710,7 @@ bool KexiDataAwareObjectInterface::acceptRowEdit() // bool allow = true; // int faultyColumn = -1; // will be !=-1 if cursor has to be moved to that column const bool inserting = m_newRowEditing; -// QString msg, desc; +// TQString msg, desc; // bool inserting = d->pInsertItem && d->pInsertItem==d->pCurrentItem; if (m_data->rowEditBuffer()->isEmpty() && !m_newRowEditing) { @@ -838,8 +838,8 @@ bool KexiDataAwareObjectInterface::cancelRowEdit() // viewport()->width(), d->rowHeight*3 + (m_navPanel ? m_navPanel->height() : 0)*3 ); // updateContents(); //js: above did not work well so we do that dirty updateWidgetContents(); -//TODO: still doesn't repaint properly!! -// QSize s(tableSize()); +//TODO: still doesn't tqrepaint properly!! +// TQSize s(tableSize()); // resizeContents(s.width(), s.height()); updateWidgetContentsSize(); // m_verticalHeader->update(); @@ -890,17 +890,17 @@ bool KexiDataAwareObjectInterface::cancelEditor() } //! @internal -class KexiDataAwareObjectInterfaceToolTip : public QToolTip { +class KexiDataAwareObjectInterfaceToolTip : public TQToolTip { public: - KexiDataAwareObjectInterfaceToolTip( const QString & text, const QPoint & pos, QWidget * widget ) - : QToolTip(widget), m_text(text) + KexiDataAwareObjectInterfaceToolTip( const TQString & text, const TQPoint & pos, TQWidget * widget ) + : TQToolTip(widget), m_text(text) { - tip( QRect(pos, QSize(100, 100)), text ); + tip( TQRect(pos, TQSize(100, 100)), text ); } - virtual void maybeTip(const QPoint & p) { - tip( QRect(p, QSize(100, 100)), m_text); + virtual void maybeTip(const TQPoint & p) { + tip( TQRect(p, TQSize(100, 100)), m_text); } - QString m_text; + TQString m_text; }; bool KexiDataAwareObjectInterface::acceptEditor() @@ -912,12 +912,12 @@ bool KexiDataAwareObjectInterface::acceptEditor() m_inside_acceptEditor = true;//avoid recursion - QVariant newval; + TQVariant newval; Validator::Result res = Validator::Ok; - QString msg, desc; + TQString msg, desc; bool setNull = false; // bool allow = true; -// static const QString msg_NOT_NULL = i18n("\"%1\" column requires a value to be entered."); +// static const TQString msg_NOT_NULL = i18n("\"%1\" column requires a value to be entered."); //autoincremented field can be omitted (left as null or empty) if we're inserting a new row const bool autoIncColumnCanBeOmitted = m_newRowEditing && m_editor->field()->isAutoIncrement(); @@ -931,19 +931,19 @@ bool KexiDataAwareObjectInterface::acceptEditor() //used e.g. for date or time values - the value can be null but not necessary invalid res = Validator::Error; editCurrentCellAgain = true; - QWidget *par = dynamic_cast<QScrollView*>(this) ? dynamic_cast<QScrollView*>(this)->viewport() : - dynamic_cast<QWidget*>(this); - QWidget *edit = dynamic_cast<QWidget*>(m_editor); + TQWidget *par = dynamic_cast<TQScrollView*>(this) ? dynamic_cast<TQScrollView*>(this)->viewport() : + dynamic_cast<TQWidget*>(this); + TQWidget *edit = dynamic_cast<TQWidget*>(m_editor); if (par && edit) { //! @todo allow displaying user-defined warning //! @todo also use for other error messages if (!m_errorMessagePopup) { // m_errorMessagePopup->close(); m_errorMessagePopup = new KexiArrowTip( - i18n("Error: %1").arg(m_editor->columnInfo()->field->typeName())+"?", - dynamic_cast<QWidget*>(this)); + i18n("Error: %1").tqarg(m_editor->columnInfo()->field->typeName())+"?", + dynamic_cast<TQWidget*>(this)); m_errorMessagePopup->move( - par->mapToGlobal(edit->pos()) + QPoint(6, edit->height() + 0) ); + par->mapToGlobal(edit->pos()) + TQPoint(6, edit->height() + 0) ); m_errorMessagePopup->show(); } m_editor->setFocus(); @@ -954,8 +954,8 @@ bool KexiDataAwareObjectInterface::acceptEditor() if (m_editor->field()->isNotNull() && !autoIncColumnCanBeOmitted) { kdDebug() << "KexiDataAwareObjectInterface::acceptEditor(): NULL NOT ALLOWED!" << endl; res = Validator::Error; -// msg = Validator::msgColumnNotEmpty().arg(m_editor->columnInfo()->field->captionOrName()) - msg = Validator::msgColumnNotEmpty().arg(m_editor->field()->captionOrName()) +// msg = Validator::msgColumnNotEmpty().tqarg(m_editor->columnInfo()->field->captionOrName()) + msg = Validator::msgColumnNotEmpty().tqarg(m_editor->field()->captionOrName()) + "\n\n" + Kexi::msgYouCanImproveData(); desc = i18n("The column's constraint is declared as NOT NULL."); editCurrentCellAgain = true; @@ -976,8 +976,8 @@ bool KexiDataAwareObjectInterface::acceptEditor() if (m_editor->field()->isNotEmpty() && !autoIncColumnCanBeOmitted) { kdDebug() << "KexiDataAwareObjectInterface::acceptEditor(): EMPTY NOT ALLOWED!" << endl; res = Validator::Error; -// msg = Validator::msgColumnNotEmpty().arg(m_editor->columnInfo()->field->captionOrName()) - msg = Validator::msgColumnNotEmpty().arg(m_editor->field()->captionOrName()) +// msg = Validator::msgColumnNotEmpty().tqarg(m_editor->columnInfo()->field->captionOrName()) + msg = Validator::msgColumnNotEmpty().tqarg(m_editor->field()->captionOrName()) + "\n\n" + Kexi::msgYouCanImproveData(); desc = i18n("The column's constraint is declared as NOT EMPTY."); editCurrentCellAgain = true; @@ -994,8 +994,8 @@ bool KexiDataAwareObjectInterface::acceptEditor() if (m_editor->field()->isNotNull() && !autoIncColumnCanBeOmitted) { kdDebug() << "KexiDataAwareObjectInterface::acceptEditor(): NEITHER NULL NOR EMPTY VALUE CAN BE SET!" << endl; res = Validator::Error; -// msg = Validator::msgColumnNotEmpty().arg(m_editor->columnInfo()->field->captionOrName()) - msg = Validator::msgColumnNotEmpty().arg(m_editor->field()->captionOrName()) +// msg = Validator::msgColumnNotEmpty().tqarg(m_editor->columnInfo()->field->captionOrName()) + msg = Validator::msgColumnNotEmpty().tqarg(m_editor->field()->captionOrName()) + "\n\n" + Kexi::msgYouCanImproveData(); desc = i18n("The column's constraint is declared as NOT EMPTY and NOT NULL."); editCurrentCellAgain = true; @@ -1064,16 +1064,16 @@ bool KexiDataAwareObjectInterface::acceptEditor() if (res == Validator::Error) { if (!msg.isEmpty()) { if (desc.isEmpty()) - KMessageBox::sorry(dynamic_cast<QWidget*>(this), msg); + KMessageBox::sorry(dynamic_cast<TQWidget*>(this), msg); else - KMessageBox::detailedSorry(dynamic_cast<QWidget*>(this), msg, desc); + KMessageBox::detailedSorry(dynamic_cast<TQWidget*>(this), msg, desc); } editCurrentCellAgain = true; // allow = false; } else if (res == Validator::Warning) { //js: todo: message!!! - KMessageBox::messageBox(dynamic_cast<QWidget*>(this), KMessageBox::Sorry, msg + "\n" + desc); + KMessageBox::messageBox(dynamic_cast<TQWidget*>(this), KMessageBox::Sorry, msg + "\n" + desc); editCurrentCellAgain = true; } @@ -1083,7 +1083,7 @@ bool KexiDataAwareObjectInterface::acceptEditor() // emit aboutToChangeCell(d->pCurrentItem, newval, allow); // if (allow) { //send changes to the backend - QVariant visibleValue; + TQVariant visibleValue; if (!newval.isNull()/* visible value should be null if value is null */ && currentTVColumn->visibleLookupColumnInfo) { @@ -1139,13 +1139,13 @@ bool KexiDataAwareObjectInterface::acceptEditor() m_editor->showWidget(); m_editor->setFocus(); } -// startEditCurrentCell(newval.type()==QVariant::String ? newval.toString() : QString::null); +// startEditCurrentCell(newval.type()==TQVariant::String ? newval.toString() : TQString()); // m_editor->setFocus(); } return false; } -void KexiDataAwareObjectInterface::startEditCurrentCell(const QString &setText) +void KexiDataAwareObjectInterface::startEditCurrentCell(const TQString &setText) { kdDebug() << "** KexiDataAwareObjectInterface::startEditCurrentCell("<<setText<<")"<<endl; // if (columnType(d->curCol) == KexiDB::Field::Boolean) @@ -1180,7 +1180,7 @@ void KexiDataAwareObjectInterface::deleteAndStartEditCurrentCell() // columnWidth(m_curCol), rowHeight()); //OK? ensureCellVisible(m_curRow+1, m_curCol); - createEditor(m_curRow, m_curCol, QString::null, false/*removeOld*/); + createEditor(m_curRow, m_curCol, TQString(), false/*removeOld*/); if (!m_editor) return; m_editor->clear(); @@ -1208,7 +1208,7 @@ void KexiDataAwareObjectInterface::deleteCurrentRow() case ImmediateDelete: break; case AskDelete: - if (KMessageBox::Cancel == KMessageBox::warningContinueCancel(dynamic_cast<QWidget*>(this), + if (KMessageBox::Cancel == KMessageBox::warningContinueCancel(dynamic_cast<TQWidget*>(this), i18n("Do you want to delete selected row?"), 0, KGuiItem(i18n("&Delete Row"),"editdelete"), "dontAskBeforeDeleteRow"/*config entry*/, @@ -1251,7 +1251,7 @@ void KexiDataAwareObjectInterface::insertItem(KexiTableItem *newItem, int row) m_curRow++; } - m_data->insertRow(*newItem, row, true /*repaint*/); + m_data->insertRow(*newItem, row, true /*tqrepaint*/); if (changeCurrentRow) { //update iter... @@ -1259,7 +1259,7 @@ void KexiDataAwareObjectInterface::insertItem(KexiTableItem *newItem, int row) (*m_itemIterator)+=m_curRow; } /* - QSize s(tableSize()); + TQSize s(tableSize()); resizeContents(s.width(),s.height()); //redraw only this row and below: @@ -1281,15 +1281,15 @@ void KexiDataAwareObjectInterface::insertItem(KexiTableItem *newItem, int row) */ } -void KexiDataAwareObjectInterface::slotRowInserted(KexiTableItem *item, bool repaint) +void KexiDataAwareObjectInterface::slotRowInserted(KexiTableItem *item, bool tqrepaint) { - int row = m_data->findRef(item); - slotRowInserted( item, row, repaint ); + int row = m_data->tqfindRef(item); + slotRowInserted( item, row, tqrepaint ); } -void KexiDataAwareObjectInterface::slotRowInserted(KexiTableItem * /*item*/, uint row, bool repaint) +void KexiDataAwareObjectInterface::slotRowInserted(KexiTableItem * /*item*/, uint row, bool tqrepaint) { - if (repaint && (int)row<rows()) { + if (tqrepaint && (int)row<rows()) { updateWidgetContentsSize(); /* updateAllVisibleRowsBelow() used instead @@ -1317,7 +1317,7 @@ void KexiDataAwareObjectInterface::slotRowInserted(KexiTableItem * /*item*/, uin } } -tristate KexiDataAwareObjectInterface::deleteAllRows(bool ask, bool repaint) +tristate KexiDataAwareObjectInterface::deleteAllRows(bool ask, bool tqrepaint) { if (!hasData()) return true; @@ -1325,13 +1325,13 @@ tristate KexiDataAwareObjectInterface::deleteAllRows(bool ask, bool repaint) return true; if (ask) { - QString tableName = m_data->dbTableName(); + TQString tableName = m_data->dbTableName(); if (!tableName.isEmpty()) { tableName.prepend(" \""); tableName.append("\""); } - if (KMessageBox::Cancel == KMessageBox::warningContinueCancel(dynamic_cast<QWidget*>(this), - i18n("Do you want to clear the contents of table %1?").arg(tableName), + if (KMessageBox::Cancel == KMessageBox::warningContinueCancel(dynamic_cast<TQWidget*>(this), + i18n("Do you want to clear the contents of table %1?").tqarg(tableName), 0, KGuiItem(i18n("&Clear Contents")) )) return cancelled; } @@ -1339,10 +1339,10 @@ tristate KexiDataAwareObjectInterface::deleteAllRows(bool ask, bool repaint) cancelRowEdit(); // acceptRowEdit(); // m_verticalHeader->clear(); - const bool repaintLater = repaint && m_spreadSheetMode; + const bool tqrepaintLater = tqrepaint && m_spreadSheetMode; const int oldRows = rows(); - bool res = m_data->deleteAllRows(repaint && !repaintLater); + bool res = m_data->deleteAllRows(tqrepaint && !tqrepaintLater); if (res) { if (m_spreadSheetMode) { @@ -1352,28 +1352,28 @@ tristate KexiDataAwareObjectInterface::deleteAllRows(bool ask, bool repaint) } } } - if (repaintLater) + if (tqrepaintLater) m_data->reload(); // d->clearVariables(); // m_verticalHeader->setCurrentRow(-1); // d->pUpdateTimer->start(1,true); -// if (repaint) -// viewport()->repaint(); +// if (tqrepaint) +// viewport()->tqrepaint(); return res; } -void KexiDataAwareObjectInterface::clearColumns(bool repaint) +void KexiDataAwareObjectInterface::clearColumns(bool tqrepaint) { cancelRowEdit(); m_data->clearInternal(); - clearColumnsInternal(repaint); + clearColumnsInternal(tqrepaint); updateIndicesForVisibleValues(); - if (repaint) -// viewport()->repaint(); + if (tqrepaint) +// viewport()->tqrepaint(); //OK? updateWidgetContents(); @@ -1393,7 +1393,7 @@ void KexiDataAwareObjectInterface::clearColumns(bool repaint) m_verticalHeader->setCurrentRow(-1); - viewport()->repaint(); + viewport()->tqrepaint(); // d->pColumnTypes.resize(0); // d->pColumnModes.resize(0); @@ -1419,7 +1419,7 @@ void KexiDataAwareObjectInterface::reloadData() if (m_verticalHeader) m_verticalHeader->setCurrentRow(-1); - if (dynamic_cast<QWidget*>(this) && dynamic_cast<QWidget*>(this)->isVisible()) + if (dynamic_cast<TQWidget*>(this) && dynamic_cast<TQWidget*>(this)->isVisible()) initDataContents(); else m_initDataContentsOnShow = true; @@ -1456,9 +1456,9 @@ int KexiDataAwareObjectInterface::dataColumns() const return m_data->columns.count(); } -QVariant KexiDataAwareObjectInterface::columnDefaultValue(int /*col*/) const +TQVariant KexiDataAwareObjectInterface::columnDefaultValue(int /*col*/) const { - return QVariant(0); + return TQVariant(0); //TODO(js) // return m_data->columns[col].defaultValue; } @@ -1490,10 +1490,10 @@ void KexiDataAwareObjectInterface::setEmptyRowInsertingEnabled(bool set) } void KexiDataAwareObjectInterface::slotAboutToDeleteRow(KexiTableItem& item, - KexiDB::ResultInfo* /*result*/, bool repaint) + KexiDB::ResultInfo* /*result*/, bool tqrepaint) { - if (repaint) { - m_rowWillBeDeleted = m_data->findRef(&item); + if (tqrepaint) { + m_rowWillBeDeleted = m_data->tqfindRef(&item); } } @@ -1529,12 +1529,12 @@ bool KexiDataAwareObjectInterface::deleteItem(KexiTableItem *item)/*, bool moveC if (!item || !beforeDeleteItem(item)) return false; - QString msg, desc; + TQString msg, desc; // bool current = (item == d->pCurrentItem); const bool lastRowDeleted = m_spreadSheetMode && m_data->last() == item; //we need to know this so we //can return to the last row //after reinserting it - if (!m_data->deleteRow(*item, true /*repaint*/)) { + if (!m_data->deleteRow(*item, true /*tqrepaint*/)) { /*const int button =*/ showErrorMessageForResult( m_data->result() ); // if (KMessageBox::No == button) { @@ -1547,7 +1547,7 @@ bool KexiDataAwareObjectInterface::deleteItem(KexiTableItem *item)/*, bool moveC //d->pCurrentItem = m_data->current(); } -// repaintAfterDelete(); +// tqrepaintAfterDelete(); if (m_spreadSheetMode) { //append empty row for spreadsheet mode m_data->append(m_data->createItem());//new KexiTableItem(m_data->columns.count())); if (m_verticalHeader) @@ -1572,7 +1572,7 @@ bool KexiDataAwareObjectInterface::hasDefaultValueAt(const KexiTableViewColumn& return false; } -const QVariant* KexiDataAwareObjectInterface::bufferedValueAt(int col, bool useDefaultValueIfPossible) +const TQVariant* KexiDataAwareObjectInterface::bufferedValueAt(int col, bool useDefaultValueIfPossible) { if (m_rowEditing && m_data->rowEditBuffer()) { @@ -1585,17 +1585,17 @@ const QVariant* KexiDataAwareObjectInterface::bufferedValueAt(int col, bool useD "fieldNumberForColumn(m_curCol) < 0" << endl; return 0; } - QVariant *storedValue = &m_currentItem->at( realFieldNumber ); + TQVariant *storedValue = &m_currentItem->at( realFieldNumber ); //db-aware data: now, try to find a buffered value (or default one) - const QVariant *cv = m_data->rowEditBuffer()->at( *tvcol->columnInfo, + const TQVariant *cv = m_data->rowEditBuffer()->at( *tvcol->columnInfo, storedValue->isNull() && useDefaultValueIfPossible); if (cv) return cv; return storedValue; } //not db-aware data: - const QVariant *cv = m_data->rowEditBuffer()->at( tvcol->field()->name() ); + const TQVariant *cv = m_data->rowEditBuffer()->at( tvcol->field()->name() ); if (cv) return cv; } @@ -1632,8 +1632,8 @@ void KexiDataAwareObjectInterface::boolToggled() updateCell(m_curRow, m_curCol); /* int s = m_currentItem->at(m_curCol).toInt(); - QVariant oldValue=m_currentItem->at(m_curCol); - (*m_currentItem)[m_curCol] = QVariant(s ? 0 : 1); + TQVariant oldValue=m_currentItem->at(m_curCol); + (*m_currentItem)[m_curCol] = TQVariant(s ? 0 : 1); updateCell(m_curRow, m_curCol); // emit itemChanged(m_currentItem, m_curRow, m_curCol, oldValue); // emit itemChanged(m_currentItem, m_curRow, m_curCol);*/ @@ -1660,7 +1660,7 @@ void KexiDataAwareObjectInterface::addNewRecordRequested() m_editor->setFocus(); } -bool KexiDataAwareObjectInterface::handleKeyPress(QKeyEvent *e, int &curRow, int &curCol, +bool KexiDataAwareObjectInterface::handleKeyPress(TQKeyEvent *e, int &curRow, int &curCol, bool fullRowSelection, bool *moveToFirstField, bool *moveToLastField) { if (moveToFirstField) @@ -1672,23 +1672,23 @@ bool KexiDataAwareObjectInterface::handleKeyPress(QKeyEvent *e, int &curRow, int const int k = e->key(); //kdDebug() << "-----------" << e->state() << " " << k << endl; - if ((k == Qt::Key_Up && nobtn) || (k == Qt::Key_PageUp && e->state()==Qt::ControlButton)) { + if ((k == TQt::Key_Up && nobtn) || (k == TQt::Key_PageUp && e->state()==TQt::ControlButton)) { selectPrevRow(); e->accept(); } - else if ((k == Qt::Key_Down && nobtn) || (k == Qt::Key_PageDown && e->state()==Qt::ControlButton)) { + else if ((k == TQt::Key_Down && nobtn) || (k == TQt::Key_PageDown && e->state()==TQt::ControlButton)) { selectNextRow(); e->accept(); } - else if (k == Qt::Key_PageUp && nobtn) { + else if (k == TQt::Key_PageUp && nobtn) { selectPrevPage(); e->accept(); } - else if (k == Qt::Key_PageDown && nobtn) { + else if (k == TQt::Key_PageDown && nobtn) { selectNextPage(); e->accept(); } - else if (k == Qt::Key_Home) { + else if (k == TQt::Key_Home) { if (fullRowSelection) { //we're in row-selection mode: home key always moves to 1st row curRow = 0;//to 1st row @@ -1697,7 +1697,7 @@ bool KexiDataAwareObjectInterface::handleKeyPress(QKeyEvent *e, int &curRow, int if (nobtn) { curCol = 0;//to 1st col } - else if (e->state()==Qt::ControlButton) { + else if (e->state()==TQt::ControlButton) { curRow = 0;//to 1st row and col curCol = 0; } @@ -1709,7 +1709,7 @@ bool KexiDataAwareObjectInterface::handleKeyPress(QKeyEvent *e, int &curRow, int //do not accept yet e->ignore(); } - else if (k == Qt::Key_End) { + else if (k == TQt::Key_End) { if (fullRowSelection) { //we're in row-selection mode: home key always moves to last row curRow = m_data->count()-1+(isInsertingEnabled()?1:0);//to last row @@ -1718,7 +1718,7 @@ bool KexiDataAwareObjectInterface::handleKeyPress(QKeyEvent *e, int &curRow, int if (nobtn) { curCol = columns()-1;//to last col } - else if (e->state()==Qt::ControlButton) { + else if (e->state()==TQt::ControlButton) { curRow = m_data->count()-1 /*+(isInsertingEnabled()?1:0)*/; //to last row and col curCol = columns()-1;//to last col } @@ -1730,8 +1730,8 @@ bool KexiDataAwareObjectInterface::handleKeyPress(QKeyEvent *e, int &curRow, int //do not accept yet e->ignore(); } - else if (isInsertingEnabled() && (e->state()==Qt::ControlButton && k == Qt::Key_Equal - || e->state()==(Qt::ControlButton|Qt::ShiftButton) && k == Qt::Key_Equal)) { + else if (isInsertingEnabled() && (e->state()==TQt::ControlButton && k == TQt::Key_Equal + || e->state()==(TQt::ControlButton|TQt::ShiftButton) && k == TQt::Key_Equal)) { curRow = m_data->count(); //to the new row curCol = 0;//to first col if (moveToFirstField) @@ -1752,19 +1752,19 @@ void KexiDataAwareObjectInterface::vScrollBarValueChanged(int v) return; if (m_scrollbarToolTipsEnabled) { - const QRect r( verticalScrollBar()->sliderRect() ); + const TQRect r( verticalScrollBar()->sliderRect() ); const int row = lastVisibleRow()+1; if (row<=0) { m_scrollBarTipTimer.stop(); m_scrollBarTip->hide(); return; } - m_scrollBarTip->setText( i18n("Row: ") + QString::number(row) ); + m_scrollBarTip->setText( i18n("Row: ") + TQString::number(row) ); m_scrollBarTip->adjustSize(); - QWidget* thisWidget = dynamic_cast<QWidget*>(this); + TQWidget* thisWidget = dynamic_cast<TQWidget*>(this); m_scrollBarTip->move( thisWidget->mapToGlobal( r.topLeft() + verticalScrollBar()->pos() ) - + QPoint( - m_scrollBarTip->width()-5, + + TQPoint( - m_scrollBarTip->width()-5, r.height()/2 - m_scrollBarTip->height()/2) ); if (verticalScrollBar()->draggingSlider()) { kdDebug(44021) << " draggingSlider() " << endl; @@ -1783,7 +1783,7 @@ void KexiDataAwareObjectInterface::vScrollBarValueChanged(int v) } } //update bottom view region -/* if (m_navPanel && (contentsHeight() - contentsY() - clipper()->height()) <= QMAX(d->rowHeight,m_navPanel->height())) { +/* if (m_navPanel && (contentsHeight() - contentsY() - clipper()->height()) <= TQMAX(d->rowHeight,m_navPanel->height())) { slotUpdate(); triggerUpdate(); }*/ @@ -1819,7 +1819,7 @@ void KexiDataAwareObjectInterface::scrollBarTipTimeout() m_scrollBarTipTimerCnt=0; } -void KexiDataAwareObjectInterface::focusOutEvent(QFocusEvent* e) +void KexiDataAwareObjectInterface::focusOutEvent(TQFocusEvent* e) { Q_UNUSED(e); m_scrollBarTipTimer.stop(); @@ -1830,12 +1830,12 @@ void KexiDataAwareObjectInterface::focusOutEvent(QFocusEvent* e) int KexiDataAwareObjectInterface::showErrorMessageForResult(KexiDB::ResultInfo* resultInfo) { - QWidget *thisWidget = dynamic_cast<QWidget*>(this); + TQWidget *thisWidget = dynamic_cast<TQWidget*>(this); if (resultInfo->allowToDiscardChanges) { return KMessageBox::questionYesNo(thisWidget, resultInfo->msg - + (resultInfo->desc.isEmpty() ? QString::null : ("\n"+resultInfo->desc)), - QString::null, - KGuiItem(i18n("Correct Changes", "Correct"), QString::null, i18n("Correct changes")), + + (resultInfo->desc.isEmpty() ? TQString() : ("\n"+resultInfo->desc)), + TQString(), + KGuiItem(i18n("Correct Changes", "Correct"), TQString(), i18n("Correct changes")), KGuiItem(i18n("Discard Changes")) ); } @@ -1873,7 +1873,7 @@ void KexiDataAwareObjectInterface::updateIndicesForVisibleValues() means then the last character. \a firstCharacter == INT_MAX means "before first" place, so searching fails immediately. On success, true is returned and \a firstCharacter is set to position of the matched string. */ -static inline bool findInString(const QString& stringValue, int stringLength, const QString& where, +static inline bool findInString(const TQString& stringValue, int stringLength, const TQString& where, int& firstCharacter, bool matchAnyPartOfField, bool matchWholeField, bool caseSensitive, bool wholeWordsOnly, bool forward) { @@ -1888,7 +1888,7 @@ static inline bool findInString(const QString& stringValue, int stringLength, co if (wholeWordsOnly) { const int whereLength = where.length(); while (true) { - pos = where.find( stringValue, pos, caseSensitive ); + pos = where.tqfind( stringValue, pos, caseSensitive ); if (pos == -1) break; if ((pos > 0 && where.at(pos-1).isLetterOrNumber()) @@ -1902,7 +1902,7 @@ static inline bool findInString(const QString& stringValue, int stringLength, co firstCharacter = pos; } else {// !wholeWordsOnly - firstCharacter = where.find( stringValue, pos, caseSensitive ); + firstCharacter = where.tqfind( stringValue, pos, caseSensitive ); } return firstCharacter != -1; } @@ -1915,7 +1915,7 @@ static inline bool findInString(const QString& stringValue, int stringLength, co if (wholeWordsOnly) { const int whereLength = where.length(); while (true) { - pos = where.findRev( stringValue, pos, caseSensitive ); + pos = where.tqfindRev( stringValue, pos, caseSensitive ); if (pos == -1) break; if ((pos > 0 && where.at(pos-1).isLetterOrNumber()) @@ -1932,7 +1932,7 @@ static inline bool findInString(const QString& stringValue, int stringLength, co firstCharacter = pos; } else {// !wholeWordsOnly - firstCharacter = where.findRev( stringValue, pos, caseSensitive ); + firstCharacter = where.tqfindRev( stringValue, pos, caseSensitive ); } return firstCharacter != -1; } @@ -1950,7 +1950,7 @@ static inline bool findInString(const QString& stringValue, int stringLength, co if (firstCharacter != -1 && firstCharacter != 0) { //we're not at 0-th char firstCharacter = -1; } - else if (where.startsWith(stringValue, caseSensitive)) { + else if (where.tqstartsWith(stringValue, caseSensitive)) { if (wholeWordsOnly) { // If where.length() < stringValue.length(), true will be returned too - fine. return !where.at( stringValue.length() ).isLetterOrNumber(); @@ -1962,12 +1962,12 @@ static inline bool findInString(const QString& stringValue, int stringLength, co return false; } -tristate KexiDataAwareObjectInterface::find(const QVariant& valueToFind, +tristate KexiDataAwareObjectInterface::tqfind(const TQVariant& valueToFind, const KexiSearchAndReplaceViewInterface::Options& options, bool next) { if (!hasData()) return cancelled; - const QVariant prevSearchedValue( m_recentlySearchedValue ); + const TQVariant prevSearchedValue( m_recentlySearchedValue ); m_recentlySearchedValue = valueToFind; const KexiSearchAndReplaceViewInterface::Options::SearchDirection prevSearchDirection = m_recentSearchDirection; m_recentSearchDirection = options.searchDirection; @@ -2049,7 +2049,7 @@ tristate KexiDataAwareObjectInterface::find(const QVariant& valueToFind, firstColumn = columnNumber; lastColumn = columnNumber; } - const QString stringValue( caseSensitive ? valueToFind.toString() : valueToFind.toString().lower() ); + const TQString stringValue( caseSensitive ? valueToFind.toString() : valueToFind.toString().lower() ); const int stringLength = stringValue.length(); // search @@ -2059,7 +2059,7 @@ tristate KexiDataAwareObjectInterface::find(const QVariant& valueToFind, for (; forward ? col <= lastColumn : col >= lastColumn; col = forward ? (col+1) : (col-1)) { - const QVariant cell( item->at( m_indicesForVisibleValues[ col ] ) ); + const TQVariant cell( item->at( m_indicesForVisibleValues[ col ] ) ); if (findInString(stringValue, stringLength, cell.toString(), firstCharacter, matchAnyPartOfField, matchWholeField, caseSensitive, wholeWordsOnly, forward)) { @@ -2092,7 +2092,7 @@ tristate KexiDataAwareObjectInterface::find(const QVariant& valueToFind, } tristate KexiDataAwareObjectInterface::findNextAndReplace( - const QVariant& valueToFind, const QVariant& replacement, + const TQVariant& valueToFind, const TQVariant& replacement, const KexiSearchAndReplaceViewInterface::Options& options, bool replaceAll) { Q_UNUSED(replacement); diff --git a/kexi/widget/tableview/kexidataawareobjectiface.h b/kexi/widget/tableview/kexidataawareobjectiface.h index 4cf2aa6a..e6e9a357 100644 --- a/kexi/widget/tableview/kexidataawareobjectiface.h +++ b/kexi/widget/tableview/kexidataawareobjectiface.h @@ -26,16 +26,16 @@ #ifndef KEXIDATAAWAREOBJECTINTERFACE_H #define KEXIDATAAWAREOBJECTINTERFACE_H -#include <qguardedptr.h> +#include <tqguardedptr.h> -#include <qtimer.h> +#include <tqtimer.h> #include <kdebug.h> #include <widget/utils/kexiarrowtip.h> #include <kexisearchandreplaceiface.h> #include "kexitableviewdata.h" -class QObject; -class QScrollBar; +class TQObject; +class TQScrollBar; class KPopupMenu; class KexiTableItem; class KexiTableViewData; @@ -54,7 +54,7 @@ namespace KexiDB { //! \brief The KexiDataAwareObjectInterface is an interface for record-based data object. /** This interface is implemented by KexiTableView and KexiFormView and used by KexiDataAwareView. If yu're implementing this interface, - add KEXI_DATAAWAREOBJECTINTERFACE convenience macro just after Q_OBJECT. + add KEXI_DATAAWAREOBJECTINTERFACE convenience macro just after TQ_OBJECT. You should add following code to your destructor so data is deleted: \code @@ -267,14 +267,14 @@ class KEXIDATATABLE_EXPORT KexiDataAwareObjectInterface Does not clear columns information. Does not destroy KexiTableViewData object (if present) but only clears its contents. Displays confirmation dialog if \a ask is true (the default is false). - Repaints widget if \a repaint is true (the default). + Repaints widget if \a tqrepaint is true (the default). For empty tables, true is returned immediately. If isDeleteEnabled() is false, false is returned. For spreadsheet mode all current rows are just replaced by empty rows. \return true on success, false on failure, and cancelled if user cancelled deletion (only possible if \a ask is true). */ - tristate deleteAllRows(bool ask = false, bool repaint = true); + tristate deleteAllRows(bool ask = false, bool tqrepaint = true); /*! \return maximum number of rows that can be displayed per one "page" for current view's size. */ @@ -356,7 +356,7 @@ class KEXIDATATABLE_EXPORT KexiDataAwareObjectInterface virtual bool acceptEditor(); //! Creates editors and shows it, what usually means the beginning of a cell editing - 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) = 0; /*! Used when Return key is pressed on cell, the cell has been double clicked @@ -365,7 +365,7 @@ class KEXIDATATABLE_EXPORT KexiDataAwareObjectInterface was displayed (in this case, \a setText is usually not empty, what means that text will be set in the cell replacing previous value). */ - virtual void startEditCurrentCell(const QString& setText = QString::null); + virtual void startEditCurrentCell(const TQString& setText = TQString()); /*! Deletes currently selected cell's contents, if allowed. In most cases delete is not accepted immediately but "row editing" mode is just started. */ @@ -386,13 +386,13 @@ class KEXIDATATABLE_EXPORT KexiDataAwareObjectInterface bool hasDefaultValueAt(const KexiTableViewColumn& tvcol); - const QVariant* bufferedValueAt(int col, bool useDefaultValueIfPossible = true); + const TQVariant* bufferedValueAt(int col, bool useDefaultValueIfPossible = true); //! \return a type of column \a col - one of KexiDB::Field::Type int columnType(int col); //! \return default value for column \a col - QVariant columnDefaultValue(int col) const; + TQVariant columnDefaultValue(int col) const; /*! \return true is column \a col is editable. Default implementation takes information about 'readOnly' flag from data member. @@ -408,7 +408,7 @@ class KEXIDATATABLE_EXPORT KexiDataAwareObjectInterface //! signals virtual void itemChanged(KexiTableItem *, int row, int col) = 0; - virtual void itemChanged(KexiTableItem *, int row, int col, QVariant oldValue) = 0; + virtual void itemChanged(KexiTableItem *, int row, int col, TQVariant oldValue) = 0; virtual void itemDeleteRequest(KexiTableItem *, int row, int col) = 0; virtual void currentItemDeleteRequest() = 0; //! Emitted for spreadsheet mode when an item was deleted and a new item has been appended @@ -446,22 +446,22 @@ class KEXIDATATABLE_EXPORT KexiDataAwareObjectInterface we're starting to edit the cell and inverting it's state. */ virtual void boolToggled(); - virtual void connectCellSelectedSignal(const QObject* receiver, + virtual void connectCellSelectedSignal(const TQObject* receiver, const char* intIntMember) = 0; - virtual void connectRowEditStartedSignal(const QObject* receiver, + virtual void connectRowEditStartedSignal(const TQObject* receiver, const char* intMember) = 0; - virtual void connectRowEditTerminatedSignal(const QObject* receiver, + virtual void connectRowEditTerminatedSignal(const TQObject* receiver, const char* voidMember) = 0; - virtual void connectReloadActionsSignal(const QObject* receiver, + virtual void connectReloadActionsSignal(const TQObject* receiver, const char* voidMember) = 0; - virtual void connectDataSetSignal(const QObject* receiver, + virtual void connectDataSetSignal(const TQObject* receiver, const char* kexiTableViewDataMember) = 0; - virtual void connectToReloadDataSlot(const QObject* sender, + virtual void connectToReloadDataSlot(const TQObject* sender, const char* voidSignal) = 0; virtual void slotDataDestroying(); @@ -490,7 +490,7 @@ class KEXIDATATABLE_EXPORT KexiDataAwareObjectInterface \return true if value has been found, false if value has not been found, and cancelled if there is nothing to find or there is no data to search in. */ - virtual tristate find(const QVariant& valueToFind, + virtual tristate tqfind(const TQVariant& valueToFind, const KexiSearchAndReplaceViewInterface::Options& options, bool next); /*! Finds \a valueToFind within the data items and replaces with \a replacement @@ -499,12 +499,12 @@ class KEXIDATATABLE_EXPORT KexiDataAwareObjectInterface has not been found and replaced, and cancelled if there is nothing to find or there is no data to search in or the data is read only. If \a replaceAll is true, all found values are replaced. */ - virtual tristate findNextAndReplace(const QVariant& valueToFind, - const QVariant& replacement, + virtual tristate findNextAndReplace(const TQVariant& valueToFind, + const TQVariant& replacement, const KexiSearchAndReplaceViewInterface::Options& options, bool replaceAll); /*! \return vertical scrollbar */ - virtual QScrollBar* verticalScrollBar() const = 0; + virtual TQScrollBar* verticalScrollBar() const = 0; /*! Used in KexiTableView::keyPressEvent() (and in continuous forms). \return true when the key press event \e was consumed. @@ -523,7 +523,7 @@ class KEXIDATATABLE_EXPORT KexiDataAwareObjectInterface can be other than the very first field in the form. Used by KexiTableView::keyPressEvent() and KexiTableView::keyPressEvent(). */ - virtual bool handleKeyPress(QKeyEvent *e, int &curRow, int &curCol, bool fullRowSelection, + virtual bool handleKeyPress(TQKeyEvent *e, int &curRow, int &curCol, bool fullRowSelection, bool *moveToFirstField = 0, bool *moveToLastField = 0); protected: @@ -537,18 +537,18 @@ class KEXIDATATABLE_EXPORT KexiDataAwareObjectInterface virtual void initDataContents(); /*! Clears columns information and thus all internal table data - and its visible representation. Repaints widget if \a repaint is true. */ - virtual void clearColumns(bool repaint = true); + and its visible representation. Repaints widget if \a tqrepaint is true. */ + virtual void clearColumns(bool tqrepaint = true); /*! Called by clearColumns() to clear internals of the object. For example, KexiTableView removes contents of it's horizontal header. */ - virtual void clearColumnsInternal(bool repaint) = 0; + virtual void clearColumnsInternal(bool tqrepaint) = 0; /*! @internal for implementation This should append another section within horizontal header or any sort of caption for a field using provided names. \a width is a hint for new field's width. */ - virtual void addHeaderColumn(const QString& caption, const QString& description, - const QIconSet& icon, int size) = 0; + virtual void addHeaderColumn(const TQString& caption, const TQString& description, + const TQIconSet& icon, int size) = 0; /*! @internal for implementation \return sorting order (within GUI): -1: descending, 1: ascending, 0: no sorting. @@ -630,11 +630,11 @@ class KEXIDATATABLE_EXPORT KexiDataAwareObjectInterface /*! Updates contents of the widget. Just call update() here on your widget. */ virtual void updateWidgetContents() = 0; - /*! Updates widget's contents size e.g. using QScrollView::resizeContents(). */ + /*! Updates widget's contents size e.g. using TQScrollView::resizeContents(). */ virtual void updateWidgetContentsSize() = 0; /*! Updates scrollbars of the widget. - QScrollView::updateScrollbars() will be usually called here. */ + TQScrollView::updateScrollbars() will be usually called here. */ virtual void updateWidgetScrollBars() = 0; /*! @internal @@ -654,18 +654,18 @@ class KEXIDATATABLE_EXPORT KexiDataAwareObjectInterface //! Handles KexiTableViewData::aboutToDeleteRow() signal. Prepares info for slotRowDeleted(). virtual void slotAboutToDeleteRow(KexiTableItem& item, KexiDB::ResultInfo* result, - bool repaint); + bool tqrepaint); - //! Handles KexiTableViewData::rowDeleted() signal to repaint when needed. + //! Handles KexiTableViewData::rowDeleted() signal to tqrepaint when needed. virtual void 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> & ) {} //! for sanity checks (return true if m_data is present; else: outputs warning) inline bool hasData() const; @@ -675,12 +675,12 @@ class KEXIDATATABLE_EXPORT KexiDataAwareObjectInterface virtual void selectCellInternal() {} /*! Used in KexiDataAwareObjectInterface::slotRowDeleted() - to repaint tow \a row and all visible below. + to tqrepaint tow \a row and all visible below. Implemented if there is more than one row displayed, i.e. currently for KexiTableView. */ virtual void updateAllVisibleRowsBelow(int row) { Q_UNUSED( row ); } //! Call this from the subclass. */ - virtual void focusOutEvent(QFocusEvent* e); + virtual void focusOutEvent(TQFocusEvent* e); /*! Handles verticalScrollBar()'s valueChanged(int) signal. Called when vscrollbar's value has been changed. @@ -705,7 +705,7 @@ class KEXIDATATABLE_EXPORT KexiDataAwareObjectInterface This is per-interface global cache. Needed for faster lookup because there could be lookup values. Called whenever columns definition changes, i.e. in setData() and clearColumns(). - @see find() */ + @see tqfind() */ void updateIndicesForVisibleValues(); //! data structure displayed for this object @@ -833,7 +833,7 @@ class KEXIDATATABLE_EXPORT KexiDataAwareObjectInterface int m_rowWillBeDeleted; /*! Displays passive error popup label used when invalid data has been entered. */ - QGuardedPtr<KexiArrowTip> m_errorMessagePopup; + TQGuardedPtr<KexiArrowTip> m_errorMessagePopup; /*! Used to enable/disable execution of vScrollBarValueChanged() when users navigate through rows using keyboard, so vscrollbar tooltips are not visible. */ @@ -842,8 +842,8 @@ class KEXIDATATABLE_EXPORT KexiDataAwareObjectInterface /*! True, if vscrollbar tooltips are enabled (true by default). */ bool m_scrollbarToolTipsEnabled : 1; - QLabel* m_scrollBarTip; //!< scrollbar tooltip - QTimer m_scrollBarTipTimer; //!< scrollbar tooltip's timer + TQLabel* m_scrollBarTip; //!< scrollbar tooltip + TQTimer m_scrollBarTipTimer; //!< scrollbar tooltip's timer uint m_scrollBarTipTimerCnt; //!< helper for timeout counting (scrollbar tooltip) //! Used to mark recently found value @@ -856,19 +856,19 @@ class KEXIDATATABLE_EXPORT KexiDataAwareObjectInterface bool exists : 1; }; - /*! Used to mark recently found value. Updated on succesful execution of find(). + /*! Used to mark recently found value. Updated on succesful execution of tqfind(). If the current cursor's position changes, or data in the current cell changes, positionOfRecentlyFoundValue.exists is set to false. */ PositionOfValue m_positionOfRecentlyFoundValue; /*! Used to compare whether we're looking for new value. */ - QVariant m_recentlySearchedValue; + TQVariant m_recentlySearchedValue; /*! Used to compare whether the search direction has changed. */ KexiSearchAndReplaceViewInterface::Options::SearchDirection m_recentSearchDirection; - //! Setup by updateIndicesForVisibleValues() and used by find() - QValueVector<uint> m_indicesForVisibleValues; + //! Setup by updateIndicesForVisibleValues() and used by tqfind() + TQValueVector<uint> m_indicesForVisibleValues; }; inline bool KexiDataAwareObjectInterface::hasData() const @@ -895,24 +895,24 @@ inline KexiTableItem *KexiDataAwareObjectInterface::itemAt(int row) const //! Convenience macro used for KexiDataAwareObjectInterface implementations. #define KEXI_DATAAWAREOBJECTINTERFACE \ public: \ - void connectCellSelectedSignal(const QObject* receiver, const char* intIntMember) { \ - connect(this, SIGNAL(cellSelected(int,int)), receiver, intIntMember); \ + void connectCellSelectedSignal(const TQObject* receiver, const char* intIntMember) { \ + connect(this, TQT_SIGNAL(cellSelected(int,int)), receiver, intIntMember); \ } \ - void connectRowEditStartedSignal(const QObject* receiver, const char* intMember) { \ - connect(this, SIGNAL(rowEditStarted(int)), receiver, intMember); \ + void connectRowEditStartedSignal(const TQObject* receiver, const char* intMember) { \ + connect(this, TQT_SIGNAL(rowEditStarted(int)), receiver, intMember); \ } \ - void connectRowEditTerminatedSignal(const QObject* receiver, const char* voidMember) { \ - connect(this, SIGNAL(rowEditTerminated(int)), receiver, voidMember); \ + void connectRowEditTerminatedSignal(const TQObject* receiver, const char* voidMember) { \ + connect(this, TQT_SIGNAL(rowEditTerminated(int)), receiver, voidMember); \ } \ - void connectReloadActionsSignal(const QObject* receiver, const char* voidMember) { \ - connect(this, SIGNAL(reloadActions()), receiver, voidMember); \ + void connectReloadActionsSignal(const TQObject* receiver, const char* voidMember) { \ + connect(this, TQT_SIGNAL(reloadActions()), receiver, voidMember); \ } \ - void connectDataSetSignal(const QObject* receiver, \ + void connectDataSetSignal(const TQObject* receiver, \ const char* kexiTableViewDataMember) { \ - connect(this, SIGNAL(dataSet(KexiTableViewData*)), receiver, kexiTableViewDataMember); \ + connect(this, TQT_SIGNAL(dataSet(KexiTableViewData*)), receiver, kexiTableViewDataMember); \ } \ - void connectToReloadDataSlot(const QObject* sender, const char* voidSignal) { \ - connect(sender, voidSignal, this, SLOT(reloadData())); \ + void connectToReloadDataSlot(const TQObject* sender, const char* voidSignal) { \ + connect(sender, voidSignal, this, TQT_SLOT(reloadData())); \ } #endif diff --git a/kexi/widget/tableview/kexidataawarepropertyset.cpp b/kexi/widget/tableview/kexidataawarepropertyset.cpp index 92fda11e..7d49ec52 100644 --- a/kexi/widget/tableview/kexidataawarepropertyset.cpp +++ b/kexi/widget/tableview/kexidataawarepropertyset.cpp @@ -28,19 +28,19 @@ KexiDataAwarePropertySet::KexiDataAwarePropertySet(KexiViewBase *view, KexiDataAwareObjectInterface* dataObject) - : QObject( view, QCString(view->name())+"KexiDataAwarePropertySet" ) + : TQObject( view, TQCString(view->name())+"KexiDataAwarePropertySet" ) , m_view(view) , m_dataObject(dataObject) , m_row(-99) { m_sets.setAutoDelete(true); -// connect(m_dataObject, SIGNAL(dataSet(KexiTableViewData*)), -// this, SLOT(slotDataSet(KexiTableViewData*))); - m_dataObject->connectDataSetSignal(this, SLOT(slotDataSet(KexiTableViewData*))); -// connect(m_dataObject, SIGNAL(cellSelected(int,int)), -// this, SLOT(slotCellSelected(int,int))); - m_dataObject->connectCellSelectedSignal(this, SLOT(slotCellSelected(int,int))); +// connect(m_dataObject, TQT_SIGNAL(dataSet(KexiTableViewData*)), +// this, TQT_SLOT(slotDataSet(KexiTableViewData*))); + m_dataObject->connectDataSetSignal(this, TQT_SLOT(slotDataSet(KexiTableViewData*))); +// connect(m_dataObject, TQT_SIGNAL(cellSelected(int,int)), +// this, TQT_SLOT(slotCellSelected(int,int))); + m_dataObject->connectCellSelectedSignal(this, TQT_SLOT(slotCellSelected(int,int))); // slotDataSet( m_dataObject->data() ); const bool wasDirty = view->dirty(); @@ -61,13 +61,13 @@ void KexiDataAwarePropertySet::slotDataSet( KexiTableViewData *data ) } m_currentTVData = data; if (!m_currentTVData.isNull()) { - connect(m_currentTVData, SIGNAL(rowDeleted()), this, SLOT(slotRowDeleted())); - connect(m_currentTVData, SIGNAL(rowsDeleted( const QValueList<int> & )), - this, SLOT(slotRowsDeleted( const QValueList<int> & ))); - connect(m_currentTVData, SIGNAL(rowInserted(KexiTableItem*,uint,bool)), - this, SLOT(slotRowInserted(KexiTableItem*,uint,bool))); - connect(m_currentTVData, SIGNAL(reloadRequested()), - this, SLOT(slotReloadRequested())); + connect(m_currentTVData, TQT_SIGNAL(rowDeleted()), this, TQT_SLOT(slotRowDeleted())); + connect(m_currentTVData, TQT_SIGNAL(rowsDeleted( const TQValueList<int> & )), + this, TQT_SLOT(slotRowsDeleted( const TQValueList<int> & ))); + connect(m_currentTVData, TQT_SIGNAL(rowInserted(KexiTableItem*,uint,bool)), + this, TQT_SLOT(slotRowInserted(KexiTableItem*,uint,bool))); + connect(m_currentTVData, TQT_SIGNAL(reloadRequested()), + this, TQT_SLOT(slotReloadRequested())); } } @@ -92,10 +92,10 @@ uint KexiDataAwarePropertySet::size() const return m_sets.size(); } -void KexiDataAwarePropertySet::clear(uint minimumSize) +void KexiDataAwarePropertySet::clear(uint tqminimumSize) { m_sets.clear(); - m_sets.resize(QMAX(minimumSize, MAX_FIELDS)); + m_sets.resize(TQMAX(tqminimumSize, MAX_FIELDS)); m_view->setDirty(true); m_view->propertySetSwitched(); } @@ -111,14 +111,14 @@ void KexiDataAwarePropertySet::insert(uint row, KoProperty::Set* set, bool newOn kexiwarn << "KexiDataAwarePropertySet::insert() invalid args: rew="<< row<< " propertyset="<< set<< endl; return; } - if (set->parent() && set->parent()!=this) { - kexiwarn << "KexiDataAwarePropertySet::insert() propertyset's parent must be NULL or this KexiDataAwarePropertySet" << endl; + if (set->tqparent() && set->tqparent()!=this) { + kexiwarn << "KexiDataAwarePropertySet::insert() propertyset's tqparent must be NULL or this KexiDataAwarePropertySet" << endl; return; } m_sets.insert(row, set); - connect(set, SIGNAL(propertyChanged(KoProperty::Set&, KoProperty::Property&)), m_view, SLOT(setDirty())); + connect(set, TQT_SIGNAL(propertyChanged(KoProperty::Set&, KoProperty::Property&)), m_view, TQT_SLOT(setDirty())); if (newOne) { //add a special property indicating that this is brand new set, @@ -159,14 +159,14 @@ void KexiDataAwarePropertySet::slotRowDeleted() emit rowDeleted(); } -void KexiDataAwarePropertySet::slotRowsDeleted( const QValueList<int> &rows ) +void KexiDataAwarePropertySet::slotRowsDeleted( const TQValueList<int> &rows ) { //let's move most property sets up & delete unwanted m_sets.setAutoDelete(false);//to avoid auto deleting in insert() const int orig_size = size(); int prev_r = -1; int num_removed = 0, cur_r = -1; - for (QValueList<int>::ConstIterator r_it = rows.constBegin(); r_it!=rows.constEnd() && *r_it < orig_size; ++r_it) { + for (TQValueList<int>::ConstIterator r_it = rows.constBegin(); r_it!=rows.constEnd() && *r_it < orig_size; ++r_it) { cur_r = *r_it;// - num_removed; if (prev_r>=0) { // kdDebug() << "move " << prev_r+num_removed-1 << ".." << cur_r-1 << " to " << prev_r+num_removed-1 << ".." << cur_r-2 << endl; @@ -206,7 +206,7 @@ void KexiDataAwarePropertySet::slotRowsDeleted( const QValueList<int> &rows ) } //void KexiDataAwarePropertySet::slotEmptyRowInserted(KexiTableItem*, uint /*index*/) -void KexiDataAwarePropertySet::slotRowInserted(KexiTableItem*, uint row, bool /*repaint*/) +void KexiDataAwarePropertySet::slotRowInserted(KexiTableItem*, uint row, bool /*tqrepaint*/) { m_view->setDirty(); @@ -238,18 +238,18 @@ KoProperty::Set* KexiDataAwarePropertySet::findPropertySetForItem(KexiTableItem& { if (m_currentTVData.isNull()) return 0; - int idx = m_currentTVData->findRef(&item); + int idx = m_currentTVData->tqfindRef(&item); if (idx<0) return 0; return m_sets[idx]; } -int KexiDataAwarePropertySet::findRowForPropertyValue(const QCString& propertyName, const QVariant& value) +int KexiDataAwarePropertySet::findRowForPropertyValue(const TQCString& propertyName, const TQVariant& value) { const int size = m_sets.size(); for (int i=0; i<size; i++) { KoProperty::Set *set = m_sets[i]; - if (!set || !set->contains(propertyName)) + if (!set || !set->tqcontains(propertyName)) continue; if (set->property(propertyName).value() == value) return i; diff --git a/kexi/widget/tableview/kexidataawarepropertyset.h b/kexi/widget/tableview/kexidataawarepropertyset.h index cee55da0..8d6212c4 100644 --- a/kexi/widget/tableview/kexidataawarepropertyset.h +++ b/kexi/widget/tableview/kexidataawarepropertyset.h @@ -20,11 +20,11 @@ #ifndef KEXIDATAAWAREPROPERTYSET_H #define KEXIDATAAWAREPROPERTYSET_H -#include <qguardedptr.h> -#include <qptrvector.h> +#include <tqguardedptr.h> +#include <tqptrvector.h> #include <koproperty/set.h> -typedef QPtrVector<KoProperty::Set> SetVector; +typedef TQPtrVector<KoProperty::Set> SetVector; class KexiViewBase; class KexiTableItem; @@ -50,9 +50,10 @@ class KexiDataAwareObjectInterface; - signalling via KexiViewBase::propertySetSwitched() that current property set has changed (e.g. on moving to other row) */ -class KEXIDATATABLE_EXPORT KexiDataAwarePropertySet : public QObject +class KEXIDATATABLE_EXPORT KexiDataAwarePropertySet : public TQObject { Q_OBJECT + TQ_OBJECT public: /*! You can instantiate KexiDataAwarePropertySet object @@ -80,7 +81,7 @@ class KEXIDATATABLE_EXPORT KexiDataAwarePropertySet : public QObject /*! \return number of the first row containing \a propertyName property equal to \a value. This is used e.g. in the Table Designer to find a row by field name. If no such row has been found, -1 is returned. */ - int findRowForPropertyValue(const QCString& propertyName, const QVariant& value); + int findRowForPropertyValue(const TQCString& propertyName, const TQVariant& value); signals: /*! Emmited when row is deleted. @@ -96,7 +97,7 @@ class KEXIDATATABLE_EXPORT KexiDataAwarePropertySet : public QObject public slots: void removeCurrentPropertySet(); - void clear(uint minimumSize = 0); + void clear(uint tqminimumSize = 0); /*! Inserts \a set property set at \a row position. If there was a buffer at this position before, it will be destroyed. @@ -106,7 +107,7 @@ class KEXIDATATABLE_EXPORT KexiDataAwarePropertySet : public QObject The property set \a set will be owned by this object, so you should not delete this property set by hand but call removeCurrentPropertySet() or remove(uint) instead. - Note that property set's parent (QObject::parent()) must be null + Note that property set's tqparent (TQObject::tqparent()) must be null or qual to this KexiDataAwarePropertySet object, otherwise this method will fail with a warning. */ @@ -123,10 +124,10 @@ class KEXIDATATABLE_EXPORT KexiDataAwarePropertySet : public QObject void slotRowDeleted(); //! Called on multiple rows delete in a tableview. - void slotRowsDeleted( const QValueList<int> &rows ); + void slotRowsDeleted( const TQValueList<int> &rows ); //! Called on \a row insertion in a tableview. - void slotRowInserted(KexiTableItem* item, uint row, bool repaint); + void slotRowInserted(KexiTableItem* item, uint row, bool tqrepaint); //! Called on selecting another cell in a tableview. void slotCellSelected(int, int row); @@ -137,10 +138,10 @@ class KEXIDATATABLE_EXPORT KexiDataAwarePropertySet : public QObject protected: SetVector m_sets; //!< prop. sets vector - QGuardedPtr<KexiViewBase> m_view; + TQGuardedPtr<KexiViewBase> m_view; KexiDataAwareObjectInterface* m_dataObject; -// QGuardedPtr<KexiTableView> m_tableView; - QGuardedPtr<KexiTableViewData> m_currentTVData; +// TQGuardedPtr<KexiTableView> m_tableView; + TQGuardedPtr<KexiTableViewData> m_currentTVData; int m_row; //!< used to know if a new row is selected in slotCellSelected() }; diff --git a/kexi/widget/tableview/kexidatatableview.cpp b/kexi/widget/tableview/kexidatatableview.cpp index 9248e890..7d7dbde6 100644 --- a/kexi/widget/tableview/kexidatatableview.cpp +++ b/kexi/widget/tableview/kexidatatableview.cpp @@ -19,8 +19,8 @@ * Boston, MA 02110-1301, USA. */ -#include <qtimer.h> -#include <qapplication.h> +#include <tqtimer.h> +#include <tqapplication.h> #include <kmessagebox.h> #include <klocale.h> @@ -33,14 +33,14 @@ #include "kexidatatableview.h" -KexiDataTableView::KexiDataTableView(QWidget *parent, const char *name) - : KexiTableView(0, parent, name) +KexiDataTableView::KexiDataTableView(TQWidget *tqparent, const char *name) + : KexiTableView(0, tqparent, name) { init(); } -KexiDataTableView::KexiDataTableView(QWidget *parent, const char *name, KexiDB::Cursor *cursor) - : KexiTableView(0, parent, name) +KexiDataTableView::KexiDataTableView(TQWidget *tqparent, const char *name, KexiDB::Cursor *cursor) + : KexiTableView(0, tqparent, name) { init(); setData(cursor); @@ -59,14 +59,14 @@ KexiDataTableView::init() // m_records = 0; // m_first = false; -// connect(this, SIGNAL(contentsMoving(int, int)), this, SLOT(slotMoving(int))); -// connect(verticalScrollBar(), SIGNAL(sliderMoved(int)), this, SLOT(slotMoving(int))); +// connect(this, TQT_SIGNAL(contentsMoving(int, int)), this, TQT_SLOT(slotMoving(int))); +// connect(verticalScrollBar(), TQT_SIGNAL(sliderMoved(int)), this, TQT_SLOT(slotMoving(int))); } /*void KexiDataTableView::initActions(KActionCollection *col) { KexiTableView::initActions(col); - new KAction(i18n("Filter"), "filter", 0, this, SLOT(filter()), col, "tablepart_filter"); + new KAction(i18n("Filter"), "filter", 0, this, TQT_SLOT(filter()), col, "tablepart_filter"); }*/ bool KexiDataTableView::setData(KexiDB::Cursor *cursor) @@ -105,7 +105,7 @@ bool KexiDataTableView::setData(KexiDB::Cursor *cursor) KexiTableViewData *tv_data = new KexiTableViewData(m_cursor); - QString caption = m_cursor->query()->caption(); + TQString caption = m_cursor->query()->caption(); if (caption.isEmpty()) caption = m_cursor->query()->name(); diff --git a/kexi/widget/tableview/kexidatatableview.h b/kexi/widget/tableview/kexidatatableview.h index 6f421894..7835289f 100644 --- a/kexi/widget/tableview/kexidatatableview.h +++ b/kexi/widget/tableview/kexidatatableview.h @@ -25,7 +25,7 @@ #include "kexitableview.h" class KexiTableItem; -class QVariant; +class TQVariant; class KXMLGUIClient; namespace KexiDB { @@ -38,12 +38,13 @@ namespace KexiDB { class KEXIDATATABLE_EXPORT KexiDataTableView : public KexiTableView { Q_OBJECT + TQ_OBJECT public: /** * creates a blank widget */ - KexiDataTableView(QWidget *parent, const char *name =0); + KexiDataTableView(TQWidget *tqparent, const char *name =0); /*! Creates a table widget and fills it using data from \a cursor. Cursor will be opened (with open()) if it is not yet opened. @@ -51,7 +52,7 @@ class KEXIDATATABLE_EXPORT KexiDataTableView : public KexiTableView and Connection::executeQuery()), otherwise the table view remain not filled with data. Cursor \a cursor will not be owned by this object. */ - KexiDataTableView(QWidget *parent, const char *name, KexiDB::Cursor *cursor); + KexiDataTableView(TQWidget *tqparent, const char *name, KexiDB::Cursor *cursor); ~KexiDataTableView(); @@ -88,7 +89,7 @@ class KEXIDATATABLE_EXPORT KexiDataTableView : public KexiTableView //db stuff KexiDB::Cursor *m_cursor; -// QMap<KexiDBUpdateRecord*,KexiTableItem*> m_insertMapping; +// TQMap<KexiDBUpdateRecord*,KexiTableItem*> m_insertMapping; }; #endif diff --git a/kexi/widget/tableview/kexidatetableedit.cpp b/kexi/widget/tableview/kexidatetableedit.cpp index 8a1fbcae..af71ae4c 100644 --- a/kexi/widget/tableview/kexidatetableedit.cpp +++ b/kexi/widget/tableview/kexidatetableedit.cpp @@ -21,20 +21,20 @@ #include "kexidatetableedit.h" -#include <qapplication.h> -#include <qpainter.h> -#include <qvariant.h> -#include <qrect.h> -#include <qpalette.h> -#include <qcolor.h> -#include <qfontmetrics.h> -#include <qdatetime.h> -#include <qcursor.h> -#include <qpoint.h> -#include <qlayout.h> -#include <qtoolbutton.h> -#include <qdatetimeedit.h> -#include <qclipboard.h> +#include <tqapplication.h> +#include <tqpainter.h> +#include <tqvariant.h> +#include <tqrect.h> +#include <tqpalette.h> +#include <tqcolor.h> +#include <tqfontmetrics.h> +#include <tqdatetime.h> +#include <tqcursor.h> +#include <tqpoint.h> +#include <tqlayout.h> +#include <tqtoolbutton.h> +#include <tqdatetimeedit.h> +#include <tqclipboard.h> #include <kdebug.h> #include <klocale.h> @@ -48,12 +48,12 @@ #include <kexiutils/utils.h> -KexiDateTableEdit::KexiDateTableEdit(KexiTableViewColumn &column, QWidget *parent) - : KexiInputTableEdit(column, parent) +KexiDateTableEdit::KexiDateTableEdit(KexiTableViewColumn &column, TQWidget *tqparent) + : KexiInputTableEdit(column, tqparent) { setName("KexiDateTableEdit"); -//! @todo add QValidator so date like "2006-59-67" cannot be even entered +//! @todo add TQValidator so date like "2006-59-67" cannot be even entered m_lineedit->setInputMask( m_formatter.inputMask() ); } @@ -62,20 +62,20 @@ KexiDateTableEdit::~KexiDateTableEdit() { } -void KexiDateTableEdit::setValueInInternalEditor(const QVariant &value) +void KexiDateTableEdit::setValueInInternalEditor(const TQVariant &value) { if (value.isValid() && value.toDate().isValid()) m_lineedit->setText( m_formatter.dateToString( value.toDate() ) ); else - m_lineedit->setText( QString::null ); + m_lineedit->setText( TQString() ); } -void KexiDateTableEdit::setValueInternal(const QVariant& add_, bool removeOld) +void KexiDateTableEdit::setValueInternal(const TQVariant& add_, bool removeOld) { if (removeOld) { //new date entering... just fill the line edit //! @todo cut string if too long.. - QString add(add_.toString()); + TQString add(add_.toString()); m_lineedit->setText(add); m_lineedit->setCursorPosition(add.length()); return; @@ -84,15 +84,15 @@ void KexiDateTableEdit::setValueInternal(const QVariant& add_, bool removeOld) m_lineedit->setCursorPosition(0); //ok? } -void KexiDateTableEdit::setupContents( QPainter *p, bool focused, const QVariant& val, - QString &txt, int &align, int &x, int &y_offset, int &w, int &h ) +void KexiDateTableEdit::setupContents( TQPainter *p, bool focused, const TQVariant& val, + TQString &txt, int &align, int &x, int &y_offset, int &w, int &h ) { Q_UNUSED(p); Q_UNUSED(focused); Q_UNUSED(x); Q_UNUSED(w); Q_UNUSED(h); -#ifdef Q_WS_WIN +#ifdef TQ_WS_WIN y_offset = -1; #else y_offset = 0; @@ -105,7 +105,7 @@ void KexiDateTableEdit::setupContents( QPainter *p, bool focused, const QVariant bool KexiDateTableEdit::valueIsNull() { -// if (m_lineedit->text().replace(m_formatter.separator(),"").stripWhiteSpace().isEmpty()) +// if (m_lineedit->text().tqreplace(m_formatter.separator(),"").stripWhiteSpace().isEmpty()) if (m_formatter.isEmpty(m_lineedit->text())) //empty date is null return true; return dateValue().isNull(); @@ -116,12 +116,12 @@ bool KexiDateTableEdit::valueIsEmpty() return valueIsNull();//js OK? TODO (nonsense?) } -QDate KexiDateTableEdit::dateValue() const +TQDate KexiDateTableEdit::dateValue() const { return m_formatter.stringToDate( m_lineedit->text() ); } -QVariant KexiDateTableEdit::value() +TQVariant KexiDateTableEdit::value() { return m_formatter.stringToVariant( m_lineedit->text() ); } @@ -133,21 +133,21 @@ bool KexiDateTableEdit::valueIsValid() return m_formatter.stringToDate( m_lineedit->text() ).isValid(); } -void KexiDateTableEdit::handleCopyAction(const QVariant& value, const QVariant& visibleValue) +void KexiDateTableEdit::handleCopyAction(const TQVariant& value, const TQVariant& visibleValue) { Q_UNUSED(visibleValue); if (!value.isNull() && value.toDate().isValid()) - qApp->clipboard()->setText( m_formatter.dateToString(value.toDate()) ); + tqApp->clipboard()->setText( m_formatter.dateToString(value.toDate()) ); else - qApp->clipboard()->setText( QString::null ); + tqApp->clipboard()->setText( TQString() ); } -void KexiDateTableEdit::handleAction(const QString& actionName) +void KexiDateTableEdit::handleAction(const TQString& actionName) { const bool alreadyVisible = m_lineedit->isVisible(); if (actionName=="edit_paste") { - const QVariant newValue( m_formatter.stringToDate(qApp->clipboard()->text()) ); + const TQVariant newValue( m_formatter.stringToDate(tqApp->clipboard()->text()) ); if (!alreadyVisible) { //paste as the entire text if the cell was not in edit mode emit editRequested(); m_lineedit->clear(); @@ -160,16 +160,16 @@ void KexiDateTableEdit::handleAction(const QString& actionName) /* void -KexiDateTableEdit::slotDateChanged(QDate date) +KexiDateTableEdit::slotDateChanged(TQDate date) { m_edit->setDate(date); - repaint(); + tqrepaint(); } void KexiDateTableEdit::slotShowDatePicker() { - QDate date = m_edit->date(); + TQDate date = m_edit->date(); m_datePicker->setDate(date); m_datePicker->setFocus(); @@ -182,30 +182,30 @@ void KexiDateTableEdit::moveToFirstSection() { if (!m_dte_date_obj) return; -#ifdef QDateTimeEditor_HACK +#ifdef TQDateTimeEditor_HACK if (m_dte_date) m_dte_date->setFocusSection(0); #else -#ifdef Q_WS_WIN //tmp - QKeyEvent ke_left(QEvent::KeyPress, Qt::Key_Left, 0, 0); +#ifdef TQ_WS_WIN //tmp + TQKeyEvent ke_left(TQEvent::KeyPress, TQt::Key_Left, 0, 0); for (int i=0; i<8; i++) - QApplication::sendEvent( m_dte_date_obj, &ke_left ); + TQApplication::sendEvent( m_dte_date_obj, &ke_left ); #endif #endif } -bool KexiDateTableEdit::eventFilter( QObject *o, QEvent *e ) +bool KexiDateTableEdit::eventFilter( TQObject *o, TQEvent *e ) { if (o==m_datePicker) { kdDebug() << e->type() << endl; switch (e->type()) { - case QEvent::Hide: + case TQEvent::Hide: m_datePickerPopupMenu->hide(); break; - case QEvent::KeyPress: - case QEvent::KeyRelease: { + case TQEvent::KeyPress: + case TQEvent::KeyRelease: { kdDebug() << "ok!" << endl; - QKeyEvent *ke = (QKeyEvent *)e; + TQKeyEvent *ke = (TQKeyEvent *)e; if (ke->key()==Key_Enter || ke->key()==Key_Return) { //accepting picker acceptDate(); @@ -224,27 +224,27 @@ bool KexiDateTableEdit::eventFilter( QObject *o, QEvent *e ) break; } } -#ifdef Q_WS_WIN //tmp - else if (e->type()==QEvent::FocusIn && o->parent() && o->parent()->parent()==m_edit +#ifdef TQ_WS_WIN //tmp + else if (e->type()==TQEvent::FocusIn && o->tqparent() && o->tqparent()->tqparent()==m_edit && m_setNumberOnFocus >= 0 && m_dte_date_obj) { // there was a number character passed as 'add' parameter in init(): moveToFirstSection(); - QKeyEvent ke(QEvent::KeyPress, int(Qt::Key_0)+m_setNumberOnFocus, - '0'+m_setNumberOnFocus, 0, QString::number(m_setNumberOnFocus)); - QApplication::sendEvent( m_dte_date_obj, &ke ); + TQKeyEvent ke(TQEvent::KeyPress, int(TQt::Key_0)+m_setNumberOnFocus, + '0'+m_setNumberOnFocus, 0, TQString::number(m_setNumberOnFocus)); + TQApplication::sendEvent( m_dte_date_obj, &ke ); m_setNumberOnFocus = -1; } #endif -#ifdef QDateTimeEditor_HACK - else if (e->type()==QEvent::KeyPress && m_dte_date) { - QKeyEvent *ke = static_cast<QKeyEvent*>(e); - if ((ke->key()==Qt::Key_Right && !m_sentEvent && cursorAtEnd()) - || (ke->key()==Qt::Key_Left && !m_sentEvent && cursorAtStart())) +#ifdef TQDateTimeEditor_HACK + else if (e->type()==TQEvent::KeyPress && m_dte_date) { + TQKeyEvent *ke = static_cast<TQKeyEvent*>(e); + if ((ke->key()==TQt::Key_Right && !m_sentEvent && cursorAtEnd()) + || (ke->key()==TQt::Key_Left && !m_sentEvent && cursorAtStart())) { //the editor should send this key event: m_sentEvent = true; //avoid recursion - QApplication::sendEvent( this, ke ); + TQApplication::sendEvent( this, ke ); m_sentEvent = false; ke->ignore(); return true; @@ -263,7 +263,7 @@ void KexiDateTableEdit::acceptDate() bool KexiDateTableEdit::cursorAtStart() { -#ifdef QDateTimeEditor_HACK +#ifdef TQDateTimeEditor_HACK return m_dte_date && m_edit->hasFocus() && m_dte_date->focusSection()==0; #else return false; @@ -272,7 +272,7 @@ bool KexiDateTableEdit::cursorAtStart() bool KexiDateTableEdit::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 @@ -282,7 +282,7 @@ bool KexiDateTableEdit::cursorAtEnd() void KexiDateTableEdit::clear() { - m_edit->setDate(QDate()); + m_edit->setDate(TQDate()); }*/ KEXI_CELLEDITOR_FACTORY_ITEM_IMPL(KexiDateEditorFactoryItem, KexiDateTableEdit) diff --git a/kexi/widget/tableview/kexidatetableedit.h b/kexi/widget/tableview/kexidatetableedit.h index 4f2a4f59..aad46c4b 100644 --- a/kexi/widget/tableview/kexidatetableedit.h +++ b/kexi/widget/tableview/kexidatetableedit.h @@ -26,7 +26,7 @@ #include <widget/utils/kexidatetimeformatter.h> /*! @short Editor class for Date type. - It is a replacement QDateEdit due to usability problems: + It is a replacement TQDateEdit due to usability problems: people are accustomed to use single-character cursor. Date format is retrieved from the KDE global settings. and input/output is performed using KLineEdit (from KexiInputTableEdit). @@ -34,28 +34,29 @@ class KexiDateTableEdit : public KexiInputTableEdit { Q_OBJECT + TQ_OBJECT public: - KexiDateTableEdit(KexiTableViewColumn &column, QWidget *parent=0); + KexiDateTableEdit(KexiTableViewColumn &column, TQWidget *tqparent=0); virtual ~KexiDateTableEdit(); - virtual void setupContents( QPainter *p, bool focused, const QVariant& val, - QString &txt, int &align, int &x, int &y_offset, int &w, int &h ); - virtual QVariant value(); + virtual void setupContents( TQPainter *p, bool focused, const TQVariant& val, + TQString &txt, int &align, int &x, int &y_offset, int &w, int &h ); + virtual TQVariant value(); virtual bool valueIsNull(); virtual bool valueIsEmpty(); virtual bool valueIsValid(); /*! Reimplemented after KexiInputTableEdit. */ - virtual void handleAction(const QString& actionName); + virtual void handleAction(const TQString& actionName); /*! Reimplemented after KexiInputTableEdit. */ - virtual void handleCopyAction(const QVariant& value, const QVariant& visibleValue); + virtual void handleCopyAction(const TQVariant& value, const TQVariant& visibleValue); protected: //! helper - void setValueInInternalEditor(const QVariant &value); - virtual void setValueInternal(const QVariant& add, bool removeOld); - QDate dateValue() const; + void setValueInInternalEditor(const TQVariant &value); + virtual void setValueInternal(const TQVariant& add, bool removeOld); + TQDate dateValue() const; //! Used to format and convert date values KexiDateFormatter m_formatter; diff --git a/kexi/widget/tableview/kexidatetimetableedit.cpp b/kexi/widget/tableview/kexidatetimetableedit.cpp index fbca7cd6..46f687f0 100644 --- a/kexi/widget/tableview/kexidatetimetableedit.cpp +++ b/kexi/widget/tableview/kexidatetimetableedit.cpp @@ -21,20 +21,20 @@ #include "kexidatetimetableedit.h" -#include <qapplication.h> -#include <qpainter.h> -#include <qvariant.h> -#include <qrect.h> -#include <qpalette.h> -#include <qcolor.h> -#include <qfontmetrics.h> -#include <qdatetime.h> -#include <qcursor.h> -#include <qpoint.h> -#include <qlayout.h> -#include <qtoolbutton.h> -#include <qdatetimeedit.h> -#include <qclipboard.h> +#include <tqapplication.h> +#include <tqpainter.h> +#include <tqvariant.h> +#include <tqrect.h> +#include <tqpalette.h> +#include <tqcolor.h> +#include <tqfontmetrics.h> +#include <tqdatetime.h> +#include <tqcursor.h> +#include <tqpoint.h> +#include <tqlayout.h> +#include <tqtoolbutton.h> +#include <tqdatetimeedit.h> +#include <tqclipboard.h> #include <kdebug.h> #include <klocale.h> @@ -47,12 +47,12 @@ #include <kexiutils/utils.h> -KexiDateTimeTableEdit::KexiDateTimeTableEdit(KexiTableViewColumn &column, QWidget *parent) - : KexiInputTableEdit(column, parent) +KexiDateTimeTableEdit::KexiDateTimeTableEdit(KexiTableViewColumn &column, TQWidget *tqparent) + : KexiInputTableEdit(column, tqparent) { setName("KexiDateTimeTableEdit"); -//! @todo add QValidator so time like "99:88:77" cannot be even entered +//! @todo add TQValidator so time like "99:88:77" cannot be even entered m_lineedit->setInputMask( dateTimeInputMask( m_dateFormatter, m_timeFormatter ) ); @@ -62,22 +62,22 @@ KexiDateTimeTableEdit::~KexiDateTimeTableEdit() { } -void KexiDateTimeTableEdit::setValueInInternalEditor(const QVariant &value) +void KexiDateTimeTableEdit::setValueInInternalEditor(const TQVariant &value) { if (value.isValid() && value.toDateTime().isValid()) m_lineedit->setText( m_dateFormatter.dateToString( value.toDateTime().date() ) + " " + m_timeFormatter.timeToString( value.toDateTime().time() ) ); else - m_lineedit->setText( QString::null ); + m_lineedit->setText( TQString() ); } -void KexiDateTimeTableEdit::setValueInternal(const QVariant& add_, bool removeOld) +void KexiDateTimeTableEdit::setValueInternal(const TQVariant& add_, bool removeOld) { if (removeOld) { //new time entering... just fill the line edit //! @todo cut string if too long.. - QString add(add_.toString()); + TQString add(add_.toString()); m_lineedit->setText(add); m_lineedit->setCursorPosition(add.length()); return; @@ -86,15 +86,15 @@ void KexiDateTimeTableEdit::setValueInternal(const QVariant& add_, bool removeOl m_lineedit->setCursorPosition(0); //ok? } -void KexiDateTimeTableEdit::setupContents( QPainter *p, bool focused, const QVariant& val, - QString &txt, int &align, int &x, int &y_offset, int &w, int &h ) +void KexiDateTimeTableEdit::setupContents( TQPainter *p, bool focused, const TQVariant& val, + TQString &txt, int &align, int &x, int &y_offset, int &w, int &h ) { Q_UNUSED(p); Q_UNUSED(focused); Q_UNUSED(x); Q_UNUSED(w); Q_UNUSED(h); -#ifdef Q_WS_WIN +#ifdef TQ_WS_WIN y_offset = -1; #else y_offset = 0; @@ -117,10 +117,10 @@ bool KexiDateTimeTableEdit::valueIsEmpty() return valueIsNull();//js OK? TODO (nonsense?) } -QVariant KexiDateTimeTableEdit::value() +TQVariant KexiDateTimeTableEdit::value() { if (textIsEmpty()) - return QVariant(); + return TQVariant(); return stringToDateTime(m_dateFormatter, m_timeFormatter, m_lineedit->text()); } @@ -134,22 +134,22 @@ bool KexiDateTimeTableEdit::textIsEmpty() const return dateTimeIsEmpty( m_dateFormatter, m_timeFormatter, m_lineedit->text() ); } -void KexiDateTimeTableEdit::handleCopyAction(const QVariant& value, const QVariant& visibleValue) +void KexiDateTimeTableEdit::handleCopyAction(const TQVariant& value, const TQVariant& visibleValue) { Q_UNUSED(visibleValue); if (!value.isNull() && value.toDateTime().isValid()) - qApp->clipboard()->setText( m_dateFormatter.dateToString(value.toDateTime().date()) + " " + tqApp->clipboard()->setText( m_dateFormatter.dateToString(value.toDateTime().date()) + " " + m_timeFormatter.timeToString(value.toDateTime().time()) ); else - qApp->clipboard()->setText( QString::null ); + tqApp->clipboard()->setText( TQString() ); } -void KexiDateTimeTableEdit::handleAction(const QString& actionName) +void KexiDateTimeTableEdit::handleAction(const TQString& actionName) { const bool alreadyVisible = m_lineedit->isVisible(); if (actionName=="edit_paste") { - const QVariant newValue( stringToDateTime(m_dateFormatter, m_timeFormatter, qApp->clipboard()->text()) ); + const TQVariant newValue( stringToDateTime(m_dateFormatter, m_timeFormatter, tqApp->clipboard()->text()) ); if (!alreadyVisible) { //paste as the entire text if the cell was not in edit mode emit editRequested(); m_lineedit->clear(); diff --git a/kexi/widget/tableview/kexidatetimetableedit.h b/kexi/widget/tableview/kexidatetimetableedit.h index c2f9eba8..6fb88a67 100644 --- a/kexi/widget/tableview/kexidatetimetableedit.h +++ b/kexi/widget/tableview/kexidatetimetableedit.h @@ -26,7 +26,7 @@ #include "kexitimetableedit.h" /*! @short Editor class for Date/Time type. - It is a replacement QDateTimeEdit due to usability problems: + It is a replacement TQDateTimeEdit due to usability problems: people are accustomed to use single-character cursor. Date and Time format is retrieved from the KDE global settings and input/output is performed using KLineEdit (from KexiInputTableEdit). @@ -34,27 +34,28 @@ class KexiDateTimeTableEdit : public KexiInputTableEdit { Q_OBJECT + TQ_OBJECT public: - KexiDateTimeTableEdit(KexiTableViewColumn &column, QWidget *parent=0); + KexiDateTimeTableEdit(KexiTableViewColumn &column, TQWidget *tqparent=0); virtual ~KexiDateTimeTableEdit(); - virtual void setupContents( QPainter *p, bool focused, const QVariant& val, - QString &txt, int &align, int &x, int &y_offset, int &w, int &h ); - virtual QVariant value(); + virtual void setupContents( TQPainter *p, bool focused, const TQVariant& val, + TQString &txt, int &align, int &x, int &y_offset, int &w, int &h ); + virtual TQVariant value(); virtual bool valueIsNull(); virtual bool valueIsEmpty(); virtual bool valueIsValid(); /*! Reimplemented after KexiInputTableEdit. */ - virtual void handleAction(const QString& actionName); + virtual void handleAction(const TQString& actionName); /*! Reimplemented after KexiInputTableEdit. */ - virtual void handleCopyAction(const QVariant& value, const QVariant& visibleValue); + virtual void handleCopyAction(const TQVariant& value, const TQVariant& visibleValue); protected: //! helper - void setValueInInternalEditor(const QVariant &value); - virtual void setValueInternal(const QVariant& add, bool removeOld); + void setValueInInternalEditor(const TQVariant &value); + virtual void setValueInternal(const TQVariant& add, bool removeOld); bool textIsEmpty() const; //! Used to format and convert date values diff --git a/kexi/widget/tableview/kexiinputtableedit.cpp b/kexi/widget/tableview/kexiinputtableedit.cpp index 9af5c627..26a3ed7f 100644 --- a/kexi/widget/tableview/kexiinputtableedit.cpp +++ b/kexi/widget/tableview/kexiinputtableedit.cpp @@ -20,14 +20,14 @@ #include "kexiinputtableedit.h" -#include <qregexp.h> -#include <qevent.h> -#include <qlayout.h> -#include <qtimer.h> -#include <qpainter.h> -#include <qapplication.h> -#include <qclipboard.h> -#include <qtooltip.h> +#include <tqregexp.h> +#include <tqevent.h> +#include <tqlayout.h> +#include <tqtimer.h> +#include <tqpainter.h> +#include <tqapplication.h> +#include <tqclipboard.h> +#include <tqtooltip.h> #include <kglobal.h> #include <klocale.h> @@ -43,12 +43,12 @@ class MyLineEdit : public KLineEdit { public: - MyLineEdit(QWidget *parent, const char *name) : KLineEdit(parent,name) + MyLineEdit(TQWidget *tqparent, const char *name) : KLineEdit(tqparent,name) {} protected: - virtual void drawFrame ( QPainter * p ) { - p->setPen( QPen( colorGroup().text() ) ); - QRect r = rect(); + virtual void drawFrame ( TQPainter * p ) { + p->setPen( TQPen( tqcolorGroup().text() ) ); + TQRect r = rect(); p->moveTo( r.topLeft() ); p->lineTo( r.topRight() ); p->lineTo( r.bottomRight() ); @@ -60,8 +60,8 @@ class MyLineEdit : public KLineEdit //====================================================== -KexiInputTableEdit::KexiInputTableEdit(KexiTableViewColumn &column, QWidget *parent) - : KexiTableEdit(column, parent) +KexiInputTableEdit::KexiInputTableEdit(KexiTableViewColumn &column, TQWidget *tqparent) + : KexiTableEdit(column, tqparent) { setName("KexiInputTableEdit"); // m_type = f.type(); //copied because the rest of code uses m_type @@ -91,7 +91,7 @@ void KexiInputTableEdit::init() if (!align_right) { //create layer for internal editor - QHBoxLayout *lyr = new QHBoxLayout(this); + TQHBoxLayout *lyr = new TQHBoxLayout(this); lyr->addSpacing(4); lyr->setAutoAdd(true); } @@ -100,29 +100,29 @@ void KexiInputTableEdit::init() m_lineedit = new MyLineEdit(this, "KexiInputTableEdit-KLineEdit"); setViewWidget(m_lineedit); if (align_right) - m_lineedit->setAlignment(AlignRight); + m_lineedit->tqsetAlignment(AlignRight); // m_cview->setFrame(false); -// m_cview->setFrameStyle( QFrame::Plain | QFrame::Box ); +// m_cview->setFrameStyle( TQFrame::Plain | TQFrame::Box ); // m_cview->setLineWidth( 1 ); m_calculatedCell = false; #if 0 //js TODO - connect(m_cview->completionBox(), SIGNAL(activated(const QString &)), - this, SLOT(completed(const QString &))); - connect(m_cview->completionBox(), SIGNAL(highlighted(const QString &)), - this, SLOT(completed(const QString &))); + connect(m_cview->completionBox(), TQT_SIGNAL(activated(const TQString &)), + this, TQT_SLOT(completed(const TQString &))); + connect(m_cview->completionBox(), TQT_SIGNAL(highlighted(const TQString &)), + this, TQT_SLOT(completed(const TQString &))); m_cview->completionBox()->setTabHandling(true); #endif } -void KexiInputTableEdit::setValueInternal(const QVariant& add, bool removeOld) +void KexiInputTableEdit::setValueInternal(const TQVariant& add, bool removeOld) { - QString text( m_textFormatter.valueToText(removeOld ? QVariant() : m_origValue, add.toString()) ); + TQString text( m_textFormatter.valueToText(removeOld ? TQVariant() : m_origValue, add.toString()) ); if (text.isEmpty()) { if (m_origValue.toString().isEmpty()) { //we have to set NULL initial value: - m_lineedit->setText(QString::null); + m_lineedit->setText(TQString()); } } else { @@ -138,7 +138,7 @@ void KexiInputTableEdit::setValueInternal(const QVariant& add, bool removeOld) #endif if (!m_lineedit->validator()) { - QValidator *validator = new KexiDB::FieldValidator( + TQValidator *validator = new KexiDB::FieldValidator( *field(), m_lineedit, "KexiInputTableEdit-validator"); m_lineedit->setValidator( validator ); } @@ -146,28 +146,28 @@ void KexiInputTableEdit::setValueInternal(const QVariant& add, bool removeOld) #if 0 //moved to KexiTextFormatter -QString KexiInputTableEdit::valueToText(KexiDB::Field* field, const QVariant& value, const QString& add) +TQString KexiInputTableEdit::valueToText(KexiDB::Field* field, const TQVariant& value, const TQString& add) { - QString text; //result + TQString text; //result if (field->isFPNumericType()) { //! @todo precision! //! @todo support 'g' format - text = QString::number(value.toDouble(), 'f', - QMAX(field->visibleDecimalPlaces(), 10)); //<-- 10 is quite good maximum for fractional digits + text = TQString::number(value.toDouble(), 'f', + TQMAX(field->visibleDecimalPlaces(), 10)); //<-- 10 is quite good maximum for fractional digits //! @todo add command line settings? if (value.toDouble() == 0.0) { text = add.isEmpty() ? "0" : add; //eat 0 } else { //! @todo (js): get decimal places settings here... - QStringList sl = QStringList::split(".", text); + TQStringList sl = TQStringList::split(".", text); if (text.isEmpty()) { //nothing } else if (sl.count()==2) { // kdDebug() << "sl.count()=="<<sl.count()<< " " <<sl[0] << " | " << sl[1] << endl; - const QString sl1 = sl[1]; + const TQString sl1 = sl[1]; int pos = sl1.length()-1; if (pos>=1) { for (;pos>=0 && sl1[pos]=='0';pos--) @@ -183,7 +183,7 @@ QString KexiInputTableEdit::valueToText(KexiDB::Field* field, const QVariant& va } /*moved to KexiDB::FieldValidator if (setValidator && !m_lineedit->validator()) { - QValidator *validator = new KDoubleValidator(m_lineedit); + TQValidator *validator = new KDoubleValidator(m_lineedit); m_lineedit->setValidator( validator ); }*/ } @@ -199,7 +199,7 @@ QString KexiInputTableEdit::valueToText(KexiDB::Field* field, const QVariant& va /*moved to KexiDB::FieldValidator //! @todo implement ranges here! if (setValidator && !m_lineedit->validator()) { - QValidator *validator; + TQValidator *validator; if (KexiDB::Field::BigInteger == field()->type()) { //! @todo use field->isUnsigned() for KexiUtils::ULongLongValidator validator = new KexiUtils::LongLongValidator(m_lineedit); @@ -219,10 +219,10 @@ QString KexiInputTableEdit::valueToText(KexiDB::Field* field, const QVariant& va } #endif -void KexiInputTableEdit::paintEvent ( QPaintEvent * /*e*/ ) +void KexiInputTableEdit::paintEvent ( TQPaintEvent * /*e*/ ) { - QPainter p(this); - p.setPen( QPen( colorGroup().text() ) ); + TQPainter p(this); + p.setPen( TQPen( tqcolorGroup().text() ) ); p.drawRect( rect() ); } @@ -239,8 +239,8 @@ kdDebug() << "KexiInputTableEdit::setRestrictedCompletion()" << endl; m_cview->useGlobalKeyBindings(); - QStringList newC; - QStringList::ConstIterator it, end( m_comp.constEnd() ); + TQStringList newC; + TQStringList::ConstIterator it, end( m_comp.constEnd() ); for( it = m_comp.constBegin(); it != end; ++it) { if((*it).startsWith(m_cview->text())) @@ -251,7 +251,7 @@ kdDebug() << "KexiInputTableEdit::setRestrictedCompletion()" << endl; } void -KexiInputTableEdit::completed(const QString &s) +KexiInputTableEdit::completed(const TQString &s) { // kdDebug() << "KexiInputTableEdit::completed(): " << s << endl; m_lineedit->setText(s); @@ -274,39 +274,39 @@ bool KexiInputTableEdit::valueIsEmpty() return !m_lineedit->text().isNull() && m_lineedit->text().isEmpty(); } -QVariant KexiInputTableEdit::value() +TQVariant KexiInputTableEdit::value() { if (field()->isFPNumericType()) {//==KexiDB::Field::Double || m_type==KexiDB::Field::Float) { //! js @todo PRESERVE PRECISION! - QString txt = m_lineedit->text(); + TQString txt = m_lineedit->text(); if (m_decsym!=".") - txt = txt.replace(m_decsym,".");//convert back + txt = txt.tqreplace(m_decsym,".");//convert back bool ok; const double result = txt.toDouble(&ok); - return ok ? QVariant(result) : QVariant(); + return ok ? TQVariant(result) : TQVariant(); } else if (field()->isIntegerType()) { //! @todo check constraints bool ok; if (KexiDB::Field::BigInteger == field()->type()) { if (field()->isUnsigned()) { - const Q_ULLONG result = m_lineedit->text().toULongLong(&ok); - return ok ? QVariant(result) : QVariant(); + const TQ_ULLONG result = m_lineedit->text().toULongLong(&ok); + return ok ? TQVariant(result) : TQVariant(); } else { - const Q_LLONG result = m_lineedit->text().toLongLong(&ok); - return ok ? QVariant(result) : QVariant(); + const TQ_LLONG result = m_lineedit->text().toLongLong(&ok); + return ok ? TQVariant(result) : TQVariant(); } } if (KexiDB::Field::Integer == field()->type()) { if (field()->isUnsigned()) { const uint result = m_lineedit->text().toUInt(&ok); - return ok ? QVariant(result) : QVariant(); + return ok ? TQVariant(result) : TQVariant(); } } //default: signed int const int result = m_lineedit->text().toInt(&ok); - return ok ? QVariant(result) : QVariant(); + return ok ? TQVariant(result) : TQVariant(); } //default: text return m_lineedit->text(); @@ -328,21 +328,21 @@ bool KexiInputTableEdit::cursorAtEnd() return m_lineedit->cursorPosition()==(int)m_lineedit->text().length(); } -QSize KexiInputTableEdit::totalSize() +TQSize KexiInputTableEdit::totalSize() { if (!m_lineedit) return size(); return m_lineedit->size(); } -void KexiInputTableEdit::handleCopyAction(const QVariant& value, const QVariant& visibleValue) +void KexiInputTableEdit::handleCopyAction(const TQVariant& value, const TQVariant& visibleValue) { Q_UNUSED(visibleValue); //! @todo handle rich text? - qApp->clipboard()->setText( m_textFormatter.valueToText(value, QString::null) ); + tqApp->clipboard()->setText( m_textFormatter.valueToText(value, TQString()) ); } -void KexiInputTableEdit::handleAction(const QString& actionName) +void KexiInputTableEdit::handleAction(const TQString& actionName) { const bool alreadyVisible = m_lineedit->isVisible(); @@ -363,12 +363,12 @@ void KexiInputTableEdit::handleAction(const QString& actionName) } } -bool KexiInputTableEdit::showToolTipIfNeeded(const QVariant& value, const QRect& rect, - const QFontMetrics& fm, bool focused) +bool KexiInputTableEdit::showToolTipIfNeeded(const TQVariant& value, const TQRect& rect, + const TQFontMetrics& fm, bool focused) { - QString text( value.type()==QVariant::String ? value.toString() - : m_textFormatter.valueToText(value, QString::null) ); - QRect internalRect(rect); + TQString text( value.type()==TQVariant::String ? value.toString() + : m_textFormatter.valueToText(value, TQString()) ); + TQRect internalRect(rect); internalRect.setLeft(rect.x()+leftMargin()); internalRect.setWidth(internalRect.width()-rightMargin(focused)-2*3); kexidbg << rect << " " << internalRect << " " << fm.width(text) << endl; diff --git a/kexi/widget/tableview/kexiinputtableedit.h b/kexi/widget/tableview/kexiinputtableedit.h index df770287..3b4cf015 100644 --- a/kexi/widget/tableview/kexiinputtableedit.h +++ b/kexi/widget/tableview/kexiinputtableedit.h @@ -22,7 +22,7 @@ #define KEXIINPUTTABLEEDIT_H #include <klineedit.h> -#include <qvariant.h> +#include <tqvariant.h> #include "kexitableedit.h" #include "kexicelleditorfactory.h" @@ -33,9 +33,10 @@ class KEXIDATATABLE_EXPORT KexiInputTableEdit : public KexiTableEdit { Q_OBJECT + TQ_OBJECT public: - KexiInputTableEdit(KexiTableViewColumn &column, QWidget *parent=0); + KexiInputTableEdit(KexiTableViewColumn &column, TQWidget *tqparent=0); virtual ~KexiInputTableEdit(); @@ -44,7 +45,7 @@ class KEXIDATATABLE_EXPORT KexiInputTableEdit : public KexiTableEdit /*! \return text for \a value and \a field. \a add is a text that should be added to the value if possible. Used in setValueInternal(), by form widgets and for reporting/printing. */ - static QString valueToText(KexiDB::Field* field, const QVariant& value, const QString& add); + static TQString valueToText(KexiDB::Field* field, const TQVariant& value, const TQString& add); #endif virtual bool valueChanged(); @@ -57,36 +58,36 @@ class KEXIDATATABLE_EXPORT KexiInputTableEdit : public KexiTableEdit //! (check this with KexiDB::Field::hasEmptyProperty()), virtual bool valueIsEmpty(); - virtual QVariant value(); + virtual TQVariant value(); virtual bool cursorAtStart(); virtual bool cursorAtEnd(); -// virtual bool eventFilter(QObject* watched, QEvent* e); +// virtual bool eventFilter(TQObject* watched, TQEvent* e); //js void end(bool mark); //js void backspace(); virtual void clear(); /*! \return total size of this editor, including any buttons, etc. (if present). */ - virtual QSize totalSize(); + virtual TQSize totalSize(); /*! Handles action having standard name \a actionName. Action could be: "edit_cut", "edit_paste", etc. */ - virtual void handleAction(const QString& actionName); + virtual void handleAction(const TQString& actionName); /*! Handles copy action for value. The \a value is copied to clipboard in format appropriate for the editor's impementation, e.g. for image cell it can be a pixmap. \a visibleValue is unused here. Reimplemented after KexiTableEdit. */ - virtual void handleCopyAction(const QVariant& value, const QVariant& visibleValue); + virtual void handleCopyAction(const TQVariant& value, const TQVariant& visibleValue); /*! Shows a special tooltip for \a value if needed, i.e. if the value could not fit inside \a rect for a given font metrics \a fm. - \return true a normal tooltip should be displayed (using QToolTip,) and false if + \return true a normal tooltip should be displayed (using TQToolTip,) and false if no tooltip should be displayed or a custom tooltip was displayed internally (not yet supported). This implementation converts the value to text using valueToText() if \a calue is not string to see whether it can fit inside the cell's \a rect. If the cell is currentl focused (selected), \a focused is true. */ - virtual bool showToolTipIfNeeded(const QVariant& value, const QRect& rect, const QFontMetrics& fm, + virtual bool showToolTipIfNeeded(const TQVariant& value, const TQRect& rect, const TQFontMetrics& fm, bool focused); public slots: @@ -101,20 +102,20 @@ class KEXIDATATABLE_EXPORT KexiInputTableEdit : public KexiTableEdit protected slots: void setRestrictedCompletion(); - void completed(const QString &); + void completed(const TQString &); protected: //! initializes this editor with \a add value - virtual void setValueInternal(const QVariant& add, bool removeOld); + virtual void setValueInternal(const TQVariant& add, bool removeOld); void showHintButton(); void init(); - virtual void paintEvent( QPaintEvent *e ); + virtual void paintEvent( TQPaintEvent *e ); KexiTextFormatter m_textFormatter; bool m_calculatedCell; - QString m_decsym; //! decimal symbol - QString m_origText; //! orig. Line Edit's text after conversion - for easy comparing + TQString m_decsym; //! decimal symbol + TQString m_origText; //! orig. Line Edit's text after conversion - for easy comparing KLineEdit *m_lineedit; signals: diff --git a/kexi/widget/tableview/kexitableedit.cpp b/kexi/widget/tableview/kexitableedit.cpp index 8c3f5612..6a9008f1 100644 --- a/kexi/widget/tableview/kexitableedit.cpp +++ b/kexi/widget/tableview/kexitableedit.cpp @@ -23,44 +23,44 @@ #include <kexidb/field.h> #include <kexidb/utils.h> -#include <qpalette.h> -#include <qpainter.h> +#include <tqpalette.h> +#include <tqpainter.h> #include <kglobal.h> #include <klocale.h> #include <kdebug.h> -KexiTableEdit::KexiTableEdit(KexiTableViewColumn &column, QWidget* parent) -: QWidget(dynamic_cast<QScrollView*>(parent) ? dynamic_cast<QScrollView*>(parent)->viewport() : parent) +KexiTableEdit::KexiTableEdit(KexiTableViewColumn &column, TQWidget* tqparent) +: TQWidget(dynamic_cast<TQScrollView*>(tqparent) ? dynamic_cast<TQScrollView*>(tqparent)->viewport() : tqparent) ,m_column(&column) // ,m_field(&f) // ,m_type(f.type()) //copied because the rest of code uses m_type - ,m_scrollView(dynamic_cast<QScrollView*>(parent)) + ,m_scrollView(dynamic_cast<TQScrollView*>(tqparent)) ,m_usesSelectedTextColor(true) ,m_view(0) // ,m_hasFocusableWidget(true) // ,m_acceptEditorAfterDeleteContents(false) { - setPaletteBackgroundColor( palette().color(QPalette::Active, QColorGroup::Base) ); + setPaletteBackgroundColor( palette().color(TQPalette::Active, TQColorGroup::Base) ); installEventFilter(this); //margins if (displayedField()->isFPNumericType()) { -#ifdef Q_WS_WIN +#ifdef TQ_WS_WIN m_leftMargin = 0; #else m_leftMargin = 0; #endif } else if (displayedField()->isIntegerType()) { -#ifdef Q_WS_WIN +#ifdef TQ_WS_WIN m_leftMargin = 1; #else m_leftMargin = 0; #endif } else {//default -#ifdef Q_WS_WIN +#ifdef TQ_WS_WIN m_leftMargin = 5; #else m_leftMargin = 5; @@ -83,7 +83,7 @@ KexiDB::Field *KexiTableEdit::displayedField() const return m_column->field(); //typical case } -void KexiTableEdit::setViewWidget(QWidget *v) +void KexiTableEdit::setViewWidget(TQWidget *v) { m_view = v; m_view->move(0,0); @@ -91,7 +91,7 @@ void KexiTableEdit::setViewWidget(QWidget *v) setFocusProxy(m_view); } -void KexiTableEdit::moveChild( QWidget * child, int x, int y ) +void KexiTableEdit::moveChild( TQWidget * child, int x, int y ) { if (m_scrollView) m_scrollView->moveChild(child, x, y); @@ -99,9 +99,9 @@ void KexiTableEdit::moveChild( QWidget * child, int x, int y ) void KexiTableEdit::resize(int w, int h) { - QWidget::resize(w, h); + TQWidget::resize(w, h); if (m_view) { - if (!layout()) { //if there is layout (eg. KexiInputTableEdit), resize is automatic + if (!tqlayout()) { //if there is tqlayout (eg. KexiInputTableEdit), resize is automatic m_view->move(0,0); m_view->resize(w, h); } @@ -109,22 +109,22 @@ void KexiTableEdit::resize(int w, int h) } bool -KexiTableEdit::eventFilter(QObject* watched, QEvent* e) +KexiTableEdit::eventFilter(TQObject* watched, TQEvent* e) { /* if (watched == m_view) { - if(e->type() == QEvent::KeyPress) { - QKeyEvent* ev = static_cast<QKeyEvent*>(e); + if(e->type() == TQEvent::KeyPress) { + TQKeyEvent* ev = static_cast<TQKeyEvent*>(e); // if (ev->key()==Key_Tab) { // } } }*/ - if(watched == this) + if(TQT_BASE_OBJECT(watched) == TQT_BASE_OBJECT(this)) { - if(e->type() == QEvent::KeyPress) + if(e->type() == TQEvent::KeyPress) { - QKeyEvent* ev = static_cast<QKeyEvent*>(e); + TQKeyEvent* ev = TQT_TQKEYEVENT(e); if(ev->key() == Key_Escape) { @@ -137,23 +137,23 @@ KexiTableEdit::eventFilter(QObject* watched, QEvent* e) } } return false; -// return QWidget::eventFilter(watched, e); +// return TQWidget::eventFilter(watched, e); } -void KexiTableEdit::paintFocusBorders( QPainter *p, QVariant &, int x, int y, int w, int h ) +void KexiTableEdit::paintFocusBorders( TQPainter *p, TQVariant &, int x, int y, int w, int h ) { p->drawRect(x, y, w, h); } -void KexiTableEdit::setupContents( QPainter *p, bool focused, const QVariant& val, - QString &txt, int &align, int &/*x*/, int &y_offset, int &w, int &h ) +void KexiTableEdit::setupContents( TQPainter *p, bool focused, const TQVariant& val, + TQString &txt, int &align, int &/*x*/, int &y_offset, int &w, int &h ) { Q_UNUSED(p); Q_UNUSED(focused); Q_UNUSED(h); KexiDB::Field *realField = displayedField(); -#ifdef Q_WS_WIN +#ifdef TQ_WS_WIN // x = 1; y_offset = -1; #else @@ -171,11 +171,11 @@ void KexiTableEdit::setupContents( QPainter *p, bool focused, const QVariant& va align |= AlignRight; } else if (realField->isIntegerType()) { - Q_LLONG num = val.toLongLong(); + TQ_LLONG num = val.toLongLong(); w -= 6; align |= AlignRight; if (!val.isNull()) - txt = QString::number(num); + txt = TQString::number(num); } else {//default: if (!val.isNull()) { @@ -185,18 +185,18 @@ void KexiTableEdit::setupContents( QPainter *p, bool focused, const QVariant& va } } -void KexiTableEdit::paintSelectionBackground( QPainter *p, bool /*focused*/, - const QString& txt, int align, int x, int y_offset, int w, int h, const QColor& fillColor, - const QFontMetrics &fm, bool readOnly, bool fullRowSelection ) +void KexiTableEdit::paintSelectionBackground( TQPainter *p, bool /*focused*/, + const TQString& txt, int align, int x, int y_offset, int w, int h, const TQColor& fillColor, + const TQFontMetrics &fm, bool readOnly, bool fullRowSelection ) { if (!readOnly && !fullRowSelection && !txt.isEmpty()) { - QRect bound=fm.boundingRect(x, y_offset, w - (x+x), h, align, txt); + TQRect bound=fm.boundingRect(x, y_offset, w - (x+x), h, align, txt); bound.setY(0); - bound.setWidth( QMIN( bound.width()+2, w - (x+x)+1 ) ); - if (align & Qt::AlignLeft) { + bound.setWidth( TQMIN( bound.width()+2, w - (x+x)+1 ) ); + if (align & TQt::AlignLeft) { bound.setX(bound.x()-1); } - else if (align & Qt::AlignRight) { + else if (align & TQt::AlignRight) { bound.moveLeft( w - bound.width() ); //move to left, if too wide } //TODO align center @@ -208,18 +208,18 @@ void KexiTableEdit::paintSelectionBackground( QPainter *p, bool /*focused*/, } } -int KexiTableEdit::widthForValue( QVariant &val, const QFontMetrics &fm ) +int KexiTableEdit::widthForValue( TQVariant &val, const TQFontMetrics &fm ) { return fm.width( val.toString() ); } -void KexiTableEdit::repaintRelatedCell() +void KexiTableEdit::tqrepaintRelatedCell() { if (dynamic_cast<KexiDataAwareObjectInterface*>(m_scrollView)) dynamic_cast<KexiDataAwareObjectInterface*>(m_scrollView)->updateCurrentCell(); } -bool KexiTableEdit::showToolTipIfNeeded(const QVariant& value, const QRect& rect, const QFontMetrics& fm, +bool KexiTableEdit::showToolTipIfNeeded(const TQVariant& value, const TQRect& rect, const TQFontMetrics& fm, bool focused) { Q_UNUSED(value); diff --git a/kexi/widget/tableview/kexitableedit.h b/kexi/widget/tableview/kexitableedit.h index ef38a11f..d8ac7c86 100644 --- a/kexi/widget/tableview/kexitableedit.h +++ b/kexi/widget/tableview/kexitableedit.h @@ -23,8 +23,8 @@ #include <kexidataiteminterface.h> -#include <qvariant.h> -#include <qscrollview.h> +#include <tqvariant.h> +#include <tqscrollview.h> #include "kexitableviewdata.h" @@ -36,12 +36,13 @@ namespace KexiDB { /*! @short Abstract class for a cell editor. Handles cell painting and displaying the editor widget. */ -class KEXIDATATABLE_EXPORT KexiTableEdit : public QWidget, public KexiDataItemInterface +class KEXIDATATABLE_EXPORT KexiTableEdit : public TQWidget, public KexiDataItemInterface { Q_OBJECT + TQ_OBJECT public: - KexiTableEdit(KexiTableViewColumn &column, QWidget* parent = 0); + KexiTableEdit(KexiTableViewColumn &column, TQWidget* tqparent = 0); virtual ~KexiTableEdit(); @@ -72,7 +73,7 @@ class KEXIDATATABLE_EXPORT KexiTableEdit : public QWidget, public KexiDataItemIn virtual void resize(int w, int h); /*! \return the view widget of this editor, e.g. line edit widget. */ - virtual QWidget* widget() { return m_view; } + virtual TQWidget* widget() { return m_view; } /*! Hides item's widget, if available. */ inline virtual void hideWidget() { hide(); } @@ -83,11 +84,11 @@ class KEXIDATATABLE_EXPORT KexiTableEdit : public QWidget, public KexiDataItemIn /*! Paints a border for the cell described by \a x, \a y, \a w, \a h on \a p painter. The cell's value is \a val (may be useful if you want to reimplement this method). */ - virtual void paintFocusBorders( QPainter *p, QVariant &cal, int x, int y, int w, int h ); + virtual void paintFocusBorders( TQPainter *p, TQVariant &cal, int x, int y, int w, int h ); /*! For reimplementation. Sets up and paints cell's contents using context of \a val value. - \a focused is true if the cell is focused. \a align is set using Qt::AlignmentFlags. + \a focused is true if the cell is focused. \a align is set using TQt::AlignmentFlags. Some additional things may be painted using \a p, but it is not needed to paint the text (this is done automatically outside of this method). @@ -101,8 +102,8 @@ class KEXIDATATABLE_EXPORT KexiTableEdit : public QWidget, public KexiDataItemIn \a p painter's pen is set to foreground color (usually black) that should be used to paint foreground information, if needed. For example boolean editor widget paints a rectangle using this color. */ - virtual void setupContents( QPainter *p, bool focused, const QVariant& val, - QString &txt, int &align, int &x, int &y_offset, int &w, int &h ); + virtual void setupContents( TQPainter *p, bool focused, const TQVariant& val, + TQString &txt, int &align, int &x, int &y_offset, int &w, int &h ); /*! \return true if "selected text" color should be used to paint contents of the editor. True by default. It's false e.g. in boolean editor, where no selection is painted @@ -115,16 +116,16 @@ class KEXIDATATABLE_EXPORT KexiTableEdit : public QWidget, public KexiDataItemIn /*! For reimplementation. Paints selection's background using \a p. Most parameters are similar to these from setupContents(). */ - virtual void paintSelectionBackground( QPainter *p, bool focused, const QString& txt, - int align, int x, int y_offset, int w, int h, const QColor& fillColor, - const QFontMetrics &fm, bool readOnly, bool fullRowSelection ); + virtual void paintSelectionBackground( TQPainter *p, bool focused, const TQString& txt, + int align, int x, int y_offset, int w, int h, const TQColor& fillColor, + const TQFontMetrics &fm, bool readOnly, bool fullRowSelection ); - /*! Sometimes, editor can contain non-standard margin, for example combobox editor contains + /*! Sometimes, editor can contain non-standard margin, for example combobox editor tqcontains dropdown button at the right side. \return left margin's size; 0 by default. For reimplementation. */ int leftMargin() const { return m_leftMargin; } - /*! Sometimes, editor can contain non-standard margin, for example combobox editor contains + /*! Sometimes, editor can contain non-standard margin, for example combobox editor tqcontains dropdown button at the right side. THe dropdown button's width is counted only if \a focused is true. \return right margin's size; 0 by default. For reimplementation. */ int rightMargin(bool focused) const; @@ -133,7 +134,7 @@ class KEXIDATATABLE_EXPORT KexiTableEdit : public QWidget, public KexiDataItemIn For implementation: true should be returned if \a ke should be accepted. If \a editorActive is true, this editor is currently active, i.e. the table view is in edit mode. By default false is returned. */ - virtual bool handleKeyPress( QKeyEvent* ke, bool editorActive ) { + virtual bool handleKeyPress( TQKeyEvent* ke, bool editorActive ) { Q_UNUSED(ke); Q_UNUSED(editorActive); return false; } /*! Handles double click request coming from the table view. @@ -146,24 +147,24 @@ class KEXIDATATABLE_EXPORT KexiTableEdit : public QWidget, public KexiDataItemIn For a special case (combo box), \a visibleValue can be provided, so it can be copied to the clipboard instead of unreadable \a value. For reimplementation. */ - virtual void handleCopyAction(const QVariant& value, const QVariant& visibleValue) = 0; + virtual void handleCopyAction(const TQVariant& value, const TQVariant& visibleValue) = 0; /*! \return width of \a value. For the default implementation \a val is converted to a string and width of this string is returned. */ - virtual int widthForValue( QVariant &val, const QFontMetrics &fm ); + virtual int widthForValue( TQVariant &val, const TQFontMetrics &fm ); /*! \return total size of this editor, including any buttons, etc. (if present). Reimpelment this if you want to return more appropriate size. This impelmentation just - returns QWidget::size(). */ - virtual QSize totalSize() { return QWidget::size(); } + returns TQWidget::size(). */ + virtual TQSize totalSize() { return TQWidget::size(); } /*! Shows a special tooltip for \a value if needed, i.e. if the value could not fit inside \a rect for a given font metrics \a fm. - \return true a normal tooltip should be displayed (using QToolTip,) and false if + \return true a normal tooltip should be displayed (using TQToolTip,) and false if no tooltip should be displayed or a custom tooltip was displayed internally (not yet supported). Default implementation does nothing and returns false. If the cell is currentl focused (selected), \a focused is true. */ - virtual bool showToolTipIfNeeded(const QVariant& value, const QRect& rect, const QFontMetrics& fm, + virtual bool showToolTipIfNeeded(const TQVariant& value, const TQRect& rect, const TQFontMetrics& fm, bool focused); /*! Created internal editor for this editor is needed. This method is only implemented @@ -177,28 +178,28 @@ class KEXIDATATABLE_EXPORT KexiTableEdit : public QWidget, public KexiDataItemIn void acceptRequested(); protected: - virtual bool eventFilter(QObject* watched, QEvent* e); + virtual bool eventFilter(TQObject* watched, TQEvent* e); /*! Sets \a v as view widget for this editor. The view will be assigned as focus proxy for the editor, its events will be filtered, it will be resized when neede, and so on. */ - void setViewWidget(QWidget *v); + void setViewWidget(TQWidget *v); - /*! Moves child widget within the viewport if the parent is scrollview (otherwise does nothing). - Use this for child widgets that are outside of this editor widget, instead of calling QWidget::move(). */ - void moveChild( QWidget * child, int x, int y ); + /*! Moves child widget within the viewport if the tqparent is scrollview (otherwise does nothing). + Use this for child widgets that are outside of this editor widget, instead of calling TQWidget::move(). */ + void moveChild( TQWidget * child, int x, int y ); /*! Allows to force redrawing the related cell by the editor itself. Usable when the editor is not - displayed by a QWidget but rather by table view cell itself, for example KexiBlobTableEdit. */ - void repaintRelatedCell(); + displayed by a TQWidget but rather by table view cell itself, for example KexiBlobTableEdit. */ + void tqrepaintRelatedCell(); KexiTableViewColumn *m_column; int m_leftMargin; int m_rightMargin, m_rightMarginWhenFocused; - QScrollView* m_scrollView; //!< may be 0 if the parent is not a scrollview + TQScrollView* m_scrollView; //!< may be 0 if the tqparent is not a scrollview bool m_usesSelectedTextColor : 1; //!< set in ctor, @see usesSelectedTextColor() private: - QWidget* m_view; + TQWidget* m_view; }; //! Declaration of cell editor factory @@ -210,7 +211,7 @@ class KEXIDATATABLE_EXPORT KexiTableEdit : public QWidget, public KexiDataItemIn virtual ~factoryclassname(); \ \ protected: \ - virtual KexiTableEdit* createEditor(KexiTableViewColumn &column, QWidget* parent = 0); \ + virtual KexiTableEdit* createEditor(KexiTableViewColumn &column, TQWidget* tqparent = 0); \ }; //! Implementation of cell editor factory @@ -225,9 +226,9 @@ factoryclassname::~factoryclassname() \ {} \ \ KexiTableEdit* factoryclassname::createEditor( \ - KexiTableViewColumn &column, QWidget* parent) \ + KexiTableViewColumn &column, TQWidget* tqparent) \ { \ - return new itemclassname(column, parent); \ + return new itemclassname(column, tqparent); \ } #endif diff --git a/kexi/widget/tableview/kexitableitem.cpp b/kexi/widget/tableview/kexitableitem.cpp index e1669a35..659e341e 100644 --- a/kexi/widget/tableview/kexitableitem.cpp +++ b/kexi/widget/tableview/kexitableitem.cpp @@ -55,8 +55,8 @@ KexiTableItem::clearValues() void KexiTableItem::debug() const { - QString s = QString("KexiTableItem (%1 items)").arg(size()); + TQString s = TQString("KexiTableItem (%1 items)").tqarg(size()); for (uint i = 0; i < size(); i++) - s.append( QString::number(i)+":"+at(i).toString()+" " ); + s.append( TQString::number(i)+":"+at(i).toString()+" " ); kexidbg << s << endl; } diff --git a/kexi/widget/tableview/kexitableitem.h b/kexi/widget/tableview/kexitableitem.h index 00074e82..0216ee48 100644 --- a/kexi/widget/tableview/kexitableitem.h +++ b/kexi/widget/tableview/kexitableitem.h @@ -25,10 +25,10 @@ #ifndef KEXITABLEITEM_H #define KEXITABLEITEM_H -#include <qstring.h> -#include <qdatetime.h> -#include <qvaluevector.h> -#include <qvariant.h> +#include <tqstring.h> +#include <tqdatetime.h> +#include <tqvaluevector.h> +#include <tqvariant.h> #include <kexidb/connection.h> diff --git a/kexi/widget/tableview/kexitableview.cpp b/kexi/widget/tableview/kexitableview.cpp index 108b1696..229f909c 100644 --- a/kexi/widget/tableview/kexitableview.cpp +++ b/kexi/widget/tableview/kexitableview.cpp @@ -24,18 +24,18 @@ Original Project: buX (www.bux.at) */ -#include <qpainter.h> -#include <qkeycode.h> -#include <qlineedit.h> -#include <qcombobox.h> -#include <qwmatrix.h> -#include <qtimer.h> -#include <qpopupmenu.h> -#include <qcursor.h> -#include <qstyle.h> -#include <qlayout.h> -#include <qlabel.h> -#include <qwhatsthis.h> +#include <tqpainter.h> +#include <tqkeycode.h> +#include <tqlineedit.h> +#include <tqcombobox.h> +#include <tqwmatrix.h> +#include <tqtimer.h> +#include <tqpopupmenu.h> +#include <tqcursor.h> +#include <tqstyle.h> +#include <tqlayout.h> +#include <tqlabel.h> +#include <tqwhatsthis.h> #include <kglobal.h> #include <klocale.h> @@ -59,16 +59,16 @@ #include <widget/utils/kexidisplayutils.h> #include <kexidb/cursor.h> -KexiTableView::Appearance::Appearance(QWidget *widget) +KexiTableView::Appearance::Appearance(TQWidget *widget) : alternateBackgroundColor( KGlobalSettings::alternateBackgroundColor() ) { //set defaults - if (qApp) { - QPalette p = widget ? widget->palette() : qApp->palette(); + if (tqApp) { + TQPalette p = widget ? widget->palette() : tqApp->palette(); baseColor = p.active().base(); textColor = p.active().text(); - borderColor = QColor(200,200,200); - emptyAreaColor = p.active().color(QColorGroup::Base); + borderColor = TQColor(200,200,200); + emptyAreaColor = p.active().color(TQColorGroup::Base); rowHighlightingColor = KexiUtils::blendedColors(p.active().highlight(), baseColor, 33, 66); rowMouseOverHighlightingColor = KexiUtils::blendedColors(p.active().highlight(), baseColor, 10, 90); rowMouseOverAlternateHighlightingColor = KexiUtils::blendedColors(p.active().highlight(), alternateBackgroundColor, 10, 90); @@ -87,31 +87,31 @@ KexiTableView::Appearance::Appearance(QWidget *widget) //----------------------------------------- //! @internal A special What's This class displaying information about a given column -class KexiTableView::WhatsThis : public QWhatsThis +class KexiTableView::WhatsThis : public TQWhatsThis { public: - WhatsThis(KexiTableView* tv) : QWhatsThis(tv), m_tv(tv) + WhatsThis(KexiTableView* tv) : TQWhatsThis(tv), m_tv(tv) { Q_ASSERT(tv); } virtual ~WhatsThis() { } - virtual QString text( const QPoint & pos) + virtual TQString text( const TQPoint & pos) { const int leftMargin = m_tv->verticalHeaderVisible() ? m_tv->verticalHeader()->width() : 0; //const int topMargin = m_tv->horizontalHeaderVisible() ? m_tv->d->pTopHeader->height() : 0; //const int bottomMargin = m_tv->d->appearance.navigatorEnabled ? m_tv->m_navPanel->height() : 0; - if (KexiUtils::hasParent(m_tv->verticalHeader(), m_tv->childAt(pos))) { + if (KexiUtils::hasParent(TQT_TQOBJECT(m_tv->verticalHeader()), TQT_TQOBJECT(m_tv->tqchildAt(pos)))) { return i18n("Contains a pointer to the currently selected row"); } - else if (KexiUtils::hasParent(m_tv->m_navPanel, m_tv->childAt(pos))) { + else if (KexiUtils::hasParent(TQT_TQOBJECT(m_tv->m_navPanel), TQT_TQOBJECT(m_tv->tqchildAt(pos)))) { return i18n("Row navigator"); -// return QWhatsThis::textFor(m_tv->m_navPanel, QPoint( pos.x(), pos.y() - m_tv->height() + bottomMargin )); +// return TQWhatsThis::textFor(m_tv->m_navPanel, TQPoint( pos.x(), pos.y() - m_tv->height() + bottomMargin )); } KexiDB::Field *f = m_tv->field( m_tv->columnAt(pos.x()-leftMargin) ); if (!f) - return QString::null; + return TQString(); return f->description().isEmpty() ? f->captionOrName() : f->description(); } protected: @@ -121,19 +121,19 @@ class KexiTableView::WhatsThis : public QWhatsThis //----------------------------------------- KexiTableViewCellToolTip::KexiTableViewCellToolTip( KexiTableView * tableView ) - : QToolTip(tableView->viewport()) + : TQToolTip(tableView->viewport()) , m_tableView(tableView) { } KexiTableViewCellToolTip::~KexiTableViewCellToolTip() { - remove(parentWidget()); + remove(tqparentWidget()); } -void KexiTableViewCellToolTip::maybeTip( const QPoint & p ) +void KexiTableViewCellToolTip::maybeTip( const TQPoint & p ) { - const QPoint cp( m_tableView->viewportToContents( p ) ); + const TQPoint cp( m_tableView->viewportToContents( p ) ); const int row = m_tableView->rowAt( cp.y(), true/*ignoreEnd*/ ); const int col = m_tableView->columnAt( cp.x() ); @@ -147,21 +147,21 @@ void KexiTableViewCellToolTip::maybeTip( const QPoint & p ) int h = m_tableView->rowHeight(); int x = 0; int y_offset = 0; - int align = Qt::SingleLine | Qt::AlignVCenter; - QString txtValue; - QVariant cellValue; + int align = TQt::SingleLine | TQt::AlignVCenter; + TQString txtValue; + TQVariant cellValue; KexiTableViewColumn *tvcol = m_tableView->column(col); if (!m_tableView->getVisibleLookupValue(cellValue, editor, item, tvcol)) cellValue = insertRowSelected ? editor->displayedField()->defaultValue() : item->at(col); //display default value if available const bool focused = m_tableView->selectedItem() == item && col == m_tableView->currentColumn(); editor->setupContents( 0, focused, cellValue, txtValue, align, x, y_offset, w, h ); - QRect realRect(m_tableView->columnPos(col)-m_tableView->contentsX(), + TQRect realRect(m_tableView->columnPos(col)-m_tableView->contentsX(), m_tableView->rowPos(row)-m_tableView->contentsY(), w, h); //m_tableView->cellGeometry( row, col )); if (editor->showToolTipIfNeeded( - txtValue.isEmpty() ? item->at(col) : QVariant(txtValue), + txtValue.isEmpty() ? item->at(col) : TQVariant(txtValue), realRect, m_tableView->fontMetrics(), focused)) { - QString squeezedTxtValue; + TQString squeezedTxtValue; if (txtValue.length() > 50) squeezedTxtValue = txtValue.left(100) + "..."; else @@ -174,8 +174,8 @@ void KexiTableViewCellToolTip::maybeTip( const QPoint & p ) //----------------------------------------- -KexiTableView::KexiTableView(KexiTableViewData* data, QWidget* parent, const char* name) -: QScrollView(parent, name, /*Qt::WRepaintNoErase | */Qt::WStaticContents /*| Qt::WResizeNoErase*/) +KexiTableView::KexiTableView(KexiTableViewData* data, TQWidget* tqparent, const char* name) +: TQScrollView(tqparent, name, /*TQt::WRepaintNoErase | */TQt::WStaticContents /*| TQt::WResizeNoErase*/) , KexiRecordNavigatorHandler() , KexiSharedActionClient() , KexiDataAwareObjectInterface() @@ -184,32 +184,32 @@ KexiTableView::KexiTableView(KexiTableViewData* data, QWidget* parent, const cha d = new KexiTableViewPrivate(this); - connect( kapp, SIGNAL( settingsChanged(int) ), SLOT( slotSettingsChanged(int) ) ); + connect( kapp, TQT_SIGNAL( settingsChanged(int) ), TQT_SLOT( slotSettingsChanged(int) ) ); slotSettingsChanged(KApplication::SETTINGS_SHORTCUTS); m_data = new KexiTableViewData(); //to prevent crash because m_data==0 m_owner = true; //-this will be deleted if needed setResizePolicy(Manual); - viewport()->setBackgroundMode(Qt::NoBackground); -// viewport()->setFocusPolicy(StrongFocus); - viewport()->setFocusPolicy(WheelFocus); - setFocusPolicy(WheelFocus); //<--- !!!!! important (was NoFocus), - // otherwise QApplication::setActiveWindow() won't activate + viewport()->setBackgroundMode(TQt::NoBackground); +// viewport()->setFocusPolicy(TQ_StrongFocus); + viewport()->setFocusPolicy(TQ_WheelFocus); + setFocusPolicy(TQ_WheelFocus); //<--- !!!!! important (was NoFocus), + // otherwise TQApplication::setActiveWindow() won't activate // this widget when needed! // setFocusProxy(viewport()); viewport()->installEventFilter(this); //setup colors defaults - setBackgroundMode(Qt::PaletteBackground); -// setEmptyAreaColor(d->appearance.baseColor);//palette().active().color(QColorGroup::Base)); + setBackgroundMode(TQt::PaletteBackground); +// setEmptyAreaColor(d->appearance.baseColor);//palette().active().color(TQColorGroup::Base)); -// d->baseColor = colorGroup().base(); -// d->textColor = colorGroup().text(); +// d->baseColor = tqcolorGroup().base(); +// d->textColor = tqcolorGroup().text(); // d->altColor = KGlobalSettings::alternateBackgroundColor(); -// d->grayColor = QColor(200,200,200); - d->diagonalGrayPattern = QBrush(d->appearance.borderColor, Qt::BDiagPattern); +// d->grayColor = TQColor(200,200,200); + d->diagonalGrayPattern = TQBrush(d->appearance.borderColor, TQt::BDiagPattern); setLineWidth(1); horizontalScrollBar()->installEventFilter(this); @@ -219,13 +219,13 @@ KexiTableView::KexiTableView(KexiTableViewData* data, QWidget* parent, const cha //context menu m_popupMenu = new KPopupMenu(this, "contextMenu"); #if 0 //moved to mainwindow's actions - d->menu_id_addRecord = m_popupMenu->insertItem(i18n("Add Record"), this, SLOT(addRecord()), Qt::CTRL+Qt::Key_Insert); + d->menu_id_addRecord = m_popupMenu->insertItem(i18n("Add Record"), this, TQT_SLOT(addRecord()), TQt::CTRL+TQt::Key_Insert); d->menu_id_removeRecord = m_popupMenu->insertItem( kapp->iconLoader()->loadIcon("button_cancel", KIcon::Small), - i18n("Remove Record"), this, SLOT(removeRecord()), Qt::CTRL+Qt::Key_Delete); + i18n("Remove Record"), this, TQT_SLOT(removeRecord()), TQt::CTRL+TQt::Key_Delete); #endif -#ifdef Q_WS_WIN +#ifdef TQ_WS_WIN d->rowHeight = fontMetrics().lineSpacing() + 4; #else d->rowHeight = fontMetrics().lineSpacing() + 1; @@ -234,27 +234,27 @@ KexiTableView::KexiTableView(KexiTableViewData* data, QWidget* parent, const cha if(d->rowHeight < 17) d->rowHeight = 17; - d->pUpdateTimer = new QTimer(this); + d->pUpdateTimer = new TQTimer(this); // setMargins(14, fontMetrics().height() + 4, 0, 0); // Create headers m_horizontalHeader = new KexiTableViewHeader(this, "topHeader"); - m_horizontalHeader->setSelectionBackgroundColor( palette().active().highlight() ); + m_horizontalHeader->setSelectionBackgroundColor( tqpalette().active().highlight() ); m_horizontalHeader->setOrientation(Qt::Horizontal); m_horizontalHeader->setTracking(false); m_horizontalHeader->setMovingEnabled(false); - connect(m_horizontalHeader, SIGNAL(sizeChange(int,int,int)), this, SLOT(slotTopHeaderSizeChange(int,int,int))); + connect(m_horizontalHeader, TQT_SIGNAL(sizeChange(int,int,int)), this, TQT_SLOT(slotTopHeaderSizeChange(int,int,int))); m_verticalHeader = new KexiRecordMarker(this, "rm"); - m_verticalHeader->setSelectionBackgroundColor( palette().active().highlight() ); + m_verticalHeader->setSelectionBackgroundColor( tqpalette().active().highlight() ); m_verticalHeader->setCellHeight(d->rowHeight); // m_verticalHeader->setFixedWidth(d->rowHeight); m_verticalHeader->setCurrentRow(-1); setMargins( - QMIN(m_horizontalHeader->sizeHint().height(), d->rowHeight), - m_horizontalHeader->sizeHint().height(), 0, 0); + TQMIN(m_horizontalHeader->tqsizeHint().height(), d->rowHeight), + m_horizontalHeader->tqsizeHint().height(), 0, 0); setupNavigator(); @@ -267,8 +267,8 @@ KexiTableView::KexiTableView(KexiTableViewData* data, QWidget* parent, const cha setData( data ); #if 0//(js) doesn't work! - d->scrollTimer = new QTimer(this); - connect(d->scrollTimer, SIGNAL(timeout()), this, SLOT(slotAutoScroll())); + d->scrollTimer = new TQTimer(this); + connect(d->scrollTimer, TQT_SIGNAL(timeout()), this, TQT_SLOT(slotAutoScroll())); #endif // setBackgroundAltering(true); @@ -278,17 +278,17 @@ KexiTableView::KexiTableView(KexiTableViewData* data, QWidget* parent, const cha viewport()->setAcceptDrops(true); // Connect header, table and scrollbars - connect(horizontalScrollBar(), SIGNAL(valueChanged(int)), m_horizontalHeader, SLOT(setOffset(int))); - connect(verticalScrollBar(), SIGNAL(valueChanged(int)), m_verticalHeader, SLOT(setOffset(int))); - connect(m_horizontalHeader, SIGNAL(sizeChange(int, int, int)), this, SLOT(slotColumnWidthChanged(int, int, int))); - connect(m_horizontalHeader, SIGNAL(sectionHandleDoubleClicked(int)), this, SLOT(slotSectionHandleDoubleClicked(int))); - connect(m_horizontalHeader, SIGNAL(clicked(int)), this, SLOT(sortColumnInternal(int))); + connect(horizontalScrollBar(), TQT_SIGNAL(valueChanged(int)), m_horizontalHeader, TQT_SLOT(setOffset(int))); + connect(verticalScrollBar(), TQT_SIGNAL(valueChanged(int)), m_verticalHeader, TQT_SLOT(setOffset(int))); + connect(m_horizontalHeader, TQT_SIGNAL(sizeChange(int, int, int)), this, TQT_SLOT(slotColumnWidthChanged(int, int, int))); + connect(m_horizontalHeader, TQT_SIGNAL(sectionHandleDoubleClicked(int)), this, TQT_SLOT(slotSectionHandleDoubleClicked(int))); + connect(m_horizontalHeader, TQT_SIGNAL(clicked(int)), this, TQT_SLOT(sortColumnInternal(int))); - connect(d->pUpdateTimer, SIGNAL(timeout()), this, SLOT(slotUpdate())); + connect(d->pUpdateTimer, TQT_SIGNAL(timeout()), this, TQT_SLOT(slotUpdate())); // horizontalScrollBar()->show(); updateScrollBars(); -// resize(sizeHint()); +// resize(tqsizeHint()); // updateContents(); // setMinimumHeight(horizontalScrollBar()->height() + d->rowHeight + topMargin()); @@ -333,7 +333,7 @@ void KexiTableView::setupNavigator() m_navPanel = new KexiRecordNavigator(this, leftMargin(), "navPanel"); m_navPanel->setRecordHandler(this); - m_navPanel->setSizePolicy(QSizePolicy::Minimum,QSizePolicy::Preferred); + m_navPanel->tqsetSizePolicy(TQSizePolicy::Minimum,TQSizePolicy::Preferred); } void KexiTableView::initDataContents() @@ -345,8 +345,8 @@ void KexiTableView::initDataContents() m_navPanel->showEditingIndicator(false); } -void KexiTableView::addHeaderColumn(const QString& caption, const QString& description, - const QIconSet& icon, int width) +void KexiTableView::addHeaderColumn(const TQString& caption, const TQString& description, + const TQIconSet& icon, int width) { const int nr = m_horizontalHeader->count(); if (icon.isNull()) @@ -360,33 +360,33 @@ void KexiTableView::addHeaderColumn(const QString& caption, const QString& descr void KexiTableView::updateWidgetContentsSize() { - QSize s(tableSize()); + TQSize s(tableSize()); resizeContents(s.width(), s.height()); } -void KexiTableView::slotRowsDeleted( const QValueList<int> &rows ) +void KexiTableView::slotRowsDeleted( const TQValueList<int> &rows ) { - viewport()->repaint(); + viewport()->tqrepaint(); updateWidgetContentsSize(); - setCursorPosition(QMAX(0, (int)m_curRow - (int)rows.count()), -1, true); + setCursorPosition(TQMAX(0, (int)m_curRow - (int)rows.count()), -1, true); } -/*void KexiTableView::addDropFilter(const QString &filter) +/*void KexiTableView::addDropFilter(const TQString &filter) { d->dropFilters.append(filter); viewport()->setAcceptDrops(true); }*/ -void KexiTableView::setFont( const QFont &font ) +void KexiTableView::setFont( const TQFont &font ) { - QScrollView::setFont(font); + TQScrollView::setFont(font); updateFonts(true); } -void KexiTableView::updateFonts(bool repaint) +void KexiTableView::updateFonts(bool tqrepaint) { -#ifdef Q_WS_WIN +#ifdef TQ_WS_WIN d->rowHeight = fontMetrics().lineSpacing() + 4; #else d->rowHeight = fontMetrics().lineSpacing() + 1; @@ -399,15 +399,15 @@ void KexiTableView::updateFonts(bool repaint) // if(d->rowHeight < 22) // d->rowHeight = 22; setMargins( - QMIN(m_horizontalHeader->sizeHint().height(), d->rowHeight), - m_horizontalHeader->sizeHint().height(), 0, 0); + TQMIN(m_horizontalHeader->tqsizeHint().height(), d->rowHeight), + m_horizontalHeader->tqsizeHint().height(), 0, 0); // setMargins(14, d->rowHeight, 0, 0); m_verticalHeader->setCellHeight(d->rowHeight); KexiDisplayUtils::initDisplayForAutonumberSign(d->autonumberSignDisplayParameters, this); KexiDisplayUtils::initDisplayForDefaultValue(d->defaultValueDisplayParameters, this); - if (repaint) + if (tqrepaint) updateContents(); } @@ -425,7 +425,7 @@ void KexiTableView::updateAllVisibleRowsBelow(int row) clipper()->width(), clipper()->height() - (rowPos(row) - contentsY()) ); } -void KexiTableView::clearColumnsInternal(bool /*repaint*/) +void KexiTableView::clearColumnsInternal(bool /*tqrepaint*/) { while(m_horizontalHeader->count()>0) m_horizontalHeader->removeLabel(0); @@ -434,7 +434,7 @@ void KexiTableView::clearColumnsInternal(bool /*repaint*/) void KexiTableView::slotUpdate() { // kdDebug(44021) << " KexiTableView::slotUpdate() -- " << endl; -// QSize s(tableSize()); +// TQSize s(tableSize()); // viewport()->setUpdatesEnabled(false); /// resizeContents(s.width(), s.height()); // viewport()->setUpdatesEnabled(true); @@ -457,7 +457,7 @@ int KexiTableView::currentLocalSortingOrder() const { if (m_horizontalHeader->sortIndicatorSection()==-1) return 0; - return (m_horizontalHeader->sortIndicatorOrder() == Qt::Ascending) ? 1 : -1; + return (m_horizontalHeader->sortIndicatorOrder() == TQt::Ascending) ? 1 : -1; } void KexiTableView::setLocalSortingOrder(int col, int order) @@ -465,7 +465,7 @@ void KexiTableView::setLocalSortingOrder(int col, int order) if (order == 0) col = -1; if (col>=0) - m_horizontalHeader->setSortIndicator(col, (order==1) ? Qt::Ascending : Qt::Descending); + m_horizontalHeader->setSortIndicator(col, (order==1) ? TQt::Ascending : TQt::Descending); } int KexiTableView::currentLocalSortColumn() const @@ -488,37 +488,37 @@ void KexiTableView::updateGUIAfterSorting() // d->pUpdateTimer->start(1,true); } -QSizePolicy KexiTableView::sizePolicy() const +TQSizePolicy KexiTableView::sizePolicy() const { // this widget is expandable - return QSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding); + return TQSizePolicy(TQSizePolicy::Expanding, TQSizePolicy::Expanding); } -QSize KexiTableView::sizeHint() const +TQSize KexiTableView::tqsizeHint() const { - const QSize &ts = tableSize(); - int w = QMAX( ts.width() + leftMargin()+ verticalScrollBar()->sizeHint().width() + 2*2, + const TQSize &ts = tableSize(); + int w = TQMAX( ts.width() + leftMargin()+ verticalScrollBar()->tqsizeHint().width() + 2*2, (m_navPanel->isVisible() ? m_navPanel->width() : 0) ); - int h = QMAX( ts.height()+topMargin()+horizontalScrollBar()->sizeHint().height(), - minimumSizeHint().height() ); - w = QMIN( w, qApp->desktop()->width()*3/4 ); //stretch - h = QMIN( h, qApp->desktop()->height()*3/4 ); //stretch - -// kexidbg << "KexiTableView::sizeHint()= " <<w <<", " <<h << endl; - - return QSize(w, h); - /*QSize( - QMAX( ts.width() + leftMargin() + 2*2, (m_navPanel ? m_navPanel->width() : 0) ), - //+ QMIN(m_verticalHeader->width(),d->rowHeight) + margin()*2, - QMAX( ts.height()+topMargin()+horizontalScrollBar()->sizeHint().height(), - minimumSizeHint().height() ) + int h = TQMAX( ts.height()+topMargin()+horizontalScrollBar()->tqsizeHint().height(), + tqminimumSizeHint().height() ); + w = TQMIN( w, tqApp->desktop()->width()*3/4 ); //stretch + h = TQMIN( h, tqApp->desktop()->height()*3/4 ); //stretch + +// kexidbg << "KexiTableView::tqsizeHint()= " <<w <<", " <<h << endl; + + return TQSize(w, h); + /*TQSize( + TQMAX( ts.width() + leftMargin() + 2*2, (m_navPanel ? m_navPanel->width() : 0) ), + //+ TQMIN(m_verticalHeader->width(),d->rowHeight) + margin()*2, + TQMAX( ts.height()+topMargin()+horizontalScrollBar()->tqsizeHint().height(), + tqminimumSizeHint().height() ) );*/ -// QMAX(ts.height() + topMargin(), minimumSizeHint().height()) ); +// TQMAX(ts.height() + topMargin(), tqminimumSizeHint().height()) ); } -QSize KexiTableView::minimumSizeHint() const +TQSize KexiTableView::tqminimumSizeHint() const { - return QSize( + return TQSize( leftMargin() + ((columns()>0)?columnWidth(0):KEXI_DEFAULT_DATA_COLUMN_WIDTH) + 2*2, d->rowHeight*5/2 + topMargin() + (m_navPanel && m_navPanel->isVisible() ? m_navPanel->height() : 0) ); @@ -527,7 +527,7 @@ QSize KexiTableView::minimumSizeHint() const void KexiTableView::createBuffer(int width, int height) { if(!d->pBufferPm) - d->pBufferPm = new QPixmap(width, height); + d->pBufferPm = new TQPixmap(width, height); else if(d->pBufferPm->width() < width || d->pBufferPm->height() < height) d->pBufferPm->resize(width, height); @@ -536,7 +536,7 @@ void KexiTableView::createBuffer(int width, int height) //internal inline void KexiTableView::paintRow(KexiTableItem *item, - QPainter *pb, int r, int rowp, int cx, int cy, + TQPainter *pb, int r, int rowp, int cx, int cy, int colfirst, int collast, int maxwc) { if (!item) @@ -579,7 +579,7 @@ inline void KexiTableView::paintRow(KexiTableItem *item, // Translate painter and draw the cell pb->saveWorldMatrix(); pb->translate(translx, transly); - paintCell( pb, item, c, r, QRect(colp, rowp, colw, d->rowHeight)); + paintCell( pb, item, c, r, TQRect(colp, rowp, colw, d->rowHeight)); pb->restoreWorldMatrix(); } @@ -594,14 +594,14 @@ inline void KexiTableView::paintRow(KexiTableItem *item, if (y_line>=0) { RasterOp op = pb->rasterOp(); pb->setRasterOp(XorROP); - pb->setPen( QPen(Qt::white, 3) ); + pb->setPen( TQPen(TQt::white, 3) ); pb->drawLine(0, y_line, maxwc, y_line); pb->setRasterOp(op); } } } -void KexiTableView::drawContents( QPainter *p, int cx, int cy, int cw, int ch) +void KexiTableView::drawContents( TQPainter *p, int cx, int cy, int cw, int ch) { if (d->disableDrawContents) return; @@ -613,8 +613,8 @@ void KexiTableView::drawContents( QPainter *p, int cx, int cy, int cw, int ch) bool plus1row = false; //true if we should show 'inserting' row at the end bool paintOnlyInsertRow = false; -/* kdDebug(44021) << QString(" KexiTableView::drawContents(cx:%1 cy:%2 cw:%3 ch:%4)") - .arg(cx).arg(cy).arg(cw).arg(ch) << endl;*/ +/* kdDebug(44021) << TQString(" KexiTableView::drawContents(cx:%1 cy:%2 cw:%3 ch:%4)") + .tqarg(cx).tqarg(cy).tqarg(cw).tqarg(ch) << endl;*/ if (rowlast == -1) { rowlast = rows() - 1; @@ -657,10 +657,10 @@ void KexiTableView::drawContents( QPainter *p, int cx, int cy, int cw, int ch) createBuffer(cw, ch); if(d->pBufferPm->isNull()) return; - QPainter *pb = new QPainter(d->pBufferPm, this); -// pb->fillRect(0, 0, cw, ch, colorGroup().base()); + TQPainter *pb = new TQPainter(d->pBufferPm, this); +// pb->fillRect(0, 0, cw, ch, tqcolorGroup().base()); -// int maxwc = QMIN(cw, (columnPos(d->numCols - 1) + columnWidth(d->numCols - 1))); +// int maxwc = TQMIN(cw, (columnPos(d->numCols - 1) + columnWidth(d->numCols - 1))); int maxwc = columnPos(columns() - 1) + columnWidth(columns() - 1); // kdDebug(44021) << "KexiTableView::drawContents(): maxwc: " << maxwc << endl; @@ -673,7 +673,7 @@ void KexiTableView::drawContents( QPainter *p, int cx, int cy, int cw, int ch) rowp = rowPos(r); // 'insert' row's position } else { - QPtrListIterator<KexiTableItem> it = m_data->iterator(); + TQPtrListIterator<KexiTableItem> it = m_data->iterator(); it += rowfirst;//move to 1st row rowp = rowPos(rowfirst); // row position for (r = rowfirst;r <= rowlast; r++, ++it, rowp+=d->rowHeight) { @@ -693,7 +693,7 @@ void KexiTableView::drawContents( QPainter *p, int cx, int cy, int cw, int ch) paintEmptyArea(p, cx, cy, cw, ch); } -bool KexiTableView::isDefaultValueDisplayed(KexiTableItem *item, int col, QVariant* value) +bool KexiTableView::isDefaultValueDisplayed(KexiTableItem *item, int col, TQVariant* value) { const bool cursorAtInsertRowOrEditingNewRow = (item == m_insertItem || (m_newRowEditing && m_currentItem == item)); KexiTableViewColumn *tvcol; @@ -709,7 +709,7 @@ bool KexiTableView::isDefaultValueDisplayed(KexiTableItem *item, int col, QVaria return false; } -void KexiTableView::paintCell(QPainter* p, KexiTableItem *item, int col, int row, const QRect &cr, bool print) +void KexiTableView::paintCell(TQPainter* p, KexiTableItem *item, int col, int row, const TQRect &cr, bool print) { p->save(); Q_UNUSED(print); @@ -718,12 +718,12 @@ void KexiTableView::paintCell(QPainter* p, KexiTableItem *item, int col, int row int x2 = w - 1; int y2 = h - 1; -/* if (0==qstrcmp("KexiComboBoxPopup",parentWidget()->className())) { - kexidbg << parentWidget()->className() << " >>>>>> KexiTableView::paintCell(col=" << col <<"row="<<row<<") w="<<w<<endl; +/* if (0==qstrcmp("KexiComboBoxPopup",tqparentWidget()->className())) { + kexidbg << tqparentWidget()->className() << " >>>>>> KexiTableView::paintCell(col=" << col <<"row="<<row<<") w="<<w<<endl; }*/ // Draw our lines - QPen pen(p->pen()); + TQPen pen(p->pen()); if (d->appearance.gridEnabled) { p->setPen(d->appearance.borderColor); @@ -746,12 +746,12 @@ void KexiTableView::paintCell(QPainter* p, KexiTableItem *item, int col, int row int x = edit ? edit->leftMargin() : 0; int y_offset=0; - int align = Qt::SingleLine | Qt::AlignVCenter; - QString txt; //text to draw + int align = TQt::SingleLine | TQt::AlignVCenter; + TQString txt; //text to draw KexiTableViewColumn *tvcol = m_data->column(col); - QVariant cellValue; + TQVariant cellValue; if (col < (int)item->count()) { if (m_currentItem == item) { if (m_editor && row == m_curRow && col == m_curCol @@ -790,44 +790,44 @@ void KexiTableView::paintCell(QPainter* p, KexiTableItem *item, int col, int row && m_curRow /*d->highlightedRow*/ >= 0 && row != m_curRow; //d->highlightedRow; // setup default pen - QPen defaultPen; + TQPen defaultPen; const bool usesSelectedTextColor = edit && edit->usesSelectedTextColor(); if (defaultValueDisplayed) { if (col == m_curCol && row == m_curRow && usesSelectedTextColor) - defaultPen = d->defaultValueDisplayParameters.selectedTextColor; + defaultPen = TQPen(d->defaultValueDisplayParameters.selectedTextColor); else - defaultPen = d->defaultValueDisplayParameters.textColor; + defaultPen = TQPen(d->defaultValueDisplayParameters.textColor); } else if (d->appearance.fullRowSelection && (row == d->highlightedRow || (row == m_curRow && d->highlightedRow==-1)) && usesSelectedTextColor ) { - defaultPen = d->appearance.rowHighlightingTextColor; //special case: highlighted row + defaultPen = TQPen(d->appearance.rowHighlightingTextColor); //special case: highlighted row } else if (d->appearance.fullRowSelection && row == m_curRow && usesSelectedTextColor) { - defaultPen = d->appearance.textColor; //special case for full row selection + defaultPen = TQPen(d->appearance.textColor); //special case for full row selection } else if (m_currentItem == item && col == m_curCol && !columnReadOnly && !dontPaintNonpersistentSelectionBecauseDifferentRowHasBeenHighlighted && usesSelectedTextColor) { - defaultPen = colorGroup().highlightedText(); //selected text + defaultPen = TQPen(tqcolorGroup().highlightedText()); //selected text } else if (d->appearance.rowHighlightingEnabled && row == m_curRow && !dontPaintNonpersistentSelectionBecauseDifferentRowHasBeenHighlighted && usesSelectedTextColor) { - defaultPen = d->appearance.rowHighlightingTextColor; + defaultPen = TQPen(d->appearance.rowHighlightingTextColor); } else if (d->appearance.rowMouseOverHighlightingEnabled && row == d->highlightedRow && !dontPaintNonpersistentSelectionBecauseDifferentRowHasBeenHighlighted && usesSelectedTextColor) { - defaultPen = d->appearance.rowMouseOverHighlightingTextColor; + defaultPen = TQPen(d->appearance.rowMouseOverHighlightingTextColor); } else - defaultPen = d->appearance.textColor; + defaultPen = TQPen(d->appearance.textColor); if (edit) { if (defaultValueDisplayed) @@ -849,7 +849,7 @@ void KexiTableView::paintCell(QPainter* p, KexiTableItem *item, int col, int row if (m_currentItem == item && (col == m_curCol || d->appearance.fullRowSelection)) { if (edit && ((d->appearance.rowHighlightingEnabled && !d->appearance.fullRowSelection) || (row == m_curRow && d->highlightedRow==-1 && d->appearance.fullRowSelection))) //!dontPaintNonpersistentSelectionBecauseDifferentRowHasBeenHighlighted) edit->paintSelectionBackground( p, isEnabled(), txt, align, x, y_offset, w, h, - isEnabled() ? colorGroup().highlight() : QColor(200,200,200),//d->grayColor, + isEnabled() ? tqcolorGroup().highlight() : TQColor(200,200,200),//d->grayColor, p->fontMetrics(), columnReadOnly, d->appearance.fullRowSelection ); } @@ -867,7 +867,7 @@ void KexiTableView::paintCell(QPainter* p, KexiTableItem *item, int col, int row p->setPen(d->appearance.textColor); } else { - QPen gray_pen(p->pen()); + TQPen gray_pen(p->pen()); gray_pen.setColor(d->appearance.borderColor); p->setPen(gray_pen); } @@ -887,7 +887,7 @@ void KexiTableView::paintCell(QPainter* p, KexiTableItem *item, int col, int row // autonumber = true; // if (autonumber) { KexiDisplayUtils::paintAutonumberSign(d->autonumberSignDisplayParameters, p, - x, y_offset, w - x - x - ((align & Qt::AlignLeft)?2:0), h, align); + x, y_offset, w - x - x - ((align & TQt::AlignLeft)?2:0), h, align); // } } } @@ -897,81 +897,81 @@ void KexiTableView::paintCell(QPainter* p, KexiTableItem *item, int col, int row if (defaultValueDisplayed) p->setFont( d->defaultValueDisplayParameters.font ); p->setPen( defaultPen ); - p->drawText(x, y_offset, w - (x + x)- ((align & Qt::AlignLeft)?2:0)/*right space*/, h, + p->drawText(x, y_offset, w - (x + x)- ((align & TQt::AlignLeft)?2:0)/*right space*/, h, align, txt); } p->restore(); } -QPoint KexiTableView::contentsToViewport2( const QPoint &p ) +TQPoint KexiTableView::contentsToViewport2( const TQPoint &p ) { - return QPoint( p.x() - contentsX(), p.y() - contentsY() ); + return TQPoint( p.x() - contentsX(), p.y() - contentsY() ); } void KexiTableView::contentsToViewport2( int x, int y, int& vx, int& vy ) { - const QPoint v = contentsToViewport2( QPoint( x, y ) ); + const TQPoint v = contentsToViewport2( TQPoint( x, y ) ); vx = v.x(); vy = v.y(); } -QPoint KexiTableView::viewportToContents2( const QPoint& vp ) +TQPoint KexiTableView::viewportToContents2( const TQPoint& vp ) { - return QPoint( vp.x() + contentsX(), + return TQPoint( vp.x() + contentsX(), vp.y() + contentsY() ); } -void KexiTableView::paintEmptyArea( QPainter *p, int cx, int cy, int cw, int ch ) +void KexiTableView::paintEmptyArea( TQPainter *p, int cx, int cy, int cw, int ch ) { -// qDebug("%s: paintEmptyArea(x:%d y:%d w:%d h:%d)", (const char*)parentWidget()->caption(),cx,cy,cw,ch); +// qDebug("%s: paintEmptyArea(x:%d y:%d w:%d h:%d)", (const char*)tqparentWidget()->caption(),cx,cy,cw,ch); // Regions work with shorts, so avoid an overflow and adjust the // table size to the visible size - QSize ts( tableSize() ); -// ts.setWidth( QMIN( ts.width(), visibleWidth() ) ); -// ts.setHeight( QMIN( ts.height() - (m_navPanel ? m_navPanel->height() : 0), visibleHeight()) ); -/* kdDebug(44021) << QString(" (cx:%1 cy:%2 cw:%3 ch:%4)") - .arg(cx).arg(cy).arg(cw).arg(ch) << endl; - kdDebug(44021) << QString(" (w:%3 h:%4)") - .arg(ts.width()).arg(ts.height()) << endl;*/ + TQSize ts( tableSize() ); +// ts.setWidth( TQMIN( ts.width(), visibleWidth() ) ); +// ts.setHeight( TQMIN( ts.height() - (m_navPanel ? m_navPanel->height() : 0), visibleHeight()) ); +/* kdDebug(44021) << TQString(" (cx:%1 cy:%2 cw:%3 ch:%4)") + .tqarg(cx).tqarg(cy).tqarg(cw).tqarg(ch) << endl; + kdDebug(44021) << TQString(" (w:%3 h:%4)") + .tqarg(ts.width()).tqarg(ts.height()) << endl;*/ // Region of the rect we should draw, calculated in viewport // coordinates, as a region can't handle bigger coordinates contentsToViewport2( cx, cy, cx, cy ); - QRegion reg( QRect( cx, cy, cw, ch ) ); + TQRegion reg( TQRect( cx, cy, cw, ch ) ); //kexidbg << "---cy-- " << contentsY() << endl; // Subtract the table from it -// reg = reg.subtract( QRect( QPoint( 0, 0 ), ts-QSize(0,m_navPanel->isVisible() ? m_navPanel->height() : 0) ) ); - reg = reg.subtract( QRect( QPoint( 0, 0 ), ts - -QSize(0,QMAX((m_navPanel ? m_navPanel->height() : 0), horizontalScrollBar()->sizeHint().height()) - - (horizontalScrollBar()->isVisible() ? horizontalScrollBar()->sizeHint().height()/2 : 0) +// reg = reg.subtract( TQRect( TQPoint( 0, 0 ), ts-TQSize(0,m_navPanel->isVisible() ? m_navPanel->height() : 0) ) ); + reg = reg.subtract( TQRect( TQPoint( 0, 0 ), ts + -TQSize(0,TQMAX((m_navPanel ? m_navPanel->height() : 0), horizontalScrollBar()->tqsizeHint().height()) + - (horizontalScrollBar()->isVisible() ? horizontalScrollBar()->tqsizeHint().height()/2 : 0) + (horizontalScrollBar()->isVisible() ? 0 : d->internal_bottomMargin -// horizontalScrollBar()->sizeHint().height()/2 +// horizontalScrollBar()->tqsizeHint().height()/2 ) -//- /*d->bottomMargin */ horizontalScrollBar()->sizeHint().height()*3/2 +//- /*d->bottomMargin */ horizontalScrollBar()->tqsizeHint().height()*3/2 + contentsY() -// - (verticalScrollBar()->isVisible() ? horizontalScrollBar()->sizeHint().height()/2 : 0) +// - (verticalScrollBar()->isVisible() ? horizontalScrollBar()->tqsizeHint().height()/2 : 0) ) ) ); -// reg = reg.subtract( QRect( QPoint( 0, 0 ), ts ) ); +// reg = reg.subtract( TQRect( TQPoint( 0, 0 ), ts ) ); // And draw the rectangles (transformed inc contents coordinates as needed) - QMemArray<QRect> r = reg.rects(); + TQMemArray<TQRect> r = reg.tqrects(); for ( int i = 0; i < (int)r.count(); i++ ) { - QRect rect( viewportToContents2(r[i].topLeft()), r[i].size() ); -/* kdDebug(44021) << QString("- pEA: p->fillRect(x:%1 y:%2 w:%3 h:%4)") - .arg(rect.x()).arg(rect.y()) - .arg(rect.width()).arg(rect.height()) << endl;*/ -// p->fillRect( QRect(viewportToContents2(r[i].topLeft()),r[i].size()), d->emptyAreaColor ); + TQRect rect( viewportToContents2(r[i].topLeft()), r[i].size() ); +/* kdDebug(44021) << TQString("- pEA: p->fillRect(x:%1 y:%2 w:%3 h:%4)") + .tqarg(rect.x()).tqarg(rect.y()) + .tqarg(rect.width()).tqarg(rect.height()) << endl;*/ +// p->fillRect( TQRect(viewportToContents2(r[i].topLeft()),r[i].size()), d->emptyAreaColor ); p->fillRect( rect, d->appearance.emptyAreaColor ); -// p->fillRect( QRect(viewportToContents2(r[i].topLeft()),r[i].size()), viewport()->backgroundBrush() ); +// p->fillRect( TQRect(viewportToContents2(r[i].topLeft()),r[i].size()), viewport()->backgroundBrush() ); } } -void KexiTableView::contentsMouseDoubleClickEvent(QMouseEvent *e) +void KexiTableView::contentsMouseDoubleClickEvent(TQMouseEvent *e) { // kdDebug(44021) << "KexiTableView::contentsMouseDoubleClickEvent()" << endl; m_contentsMousePressEvent_dblClick = true; @@ -987,7 +987,7 @@ void KexiTableView::contentsMouseDoubleClickEvent(QMouseEvent *e) } else { startEditCurrentCell(); - // createEditor(m_curRow, m_curCol, QString::null); + // createEditor(m_curRow, m_curCol, TQString()); } } @@ -995,22 +995,22 @@ void KexiTableView::contentsMouseDoubleClickEvent(QMouseEvent *e) } } -void KexiTableView::contentsMousePressEvent( QMouseEvent* e ) +void KexiTableView::contentsMousePressEvent( TQMouseEvent* e ) { // kdDebug(44021) << "KexiTableView::contentsMousePressEvent() ??" << endl; setFocus(); if(m_data->count()==0 && !isInsertingEnabled()) { - QScrollView::contentsMousePressEvent( e ); + TQScrollView::contentsMousePressEvent( e ); return; } if (columnAt(e->pos().x())==-1) { //outside a colums - QScrollView::contentsMousePressEvent( e ); + TQScrollView::contentsMousePressEvent( e ); return; } // d->contentsMousePressEvent_ev = *e; // d->contentsMousePressEvent_enabled = true; -// QTimer::singleShot(2000, this, SLOT( contentsMousePressEvent_Internal() )); +// TQTimer::singleShot(2000, this, TQT_SLOT( contentsMousePressEvent_Internal() )); // d->contentsMousePressEvent_timer.start(100,true); // if (!d->contentsMousePressEvent_enabled) @@ -1022,7 +1022,7 @@ void KexiTableView::contentsMousePressEvent( QMouseEvent* e ) return; } -// kdDebug(44021)<<"void KexiTableView::contentsMousePressEvent( QMouseEvent* e ) by now the current items should be set, if not -> error + crash"<<endl; +// kdDebug(44021)<<"void KexiTableView::contentsMousePressEvent( TQMouseEvent* e ) by now the current items should be set, if not -> error + crash"<<endl; if(e->button() == Qt::RightButton) { showContextMenu(e->globalPos()); @@ -1032,19 +1032,19 @@ void KexiTableView::contentsMousePressEvent( QMouseEvent* e ) if(columnType(m_curCol) == KexiDB::Field::Boolean && columnEditable(m_curCol)) { //only accept clicking on the [x] rect (copied from KexiBoolTableEdit::setupContents()) - int s = QMAX(d->rowHeight - 5, 12); - s = QMIN( d->rowHeight-3, s ); - s = QMIN( columnWidth(m_curCol)-3, s ); //avoid too large box - const QRect r( columnPos(m_curCol) + QMAX( columnWidth(m_curCol)/2 - s/2, 0 ), rowPos(m_curRow) +d->rowHeight/2 - s/2 /*- 1*/, s, s); + int s = TQMAX(d->rowHeight - 5, 12); + s = TQMIN( d->rowHeight-3, s ); + s = TQMIN( columnWidth(m_curCol)-3, s ); //avoid too large box + const TQRect r( columnPos(m_curCol) + TQMAX( columnWidth(m_curCol)/2 - s/2, 0 ), rowPos(m_curRow) +d->rowHeight/2 - s/2 /*- 1*/, s, s); //kexidbg << r << endl; - if (r.contains(e->pos())) { + if (r.tqcontains(e->pos())) { // kexidbg << "e->x:" << e->x() << " e->y:" << e->y() << " " << rowPos(m_curRow) << // " " << columnPos(m_curCol) << endl; boolToggled(); } } #if 0 //js: TODO - else if(columnType(m_curCol) == QVariant::StringList && columnEditable(m_curCol)) + else if(columnType(m_curCol) == TQVariant::StringList && columnEditable(m_curCol)) { createEditor(m_curRow, m_curCol); } @@ -1053,7 +1053,7 @@ void KexiTableView::contentsMousePressEvent( QMouseEvent* e ) //ScrollView::contentsMousePressEvent( e ); } -void KexiTableView::contentsMouseReleaseEvent( QMouseEvent* e ) +void KexiTableView::contentsMouseReleaseEvent( TQMouseEvent* e ) { // kdDebug(44021) << "KexiTableView::contentsMousePressEvent() ??" << endl; if(m_data->count()==0 && !isInsertingEnabled()) @@ -1068,12 +1068,12 @@ void KexiTableView::contentsMouseReleaseEvent( QMouseEvent* e ) if (!m_currentItem || col==-1 || row==-1 || col!=m_curCol || row!=m_curRow)//outside a current cell return; - QScrollView::contentsMouseReleaseEvent( e ); + TQScrollView::contentsMouseReleaseEvent( e ); emit itemMouseReleased(m_currentItem, m_curRow, m_curCol); } -bool KexiTableView::handleContentsMousePressOrRelease(QMouseEvent* e, bool release) +bool KexiTableView::handleContentsMousePressOrRelease(TQMouseEvent* e, bool release) { // remember old focus cell int oldRow = m_curRow; @@ -1088,9 +1088,9 @@ bool KexiTableView::handleContentsMousePressOrRelease(QMouseEvent* e, bool relea newrow = rowAt(e->pos().y() - d->rowHeight); if (newrow==-1 && m_data->count()>0) { if (release) - QScrollView::contentsMouseReleaseEvent( e ); + TQScrollView::contentsMouseReleaseEvent( e ); else - QScrollView::contentsMousePressEvent( e ); + TQScrollView::contentsMousePressEvent( e ); return false; } newrow++; @@ -1105,9 +1105,9 @@ bool KexiTableView::handleContentsMousePressOrRelease(QMouseEvent* e, bool relea else { if (rowAt(e->pos().y())==-1 || columnAt(e->pos().x())==-1) { if (release) - QScrollView::contentsMouseReleaseEvent( e ); + TQScrollView::contentsMouseReleaseEvent( e ); else - QScrollView::contentsMousePressEvent( e ); + TQScrollView::contentsMousePressEvent( e ); return false; //clicked outside a grid } // get new focus cell @@ -1121,13 +1121,13 @@ bool KexiTableView::handleContentsMousePressOrRelease(QMouseEvent* e, bool relea return true; } -void KexiTableView::showContextMenu(const QPoint& _pos) +void KexiTableView::showContextMenu(const TQPoint& _pos) { if (!d->contextMenuEnabled || m_popupMenu->count()<1) return; - QPoint pos(_pos); - if (pos==QPoint(-1,-1)) { - pos = viewport()->mapToGlobal( QPoint( columnPos(m_curCol), rowPos(m_curRow) + d->rowHeight ) ); + TQPoint pos(_pos); + if (pos==TQPoint(-1,-1)) { + pos = viewport()->mapToGlobal( TQPoint( columnPos(m_curCol), rowPos(m_curRow) + d->rowHeight ) ); } //show own context menu if configured // if (updateContextMenu()) { @@ -1140,7 +1140,7 @@ void KexiTableView::showContextMenu(const QPoint& _pos) }*/ } -void KexiTableView::contentsMouseMoveEvent( QMouseEvent *e ) +void KexiTableView::contentsMouseMoveEvent( TQMouseEvent *e ) { int row; const int col = columnAt(e->x()); @@ -1159,7 +1159,7 @@ void KexiTableView::contentsMouseMoveEvent( QMouseEvent *e ) d->highlightedRow = row; updateRow(oldRow); updateRow(d->highlightedRow); - //currently selected (not necessary highlighted) row needs to be repainted + //currently selected (not necessary highlighted) row needs to be tqrepainted updateRow(m_curRow); m_verticalHeader->setHighlightedRow(d->highlightedRow); } @@ -1202,11 +1202,11 @@ void KexiTableView::contentsMouseMoveEvent( QMouseEvent *e ) contentsMousePressEvent(e); } #endif - QScrollView::contentsMouseMoveEvent(e); + TQScrollView::contentsMouseMoveEvent(e); } #if 0//(js) doesn't work! -void KexiTableView::contentsMouseReleaseEvent(QMouseEvent *) +void KexiTableView::contentsMouseReleaseEvent(TQMouseEvent *) { if(d->needAutoScroll) { @@ -1215,13 +1215,13 @@ void KexiTableView::contentsMouseReleaseEvent(QMouseEvent *) } #endif -static bool overrideEditorShortcutNeeded(QKeyEvent *e) +static bool overrideEditorShortcutNeeded(TQKeyEvent *e) { //perhaps more to come... - return e->key() == Qt::Key_Delete && e->state()==Qt::ControlButton; + return e->key() == TQt::Key_Delete && e->state()==TQt::ControlButton; } -bool KexiTableView::shortCutPressed( QKeyEvent *e, const QCString &action_name ) +bool KexiTableView::shortCutPressed( TQKeyEvent *e, const TQCString &action_name ) { const int k = e->key(); KAction *action = m_sharedActions[action_name]; @@ -1240,20 +1240,20 @@ bool KexiTableView::shortCutPressed( QKeyEvent *e, const QCString &action_name ) //check default shortcut (when user app has no action shortcuts defined // but we want these shortcuts to still work) if (action_name=="data_save_row") - return (k == Qt::Key_Return || k == Qt::Key_Enter) && e->state()==Qt::ShiftButton; + return (k == TQt::Key_Return || k == TQt::Key_Enter) && e->state()==TQt::ShiftButton; if (action_name=="edit_delete_row") - return k == Qt::Key_Delete && e->state()==Qt::ControlButton; + return k == TQt::Key_Delete && e->state()==TQt::ControlButton; if (action_name=="edit_delete") - return k == Qt::Key_Delete && e->state()==Qt::NoButton; + return k == TQt::Key_Delete && e->state()==Qt::NoButton; if (action_name=="edit_edititem") - return k == Qt::Key_F2 && e->state()==Qt::NoButton; + return k == TQt::Key_F2 && e->state()==Qt::NoButton; if (action_name=="edit_insert_empty_row") - return k == Qt::Key_Insert && e->state()==(Qt::ShiftButton | Qt::ControlButton); + return k == TQt::Key_Insert && e->state()==(TQt::ShiftButton | TQt::ControlButton); return false; } -void KexiTableView::keyPressEvent(QKeyEvent* e) +void KexiTableView::keyPressEvent(TQKeyEvent* e) { if (!hasData()) return; @@ -1261,10 +1261,10 @@ void KexiTableView::keyPressEvent(QKeyEvent* e) const int k = e->key(); const bool ro = isReadOnly(); - QWidget *w = focusWidget(); + TQWidget *w = tqfocusWidget(); // if (!w || w!=viewport() && w!=this && (!m_editor || w!=m_editor->view() && w!=m_editor)) { // if (!w || w!=viewport() && w!=this && (!m_editor || w!=m_editor->view())) { - if (!w || w!=viewport() && w!=this && (!m_editor || !KexiUtils::hasParent(dynamic_cast<QObject*>(m_editor), w))) { + if (!w || TQT_BASE_OBJECT(w)!=TQT_BASE_OBJECT(viewport()) && TQT_TQOBJECT(w)!=TQT_TQOBJECT(this) && (!m_editor || !KexiUtils::hasParent(TQT_TQOBJECT(dynamic_cast<TQT_BASE_OBJECT_NAME*>(m_editor)), TQT_TQOBJECT(w)))) { //don't process stranger's events e->ignore(); return; @@ -1286,11 +1286,11 @@ void KexiTableView::keyPressEvent(QKeyEvent* e) } if(m_editor) {// if a cell is edited, do some special stuff - if (k == Qt::Key_Escape) { + if (k == TQt::Key_Escape) { cancelEditor(); e->accept(); return; - } else if (k == Qt::Key_Return || k == Qt::Key_Enter) { + } else if (k == TQt::Key_Return || k == TQt::Key_Enter) { if (columnType(m_curCol) == KexiDB::Field::Boolean) { boolToggled(); } @@ -1309,7 +1309,7 @@ void KexiTableView::keyPressEvent(QKeyEvent* e) } } - if(k == Qt::Key_Return || k == Qt::Key_Enter) + if(k == TQt::Key_Return || k == TQt::Key_Enter) { emit itemReturnPressed(m_currentItem, m_curRow, m_curCol); } @@ -1317,7 +1317,7 @@ void KexiTableView::keyPressEvent(QKeyEvent* e) int curRow = m_curRow; int curCol = m_curCol; - const bool nobtn = e->state()==NoButton; + const bool nobtn = e->state()==Qt::NoButton; bool printable = false; //check shared shortcuts @@ -1338,8 +1338,8 @@ void KexiTableView::keyPressEvent(QKeyEvent* e) } } -/* case Qt::Key_Delete: - if (e->state()==Qt::ControlButton) {//remove current row +/* case TQt::Key_Delete: + if (e->state()==TQt::ControlButton) {//remove current row deleteCurrentRow(); } else if (nobtn) {//remove contents of the current cell @@ -1348,18 +1348,18 @@ void KexiTableView::keyPressEvent(QKeyEvent* e) break;*/ // bool _return; - if (k == Qt::Key_Shift || k == Qt::Key_Alt || k == Qt::Key_Control || k == Qt::Key_Meta) { + if (k == TQt::Key_Shift || k == TQt::Key_Alt || k == TQt::Key_Control || k == TQt::Key_Meta) { e->ignore(); } else if (KexiDataAwareObjectInterface::handleKeyPress(e, curRow, curCol, d->appearance.fullRowSelection)) { if (e->isAccepted()) return; } - else if (k == Qt::Key_Backspace && nobtn) { + else if (k == TQt::Key_Backspace && nobtn) { if (!ro && columnType(curCol) != KexiDB::Field::Boolean && columnEditable(curCol)) - createEditor(curRow, curCol, QString::null, true); + createEditor(curRow, curCol, TQString(), true); } - else if (k == Qt::Key_Space) { + else if (k == TQt::Key_Space) { if (nobtn && !ro && columnEditable(curCol)) { if (columnType(curCol) == KexiDB::Field::Boolean) { boolToggled(); @@ -1368,7 +1368,7 @@ void KexiTableView::keyPressEvent(QKeyEvent* e) printable = true; //just space key } } - else if (k == Qt::Key_Escape) { + else if (k == TQt::Key_Escape) { if (nobtn && m_rowEditing) { cancelRowEdit(); return; @@ -1376,8 +1376,8 @@ void KexiTableView::keyPressEvent(QKeyEvent* e) } else { //others: - if (nobtn && (k==Qt::Key_Tab || k==Qt::Key_Right)) { -//! \todo add option for stopping at 1st column for Qt::Key_left + if (nobtn && (k==TQt::Key_Tab || k==TQt::Key_Right)) { +//! \todo add option for stopping at 1st column for TQt::Key_left //tab if (acceptEditor()) { if (curCol == (columns() - 1)) { @@ -1390,10 +1390,10 @@ void KexiTableView::keyPressEvent(QKeyEvent* e) curCol++; } } - else if ((e->state()==Qt::ShiftButton && k==Qt::Key_Tab) - || (nobtn && k==Qt::Key_Backtab) - || (e->state()==Qt::ShiftButton && k==Qt::Key_Backtab) - || (nobtn && k==Qt::Key_Left) + else if ((e->state()==TQt::ShiftButton && k==TQt::Key_Tab) + || (nobtn && k==TQt::Key_Backtab) + || (e->state()==TQt::ShiftButton && k==TQt::Key_Backtab) + || (nobtn && k==TQt::Key_Left) ) { //! \todo add option for stopping at last column //backward tab @@ -1408,7 +1408,7 @@ void KexiTableView::keyPressEvent(QKeyEvent* e) curCol--; } } - else if (nobtn && k==d->contextMenuKey) { //Qt::Key_Menu: + else if (nobtn && k==d->contextMenuKey) { //TQt::Key_Menu: showContextMenu(); } else { @@ -1418,16 +1418,16 @@ void KexiTableView::keyPressEvent(QKeyEvent* e) e->accept(); return; } - else if ( nobtn && (k==Qt::Key_Enter || k==Qt::Key_Return || shortCutPressed(e, "edit_edititem")) ) { + else if ( nobtn && (k==TQt::Key_Enter || k==TQt::Key_Return || shortCutPressed(e, "edit_edititem")) ) { //this condition is moved after handleKeyPress() to allow to everride enter key as well startEditOrToggleValue(); } else { kexidbg << "KexiTableView::KeyPressEvent(): default" << endl; if (e->text().isEmpty() || !e->text().isEmpty() && !e->text()[0].isPrint() ) { - kdDebug(44021) << "NOT PRINTABLE: 0x0" << QString("%1").arg(k,0,16) <<endl; + kdDebug(44021) << "NOT PRINTABLE: 0x0" << TQString("%1").tqarg(k,0,16) <<endl; // e->ignore(); - QScrollView::keyPressEvent(e); + TQScrollView::keyPressEvent(e); return; } printable = true; @@ -1437,7 +1437,7 @@ void KexiTableView::keyPressEvent(QKeyEvent* e) //finally: we've printable char: if (printable && !ro) { KexiTableViewColumn *tvcol = m_data->column(curCol); - if (tvcol->acceptsFirstChar(e->text()[0])) { + if (tvcol->acceptsFirstChar(TQString(e->text())[0])) { kdDebug(44021) << "KexiTableView::KeyPressEvent(): ev pressed: acceptsFirstChar()==true" << endl; // if (e->text()[0].isPrint()) createEditor(curRow, curCol, e->text(), true); @@ -1450,7 +1450,7 @@ void KexiTableView::keyPressEvent(QKeyEvent* e) m_vScrollBarValueChanged_enabled=false; - // if focus cell changes, repaint + // if focus cell changes, tqrepaint setCursorPosition(curRow, curCol); m_vScrollBarValueChanged_enabled=true; @@ -1495,9 +1495,9 @@ KexiDataItemInterface *KexiTableView::editor( int col, bool ignoreMissingEditor if (m_data->cursor() && m_data->cursor()->query()) editor->createInternalEditor(*m_data->cursor()->query()); - 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); @@ -1518,7 +1518,7 @@ void KexiTableView::editorShowFocus( int /*row*/, int col ) }*/ if (edit) { kexidbg<< "KexiTableView::editorShowFocus() : IN" << endl; - QRect rect = cellGeometry( m_curRow, m_curCol ); + TQRect rect = cellGeometry( m_curRow, m_curCol ); // rect.moveBy( -contentsX(), -contentsY() ); edit->showFocus( rect, isReadOnly() || m_data->column(col)->isReadOnly() ); } @@ -1534,7 +1534,7 @@ void KexiTableView::reloadData() { updateContents(); } -void KexiTableView::createEditor(int row, int col, const QString& addText, bool removeOld) +void KexiTableView::createEditor(int row, int col, const TQString& addText, bool removeOld) { kdDebug(44021) << "KexiTableView::createEditor('"<<addText<<"',"<<removeOld<<")"<<endl; if (isReadOnly()) { @@ -1569,7 +1569,7 @@ void KexiTableView::createEditor(int row, int col, const QString& addText, bool //refr. current and next row updateContents(columnPos(0), rowPos(row), viewport()->width(), d->rowHeight*2); // updateContents(columnPos(0), rowPos(row+1), viewport()->width(), d->rowHeight); -//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()); @@ -1598,13 +1598,13 @@ void KexiTableView::createEditor(int row, int col, const QString& addText, bool } } -void KexiTableView::focusInEvent(QFocusEvent* e) +void KexiTableView::focusInEvent(TQFocusEvent* e) { Q_UNUSED(e); updateCell(m_curRow, m_curCol); } -void KexiTableView::focusOutEvent(QFocusEvent* e) +void KexiTableView::focusOutEvent(TQFocusEvent* e) { KexiDataAwareObjectInterface::focusOutEvent(e); } @@ -1614,12 +1614,12 @@ bool KexiTableView::focusNextPrevChild(bool /*next*/) return false; //special Tab/BackTab meaning /* if (m_editor) return true; - return QScrollView::focusNextPrevChild(next);*/ + return TQScrollView::focusNextPrevChild(next);*/ } -void KexiTableView::resizeEvent(QResizeEvent *e) +void KexiTableView::resizeEvent(TQResizeEvent *e) { - QScrollView::resizeEvent(e); + TQScrollView::resizeEvent(e); //updateGeometries(); if (m_navPanel) @@ -1630,34 +1630,34 @@ void KexiTableView::resizeEvent(QResizeEvent *e) slotUpdate(); triggerUpdate(); } -// d->pTopHeader->repaint(); +// d->pTopHeader->tqrepaint(); /* m_navPanel->setGeometry( frameWidth(), viewport()->height() +d->pTopHeader->height() - -(horizontalScrollBar()->isVisible() ? 0 : horizontalScrollBar()->sizeHint().height()) + -(horizontalScrollBar()->isVisible() ? 0 : horizontalScrollBar()->tqsizeHint().height()) +frameWidth(), - m_navPanel->sizeHint().width(), // - verticalScrollBar()->sizeHint().width() - horizontalScrollBar()->sizeHint().width(), - horizontalScrollBar()->sizeHint().height() + m_navPanel->tqsizeHint().width(), // - verticalScrollBar()->tqsizeHint().width() - horizontalScrollBar()->tqsizeHint().width(), + horizontalScrollBar()->tqsizeHint().height() );*/ // updateContents(); // m_navPanel->setGeometry(1,horizontalScrollBar()->pos().y(), // m_navPanel->width(), horizontalScrollBar()->height()); // updateContents(0,0,2000,2000);//js -// erase(); repaint(); +// erase(); tqrepaint(); } -void KexiTableView::viewportResizeEvent( QResizeEvent *e ) +void KexiTableView::viewportResizeEvent( TQResizeEvent *e ) { - QScrollView::viewportResizeEvent( e ); + TQScrollView::viewportResizeEvent( e ); updateGeometries(); -// erase(); repaint(); +// erase(); tqrepaint(); } -void KexiTableView::showEvent(QShowEvent *e) +void KexiTableView::showEvent(TQShowEvent *e) { - QScrollView::showEvent(e); + TQScrollView::showEvent(e); if (!d->maximizeColumnsWidthOnShow.isEmpty()) { maximizeColumnsWidth(d->maximizeColumnsWidthOnShow); d->maximizeColumnsWidthOnShow.clear(); @@ -1670,29 +1670,29 @@ void KexiTableView::showEvent(QShowEvent *e) } else { //just update size - QSize s(tableSize()); -// QRect r(cellGeometry(rows() - 1 + (isInsertingEnabled()?1:0), columns() - 1 )); + TQSize s(tableSize()); +// TQRect r(cellGeometry(rows() - 1 + (isInsertingEnabled()?1:0), columns() - 1 )); // resizeContents(r.right() + 1, r.bottom() + 1); resizeContents(s.width(),s.height()); } updateGeometries(); //now we can ensure cell's visibility ( if there was such a call before show() ) - if (d->ensureCellVisibleOnShow!=QPoint(-1,-1)) { + if (d->ensureCellVisibleOnShow!=TQPoint(-1,-1)) { ensureCellVisible( d->ensureCellVisibleOnShow.x(), d->ensureCellVisibleOnShow.y() ); - d->ensureCellVisibleOnShow = QPoint(-1,-1); //reset the flag + d->ensureCellVisibleOnShow = TQPoint(-1,-1); //reset the flag } if (m_navPanel) m_navPanel->updateGeometry(leftMargin()); // updateNavPanelGeometry(); } -void KexiTableView::contentsDragMoveEvent(QDragMoveEvent *e) +void KexiTableView::contentsDragMoveEvent(TQDragMoveEvent *e) { if (!hasData()) return; if (m_dropsAtRowEnabled) { - QPoint p = e->pos(); + TQPoint p = e->pos(); int row = rowAt(p.y()); KexiTableItem *item = 0; // if (row==(rows()-1) && (p.y() % d->rowHeight) > (d->rowHeight*2/3) ) { @@ -1721,7 +1721,7 @@ void KexiTableView::contentsDragMoveEvent(QDragMoveEvent *e) } else e->acceptAction(false); -/* QStringList::ConstIterator it, end( d->dropFilters.constEnd() ); +/* TQStringList::ConstIterator it, end( d->dropFilters.constEnd() ); for( it = d->dropFilters.constBegin(); it != end; it++) { if(e->provides((*it).latin1())) @@ -1733,7 +1733,7 @@ void KexiTableView::contentsDragMoveEvent(QDragMoveEvent *e) // e->acceptAction(false); } -void KexiTableView::contentsDropEvent(QDropEvent *e) +void KexiTableView::contentsDropEvent(TQDropEvent *e) { if (!hasData()) return; @@ -1744,7 +1744,7 @@ void KexiTableView::contentsDropEvent(QDropEvent *e) m_dragIndicatorLine = -1; updateRow(row2update); } - QPoint p = e->pos(); + TQPoint p = e->pos(); int row = rowAt(p.y()); if ((p.y() % d->rowHeight) > (d->rowHeight*2/3) ) { row++; @@ -1761,7 +1761,7 @@ void KexiTableView::contentsDropEvent(QDropEvent *e) } } -void KexiTableView::viewportDragLeaveEvent( QDragLeaveEvent *e ) +void KexiTableView::viewportDragLeaveEvent( TQDragLeaveEvent *e ) { Q_UNUSED(e); if (!hasData()) @@ -1780,7 +1780,7 @@ void KexiTableView::updateCell(int row, int col) { // kdDebug(44021) << "updateCell("<<row<<", "<<col<<")"<<endl; updateContents(cellGeometry(row, col)); -/* QRect r = cellGeometry(row, col); +/* TQRect r = cellGeometry(row, col); r.setHeight(r.height()+6); r.setTop(r.top()-3); updateContents();*/ @@ -1799,30 +1799,30 @@ void KexiTableView::updateRow(int row) //int leftcol = d->pTopHeader->sectionAt( d->pTopHeader->offset() ); //kexidbg << contentsX() << " " << contentsY() << endl; - //kexidbg << QRect( columnPos( leftcol ), rowPos(row), clipper()->width(), rowHeight() ) << endl; - // updateContents( QRect( columnPos( leftcol ), rowPos(row), clipper()->width(), rowHeight() ) ); //columnPos(rightcol)+columnWidth(rightcol), rowHeight() ) ); - updateContents( QRect( contentsX(), rowPos(row), clipper()->width(), rowHeight() ) ); //columnPos(rightcol)+columnWidth(rightcol), rowHeight() ) ); + //kexidbg << TQRect( columnPos( leftcol ), rowPos(row), clipper()->width(), rowHeight() ) << endl; + // updateContents( TQRect( columnPos( leftcol ), rowPos(row), clipper()->width(), rowHeight() ) ); //columnPos(rightcol)+columnWidth(rightcol), rowHeight() ) ); + updateContents( TQRect( contentsX(), rowPos(row), clipper()->width(), rowHeight() ) ); //columnPos(rightcol)+columnWidth(rightcol), rowHeight() ) ); } void KexiTableView::slotColumnWidthChanged( int, int, int ) { - QSize s(tableSize()); + TQSize s(tableSize()); int w = contentsWidth(); viewport()->setUpdatesEnabled(false); resizeContents( s.width(), s.height() ); viewport()->setUpdatesEnabled(true); if (contentsWidth() < w) { updateContents(contentsX(), 0, viewport()->width(), contentsHeight()); -// repaintContents( s.width(), 0, w - s.width() + 1, contentsHeight(), true ); +// tqrepaintContents( s.width(), 0, w - s.width() + 1, contentsHeight(), true ); } else { // updateContents( columnPos(col), 0, contentsWidth(), contentsHeight() ); updateContents(contentsX(), 0, viewport()->width(), contentsHeight()); - // viewport()->repaint(); + // viewport()->tqrepaint(); } // updateContents(0, 0, d->pBufferPm->width(), d->pBufferPm->height()); - QWidget *editorWidget = dynamic_cast<QWidget*>(m_editor); + TQWidget *editorWidget = dynamic_cast<TQWidget*>(m_editor); if (editorWidget) { editorWidget->resize(columnWidth(m_curCol)-1, rowHeight()-1); @@ -1844,7 +1844,7 @@ void KexiTableView::slotSectionHandleDoubleClicked( int section ) void KexiTableView::updateGeometries() { - QSize ts = tableSize(); + TQSize ts = tableSize(); if (m_horizontalHeader->offset() && ts.width() < (m_horizontalHeader->offset() + m_horizontalHeader->width())) horizontalScrollBar()->setValue(ts.width() - m_horizontalHeader->width()); @@ -1871,7 +1871,7 @@ int KexiTableView::columnPos(int col) const if (!hasData()) return 0; //if this column is hidden, find first column before that is visible - int c = QMIN(col, (int)m_data->columnsCount()-1), vcID = 0; + int c = TQMIN(col, (int)m_data->columnsCount()-1), vcID = 0; while (c>=0 && (vcID=m_data->visibleColumnID( c ))==-1) c--; if (c<0) @@ -1912,67 +1912,67 @@ int KexiTableView::rowAt(int pos, bool ignoreEnd) const return pos; } -QRect KexiTableView::cellGeometry(int row, int col) const +TQRect KexiTableView::cellGeometry(int row, int col) const { - return QRect(columnPos(col), rowPos(row), + return TQRect(columnPos(col), rowPos(row), columnWidth(col), rowHeight()); } -QSize KexiTableView::tableSize() const +TQSize KexiTableView::tableSize() const { if ((rows()+ (isInsertingEnabled()?1:0) ) > 0 && columns() > 0) { /* kexidbg << "tableSize()= " << columnPos( columns() - 1 ) + columnWidth( columns() - 1 ) << ", " << rowPos( rows()-1+(isInsertingEnabled()?1:0)) + d->rowHeight -// + QMAX(m_navPanel ? m_navPanel->height() : 0, horizontalScrollBar()->sizeHint().height()) - + (m_navPanel->isVisible() ? QMAX( m_navPanel->height(), horizontalScrollBar()->sizeHint().height() ) :0 ) +// + TQMAX(m_navPanel ? m_navPanel->height() : 0, horizontalScrollBar()->tqsizeHint().height()) + + (m_navPanel->isVisible() ? TQMAX( m_navPanel->height(), horizontalScrollBar()->tqsizeHint().height() ) :0 ) + margin() << endl; */ // kexidbg<< m_navPanel->isVisible() <<" "<<m_navPanel->height()<<" " -// <<horizontalScrollBar()->sizeHint().height()<<" "<<rowPos( rows()-1+(isInsertingEnabled()?1:0))<<endl; +// <<horizontalScrollBar()->tqsizeHint().height()<<" "<<rowPos( rows()-1+(isInsertingEnabled()?1:0))<<endl; - //int xx = horizontalScrollBar()->sizeHint().height()/2; + //int xx = horizontalScrollBar()->tqsizeHint().height()/2; - QSize s( + TQSize s( columnPos( columns() - 1 ) + columnWidth( columns() - 1 ), -// + verticalScrollBar()->sizeHint().width(), +// + verticalScrollBar()->tqsizeHint().width(), rowPos( rows()-1+(isInsertingEnabled()?1:0) ) + d->rowHeight - + (horizontalScrollBar()->isVisible() ? 0 : horizontalScrollBar()->sizeHint().height()) + + (horizontalScrollBar()->isVisible() ? 0 : horizontalScrollBar()->tqsizeHint().height()) + d->internal_bottomMargin -// horizontalScrollBar()->sizeHint().height()/2 -// - /*d->bottomMargin */ horizontalScrollBar()->sizeHint().height()*3/2 +// horizontalScrollBar()->tqsizeHint().height()/2 +// - /*d->bottomMargin */ horizontalScrollBar()->tqsizeHint().height()*3/2 // + ( (m_navPanel && m_navPanel->isVisible() && verticalScrollBar()->isVisible() // && !horizontalScrollBar()->isVisible()) - // ? horizontalScrollBar()->sizeHint().height() : 0) + // ? horizontalScrollBar()->tqsizeHint().height() : 0) -// + QMAX( (m_navPanel && m_navPanel->isVisible()) ? m_navPanel->height() : 0, -// horizontalScrollBar()->isVisible() ? horizontalScrollBar()->sizeHint().height() : 0) +// + TQMAX( (m_navPanel && m_navPanel->isVisible()) ? m_navPanel->height() : 0, +// horizontalScrollBar()->isVisible() ? horizontalScrollBar()->tqsizeHint().height() : 0) // + (m_navPanel->isVisible() -// ? QMAX( m_navPanel->height(), horizontalScrollBar()->sizeHint().height() ) :0 ) +// ? TQMAX( m_navPanel->height(), horizontalScrollBar()->tqsizeHint().height() ) :0 ) -// - (horizontalScrollBar()->isVisible() ? horizontalScrollBar()->sizeHint().height() :0 ) +// - (horizontalScrollBar()->isVisible() ? horizontalScrollBar()->tqsizeHint().height() :0 ) + margin() //-2*d->rowHeight ); // kexidbg << rows()-1 <<" "<< (isInsertingEnabled()?1:0) <<" "<< (m_rowEditing?1:0) << " " << s << endl; return s; -// +horizontalScrollBar()->sizeHint().height() + margin() ); +// +horizontalScrollBar()->tqsizeHint().height() + margin() ); } - return QSize(0,0); + return TQSize(0,0); } void KexiTableView::ensureCellVisible(int row, int col/*=-1*/) { if (!isVisible()) { //the table is invisible: we can't ensure visibility now - d->ensureCellVisibleOnShow = QPoint(row,col); + d->ensureCellVisibleOnShow = TQPoint(row,col); return; } //quite clever: ensure the cell is visible: - QRect r( columnPos(col==-1 ? m_curCol : col), rowPos(row) +(d->appearance.fullRowSelection?1:0), + TQRect r( columnPos(col==-1 ? m_curCol : col), rowPos(row) +(d->appearance.fullRowSelection?1:0), columnWidth(col==-1 ? m_curCol : col), rowHeight()); /* if (m_navPanel && horizontalScrollBar()->isHidden() && row == rows()-1) { @@ -1988,7 +1988,7 @@ void KexiTableView::ensureCellVisible(int row, int col/*=-1*/) r.setBottom(r.bottom()+m_navPanel->height()); } - QPoint pcenter = r.center(); + TQPoint pcenter = r.center(); ensureVisible(pcenter.x(), pcenter.y(), r.width()/2, r.height()/2); // updateContents(); // updateNavPanelGeometry(); @@ -2007,13 +2007,13 @@ void KexiTableView::updateAfterAcceptRowEdit() m_navPanel->showEditingIndicator(false); } -bool KexiTableView::getVisibleLookupValue(QVariant& cellValue, KexiTableEdit *edit, +bool KexiTableView::getVisibleLookupValue(TQVariant& cellValue, KexiTableEdit *edit, KexiTableItem *item, KexiTableViewColumn *tvcol) const { if (edit->columnInfo() && edit->columnInfo()->indexForVisibleLookupValue()!=-1 && edit->columnInfo()->indexForVisibleLookupValue() < (int)item->count()) { - const QVariant *visibleFieldValue = 0; + const TQVariant *visibleFieldValue = 0; if (m_currentItem == item && m_data->rowEditBuffer()) { visibleFieldValue = m_data->rowEditBuffer()->at( *tvcol->visibleLookupColumnInfo, false/*!useDefaultValueIfPossible*/ ); @@ -2040,7 +2040,7 @@ void KexiTableView::removeEditor() void KexiTableView::slotRowRepaintRequested(KexiTableItem& item) { - updateRow( m_data->findRef(&item) ); + updateRow( m_data->tqfindRef(&item) ); } //(js) unused @@ -2081,15 +2081,15 @@ KexiTableView::print(KPrinter &/*printer*/) int bottomMargin = 0; kdDebug(44021) << "KexiTableView::print: bottom = " << bottomMargin << endl; - QPainter p(&printer); + TQPainter p(&printer); KexiTableItem *i; int width = leftMargin; for(int col=0; col < columns(); col++) { - p.fillRect(width, topMargin - d->rowHeight, columnWidth(col), d->rowHeight, QBrush(Qt::gray)); + p.fillRect(width, topMargin - d->rowHeight, columnWidth(col), d->rowHeight, TQBrush(TQt::gray)); p.drawRect(width, topMargin - d->rowHeight, columnWidth(col), d->rowHeight); - p.drawText(width, topMargin - d->rowHeight, columnWidth(col), d->rowHeight, Qt::AlignLeft | Qt::AlignVCenter, + p.drawText(width, topMargin - d->rowHeight, columnWidth(col), d->rowHeight, TQt::AlignLeft | TQt::AlignVCenter, m_horizontalHeader->label(col)); width = width + columnWidth(col); } @@ -2107,7 +2107,7 @@ KexiTableView::print(KPrinter &/*printer*/) kdDebug(44021) << "KexiTableView::print: col = " << col << " x = " << xOffset << endl; p.saveWorldMatrix(); p.translate(xOffset, yOffset); - paintCell(&p, i, col, QRect(0, 0, columnWidth(col) + 1, d->rowHeight), true); + paintCell(&p, i, col, TQRect(0, 0, columnWidth(col) + 1, d->rowHeight), true); p.restoreWorldMatrix(); // p.drawRect(xOffset, yOffset, columnWidth(col), d->rowHeight); xOffset = xOffset + columnWidth(col); @@ -2136,7 +2136,7 @@ KexiTableView::print(KPrinter &/*printer*/) } #endif -QString KexiTableView::columnCaption(int colNum) const +TQString KexiTableView::columnCaption(int colNum) const { return m_horizontalHeader->label(colNum); } @@ -2167,14 +2167,14 @@ void KexiTableView::adjustColumnWidthToContents(int colNum) if (indexOfVisibleColumn < 0) return; - QPtrListIterator<KexiTableItem> it = m_data->iterator(); + TQPtrListIterator<KexiTableItem> it = m_data->iterator(); if (it.current() && it.current()->count()<=(uint)indexOfVisibleColumn) return; KexiCellEditorFactoryItem *item = KexiCellEditorFactory::item( columnType(indexOfVisibleColumn) ); if (!item) return; - QFontMetrics fm(fontMetrics()); + TQFontMetrics fm(fontMetrics()); int maxw = horizontalHeaderVisible() ? fm.width( m_horizontalHeader->label( colNum/* not indexOfVisibleColumn*/ ) ) : 0; if (maxw == 0 && m_data->isEmpty()) @@ -2186,7 +2186,7 @@ void KexiTableView::adjustColumnWidthToContents(int colNum) if (ed) { for (it = m_data->iterator(); it.current(); ++it) { const int wfw = ed->widthForValue( it.current()->at( indexOfVisibleColumn ), fm ); - maxw = QMAX( maxw, wfw ); + maxw = TQMAX( maxw, wfw ); } const bool focused = currentColumn() == colNum; maxw += (fm.width(" ") + ed->leftMargin() + ed->rightMargin(focused)); @@ -2207,7 +2207,7 @@ void KexiTableView::setColumnWidth(int colNum, int width) slotTopHeaderSizeChange( colNum, oldWidth, m_horizontalHeader->sectionSize( colNum ) ); } -void KexiTableView::maximizeColumnsWidth( const QValueList<int> &columnList ) +void KexiTableView::maximizeColumnsWidth( const TQValueList<int> &columnList ) { if (!isVisible()) { d->maximizeColumnsWidthOnShow += columnList; @@ -2216,11 +2216,11 @@ void KexiTableView::maximizeColumnsWidth( const QValueList<int> &columnList ) if (width() <= m_horizontalHeader->headerWidth()) return; //sort the list and make it unique - QValueList<int> cl, sortedList = columnList; + TQValueList<int> cl, sortedList = columnList; qHeapSort(sortedList); int i=-999; - QValueList<int>::ConstIterator it, end( sortedList.constEnd() ); + TQValueList<int>::ConstIterator it, end( sortedList.constEnd() ); for ( it = sortedList.constBegin(); it != end; ++it) { if (i != (*it)) { cl += (*it); @@ -2271,13 +2271,13 @@ void KexiTableView::setVerticalHeaderVisible(bool set) int left_width; if (set) { m_verticalHeader->show(); - left_width = QMIN(m_horizontalHeader->sizeHint().height(), d->rowHeight); + left_width = TQMIN(m_horizontalHeader->tqsizeHint().height(), d->rowHeight); } else { m_verticalHeader->hide(); left_width = 0; } - setMargins( left_width, horizontalHeaderVisible() ? m_horizontalHeader->sizeHint().height() : 0, 0, 0); + setMargins( left_width, horizontalHeaderVisible() ? m_horizontalHeader->tqsizeHint().height() : 0, 0, 0); } bool KexiTableView::horizontalHeaderVisible() const @@ -2291,7 +2291,7 @@ void KexiTableView::setHorizontalHeaderVisible(bool set) d->horizontalHeaderVisible = set; //needed because isVisible() is not always accurate if (set) { m_horizontalHeader->show(); - top_height = m_horizontalHeader->sizeHint().height(); + top_height = m_horizontalHeader->tqsizeHint().height(); } else { m_horizontalHeader->hide(); @@ -2308,7 +2308,7 @@ void KexiTableView::triggerUpdate() // d->pUpdateTimer->start(200, true); } -void KexiTableView::setHBarGeometry( QScrollBar & hbar, int x, int y, int w, int h ) +void KexiTableView::setHBarGeometry( TQScrollBar & hbar, int x, int y, int w, int h ) { /*todo*/ kdDebug(44021)<<"KexiTableView::setHBarGeometry"<<endl; @@ -2329,7 +2329,7 @@ void KexiTableView::setSpreadSheetMode() setAppearance( a ); } -int KexiTableView::validRowNumber(const QString& text) +int KexiTableView::validRowNumber(const TQString& text) { bool ok=true; int r = text.toInt(&ok); @@ -2376,11 +2376,11 @@ void KexiTableView::copySelection() { if (m_currentItem && m_curCol!=-1) { KexiTableEdit *edit = tableEditorWidget( m_curCol ); - QVariant defaultValue; + TQVariant defaultValue; const bool defaultValueDisplayed = isDefaultValueDisplayed(m_currentItem, m_curCol, &defaultValue); if (edit) { - QVariant visibleValue; + TQVariant visibleValue; getVisibleLookupValue(visibleValue, edit, m_currentItem, m_data->column(m_curCol)); edit->handleCopyAction( defaultValueDisplayed ? defaultValue : m_currentItem->at( m_curCol ), @@ -2405,14 +2405,14 @@ void KexiTableView::paste() edit->handleAction("edit_paste"); } -bool KexiTableView::eventFilter( QObject *o, QEvent *e ) +bool KexiTableView::eventFilter( TQObject *o, TQEvent *e ) { //don't allow to stole key my events by others: // kexidbg << "spontaneous " << e->spontaneous() << " type=" << e->type() << endl; - if (e->type()==QEvent::KeyPress) { - if (e->spontaneous() /*|| e->type()==QEvent::AccelOverride*/) { - QKeyEvent *ke = static_cast<QKeyEvent*>(e); + if (e->type()==TQEvent::KeyPress) { + if (e->spontaneous() /*|| e->type()==TQEvent::AccelOverride*/) { + TQKeyEvent *ke = TQT_TQKEYEVENT(e); const int k = ke->key(); int s = ke->state(); //cell editor's events: @@ -2422,12 +2422,12 @@ bool KexiTableView::eventFilter( QObject *o, QEvent *e ) ke->accept(); return true; } - else if (m_editor && (o==dynamic_cast<QObject*>(m_editor) || o==m_editor->widget())) { - if ( (k==Qt::Key_Tab && (s==Qt::NoButton || s==Qt::ShiftButton)) + else if (m_editor && (o==dynamic_cast<TQT_BASE_OBJECT_NAME*>(m_editor) || TQT_BASE_OBJECT(o)==TQT_BASE_OBJECT(m_editor->widget()))) { + if ( (k==TQt::Key_Tab && (s==Qt::NoButton || s==TQt::ShiftButton)) || (overrideEditorShortcutNeeded(ke)) - || (k==Qt::Key_Enter || k==Qt::Key_Return || k==Qt::Key_Up || k==Qt::Key_Down) - || (k==Qt::Key_Left && m_editor->cursorAtStart()) - || (k==Qt::Key_Right && m_editor->cursorAtEnd()) + || (k==TQt::Key_Enter || k==TQt::Key_Return || k==TQt::Key_Up || k==TQt::Key_Down) + || (k==TQt::Key_Left && m_editor->cursorAtStart()) + || (k==TQt::Key_Right && m_editor->cursorAtEnd()) ) { //try to steal the key press from editor or it's internal widget... @@ -2437,12 +2437,12 @@ bool KexiTableView::eventFilter( QObject *o, QEvent *e ) } } /* - else if (e->type()==QEvent::KeyPress && (o==this || (m_editor && o==m_editor->widget()))){//|| o==viewport()) + else if (e->type()==TQEvent::KeyPress && (o==this || (m_editor && o==m_editor->widget()))){//|| o==viewport()) keyPressEvent(ke); if (ke->isAccepted()) return true; }*/ -/*todo else if ((k==Qt::Key_Tab || k==(Qt::SHIFT|Qt::Key_Tab)) && o==d->navRowNumber) { +/*todo else if ((k==TQt::Key_Tab || k==(TQt::SHIFT|TQt::Key_Tab)) && o==d->navRowNumber) { //tab key focuses tv ke->accept(); setFocus(); @@ -2450,14 +2450,14 @@ bool KexiTableView::eventFilter( QObject *o, QEvent *e ) }*/ } } - else if (o==horizontalScrollBar()) { - if ((e->type()==QEvent::Show && !horizontalScrollBar()->isVisible()) - || (e->type()==QEvent::Hide && horizontalScrollBar()->isVisible())) { + else if (TQT_BASE_OBJECT(o)==TQT_BASE_OBJECT(horizontalScrollBar())) { + if ((e->type()==TQEvent::Show && !horizontalScrollBar()->isVisible()) + || (e->type()==TQEvent::Hide && horizontalScrollBar()->isVisible())) { updateWidgetContentsSize(); } } - else if (e->type()==QEvent::Leave) { - if (o==viewport() && d->appearance.rowMouseOverHighlightingEnabled + else if (e->type()==TQEvent::Leave) { + if (TQT_BASE_OBJECT(o)==TQT_BASE_OBJECT(viewport()) && d->appearance.rowMouseOverHighlightingEnabled && d->appearance.persistentSelections) { if (d->highlightedRow!=-1) { @@ -2474,22 +2474,22 @@ bool KexiTableView::eventFilter( QObject *o, QEvent *e ) } } } - d->recentCellWithToolTip = QPoint(-1,-1); + d->recentCellWithToolTip = TQPoint(-1,-1); } -/* else if (e->type()==QEvent::FocusOut && o->inherits("QWidget")) { +/* else if (e->type()==TQEvent::FocusOut && o->inherits(TQWIDGET_OBJECT_NAME_STRING)) { //hp==true if currently focused widget is a child of this table view - const bool hp = KexiUtils::hasParent( static_cast<QWidget*>(o), focusWidget()); - if (!hp && KexiUtils::hasParent( this, static_cast<QWidget*>(o))) { + const bool hp = KexiUtils::hasParent( static_cast<TQWidget*>(o), tqfocusWidget()); + if (!hp && KexiUtils::hasParent( this, static_cast<TQWidget*>(o))) { //accept row editing if focus is moved to foreign widget - //(not a child, like eg. editor) from one of our table view's children + //(not a child, like eg. editor) from one of our table view's tqchildren //or from table view itself if (!acceptRowEdit()) { - static_cast<QWidget*>(o)->setFocus(); + static_cast<TQWidget*>(o)->setFocus(); return true; } } }*/ - return QScrollView::eventFilter(o,e); + return TQScrollView::eventFilter(o,e); } void KexiTableView::slotTopHeaderSizeChange( @@ -2503,14 +2503,14 @@ void KexiTableView::setBottomMarginInternal(int pixels) d->internal_bottomMargin = pixels; } -void KexiTableView::paletteChange( const QPalette &oldPalette ) +void KexiTableView::paletteChange( const TQPalette &oldPalette ) { Q_UNUSED(oldPalette); //update: if (m_verticalHeader) - m_verticalHeader->setSelectionBackgroundColor( palette().active().highlight() ); + m_verticalHeader->setSelectionBackgroundColor( tqpalette().active().highlight() ); if (m_horizontalHeader) - m_horizontalHeader->setSelectionBackgroundColor( palette().active().highlight() ); + m_horizontalHeader->setSelectionBackgroundColor( tqpalette().active().highlight() ); } const KexiTableView::Appearance& KexiTableView::appearance() const @@ -2531,8 +2531,8 @@ void KexiTableView::setAppearance(const Appearance& a) m_verticalHeader->setCellHeight(d->rowHeight); if (m_horizontalHeader) { setMargins( - QMIN(m_horizontalHeader->sizeHint().height(), d->rowHeight), - m_horizontalHeader->sizeHint().height(), 0, 0); + TQMIN(m_horizontalHeader->tqsizeHint().height(), d->rowHeight), + m_horizontalHeader->tqsizeHint().height(), 0, 0); } // } if (a.rowHighlightingEnabled) @@ -2561,8 +2561,8 @@ int KexiTableView::highlightedRow() const void KexiTableView::setHighlightedRow(int row) { if (row!=-1) { - row = QMIN(rows() - 1 + (isInsertingEnabled()?1:0), row); - row = QMAX(0, row); + row = TQMIN(rows() - 1 + (isInsertingEnabled()?1:0), row); + row = TQMAX(0, row); ensureCellVisible(row, -1); } const int previouslyHighlightedRow = d->highlightedRow; @@ -2581,7 +2581,7 @@ void KexiTableView::setHighlightedRow(int row) if (m_curRow>=0 && (previouslyHighlightedRow==-1 || previouslyHighlightedRow==m_curRow) && d->highlightedRow!=m_curRow && !d->appearance.persistentSelections) { - //currently selected row needs to be repainted + //currently selected row needs to be tqrepainted updateRow(m_curRow); } } diff --git a/kexi/widget/tableview/kexitableview.h b/kexi/widget/tableview/kexitableview.h index 9f9c632e..f06fce10 100644 --- a/kexi/widget/tableview/kexitableview.h +++ b/kexi/widget/tableview/kexitableview.h @@ -27,11 +27,11 @@ #ifndef KEXITABLEVIEW_H #define KEXITABLEVIEW_H -#include <qscrollview.h> -#include <qvariant.h> -#include <qptrlist.h> -#include <qheader.h> -#include <qtooltip.h> +#include <tqscrollview.h> +#include <tqvariant.h> +#include <tqptrlist.h> +#include <tqheader.h> +#include <tqtooltip.h> #include <kdebug.h> @@ -64,37 +64,38 @@ namespace KexiDB { /*! @see KexiFormScrollView */ class KEXIDATATABLE_EXPORT KexiTableView : - public QScrollView, + public TQScrollView, public KexiRecordNavigatorHandler, public KexiSharedActionClient, public KexiDataAwareObjectInterface { Q_OBJECT + TQ_OBJECT KEXI_DATAAWAREOBJECTINTERFACE public: /*! Defines table view's detailed appearance settings. */ class KEXIDATATABLE_EXPORT Appearance { public: - Appearance(QWidget *widget = 0); + Appearance(TQWidget *widget = 0); /*! base color for cells, default is "Base" color for application's current active palette */ - QColor baseColor; + TQColor baseColor; /*! text color for cells, default is "Text" color for application's current active palette */ - QColor textColor; + TQColor textColor; - /*! border color for cells, default is QColor(200,200,200) */ - QColor borderColor; + /*! border color for cells, default is TQColor(200,200,200) */ + TQColor borderColor; /*! empty area color, default is "Base" color for application's current active palette */ - QColor emptyAreaColor; + TQColor emptyAreaColor; /*! alternate background color, default is KGlobalSettings::alternateBackgroundColor() */ - QColor alternateBackgroundColor; + TQColor alternateBackgroundColor; /*! true if background altering should be enabled, true by default */ bool backgroundAltering : 1; @@ -129,26 +130,26 @@ public: /*! color for row highlight, default is intermediate (33%/60%) between active highlight and base color. */ - QColor rowHighlightingColor; + TQColor rowHighlightingColor; /*! color for text under row highlight, default is the same as textColor. Used when rowHighlightingEnabled is true; */ - QColor rowHighlightingTextColor; + TQColor rowHighlightingTextColor; /*! color for row highlight for mouseover, default is intermediate (20%/80%) between active highlight and base color. Used when rowMouseOverHighlightingEnabled is true. */ - QColor rowMouseOverHighlightingColor; + TQColor rowMouseOverHighlightingColor; /*! color for text under row highlight for mouseover, default is the same as textColor. Used when rowMouseOverHighlightingEnabled is true; */ - QColor rowMouseOverHighlightingTextColor; + TQColor rowMouseOverHighlightingTextColor; /*! Like rowMouseOverHighlightingColor but for areas painted with alternate color. This is computed using active highlight color and alternateBackgroundColor. */ - QColor rowMouseOverAlternateHighlightingColor; + TQColor rowMouseOverAlternateHighlightingColor; }; - KexiTableView(KexiTableViewData* data=0, QWidget* parent=0, const char* name=0); + KexiTableView(KexiTableViewData* data=0, TQWidget* tqparent=0, const char* name=0); virtual ~KexiTableView(); /*! \return current appearance settings */ @@ -158,7 +159,7 @@ public: void setAppearance(const Appearance& a); /*! \return string displayed for column's header \a colNum */ - QString columnCaption(int colNum) const; + TQString columnCaption(int colNum) const; /*! Convenience function. \return field object that define column \a colNum or NULL if there is no such column */ @@ -177,7 +178,7 @@ public: for current table view's size. */ virtual int rowsPerPage() const; - QRect cellGeometry(int row, int col) const; + TQRect cellGeometry(int row, int col) const; int columnWidth(int col) const; int rowHeight() const; int columnPos(int col) const; @@ -221,14 +222,14 @@ public: #endif // reimplemented for internal reasons - virtual QSizePolicy sizePolicy() const; - virtual QSize sizeHint() const; - virtual QSize minimumSizeHint() const; + virtual TQSizePolicy sizePolicy() const; + virtual TQSize tqsizeHint() const; + virtual TQSize tqminimumSizeHint() const; /*! Reimplemented to update cached fonts and row sizes for the painter. */ - void setFont(const QFont &f); + void setFont(const TQFont &f); - virtual QSize tableSize() const; + virtual TQSize tableSize() const; void emitSelected(); @@ -243,7 +244,7 @@ public: ScrollRight }; - virtual bool eventFilter( QObject *o, QEvent *e ); + virtual bool eventFilter( TQObject *o, TQEvent *e ); //! Initializes standard editor cell editor factories. This is called internally, once. static void initCellEditorFactories(); @@ -256,13 +257,13 @@ public: KexiTableItem *highlightedItem() const; /*! \return vertical scrollbar. Implemented for KexiDataAwareObjectInterface. */ - virtual QScrollBar* verticalScrollBar() const { return QScrollView::verticalScrollBar(); } + virtual TQScrollBar* verticalScrollBar() const { return TQScrollView::verticalScrollBar(); } public slots: virtual void setData( KexiTableViewData *data, bool owner = true ) { KexiDataAwareObjectInterface::setData( data, owner ); } - virtual void clearColumnsInternal(bool repaint); + virtual void clearColumnsInternal(bool tqrepaint); /*! Adjusts \a colNum column's width to its (current) contents. If \a colNum == -1, all columns' width is adjusted. */ @@ -274,18 +275,18 @@ public slots: /*! If \a set is true, \a colNum column is resized to take full possible width. If \a set is false, no automatic resize will be performed. If \a colNum is -1, all columns are equally resized, when needed, to take full possible width. - This method behaves like QHeader::setStretchEnabled ( bool b, int section ). */ + This method behaves like TQHeader::setStretchEnabled ( bool b, int section ). */ void setColumnStretchEnabled( bool set, int colNum ); /*! Maximizes widths of columns selected by \a columnList, so the horizontal header has maximum overall width. Each selected column's width will be increased by the same value. Does nothing if \a columnList is empty or there is no free space to resize columns. If this table view is not visible, resizing will be performed on showing. */ - void maximizeColumnsWidth( const QValueList<int> &columnList ); + void maximizeColumnsWidth( const TQValueList<int> &columnList ); /*! Adjusts the size of the sections to fit the size of the horizontal header as completely as possible. Only sections for which column stretch is enabled will be resized. - \sa setColumnStretchEnabled() QHeader::adjustHeaderSize() */ + \sa setColumnStretchEnabled() TQHeader::adjustHeaderSize() */ void adjustHorizontalHeaderSize(); /*! Sets highlighted row number or -1 if no row has to be highlighted. @@ -302,7 +303,7 @@ public slots: virtual void ensureCellVisible(int row, int col/*=-1*/); // void gotoNext(); -//js int findString(const QString &string); +//js int findString(const TQString &string); /*! Deletes currently selected record; does nothing if no record is currently selected. If record is in edit mode, editing @@ -325,7 +326,7 @@ public slots: was displayed (in this case, \a setText is usually not empty, what means that text will be set in the cell replacing previous value). */ - virtual void startEditCurrentCell(const QString& setText = QString::null) + virtual void startEditCurrentCell(const TQString& setText = TQString()) { KexiDataAwareObjectInterface::startEditCurrentCell(setText); } /*! Deletes currently selected cell's contents, if allowed. @@ -371,20 +372,20 @@ signals: void itemDblClicked(KexiTableItem *, int row, int col); void itemMouseReleased(KexiTableItem *, int row, int col); - void dragOverRow(KexiTableItem *item, int row, QDragMoveEvent* e); - void droppedAtRow(KexiTableItem *item, int row, QDropEvent *e, KexiTableItem*& newItem); + void dragOverRow(KexiTableItem *item, int row, TQDragMoveEvent* e); + void droppedAtRow(KexiTableItem *item, int row, TQDropEvent *e, KexiTableItem*& newItem); /*! Data has been refreshed on-screen - emitted from initDataContents(). */ virtual void dataRefreshed(); 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(); //! Emitted for spreadsheet mode when an item was deleted and a new item has been appended virtual void newItemAppendedForAfterDeletingInSpreadSheetMode(); // void addRecordRequest(); -// void contextMenuRequested(KexiTableItem *, int row, int col, const QPoint &); +// void contextMenuRequested(KexiTableItem *, int row, int col, const TQPoint &); void sortedColumnChanged(int col); //! emmited when row editing is started (for updating or inserting) @@ -403,7 +404,7 @@ protected slots: virtual void slotDataDestroying() { KexiDataAwareObjectInterface::slotDataDestroying(); } - virtual void slotRowsDeleted( const QValueList<int> & ); + virtual void slotRowsDeleted( const TQValueList<int> & ); //! updates display after many rows deletion void slotColumnWidthChanged( int col, int os, int ns ); @@ -431,19 +432,19 @@ protected slots: 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) - { KexiDataAwareObjectInterface::slotRowInserted(item, repaint); } + //! Handles KexiTableViewData::rowInserted() signal to tqrepaint when needed. + virtual void slotRowInserted(KexiTableItem *item, bool tqrepaint) + { KexiDataAwareObjectInterface::slotRowInserted(item, tqrepaint); } //! Like above, not db-aware version - virtual void slotRowInserted(KexiTableItem *item, uint row, bool repaint) - { KexiDataAwareObjectInterface::slotRowInserted(item, row, repaint); } + virtual void slotRowInserted(KexiTableItem *item, uint row, bool tqrepaint) + { KexiDataAwareObjectInterface::slotRowInserted(item, row, tqrepaint); } /*! Handles verticalScrollBar()'s valueChanged(int) signal. Called when vscrollbar's value has been changed. */ @@ -465,7 +466,7 @@ protected: virtual void initDataContents(); /*! Implementation for KexiDataAwareObjectInterface. - Updates widget's contents size using QScrollView::resizeContents() + Updates widget's contents size using TQScrollView::resizeContents() depending on tableSize(). */ virtual void updateWidgetContentsSize(); @@ -495,42 +496,42 @@ protected: /*! Implementation for KexiDataAwareObjectInterface. Adds another section within the horizontal header. */ - virtual void addHeaderColumn(const QString& caption, const QString& description, - const QIconSet& icon, int size); + virtual void addHeaderColumn(const TQString& caption, const TQString& description, + const TQIconSet& icon, int size); /*! @internal \return true if the row defined by \a item has default value at column \a col. If this is the case and \a value is not NULL, *value is set to the default value. */ - bool isDefaultValueDisplayed(KexiTableItem *item, int col, QVariant* value = 0); + bool isDefaultValueDisplayed(KexiTableItem *item, int col, TQVariant* value = 0); - //! painting and layout - void drawContents(QPainter *p, int cx, int cy, int cw, int ch); + //! painting and tqlayout + void drawContents(TQPainter *p, int cx, int cy, int cw, int ch); void createBuffer(int width, int height); - void paintCell(QPainter* p, KexiTableItem *item, int col, int row, const QRect &cr, bool print=false); - void paintEmptyArea(QPainter *p, int cx, int cy, int cw, int ch); + void paintCell(TQPainter* p, KexiTableItem *item, int col, int row, const TQRect &cr, bool print=false); + void paintEmptyArea(TQPainter *p, int cx, int cy, int cw, int ch); void updateGeometries(); - QPoint contentsToViewport2( const QPoint &p ); + TQPoint contentsToViewport2( const TQPoint &p ); void contentsToViewport2( int x, int y, int& vx, int& vy ); - QPoint viewportToContents2( const QPoint& vp ); + TQPoint viewportToContents2( const TQPoint& vp ); // event handling - virtual void contentsMousePressEvent(QMouseEvent* e); - virtual void contentsMouseReleaseEvent(QMouseEvent* e); + virtual void contentsMousePressEvent(TQMouseEvent* e); + virtual void contentsMouseReleaseEvent(TQMouseEvent* e); //! @internal called by contentsMouseOrEvent() contentsMouseReleaseEvent() to move cursor - bool handleContentsMousePressOrRelease(QMouseEvent* e, bool release); - virtual void contentsMouseMoveEvent(QMouseEvent* e); - virtual void contentsMouseDoubleClickEvent(QMouseEvent* e); - virtual void keyPressEvent(QKeyEvent* e); - virtual void focusInEvent(QFocusEvent* e); - virtual void focusOutEvent(QFocusEvent* e); - virtual void resizeEvent(QResizeEvent* e); - virtual void viewportResizeEvent(QResizeEvent *e); - virtual void showEvent(QShowEvent *e); - virtual void contentsDragMoveEvent(QDragMoveEvent *e); - virtual void contentsDropEvent(QDropEvent *e); - virtual void viewportDragLeaveEvent(QDragLeaveEvent *e); - virtual void paletteChange( const QPalette &oldPalette ); + bool handleContentsMousePressOrRelease(TQMouseEvent* e, bool release); + virtual void contentsMouseMoveEvent(TQMouseEvent* e); + virtual void contentsMouseDoubleClickEvent(TQMouseEvent* e); + virtual void keyPressEvent(TQKeyEvent* e); + virtual void focusInEvent(TQFocusEvent* e); + virtual void focusOutEvent(TQFocusEvent* e); + virtual void resizeEvent(TQResizeEvent* e); + virtual void viewportResizeEvent(TQResizeEvent *e); + virtual void showEvent(TQShowEvent *e); + virtual void contentsDragMoveEvent(TQDragMoveEvent *e); + virtual void contentsDropEvent(TQDropEvent *e); + virtual void viewportDragLeaveEvent(TQDragLeaveEvent *e); + virtual void paletteChange( const TQPalette &oldPalette ); /*! Implementation for KexiDataAwareObjectInterface */ virtual KexiDataItemInterface *editor( int col, bool ignoreMissingEditor = false ); @@ -542,7 +543,7 @@ protected: virtual void editorShowFocus( int row, int col ); //! Creates editors and shows it, what usually means the beginning of a cell editing - 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); bool focusNextPrevChild(bool next); @@ -552,7 +553,7 @@ protected: given action's shortcut - false is returned (beause action is already performed at main window's level). */ - bool shortCutPressed( QKeyEvent *e, const QCString &action_name ); + bool shortCutPressed( TQKeyEvent *e, const TQCString &action_name ); #if 0 //we have now KexiActionProxy /*! Updates visibility/accesibility of popup menu items, @@ -564,30 +565,30 @@ protected: if menu is configured, else: contextMenuRequested() signal is emmited. Method used in contentsMousePressEvent() (for right button) - and keyPressEvent() for Qt::Key_Menu key. - If \a pos is QPoint(-1,-1) (the default), menu is positioned below the current cell. + and keyPressEvent() for TQt::Key_Menu key. + If \a pos is TQPoint(-1,-1) (the default), menu is positioned below the current cell. */ - void showContextMenu( const QPoint& pos = QPoint(-1,-1) ); + void showContextMenu( const TQPoint& pos = TQPoint(-1,-1) ); /*! internal */ inline void paintRow(KexiTableItem *item, - QPainter *pb, int r, int rowp, int cx, int cy, + TQPainter *pb, int r, int rowp, int cx, int cy, int colfirst, int collast, int maxwc); - virtual void setHBarGeometry( QScrollBar & hbar, int x, int y, int w, int h ); + virtual void setHBarGeometry( TQScrollBar & hbar, int x, int y, int w, int h ); //! Setups navigator widget void setupNavigator(); //! internal, to determine valid row number when navigator text changed - int validRowNumber(const QString& text); + int validRowNumber(const TQString& text); /*! Reimplementation for KexiDataAwareObjectInterface (viewport()->setFocus() is just added) */ virtual void removeEditor(); //! Internal: updated sched fonts for painting. - void updateFonts(bool repaint = false); + void updateFonts(bool tqrepaint = false); /*! @internal Changes bottom margin settings, in pixels. At this time, it's used by KexiComboBoxPopup to decrease margin for popup's table. */ @@ -613,7 +614,7 @@ protected: virtual void paste(); /*! Used in KexiDataAwareObjectInterface::slotRowDeleted() - to repaint tow \a row and all visible below. */ + to tqrepaint tow \a row and all visible below. */ virtual void updateAllVisibleRowsBelow(int row); void updateAfterCancelRowEdit(); @@ -622,11 +623,11 @@ protected: /*! Sets \a cellValue if there is a lookup value for the cell \a item. Used in KexiTableView::paintCell() and KexiTableViewCellToolTip::maybeTip() \return true is \a cellValue has been found. */ - bool getVisibleLookupValue(QVariant& cellValue, KexiTableEdit *edit, + bool getVisibleLookupValue(TQVariant& cellValue, KexiTableEdit *edit, KexiTableItem *item, KexiTableViewColumn *tvcol) const; -// //! Called to repaint contents after a row is deleted. -// void repaintAfterDelete(); +// //! Called to tqrepaint contents after a row is deleted. +// void tqrepaintAfterDelete(); KexiTableViewPrivate *d; diff --git a/kexi/widget/tableview/kexitableview_p.cpp b/kexi/widget/tableview/kexitableview_p.cpp index 7cf774db..d5e1641a 100644 --- a/kexi/widget/tableview/kexitableview_p.cpp +++ b/kexi/widget/tableview/kexitableview_p.cpp @@ -27,7 +27,7 @@ #include "kexitableview_p.h" #include "kexitableedit.h" -#include <qlabel.h> +#include <tqlabel.h> #include <kglobalsettings.h> @@ -47,12 +47,12 @@ KexiTableViewPrivate::KexiTableViewPrivate(KexiTableView* t) //moved scrollbarToolTipsEnabled = true; //moved scrollBarTipTimerCnt = 0; //moved scrollBarTip = 0; - ensureCellVisibleOnShow = QPoint(-1,-1); - internal_bottomMargin = tv->horizontalScrollBar()->sizeHint().height()/2; + ensureCellVisibleOnShow = TQPoint(-1,-1); + internal_bottomMargin = tv->horizontalScrollBar()->tqsizeHint().height()/2; highlightedRow = -1; moveCursorOnMouseRelease = false; horizontalHeaderVisible = true; - recentCellWithToolTip = QPoint(-1,-1); + recentCellWithToolTip = TQPoint(-1,-1); } KexiTableViewPrivate::~KexiTableViewPrivate() diff --git a/kexi/widget/tableview/kexitableview_p.h b/kexi/widget/tableview/kexitableview_p.h index 58fe8574..b0679dfa 100644 --- a/kexi/widget/tableview/kexitableview_p.h +++ b/kexi/widget/tableview/kexitableview_p.h @@ -32,10 +32,10 @@ #include <kexidb/roweditbuffer.h> #include <widget/utils/kexidisplayutils.h> -#include <qevent.h> -#include <qtimer.h> -#include <qvalidator.h> -#include <qasciidict.h> +#include <tqevent.h> +#include <tqtimer.h> +#include <tqvalidator.h> +#include <tqasciidict.h> #include <kpushbutton.h> #include <ktoolbarbutton.h> @@ -46,18 +46,18 @@ class KexiTableItem; class KexiTableRM; class KexiTableEdit; -class QLabel; +class TQLabel; class KexiTableViewHeader; //! @short a dynamic tooltip for table view cells /*! @internal */ -class KexiTableViewCellToolTip : public QToolTip +class KexiTableViewCellToolTip : public TQToolTip { public: KexiTableViewCellToolTip( KexiTableView * tableView ); virtual ~KexiTableViewCellToolTip(); protected: - virtual void maybeTip( const QPoint & p ); + virtual void maybeTip( const TQPoint & p ); KexiTableView *m_tableView; }; @@ -76,17 +76,17 @@ class KexiTableViewPrivate KexiTableView *tv; //! editors: one for each column (indexed by KexiTableViewColumn) - QPtrDict<KexiTableEdit> editors; + TQPtrDict<KexiTableEdit> editors; int rowHeight; - QPixmap *pBufferPm; - QTimer *pUpdateTimer; + TQPixmap *pBufferPm; + TQTimer *pUpdateTimer; int menu_id_addRecord; int menu_id_removeRecord; #if 0//(js) doesn't work! - QTimer *scrollTimer; + TQTimer *scrollTimer; #endif KexiTableView::ScrollDirection scrollDirection; @@ -119,7 +119,7 @@ class KexiTableViewPrivate KexiTableView::Appearance appearance; //! brushes, fonts - QBrush diagonalGrayPattern; + TQBrush diagonalGrayPattern; //! Parameters for displaying autonumbers KexiDisplayUtils::DisplayParameters autonumberSignDisplayParameters; @@ -128,11 +128,11 @@ class KexiTableViewPrivate KexiDisplayUtils::DisplayParameters defaultValueDisplayParameters; //! Used by delayed mode of maximizeColumnsWidth() - QValueList<int> maximizeColumnsWidthOnShow; + TQValueList<int> maximizeColumnsWidthOnShow; /*! Used for delayed call of ensureCellVisible() after show(). It's equal to (-1,-1) if ensureCellVisible() shouldn't e called. */ - QPoint ensureCellVisibleOnShow; + TQPoint ensureCellVisibleOnShow; /*! @internal Changes bottom margin settings, in pixels. At this time, it's used by KexiComboBoxPopup to decrease margin for popup's table. */ @@ -145,8 +145,8 @@ class KexiTableViewPrivate int contextMenuKey; /*! Specifies currently displayed cell tooltip. - Value of QPoint(-1,-1) means "no tooltip". */ - QPoint recentCellWithToolTip; + Value of TQPoint(-1,-1) means "no tooltip". */ + TQPoint recentCellWithToolTip; /*! Table cell tooltip */ KexiTableViewCellToolTip *cellToolTip; diff --git a/kexi/widget/tableview/kexitableviewdata.cpp b/kexi/widget/tableview/kexitableviewdata.cpp index 62259db3..1fb65c6a 100644 --- a/kexi/widget/tableview/kexitableviewdata.cpp +++ b/kexi/widget/tableview/kexitableviewdata.cpp @@ -36,7 +36,7 @@ #include <kdebug.h> #include <klocale.h> -#include <qapplication.h> +#include <tqapplication.h> unsigned short KexiTableViewData::charTable[]= { @@ -54,12 +54,12 @@ KexiTableViewColumn::KexiTableViewColumn(KexiDB::Field& f, bool owner) init(); } -KexiTableViewColumn::KexiTableViewColumn(const QString& name, KexiDB::Field::Type ctype, +KexiTableViewColumn::KexiTableViewColumn(const TQString& name, KexiDB::Field::Type ctype, uint cconst, uint options, uint length, uint precision, - QVariant defaultValue, - const QString& caption, const QString& description, uint width + TQVariant defaultValue, + const TQString& caption, const TQString& description, uint width ) : columnInfo(0) , visibleLookupColumnInfo(0) @@ -78,8 +78,8 @@ KexiTableViewColumn::KexiTableViewColumn(const QString& name, KexiDB::Field::Typ init(); } -KexiTableViewColumn::KexiTableViewColumn(const QString& name, KexiDB::Field::Type ctype, - const QString& caption, const QString& description) +KexiTableViewColumn::KexiTableViewColumn(const TQString& name, KexiDB::Field::Type ctype, + const TQString& caption, const TQString& description) : columnInfo(0) , visibleLookupColumnInfo(0) { @@ -88,7 +88,7 @@ KexiTableViewColumn::KexiTableViewColumn(const QString& name, KexiDB::Field::Typ KexiDB::Field::NoConstraints, KexiDB::Field::NoOptions, 0, 0, - QVariant(), + TQVariant(), caption, description); isDBAware = false; @@ -122,7 +122,7 @@ KexiTableViewColumn::KexiTableViewColumn( } init(); //setup column's readonly flag: true, if - // - it's not from parent table's field, or + // - it's not from tqparent table's field, or // - if the query itself is coming from read-only connection, or // - if the query itself is stored (i.e. has connection) and lookup column is defined const bool columnFromMasterTable = query.masterTable()==columnInfo->field->table(); @@ -168,7 +168,7 @@ void KexiTableViewColumn::init() void KexiTableViewColumn::setValidator( KexiUtils::Validator* v ) { if (m_validator) {//remove old one - if (!m_validator->parent()) //destroy if has no parent + if (!m_validator->tqparent()) //destroy if has no tqparent delete m_validator; } m_validator = v; @@ -205,7 +205,7 @@ bool KexiTableViewColumn::isReadOnly() const return m_readOnly || (m_data && m_data->isReadOnly()); } -bool KexiTableViewColumn::acceptsFirstChar(const QChar& ch) const +bool KexiTableViewColumn::acceptsFirstChar(const TQChar& ch) const { // the field we're looking at can be related to "visible lookup column" // if lookup column is present @@ -216,7 +216,7 @@ bool KexiTableViewColumn::acceptsFirstChar(const QChar& ch) const return visibleField->isFPNumericType(); if (ch=='-') return !visibleField->isUnsigned(); - if (ch=='+' || (ch>='0' && ch<='9')) + if (ch=='+' || ((int)ch>='0' && (int)ch<='9')) return true; return false; } @@ -227,7 +227,7 @@ bool KexiTableViewColumn::acceptsFirstChar(const QChar& ch) const case KexiDB::Field::Date: case KexiDB::Field::DateTime: case KexiDB::Field::Time: - return ch>='0' && ch<='9'; + return (int)ch>='0' && (int)ch<='9'; default:; } return true; @@ -237,7 +237,7 @@ bool KexiTableViewColumn::acceptsFirstChar(const QChar& ch) const //------------------------------------------------------ KexiTableViewData::KexiTableViewData() - : QObject() + : TQObject() , KexiTableViewDataBase() { init(); @@ -245,7 +245,7 @@ KexiTableViewData::KexiTableViewData() // db-aware ctor KexiTableViewData::KexiTableViewData(KexiDB::Cursor *c) - : QObject() + : TQObject() , KexiTableViewDataBase() { init(); @@ -282,9 +282,9 @@ KexiTableViewData::KexiTableViewData(KexiDB::Cursor *c) } KexiTableViewData::KexiTableViewData( - const QValueList<QVariant> &keys, const QValueList<QVariant> &values, + const TQValueList<TQVariant> &keys, const TQValueList<TQVariant> &values, KexiDB::Field::Type keyType, KexiDB::Field::Type valueType) - : QObject() + : TQObject() , KexiTableViewDataBase() { init(keys, values, keyType, valueType); @@ -293,7 +293,7 @@ KexiTableViewData::KexiTableViewData( KexiTableViewData::KexiTableViewData( KexiDB::Field::Type keyType, KexiDB::Field::Type valueType) { - const QValueList<QVariant> empty; + const TQValueList<TQVariant> empty; init(empty, empty, keyType, valueType); } @@ -304,7 +304,7 @@ KexiTableViewData::~KexiTableViewData() } void KexiTableViewData::init( - const QValueList<QVariant> &keys, const QValueList<QVariant> &values, + const TQValueList<TQVariant> &keys, const TQValueList<TQVariant> &values, KexiDB::Field::Type keyType, KexiDB::Field::Type valueType) { init(); @@ -318,9 +318,9 @@ void KexiTableViewData::init( KexiTableViewColumn *valueColumn = new KexiTableViewColumn(*valueField, true); addColumn(valueColumn); - uint cnt = QMIN(keys.count(), values.count()); - QValueList<QVariant>::ConstIterator it_keys = keys.constBegin(); - QValueList<QVariant>::ConstIterator it_values = values.constBegin(); + uint cnt = TQMIN(keys.count(), values.count()); + TQValueList<TQVariant>::ConstIterator it_keys = keys.constBegin(); + TQValueList<TQVariant>::ConstIterator it_values = values.constBegin(); for (;cnt>0;++it_keys, ++it_values, cnt--) { KexiTableItem *item = new KexiTableItem(2); (*item)[0] = (*it_keys); @@ -355,14 +355,14 @@ void KexiTableViewData::init() void KexiTableViewData::deleteLater() { m_cursor = 0; - QObject::deleteLater(); + TQObject::deleteLater(); } void KexiTableViewData::addColumn( KexiTableViewColumn* col ) { // if (!col->isDBAware) { // if (!m_simpleColumnsByName) -// m_simpleColumnsByName = new QDict<KexiTableViewColumn>(101); +// m_simpleColumnsByName = new TQDict<KexiTableViewColumn>(101); // m_simpleColumnsByName->insert(col->caption,col);//for faster lookup // } columns.append( col ); @@ -386,11 +386,11 @@ void KexiTableViewData::addColumn( KexiTableViewColumn* col ) m_itemSize = columns.count()+(m_containsROWIDInfo?1:0); } -QString KexiTableViewData::dbTableName() const +TQString KexiTableViewData::dbTableName() const { if (m_cursor && m_cursor->query() && m_cursor->query()->masterTable()) return m_cursor->query()->masterTable()->name(); - return QString::null; + return TQString(); } void KexiTableViewData::setSorting(int column, bool ascending) @@ -506,11 +506,11 @@ int KexiTableViewData::cmpTime(Item item1, Item item2) int KexiTableViewData::cmpStr(Item item1, Item item2) { CMP_NULLS(item1, item2); - const QString &as = m_leftTmp.toString(); - const QString &bs = m_rightTmp.toString(); + const TQString &as = m_leftTmp.toString(); + const TQString &bs = m_rightTmp.toString(); - const QChar *a = as.unicode(); - const QChar *b = bs.unicode(); + const TQChar *a = as.tqunicode(); + const TQChar *b = bs.tqunicode(); if ( a == b ) return 0; @@ -522,18 +522,18 @@ int KexiTableViewData::cmpStr(Item item1, Item item2) unsigned short au; unsigned short bu; - int l=QMIN(as.length(),bs.length()); + int l=TQMIN(as.length(),bs.length()); - au = a->unicode(); - bu = b->unicode(); + au = a->tqunicode(); + bu = b->tqunicode(); au = (au <= 0x17e ? charTable[au] : 0xffff); bu = (bu <= 0x17e ? charTable[bu] : 0xffff); while (l-- && au == bu) { a++,b++; - au = a->unicode(); - bu = b->unicode(); + au = a->tqunicode(); + bu = b->tqunicode(); au = (au <= 0x17e ? charTable[au] : 0xffff); bu = (bu <= 0x17e ? charTable[bu] : 0xffff); } @@ -578,8 +578,8 @@ void KexiTableViewData::clearRowEditBuffer() } bool KexiTableViewData::updateRowEditBufferRef(KexiTableItem *item, - int colnum, KexiTableViewColumn* col, QVariant& newval, bool allowSignals, - QVariant *visibleValueForLookupField) + int colnum, KexiTableViewColumn* col, TQVariant& newval, bool allowSignals, + TQVariant *visibleValueForLookupField) { m_result.clear(); if (allowSignals) @@ -615,7 +615,7 @@ bool KexiTableViewData::updateRowEditBufferRef(KexiTableItem *item, return false; } //not db-aware: - const QString colname = col->field()->name(); + const TQString colname = col->field()->name(); if (colname.isEmpty()) { kdDebug() << "KexiTableViewData::updateRowEditBufferRef(): column #" << colnum<<" not found!" << endl; return false; @@ -635,7 +635,7 @@ bool KexiTableViewData::updateRowEditBufferRef(KexiTableItem *item, } //! @todo if there're multiple views for this data, we need multiple buffers! -bool KexiTableViewData::saveRow(KexiTableItem& item, bool insert, bool repaint) +bool KexiTableViewData::saveRow(KexiTableItem& item, bool insert, bool tqrepaint) { if (!m_pRowEditBuffer) return true; //nothing to do @@ -645,7 +645,7 @@ bool KexiTableViewData::saveRow(KexiTableItem& item, bool insert, bool repaint) KexiTableViewColumn::ListIterator it_f(columns); KexiDB::RowData::ConstIterator it_r = item.constBegin(); int col = 0; - const QVariant *val; + const TQVariant *val; for (;it_f.current() && it_r!=item.constEnd();++it_f,++it_r,col++) { KexiDB::Field *f = it_f.current()->field(); val = 0; @@ -655,7 +655,7 @@ bool KexiTableViewData::saveRow(KexiTableItem& item, bool insert, bool repaint) if (val->isNull() && !f->isAutoIncrement()) { //NOT NULL violated m_result.msg = i18n("\"%1\" column requires a value to be entered.") - .arg(f->captionOrName()) + "\n\n" + Kexi::msgYouCanImproveData(); + .tqarg(f->captionOrName()) + "\n\n" + Kexi::msgYouCanImproveData(); m_result.desc = i18n("The column's constraint is declared as NOT NULL."); m_result.column = col; return false; @@ -666,7 +666,7 @@ bool KexiTableViewData::saveRow(KexiTableItem& item, bool insert, bool repaint) if (!f->isAutoIncrement() && (val->isNull() || KexiDB::isEmptyValue( f, *val ))) { //NOT EMPTY violated m_result.msg = i18n("\"%1\" column requires a value to be entered.") - .arg(f->captionOrName()) + "\n\n" + Kexi::msgYouCanImproveData(); + .tqarg(f->captionOrName()) + "\n\n" + Kexi::msgYouCanImproveData(); m_result.desc = i18n("The column's constraint is declared as NOT EMPTY."); m_result.column = col; return false; @@ -685,7 +685,7 @@ bool KexiTableViewData::saveRow(KexiTableItem& item, bool insert, bool repaint) /* if (desc) *desc = -js: TODO: use KexiMainWindowImpl::showErrorMessage(const QString &title, KexiDB::Object *obj) +js: TODO: use KexiMainWindowImpl::showErrorMessage(const TQString &title, KexiDB::Object *obj) after it will be moved somewhere to kexidb (this will require moving other showErrorMessage() methods from KexiMainWindowImpl to libkexiutils....) then: just call: *desc = KexiDB::errorMessage(m_cursor); @@ -721,12 +721,12 @@ js: TODO: use KexiMainWindowImpl::showErrorMessage(const QString &title, KexiDB: m_pRowEditBuffer->clear(); - if (repaint) + if (tqrepaint) emit rowRepaintRequested(item); return true; } -bool KexiTableViewData::saveRowChanges(KexiTableItem& item, bool repaint) +bool KexiTableViewData::saveRowChanges(KexiTableItem& item, bool tqrepaint) { kdDebug() << "KexiTableViewData::saveRowChanges()..." << endl; m_result.clear(); @@ -734,32 +734,32 @@ bool KexiTableViewData::saveRowChanges(KexiTableItem& item, bool repaint) if (!m_result.success) return false; - if (saveRow(item, false /*update*/, repaint)) { + if (saveRow(item, false /*update*/, tqrepaint)) { emit rowUpdated(&item); return true; } return false; } -bool KexiTableViewData::saveNewRow(KexiTableItem& item, bool repaint) +bool KexiTableViewData::saveNewRow(KexiTableItem& item, bool tqrepaint) { kdDebug() << "KexiTableViewData::saveNewRow()..." << endl; m_result.clear(); - emit aboutToInsertRow(&item, &m_result, repaint); + emit aboutToInsertRow(&item, &m_result, tqrepaint); if (!m_result.success) return false; - if (saveRow(item, true /*insert*/, repaint)) { - emit rowInserted(&item, repaint); + if (saveRow(item, true /*insert*/, tqrepaint)) { + emit rowInserted(&item, tqrepaint); return true; } return false; } -bool KexiTableViewData::deleteRow(KexiTableItem& item, bool repaint) +bool KexiTableViewData::deleteRow(KexiTableItem& item, bool tqrepaint) { m_result.clear(); - emit aboutToDeleteRow(item, &m_result, repaint); + emit aboutToDeleteRow(item, &m_result, tqrepaint); if (!m_result.success) return false; @@ -784,15 +784,15 @@ bool KexiTableViewData::deleteRow(KexiTableItem& item, bool repaint) return true; } -void KexiTableViewData::deleteRows( const QValueList<int> &rowsToDelete, bool repaint ) +void KexiTableViewData::deleteRows( const TQValueList<int> &rowsToDelete, bool tqrepaint ) { - Q_UNUSED( repaint ); + Q_UNUSED( tqrepaint ); if (rowsToDelete.isEmpty()) return; int last_r=0; first(); - for (QValueList<int>::ConstIterator r_it = rowsToDelete.constBegin(); r_it!=rowsToDelete.constEnd(); ++r_it) { + for (TQValueList<int>::ConstIterator r_it = rowsToDelete.constBegin(); r_it!=rowsToDelete.constEnd(); ++r_it) { for (; last_r<(*r_it); last_r++) { next(); } @@ -804,17 +804,17 @@ void KexiTableViewData::deleteRows( const QValueList<int> &rowsToDelete, bool re emit rowsDeleted( rowsToDelete ); } -void KexiTableViewData::insertRow(KexiTableItem& item, uint index, bool repaint) +void KexiTableViewData::insertRow(KexiTableItem& item, uint index, bool tqrepaint) { - if (!insert( index = QMIN(index, count()), &item )) + if (!insert( index = TQMIN(index, count()), &item )) return; - emit rowInserted(&item, index, repaint); + emit rowInserted(&item, index, tqrepaint); } void KexiTableViewData::clearInternal() { clearRowEditBuffer(); -// qApp->processEvents( 1 ); +// tqApp->processEvents( 1 ); //TODO: this is time consuming: find better data model // KexiTableViewDataBase::clear(); const uint c = count(); @@ -822,12 +822,12 @@ void KexiTableViewData::clearInternal() removeLast(); #ifndef KEXI_NO_PROCESS_EVENTS if (i % 1000 == 0) - qApp->processEvents( 1 ); + tqApp->tqprocessEvents( 1 ); #endif } } -bool KexiTableViewData::deleteAllRows(bool repaint) +bool KexiTableViewData::deleteAllRows(bool tqrepaint) { clearInternal(); @@ -837,7 +837,7 @@ bool KexiTableViewData::deleteAllRows(bool repaint) res = m_cursor->deleteAllRows(); } - if (repaint) + if (tqrepaint) emit reloadRequested(); return res; } @@ -873,7 +873,7 @@ void KexiTableViewData::preloadAllRows() m_cursor->moveNext(); #ifndef KEXI_NO_PROCESS_EVENTS if ((i % 1000) == 0) - qApp->processEvents( 1 ); + tqApp->tqprocessEvents( 1 ); #endif } } diff --git a/kexi/widget/tableview/kexitableviewdata.h b/kexi/widget/tableview/kexitableviewdata.h index 970d1d23..56241fcb 100644 --- a/kexi/widget/tableview/kexitableviewdata.h +++ b/kexi/widget/tableview/kexitableviewdata.h @@ -25,11 +25,11 @@ #ifndef KEXITABLEVIEWDATA_H #define KEXITABLEVIEWDATA_H -#include <qptrlist.h> -#include <qvariant.h> -#include <qvaluevector.h> -#include <qstring.h> -#include <qobject.h> +#include <tqptrlist.h> +#include <tqvariant.h> +#include <tqvaluevector.h> +#include <tqstring.h> +#include <tqobject.h> #include "kexitableitem.h" @@ -51,8 +51,8 @@ class KexiTableViewData; /*! Single column definition. */ class KEXIDATATABLE_EXPORT KexiTableViewColumn { public: - typedef QPtrList<KexiTableViewColumn> List; - typedef QPtrListIterator<KexiTableViewColumn> ListIterator; + typedef TQPtrList<KexiTableViewColumn> List; + typedef TQPtrListIterator<KexiTableViewColumn> ListIterator; /*! Not db-aware ctor. if \a owner is true, the field \a will be owned by this column, so you shouldn't care about destroying this field. */ @@ -62,18 +62,18 @@ class KEXIDATATABLE_EXPORT KexiTableViewColumn { equal to these accepted by KexiDB::Field ctor. The column will be the owner of this automatically generated field. */ - KexiTableViewColumn(const QString& name, KexiDB::Field::Type ctype, + KexiTableViewColumn(const TQString& name, KexiDB::Field::Type ctype, uint cconst = KexiDB::Field::NoConstraints, uint options = KexiDB::Field::NoOptions, uint length=0, uint precision=0, - QVariant defaultValue=QVariant(), - const QString& caption = QString::null, - const QString& description = QString::null, + TQVariant defaultValue=TQVariant(), + const TQString& caption = TQString(), + const TQString& description = TQString(), uint width = 0); /*! Not db-aware, convenience ctor, simplified version of the above. */ - KexiTableViewColumn(const QString& name, KexiDB::Field::Type ctype, const QString& caption, - const QString& description = QString::null); + KexiTableViewColumn(const TQString& name, KexiDB::Field::Type ctype, const TQString& caption, + const TQString& description = TQString()); //! Db-aware version. KexiTableViewColumn(const KexiDB::QuerySchema &query, KexiDB::QueryColumnInfo& aColumnInfo, @@ -81,11 +81,11 @@ class KEXIDATATABLE_EXPORT KexiTableViewColumn { virtual ~KexiTableViewColumn(); - virtual bool acceptsFirstChar(const QChar& ch) const; + virtual bool acceptsFirstChar(const TQChar& ch) const; /*! \return true if the column is read-only For db-aware column this can depend on whether the column - is in parent table of this query. \sa setReadOnly() */ + is in tqparent table of this query. \sa setReadOnly() */ bool isReadOnly() const; //TODO: synchronize this with table view: @@ -103,10 +103,10 @@ class KEXIDATATABLE_EXPORT KexiTableViewColumn { } /*! Sets icon for displaying in the caption area (header). */ - void setIcon(const QIconSet& icon) { m_icon = icon; } + void setIcon(const TQIconSet& icon) { m_icon = icon; } /*! \return bame of icon displayed in the caption area (header). */ - QIconSet icon() const { return m_icon; } + TQIconSet icon() const { return m_icon; } /*! If \a visible is true, caption has to be displayed in the column's header, (or field's name if caption is empty. True by default. */ @@ -120,10 +120,10 @@ class KEXIDATATABLE_EXPORT KexiTableViewColumn { - field's caption - or field's alias (from query) - or finally - field's name */ - inline QString captionAliasOrName() const { return m_captionAliasOrName; } + inline TQString captionAliasOrName() const { return m_captionAliasOrName; } /*! Assigns validator \a v for this column. - If the validator has no parent object, it will be owned by the column, + If the validator has no tqparent object, it will be owned by the column, so you shouldn't care about destroying it. */ void setValidator( KexiUtils::Validator* v ); @@ -150,7 +150,7 @@ class KEXIDATATABLE_EXPORT KexiTableViewColumn { /*! Only usable if related data is set (ie. this is for combo boxes). Sets 'editable' flag for this column, what means a new value can be entered - by hand. This is similar to QComboBox::setEditable(). */ + by hand. This is similar to TQComboBox::setEditable(). */ void setRelatedDataEditable(bool set); /*! Only usable if related data is set (ie. this is for combo boxes). @@ -171,14 +171,14 @@ class KEXIDATATABLE_EXPORT KexiTableViewColumn { bool isDBAware : 1; //!< true if data is stored in DB, not only in memeory -/* QString caption; +/* TQString caption; int type; //!< one of KexiDB::Field::Type uint width; */ // bool isNull() const; -/* virtual QString caption() const; - virtual void setCaption(const QString& c); +/* virtual TQString caption() const; + virtual void setCaption(const TQString& c); */ protected: //! special ctor that do not allocate d member; @@ -186,9 +186,9 @@ class KEXIDATATABLE_EXPORT KexiTableViewColumn { void init(); - QString m_captionAliasOrName; + TQString m_captionAliasOrName; - QIconSet m_icon; + TQIconSet m_icon; KexiUtils::Validator* m_validator; @@ -211,20 +211,21 @@ class KEXIDATATABLE_EXPORT KexiTableViewColumn { /*! List of column definitions. */ -//typedef QValueVector<KexiTableViewColumn> KexiTableViewColumnList; +//typedef TQValueVector<KexiTableViewColumn> KexiTableViewColumnList; -typedef QPtrList<KexiTableItem> KexiTableViewDataBase; +typedef TQPtrList<KexiTableItem> KexiTableViewDataBase; -/*! Reimplements QPtrList to allow configurable sorting and more. +/*! Reimplements TQPtrList to allow configurable sorting and more. Original author: Till Busch. Reimplemented by Jaroslaw Staniek. */ -class KEXIDATATABLE_EXPORT KexiTableViewData : public QObject, protected KexiTableViewDataBase +class KEXIDATATABLE_EXPORT KexiTableViewData : public TQObject, protected KexiTableViewDataBase { Q_OBJECT + TQ_OBJECT public: - typedef QPtrListIterator<KexiTableItem> Iterator; + typedef TQPtrListIterator<KexiTableItem> Iterator; //! not db-aware version KexiTableViewData(); @@ -242,7 +243,7 @@ public: @param valueType a type for values */ KexiTableViewData( - const QValueList<QVariant> &keys, const QValueList<QVariant> &values, + const TQValueList<TQVariant> &keys, const TQValueList<TQVariant> &values, KexiDB::Field::Type keyType = KexiDB::Field::Text, KexiDB::Field::Type valueType = KexiDB::Field::Text); @@ -284,8 +285,8 @@ public: inline bool isDBAware() { return m_cursor; } /*! For db-aware data set only: table name is returned; - equivalent to cursor()->query()->parentTable()->name(). */ - QString dbTableName() const; + equivalent to cursor()->query()->tqparentTable()->name(). */ + TQString dbTableName() const; inline KexiDB::Cursor* cursor() const { return m_cursor; } @@ -333,21 +334,21 @@ public: Note that \a newval may be changed in aboutToChangeCell() signal handler. \sa KexiDB::RowEditBuffer */ bool updateRowEditBufferRef(KexiTableItem *item, - int colnum, KexiTableViewColumn* col, QVariant& newval, bool allowSignals = true, - QVariant *visibleValueForLookupField = 0); + int colnum, KexiTableViewColumn* col, TQVariant& newval, bool allowSignals = true, + TQVariant *visibleValueForLookupField = 0); /*! Added for convenience. Like above but \a newval is passed by value. */ inline bool updateRowEditBuffer(KexiTableItem *item, int colnum, KexiTableViewColumn* col, - QVariant newval, bool allowSignals = true) + TQVariant newval, bool allowSignals = true) { - QVariant newv(newval); + TQVariant newv(newval); return updateRowEditBufferRef(item, colnum, col, newv, allowSignals); } /*! Added for convenience. Like above but it's assumed that \a item item's columns are ordered like in table view, not like in form view. Don't use this with form views. */ inline bool updateRowEditBuffer(KexiTableItem *item, int colnum, - QVariant newval, bool allowSignals = true) + TQVariant newval, bool allowSignals = true) { KexiTableViewColumn* col = columns.at(colnum); return col ? updateRowEditBufferRef(item, colnum, col, newval, allowSignals) : false; @@ -358,27 +359,27 @@ public: /*! \return last operation's result information (always not null). */ inline KexiDB::ResultInfo* result() { return &m_result; } - bool saveRowChanges(KexiTableItem& item, bool repaint = false); + bool saveRowChanges(KexiTableItem& item, bool tqrepaint = false); - bool saveNewRow(KexiTableItem& item, bool repaint = false); + bool saveNewRow(KexiTableItem& item, bool tqrepaint = false); - bool deleteRow(KexiTableItem& item, bool repaint = false); + bool deleteRow(KexiTableItem& item, bool tqrepaint = false); /*! Deletes rows (by number) passed with \a rowsToDelete. Currently, this method is only for non data-aware tables. */ - void deleteRows( const QValueList<int> &rowsToDelete, bool repaint = false ); + void deleteRows( const TQValueList<int> &rowsToDelete, bool tqrepaint = false ); /*! Deletes all rows. Works either for db-aware and non db-aware tables. Column's definition is not changed. For db-aware version, all rows are removed from a database. Row-edit buffer is cleared. - If \a repaint is true, reloadRequested() signal + If \a tqrepaint is true, reloadRequested() signal is emitted after deleting (if at least one row was deleted), - so presenters can repaint their contents. + so presenters can tqrepaint their contents. \return true on success. */ - virtual bool deleteAllRows(bool repaint = false); + virtual bool deleteAllRows(bool tqrepaint = false); /*! @internal method, used mostly by specialized classes like KexiTableView. Clears internal row structures. Row-edit buffer is cleared. @@ -389,7 +390,7 @@ public: /*! Inserts new \a item at index \a index. \a item will be owned by this data object. Note: Reasonable only for not not-db-aware version. */ - void insertRow(KexiTableItem& item, uint index, bool repaint = false); + void insertRow(KexiTableItem& item, uint index, bool tqrepaint = false); /*TODO: add this as well? void insertRow(KexiTableItem& item, KexiTableItem& aboveItem); */ @@ -407,7 +408,7 @@ public: inline bool isEmpty () const { return KexiTableViewDataBase::isEmpty(); } inline KexiTableItem* first() { return KexiTableViewDataBase::first(); } inline KexiTableItem* last() { return KexiTableViewDataBase::last(); } - inline int findRef( const KexiTableItem* item ) { return KexiTableViewDataBase::findRef(item); } + inline int tqfindRef( const KexiTableItem* item ) { return KexiTableViewDataBase::tqfindRef(item); } inline void sort() { KexiTableViewDataBase::sort(); } inline bool removeFirst() { return KexiTableViewDataBase::removeFirst(); } inline bool removeLast() { return KexiTableViewDataBase::removeLast(); } @@ -428,7 +429,7 @@ public: { return new KexiTableItem(m_itemSize); } public slots: - //! @internal The same as QObject::deleteLater() but also sets smart pointer m_cursor to 0 to avoid crashes... + //! @internal The same as TQObject::deleteLater() but also sets smart pointer m_cursor to 0 to avoid crashes... void deleteLater(); signals: @@ -438,13 +439,13 @@ signals: Connect this signal to your slot and set \a result->success to false to disallow this change. You can also change \a newValue to other value, or change other columns in \a item row. */ - void aboutToChangeCell(KexiTableItem *item, int colnum, QVariant& newValue, + void aboutToChangeCell(KexiTableItem *item, int colnum, TQVariant& newValue, KexiDB::ResultInfo* result); /*! Emited before inserting of a new, current row. Connect this signal to your slot and set \a result->success to false to disallow this inserting. You can also change columns in \a item row. */ - void aboutToInsertRow(KexiTableItem *item, KexiDB::ResultInfo* result, bool repaint); + void aboutToInsertRow(KexiTableItem *item, KexiDB::ResultInfo* result, bool tqrepaint); /*! Emited before changing of an edited, current row. Connect this signal to your slot and set \a result->success to false @@ -454,21 +455,21 @@ signals: void rowUpdated(KexiTableItem*); //!< Current row has been updated - void rowInserted(KexiTableItem*, bool repaint); //!< A row has been inserted + void rowInserted(KexiTableItem*, bool tqrepaint); //!< A row has been inserted //! A row has been inserted at \a index position (not db-aware data only) - void rowInserted(KexiTableItem*, uint index, bool repaint); + void rowInserted(KexiTableItem*, uint index, bool tqrepaint); /*! Emited before deleting of a current row. Connect this signal to your slot and set \a result->success to false to disallow this deleting. */ - void aboutToDeleteRow(KexiTableItem& item, KexiDB::ResultInfo* result, bool repaint); + void aboutToDeleteRow(KexiTableItem& item, KexiDB::ResultInfo* result, bool tqrepaint); //! Current row has been deleted void rowDeleted(); //! Rows have been deleted - void rowsDeleted( const QValueList<int> &rowsToDelete ); + void rowsDeleted( const TQValueList<int> &rowsToDelete ); //! Displayed data needs to be reloaded in all presenters. void reloadRequested(); @@ -478,7 +479,7 @@ signals: protected: void init(); void init( - const QValueList<QVariant> &keys, const QValueList<QVariant> &values, + const TQValueList<TQVariant> &keys, const TQValueList<TQVariant> &values, KexiDB::Field::Type keyType, KexiDB::Field::Type valueType); virtual int compareItems(Item item1, Item item2); @@ -492,11 +493,11 @@ protected: int cmpDateTime(Item item1, Item item2); int cmpTime(Item item1, Item item2); - //! Compare function for BLOB data (QByteArray). Uses size as the weight. + //! Compare function for BLOB data (TQByteArray). Uses size as the weight. int cmpBLOB(Item item1, Item item2); //! internal: for saveRowChanges() and saveNewRow() - bool saveRow(KexiTableItem& item, bool insert, bool repaint); + bool saveRow(KexiTableItem& item, bool insert, bool tqrepaint); //! (logical) sorted column number, set by setSorting() //! can differ from m_realSortedColumn if there's lookup column used @@ -508,15 +509,15 @@ protected: int m_itemSize; static unsigned short charTable[]; KexiDB::RowEditBuffer *m_pRowEditBuffer; - QGuardedPtr<KexiDB::Cursor> m_cursor; + TQGuardedPtr<KexiDB::Cursor> m_cursor; //! used to faster lookup columns of simple type (not dbaware) -// QDict<KexiTableViewColumn> *m_simpleColumnsByName; +// TQDict<KexiTableViewColumn> *m_simpleColumnsByName; KexiDB::ResultInfo m_result; uint m_visibleColumnsCount; - QValueVector<int> m_visibleColumnsIDs, m_globalColumnsIDs; + TQValueVector<int> m_visibleColumnsIDs, m_globalColumnsIDs; bool m_readOnly : 1; bool m_insertingEnabled : 1; @@ -534,7 +535,7 @@ protected: //! Temporary, used in compare functions like cmpInt(), cmpString() //! to avoid memory allocations. - QVariant m_leftTmp, m_rightTmp; + TQVariant m_leftTmp, m_rightTmp; }; #endif diff --git a/kexi/widget/tableview/kexitableviewheader.cpp b/kexi/widget/tableview/kexitableviewheader.cpp index 3656a041..05212dd1 100644 --- a/kexi/widget/tableview/kexitableviewheader.cpp +++ b/kexi/widget/tableview/kexitableviewheader.cpp @@ -19,9 +19,9 @@ #include "kexitableviewheader.h" -#include <qapplication.h> -#include <qtooltip.h> -#include <qstyle.h> +#include <tqapplication.h> +#include <tqtooltip.h> +#include <tqstyle.h> #include <kexiutils/utils.h> #include <kexiutils/styleproxy.h> @@ -31,105 +31,105 @@ class KexiTableViewHeaderStyle : public KexiUtils::StyleProxy { public: - KexiTableViewHeaderStyle(QStyle *parentStyle, QWidget *widget) - : KexiUtils::StyleProxy(parentStyle) + KexiTableViewHeaderStyle(TQStyle *tqparentStyle, TQWidget *widget) + : KexiUtils::StyleProxy(tqparentStyle) { - setBackgroundColor( widget->palette().active().background() ); + setBackgroundColor( widget->tqpalette().active().background() ); } ~KexiTableViewHeaderStyle() {} - virtual void drawPrimitive( PrimitiveElement pe, - QPainter *p, const QRect &r, const QColorGroup &cg, SFlags flags = Style_Default, - const QStyleOption& option = QStyleOption::Default ) const + virtual void tqdrawPrimitive( TQ_PrimitiveElement pe, + TQPainter *p, const TQRect &r, const TQColorGroup &cg, SFlags flags = Style_Default, + const TQStyleOption& option = TQStyleOption::Default ) const { - if (pe==QStyle::PE_HeaderSection) { - QColorGroup newCg(cg); - newCg.setColor(QColorGroup::Button, m_backgroundColor); - newCg.setColor(QColorGroup::Background, m_backgroundColor); //set background color as well (e.g. for thinkeramik) - m_style->drawPrimitive( pe, p, r, newCg, flags, option ); + if (pe==TQStyle::PE_HeaderSection) { + TQColorGroup newCg(cg); + newCg.setColor(TQColorGroup::Button, m_backgroundColor); + newCg.setColor(TQColorGroup::Background, m_backgroundColor); //set background color as well (e.g. for thinkeramik) + m_style->tqdrawPrimitive( pe, p, r, newCg, flags, option ); return; } - m_style->drawPrimitive( pe, p, r, cg, flags, option ); + m_style->tqdrawPrimitive( pe, p, r, cg, flags, option ); } - void setBackgroundColor( const QColor& color ) { m_backgroundColor = color; } + void setBackgroundColor( const TQColor& color ) { m_backgroundColor = color; } protected: - QColor m_backgroundColor; + TQColor m_backgroundColor; }; -KexiTableViewHeader::KexiTableViewHeader(QWidget * parent, const char * name) - : QHeader(parent, name) +KexiTableViewHeader::KexiTableViewHeader(TQWidget * tqparent, const char * name) + : TQHeader(tqparent, name) , m_lastToolTipSection(-1) - , m_selectionBackgroundColor(qApp->palette().active().highlight()) + , m_selectionBackgroundColor(tqApp->tqpalette().active().highlight()) , m_selectedSection(-1) , m_styleChangeEnabled(true) { - styleChange( style() ); + styleChange( tqstyle() ); installEventFilter(this); - connect(this, SIGNAL(sizeChange(int,int,int)), - this, SLOT(slotSizeChange(int,int,int))); + connect(this, TQT_SIGNAL(sizeChange(int,int,int)), + this, TQT_SLOT(slotSizeChange(int,int,int))); } KexiTableViewHeader::~KexiTableViewHeader() { } -void KexiTableViewHeader::styleChange( QStyle& oldStyle ) +void KexiTableViewHeader::styleChange( TQStyle& oldStyle ) { - QHeader::styleChange( oldStyle ); + TQHeader::styleChange( oldStyle ); if (!m_styleChangeEnabled) return; m_styleChangeEnabled = false; - setStyle( new KexiTableViewHeaderStyle(&qApp->style(), this) ); + setStyle( new KexiTableViewHeaderStyle(&tqApp->tqstyle(), this) ); m_styleChangeEnabled = true; } -int KexiTableViewHeader::addLabel ( const QString & s, int size ) +int KexiTableViewHeader::addLabel ( const TQString & s, int size ) { m_toolTips += ""; slotSizeChange(0,0,0);//refresh - return QHeader::addLabel(s, size); + return TQHeader::addLabel(s, size); } -int KexiTableViewHeader::addLabel ( const QIconSet & iconset, const QString & s, int size ) +int KexiTableViewHeader::addLabel ( const TQIconSet & iconset, const TQString & s, int size ) { m_toolTips += ""; slotSizeChange(0,0,0);//refresh - return QHeader::addLabel(iconset, s, size); + return TQHeader::addLabel(iconset, s, size); } void KexiTableViewHeader::removeLabel( int section ) { if (section < 0 || section >= count()) return; - QStringList::Iterator it = m_toolTips.begin(); + TQStringList::Iterator it = m_toolTips.begin(); it += section; m_toolTips.remove(it); slotSizeChange(0,0,0);//refresh - QHeader::removeLabel(section); + TQHeader::removeLabel(section); } -void KexiTableViewHeader::setToolTip( int section, const QString & toolTip ) +void KexiTableViewHeader::setToolTip( int section, const TQString & toolTip ) { if (section < 0 || section >= (int)m_toolTips.count()) return; m_toolTips[ section ] = toolTip; } -bool KexiTableViewHeader::eventFilter(QObject * watched, QEvent * e) +bool KexiTableViewHeader::eventFilter(TQObject * watched, TQEvent * e) { - if (e->type()==QEvent::MouseMove) { - const int section = sectionAt( static_cast<QMouseEvent*>(e)->x() ); + if (e->type()==TQEvent::MouseMove) { + const int section = sectionAt( TQT_TQMOUSEEVENT(e)->x() ); if (section != m_lastToolTipSection && section >= 0 && section < (int)m_toolTips.count()) { - QToolTip::remove(this, m_toolTipRect); - QString tip = m_toolTips[ section ]; + TQToolTip::remove(this, m_toolTipRect); + TQString tip = m_toolTips[ section ]; if (tip.isEmpty()) { //try label - QFontMetrics fm(font()); - int minWidth = fm.width( label( section ) ) + style().pixelMetric( QStyle::PM_HeaderMargin ); - QIconSet *iset = iconSet( section ); + TQFontMetrics fm(font()); + int minWidth = fm.width( label( section ) ) + tqstyle().tqpixelMetric( TQStyle::PM_HeaderMargin ); + TQIconSet *iset = iconSet( section ); if (iset) - minWidth += (2+iset->pixmap( QIconSet::Small, QIconSet::Normal ).width()); //taken from QHeader::sectionSizeHint() + minWidth += (2+iset->pixmap( TQIconSet::Small, TQIconSet::Normal ).width()); //taken from TQHeader::sectionSizeHint() if (minWidth > sectionSize( section )) tip = label( section ); } @@ -137,30 +137,30 @@ bool KexiTableViewHeader::eventFilter(QObject * watched, QEvent * e) m_lastToolTipSection = -1; } else { - QToolTip::add(this, m_toolTipRect = sectionRect(section), tip); + TQToolTip::add(this, m_toolTipRect = sectionRect(section), tip); m_lastToolTipSection = section; } } } -// if (e->type()==QEvent::MouseButtonPress) { +// if (e->type()==TQEvent::MouseButtonPress) { // todo // } - return QHeader::eventFilter(watched, e); + return TQHeader::eventFilter(watched, e); } void KexiTableViewHeader::slotSizeChange(int /*section*/, int /*oldSize*/, int /*newSize*/ ) { if (m_lastToolTipSection>0) - QToolTip::remove(this, m_toolTipRect); + TQToolTip::remove(this, m_toolTipRect); m_lastToolTipSection = -1; //tooltip's rect is now invalid } -void KexiTableViewHeader::setSelectionBackgroundColor(const QColor &color) +void KexiTableViewHeader::setSelectionBackgroundColor(const TQColor &color) { m_selectionBackgroundColor = color; } -QColor KexiTableViewHeader::selectionBackgroundColor() const +TQColor KexiTableViewHeader::selectionBackgroundColor() const { return m_selectionBackgroundColor; } @@ -182,20 +182,20 @@ int KexiTableViewHeader::selectedSection() const return m_selectedSection; } -void KexiTableViewHeader::paintSection( QPainter * p, int index, const QRect & fr ) +void KexiTableViewHeader::paintSection( TQPainter * p, int index, const TQRect & fr ) { const bool paintSelection = index==m_selectedSection && index != -1; if (paintSelection) { - static_cast<KexiTableViewHeaderStyle&>(style()).setBackgroundColor( + static_cast<KexiTableViewHeaderStyle&>(tqstyle()).setBackgroundColor( KexiUtils::blendedColors( - palette().active().background(), m_selectionBackgroundColor, 2, 1) ); + tqpalette().active().background(), m_selectionBackgroundColor, 2, 1) ); } - QHeader::paintSection( p, index, fr ); + TQHeader::paintSection( p, index, fr ); if (paintSelection) { //revert the color for subsequent paints - static_cast<KexiTableViewHeaderStyle&>(style()).setBackgroundColor( - palette().active().background()); + static_cast<KexiTableViewHeaderStyle&>(tqstyle()).setBackgroundColor( + tqpalette().active().background()); } } diff --git a/kexi/widget/tableview/kexitableviewheader.h b/kexi/widget/tableview/kexitableviewheader.h index 5da3fa7b..efc35055 100644 --- a/kexi/widget/tableview/kexitableviewheader.h +++ b/kexi/widget/tableview/kexitableviewheader.h @@ -20,9 +20,9 @@ #ifndef KEXITABLEVIEWHEADER_H #define KEXITABLEVIEWHEADER_H -#include <qheader.h> +#include <tqheader.h> -class QStyle; +class TQStyle; //! @short A table view header with additional actions. /*! Displays field description (Field::description()) text as tool tip, if available. @@ -30,44 +30,45 @@ class QStyle; \todo react on indexChange ( int section, int fromIndex, int toIndex ) signal */ -class KEXIDATATABLE_EXPORT KexiTableViewHeader : public QHeader +class KEXIDATATABLE_EXPORT KexiTableViewHeader : public TQHeader { Q_OBJECT + TQ_OBJECT public: - KexiTableViewHeader(QWidget * parent = 0, const char * name = 0); + KexiTableViewHeader(TQWidget * tqparent = 0, const char * name = 0); virtual ~KexiTableViewHeader(); - int addLabel( const QString & s, int size = -1 ); + int addLabel( const TQString & s, int size = -1 ); - int addLabel( const QIconSet & iconset, const QString & s, int size = -1 ); + int addLabel( const TQIconSet & iconset, const TQString & s, int size = -1 ); void removeLabel( int section ); /*! Sets \a toolTip for \a section. */ - void setToolTip( int section, const QString & toolTip ); + void setToolTip( int section, const TQString & toolTip ); - virtual bool eventFilter(QObject * watched, QEvent * e); + virtual bool eventFilter(TQObject * watched, TQEvent * e); void setSelectedSection(int section); int selectedSection() const; - QColor selectionBackgroundColor() const; - void setSelectionBackgroundColor(const QColor &color); + TQColor selectionBackgroundColor() const; + void setSelectionBackgroundColor(const TQColor &color); protected slots: void slotSizeChange(int section, int oldSize, int newSize ); protected: - virtual void paintSection ( QPainter * p, int index, const QRect & fr ); - virtual void styleChange( QStyle& oldStyle ); + virtual void paintSection ( TQPainter * p, int index, const TQRect & fr ); + virtual void styleChange( TQStyle& oldStyle ); int m_lastToolTipSection; - QRect m_toolTipRect; + TQRect m_toolTipRect; - QStringList m_toolTips; - QColor m_selectionBackgroundColor; + TQStringList m_toolTips; + TQColor m_selectionBackgroundColor; int m_selectedSection; bool m_styleChangeEnabled : 1; }; diff --git a/kexi/widget/tableview/kexitextformatter.cpp b/kexi/widget/tableview/kexitextformatter.cpp index f4e0b89d..b7388138 100644 --- a/kexi/widget/tableview/kexitextformatter.cpp +++ b/kexi/widget/tableview/kexitextformatter.cpp @@ -71,7 +71,7 @@ void KexiTextFormatter::setField( KexiDB::Field* field ) } } -QString KexiTextFormatter::valueToText(const QVariant& value, const QString& add) const +TQString KexiTextFormatter::valueToText(const TQVariant& value, const TQString& add) const { //cases, in order of expected frequency if (!d->field || d->field->isTextType()) @@ -86,16 +86,16 @@ QString KexiTextFormatter::valueToText(const QVariant& value, const QString& add if (value.toDouble() == 0.0) return add.isEmpty() ? "0" : add; //eat 0 #if 0 //moved to KexiDB::formatNumberForVisibleDecimalPlaces() - QString text( QString::number(value.toDouble(), 'f', - QMAX(d->field->visibleDecimalPlaces(), 10)) ); //!<-- 10 is quite good maximum for fractional digits + TQString text( TQString::number(value.toDouble(), 'f', + TQMAX(d->field->visibleDecimalPlaces(), 10)) ); //!<-- 10 is quite good maximum for fractional digits //!< @todo add command line settings? //! @todo (js): get decimal places settings here... - QStringList sl = QStringList::split(".", text); + TQStringList sl = TQStringList::split(".", text); //nothing } else if (sl.count()==2) { // kdDebug() << "sl.count()=="<<sl.count()<< " " <<sl[0] << " | " << sl[1] << endl; - const QString sl1 = sl[1]; + const TQString sl1 = sl[1]; int pos = sl1.length()-1; if (pos>=1) { for (;pos>=0 && sl1[pos]=='0';pos--) @@ -113,16 +113,16 @@ QString KexiTextFormatter::valueToText(const QVariant& value, const QString& add } else if (d->field->type() == KexiDB::Field::Boolean) { //! @todo temporary solution for booleans! - const bool boolValue = value.isNull() ? QVariant(add).toBool() : value.toBool(); + const bool boolValue = value.isNull() ? TQVariant(add).toBool() : value.toBool(); return boolValue ? "1" : "0"; } else if (d->field->type() == KexiDB::Field::Date) { - return d->dateFormatter->dateToString( value.toString().isEmpty() ? QDate() : value.toDate() ); + return d->dateFormatter->dateToString( value.toString().isEmpty() ? TQDate() : value.toDate() ); } else if (d->field->type() == KexiDB::Field::Time) { return d->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) ); } else if (d->field->type() == KexiDB::Field::DateTime) { if (value.toString().isEmpty() ) @@ -138,10 +138,10 @@ QString KexiTextFormatter::valueToText(const QVariant& value, const QString& add return value.toString() + add; } -QVariant KexiTextFormatter::textToValue(const QString& text) const +TQVariant KexiTextFormatter::textToValue(const TQString& text) const { if (!d->field) - return QVariant(); + return TQVariant(); const KexiDB::Field::Type t = d->field->type(); switch (t) { case KexiDB::Field::Text: @@ -157,7 +157,7 @@ QVariant KexiTextFormatter::textToValue(const QString& text) const 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 d->dateFormatter->stringToVariant( text ); case KexiDB::Field::Time: @@ -167,8 +167,8 @@ QVariant KexiTextFormatter::textToValue(const QString& text) const case KexiDB::Field::Float: case KexiDB::Field::Double: { // replace custom decimal symbol with '.' as required by to{Float|Double}() - QString fixedText( text ); - fixedText.replace(KGlobal::locale()->decimalSymbol(), "."); + TQString fixedText( text ); + fixedText.tqreplace(KGlobal::locale()->decimalSymbol(), "."); if (t == KexiDB::Field::Double) return fixedText.toDouble(); return fixedText.toFloat(); @@ -179,7 +179,7 @@ QVariant KexiTextFormatter::textToValue(const QString& text) const //! @todo more data types! } -bool KexiTextFormatter::valueIsEmpty(const QString& text) const +bool KexiTextFormatter::valueIsEmpty(const TQString& text) const { if (text.isEmpty()) return true; @@ -198,7 +198,7 @@ bool KexiTextFormatter::valueIsEmpty(const QString& text) const return text.isEmpty(); } -bool KexiTextFormatter::valueIsValid(const QString& text) const +bool KexiTextFormatter::valueIsValid(const TQString& text) const { if (!d->field) return true; @@ -218,7 +218,7 @@ bool KexiTextFormatter::valueIsValid(const QString& text) const return true; } -QString KexiTextFormatter::inputMask() const +TQString KexiTextFormatter::inputMask() const { const KexiDB::Field::Type t = d->field->type(); if (t==KexiDB::Field::Date) { @@ -232,6 +232,6 @@ QString KexiTextFormatter::inputMask() const else if (t==KexiDB::Field::DateTime) { dateTimeInputMask( *d->dateFormatter, *d->timeFormatter ); } - return QString::null; + return TQString(); } diff --git a/kexi/widget/tableview/kexitextformatter.h b/kexi/widget/tableview/kexitextformatter.h index 3ea611a4..12e67a37 100644 --- a/kexi/widget/tableview/kexitextformatter.h +++ b/kexi/widget/tableview/kexitextformatter.h @@ -22,7 +22,7 @@ #include <kexidb/field.h> -//! @short Text formatter used to format QVariant values to text for displaying and back to QVariant +//! @short Text formatter used to format TQVariant values to text for displaying and back to TQVariant /*! Used by KexiInputTableEdit, KexiDateTableEdit, KexiTimeTableEdit, KexiDateTimeTableEdit, KexiDBLineEdit (forms), etc. */ class KEXIDATATABLE_EXPORT KexiTextFormatter @@ -38,24 +38,24 @@ class KEXIDATATABLE_EXPORT KexiTextFormatter A field schema set using setField() is used to perform the formatting. \a add is a text that should be added to the value if possible. Used in KexiInputTableEdit::setValueInternal(), by form widgets and for reporting/printing. */ - QString valueToText(const QVariant& value, const QString& add) const; + TQString valueToText(const TQVariant& value, const TQString& add) const; /*! \return value cnverted from \a text A field schema set using setField() is used to perform the formatting. Used in KexiInputTableEdit::setValueInternal(), by form widgets and for reporting/printing. */ - QVariant textToValue(const QString& text) const; + TQVariant textToValue(const TQString& text) const; /*! \return true if value formatted as \a text is empty. A field schema set using setField() is used to perform the calculation. */ - bool valueIsEmpty(const QString& text) const; + bool valueIsEmpty(const TQString& text) const; /*! \return true if value formatted as \a text is valid. A field schema set using setField() is used to perform the calculation. */ - bool valueIsValid(const QString& text) const; + bool valueIsValid(const TQString& text) const; - /*! \return input mask for intering values related to a field schema + /*! \return input tqmask for intering values related to a field schema which has been set using setField(). */ - QString inputMask() const; + TQString inputMask() const; class Private; Private *d; diff --git a/kexi/widget/tableview/kexitimetableedit.cpp b/kexi/widget/tableview/kexitimetableedit.cpp index 3238c58e..5f3313f7 100644 --- a/kexi/widget/tableview/kexitimetableedit.cpp +++ b/kexi/widget/tableview/kexitimetableedit.cpp @@ -19,20 +19,20 @@ #include "kexitimetableedit.h" -#include <qapplication.h> -#include <qpainter.h> -#include <qvariant.h> -#include <qrect.h> -#include <qpalette.h> -#include <qcolor.h> -#include <qfontmetrics.h> -#include <qdatetime.h> -#include <qcursor.h> -#include <qpoint.h> -#include <qlayout.h> -#include <qtoolbutton.h> -#include <qdatetimeedit.h> -#include <qclipboard.h> +#include <tqapplication.h> +#include <tqpainter.h> +#include <tqvariant.h> +#include <tqrect.h> +#include <tqpalette.h> +#include <tqcolor.h> +#include <tqfontmetrics.h> +#include <tqdatetime.h> +#include <tqcursor.h> +#include <tqpoint.h> +#include <tqlayout.h> +#include <tqtoolbutton.h> +#include <tqdatetimeedit.h> +#include <tqclipboard.h> #include <kdebug.h> #include <klocale.h> @@ -45,12 +45,12 @@ #include <kexiutils/utils.h> -KexiTimeTableEdit::KexiTimeTableEdit(KexiTableViewColumn &column, QWidget *parent) - : KexiInputTableEdit(column, parent) +KexiTimeTableEdit::KexiTimeTableEdit(KexiTableViewColumn &column, TQWidget *tqparent) + : KexiInputTableEdit(column, tqparent) { setName("KexiTimeTableEdit"); -//! @todo add QValidator so time like "99:88:77" cannot be even entered +//! @todo add TQValidator so time like "99:88:77" cannot be even entered m_lineedit->setInputMask( m_formatter.inputMask() ); } @@ -59,20 +59,20 @@ KexiTimeTableEdit::~KexiTimeTableEdit() { } -void KexiTimeTableEdit::setValueInInternalEditor(const QVariant &value) +void KexiTimeTableEdit::setValueInInternalEditor(const TQVariant &value) { if (value.isValid() && value.toTime().isValid()) m_lineedit->setText( m_formatter.timeToString( value.toTime() ) ); else - m_lineedit->setText( QString::null ); + m_lineedit->setText( TQString() ); } -void KexiTimeTableEdit::setValueInternal(const QVariant& add_, bool removeOld) +void KexiTimeTableEdit::setValueInternal(const TQVariant& add_, bool removeOld) { if (removeOld) { //new time entering... just fill the line edit //! @todo cut string if too long.. - QString add(add_.toString()); + TQString add(add_.toString()); m_lineedit->setText(add); m_lineedit->setCursorPosition(add.length()); return; @@ -81,20 +81,20 @@ void KexiTimeTableEdit::setValueInternal(const QVariant& add_, bool removeOld) m_lineedit->setCursorPosition(0); //ok? } -void KexiTimeTableEdit::setupContents( QPainter *p, bool focused, const QVariant& val, - QString &txt, int &align, int &x, int &y_offset, int &w, int &h ) +void KexiTimeTableEdit::setupContents( TQPainter *p, bool focused, const TQVariant& val, + TQString &txt, int &align, int &x, int &y_offset, int &w, int &h ) { Q_UNUSED(p); Q_UNUSED(focused); Q_UNUSED(x); Q_UNUSED(w); Q_UNUSED(h); -#ifdef Q_WS_WIN +#ifdef TQ_WS_WIN y_offset = -1; #else y_offset = 0; #endif - if (!val.isNull() && val.canCast(QVariant::Time)) + if (!val.isNull() && val.canCast(TQVariant::Time)) txt = m_formatter.timeToString(val.toTime()); align |= AlignLeft; } @@ -111,12 +111,12 @@ bool KexiTimeTableEdit::valueIsEmpty() return valueIsNull();// OK? TODO (nonsense?) } -QTime KexiTimeTableEdit::timeValue() +TQTime KexiTimeTableEdit::timeValue() { return m_formatter.stringToTime( m_lineedit->text() ); } -QVariant KexiTimeTableEdit::value() +TQVariant KexiTimeTableEdit::value() { return m_formatter.stringToVariant( m_lineedit->text() ); } @@ -128,21 +128,21 @@ bool KexiTimeTableEdit::valueIsValid() return m_formatter.stringToTime( m_lineedit->text() ).isValid(); } -void KexiTimeTableEdit::handleCopyAction(const QVariant& value, const QVariant& visibleValue) +void KexiTimeTableEdit::handleCopyAction(const TQVariant& value, const TQVariant& visibleValue) { Q_UNUSED(visibleValue); if (!value.isNull() && value.toTime().isValid()) - qApp->clipboard()->setText( m_formatter.timeToString(value.toTime()) ); + tqApp->clipboard()->setText( m_formatter.timeToString(value.toTime()) ); else - qApp->clipboard()->setText( QString::null ); + tqApp->clipboard()->setText( TQString() ); } -void KexiTimeTableEdit::handleAction(const QString& actionName) +void KexiTimeTableEdit::handleAction(const TQString& actionName) { const bool alreadyVisible = m_lineedit->isVisible(); if (actionName=="edit_paste") { - const QVariant newValue( m_formatter.stringToTime( qApp->clipboard()->text() ) ); + const TQVariant newValue( m_formatter.stringToTime( tqApp->clipboard()->text() ) ); if (!alreadyVisible) { //paste as the entire text if the cell was not in edit mode emit editRequested(); m_lineedit->clear(); diff --git a/kexi/widget/tableview/kexitimetableedit.h b/kexi/widget/tableview/kexitimetableedit.h index 4daa68ec..6c427bbd 100644 --- a/kexi/widget/tableview/kexitimetableedit.h +++ b/kexi/widget/tableview/kexitimetableedit.h @@ -24,7 +24,7 @@ #include <widget/utils/kexidatetimeformatter.h> /*! @short Editor class for Time type. - It is a replacement QTimeEdit due to usability problems: + It is a replacement TQTimeEdit due to usability problems: people are accustomed to use single-character cursor. Time format is retrieved from the KDE global settings and input/output is performed using KLineEdit (from KexiInputTableEdit). @@ -32,28 +32,29 @@ class KexiTimeTableEdit : public KexiInputTableEdit { Q_OBJECT + TQ_OBJECT public: - KexiTimeTableEdit(KexiTableViewColumn &column, QWidget *parent=0); + KexiTimeTableEdit(KexiTableViewColumn &column, TQWidget *tqparent=0); virtual ~KexiTimeTableEdit(); - virtual void setupContents( QPainter *p, bool focused, const QVariant& val, - QString &txt, int &align, int &x, int &y_offset, int &w, int &h ); - virtual QVariant value(); + virtual void setupContents( TQPainter *p, bool focused, const TQVariant& val, + TQString &txt, int &align, int &x, int &y_offset, int &w, int &h ); + virtual TQVariant value(); virtual bool valueIsNull(); virtual bool valueIsEmpty(); virtual bool valueIsValid(); /*! Reimplemented after KexiInputTableEdit. */ - virtual void handleAction(const QString& actionName); + virtual void handleAction(const TQString& actionName); /*! Reimplemented after KexiInputTableEdit. */ - virtual void handleCopyAction(const QVariant& value, const QVariant& visibleValue); + virtual void handleCopyAction(const TQVariant& value, const TQVariant& visibleValue); protected: //! helper - void setValueInInternalEditor(const QVariant &value); - virtual void setValueInternal(const QVariant& add, bool removeOld); - QTime timeValue(); + void setValueInInternalEditor(const TQVariant &value); + virtual void setValueInternal(const TQVariant& add, bool removeOld); + TQTime timeValue(); //! Used to format and convert time values KexiTimeFormatter m_formatter; diff --git a/kexi/widget/utils/kexiarrowtip.cpp b/kexi/widget/utils/kexiarrowtip.cpp index cdffcb02..a805f5e3 100644 --- a/kexi/widget/utils/kexiarrowtip.cpp +++ b/kexi/widget/utils/kexiarrowtip.cpp @@ -19,44 +19,44 @@ #include "kexiarrowtip.h" -#include <qpixmap.h> -#include <qbitmap.h> -#include <qpainter.h> -#include <qimage.h> -#include <qtooltip.h> -#include <qfont.h> -#include <qfontmetrics.h> -#include <qtimer.h> +#include <tqpixmap.h> +#include <tqbitmap.h> +#include <tqpainter.h> +#include <tqimage.h> +#include <tqtooltip.h> +#include <tqfont.h> +#include <tqfontmetrics.h> +#include <tqtimer.h> #include <kexiutils/utils.h> -KexiArrowTip::KexiArrowTip(const QString& text, QWidget* parent) - : KexiToolTip(text, parent) +KexiArrowTip::KexiArrowTip(const TQString& text, TQWidget* tqparent) + : KexiToolTip(text, tqparent) , m_opacity(0.0) { - QPalette pal( palette() ); - QColorGroup cg(pal.active()); - cg.setColor(QColorGroup::Foreground, Qt::red); + TQPalette pal( palette() ); + TQColorGroup cg(pal.active()); + cg.setColor(TQColorGroup::Foreground, TQt::red); pal.setActive(cg); setPalette(pal); - QFontMetrics fm(font()); - QSize sz(fm.boundingRect(m_value.toString()).size()); - sz += QSize(14, 10); //+margins + TQFontMetrics fm(font()); + TQSize sz(fm.boundingRect(m_value.toString()).size()); + sz += TQSize(14, 10); //+margins m_arrowHeight = sz.height()/2; - sz += QSize(0, m_arrowHeight); //+arrow height + sz += TQSize(0, m_arrowHeight); //+arrow height resize(sz); setAutoMask( false ); - //generate mask - QPixmap maskPm(size()); - maskPm.fill( black ); - QPainter maskPainter(&maskPm); - drawFrame(maskPainter); - QImage maskImg( maskPm.convertToImage() ); - QBitmap bm; - bm = maskImg.createHeuristicMask(); + //generate tqmask + TQPixmap tqmaskPm(size()); + tqmaskPm.fill( black ); + TQPainter tqmaskPainter(&tqmaskPm); + drawFrame(tqmaskPainter); + TQImage tqmaskImg( tqmaskPm.convertToImage() ); + TQBitmap bm; + bm = tqmaskImg.createHeuristicMask(); setMask( bm ); } @@ -88,7 +88,7 @@ void KexiArrowTip::increaseOpacity() m_opacity += 0.10; setWindowOpacity(m_opacity); if (m_opacity < 1.0) - QTimer::singleShot(25, this, SLOT(increaseOpacity())); + TQTimer::singleShot(25, this, TQT_SLOT(increaseOpacity())); } void KexiArrowTip::decreaseOpacity() @@ -100,7 +100,7 @@ void KexiArrowTip::decreaseOpacity() } m_opacity -= 0.10; setWindowOpacity(m_opacity); - QTimer::singleShot(25, this, SLOT(decreaseOpacity())); + TQTimer::singleShot(25, this, TQT_SLOT(decreaseOpacity())); } bool KexiArrowTip::close ( bool alsoDelete ) @@ -115,16 +115,16 @@ bool KexiArrowTip::close ( bool alsoDelete ) return m_opacity<=0.0; } -void KexiArrowTip::drawContents(QPainter& p) +void KexiArrowTip::drawContents(TQPainter& p) { - p.setPen( QPen(palette().active().foreground(), 1) ); - p.drawText(QRect(0,m_arrowHeight,width(),height()-m_arrowHeight), - Qt::AlignCenter, m_value.toString()); + p.setPen( TQPen(tqpalette().active().foreground(), 1) ); + p.drawText(TQRect(0,m_arrowHeight,width(),height()-m_arrowHeight), + TQt::AlignCenter, m_value.toString()); } -void KexiArrowTip::drawFrame(QPainter& p) +void KexiArrowTip::drawFrame(TQPainter& p) { - QPen pen(palette().active().foreground(), 1, Qt::SolidLine, Qt::SquareCap, Qt::MiterJoin); + TQPen pen(tqpalette().active().foreground(), 1, Qt::SolidLine, Qt::SquareCap, Qt::MiterJoin); p.setPen( pen ); /* /\ @@ -134,7 +134,7 @@ void KexiArrowTip::drawFrame(QPainter& p) */ //1st line const int arrowOffset = 5; //5 pixels to right - QPointArray pa(8); + TQPointArray pa(8); pa.setPoint(0, 0, m_arrowHeight-1); pa.setPoint(1, 0, height()-1); pa.setPoint(2, width()-1, height()-1); diff --git a/kexi/widget/utils/kexiarrowtip.h b/kexi/widget/utils/kexiarrowtip.h index d6de6186..791535fa 100644 --- a/kexi/widget/utils/kexiarrowtip.h +++ b/kexi/widget/utils/kexiarrowtip.h @@ -29,11 +29,12 @@ class KEXIGUIUTILS_EXPORT KexiArrowTip : public KexiToolTip { Q_OBJECT + TQ_OBJECT public: - KexiArrowTip(const QString& text, QWidget* parent); + KexiArrowTip(const TQString& text, TQWidget* tqparent); virtual ~KexiArrowTip(); - inline QString text() const { return m_value.toString(); } + inline TQString text() const { return m_value.toString(); } virtual bool close() { return close(false); } virtual bool close( bool alsoDelete ); @@ -46,8 +47,8 @@ class KEXIGUIUTILS_EXPORT KexiArrowTip : public KexiToolTip void decreaseOpacity(); protected: - virtual void drawFrame(QPainter& p); - virtual void drawContents(QPainter& p); + virtual void drawFrame(TQPainter& p); + virtual void drawContents(TQPainter& p); int m_arrowHeight; double m_opacity; diff --git a/kexi/widget/utils/kexicomboboxdropdownbutton.cpp b/kexi/widget/utils/kexicomboboxdropdownbutton.cpp index 407bc6fe..b5c22372 100644 --- a/kexi/widget/utils/kexicomboboxdropdownbutton.cpp +++ b/kexi/widget/utils/kexicomboboxdropdownbutton.cpp @@ -23,18 +23,18 @@ #include <kdebug.h> #include <kcombobox.h> -#include <qstyle.h> -#include <qapplication.h> +#include <tqstyle.h> +#include <tqapplication.h> -KexiComboBoxDropDownButton::KexiComboBoxDropDownButton( QWidget *parent ) - : KPushButton(parent) +KexiComboBoxDropDownButton::KexiComboBoxDropDownButton( TQWidget *tqparent ) + : KPushButton(tqparent) { m_paintedCombo = new KComboBox(this); m_paintedCombo->hide(); m_paintedCombo->setEditable(true); setToggleButton(true); - styleChange(style()); + styleChange(tqstyle()); m_paintedCombo->move(0,0); m_paintedCombo->setFixedSize(size()); } @@ -43,45 +43,45 @@ KexiComboBoxDropDownButton::~KexiComboBoxDropDownButton() { } -void KexiComboBoxDropDownButton::drawButton(QPainter *p) +void KexiComboBoxDropDownButton::drawButton(TQPainter *p) { - int flags = QStyle::Style_Enabled | QStyle::Style_HasFocus; + int flags = TQStyle::Style_Enabled | TQStyle::Style_HasFocus; if (isDown()) - flags |= QStyle::Style_Down; + flags |= TQStyle::Style_Down; KPushButton::drawButton(p); - QRect r = rect(); + TQRect r = rect(); r.setHeight(r.height()+m_fixForHeight); - if (m_drawComplexControl) { + if (m_tqdrawComplexControl) { if (m_fixForHeight>0 && m_paintedCombo->size()!=size()) { m_paintedCombo->move(0,0); - m_paintedCombo->setFixedSize(size()+QSize(0, m_fixForHeight)); //last chance to fix size + m_paintedCombo->setFixedSize(size()+TQSize(0, m_fixForHeight)); //last chance to fix size } - style().drawComplexControl( QStyle::CC_ComboBox, p, - m_fixForHeight>0 ? (const QWidget*)m_paintedCombo : this, r, colorGroup(), - flags, (uint)(QStyle::SC_ComboBoxArrow), QStyle::SC_None ); + tqstyle().tqdrawComplexControl( TQStyle::CC_ComboBox, p, + m_fixForHeight>0 ? (const TQWidget*)m_paintedCombo : this, r, tqcolorGroup(), + flags, (uint)(TQStyle::SC_ComboBoxArrow), TQStyle::SC_None ); } else { r.setWidth(r.width()+2); - style().drawPrimitive( QStyle::PE_ArrowDown, p, r, colorGroup(), flags); + tqstyle().tqdrawPrimitive( TQStyle::PE_ArrowDown, p, r, tqcolorGroup(), flags); } } -void KexiComboBoxDropDownButton::styleChange( QStyle & oldStyle ) +void KexiComboBoxDropDownButton::styleChange( TQStyle & oldStyle ) { //<hack> - if (qstricmp(style().name(),"thinkeramik")==0) { + if (qstricmp(tqstyle().name(),"thinkeramik")==0) { m_fixForHeight = 3; } else m_fixForHeight = 0; //</hack> - m_drawComplexControl = - (style().inherits("KStyle") && qstricmp(style().name(),"qtcurve")!=0) - || qstricmp(style().name(),"platinum")==0; + m_tqdrawComplexControl = + (tqstyle().inherits("KStyle") && qstricmp(tqstyle().name(),"qtcurve")!=0) + || qstricmp(tqstyle().name(),"platinum")==0; if (m_fixForHeight==0) - setFixedWidth( style().querySubControlMetrics( QStyle::CC_ComboBox, - (const QWidget*)m_paintedCombo, QStyle::SC_ComboBoxArrow ).width() +1 ); + setFixedWidth( tqstyle().querySubControlMetrics( TQStyle::CC_ComboBox, + (const TQWidget*)m_paintedCombo, TQStyle::SC_ComboBoxArrow ).width() +1 ); KPushButton::styleChange(oldStyle); } diff --git a/kexi/widget/utils/kexicomboboxdropdownbutton.h b/kexi/widget/utils/kexicomboboxdropdownbutton.h index da53a7e2..970e46c3 100644 --- a/kexi/widget/utils/kexicomboboxdropdownbutton.h +++ b/kexi/widget/utils/kexicomboboxdropdownbutton.h @@ -30,19 +30,19 @@ class KComboBox; class KEXIGUIUTILS_EXPORT KexiComboBoxDropDownButton : public KPushButton { public: - KexiComboBoxDropDownButton( QWidget *parent ); + KexiComboBoxDropDownButton( TQWidget *tqparent ); virtual ~KexiComboBoxDropDownButton(); protected: /*! Reimplemented after @ref KPushButton to draw drop-down arrow. */ - virtual void drawButton(QPainter *p); + virtual void drawButton(TQPainter *p); /*! Reimplemented after @ref KPushButton to adapt size to style changes. */ - virtual void styleChange( QStyle & oldStyle ); + virtual void styleChange( TQStyle & oldStyle ); int m_fixForHeight; - bool m_drawComplexControl : 1; - KComboBox *m_paintedCombo; //!< fake combo used only to pass it as 'this' for QStyle + bool m_tqdrawComplexControl : 1; + KComboBox *m_paintedCombo; //!< fake combo used only to pass it as 'this' for TQStyle //!< (because styles use \<static_cast\>) }; diff --git a/kexi/widget/utils/kexicontextmenuutils.cpp b/kexi/widget/utils/kexicontextmenuutils.cpp index 727cef6f..8c6c3ab2 100644 --- a/kexi/widget/utils/kexicontextmenuutils.cpp +++ b/kexi/widget/utils/kexicontextmenuutils.cpp @@ -27,10 +27,10 @@ #include <kdebug.h> #include <kmessagebox.h> -#include <qfiledialog.h> -#include <qapplication.h> +#include <tqfiledialog.h> +#include <tqapplication.h> -#ifdef Q_WS_WIN +#ifdef TQ_WS_WIN #include <win32_utils.h> #include <krecentdirs.h> #endif @@ -39,8 +39,8 @@ class KexiImageContextMenu::Private { public: - Private(QWidget *parent) - : actionCollection(parent) + Private(TQWidget *tqparent) + : actionCollection(tqparent) { } @@ -55,38 +55,38 @@ public: //------------ -KexiImageContextMenu::KexiImageContextMenu(QWidget* parent) - : KPopupMenu(parent) +KexiImageContextMenu::KexiImageContextMenu(TQWidget* tqparent) + : KPopupMenu(tqparent) , d( new Private(this) ) { setName("KexiImageContextMenu"); - insertTitle(QString::null); + insertTitle(TQString()); d->insertFromFileAction = new KAction(i18n("Insert From &File..."), SmallIconSet("fileopen"), 0, - this, SLOT(insertFromFile()), &d->actionCollection, "insert"); + TQT_TQOBJECT(this), TQT_SLOT(insertFromFile()), &d->actionCollection, "insert"); d->insertFromFileAction->plug(this); - d->saveAsAction = KStdAction::saveAs(this, SLOT(saveAs()), &d->actionCollection); + d->saveAsAction = KStdAction::saveAs(TQT_TQOBJECT(this), TQT_SLOT(saveAs()), &d->actionCollection); // d->saveAsAction->setText(i18n("&Save &As...")); d->saveAsAction->plug(this); insertSeparator(); - d->cutAction = KStdAction::cut(this, SLOT(cut()), &d->actionCollection); + d->cutAction = KStdAction::cut(TQT_TQOBJECT(this), TQT_SLOT(cut()), &d->actionCollection); d->cutAction->plug(this); - d->copyAction = KStdAction::copy(this, SLOT(copy()), &d->actionCollection); + d->copyAction = KStdAction::copy(TQT_TQOBJECT(this), TQT_SLOT(copy()), &d->actionCollection); d->copyAction->plug(this); - d->pasteAction = KStdAction::paste(this, SLOT(paste()), &d->actionCollection); + d->pasteAction = KStdAction::paste(TQT_TQOBJECT(this), TQT_SLOT(paste()), &d->actionCollection); d->pasteAction->plug(this); d->deleteAction = new KAction(i18n("&Clear"), SmallIconSet("editdelete"), 0, - this, SLOT(clear()), &d->actionCollection, "delete"); + TQT_TQOBJECT(this), TQT_SLOT(clear()), &d->actionCollection, "delete"); d->deleteAction->plug(this); #ifdef KEXI_NO_UNFINISHED d->propertiesAction = 0; #else insertSeparator(); d->propertiesAction = new KAction(i18n("Properties"), 0, 0, - this, SLOT(showProperties()), &d->actionCollection, "properties"); + this, TQT_SLOT(showProperties()), &d->actionCollection, "properties"); d->propertiesAction->plug(this); #endif - connect(this, SIGNAL(aboutToShow()), this, SLOT(updateActionsAvailability())); + connect(this, TQT_SIGNAL(aboutToShow()), this, TQT_SLOT(updateActionsAvailability())); } KexiImageContextMenu::~KexiImageContextMenu() @@ -96,12 +96,12 @@ KexiImageContextMenu::~KexiImageContextMenu() void KexiImageContextMenu::insertFromFile() { -// QWidget *focusWidget = qApp->focusWidget(); -#ifdef Q_WS_WIN - QString recentDir; - QString fileName = QFileDialog::getOpenFileName( +// TQWidget *tqfocusWidget = tqApp->tqfocusWidget(); +#ifdef TQ_WS_WIN + TQString recentDir; + TQString fileName = TQFileDialog::getOpenFileName( KFileDialog::getStartURL(":LastVisitedImagePath", recentDir).path(), - convertKFileDialogFilterToQFileDialogFilter(KImageIO::pattern(KImageIO::Reading)), + convertKFileDialogFilterToTQFileDialogFilter(KImageIO::pattern(KImageIO::Reading)), this, 0, i18n("Insert Image From File")); KURL url; if (!fileName.isEmpty()) @@ -109,22 +109,22 @@ void KexiImageContextMenu::insertFromFile() #else KURL url( KFileDialog::getImageOpenURL( ":LastVisitedImagePath", this, i18n("Insert Image From File")) ); -// 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 #endif if (!url.isValid()) { //focus the app again because to avoid annoying the user with unfocused main window - if (qApp->mainWidget()) { - //focusWidget->raise(); - //focusWidget->setFocus(); - qApp->mainWidget()->raise(); + if (tqApp->mainWidget()) { + //tqfocusWidget->raise(); + //tqfocusWidget->setFocus(); + tqApp->mainWidget()->raise(); } return; } kexipluginsdbg << "fname=" << url.prettyURL() << endl; -#ifdef Q_WS_WIN +#ifdef TQ_WS_WIN //save last visited path // KURL url(fileName); if (url.isLocalFile()) @@ -132,16 +132,16 @@ void KexiImageContextMenu::insertFromFile() #endif emit insertFromFileRequested(url); - if (qApp->mainWidget()) { -// focusWidget->raise(); -// focusWidget->setFocus(); - qApp->mainWidget()->raise(); + if (tqApp->mainWidget()) { +// tqfocusWidget->raise(); +// tqfocusWidget->setFocus(); + tqApp->mainWidget()->raise(); } } void KexiImageContextMenu::saveAs() { - QString origFilename, fileExtension; + TQString origFilename, fileExtension; bool dataIsEmpty = false; emit aboutToSaveAsRequested(origFilename, fileExtension, dataIsEmpty); @@ -150,44 +150,44 @@ void KexiImageContextMenu::saveAs() return; } if (!origFilename.isEmpty()) - origFilename = QString("/") + origFilename; + origFilename = TQString("/") + origFilename; if (fileExtension.isEmpty()) { // PNG data is the default fileExtension = "png"; } -#ifdef Q_WS_WIN - QString recentDir; - QString fileName = QFileDialog::getSaveFileName( +#ifdef TQ_WS_WIN + TQString recentDir; + TQString fileName = TQFileDialog::getSaveFileName( KFileDialog::getStartURL(":LastVisitedImagePath", recentDir).path() + origFilename, - convertKFileDialogFilterToQFileDialogFilter(KImageIO::pattern(KImageIO::Writing)), + convertKFileDialogFilterToTQFileDialogFilter(KImageIO::pattern(KImageIO::Writing)), this, 0, i18n("Save Image to File")); #else //! @todo add originalFileName! (requires access to KRecentDirs) - QString fileName = KFileDialog::getSaveFileName( + TQString fileName = KFileDialog::getSaveFileName( ":LastVisitedImagePath", KImageIO::pattern(KImageIO::Writing), this, i18n("Save Image to File")); #endif if (fileName.isEmpty()) return; - if (QFileInfo(fileName).extension().isEmpty()) - fileName += (QString(".")+fileExtension); + if (TQFileInfo(fileName).extension().isEmpty()) + fileName += (TQString(".")+fileExtension); kdDebug() << fileName << endl; KURL url; url.setPath( fileName ); -#ifdef Q_WS_WIN +#ifdef TQ_WS_WIN //save last visited path if (url.isLocalFile()) KRecentDirs::add(":LastVisitedImagePath", url.directory()); #endif - QFile f(fileName); + TQFile f(fileName); if (f.exists() && KMessageBox::Yes != KMessageBox::warningYesNo(this, "<qt>"+i18n("File \"%1\" already exists." "<p>Do you want to replace it with a new one?") - .arg(QDir::convertSeparators(fileName))+"</qt>",0, + .tqarg(TQDir::convertSeparators(fileName))+"</qt>",0, KGuiItem(i18n("&Replace")), KGuiItem(i18n("&Don't Replace")))) { return; @@ -244,7 +244,7 @@ KActionCollection* KexiImageContextMenu::actionCollection() const } //static -bool KexiImageContextMenu::updateTitle(QPopupMenu *menu, const QString& title, const QString& iconName) +bool KexiImageContextMenu::updateTitle(TQPopupMenu *menu, const TQString& title, const TQString& iconName) { return KexiContextMenuUtils::updateTitle(menu, title, i18n("Image"), iconName); } @@ -252,13 +252,13 @@ bool KexiImageContextMenu::updateTitle(QPopupMenu *menu, const QString& title, c // ------------------------------------------- //static -bool KexiContextMenuUtils::updateTitle(QPopupMenu *menu, const QString& objectName, - const QString& objectTypeName, const QString& iconName) +bool KexiContextMenuUtils::updateTitle(TQPopupMenu *menu, const TQString& objectName, + const TQString& objectTypeName, const TQString& iconName) { if (!menu || objectName.isEmpty() || objectTypeName.isEmpty()) return false; const int id = menu->idAt(0); - QMenuItem *item = menu->findItem(id); + TQMenuItem *item = menu->tqfindItem(id); if (!item) return false; KPopupTitle *title = dynamic_cast<KPopupTitle *>(item->widget()); @@ -267,14 +267,14 @@ bool KexiContextMenuUtils::updateTitle(QPopupMenu *menu, const QString& objectNa /*! @todo look at makeFirstCharacterUpperCaseInCaptions setting [bool] (see doc/dev/settings.txt) */ - QString realTitle( i18n("Object name : Object type", "%1 : %2") - .arg( objectName[0].upper() + objectName.mid(1) ) - .arg( objectTypeName )); + TQString realTitle( i18n("Object name : Object type", "%1 : %2") + .tqarg( objectName[0].upper() + objectName.mid(1) ) + .tqarg( objectTypeName )); if (iconName.isEmpty()) title->setTitle(realTitle); else { - QPixmap pixmap(SmallIcon( iconName )); + TQPixmap pixmap(SmallIcon( iconName )); title->setTitle(realTitle, &pixmap); } return true; diff --git a/kexi/widget/utils/kexicontextmenuutils.h b/kexi/widget/utils/kexicontextmenuutils.h index 95258e96..2f73b18e 100644 --- a/kexi/widget/utils/kexicontextmenuutils.h +++ b/kexi/widget/utils/kexicontextmenuutils.h @@ -35,8 +35,8 @@ class KEXIGUIUTILS_EXPORT KexiContextMenuUtils public: /*! Updates title for context menu. \return true if the title has been updated. */ - static bool updateTitle(QPopupMenu *menu, const QString& objectName, - const QString& objectTypeName, const QString& iconName); + static bool updateTitle(TQPopupMenu *menu, const TQString& objectName, + const TQString& objectTypeName, const TQString& iconName); }; //! @short A context menu used for images within form and table views @@ -50,17 +50,18 @@ class KEXIGUIUTILS_EXPORT KexiContextMenuUtils class KEXIGUIUTILS_EXPORT KexiImageContextMenu : public KPopupMenu { Q_OBJECT + TQ_OBJECT public: - KexiImageContextMenu(QWidget *parent); + KexiImageContextMenu(TQWidget *tqparent); virtual ~KexiImageContextMenu(); KActionCollection* actionCollection() const; /*! Updates title for context menu. - Used in KexiDBWidgetContextMenuExtender::createTitle(QPopupMenu *menu) and KexiDBImageBox. + Used in KexiDBWidgetContextMenuExtender::createTitle(TQPopupMenu *menu) and KexiDBImageBox. \return true if the title has been updated. */ - static bool updateTitle(QPopupMenu *menu, const QString& title, const QString& iconName = QString::null); + static bool updateTitle(TQPopupMenu *menu, const TQString& title, const TQString& iconName = TQString()); public slots: void updateActionsAvailability(); @@ -84,10 +85,10 @@ class KEXIGUIUTILS_EXPORT KexiImageContextMenu : public KPopupMenu /*! Emitted before "saveAs" action was requested. You should fill \a origFilename, \a fileExtension and \a dataIsEmpty values. If \a dataIsEmpty is false, saving will be cancelled. */ - void aboutToSaveAsRequested(QString& origFilename, QString& fileExtension, bool& dataIsEmpty); + void aboutToSaveAsRequested(TQString& origFilename, TQString& fileExtension, bool& dataIsEmpty); //! Emitted when "saveAs" action was requested - void saveAsRequested(const QString& fileName); + void saveAsRequested(const TQString& fileName); //! Emitted when "cut" action was requested void cutRequested(); diff --git a/kexi/widget/utils/kexidatetimeformatter.cpp b/kexi/widget/utils/kexidatetimeformatter.cpp index d8f642ca..430d2f8f 100644 --- a/kexi/widget/utils/kexidatetimeformatter.cpp +++ b/kexi/widget/utils/kexidatetimeformatter.cpp @@ -32,69 +32,69 @@ KexiDateFormatter::KexiDateFormatter() { // use "short date" format system settings //! @todo allow to override the format using column property and/or global app settings - QString df( KGlobal::locale()->dateFormatShort() ); + TQString df( KGlobal::locale()->dateFormatShort() ); if (df.length()>2) m_separator = df.mid(2,1); else m_separator = "-"; const int separatorLen = m_separator.length(); - QString yearMask("9999"); - QString yearDateFormat("yyyy"), + TQString yearMask("9999"); + TQString yearDateFormat("yyyy"), monthDateFormat("MM"), dayDateFormat("dd"); //for setting up m_dateFormat bool ok = df.length()>=8; - int yearpos, monthpos, daypos; //result of df.find() + int yearpos, monthpos, daypos; //result of df.tqfind() if (ok) {//look at % variables //! @todo more variables are possible here, see void KLocale::setDateFormatShort() docs //! http://developer.kde.org/documentation/library/3.5-api/kdelibs-apidocs/kdecore/html/classKLocale.html#a59 - yearpos = df.find("%y", 0, false); //&y or %y + yearpos = df.tqfind("%y", 0, false); //&y or %y m_longYear = !(yearpos>=0 && df.mid(yearpos+1, 1)=="y"); if (!m_longYear) { yearMask = "99"; yearDateFormat = "yy"; } - monthpos = df.find("%m", 0, true); //%m or %n + monthpos = df.tqfind("%m", 0, true); //%m or %n m_monthWithLeadingZero = true; if (monthpos<0) { - monthpos = df.find("%n", 0, false); + monthpos = df.tqfind("%n", 0, false); m_monthWithLeadingZero = false; monthDateFormat = "M"; } - daypos = df.find("%d", 0, true);//%d or %e + daypos = df.tqfind("%d", 0, true);//%d or %e m_dayWithLeadingZero = true; if (daypos<0) { - daypos = df.find("%e", 0, false); + daypos = df.tqfind("%e", 0, false); m_dayWithLeadingZero = false; dayDateFormat = "d"; } ok = (yearpos>=0 && monthpos>=0 && daypos>=0); } - m_order = QDateEdit::YMD; //default + m_order = TQDateEdit::YMD; //default if (ok) { if (yearpos<monthpos && monthpos<daypos) { //will be set in "default: YMD" } else if (yearpos<daypos && daypos<monthpos) { - m_order = QDateEdit::YDM; -//! @todo use QRegExp (to replace %Y by %1, etc.) instead of hardcoded "%1%299%399" + m_order = TQDateEdit::YDM; +//! @todo use TQRegExp (to tqreplace %Y by %1, etc.) instead of hardcoded "%1%299%399" //! because df may contain also other characters - m_inputMask = QString("%1%299%399").arg(yearMask).arg(m_separator).arg(m_separator); + m_inputMask = TQString("%1%299%399").tqarg(yearMask).tqarg(m_separator).tqarg(m_separator); m_qtFormat = yearDateFormat+m_separator+dayDateFormat+m_separator+monthDateFormat; m_yearpos = 0; m_daypos = yearMask.length()+separatorLen; m_monthpos = m_daypos+2+separatorLen; } else if (daypos<monthpos && monthpos<yearpos) { - m_order = QDateEdit::DMY; - m_inputMask = QString("99%199%2%3").arg(m_separator).arg(m_separator).arg(yearMask); + m_order = TQDateEdit::DMY; + m_inputMask = TQString("99%199%2%3").tqarg(m_separator).tqarg(m_separator).tqarg(yearMask); m_qtFormat = dayDateFormat+m_separator+monthDateFormat+m_separator+yearDateFormat; m_daypos = 0; m_monthpos = 2+separatorLen; m_yearpos = m_monthpos+2+separatorLen; } else if (monthpos<daypos && daypos<yearpos) { - m_order = QDateEdit::MDY; - m_inputMask = QString("99%199%2%3").arg(m_separator).arg(m_separator).arg(yearMask); + m_order = TQDateEdit::MDY; + m_inputMask = TQString("99%199%2%3").tqarg(m_separator).tqarg(m_separator).tqarg(yearMask); m_qtFormat = monthDateFormat+m_separator+dayDateFormat+m_separator+yearDateFormat; m_monthpos = 0; m_daypos = 2+separatorLen; @@ -103,8 +103,8 @@ KexiDateFormatter::KexiDateFormatter() else ok = false; } - if (!ok || m_order == QDateEdit::YMD) {//default: YMD - m_inputMask = QString("%1%299%399").arg(yearMask).arg(m_separator).arg(m_separator); + if (!ok || m_order == TQDateEdit::YMD) {//default: YMD + m_inputMask = TQString("%1%299%399").tqarg(yearMask).tqarg(m_separator).tqarg(m_separator); m_qtFormat = yearDateFormat+m_separator+monthDateFormat+m_separator+dayDateFormat; m_yearpos = 0; m_monthpos = yearMask.length()+separatorLen; @@ -117,12 +117,12 @@ KexiDateFormatter::~KexiDateFormatter() { } -QDate KexiDateFormatter::stringToDate( const QString& str ) const +TQDate KexiDateFormatter::stringToDate( const TQString& str ) const { bool ok = true; int year = str.mid(m_yearpos, m_longYear ? 4 : 2).toInt(&ok); if (!ok) - return QDate(); + return TQDate(); if (year < 30) {//2000..2029 year = 2000 + year; } @@ -132,35 +132,35 @@ QDate KexiDateFormatter::stringToDate( const QString& str ) const int month = str.mid(m_monthpos, 2).toInt(&ok); if (!ok) - return QDate(); + return TQDate(); int day = str.mid(m_daypos, 2).toInt(&ok); if (!ok) - return QDate(); + return TQDate(); - QDate date(year, month, day); + TQDate date(year, month, day); if (!date.isValid()) - return QDate(); + return TQDate(); return date; } -QVariant KexiDateFormatter::stringToVariant( const QString& str ) const +TQVariant KexiDateFormatter::stringToVariant( const TQString& str ) const { if (isEmpty(str)) - return QVariant(); - const QDate date( stringToDate( str ) ); + return TQVariant(); + const TQDate date( stringToDate( str ) ); if (date.isValid()) return date; - return QVariant(); + return TQVariant(); } -bool KexiDateFormatter::isEmpty( const QString& str ) const +bool KexiDateFormatter::isEmpty( const TQString& str ) const { - QString s(str); - return s.replace(m_separator,"").stripWhiteSpace().isEmpty(); + TQString s(str); + return s.tqreplace(m_separator,"").stripWhiteSpace().isEmpty(); } -QString KexiDateFormatter::dateToString( const QDate& date ) const +TQString KexiDateFormatter::dateToString( const TQDate& date ) const { return date.toString(m_qtFormat); } @@ -168,35 +168,35 @@ QString KexiDateFormatter::dateToString( const QDate& date ) const //------------------------------------------------ KexiTimeFormatter::KexiTimeFormatter() -: m_hmsRegExp( new QRegExp("(\\d*):(\\d*):(\\d*).*( am| pm){,1}", false/*!CS*/) ) - , m_hmRegExp( new QRegExp("(\\d*):(\\d*).*( am| pm){,1}", false/*!CS*/) ) +: m_hmsRegExp( new TQRegExp("(\\d*):(\\d*):(\\d*).*( am| pm){,1}", false/*!CS*/) ) + , m_hmRegExp( new TQRegExp("(\\d*):(\\d*).*( am| pm){,1}", false/*!CS*/) ) { - QString tf( KGlobal::locale()->timeFormat() ); - //m_hourpos, m_minpos, m_secpos; are result of tf.find() - QString hourVariable, minVariable, secVariable; + TQString tf( KGlobal::locale()->timeFormat() ); + //m_hourpos, m_minpos, m_secpos; are result of tf.tqfind() + TQString hourVariable, minVariable, secVariable; - //detect position of HOUR section: find %H or %k or %I or %l + //detect position of HOUR section: tqfind %H or %k or %I or %l m_24h = true; m_hoursWithLeadingZero = true; - m_hourpos = tf.find("%H", 0, true); + m_hourpos = tf.tqfind("%H", 0, true); if (m_hourpos>=0) { m_24h = true; m_hoursWithLeadingZero = true; } else { - m_hourpos = tf.find("%k", 0, true); + m_hourpos = tf.tqfind("%k", 0, true); if (m_hourpos>=0) { m_24h = true; m_hoursWithLeadingZero = false; } else { - m_hourpos = tf.find("%I", 0, true); + m_hourpos = tf.tqfind("%I", 0, true); if (m_hourpos>=0) { m_24h = false; m_hoursWithLeadingZero = true; } else { - m_hourpos = tf.find("%l", 0, true); + m_hourpos = tf.tqfind("%l", 0, true); if (m_hourpos>=0) { m_24h = false; m_hoursWithLeadingZero = false; @@ -204,9 +204,9 @@ KexiTimeFormatter::KexiTimeFormatter() } } } - m_minpos = tf.find("%M", 0, true); - m_secpos = tf.find("%S", 0, true); //can be -1 - m_ampmpos = tf.find("%p", 0, true); //can be -1 + m_minpos = tf.tqfind("%M", 0, true); + m_secpos = tf.tqfind("%S", 0, true); //can be -1 + m_ampmpos = tf.tqfind("%p", 0, true); //can be -1 if (m_hourpos<0 || m_minpos<0) { //set default: hr and min are needed, sec are optional @@ -221,13 +221,13 @@ KexiTimeFormatter::KexiTimeFormatter() hourVariable = tf.mid(m_hourpos, 2); m_inputMask = tf; -// m_inputMask.replace( hourVariable, "00" ); -// m_inputMask.replace( "%M", "00" ); -// m_inputMask.replace( "%S", "00" ); //optional - m_inputMask.replace( hourVariable, "99" ); - m_inputMask.replace( "%M", "99" ); - m_inputMask.replace( "%S", "00" ); //optional - m_inputMask.replace( "%p", "AA" ); //am or pm +// m_inputMask.tqreplace( hourVariable, "00" ); +// m_inputMask.tqreplace( "%M", "00" ); +// m_inputMask.tqreplace( "%S", "00" ); //optional + m_inputMask.tqreplace( hourVariable, "99" ); + m_inputMask.tqreplace( "%M", "99" ); + m_inputMask.tqreplace( "%S", "00" ); //optional + m_inputMask.tqreplace( "%p", "AA" ); //am or pm m_inputMask += ";_"; m_outputFormat = tf; @@ -239,7 +239,7 @@ KexiTimeFormatter::~KexiTimeFormatter() delete m_hmRegExp; } -QTime KexiTimeFormatter::stringToTime( const QString& str ) const +TQTime KexiTimeFormatter::stringToTime( const TQString& str ) const { int hour, min, sec; bool pm = false; @@ -257,7 +257,7 @@ QTime KexiTimeFormatter::stringToTime( const QString& str ) const } if (tryWithoutSeconds) { if (-1 == m_hmRegExp->search(str)) - return QTime(99,0,0); + return TQTime(99,0,0); hour = m_hmRegExp->cap(1).toInt(); min = m_hmRegExp->cap(2).toInt(); sec = 0; @@ -267,98 +267,98 @@ QTime KexiTimeFormatter::stringToTime( const QString& str ) const if (pm && hour < 12) hour += 12; //PM - return QTime(hour, min, sec); + return TQTime(hour, min, sec); } -QVariant KexiTimeFormatter::stringToVariant( const QString& str ) +TQVariant KexiTimeFormatter::stringToVariant( const TQString& str ) { if (isEmpty( str )) - return QVariant(); - const QTime time( stringToTime( str ) ); + return TQVariant(); + const TQTime time( stringToTime( str ) ); if (time.isValid()) return time; - return QVariant(); + return TQVariant(); } -bool KexiTimeFormatter::isEmpty( const QString& str ) const +bool KexiTimeFormatter::isEmpty( const TQString& str ) const { - QString s(str); - return s.replace(':',"").stripWhiteSpace().isEmpty(); + TQString s(str); + return s.tqreplace(':',"").stripWhiteSpace().isEmpty(); } -QString KexiTimeFormatter::timeToString( const QTime& time ) const +TQString KexiTimeFormatter::timeToString( const TQTime& time ) const { if (!time.isValid()) - return QString::null; + return TQString(); - QString s(m_outputFormat); + TQString s(m_outputFormat); if (m_24h) { if (m_hoursWithLeadingZero) - s.replace( "%H", QString::fromLatin1(time.hour()<10 ? "0" : "") + QString::number(time.hour()) ); + s.tqreplace( "%H", TQString::tqfromLatin1(time.hour()<10 ? "0" : "") + TQString::number(time.hour()) ); else - s.replace( "%k", QString::number(time.hour()) ); + s.tqreplace( "%k", TQString::number(time.hour()) ); } else { int time12 = (time.hour()>12) ? (time.hour()-12) : time.hour(); if (m_hoursWithLeadingZero) - s.replace( "%I", QString::fromLatin1(time12<10 ? "0" : "") + QString::number(time12) ); + s.tqreplace( "%I", TQString::tqfromLatin1(time12<10 ? "0" : "") + TQString::number(time12) ); else - s.replace( "%l", QString::number(time12) ); + s.tqreplace( "%l", TQString::number(time12) ); } - s.replace( "%M", QString::fromLatin1(time.minute()<10 ? "0" : "") + QString::number(time.minute()) ); + s.tqreplace( "%M", TQString::tqfromLatin1(time.minute()<10 ? "0" : "") + TQString::number(time.minute()) ); if (m_secpos>=0) - s.replace( "%S", QString::fromLatin1(time.second()<10 ? "0" : "") + QString::number(time.second()) ); + s.tqreplace( "%S", TQString::tqfromLatin1(time.second()<10 ? "0" : "") + TQString::number(time.second()) ); if (m_ampmpos>=0) - s.replace( "%p", KGlobal::locale()->translate( time.hour()>=12 ? "pm" : "am") ); + s.tqreplace( "%p", KGlobal::locale()->translate( time.hour()>=12 ? "pm" : "am") ); return s; } //------------------------------------------------ -QString dateTimeInputMask(const KexiDateFormatter& dateFormatter, const KexiTimeFormatter& timeFormatter) +TQString dateTimeInputMask(const KexiDateFormatter& dateFormatter, const KexiTimeFormatter& timeFormatter) { - QString mask(dateFormatter.inputMask()); - mask.truncate(dateFormatter.inputMask().length()-2); - return mask + " " + timeFormatter.inputMask(); + TQString tqmask(dateFormatter.inputMask()); + tqmask.truncate(dateFormatter.inputMask().length()-2); + return tqmask + " " + timeFormatter.inputMask(); } -QDateTime stringToDateTime( - const KexiDateFormatter& dateFormatter, const KexiTimeFormatter& timeFormatter, const QString& str) +TQDateTime stringToDateTime( + const KexiDateFormatter& dateFormatter, const KexiTimeFormatter& timeFormatter, const TQString& str) { - QString s( str.stripWhiteSpace() ); - const int timepos = s.find(" "); - const bool emptyTime = timepos >= 0 && timeFormatter.isEmpty(s.mid(timepos+1)); //.replace(':',"").stripWhiteSpace().isEmpty(); + TQString s( str.stripWhiteSpace() ); + const int timepos = s.tqfind(" "); + const bool emptyTime = timepos >= 0 && timeFormatter.isEmpty(s.mid(timepos+1)); //.tqreplace(':',"").stripWhiteSpace().isEmpty(); if (emptyTime) s = s.left(timepos); if (timepos>0 && !emptyTime) { - return QDateTime( + return TQDateTime( dateFormatter.stringToDate( s.left(timepos) ), timeFormatter.stringToTime( s.mid(timepos+1) ) ); } else { - return QDateTime( + return TQDateTime( dateFormatter.stringToDate( s ), - QTime(0,0,0) + TQTime(0,0,0) ); } } bool dateTimeIsEmpty( const KexiDateFormatter& dateFormatter, const KexiTimeFormatter& timeFormatter, - const QString& str ) + const TQString& str ) { - int timepos = str.find(" "); - const bool emptyTime = timepos >= 0 && timeFormatter.isEmpty(str.mid(timepos+1)); //s.mid(timepos+1).replace(':',"").stripWhiteSpace().isEmpty(); - return (timepos >= 0 && dateFormatter.isEmpty(str.left(timepos)) //s.left(timepos).replace(m_dateFormatter.separator(), "").stripWhiteSpace().isEmpty() + int timepos = str.tqfind(" "); + const bool emptyTime = timepos >= 0 && timeFormatter.isEmpty(str.mid(timepos+1)); //s.mid(timepos+1).tqreplace(':',"").stripWhiteSpace().isEmpty(); + return (timepos >= 0 && dateFormatter.isEmpty(str.left(timepos)) //s.left(timepos).tqreplace(m_dateFormatter.separator(), "").stripWhiteSpace().isEmpty() && emptyTime); } bool dateTimeIsValid( const KexiDateFormatter& dateFormatter, - const KexiTimeFormatter& timeFormatter, const QString& str ) + const KexiTimeFormatter& timeFormatter, const TQString& str ) { - int timepos = str.find(" "); - const bool emptyTime = timepos >= 0 && timeFormatter.isEmpty(str.mid(timepos+1)); //s.mid(timepos+1).replace(':',"").stripWhiteSpace().isEmpty(); - if (timepos >= 0 && dateFormatter.isEmpty(str.left(timepos)) // s.left(timepos).replace(m_dateFormatter.separator(), "").stripWhiteSpace().isEmpty() + int timepos = str.tqfind(" "); + const bool emptyTime = timepos >= 0 && timeFormatter.isEmpty(str.mid(timepos+1)); //s.mid(timepos+1).tqreplace(':',"").stripWhiteSpace().isEmpty(); + if (timepos >= 0 && dateFormatter.isEmpty(str.left(timepos)) // s.left(timepos).tqreplace(m_dateFormatter.separator(), "").stripWhiteSpace().isEmpty() && emptyTime) //empty date/time is valid return true; diff --git a/kexi/widget/utils/kexidatetimeformatter.h b/kexi/widget/utils/kexidatetimeformatter.h index 252bc535..1340320b 100644 --- a/kexi/widget/utils/kexidatetimeformatter.h +++ b/kexi/widget/utils/kexidatetimeformatter.h @@ -20,8 +20,8 @@ #ifndef KEXIDATETIMEFORMATTER_H #define KEXIDATETIMEFORMATTER_H -#include <qdatetimeedit.h> -#include <qregexp.h> +#include <tqdatetimeedit.h> +#include <tqregexp.h> //! @short Date formatter used by KexiDateTableEdit and KexiDateTimeTableEdit class KEXIGUIUTILS_EXPORT KexiDateFormatter @@ -37,36 +37,36 @@ class KEXIGUIUTILS_EXPORT KexiDateFormatter //! Converts string \a str to date using predefined settings. //! \return invalid date if the conversion is impossible - QDate stringToDate( const QString& str ) const; + TQDate stringToDate( const TQString& str ) const; /*! Converts string \a str to date using predefined settings - and returns QVariant containing the date value. + and returns TQVariant containing the date value. This method does the same as stringToDate() but if \a string contains invalid date representation, e.g. contains only spaces - and separators, null QVariant() is returned. */ - QVariant stringToVariant( const QString& str ) const; + and separators, null TQVariant() is returned. */ + TQVariant stringToVariant( const TQString& str ) const; //! Converts \a date to string using predefined settings. //! \return null string if \a date is invalid - QString dateToString( const QDate& date ) const; + TQString dateToString( const TQDate& date ) const; - //! \return Input mask generated using the formatter settings. - //! Can be used in QLineEdit::setInputMask(). - QString inputMask() const { return m_inputMask; } + //! \return Input tqmask generated using the formatter settings. + //! Can be used in TQLineEdit::setInputMask(). + TQString inputMask() const { return m_inputMask; } //! \return separator for this date format, a single character like "-" or "/" - QString separator() const { return m_separator; } + TQString separator() const { return m_separator; } //! \return true if \a str contains only spaces //! and separators according to the date format. - bool isEmpty( const QString& str ) const; + bool isEmpty( const TQString& str ) const; protected: - //! Input mask generated using the formatter settings. Can be used in QLineEdit::setInputMask(). - QString m_inputMask; + //! Input tqmask generated using the formatter settings. Can be used in TQLineEdit::setInputMask(). + TQString m_inputMask; //! Order of date sections - QDateEdit::Order m_order; + TQDateEdit::Order m_order; //! 4 or 2 digits bool m_longYear; @@ -74,12 +74,12 @@ class KEXIGUIUTILS_EXPORT KexiDateFormatter bool m_monthWithLeadingZero, m_dayWithLeadingZero; //! Date format used in dateToString() - QString m_qtFormat; + TQString m_qtFormat; - //! Used in stringToDate() to convert string back to QDate + //! Used in stringToDate() to convert string back to TQDate int m_yearpos, m_monthpos, m_daypos; - QString m_separator; + TQString m_separator; }; /*! @short Time formatter used by KexiTimeTableEdit and KexiDateTimeTableEdit @@ -98,33 +98,33 @@ class KEXIGUIUTILS_EXPORT KexiTimeFormatter //! converts string \a str to time using predefined settings //! \return invalid time if the conversion is impossible - QTime stringToTime( const QString& str ) const; + TQTime stringToTime( const TQString& str ) const; /*! Converts string \a str to time using predefined settings - and returns QVariant containing the time value. + and returns TQVariant containing the time value. This method does the same as stringToTime() but if \a string contains invalid time representation, e.g. contains only spaces - and separators, null QVariant() is returned. */ - QVariant stringToVariant( const QString& str ); + and separators, null TQVariant() is returned. */ + TQVariant stringToVariant( const TQString& str ); //! converts \a time to string using predefined settings //! \return null string if \a time is invalid - QString timeToString( const QTime& time ) const; + TQString timeToString( const TQTime& time ) const; - //! \return Input mask generated using the formatter settings. - //! Can be used in QLineEdit::setInputMask(). - QString inputMask() const { return m_inputMask; } + //! \return Input tqmask generated using the formatter settings. + //! Can be used in TQLineEdit::setInputMask(). + TQString inputMask() const { return m_inputMask; } //! \return true if \a str contains only spaces //! and separators according to the time format. - bool isEmpty( const QString& str ) const; + bool isEmpty( const TQString& str ) const; protected: - //! Input mask generated using the formatter settings. Can be used in QLineEdit::setInputMask(). - QString m_inputMask; + //! Input tqmask generated using the formatter settings. Can be used in TQLineEdit::setInputMask(). + TQString m_inputMask; // //! Order of date sections -// QDateEdit::Order m_order; +// TQDateEdit::Order m_order; //! 12 or 12h bool m_24h; @@ -132,34 +132,34 @@ class KEXIGUIUTILS_EXPORT KexiTimeFormatter bool m_hoursWithLeadingZero; //! Time format used in timeToString(). Notation from KLocale::setTimeFormat() is used. - QString m_outputFormat; + TQString m_outputFormat; - //! Used in stringToTime() to convert string back to QTime + //! Used in stringToTime() to convert string back to TQTime int m_hourpos, m_minpos, m_secpos, m_ampmpos; - QRegExp *m_hmsRegExp, *m_hmRegExp; + TQRegExp *m_hmsRegExp, *m_hmRegExp; }; -//! \return a date/time input mask using date and time formatter. +//! \return a date/time input tqmask using date and time formatter. //! Date is separated from time by one space character. -KEXIGUIUTILS_EXPORT QString dateTimeInputMask( +KEXIGUIUTILS_EXPORT TQString dateTimeInputMask( const KexiDateFormatter& dateFormatter, const KexiTimeFormatter& timeFormatter); -/*! \return a QDateTime value converted from string using \a dateFormatter and \a timeFormatter. +/*! \return a TQDateTime value converted from string using \a dateFormatter and \a timeFormatter. A single space between date and time is assumed. Invalid value is returned when \a str contains no valid date or \a str contains invalid time. Value with time equal 00:00:00 is returned if \a str contains empty time part. */ -KEXIGUIUTILS_EXPORT QDateTime stringToDateTime( - const KexiDateFormatter& dateFormatter, const KexiTimeFormatter& timeFormatter, const QString& str); +KEXIGUIUTILS_EXPORT TQDateTime stringToDateTime( + const KexiDateFormatter& dateFormatter, const KexiTimeFormatter& timeFormatter, const TQString& str); /*! \return true if \a str contains only spaces and separators according to formats provided by \a dateFormatter and \a timeFormatter. */ KEXIGUIUTILS_EXPORT bool dateTimeIsEmpty( const KexiDateFormatter& dateFormatter, - const KexiTimeFormatter& timeFormatter, const QString& str ); + const KexiTimeFormatter& timeFormatter, const TQString& str ); /*! \return true if \a str gives valid date/time value according to formats provided by \a dateFormatter and \a timeFormatter. */ KEXIGUIUTILS_EXPORT bool dateTimeIsValid( const KexiDateFormatter& dateFormatter, - const KexiTimeFormatter& timeFormatter, const QString& str ); + const KexiTimeFormatter& timeFormatter, const TQString& str ); #endif diff --git a/kexi/widget/utils/kexidisplayutils.cpp b/kexi/widget/utils/kexidisplayutils.cpp index c7d238b1..1943b086 100644 --- a/kexi/widget/utils/kexidisplayutils.cpp +++ b/kexi/widget/utils/kexidisplayutils.cpp @@ -19,19 +19,19 @@ #include "kexidisplayutils.h" -#include <qpixmap.h> -#include <qpainter.h> -#include <qimage.h> -#include <qwidget.h> +#include <tqpixmap.h> +#include <tqpainter.h> +#include <tqimage.h> +#include <tqwidget.h> #include <klocale.h> #include <kstaticdeleter.h> // a color for displaying default values or autonumbers -#define SPECIAL_TEXT_COLOR Qt::blue +#define SPECIAL_TEXT_COLOR TQt::blue -static KStaticDeleter<QPixmap> KexiDisplayUtils_autonum_deleter; -QPixmap* KexiDisplayUtils_autonum = 0; +static KStaticDeleter<TQPixmap> KexiDisplayUtils_autonum_deleter; +TQPixmap* KexiDisplayUtils_autonum = 0; static const unsigned int autonumber_png_len = 245; static const unsigned char autonumber_png_data[] = { @@ -56,8 +56,8 @@ static const unsigned char autonumber_png_data[] = { }; /* Generated by qembed */ -#include <qcstring.h> -#include <qdict.h> +#include <tqcstring.h> +#include <tqdict.h> static struct Embed { unsigned int size; const unsigned char *data; @@ -67,11 +67,11 @@ static struct Embed { { 0, 0, 0 } }; -QPixmap* getPix(int id) +TQPixmap* getPix(int id) { -// QByteArray ba; +// TQByteArray ba; // ba.setRawData( (char*)embed_vec[id].data, embed_vec[id].size ); - QPixmap *pix = new QPixmap(); + TQPixmap *pix = new TQPixmap(); pix->loadFromData( embed_vec[id].data, embed_vec[id].size ); return pix; } @@ -90,14 +90,14 @@ KexiDisplayUtils::DisplayParameters::DisplayParameters() { } -KexiDisplayUtils::DisplayParameters::DisplayParameters(QWidget *w) +KexiDisplayUtils::DisplayParameters::DisplayParameters(TQWidget *w) { - textColor = w->palette().active().foreground(); - selectedTextColor = w->palette().active().highlightedText(); + textColor = w->tqpalette().active().foreground(); + selectedTextColor = w->tqpalette().active().highlightedText(); font = w->font(); } -void KexiDisplayUtils::initDisplayForAutonumberSign(DisplayParameters& par, QWidget *widget) +void KexiDisplayUtils::initDisplayForAutonumberSign(DisplayParameters& par, TQWidget *widget) { initDisplayUtilsImages(); @@ -105,20 +105,20 @@ void KexiDisplayUtils::initDisplayForAutonumberSign(DisplayParameters& par, QWid par.selectedTextColor = SPECIAL_TEXT_COLOR; //hmm, unused anyway par.font = widget->font(); par.font.setItalic(true); - QFontMetrics fm(par.font); + TQFontMetrics fm(par.font); par.textWidth = fm.width(i18n("(autonumber)")); par.textHeight = fm.height(); } -void KexiDisplayUtils::initDisplayForDefaultValue(DisplayParameters& par, QWidget *widget) +void KexiDisplayUtils::initDisplayForDefaultValue(DisplayParameters& par, TQWidget *widget) { par.textColor = SPECIAL_TEXT_COLOR; - par.selectedTextColor = widget->palette().active().highlightedText(); + par.selectedTextColor = widget->tqpalette().active().highlightedText(); par.font = widget->font(); par.font.setItalic(true); } -void KexiDisplayUtils::paintAutonumberSign(const DisplayParameters& par, QPainter* painter, +void KexiDisplayUtils::paintAutonumberSign(const DisplayParameters& par, TQPainter* painter, int x, int y, int width, int height, int align, bool overrideColor) { painter->save(); @@ -128,37 +128,37 @@ void KexiDisplayUtils::paintAutonumberSign(const DisplayParameters& par, QPainte painter->setPen(par.textColor); // int text_x = x; - if (!(align & Qt::AlignVertical_Mask)) - align |= Qt::AlignVCenter; - if (!(align & Qt::AlignHorizontal_Mask)) - align |= Qt::AlignLeft; + if (!(align & TQt::AlignVertical_Mask)) + align |= TQt::AlignVCenter; + if (!(align & TQt::AlignHorizontal_Mask)) + align |= TQt::AlignLeft; int y_pixmap_pos = 0; - if (align & Qt::AlignVCenter) { - y_pixmap_pos = QMAX(0, y+1 + (height - KexiDisplayUtils_autonum->height())/2); + if (align & TQt::AlignVCenter) { + y_pixmap_pos = TQMAX(0, y+1 + (height - KexiDisplayUtils_autonum->height())/2); } - else if (align & Qt::AlignTop) { - y_pixmap_pos = y + QMAX(0, (par.textHeight - KexiDisplayUtils_autonum->height())/2); + else if (align & TQt::AlignTop) { + y_pixmap_pos = y + TQMAX(0, (par.textHeight - KexiDisplayUtils_autonum->height())/2); } - else if (align & Qt::AlignBottom) { + else if (align & TQt::AlignBottom) { y_pixmap_pos = y+1 + height - KexiDisplayUtils_autonum->height() - - QMAX(0, (par.textHeight - KexiDisplayUtils_autonum->height())/2); + - TQMAX(0, (par.textHeight - KexiDisplayUtils_autonum->height())/2); } - if (align & (Qt::AlignLeft | Qt::AlignJustify)) { + if (align & (TQt::AlignLeft | TQt::AlignJustify)) { // text_x = x + KexiDisplayUtils_autonum->width() + 2; if (!overrideColor) { painter->drawPixmap( x, y_pixmap_pos, *KexiDisplayUtils_autonum ); x += (KexiDisplayUtils_autonum->width() + 4); } } - else if (align & Qt::AlignRight) { + else if (align & TQt::AlignRight) { if (!overrideColor) { painter->drawPixmap( x + width - par.textWidth - KexiDisplayUtils_autonum->width() - 4, y_pixmap_pos, *KexiDisplayUtils_autonum ); } } - else if (align & Qt::AlignCenter) { + else if (align & TQt::AlignCenter) { //! @todo if (!overrideColor) painter->drawPixmap( x + (width - par.textWidth)/2 - KexiDisplayUtils_autonum->width() - 4, diff --git a/kexi/widget/utils/kexidisplayutils.h b/kexi/widget/utils/kexidisplayutils.h index 8790b662..9d4974cd 100644 --- a/kexi/widget/utils/kexidisplayutils.h +++ b/kexi/widget/utils/kexidisplayutils.h @@ -20,9 +20,9 @@ #ifndef KEXIDISPUTILS_H #define KEXIDISPUTILS_H -#include <qfont.h> -#include <qcolor.h> -class QWidget; +#include <tqfont.h> +#include <tqcolor.h> +class TQWidget; //! \brief A set of utilities related to displaying common elements in Kexi, like e.g. (autonumber) sign class KEXIGUIUTILS_EXPORT KexiDisplayUtils @@ -36,22 +36,22 @@ class KEXIGUIUTILS_EXPORT KexiDisplayUtils DisplayParameters(); //! Copies properties from \a w. - DisplayParameters(QWidget *w); + DisplayParameters(TQWidget *w); - QColor textColor, selectedTextColor; - QFont font; + TQColor textColor, selectedTextColor; + TQFont font; int textWidth, textHeight; //!< used for "(autonumber)" text only }; //! Initializes display parameters for autonumber sign - static void initDisplayForAutonumberSign(DisplayParameters& par, QWidget *widget); + static void initDisplayForAutonumberSign(DisplayParameters& par, TQWidget *widget); //! Paints autonumber sign using \a par parameters - static void paintAutonumberSign(const DisplayParameters& par, QPainter* painter, + static void paintAutonumberSign(const DisplayParameters& par, TQPainter* painter, int x, int y, int width, int height, int align, bool overrideColor = false); //! Initializes display parameters for default value - static void initDisplayForDefaultValue(DisplayParameters& par, QWidget *widget); + static void initDisplayForDefaultValue(DisplayParameters& par, TQWidget *widget); }; #endif diff --git a/kexi/widget/utils/kexidropdownbutton.cpp b/kexi/widget/utils/kexidropdownbutton.cpp index a17e5cfb..b2ed022e 100644 --- a/kexi/widget/utils/kexidropdownbutton.cpp +++ b/kexi/widget/utils/kexidropdownbutton.cpp @@ -22,22 +22,22 @@ #include <kpopupmenu.h> #include <kdebug.h> -#include <qstyle.h> -#include <qapplication.h> +#include <tqstyle.h> +#include <tqapplication.h> -KexiDropDownButton::KexiDropDownButton(QWidget *parent) - : QToolButton(parent, "KexiDBImageBox::Button") +KexiDropDownButton::KexiDropDownButton(TQWidget *tqparent) + : TQToolButton(tqparent, "KexiDBImageBox::Button") { - setSizePolicy(QSizePolicy::Preferred, QSizePolicy::Expanding); + tqsetSizePolicy(TQSizePolicy::Preferred, TQSizePolicy::Expanding); //! @todo get this from a KStyle -// setFixedWidth(QMAX(18, qApp->globalStrut().width())); +// setFixedWidth(TQMAX(18, tqApp->globalStrut().width())); int fixedWidth; //hack - if (qstricmp(style().name(),"thinkeramik")==0) + if (qstricmp(tqstyle().name(),"thinkeramik")==0) fixedWidth = 18; //typical width as in "windows" style else - fixedWidth = style().querySubControlMetrics( QStyle::CC_ComboBox, - this, QStyle::SC_ComboBoxArrow ).width(); + fixedWidth = tqstyle().querySubControlMetrics( TQStyle::CC_ComboBox, + this, TQStyle::SC_ComboBoxArrow ).width(); setFixedWidth( fixedWidth ); setPopupDelay(10/*ms*/); } @@ -46,37 +46,37 @@ KexiDropDownButton::~KexiDropDownButton() { } -void KexiDropDownButton::drawButton( QPainter *p ) +void KexiDropDownButton::drawButton( TQPainter *p ) { - QToolButton::drawButton(p); - QStyle::SFlags arrowFlags = QStyle::Style_Default; + TQToolButton::drawButton(p); + TQStyle::SFlags arrowFlags = TQStyle::Style_Default; if (isDown() || state()==On) - arrowFlags |= QStyle::Style_Down; + arrowFlags |= TQStyle::Style_Down; if (isEnabled()) - arrowFlags |= QStyle::Style_Enabled; - style().drawPrimitive(QStyle::PE_ArrowDown, p, - QRect((width()-7)/2, height()-9, 7, 7), colorGroup(), - arrowFlags, QStyleOption() ); + arrowFlags |= TQStyle::Style_Enabled; + tqstyle().tqdrawPrimitive(TQStyle::PE_ArrowDown, p, + TQRect((width()-7)/2, height()-9, 7, 7), tqcolorGroup(), + arrowFlags, TQStyleOption() ); } -QSize KexiDropDownButton::sizeHint () const +TQSize KexiDropDownButton::tqsizeHint () const { - return QSize( fontMetrics().maxWidth() + 2*2, fontMetrics().height()*2 + 2*2 ); + return TQSize( fontMetrics().maxWidth() + 2*2, fontMetrics().height()*2 + 2*2 ); } -void KexiDropDownButton::keyPressEvent( QKeyEvent * e ) +void KexiDropDownButton::keyPressEvent( TQKeyEvent * e ) { const int k = e->key(); - const bool dropDown = (e->state() == Qt::NoButton && (k==Qt::Key_Space || k==Qt::Key_Enter || k==Qt::Key_Return || k==Qt::Key_F2 || k==Qt::Key_F4)) - || (e->state() == Qt::AltButton && k==Qt::Key_Down); + const bool dropDown = (e->state() == Qt::NoButton && (k==TQt::Key_Space || k==TQt::Key_Enter || k==TQt::Key_Return || k==TQt::Key_F2 || k==TQt::Key_F4)) + || (e->state() == TQt::AltButton && k==TQt::Key_Down); if (dropDown) { e->accept(); animateClick(); - QMouseEvent me( QEvent::MouseButtonPress, QPoint(2,2), Qt::LeftButton, Qt::NoButton ); - QApplication::sendEvent( this, &me ); + TQMouseEvent me( TQEvent::MouseButtonPress, TQPoint(2,2), Qt::LeftButton, Qt::NoButton ); + TQApplication::sendEvent( this, &me ); return; } - QToolButton::keyPressEvent(e); + TQToolButton::keyPressEvent(e); } #include "kexidropdownbutton.moc" diff --git a/kexi/widget/utils/kexidropdownbutton.h b/kexi/widget/utils/kexidropdownbutton.h index fccbd409..a2d280a7 100644 --- a/kexi/widget/utils/kexidropdownbutton.h +++ b/kexi/widget/utils/kexidropdownbutton.h @@ -20,26 +20,27 @@ #ifndef KexiDropDownButton_H #define KexiDropDownButton_H -#include <qtoolbutton.h> -#include <qguardedptr.h> +#include <tqtoolbutton.h> +#include <tqguardedptr.h> //! @short A button for drop-down "Image" menu /*! Used in KexiDBImageBox and KexiBlobTableEdit. Additionally, the button reacts on pressing space, return, enter, F2, F4 and alt+down buttons. */ -class KEXIGUIUTILS_EXPORT KexiDropDownButton : public QToolButton +class KEXIGUIUTILS_EXPORT KexiDropDownButton : public TQToolButton { Q_OBJECT + TQ_OBJECT public: - KexiDropDownButton(QWidget *parent); + KexiDropDownButton(TQWidget *tqparent); virtual ~KexiDropDownButton(); - virtual void drawButton( QPainter *p ); + virtual void drawButton( TQPainter *p ); - virtual QSize sizeHint () const; + virtual TQSize tqsizeHint () const; - virtual void keyPressEvent ( QKeyEvent * e ); + virtual void keyPressEvent ( TQKeyEvent * e ); }; #endif diff --git a/kexi/widget/utils/kexiflowlayout.cpp b/kexi/widget/utils/kexiflowlayout.cpp index b8a8601e..d7150c6b 100644 --- a/kexi/widget/utils/kexiflowlayout.cpp +++ b/kexi/widget/utils/kexiflowlayout.cpp @@ -23,20 +23,20 @@ /// Iterator class -class KexiFlowLayoutIterator : public QGLayoutIterator +class KexiFlowLayoutIterator : public TQGLayoutIterator { public: - KexiFlowLayoutIterator( QPtrList<QLayoutItem> *list ) + KexiFlowLayoutIterator( TQPtrList<TQLayoutItem> *list ) : m_idx(0), m_list( list ) {} uint count() const; - QLayoutItem *current(); - QLayoutItem *next(); - QLayoutItem *takeCurrent(); + TQLayoutItem *current(); + TQLayoutItem *next(); + TQLayoutItem *takeCurrent(); private: int m_idx; - QPtrList<QLayoutItem> *m_list; + TQPtrList<TQLayoutItem> *m_list; }; uint @@ -45,47 +45,47 @@ KexiFlowLayoutIterator::count() const return m_list->count(); } -QLayoutItem * +TQLayoutItem * KexiFlowLayoutIterator::current() { return (m_idx < (int)count()) ? m_list->at(m_idx) : 0; } -QLayoutItem * +TQLayoutItem * KexiFlowLayoutIterator::next() { m_idx++; return current(); } -QLayoutItem * +TQLayoutItem * KexiFlowLayoutIterator::takeCurrent() { return (m_idx < (int)count()) ? m_list->take(m_idx) : 0; } -//// The layout itself +//// The tqlayout itself -KexiFlowLayout::KexiFlowLayout(QWidget *parent, int border, int space, const char *name) - : QLayout(parent, border, space, name) +KexiFlowLayout::KexiFlowLayout(TQWidget *tqparent, int border, int space, const char *name) + : TQLayout(tqparent, border, space, name) { - m_orientation = Horizontal; + m_orientation =Qt::Horizontal; m_justify = false; m_cached_width = 0; } -KexiFlowLayout::KexiFlowLayout(QLayout* parent, int space, const char *name) - : QLayout( parent, space, name ) +KexiFlowLayout::KexiFlowLayout(TQLayout* tqparent, int space, const char *name) + : TQLayout( tqparent, space, name ) { - m_orientation = Horizontal; + m_orientation =Qt::Horizontal; m_justify = false; m_cached_width = 0; } KexiFlowLayout::KexiFlowLayout(int space, const char *name) - : QLayout(space, name) + : TQLayout(space, name) { - m_orientation = Horizontal; + m_orientation =Qt::Horizontal; m_justify = false; m_cached_width = 0; } @@ -98,29 +98,35 @@ KexiFlowLayout::~KexiFlowLayout() void KexiFlowLayout::addItem(QLayoutItem *item) { - m_list.append(item); + m_list.append(TQT_TQLAYOUTITEM(item)); } void KexiFlowLayout::addSpacing(int size) { - if (m_orientation == Horizontal) - addItem( new QSpacerItem( size, 0, QSizePolicy::Fixed, QSizePolicy::Minimum ) ); + if (m_orientation ==Qt::Horizontal) + addItem( TQT_TQLAYOUTITEM(new TQSpacerItem( size, 0, TQSizePolicy::Fixed, TQSizePolicy::Minimum )) ); else - addItem( new QSpacerItem( 0, size, QSizePolicy::Minimum, QSizePolicy::Fixed ) ); + addItem( TQT_TQLAYOUTITEM(new TQSpacerItem( 0, size, TQSizePolicy::Minimum, TQSizePolicy::Fixed )) ); } -QLayoutIterator +TQLayoutIterator KexiFlowLayout::iterator() { - return QLayoutIterator( new KexiFlowLayoutIterator(&m_list) ); + // [FIXME] +#ifdef USE_QT4 + #warning [FIXME] ContainerAreaLayout iterators may not function correctly under Qt4 + return TQLayoutIterator( this ); // [FIXME] +#else // USE_QT4 + return TQLayoutIterator( new KexiFlowLayoutIterator(&m_list) ); +#endif // USE_QT4 } -QPtrList<QWidget>* +TQPtrList<TQWidget>* KexiFlowLayout::widgetList() const { - QPtrList<QWidget> *list = new QPtrList<QWidget>(); - for (QPtrListIterator<QLayoutItem> it(m_list); it.current(); ++it) { + TQPtrList<TQWidget> *list = new TQPtrList<TQWidget>(); + for (TQPtrListIterator<TQLayoutItem> it(m_list); it.current(); ++it) { if(it.current()->widget()) list->append(it.current()->widget()); } @@ -128,11 +134,11 @@ KexiFlowLayout::widgetList() const } void -KexiFlowLayout::invalidate() +KexiFlowLayout::tqinvalidate() { - QLayout::invalidate(); - m_cached_sizeHint = QSize(); - m_cached_minSize = QSize(); + TQLayout::tqinvalidate(); + m_cached_tqsizeHint = TQSize(); + m_cached_minSize = TQSize(); m_cached_width = 0; } @@ -145,7 +151,7 @@ KexiFlowLayout::isEmpty() bool KexiFlowLayout::hasHeightForWidth() const { - return (m_orientation == Horizontal); + return (m_orientation ==Qt::Horizontal); } int @@ -154,7 +160,7 @@ KexiFlowLayout::heightForWidth(int w) const if(m_cached_width != w) { // workaround to allow this method to stay 'const' KexiFlowLayout *mthis = (KexiFlowLayout*)this; - int h = mthis->simulateLayout( QRect(0,0,w,0) ); + int h = mthis->simulateLayout( TQRect(0,0,w,0) ); mthis->m_cached_hfw = h; mthis->m_cached_width = w; return h; @@ -162,73 +168,73 @@ KexiFlowLayout::heightForWidth(int w) const return m_cached_hfw; } -QSize -KexiFlowLayout::sizeHint() const +TQSize +KexiFlowLayout::tqsizeHint() const { - if(m_cached_sizeHint.isEmpty()) { + if(m_cached_tqsizeHint.isEmpty()) { KexiFlowLayout *mthis = (KexiFlowLayout*)this; - QRect r = QRect(0, 0, 2000, 2000); + TQRect r = TQRect(0, 0, 2000, 2000); mthis->simulateLayout(r); } - return m_cached_sizeHint; + return m_cached_tqsizeHint; } -QSize -KexiFlowLayout::minimumSize() const +TQSize +KexiFlowLayout::tqminimumSize() const { -//js: do we really need to simulate layout here? -// I commented this out because it was impossible to stretch layout conveniently. -// Now, minimum size is computed automatically based on item's minimumSize... +//js: do we really need to simulate tqlayout here? +// I commented this out because it was impossible to stretch tqlayout conveniently. +// Now, minimum size is computed automatically based on item's tqminimumSize... #if 0 if(m_cached_minSize.isEmpty()) { KexiFlowLayout *mthis = (KexiFlowLayout*)this; - QRect r = QRect(0, 0, 2000, 2000); + TQRect r = TQRect(0, 0, 2000, 2000); mthis->simulateLayout(r); } #endif return m_cached_minSize; } -QSizePolicy::ExpandData +TQSizePolicy::ExpandData KexiFlowLayout::expanding() const { - if(m_orientation == Vertical) - return QSizePolicy::Vertically; + if(m_orientation == Qt::Vertical) + return TQ_SPVertically; else - return QSizePolicy::Horizontally; + return TQ_SPHorizontally; } void -KexiFlowLayout::setGeometry(const QRect &r) +KexiFlowLayout::setGeometry(const TQRect &r) { - QLayout::setGeometry(r); - if(m_orientation == Horizontal) + TQLayout::setGeometry(r); + if(m_orientation ==Qt::Horizontal) doHorizontalLayout(r); else doVerticalLayout(r); } int -KexiFlowLayout::simulateLayout(const QRect &r) +KexiFlowLayout::simulateLayout(const TQRect &r) { - if(m_orientation == Horizontal) + if(m_orientation ==Qt::Horizontal) return doHorizontalLayout(r, true); else return doVerticalLayout(r, true); } int -KexiFlowLayout::doHorizontalLayout(const QRect &r, bool testOnly) +KexiFlowLayout::doHorizontalLayout(const TQRect &r, bool testOnly) { int x = r.x(); int y = r.y(); int h = 0; // height of this line int availableSpace = r.width() + spacing(); - int expandingWidgets=0; // number of widgets in the line with QSizePolicy == Expanding - QPtrListIterator<QLayoutItem> it(m_list); - QPtrList<QLayoutItem> currentLine; - QLayoutItem *o; - QSize minSize, sizeHint(20, 20); + int expandingWidgets=0; // number of widgets in the line with TQSizePolicy == Expanding + TQPtrListIterator<TQLayoutItem> it(m_list); + TQPtrList<TQLayoutItem> currentLine; + TQLayoutItem *o; + TQSize minSize, tqsizeHint(20, 20); int minSizeHeight = 0 - spacing(); while ( (o = it.current()) != 0 ) { @@ -238,41 +244,41 @@ KexiFlowLayout::doHorizontalLayout(const QRect &r, bool testOnly) } // kdDebug() << "- doHorizontalLayout(): " << o->widget()->className() << " " << o->widget()->name() << endl; - QSize oSizeHint = o->sizeHint(); // we cache these ones because it can take a while to get it (eg for child layouts) + TQSize oSizeHint = o->tqsizeHint(); // we cache these ones because it can take a while to get it (eg for child tqlayouts) if ((x + oSizeHint.width()) > r.right() && h > 0) { - // do the layout of current line - QPtrListIterator<QLayoutItem> it2(currentLine); - QLayoutItem *item; + // do the tqlayout of current line + TQPtrListIterator<TQLayoutItem> it2(currentLine); + TQLayoutItem *item; int wx = r.x(); - int sizeHintWidth = 0 -spacing(), minSizeWidth=0 - spacing(), lineMinHeight=0; + int tqsizeHintWidth = 0 -spacing(), minSizeWidth=0 - spacing(), lineMinHeight=0; while( (item = it2.current()) != 0 ) { - QSize itemSizeHint = item->sizeHint(); // we cache these ones because it can take - QSize itemMinSize = item->minimumSize(); // a while to get them - QSize s; + TQSize itemSizeHint = item->tqsizeHint(); // we cache these ones because it can take + TQSize itemMinSize = item->tqminimumSize(); // a while to get them + TQSize s; if(m_justify) { if(expandingWidgets != 0) { - if(item->expanding() == QSizePolicy::Horizontally || item->expanding() == QSizePolicy::BothDirections) - s = QSize( QMIN(itemSizeHint.width() + availableSpace / expandingWidgets + if(item->expandingDirections() == TQSizePolicy::Horizontally || item->expandingDirections() == TQSizePolicy::BothDirections) + s = TQSize( TQMIN(itemSizeHint.width() + availableSpace / expandingWidgets , r.width()), itemSizeHint.height() ); else - s = QSize( QMIN(itemSizeHint.width(), r.width()), itemSizeHint.height() ); + s = TQSize( TQMIN(itemSizeHint.width(), r.width()), itemSizeHint.height() ); } else - s = QSize( QMIN(itemSizeHint.width() + availableSpace / (int)currentLine.count() + s = TQSize( TQMIN(itemSizeHint.width() + availableSpace / (int)currentLine.count() , r.width()), itemSizeHint.height() ); } else - s = QSize ( QMIN(itemSizeHint.width(), r.width()), itemSizeHint.height() ); + s = TQSize ( TQMIN(itemSizeHint.width(), r.width()), itemSizeHint.height() ); if(!testOnly) - item->setGeometry( QRect(QPoint(wx, y), s) ); + item->setGeometry( TQRect(TQPoint(wx, y), s) ); wx = wx + s.width() + spacing(); minSizeWidth = minSizeWidth + spacing() + itemMinSize.width(); - sizeHintWidth = sizeHintWidth + spacing() + itemSizeHint.width(); - lineMinHeight = QMAX( lineMinHeight, itemMinSize.height() ); + tqsizeHintWidth = tqsizeHintWidth + spacing() + itemSizeHint.width(); + lineMinHeight = TQMAX( lineMinHeight, itemMinSize.height() ); ++it2; } - sizeHint = sizeHint.expandedTo( QSize(sizeHintWidth, 0) ); - minSize = minSize.expandedTo( QSize(minSizeWidth, 0) ); + tqsizeHint = tqsizeHint.expandedTo( TQSize(tqsizeHintWidth, 0) ); + minSize = minSize.expandedTo( TQSize(minSizeWidth, 0) ); minSizeHeight = minSizeHeight + spacing() + lineMinHeight; // start a new line y = y + spacing() + h; @@ -284,68 +290,68 @@ KexiFlowLayout::doHorizontalLayout(const QRect &r, bool testOnly) } x = x + spacing() + oSizeHint.width(); - h = QMAX( h, oSizeHint.height() ); + h = TQMAX( h, oSizeHint.height() ); currentLine.append(o); - if(o->expanding() == QSizePolicy::Horizontally || o->expanding() == QSizePolicy::BothDirections) + if(o->expandingDirections() == TQSizePolicy::Horizontally || o->expandingDirections() == TQSizePolicy::BothDirections) ++expandingWidgets; - availableSpace = QMAX(0, availableSpace - spacing() - oSizeHint.width()); + availableSpace = TQMAX(0, availableSpace - spacing() - oSizeHint.width()); ++it; } - // don't forget to layout the last line - QPtrListIterator<QLayoutItem> it2(currentLine); - QLayoutItem *item; + // don't forget to tqlayout the last line + TQPtrListIterator<TQLayoutItem> it2(currentLine); + TQLayoutItem *item; int wx = r.x(); - int sizeHintWidth = 0 -spacing(), minSizeWidth=0 - spacing(), lineMinHeight=0; + int tqsizeHintWidth = 0 -spacing(), minSizeWidth=0 - spacing(), lineMinHeight=0; while( (item = it2.current()) != 0 ) { - QSize itemSizeHint = item->sizeHint(); // we cache these ones because it can take - QSize itemMinSize = item->minimumSize(); // a while to get them - QSize s; + TQSize itemSizeHint = item->tqsizeHint(); // we cache these ones because it can take + TQSize itemMinSize = item->tqminimumSize(); // a while to get them + TQSize s; if(m_justify) { if(expandingWidgets != 0) { - if(item->expanding() == QSizePolicy::Horizontally || item->expanding() == QSizePolicy::BothDirections) - s = QSize( QMIN(itemSizeHint.width() + availableSpace / expandingWidgets + if(item->expandingDirections() == TQSizePolicy::Horizontally || item->expandingDirections() == TQSizePolicy::BothDirections) + s = TQSize( TQMIN(itemSizeHint.width() + availableSpace / expandingWidgets , r.width()), itemSizeHint.height() ); else - s = QSize( QMIN(itemSizeHint.width(), r.width()), itemSizeHint.height() ); + s = TQSize( TQMIN(itemSizeHint.width(), r.width()), itemSizeHint.height() ); } else - s = QSize( QMIN(itemSizeHint.width() + availableSpace / (int)currentLine.count() + s = TQSize( TQMIN(itemSizeHint.width() + availableSpace / (int)currentLine.count() , r.width()), itemSizeHint.height() ); } else - s = QSize ( QMIN(itemSizeHint.width(), r.width()), itemSizeHint.height() ); + s = TQSize ( TQMIN(itemSizeHint.width(), r.width()), itemSizeHint.height() ); if(!testOnly) - item->setGeometry( QRect(QPoint(wx, y), s) ); + item->setGeometry( TQRect(TQPoint(wx, y), s) ); wx = wx + s.width() + spacing(); minSizeWidth = minSizeWidth + spacing() + itemMinSize.width(); - sizeHintWidth = sizeHintWidth + spacing() + itemSizeHint.width(); - lineMinHeight = QMAX( lineMinHeight, itemMinSize.height() ); + tqsizeHintWidth = tqsizeHintWidth + spacing() + itemSizeHint.width(); + lineMinHeight = TQMAX( lineMinHeight, itemMinSize.height() ); ++it2; } - sizeHint = sizeHint.expandedTo( QSize(sizeHintWidth, y + spacing() + h) ); + tqsizeHint = tqsizeHint.expandedTo( TQSize(tqsizeHintWidth, y + spacing() + h) ); minSizeHeight = minSizeHeight + spacing() + lineMinHeight; - minSize = minSize.expandedTo( QSize(minSizeWidth, minSizeHeight) ); + minSize = minSize.expandedTo( TQSize(minSizeWidth, minSizeHeight) ); - // store sizeHint() and minimumSize() - m_cached_sizeHint = sizeHint + QSize(2* margin(), 2*margin()); - m_cached_minSize = minSize + QSize(2* margin() , 2*margin()); + // store tqsizeHint() and tqminimumSize() + m_cached_tqsizeHint = tqsizeHint + TQSize(2* margin(), 2*margin()); + m_cached_minSize = minSize + TQSize(2* margin() , 2*margin()); // return our height return y + h - r.y(); } int -KexiFlowLayout::doVerticalLayout(const QRect &r, bool testOnly) +KexiFlowLayout::doVerticalLayout(const TQRect &r, bool testOnly) { int x = r.x(); int y = r.y(); int w = 0; // width of this line int availableSpace = r.height() + spacing(); - int expandingWidgets=0; // number of widgets in the line with QSizePolicy == Expanding - QPtrListIterator<QLayoutItem> it(m_list); - QPtrList<QLayoutItem> currentLine; - QLayoutItem *o; - QSize minSize, sizeHint(20, 20); + int expandingWidgets=0; // number of widgets in the line with TQSizePolicy == Expanding + TQPtrListIterator<TQLayoutItem> it(m_list); + TQPtrList<TQLayoutItem> currentLine; + TQLayoutItem *o; + TQSize minSize, tqsizeHint(20, 20); int minSizeWidth = 0 - spacing(); while ( (o = it.current()) != 0 ) { @@ -354,41 +360,41 @@ KexiFlowLayout::doVerticalLayout(const QRect &r, bool testOnly) continue; } - QSize oSizeHint = o->sizeHint(); // we cache these ones because it can take a while to get it (eg for child layouts) + TQSize oSizeHint = o->tqsizeHint(); // we cache these ones because it can take a while to get it (eg for child tqlayouts) if (y + oSizeHint.height() > r.bottom() && w > 0) { - // do the layout of current line - QPtrListIterator<QLayoutItem> it2(currentLine); - QLayoutItem *item; + // do the tqlayout of current line + TQPtrListIterator<TQLayoutItem> it2(currentLine); + TQLayoutItem *item; int wy = r.y(); - int sizeHintHeight = 0 - spacing(), minSizeHeight = 0 - spacing(), colMinWidth=0; + int tqsizeHintHeight = 0 - spacing(), minSizeHeight = 0 - spacing(), colMinWidth=0; while( (item = it2.current()) != 0 ) { - QSize itemSizeHint = item->sizeHint(); // we cache these ones because it can take - QSize itemMinSize = item->minimumSize(); // a while to get them - QSize s; + TQSize itemSizeHint = item->tqsizeHint(); // we cache these ones because it can take + TQSize itemMinSize = item->tqminimumSize(); // a while to get them + TQSize s; if(m_justify) { if(expandingWidgets != 0) { - if(item->expanding() == QSizePolicy::Vertically || item->expanding() == QSizePolicy::BothDirections) - s = QSize( itemSizeHint.width(), QMIN(itemSizeHint.height() + availableSpace / expandingWidgets + if(item->expandingDirections() == TQSizePolicy::Vertically || item->expandingDirections() == TQSizePolicy::BothDirections) + s = TQSize( itemSizeHint.width(), TQMIN(itemSizeHint.height() + availableSpace / expandingWidgets , r.height()) ); else - s = QSize( itemSizeHint.width(), QMIN(itemSizeHint.height(), r.height()) ); + s = TQSize( itemSizeHint.width(), TQMIN(itemSizeHint.height(), r.height()) ); } else - s = QSize( itemSizeHint.width(), QMIN(itemSizeHint.height() + availableSpace / (int)currentLine.count() + s = TQSize( itemSizeHint.width(), TQMIN(itemSizeHint.height() + availableSpace / (int)currentLine.count() , r.height()) ); } else - s = QSize ( itemSizeHint.width(), QMIN(itemSizeHint.height(), r.height()) ); + s = TQSize ( itemSizeHint.width(), TQMIN(itemSizeHint.height(), r.height()) ); if(!testOnly) - item->setGeometry( QRect(QPoint(x, wy), s) ); + item->setGeometry( TQRect(TQPoint(x, wy), s) ); wy = wy + s.height() + spacing(); minSizeHeight = minSizeHeight + spacing() + itemMinSize.height(); - sizeHintHeight = sizeHintHeight + spacing() + itemSizeHint.height(); - colMinWidth = QMAX( colMinWidth, itemMinSize.width() ); + tqsizeHintHeight = tqsizeHintHeight + spacing() + itemSizeHint.height(); + colMinWidth = TQMAX( colMinWidth, itemMinSize.width() ); ++it2; } - sizeHint = sizeHint.expandedTo( QSize(0, sizeHintHeight) ); - minSize = minSize.expandedTo( QSize(0, minSizeHeight) ); + tqsizeHint = tqsizeHint.expandedTo( TQSize(0, tqsizeHintHeight) ); + minSize = minSize.expandedTo( TQSize(0, minSizeHeight) ); minSizeWidth = minSizeWidth + spacing() + colMinWidth; // start a new column x = x + spacing() + w; @@ -400,53 +406,82 @@ KexiFlowLayout::doVerticalLayout(const QRect &r, bool testOnly) } y = y + spacing() + oSizeHint.height(); - w = QMAX( w, oSizeHint.width() ); + w = TQMAX( w, oSizeHint.width() ); currentLine.append(o); - if(o->expanding() == QSizePolicy::Vertically || o->expanding() == QSizePolicy::BothDirections) + if(o->expandingDirections() == TQSizePolicy::Vertically || o->expandingDirections() == TQSizePolicy::BothDirections) ++expandingWidgets; - availableSpace = QMAX(0, availableSpace - spacing() - oSizeHint.height()); + availableSpace = TQMAX(0, availableSpace - spacing() - oSizeHint.height()); ++it; } - // don't forget to layout the last line - QPtrListIterator<QLayoutItem> it2(currentLine); - QLayoutItem *item; + // don't forget to tqlayout the last line + TQPtrListIterator<TQLayoutItem> it2(currentLine); + TQLayoutItem *item; int wy = r.y(); - int sizeHintHeight = 0 - spacing(), minSizeHeight = 0 - spacing(), colMinWidth=0; + int tqsizeHintHeight = 0 - spacing(), minSizeHeight = 0 - spacing(), colMinWidth=0; while( (item = it2.current()) != 0 ) { - QSize itemSizeHint = item->sizeHint(); // we cache these ones because it can take - QSize itemMinSize = item->minimumSize(); // a while to get them - QSize s; + TQSize itemSizeHint = item->tqsizeHint(); // we cache these ones because it can take + TQSize itemMinSize = item->tqminimumSize(); // a while to get them + TQSize s; if(m_justify) { if(expandingWidgets != 0) { - if(item->expanding() == QSizePolicy::Vertically || item->expanding() == QSizePolicy::BothDirections) - s = QSize( itemSizeHint.width(), QMIN(itemSizeHint.height() + availableSpace / expandingWidgets + if(item->expandingDirections() == TQSizePolicy::Vertically || item->expandingDirections() == TQSizePolicy::BothDirections) + s = TQSize( itemSizeHint.width(), TQMIN(itemSizeHint.height() + availableSpace / expandingWidgets , r.height()) ); else - s = QSize( itemSizeHint.width(), QMIN(itemSizeHint.height(), r.height()) ); + s = TQSize( itemSizeHint.width(), TQMIN(itemSizeHint.height(), r.height()) ); } else - s = QSize( itemSizeHint.width(), QMIN(itemSizeHint.height() + availableSpace / (int)currentLine.count() + s = TQSize( itemSizeHint.width(), TQMIN(itemSizeHint.height() + availableSpace / (int)currentLine.count() , r.height()) ); } else - s = QSize ( itemSizeHint.width(), QMIN(itemSizeHint.height(), r.height()) ); + s = TQSize ( itemSizeHint.width(), TQMIN(itemSizeHint.height(), r.height()) ); if(!testOnly) - item->setGeometry( QRect(QPoint(x, wy), s) ); + item->setGeometry( TQRect(TQPoint(x, wy), s) ); wy = wy + s.height() + spacing(); minSizeHeight = minSizeHeight + spacing() + itemMinSize.height(); - sizeHintHeight = sizeHintHeight + spacing() + itemSizeHint.height(); - colMinWidth = QMAX( colMinWidth, itemMinSize.width() ); + tqsizeHintHeight = tqsizeHintHeight + spacing() + itemSizeHint.height(); + colMinWidth = TQMAX( colMinWidth, itemMinSize.width() ); ++it2; } - sizeHint = sizeHint.expandedTo( QSize( x + spacing() + w, sizeHintHeight) ); + tqsizeHint = tqsizeHint.expandedTo( TQSize( x + spacing() + w, tqsizeHintHeight) ); minSizeWidth = minSizeWidth + spacing() + colMinWidth; - minSize = minSize.expandedTo( QSize(minSizeWidth, minSizeHeight) ); + minSize = minSize.expandedTo( TQSize(minSizeWidth, minSizeHeight) ); - // store sizeHint() and minimumSize() - m_cached_sizeHint = sizeHint + QSize(2* margin(), 2*margin()); - m_cached_minSize = minSize + QSize(2* margin(), 2*margin()); + // store tqsizeHint() and tqminimumSize() + m_cached_tqsizeHint = tqsizeHint + TQSize(2* margin(), 2*margin()); + m_cached_minSize = minSize + TQSize(2* margin(), 2*margin()); // return our width return x + w - r.x(); } +#ifdef USE_QT4 +/*! + \reimp +*/ +int KexiFlowLayout::count() const { + return m_list.count(); +} + +/*! + \reimp +*/ +TQLayoutItem* KexiFlowLayout::itemAt(int index) const { + return index >= 0 && index < m_list.count() ? (const_cast<TQPtrList<TQLayoutItem>&>(m_list).tqat(index)) : 0; +} + +/*! + \reimp +*/ +TQLayoutItem* KexiFlowLayout::takeAt(int index) { + if (index < 0 || index >= m_list.count()) + return 0; + TQLayoutItem *item = m_list.tqat(index); + m_list.remove(m_list.tqat(index)); + delete item; + + invalidate(); + return item; +} +#endif // USE_QT4
\ No newline at end of file diff --git a/kexi/widget/utils/kexiflowlayout.h b/kexi/widget/utils/kexiflowlayout.h index 173ddad5..e410fb83 100644 --- a/kexi/widget/utils/kexiflowlayout.h +++ b/kexi/widget/utils/kexiflowlayout.h @@ -20,27 +20,27 @@ #ifndef KEXIFLOWLAYOUT_H #define KEXIFLOWLAYOUT_H -#include <qlayout.h> -#include <qptrlist.h> +#include <tqlayout.h> +#include <tqptrlist.h> -//! @short a special "flow" layout -class KEXIGUIUTILS_EXPORT KexiFlowLayout : public QLayout +//! @short a special "flow" tqlayout +class KEXIGUIUTILS_EXPORT KexiFlowLayout : public TQLayout { public: - KexiFlowLayout(QWidget *parent, int border=0, int space=-1, const char *name=0); - KexiFlowLayout(QLayout* parent, int space=-1, const char *name=0); + KexiFlowLayout(TQWidget *tqparent, int border=0, int space=-1, const char *name=0); + KexiFlowLayout(TQLayout* tqparent, int space=-1, const char *name=0); KexiFlowLayout(int space=-1, const char *name=0); ~KexiFlowLayout(); - /*! \return the widgets in the order of the layout, + /*! \return the widgets in the order of the tqlayout, ie as it is stored in m_list. You must delete the list after using it. */ - QPtrList<QWidget>* widgetList() const; + TQPtrList<TQWidget>* widgetList() const; - /*! Sets layout's orientation to \a orientation. Default orientation is Vertical. */ - void setOrientation(Orientation orientation) { m_orientation = orientation; } + /*! Sets tqlayout's orientation to \a orientation. Default orientation isQt::Vertical. */ + void setOrientation(Qt::Orientation orientation) { m_orientation = orientation; } - /*! \return layout's orientation. */ + /*! \return tqlayout's orientation. */ Qt::Orientation orientation() const { return m_orientation; } void setJustified(bool justify) { m_justify = justify; } @@ -48,31 +48,35 @@ class KEXIGUIUTILS_EXPORT KexiFlowLayout : public QLayout virtual void addItem(QLayoutItem *item); virtual void addSpacing(int size); - virtual QLayoutIterator iterator(); - virtual void invalidate(); + virtual TQLayoutIterator iterator(); + virtual void tqinvalidate(); virtual bool hasHeightForWidth() const; virtual int heightForWidth(int width) const; - virtual QSize sizeHint() const; - virtual QSize minimumSize() const; - virtual QSizePolicy::ExpandData expanding() const; + virtual TQSize tqsizeHint() const; + virtual TQSize tqminimumSize() const; + virtual TQSizePolicy::ExpandData expanding() const; virtual bool isEmpty(); +#ifdef USE_QT4 + QLAYOUT_REQUIRED_METHOD_DECLARATIONS +#endif // USE_QT4 + protected: - virtual void setGeometry(const QRect&); - int simulateLayout(const QRect &r); - int doHorizontalLayout(const QRect&, bool testonly = false); - int doVerticalLayout(const QRect&, bool testonly = false); + virtual void setGeometry(const TQRect&); + int simulateLayout(const TQRect &r); + int doHorizontalLayout(const TQRect&, bool testonly = false); + int doVerticalLayout(const TQRect&, bool testonly = false); private: - QPtrList<QLayoutItem> m_list; + TQPtrList<TQLayoutItem> m_list; int m_cached_width; int m_cached_hfw; bool m_justify; - Orientation m_orientation; - QSize m_cached_sizeHint; - QSize m_cached_minSize; + Qt::Orientation m_orientation; + TQSize m_cached_tqsizeHint; + TQSize m_cached_minSize; }; #endif diff --git a/kexi/widget/utils/kexigradientwidget.cpp b/kexi/widget/utils/kexigradientwidget.cpp index 0411318d..2a1a3ba3 100644 --- a/kexi/widget/utils/kexigradientwidget.cpp +++ b/kexi/widget/utils/kexigradientwidget.cpp @@ -17,30 +17,30 @@ * Boston, MA 02110-1301, USA. */ -#include <qapplication.h> -#include <qbitmap.h> -#include <qimage.h> -#include <qobjectlist.h> -#include <qpainter.h> -#include <qstyle.h> +#include <tqapplication.h> +#include <tqbitmap.h> +#include <tqimage.h> +#include <tqobjectlist.h> +#include <tqpainter.h> +#include <tqstyle.h> #include <kimageeffect.h> #include <kpixmap.h> #include "kexigradientwidget.h" -KexiGradientWidget::KexiGradientWidget( QWidget *parent, const char *name, WFlags f ) - : QWidget( parent, name, f ), p_displayMode( NoGradient ), +KexiGradientWidget::KexiGradientWidget( TQWidget *tqparent, const char *name, WFlags f ) + : TQWidget( tqparent, name, f ), p_displayMode( NoGradient ), p_gradientType( VerticalGradient ), - p_color1( Qt::white ), p_color2( Qt::blue ), p_currentChild( 0 ), + p_color1( TQt::white ), p_color2( TQt::blue ), p_currentChild( 0 ), p_opacity( 0.5 ), p_cacheDirty( true ) { p_customBackgroundWidgets.setAutoDelete( false ); p_knownWidgets.setAutoDelete( false ); - p_backgroundColor = QWidget::paletteBackgroundColor(); + p_backgroundColor = TQWidget::paletteBackgroundColor(); - connect ( &p_rebuildDelayTimer, SIGNAL( timeout() ), this, SLOT( setCacheDirty() ) ); + connect ( &p_rebuildDelayTimer, TQT_SIGNAL( timeout() ), this, TQT_SLOT( setCacheDirty() ) ); installEventFilter( this ); } @@ -49,17 +49,17 @@ KexiGradientWidget::~KexiGradientWidget() { } -bool KexiGradientWidget::isValidChildWidget( QObject* child ) { - const QWidget* wgt = dynamic_cast<QWidget*>( child ); +bool KexiGradientWidget::isValidChildWidget( TQObject* child ) { + const TQWidget* wgt = dynamic_cast<TQWidget*>( child ); if ( wgt == 0L ) return false; - if ( wgt->inherits( "QScrollView" ) ) + if ( wgt->inherits( TQSCROLLVIEW_OBJECT_NAME_STRING ) ) return false; - if ( wgt->inherits( "QComboBox" ) ) + if ( wgt->inherits( TQCOMBOBOX_OBJECT_NAME_STRING ) ) return false; - if ( wgt->inherits( "QLineEdit" ) ) + if ( wgt->inherits( TQLINEEDIT_OBJECT_NAME_STRING ) ) return false; if ( wgt->inherits( "KexiDBForm" ) ) return false; @@ -67,14 +67,14 @@ bool KexiGradientWidget::isValidChildWidget( QObject* child ) { return true; } -void KexiGradientWidget::buildChildrenList( WidgetList& list, QWidget* p ) { - QObjectList* objects = p->queryList( "QWidget", 0, false, false ); +void KexiGradientWidget::buildChildrenList( WidgetList& list, TQWidget* p ) { + TQObjectList* objects = p->queryList( TQWIDGET_OBJECT_NAME_STRING, 0, false, false ); - for ( QObjectList::Iterator it = objects->begin(); it != objects->end(); ++it ) { + for ( TQObjectList::Iterator it = objects->begin(); it != objects->end(); ++it ) { if ( isValidChildWidget( ( *it ) ) == false ) continue; - list.append( dynamic_cast<QWidget*>( ( *it ) ) ); - buildChildrenList( list, dynamic_cast<QWidget*>( ( *it ) ) ); + list.append( dynamic_cast<TQWidget*>( ( *it ) ) ); + buildChildrenList( list, dynamic_cast<TQWidget*>( ( *it ) ) ); } delete objects; @@ -85,20 +85,20 @@ void KexiGradientWidget::rebuildCache( void ) { buildChildrenList( childWidgetList, this ); /** - Disable the effect and behave like a normal QWidget. + Disable the effect and behave like a normal TQWidget. */ if ( p_displayMode == NoGradient ) { // if ( p_backgroundPixmap.isNull() ) { //unsetPalette(); //} else { - QWidget::setPaletteBackgroundPixmap( p_backgroundPixmap ); + TQWidget::setPaletteBackgroundPixmap( p_backgroundPixmap ); //} - QWidget::setPaletteBackgroundColor( p_backgroundColor ); + TQWidget::setPaletteBackgroundColor( p_backgroundColor ); for ( WidgetList::Iterator it = childWidgetList.begin(); it != childWidgetList.end(); ++it ) { - if ( p_customBackgroundWidgets.contains( ( *it ) ) == false ) { + if ( p_customBackgroundWidgets.tqcontains( ( *it ) ) == false ) { ( *it )->unsetPalette(); } } @@ -110,8 +110,8 @@ void KexiGradientWidget::rebuildCache( void ) { } KPixmap tempPixmap; - QImage gradientImage; - QImage bgImage; + TQImage gradientImage; + TQImage bgImage; /** Draw the gradient @@ -124,7 +124,7 @@ void KexiGradientWidget::rebuildCache( void ) { */ if ( p_displayMode == FadedGradient ) { tempPixmap.resize( size() ); - QPainter p( &tempPixmap, this ); + TQPainter p( &tempPixmap, this ); if ( p_backgroundPixmap.isNull() ) { /* @@ -133,8 +133,8 @@ void KexiGradientWidget::rebuildCache( void ) { */ unsetPalette(); p.fillRect( 0, 0, width(), height(), palette().brush( - isEnabled() ? QPalette::Active : QPalette::Disabled, - QColorGroup::Background ) ); + isEnabled() ? TQPalette::Active : TQPalette::Disabled, + TQColorGroup::Background ) ); } else { p.drawTiledPixmap( 0, 0, width(), height(), p_backgroundPixmap ); } @@ -155,12 +155,12 @@ void KexiGradientWidget::rebuildCache( void ) { } /** - All children need to have our background set. + All tqchildren need to have our background set. */ KPixmap partPixmap; - QRect area; - QWidget* childWidget = 0; - const QPoint topLeft( 0, 0 ); + TQRect area; + TQWidget* childWidget = 0; + const TQPoint topLeft( 0, 0 ); for ( WidgetList::Iterator it = childWidgetList.begin(); it != childWidgetList.end(); ++it ) { @@ -170,7 +170,7 @@ void KexiGradientWidget::rebuildCache( void ) { /** Exclude widgets with a custom palette. */ - if ( p_customBackgroundWidgets.contains( childWidget ) ) { + if ( p_customBackgroundWidgets.tqcontains( childWidget ) ) { continue; } @@ -179,8 +179,8 @@ void KexiGradientWidget::rebuildCache( void ) { Get the part of the tempPixmap that is under the current child-widget. */ - if ( childWidget->parent() == this ) { - area = childWidget->geometry(); + if ( TQT_BASE_OBJECT(childWidget->tqparent()) == TQT_BASE_OBJECT(this) ) { + area = childWidget->tqgeometry(); } else { area.setTopLeft( childWidget->mapTo( this, childWidget->clipRegion().boundingRect().topLeft() ) ); @@ -192,17 +192,17 @@ void KexiGradientWidget::rebuildCache( void ) { childWidget->setPaletteBackgroundPixmap( partPixmap ); } - QWidget::setPaletteBackgroundPixmap( tempPixmap ); + TQWidget::setPaletteBackgroundPixmap( tempPixmap ); /** Unset the dirty-flag at the end of the method. - QWidget::setPaletteBackgroundPixmap() causes this + TQWidget::setPaletteBackgroundPixmap() causes this to get set to true again, so set it to false right after setting the pixmap. */ p_cacheDirty = false; } -void KexiGradientWidget::paintEvent( QPaintEvent* e ) { +void KexiGradientWidget::paintEvent( TQPaintEvent* e ) { /** Rebuild the background-pixmap if necessary. */ @@ -213,19 +213,19 @@ void KexiGradientWidget::paintEvent( QPaintEvent* e ) { /** Draw the widget as usual */ - QWidget::paintEvent( e ); + TQWidget::paintEvent( e ); } -bool KexiGradientWidget::eventFilter( QObject* object, QEvent* event ) { - QWidget* child = dynamic_cast<QWidget*>( object ); +bool KexiGradientWidget::eventFilter( TQObject* object, TQEvent* event ) { + TQWidget* child = dynamic_cast<TQWidget*>( object ); /** Manage list of child-widgets. */ - if ( object == this ) { - if ( event->type() == QEvent::ChildInserted ) { - child = dynamic_cast<QWidget*>( dynamic_cast<QChildEvent*>( event )->child() ); - if ( isValidChildWidget( child ) == false ) { + if ( TQT_BASE_OBJECT(object) == TQT_BASE_OBJECT(this) ) { + if ( event->type() == TQEvent::ChildInserted ) { + child = dynamic_cast<TQWidget*>( dynamic_cast<TQChildEvent*>( event )->child() ); + if ( isValidChildWidget( TQT_TQOBJECT(child) ) == false ) { return false; } /** @@ -236,11 +236,11 @@ bool KexiGradientWidget::eventFilter( QObject* object, QEvent* event ) { ... and install 'this' as the child's event-filter. */ child->installEventFilter( this ); - } else if ( event->type() == QEvent::ChildRemoved ) { + } else if ( event->type() == TQEvent::ChildRemoved ) { /** Remove the child-widget from the list of known widgets. */ - p_knownWidgets.remove( dynamic_cast<QWidget*>( dynamic_cast<QChildEvent*>( event )->child() ) ); + p_knownWidgets.remove( dynamic_cast<TQWidget*>( dynamic_cast<TQChildEvent*>( event )->child() ) ); } return false; } @@ -248,14 +248,14 @@ bool KexiGradientWidget::eventFilter( QObject* object, QEvent* event ) { /** Manage custombackground-list. */ - if ( event->type() == QEvent::PaletteChange ) { + if ( event->type() == TQEvent::PaletteChange ) { /** p_currentChild will be == 0L, when the user sets it's palette manually. In this case, it has to be added to the customBackground-list. */ if ( p_currentChild == 0L && child != 0L ) { - if ( p_customBackgroundWidgets.contains( child ) == false ) { + if ( p_customBackgroundWidgets.tqcontains( child ) == false ) { p_customBackgroundWidgets.append( child ); return false; } @@ -269,7 +269,7 @@ bool KexiGradientWidget::eventFilter( QObject* object, QEvent* event ) { Add the new child to the list of widgets, we don't set the background ourselves if it isn't in the list. */ - if ( p_customBackgroundWidgets.contains( child ) == false ) { + if ( p_customBackgroundWidgets.tqcontains( child ) == false ) { if ( child->paletteBackgroundPixmap() != 0L ) { p_customBackgroundWidgets.append( child ); } @@ -290,37 +290,37 @@ bool KexiGradientWidget::eventFilter( QObject* object, QEvent* event ) { p_currentChild = 0; } - if ( event->type() == QEvent::Move ) { - if ( p_customBackgroundWidgets.contains( child ) == false ) { + if ( event->type() == TQEvent::Move ) { + if ( p_customBackgroundWidgets.tqcontains( child ) == false ) { updateChildBackground( child ); } } return false; } -void KexiGradientWidget::updateChildBackground( QWidget* childWidget ) +void KexiGradientWidget::updateChildBackground( TQWidget* childWidget ) { KPixmap partPixmap; KPixmap bgPixmap; - QRect area; - const QPoint topLeft( 0, 0 ); + TQRect area; + const TQPoint topLeft( 0, 0 ); - bgPixmap = paletteBackgroundPixmap() ? (*paletteBackgroundPixmap()) : QPixmap(); + bgPixmap = paletteBackgroundPixmap() ? (*paletteBackgroundPixmap()) : TQPixmap(); if ( bgPixmap.isNull() ) return; /** - Exclude widgtes that don't have a parent. - This happens when children are removed + Exclude widgtes that don't have a tqparent. + This happens when tqchildren are removed which are in the knownWidgets-list. */ - if ( childWidget->parent() == 0L ) + if ( childWidget->tqparent() == 0L ) return; /** Exclude widgets with a custom palette. */ - if ( p_customBackgroundWidgets.contains( childWidget ) ) { + if ( p_customBackgroundWidgets.tqcontains( childWidget ) ) { return; } @@ -329,8 +329,8 @@ void KexiGradientWidget::updateChildBackground( QWidget* childWidget ) Get the part of the tempPixmap that is under the current child-widget. */ - if ( childWidget->parent() == this ) { - area = childWidget->geometry(); + if ( TQT_BASE_OBJECT(childWidget->tqparent()) == TQT_BASE_OBJECT(this) ) { + area = childWidget->tqgeometry(); } else { area.setTopLeft( childWidget->mapTo( this, childWidget->clipRegion().boundingRect().topLeft() ) ); @@ -342,15 +342,15 @@ void KexiGradientWidget::updateChildBackground( QWidget* childWidget ) childWidget->setPaletteBackgroundPixmap( partPixmap ); } -void KexiGradientWidget::setPaletteBackgroundColor( const QColor& color ) +void KexiGradientWidget::setPaletteBackgroundColor( const TQColor& color ) { p_backgroundColor = color; if ( p_displayMode == NoGradient ) { - QWidget::setPaletteBackgroundColor( p_backgroundColor ); + TQWidget::setPaletteBackgroundColor( p_backgroundColor ); } } -const QColor& KexiGradientWidget::paletteBackgroundColor() const +const TQColor& KexiGradientWidget::paletteBackgroundColor() const { return p_backgroundColor; } diff --git a/kexi/widget/utils/kexigradientwidget.h b/kexi/widget/utils/kexigradientwidget.h index 0032e7b1..3a90add8 100644 --- a/kexi/widget/utils/kexigradientwidget.h +++ b/kexi/widget/utils/kexigradientwidget.h @@ -20,8 +20,8 @@ #ifndef KEXIGRADIENTWIDGET_H #define KEXIGRADIENTWIDGET_H -#include <qtimer.h> -#include <qwidget.h> +#include <tqtimer.h> +#include <tqwidget.h> #include <kimageeffect.h> #include <kpixmap.h> @@ -32,15 +32,16 @@ /*! @author Christian Nitschkowski */ -class KEXIGUIUTILS_EXPORT KexiGradientWidget : public QWidget { - typedef QPtrList<QWidget> WidgetList; +class KEXIGUIUTILS_EXPORT KexiGradientWidget : public TQWidget { + typedef TQPtrList<TQWidget> WidgetList; Q_OBJECT - Q_PROPERTY(DisplayMode displayMode READ displayMode WRITE setDisplayMode DESIGNABLE true) - Q_PROPERTY(GradientType gradientType READ gradientType WRITE setGradientType DESIGNABLE true) - Q_PROPERTY(QColor gradientColor1 READ gradientColor1 WRITE setGradientColor1 DESIGNABLE true) - Q_PROPERTY(QColor gradientColor2 READ gradientColor2 WRITE setGradientColor2 DESIGNABLE true) - Q_PROPERTY(double blendOpacity READ blendOpacity WRITE setBlendOpacity DESIGNABLE true) + TQ_OBJECT + TQ_PROPERTY(DisplayMode displayMode READ displayMode WRITE setDisplayMode DESIGNABLE true) + TQ_PROPERTY(GradientType gradientType READ gradientType WRITE setGradientType DESIGNABLE true) + TQ_PROPERTY(TQColor gradientColor1 READ gradientColor1 WRITE setGradientColor1 DESIGNABLE true) + TQ_PROPERTY(TQColor gradientColor2 READ gradientColor2 WRITE setGradientColor2 DESIGNABLE true) + TQ_PROPERTY(double blendOpacity READ blendOpacity WRITE setBlendOpacity DESIGNABLE true) Q_ENUMS( DisplayMode GradientType ) public: @@ -48,7 +49,7 @@ class KEXIGUIUTILS_EXPORT KexiGradientWidget : public QWidget { Modes for displaying the gradient. */ enum DisplayMode { - NoGradient, //!< No gradient at all. Will behave just like a QWidget + NoGradient, //!< No gradient at all. Will behave just like a TQWidget FadedGradient, //!< Gradient will be faded with the widgets background SimpleGradient //!< Gradient will replace the usual widget background }; @@ -68,16 +69,16 @@ class KEXIGUIUTILS_EXPORT KexiGradientWidget : public QWidget { EllipticGradient = KImageEffect::EllipticGradient }; - KexiGradientWidget( QWidget *parent = 0, const char *name = 0, WFlags f = 0 ); + KexiGradientWidget( TQWidget *tqparent = 0, const char *name = 0, WFlags f = 0 ); virtual ~KexiGradientWidget(); - virtual void setPaletteBackgroundPixmap( const QPixmap& pixmap ) { + virtual void setPaletteBackgroundPixmap( const TQPixmap& pixmap ) { p_backgroundPixmap = pixmap; p_rebuildDelayTimer.start( REBUILD_DELAY, true ); } - virtual const QColor& paletteBackgroundColor() const; + virtual const TQColor& paletteBackgroundColor() const; /*! Set the displaymode \a mode. @@ -114,14 +115,14 @@ class KEXIGUIUTILS_EXPORT KexiGradientWidget : public QWidget { /*! Set color #1 for the gradient-effect. \a color is the new color. */ - void setGradientColor1( const QColor& color ) { + void setGradientColor1( const TQColor& color ) { p_color1 = color; p_cacheDirty = true; } /*! Set color #2 for the gradient-effect. \a color is the new color. */ - void setGradientColor2( const QColor& color ) { + void setGradientColor2( const TQColor& color ) { p_color2 = color; p_cacheDirty = true; } @@ -131,17 +132,17 @@ class KEXIGUIUTILS_EXPORT KexiGradientWidget : public QWidget { \a color1 is the first color, \a color2 the second. */ - void setGradientColors( const QColor& color1, const QColor& color2 ) { + void setGradientColors( const TQColor& color1, const TQColor& color2 ) { p_color1 = color1; p_color2 = color2; p_cacheDirty = true; } /*! \return the color #1 used for the gradient. */ - QColor gradientColor1() const { return p_color1; } + TQColor gradientColor1() const { return p_color1; } /*! \return the color #2 used for the gradient. */ - QColor gradientColor2() const { return p_color2; } + TQColor gradientColor2() const { return p_color2; } /*! Sets the opacity of the gradient when fading with background. @@ -155,47 +156,47 @@ class KEXIGUIUTILS_EXPORT KexiGradientWidget : public QWidget { double blendOpacity() const { return p_opacity; } public slots: - virtual void setPaletteBackgroundColor( const QColor& color ); + virtual void setPaletteBackgroundColor( const TQColor& color ); protected: - virtual bool eventFilter( QObject* object, QEvent* event ); + virtual bool eventFilter( TQObject* object, TQEvent* event ); virtual void enabledChange( bool enabled ) { p_cacheDirty = true; - QWidget::enabledChange( enabled ); + TQWidget::enabledChange( enabled ); } - virtual void paletteChange( const QPalette& pal ) { + virtual void paletteChange( const TQPalette& pal ) { p_cacheDirty = true; - QWidget::paletteChange( pal ); + TQWidget::paletteChange( pal ); } - virtual void paintEvent( QPaintEvent* e ); + virtual void paintEvent( TQPaintEvent* e ); - virtual void resizeEvent( QResizeEvent* e ) { + virtual void resizeEvent( TQResizeEvent* e ) { p_rebuildDelayTimer.start( REBUILD_DELAY, true ); - QWidget::resizeEvent( e ); + TQWidget::resizeEvent( e ); } - virtual void styleChange( QStyle& style ) { + virtual void styleChange( TQStyle& style ) { p_cacheDirty = true; - QWidget::styleChange( style ); + TQWidget::styleChange( style ); } private: /*! - Builds a list of children of \a p. + Builds a list of tqchildren of \a p. Only widgets that work correctly with KexiGradientWidget will be in this list. The results will be stored in \a list. - The method recursively calls itself until all children of \a p + The method recursively calls itself until all tqchildren of \a p have been found and stored in the list. */ - static void buildChildrenList( WidgetList& list, QWidget* p ); + static void buildChildrenList( WidgetList& list, TQWidget* p ); /*! \a return if the \a child is a widget that should get a background set. */ - static bool isValidChildWidget( QObject* child ); + static bool isValidChildWidget( TQObject* child ); /*! Rebuilds the cache completely. @@ -210,7 +211,7 @@ class KEXIGUIUTILS_EXPORT KexiGradientWidget : public QWidget { The same code is used for PaletteChange-events, but in a different location. */ - void updateChildBackground( QWidget* childWidget ); + void updateChildBackground( TQWidget* childWidget ); private: WidgetList p_knownWidgets; @@ -218,14 +219,14 @@ class KEXIGUIUTILS_EXPORT KexiGradientWidget : public QWidget { DisplayMode p_displayMode; GradientType p_gradientType; KPixmap p_backgroundPixmap; - QColor p_color1; - QColor p_color2; - QTimer p_rebuildDelayTimer; - QWidget* p_currentChild; + TQColor p_color1; + TQColor p_color2; + TQTimer p_rebuildDelayTimer; + TQWidget* p_currentChild; double p_opacity; bool p_cacheDirty; - QColor p_backgroundColor; + TQColor p_backgroundColor; public slots: /*! @@ -233,7 +234,7 @@ class KEXIGUIUTILS_EXPORT KexiGradientWidget : public QWidget { is set up completely. */ virtual void polish() { - QWidget::polish(); + TQWidget::polish(); rebuildCache(); } diff --git a/kexi/widget/utils/kexirecordmarker.cpp b/kexi/widget/utils/kexirecordmarker.cpp index d434fcaf..654f3be7 100644 --- a/kexi/widget/utils/kexirecordmarker.cpp +++ b/kexi/widget/utils/kexirecordmarker.cpp @@ -22,20 +22,20 @@ #include "kexirecordmarker.h" -#include <qcolor.h> -#include <qstyle.h> -#include <qpixmap.h> -#include <qpainter.h> -#include <qimage.h> -#include <qapplication.h> +#include <tqcolor.h> +#include <tqstyle.h> +#include <tqpixmap.h> +#include <tqpainter.h> +#include <tqimage.h> +#include <tqapplication.h> #include <kdebug.h> #include <kstaticdeleter.h> #include <kexiutils/utils.h> -static KStaticDeleter<QImage> KexiRecordMarker_pen_deleter, KexiRecordMarker_plus_deleter; -QImage* KexiRecordMarker_pen = 0, *KexiRecordMarker_plus = 0; +static KStaticDeleter<TQImage> KexiRecordMarker_pen_deleter, KexiRecordMarker_plus_deleter; +TQImage* KexiRecordMarker_pen = 0, *KexiRecordMarker_plus = 0; static const unsigned char img_pen_data[] = { 0x00,0x00,0x03,0x30,0x78,0x9c,0xfb,0xff,0xff,0x3f,0xc3,0x7f,0x32,0x30, @@ -56,7 +56,7 @@ static struct EmbedImage { const unsigned char *data; ulong compressed; int numColors; - const QRgb *colorTable; + const TQRgb *colorTable; bool alpha; const char *name; } embed_image[] = { @@ -64,14 +64,14 @@ static struct EmbedImage { { 10, 10, 32, (const unsigned char*)img_pen_data, 50, 0, 0, true, "tableview_plus.png" } }; -QImage* getImg(const unsigned char* data, int id) +TQImage* getImg(const unsigned char* data, int id) { - QByteArray baunzip; - baunzip = qUncompress( data, embed_image[id].compressed ); - QImage *img = new QImage( QImage((uchar*)baunzip.data(), + TQByteArray baunzip; + baunzip = tqUncompress( data, embed_image[id].compressed ); + TQImage *img = new TQImage( TQImage((uchar*)baunzip.data(), embed_image[id].width, embed_image[id].height, - embed_image[id].depth, (QRgb*)embed_image[id].colorTable, - embed_image[id].numColors, QImage::BigEndian + embed_image[id].depth, (TQRgb*)embed_image[id].colorTable, + embed_image[id].numColors, TQImage::BigEndian ).copy() ); if ( embed_image[id].alpha ) img->setAlphaBuffer(true); @@ -100,7 +100,7 @@ public: , highlightedRow(-1) , editRow(-1) , rows(0) - , selectionBackgroundColor(qApp->palette().active().highlight()) + , selectionBackgroundColor(tqApp->tqpalette().active().highlight()) , showInsertRow(true) { } @@ -110,14 +110,14 @@ public: int highlightedRow; int editRow; int rows; - QColor selectionBackgroundColor; + TQColor selectionBackgroundColor; bool showInsertRow : 1; }; //---------------------------------------------------------------- -KexiRecordMarker::KexiRecordMarker(QWidget *parent, const char* name) - : QWidget(parent, name) +KexiRecordMarker::KexiRecordMarker(TQWidget *tqparent, const char* name) + : TQWidget(tqparent, name) , d( new Private() ) { initRecordMarkerImages(); @@ -128,13 +128,13 @@ KexiRecordMarker::~KexiRecordMarker() delete d; } -QImage* KexiRecordMarker::penImage() +TQImage* KexiRecordMarker::penImage() { initRecordMarkerImages(); return KexiRecordMarker_pen; } -QImage* KexiRecordMarker::plusImage() +TQImage* KexiRecordMarker::plusImage() { initRecordMarkerImages(); return KexiRecordMarker_plus; @@ -178,36 +178,36 @@ int KexiRecordMarker::rows() const return d->rows; } -void KexiRecordMarker::paintEvent(QPaintEvent *e) +void KexiRecordMarker::paintEvent(TQPaintEvent *e) { - QPainter p(this); - QRect r(e->rect()); + TQPainter p(this); + TQRect r(e->rect()); int first = (r.top() + d->offset) / d->rowHeight; int last = (r.bottom() + d->offset) / d->rowHeight; if(last > (d->rows-1+(d->showInsertRow?1:0))) last = d->rows-1+(d->showInsertRow?1:0); - QColorGroup selectedColorGroup(colorGroup()); - selectedColorGroup.setColor( QColorGroup::Button, - KexiUtils::blendedColors( selectedColorGroup.color(QColorGroup::Background), + TQColorGroup selectedColorGroup(tqcolorGroup()); + selectedColorGroup.setColor( TQColorGroup::Button, + KexiUtils::blendedColors( selectedColorGroup.color(TQColorGroup::Background), d->selectionBackgroundColor, 2, 1) ); - selectedColorGroup.setColor( QColorGroup::Background, - selectedColorGroup.color(QColorGroup::Button) ); //set background color as well (e.g. for thinkeramik) - QColorGroup highlightedColorGroup(colorGroup()); - highlightedColorGroup.setColor( QColorGroup::Button, - KexiUtils::blendedColors( highlightedColorGroup.color(QColorGroup::Background), + selectedColorGroup.setColor( TQColorGroup::Background, + selectedColorGroup.color(TQColorGroup::Button) ); //set background color as well (e.g. for thinkeramik) + TQColorGroup highlightedColorGroup(tqcolorGroup()); + highlightedColorGroup.setColor( TQColorGroup::Button, + KexiUtils::blendedColors( highlightedColorGroup.color(TQColorGroup::Background), d->selectionBackgroundColor, 4, 1) ); - highlightedColorGroup.setColor( QColorGroup::Background, - highlightedColorGroup.color(QColorGroup::Button) ); //set background color as well (e.g. for thinkeramik) + highlightedColorGroup.setColor( TQColorGroup::Background, + highlightedColorGroup.color(TQColorGroup::Button) ); //set background color as well (e.g. for thinkeramik) for(int i=first; i <= last; i++) { int y = ((d->rowHeight * i)-d->offset); - QRect r(0, y, width(), d->rowHeight); + TQRect r(0, y, width(), d->rowHeight); p.drawRect(r); - style().drawPrimitive( QStyle::PE_HeaderSection, &p, r, - (d->currentRow == i) ? selectedColorGroup : (d->highlightedRow == i ? highlightedColorGroup : colorGroup()), - QStyle::Style_Raised | (isEnabled() ? QStyle::Style_Enabled : 0)); + tqstyle().tqdrawPrimitive( TQStyle::PE_HeaderSection, &p, r, + (d->currentRow == i) ? selectedColorGroup : (d->highlightedRow == i ? highlightedColorGroup : tqcolorGroup()), + TQStyle::Style_Raised | (isEnabled() ? TQStyle::Style_Enabled : 0)); } if (d->editRow!=-1 && d->editRow >= first && d->editRow <= (last/*+1 for insert row*/)) { //show pen when editing @@ -220,9 +220,9 @@ void KexiRecordMarker::paintEvent(QPaintEvent *e) && (!d->showInsertRow || (d->showInsertRow && d->currentRow < last)))/*don't display marker for 'insert' row*/ { //show marker - p.setBrush(colorGroup().foreground()); - p.setPen(QPen(Qt::NoPen)); - QPointArray points(3); + p.setBrush(tqcolorGroup().foreground()); + p.setPen(TQPen(TQt::NoPen)); + TQPointArray points(3); int ofs = d->rowHeight / 4; int ofs2 = (width() - ofs) / 2 -1; int pos = ((d->rowHeight*d->currentRow)-d->offset)-ofs/2+2; @@ -294,12 +294,12 @@ void KexiRecordMarker::showInsertRow(bool show) update(); } -void KexiRecordMarker::setSelectionBackgroundColor(const QColor &color) +void KexiRecordMarker::setSelectionBackgroundColor(const TQColor &color) { d->selectionBackgroundColor = color; } -QColor KexiRecordMarker::selectionBackgroundColor() const +TQColor KexiRecordMarker::selectionBackgroundColor() const { return d->selectionBackgroundColor; } diff --git a/kexi/widget/utils/kexirecordmarker.h b/kexi/widget/utils/kexirecordmarker.h index 1408f83b..1348ca1d 100644 --- a/kexi/widget/utils/kexirecordmarker.h +++ b/kexi/widget/utils/kexirecordmarker.h @@ -23,23 +23,24 @@ #ifndef KEXIRECORDMARKER_H #define KEXIRECORDMARKER_H -#include <qwidget.h> +#include <tqwidget.h> -class QImage; +class TQImage; //! \brief Record marker, usually displayed at the left side of a table view or a continuous form. -class KEXIGUIUTILS_EXPORT KexiRecordMarker : public QWidget +class KEXIGUIUTILS_EXPORT KexiRecordMarker : public TQWidget { Q_OBJECT + TQ_OBJECT public: - KexiRecordMarker(QWidget *parent, const char* name = 0); + KexiRecordMarker(TQWidget *tqparent, const char* name = 0); ~KexiRecordMarker(); int rows() const; - static QImage* penImage(); - static QImage* plusImage(); + static TQImage* penImage(); + static TQImage* plusImage(); public slots: void setOffset(int offset); @@ -51,8 +52,8 @@ class KEXIGUIUTILS_EXPORT KexiRecordMarker : public QWidget void setEditRow(int row); void showInsertRow(bool show); - QColor selectionBackgroundColor() const; - void setSelectionBackgroundColor(const QColor &color); + TQColor selectionBackgroundColor() const; + void setSelectionBackgroundColor(const TQColor &color); void addLabel(bool upd=true); void removeLabel(bool upd=true); @@ -63,7 +64,7 @@ class KEXIGUIUTILS_EXPORT KexiRecordMarker : public QWidget void clear(bool upd=true); protected: - virtual void paintEvent(QPaintEvent *e); + virtual void paintEvent(TQPaintEvent *e); class Private; Private * const d; diff --git a/kexi/widget/utils/kexirecordnavigator.cpp b/kexi/widget/utils/kexirecordnavigator.cpp index f0dff087..6fe7fbdc 100644 --- a/kexi/widget/utils/kexirecordnavigator.cpp +++ b/kexi/widget/utils/kexirecordnavigator.cpp @@ -18,12 +18,12 @@ * Boston, MA 02110-1301, USA. */ -#include <qtoolbutton.h> -#include <qlayout.h> -#include <qlabel.h> -#include <qvalidator.h> -#include <qtooltip.h> -#include <qscrollview.h> +#include <tqtoolbutton.h> +#include <tqlayout.h> +#include <tqlabel.h> +#include <tqvalidator.h> +#include <tqtooltip.h> +#include <tqscrollview.h> #include <klocale.h> #include <kiconloader.h> @@ -46,9 +46,9 @@ class KexiRecordNavigatorPrivate { } KexiRecordNavigatorHandler *handler; - QHBoxLayout *lyr; + TQHBoxLayout *lyr; - QLabel *editingIndicatorLabel; + TQLabel *editingIndicatorLabel; bool editingIndicatorEnabled : 1; bool editingIndicatorVisible : 1; }; @@ -65,103 +65,103 @@ KexiRecordNavigatorHandler::~KexiRecordNavigatorHandler() //-------------------------------------------------- -KexiRecordNavigator::KexiRecordNavigator(QWidget *parent, int leftMargin, const char *name) - : QFrame(parent, name) +KexiRecordNavigator::KexiRecordNavigator(TQWidget *tqparent, int leftMargin, const char *name) + : TQFrame(tqparent, name) , m_view(0) , m_isInsertingEnabled(true) , d( new KexiRecordNavigatorPrivate() ) { - if (parent->inherits("QScrollView")) - setParentView( dynamic_cast<QScrollView*>(parent) ); - setFrameStyle(QFrame::NoFrame); - d->lyr = new QHBoxLayout(this,0,0,"nav_lyr"); + if (tqparent->inherits(TQSCROLLVIEW_OBJECT_NAME_STRING)) + setParentView( dynamic_cast<TQScrollView*>(tqparent) ); + setFrameStyle(TQFrame::NoFrame); + d->lyr = new TQHBoxLayout(this,0,0,"nav_lyr"); - m_textLabel = new QLabel(this); + m_textLabel = new TQLabel(this); d->lyr->addWidget( m_textLabel ); setLabelText(i18n("Row:")); - int bw = 6+SmallIcon("navigator_first").width(); //QMIN( horizontalScrollBar()->height(), 20); - QFont f = font(); + int bw = 6+SmallIcon("navigator_first").width(); //TQMIN( horizontalScrollBar()->height(), 20); + TQFont f = font(); f.setPixelSize((bw > 12) ? 12 : bw); - QFontMetrics fm(f); + TQFontMetrics fm(f); m_nav1DigitWidth = fm.width("8"); - d->lyr->addWidget( m_navBtnFirst = new QToolButton(this) ); + d->lyr->addWidget( m_navBtnFirst = new TQToolButton(this) ); m_navBtnFirst->setFixedWidth(bw); - m_navBtnFirst->setFocusPolicy(NoFocus); + m_navBtnFirst->setFocusPolicy(TQ_NoFocus); m_navBtnFirst->setIconSet( SmallIconSet("navigator_first") ); - QToolTip::add(m_navBtnFirst, i18n("First row")); + TQToolTip::add(m_navBtnFirst, i18n("First row")); - d->lyr->addWidget( m_navBtnPrev = new QToolButton(this) ); + d->lyr->addWidget( m_navBtnPrev = new TQToolButton(this) ); m_navBtnPrev->setFixedWidth(bw); - m_navBtnPrev->setFocusPolicy(NoFocus); + m_navBtnPrev->setFocusPolicy(TQ_NoFocus); m_navBtnPrev->setIconSet( SmallIconSet("navigator_prev") ); m_navBtnPrev->setAutoRepeat(true); - QToolTip::add(m_navBtnPrev, i18n("Previous row")); + TQToolTip::add(m_navBtnPrev, i18n("Previous row")); d->lyr->addSpacing( 6 ); d->lyr->addWidget( m_navRecordNumber = new KLineEdit(this) ); - m_navRecordNumber->setAlignment(AlignRight | AlignVCenter); - m_navRecordNumber->setFocusPolicy(ClickFocus); + m_navRecordNumber->tqsetAlignment(AlignRight | AlignVCenter); + m_navRecordNumber->setFocusPolicy(TQ_ClickFocus); m_navRecordNumber->installEventFilter(this); // m_navRowNumber->setFixedWidth(fw); - m_navRecordNumberValidator = new QIntValidator(1, INT_MAX, this); + m_navRecordNumberValidator = new TQIntValidator(1, INT_MAX, TQT_TQOBJECT(this)); m_navRecordNumber->setValidator(m_navRecordNumberValidator); m_navRecordNumber->installEventFilter(this); - QToolTip::add(m_navRecordNumber, i18n("Current row number")); + TQToolTip::add(m_navRecordNumber, i18n("Current row number")); KLineEdit *lbl_of = new KLineEdit(i18n("of"), this); - lbl_of->setSizePolicy(QSizePolicy::Fixed,QSizePolicy::Preferred); + lbl_of->tqsetSizePolicy(TQSizePolicy::Fixed,TQSizePolicy::Preferred); lbl_of->setMaximumWidth(fm.width(lbl_of->text())+8); lbl_of->setReadOnly(true); lbl_of->setLineWidth(0); - lbl_of->setFocusPolicy(NoFocus); - lbl_of->setAlignment(AlignCenter); + lbl_of->setFocusPolicy(TQ_NoFocus); + lbl_of->tqsetAlignment(AlignCenter); d->lyr->addWidget( lbl_of ); d->lyr->addWidget( m_navRecordCount = new KLineEdit(this) ); - m_navRecordCount->setSizePolicy(QSizePolicy::Fixed,QSizePolicy::Preferred); + m_navRecordCount->tqsetSizePolicy(TQSizePolicy::Fixed,TQSizePolicy::Preferred); m_navRecordCount->setReadOnly(true); m_navRecordCount->setLineWidth(0); - m_navRecordCount->setFocusPolicy(NoFocus); - m_navRecordCount->setAlignment(AlignLeft | AlignVCenter); - QToolTip::add(m_navRecordCount, i18n("Number of rows")); + m_navRecordCount->setFocusPolicy(TQ_NoFocus); + m_navRecordCount->tqsetAlignment(AlignLeft | AlignVCenter); + TQToolTip::add(m_navRecordCount, i18n("Number of rows")); lbl_of->setFont(f); m_navRecordNumber->setFont(f); m_navRecordCount->setFont(f); setFont(f); - d->lyr->addWidget( m_navBtnNext = new QToolButton(this) ); + d->lyr->addWidget( m_navBtnNext = new TQToolButton(this) ); m_navBtnNext->setFixedWidth(bw); - m_navBtnNext->setFocusPolicy(NoFocus); + m_navBtnNext->setFocusPolicy(TQ_NoFocus); m_navBtnNext->setIconSet( SmallIconSet("navigator_next") ); m_navBtnNext->setAutoRepeat(true); - QToolTip::add(m_navBtnNext, i18n("Next row")); + TQToolTip::add(m_navBtnNext, i18n("Next row")); - d->lyr->addWidget( m_navBtnLast = new QToolButton(this) ); + d->lyr->addWidget( m_navBtnLast = new TQToolButton(this) ); m_navBtnLast->setFixedWidth(bw); - m_navBtnLast->setFocusPolicy(NoFocus); + m_navBtnLast->setFocusPolicy(TQ_NoFocus); m_navBtnLast->setIconSet( SmallIconSet("navigator_last") ); - QToolTip::add(m_navBtnLast, i18n("Last row")); + TQToolTip::add(m_navBtnLast, i18n("Last row")); d->lyr->addSpacing( 6 ); - d->lyr->addWidget( m_navBtnNew = new QToolButton(this) ); + d->lyr->addWidget( m_navBtnNew = new TQToolButton(this) ); m_navBtnNew->setFixedWidth(bw); - m_navBtnNew->setFocusPolicy(NoFocus); + m_navBtnNew->setFocusPolicy(TQ_NoFocus); m_navBtnNew->setIconSet( SmallIconSet("navigator_new") ); - QToolTip::add(m_navBtnNew, i18n("New row")); + TQToolTip::add(m_navBtnNew, i18n("New row")); m_navBtnNext->setEnabled(isInsertingEnabled()); d->lyr->addSpacing( 6 ); d->lyr->addStretch(10); - connect(m_navBtnPrev,SIGNAL(clicked()),this,SLOT(slotPrevButtonClicked())); - connect(m_navBtnNext,SIGNAL(clicked()),this,SLOT(slotNextButtonClicked())); - connect(m_navBtnLast,SIGNAL(clicked()),this,SLOT(slotLastButtonClicked())); - connect(m_navBtnFirst,SIGNAL(clicked()),this,SLOT(slotFirstButtonClicked())); - connect(m_navBtnNew,SIGNAL(clicked()),this,SLOT(slotNewButtonClicked())); + connect(m_navBtnPrev,TQT_SIGNAL(clicked()),this,TQT_SLOT(slotPrevButtonClicked())); + connect(m_navBtnNext,TQT_SIGNAL(clicked()),this,TQT_SLOT(slotNextButtonClicked())); + connect(m_navBtnLast,TQT_SIGNAL(clicked()),this,TQT_SLOT(slotLastButtonClicked())); + connect(m_navBtnFirst,TQT_SIGNAL(clicked()),this,TQT_SLOT(slotFirstButtonClicked())); + connect(m_navBtnNew,TQT_SIGNAL(clicked()),this,TQT_SLOT(slotNewButtonClicked())); setRecordCount(0); setCurrentRecordNumber(0); @@ -185,30 +185,30 @@ void KexiRecordNavigator::setInsertingEnabled(bool set) void KexiRecordNavigator::setEnabled( bool set ) { - QFrame::setEnabled(set); + TQFrame::setEnabled(set); if (set && !m_isInsertingEnabled) m_navBtnNew->setEnabled( false ); } -bool KexiRecordNavigator::eventFilter( QObject *o, QEvent *e ) +bool KexiRecordNavigator::eventFilter( TQObject *o, TQEvent *e ) { - if (o==m_navRecordNumber) { + if (TQT_BASE_OBJECT(o)==TQT_BASE_OBJECT(m_navRecordNumber)) { bool recordEntered = false; bool ret; - if (e->type()==QEvent::KeyPress) { - QKeyEvent *ke = static_cast<QKeyEvent*>(e); + if (e->type()==TQEvent::KeyPress) { + TQKeyEvent *ke = TQT_TQKEYEVENT(e); switch (ke->key()) { - case Qt::Key_Escape: { + case TQt::Key_Escape: { ke->accept(); m_navRecordNumber->undo(); if (m_view) m_view->setFocus(); return true; } - case Qt::Key_Enter: - case Qt::Key_Return: - case Qt::Key_Tab: - case Qt::Key_BackTab: + case TQt::Key_Enter: + case TQt::Key_Return: + case TQt::Key_Tab: + case TQt::Key_BackTab: { recordEntered=true; ke->accept(); //to avoid pressing Enter later @@ -217,10 +217,10 @@ bool KexiRecordNavigator::eventFilter( QObject *o, QEvent *e ) default:; } } - else if (e->type()==QEvent::FocusOut) { - if (static_cast<QFocusEvent*>(e)->reason()!=QFocusEvent::Tab - && static_cast<QFocusEvent*>(e)->reason()!=QFocusEvent::Backtab - && static_cast<QFocusEvent*>(e)->reason()!=QFocusEvent::Other) + else if (e->type()==TQEvent::FocusOut) { + if (TQT_TQFOCUSEVENT(e)->reason()!=TQFocusEvent::Tab + && TQT_TQFOCUSEVENT(e)->reason()!=TQFocusEvent::Backtab + && TQT_TQFOCUSEVENT(e)->reason()!=TQFocusEvent::Other) recordEntered=true; ret = false; } @@ -230,7 +230,7 @@ bool KexiRecordNavigator::eventFilter( QObject *o, QEvent *e ) uint r = m_navRecordNumber->text().toUInt(&ok); if (!ok || r<1) r = (recordCount()>0)?1:0; - if (m_view && (hasFocus() || e->type()==QEvent::KeyPress)) + if (m_view && (hasFocus() || e->type()==TQEvent::KeyPress)) m_view->setFocus(); setCurrentRecordNumber(r); emit recordNumberEntered(r); @@ -253,14 +253,14 @@ void KexiRecordNavigator::setCurrentRecordNumber(uint r) uint recCnt = recordCount(); if (r>(recCnt+(m_isInsertingEnabled?1:0))) r = recCnt+(m_isInsertingEnabled?1:0); - QString n; + TQString n; if (r>0) - n = QString::number(r); + n = TQString::number(r); else n = " "; // if (d->navRecordNumber->text().length() != n.length()) {//resize // d->navRecordNumber->setFixedWidth( -// d->nav1DigitWidth*QMAX( QMAX(n.length(),2)+1,d->navRecordCount->text().length()+1)+6 +// d->nav1DigitWidth*TQMAX( TQMAX(n.length(),2)+1,d->navRecordCount->text().length()+1)+6 // ); // } @@ -283,7 +283,7 @@ void KexiRecordNavigator::updateButtons(uint recCnt) void KexiRecordNavigator::setRecordCount(uint count) { - const QString & n = QString::number(count); + const TQString & n = TQString::number(count); if (m_isInsertingEnabled && currentRecordNumber()==0) { setCurrentRecordNumber(1); } @@ -297,7 +297,7 @@ void KexiRecordNavigator::setRecordCount(uint count) } } //update row number widget's width - const int w = m_nav1DigitWidth*QMAX( QMAX(n.length(),2)+1,m_navRecordNumber->text().length()+1)+6; + const int w = m_nav1DigitWidth*TQMAX( TQMAX(n.length(),2)+1,m_navRecordNumber->text().length()+1)+6; if (m_navRecordNumber->width()!=w) //resize m_navRecordNumber->setFixedWidth(w); @@ -326,18 +326,18 @@ uint KexiRecordNavigator::recordCount() const return r; } -void KexiRecordNavigator::setParentView(QScrollView *view) +void KexiRecordNavigator::setParentView(TQScrollView *view) { m_view = view; } void KexiRecordNavigator::updateGeometry(int leftMargin) { - QFrame::updateGeometry(); + TQFrame::updateGeometry(); if (m_view) { int navWidth; if (m_view->horizontalScrollBar()->isVisible()) { - navWidth = sizeHint().width(); + navWidth = tqsizeHint().width(); } else { navWidth = leftMargin + m_view->clipper()->width(); @@ -345,23 +345,23 @@ void KexiRecordNavigator::updateGeometry(int leftMargin) setGeometry( m_view->frameWidth(), - m_view->height() - m_view->horizontalScrollBar()->sizeHint().height()-m_view->frameWidth(), + m_view->height() - m_view->horizontalScrollBar()->tqsizeHint().height()-m_view->frameWidth(), navWidth, - m_view->horizontalScrollBar()->sizeHint().height() + m_view->horizontalScrollBar()->tqsizeHint().height() ); m_view->updateScrollBars(); } } -void KexiRecordNavigator::setHBarGeometry( QScrollBar & hbar, int x, int y, int w, int h ) +void KexiRecordNavigator::setHBarGeometry( TQScrollBar & hbar, int x, int y, int w, int h ) { hbar.setGeometry( x + width(), y, w - width(), h ); } -void KexiRecordNavigator::setLabelText(const QString& text) +void KexiRecordNavigator::setLabelText(const TQString& text) { - m_textLabel->setText(text.isEmpty() ? QString::null : (QString::fromLatin1(" ")+text+" ")); + m_textLabel->setText(text.isEmpty() ? TQString() : (TQString::tqfromLatin1(" ")+text+" ")); } void KexiRecordNavigator::setInsertingButtonVisible(bool set) @@ -428,9 +428,9 @@ void KexiRecordNavigator::setEditingIndicatorEnabled(bool set) d->editingIndicatorEnabled = set; if (d->editingIndicatorEnabled) { if (!d->editingIndicatorLabel) { - d->editingIndicatorLabel = new QLabel(this); - d->editingIndicatorLabel->setAlignment(Qt::AlignCenter); - QPixmap pix; + d->editingIndicatorLabel = new TQLabel(this); + d->editingIndicatorLabel->tqsetAlignment(TQt::AlignCenter); + TQPixmap pix; pix.convertFromImage( *KexiRecordMarker::penImage() ); d->editingIndicatorLabel->setFixedWidth( pix.width() + 2*2 ); d->lyr->insertWidget( 0, d->editingIndicatorLabel ); @@ -451,14 +451,14 @@ void KexiRecordNavigator::showEditingIndicator(bool show) if (!d->editingIndicatorEnabled) return; if (d->editingIndicatorVisible) { - QPixmap pix; + TQPixmap pix; pix.convertFromImage( *KexiRecordMarker::penImage() ); d->editingIndicatorLabel->setPixmap( pix ); - QToolTip::add( d->editingIndicatorLabel, i18n("Editing indicator") ); + TQToolTip::add( d->editingIndicatorLabel, i18n("Editing indicator") ); } else { - d->editingIndicatorLabel->setPixmap( QPixmap() ); - QToolTip::remove( d->editingIndicatorLabel ); + d->editingIndicatorLabel->setPixmap( TQPixmap() ); + TQToolTip::remove( d->editingIndicatorLabel ); } } diff --git a/kexi/widget/utils/kexirecordnavigator.h b/kexi/widget/utils/kexirecordnavigator.h index 674746e2..29faf115 100644 --- a/kexi/widget/utils/kexirecordnavigator.h +++ b/kexi/widget/utils/kexirecordnavigator.h @@ -21,14 +21,14 @@ #ifndef KEXIRECORDNAVIGATOR_H #define KEXIRECORDNAVIGATOR_H -#include <qframe.h> +#include <tqframe.h> #include <kexi_export.h> -class QToolButton; -class QIntValidator; -class QScrollView; -class QScrollBar; -class QLabel; +class TQToolButton; +class TQIntValidator; +class TQScrollView; +class TQScrollBar; +class TQLabel; class KLineEdit; class KGuiItem; class KexiRecordNavigatorPrivate; @@ -62,15 +62,16 @@ class KEXIGUIUTILS_EXPORT KexiRecordNavigatorHandler Note that using this way, you can allow to exist more than one navigator widget connected with your data-aware object (don't matter if this is sane). */ -class KEXIGUIUTILS_EXPORT KexiRecordNavigator : public QFrame +class KEXIGUIUTILS_EXPORT KexiRecordNavigator : public TQFrame { Q_OBJECT + TQ_OBJECT public: - KexiRecordNavigator(QWidget *parent, int leftMargin = 0, const char *name=0); + KexiRecordNavigator(TQWidget *tqparent, int leftMargin = 0, const char *name=0); virtual ~KexiRecordNavigator(); - void setParentView(QScrollView *view); + void setParentView(TQScrollView *view); /*! Sets record navigator handler. This allows to react on actions performed within navigator and vice versa. */ @@ -86,15 +87,15 @@ class KEXIGUIUTILS_EXPORT KexiRecordNavigator : public QFrame /*! \return record count displayed for this navigator. */ uint recordCount() const; - /*! Sets horizontal bar's \a hbar (at the bottom) geometry so this record navigator + /*! Sets horizontal bar's \a hbar (at the bottom) tqgeometry so this record navigator is properly positioned together with horizontal scroll bar. This method is used - in QScrollView::setHBarGeometry() implementations: + in TQScrollView::setHBarGeometry() implementations: see KexiTableView::setHBarGeometry() and KexiFormScrollView::setHBarGeometry() for usage examples. */ - void setHBarGeometry( QScrollBar & hbar, int x, int y, int w, int h ); + void setHBarGeometry( TQScrollBar & hbar, int x, int y, int w, int h ); /*! @internal used for keyboard handling. */ - virtual bool eventFilter( QObject *o, QEvent *e ); + virtual bool eventFilter( TQObject *o, TQEvent *e ); /*! \return true if "editing" indicator is visible for this navigator. @see showEditingIndicator() */ @@ -149,7 +150,7 @@ class KEXIGUIUTILS_EXPORT KexiRecordNavigator : public QFrame /*! Sets label text at the left of the for record navigator's button. By default this label contains translated "Row:" text. */ - void setLabelText(const QString& text); + void setLabelText(const TQString& text); signals: void prevButtonClicked(); @@ -165,23 +166,23 @@ class KEXIGUIUTILS_EXPORT KexiRecordNavigator : public QFrame void slotLastButtonClicked(); void slotFirstButtonClicked(); void slotNewButtonClicked(); - //void slotRecordNumberReturnPressed(const QString& text); + //void slotRecordNumberReturnPressed(const TQString& text); protected: void updateButtons(uint recCnt); - QLabel *m_textLabel; - QToolButton *m_navBtnFirst; - QToolButton *m_navBtnPrev; - QToolButton *m_navBtnNext; - QToolButton *m_navBtnLast; - QToolButton *m_navBtnNew; + TQLabel *m_textLabel; + TQToolButton *m_navBtnFirst; + TQToolButton *m_navBtnPrev; + TQToolButton *m_navBtnNext; + TQToolButton *m_navBtnLast; + TQToolButton *m_navBtnNew; KLineEdit *m_navRecordNumber; - QIntValidator *m_navRecordNumberValidator; + TQIntValidator *m_navRecordNumberValidator; KLineEdit *m_navRecordCount; //!< readonly counter uint m_nav1DigitWidth; // uint m_recordCount; - QScrollView *m_view; + TQScrollView *m_view; bool m_isInsertingEnabled : 1; KexiRecordNavigatorPrivate *d; diff --git a/kexi/widget/utils/kexisharedactionclient.h b/kexi/widget/utils/kexisharedactionclient.h index 80181bc7..58b3bd6a 100644 --- a/kexi/widget/utils/kexisharedactionclient.h +++ b/kexi/widget/utils/kexisharedactionclient.h @@ -20,7 +20,7 @@ #ifndef KEXISHAREDACTIONCLIENT_H #define KEXISHAREDACTIONCLIENT_H -#include <qasciidict.h> +#include <tqasciidict.h> class KAction; #include <kexi_export.h> @@ -43,7 +43,7 @@ class KEXIGUIUTILS_EXPORT KexiSharedActionClient protected: //! Actions pluged for this widget using plugSharedAction(), available by name. - QAsciiDict<KAction> m_sharedActions; + TQAsciiDict<KAction> m_sharedActions; }; #endif diff --git a/kexi/widget/utils/kexitooltip.cpp b/kexi/widget/utils/kexitooltip.cpp index 69a8b583..d5df13aa 100644 --- a/kexi/widget/utils/kexitooltip.cpp +++ b/kexi/widget/utils/kexitooltip.cpp @@ -19,58 +19,58 @@ #include "kexitooltip.h" -#include <qpixmap.h> -#include <qbitmap.h> -#include <qpainter.h> -#include <qimage.h> -#include <qtooltip.h> -#include <qfont.h> -#include <qfontmetrics.h> -#include <qtimer.h> +#include <tqpixmap.h> +#include <tqbitmap.h> +#include <tqpainter.h> +#include <tqimage.h> +#include <tqtooltip.h> +#include <tqfont.h> +#include <tqfontmetrics.h> +#include <tqtimer.h> -KexiToolTip::KexiToolTip(const QVariant& value, QWidget* parent) - : QWidget(parent, "KexiToolTip", Qt::WStyle_Customize | Qt::WType_Popup | Qt::WStyle_NoBorder - | Qt::WX11BypassWM | Qt::WDestructiveClose) +KexiToolTip::KexiToolTip(const TQVariant& value, TQWidget* tqparent) + : TQWidget(tqparent, "KexiToolTip", TQt::WStyle_Customize | TQt::WType_Popup | TQt::WStyle_NoBorder + | TQt::WX11BypassWM | TQt::WDestructiveClose) , m_value(value) { - setPalette( QToolTip::palette() ); - setFocusPolicy(QWidget::NoFocus); + setPalette( TQToolTip::palette() ); + setFocusPolicy(TQ_NoFocus); } KexiToolTip::~KexiToolTip() { } -QSize KexiToolTip::sizeHint() const +TQSize KexiToolTip::tqsizeHint() const { - QSize sz(fontMetrics().boundingRect(m_value.toString()).size()); + TQSize sz(fontMetrics().boundingRect(m_value.toString()).size()); return sz; } void KexiToolTip::show() { updateGeometry(); - QWidget::show(); + TQWidget::show(); } -void KexiToolTip::paintEvent( QPaintEvent *pev ) +void KexiToolTip::paintEvent( TQPaintEvent *pev ) { - QWidget::paintEvent(pev); - QPainter p(this); + TQWidget::paintEvent(pev); + TQPainter p(this); drawFrame(p); drawContents(p); } -void KexiToolTip::drawFrame(QPainter& p) +void KexiToolTip::drawFrame(TQPainter& p) { - p.setPen( QPen(palette().active().foreground(), 1) ); + p.setPen( TQPen(tqpalette().active().foreground(), 1) ); p.drawRect(rect()); } -void KexiToolTip::drawContents(QPainter& p) +void KexiToolTip::drawContents(TQPainter& p) { - p.drawText(rect(), Qt::AlignCenter, m_value.toString()); + p.drawText(rect(), TQt::AlignCenter, m_value.toString()); } #include "kexitooltip.moc" diff --git a/kexi/widget/utils/kexitooltip.h b/kexi/widget/utils/kexitooltip.h index cbb0931f..3ff93120 100644 --- a/kexi/widget/utils/kexitooltip.h +++ b/kexi/widget/utils/kexitooltip.h @@ -20,28 +20,29 @@ #ifndef KEXITOOLTIP_H #define KEXITOOLTIP_H -#include <qwidget.h> -#include <qvariant.h> +#include <tqwidget.h> +#include <tqvariant.h> //! \brief A tooltip that can display rich content -class KEXIGUIUTILS_EXPORT KexiToolTip : public QWidget +class KEXIGUIUTILS_EXPORT KexiToolTip : public TQWidget { Q_OBJECT + TQ_OBJECT public: - KexiToolTip(const QVariant& value, QWidget* parent); + KexiToolTip(const TQVariant& value, TQWidget* tqparent); virtual ~KexiToolTip(); - virtual QSize sizeHint() const; + virtual TQSize tqsizeHint() const; public slots: virtual void show(); protected: - virtual void paintEvent( QPaintEvent *pev ); - virtual void drawFrame(QPainter& p); - virtual void drawContents(QPainter& p); + virtual void paintEvent( TQPaintEvent *pev ); + virtual void drawFrame(TQPainter& p); + virtual void drawContents(TQPainter& p); - QVariant m_value; + TQVariant m_value; }; #endif diff --git a/kexi/widget/utils/klistviewitemtemplate.h b/kexi/widget/utils/klistviewitemtemplate.h index 1c89f96c..3807d43c 100644 --- a/kexi/widget/utils/klistviewitemtemplate.h +++ b/kexi/widget/utils/klistviewitemtemplate.h @@ -22,27 +22,27 @@ #include <klistview.h> -//! QListViewItem class with ability for storing additional data member +//! TQListViewItem class with ability for storing additional data member template<class type> class KListViewItemTemplate : public KListViewItem { public: - KListViewItemTemplate(type _data, QListView *parent) - : KListViewItem(parent), data(_data) {} - KListViewItemTemplate(type _data, QListViewItem *parent) - : KListViewItem(parent), data(_data) {} - KListViewItemTemplate(type _data, QListView *parent, QListViewItem *after) - : KListViewItem(parent, after), data(_data) {} - KListViewItemTemplate(type _data, QListViewItem *parent, QListViewItem *after) - : KListViewItem(parent, after), data(_data) {} - KListViewItemTemplate(type _data, QListView *parent, QString label1, QString label2=QString::null, QString label3=QString::null, QString label4=QString::null, QString label5=QString::null, QString label6=QString::null, QString label7=QString::null, QString label8=QString::null) - : KListViewItem(parent, label1, label2, label3, label4, label5, label6, label7, label8), data(_data) {} - KListViewItemTemplate(type _data, QListViewItem *parent, QString label1, QString label2=QString::null, QString label3=QString::null, QString label4=QString::null, QString label5=QString::null, QString label6=QString::null, QString label7=QString::null, QString label8=QString::null) - : KListViewItem(parent, label1, label2, label3, label4, label5, label6, label7, label8), data(_data) {} - KListViewItemTemplate(type _data, QListView *parent, QListViewItem *after, QString label1, QString label2=QString::null, QString label3=QString::null, QString label4=QString::null, QString label5=QString::null, QString label6=QString::null, QString label7=QString::null, QString label8=QString::null) - : KListViewItem(parent, after, label1, label2, label3, label4, label5, label6, label7, label8), data(_data) {} - KListViewItemTemplate(type _data, QListViewItem *parent, QListViewItem *after, QString label1, QString label2=QString::null, QString label3=QString::null, QString label4=QString::null, QString label5=QString::null, QString label6=QString::null, QString label7=QString::null, QString label8=QString::null) - : KListViewItem(parent, after, label1, label2, label3, label4, label5, label6, label7, label8), data(_data) {} + KListViewItemTemplate(type _data, TQListView *tqparent) + : KListViewItem(tqparent), data(_data) {} + KListViewItemTemplate(type _data, TQListViewItem *tqparent) + : KListViewItem(tqparent), data(_data) {} + KListViewItemTemplate(type _data, TQListView *tqparent, TQListViewItem *after) + : KListViewItem(tqparent, after), data(_data) {} + KListViewItemTemplate(type _data, TQListViewItem *tqparent, TQListViewItem *after) + : KListViewItem(tqparent, after), data(_data) {} + KListViewItemTemplate(type _data, TQListView *tqparent, TQString label1, TQString label2=TQString(), TQString label3=TQString(), TQString label4=TQString(), TQString label5=TQString(), TQString label6=TQString(), TQString label7=TQString(), TQString label8=TQString()) + : KListViewItem(tqparent, label1, label2, label3, label4, label5, label6, label7, label8), data(_data) {} + KListViewItemTemplate(type _data, TQListViewItem *tqparent, TQString label1, TQString label2=TQString(), TQString label3=TQString(), TQString label4=TQString(), TQString label5=TQString(), TQString label6=TQString(), TQString label7=TQString(), TQString label8=TQString()) + : KListViewItem(tqparent, label1, label2, label3, label4, label5, label6, label7, label8), data(_data) {} + KListViewItemTemplate(type _data, TQListView *tqparent, TQListViewItem *after, TQString label1, TQString label2=TQString(), TQString label3=TQString(), TQString label4=TQString(), TQString label5=TQString(), TQString label6=TQString(), TQString label7=TQString(), TQString label8=TQString()) + : KListViewItem(tqparent, after, label1, label2, label3, label4, label5, label6, label7, label8), data(_data) {} + KListViewItemTemplate(type _data, TQListViewItem *tqparent, TQListViewItem *after, TQString label1, TQString label2=TQString(), TQString label3=TQString(), TQString label4=TQString(), TQString label5=TQString(), TQString label6=TQString(), TQString label7=TQString(), TQString label8=TQString()) + : KListViewItem(tqparent, after, label1, label2, label3, label4, label5, label6, label7, label8), data(_data) {} type data; }; |