diff options
Diffstat (limited to 'kexi/widget/utils/kexidropdownbutton.cpp')
-rw-r--r-- | kexi/widget/utils/kexidropdownbutton.cpp | 50 |
1 files changed, 25 insertions, 25 deletions
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" |