diff options
Diffstat (limited to 'bibletime/frontend/keychooser/ckeychooserwidget.cpp')
-rw-r--r-- | bibletime/frontend/keychooser/ckeychooserwidget.cpp | 106 |
1 files changed, 53 insertions, 53 deletions
diff --git a/bibletime/frontend/keychooser/ckeychooserwidget.cpp b/bibletime/frontend/keychooser/ckeychooserwidget.cpp index 64de499..d068545 100644 --- a/bibletime/frontend/keychooser/ckeychooserwidget.cpp +++ b/bibletime/frontend/keychooser/ckeychooserwidget.cpp @@ -16,34 +16,34 @@ //Qt includes -#include <qlineedit.h> -#include <qstring.h> -#include <qstringlist.h> -#include <qlistbox.h> -#include <qtoolbutton.h> -#include <qevent.h> -#include <qlayout.h> -#include <qpainter.h> -#include <qstyle.h> -#include <qpixmap.h> -#include <qapplication.h> -#include <qtooltip.h> -#include <qrect.h> - -CKCComboBox::CKCComboBox(bool rw,QWidget* parent,const char* name) -: QComboBox(rw,parent,name) { - setFocusPolicy(QWidget::WheelFocus); +#include <tqlineedit.h> +#include <tqstring.h> +#include <tqstringlist.h> +#include <tqlistbox.h> +#include <tqtoolbutton.h> +#include <tqevent.h> +#include <tqlayout.h> +#include <tqpainter.h> +#include <tqstyle.h> +#include <tqpixmap.h> +#include <tqapplication.h> +#include <tqtooltip.h> +#include <tqrect.h> + +CKCComboBox::CKCComboBox(bool rw,TQWidget* parent,const char* name) +: TQComboBox(rw,parent,name) { + setFocusPolicy(TQWidget::WheelFocus); if (lineEdit()) { installEventFilter( lineEdit() ); } } /** Reimplementation. */ -bool CKCComboBox::eventFilter( QObject *o, QEvent *e ) { - if (e->type() == QEvent::FocusOut) { - QFocusEvent* f = static_cast<QFocusEvent*>(e); +bool CKCComboBox::eventFilter( TQObject *o, TQEvent *e ) { + if (e->type() == TQEvent::FocusOut) { + TQFocusEvent* f = static_cast<TQFocusEvent*>(e); - if (o == lineEdit() && f->reason() == QFocusEvent::Tab) { + if (o == lineEdit() && f->reason() == TQFocusEvent::Tab) { int index = listBox()->index( listBox()->findItem(currentText()) ); if (index == -1) { index = 0;// return 0 if not found @@ -53,14 +53,14 @@ bool CKCComboBox::eventFilter( QObject *o, QEvent *e ) { return false; } - else if (f->reason() == QFocusEvent::Popup) { + else if (f->reason() == TQFocusEvent::Popup) { return false; } - else if (f->reason() == QFocusEvent::ActiveWindow) { + else if (f->reason() == TQFocusEvent::ActiveWindow) { emit activated(currentText()); return false; } - else if (f->reason() == QFocusEvent::Mouse) { + else if (f->reason() == TQFocusEvent::Mouse) { emit activated(currentText()); return false; } @@ -70,12 +70,12 @@ bool CKCComboBox::eventFilter( QObject *o, QEvent *e ) { } } - return QComboBox::eventFilter(o,e); + return TQComboBox::eventFilter(o,e); } /** Scrolls in the list if the wheel of the mouse was used. */ -void CKCComboBox::wheelEvent( QWheelEvent* e ) { - return QComboBox::wheelEvent(e); +void CKCComboBox::wheelEvent( TQWheelEvent* e ) { + return TQComboBox::wheelEvent(e); const signed int change = (int)((float)e->delta()/(float)120); int current = currentItem(); @@ -92,17 +92,17 @@ void CKCComboBox::wheelEvent( QWheelEvent* e ) { //**********************************************************************************/ -CKeyChooserWidget::CKeyChooserWidget(int count, const bool useNextPrevSignals, QWidget *parent, const char *name) : QWidget(parent,name) { +CKeyChooserWidget::CKeyChooserWidget(int count, const bool useNextPrevSignals, TQWidget *parent, const char *name) : TQWidget(parent,name) { m_useNextPrevSignals = useNextPrevSignals; for (int index=1; index <= count; index++) { - m_list.append( QString::number(index) ); + m_list.append( TQString::number(index) ); } init(); reset(m_list,0,false); }; -CKeyChooserWidget::CKeyChooserWidget(QStringList *list, const bool useNextPrevSignals, QWidget *parent, const char *name ) : QWidget(parent,name) { +CKeyChooserWidget::CKeyChooserWidget(TQStringList *list, const bool useNextPrevSignals, TQWidget *parent, const char *name ) : TQWidget(parent,name) { m_useNextPrevSignals = useNextPrevSignals; if (list) { @@ -122,13 +122,13 @@ void CKeyChooserWidget::reset(const int count, int index, bool do_emit) { m_list.clear(); for (int i=1; i <= count; i++) { //TODO: CHECK - m_list.append( QString::number(i) ); + m_list.append( TQString::number(i) ); } reset(&m_list,index,do_emit); } -void CKeyChooserWidget::reset(QStringList& list, int index, bool do_emit) { +void CKeyChooserWidget::reset(TQStringList& list, int index, bool do_emit) { if (!isUpdatesEnabled()) return; @@ -137,14 +137,14 @@ void CKeyChooserWidget::reset(QStringList& list, int index, bool do_emit) { } -void CKeyChooserWidget::reset(QStringList *list, int index, bool do_emit) { +void CKeyChooserWidget::reset(TQStringList *list, int index, bool do_emit) { if (isResetting || !isUpdatesEnabled()) return; // qWarning("starting insert"); isResetting = true; - oldKey = QString::null; + oldKey = TQString::null; // m_comboBox->setUpdatesEnabled(false); //DON'T REMOVE THE HIDE: Otherwise QComboBox's sizeHint() function won't work properly @@ -168,7 +168,7 @@ void CKeyChooserWidget::reset(QStringList *list, int index, bool do_emit) { emit changed(m_comboBox->currentItem()); } - const QSize dummySize = m_comboBox->sizeHint(); //without this function call the combo box won't be properly sized! + const TQSize dummySize = m_comboBox->sizeHint(); //without this function call the combo box won't be properly sized! //DON'T REMOVE OR MOVE THE show()! Otherwise QComboBox's sizeHint() function won't work properly! m_comboBox->show(); @@ -181,16 +181,16 @@ void CKeyChooserWidget::reset(QStringList *list, int index, bool do_emit) { /** Initializes this widget. We need this function because we have more than one constructor. */ void CKeyChooserWidget::init() { - oldKey = QString::null; + oldKey = TQString::null; - setFocusPolicy(QWidget::WheelFocus); + setFocusPolicy(TQWidget::WheelFocus); m_comboBox = new CKCComboBox( true, this ); m_comboBox->setAutoCompletion( true ); - m_comboBox->setInsertionPolicy(QComboBox::NoInsertion); - m_comboBox->setFocusPolicy(QWidget::WheelFocus); + m_comboBox->setInsertionPolicy(TQComboBox::NoInsertion); + m_comboBox->setFocusPolicy(TQWidget::WheelFocus); - m_mainLayout = new QHBoxLayout( this ); + m_mainLayout = new TQHBoxLayout( this ); m_mainLayout->addWidget(m_comboBox,5); m_scroller = new CScrollerWidgetSet(this); @@ -200,25 +200,25 @@ void CKeyChooserWidget::init() { setTabOrder(m_comboBox, 0); - connect(m_scroller, SIGNAL(scroller_pressed()), SLOT(lock())); - connect(m_scroller, SIGNAL(scroller_released()), SLOT(unlock())); - connect(m_scroller, SIGNAL(change(int)), SLOT(changeCombo(int)) ); + connect(m_scroller, TQT_SIGNAL(scroller_pressed()), TQT_SLOT(lock())); + connect(m_scroller, TQT_SIGNAL(scroller_released()), TQT_SLOT(unlock())); + connect(m_scroller, TQT_SIGNAL(change(int)), TQT_SLOT(changeCombo(int)) ); - connect(m_comboBox, SIGNAL(activated(int)), SLOT(slotComboChanged(int))); - // connect(m_comboBox, SIGNAL(activated(const QString&)), SLOT(slotReturnPressed(const QString&))); - connect(m_comboBox->lineEdit(), SIGNAL(returnPressed()), SLOT(slotReturnPressed())); - connect(m_comboBox, SIGNAL(focusOut(int)), SIGNAL(focusOut(int))); + connect(m_comboBox, TQT_SIGNAL(activated(int)), TQT_SLOT(slotComboChanged(int))); + // connect(m_comboBox, TQT_SIGNAL(activated(const TQString&)), TQT_SLOT(slotReturnPressed(const TQString&))); + connect(m_comboBox->lineEdit(), TQT_SIGNAL(returnPressed()), TQT_SLOT(slotReturnPressed())); + connect(m_comboBox, TQT_SIGNAL(focusOut(int)), TQT_SIGNAL(focusOut(int))); updatelock = false; isResetting = false; } /** Is called when the return key was presed in the combobox. */ -void CKeyChooserWidget::slotReturnPressed( /*const QString& text*/) { +void CKeyChooserWidget::slotReturnPressed( /*const TQString& text*/) { Q_ASSERT(comboBox()->lineEdit()); qWarning("return pressed"); - QString text = comboBox()->lineEdit()->text(); + TQString text = comboBox()->lineEdit()->text(); for (int index = 0; index < comboBox()->count(); ++index) { if (comboBox()->text(index) == text) { // emit changed(index); @@ -237,7 +237,7 @@ void CKeyChooserWidget::slotComboChanged(int index) { setUpdatesEnabled(false); - const QString key = comboBox()->text( index ); + const TQString key = comboBox()->text( index ); if (oldKey.isNull() || (oldKey != key)) { emit changed(index); } @@ -248,13 +248,13 @@ void CKeyChooserWidget::slotComboChanged(int index) { } /** Sets the tooltips for the given entries using the parameters as text. */ -void CKeyChooserWidget::setToolTips( const QString comboTip, const QString nextEntryTip, const QString scrollButtonTip, const QString previousEntryTip) { - QToolTip::add (comboBox(),comboTip); +void CKeyChooserWidget::setToolTips( const TQString comboTip, const TQString nextEntryTip, const TQString scrollButtonTip, const TQString previousEntryTip) { + TQToolTip::add (comboBox(),comboTip); m_scroller->setToolTips(nextEntryTip, scrollButtonTip, previousEntryTip); } /** Sets the current item to the one with the given text */ -bool CKeyChooserWidget::setItem( const QString item ) { +bool CKeyChooserWidget::setItem( const TQString item ) { bool ret = false; const int count = comboBox()->count(); for (int i = 0; i < count; ++i) { |