diff options
Diffstat (limited to 'kexi/widget/tableview/kexicomboboxpopup.cpp')
-rw-r--r-- | kexi/widget/tableview/kexicomboboxpopup.cpp | 86 |
1 files changed, 43 insertions, 43 deletions
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() |