summaryrefslogtreecommitdiffstats
path: root/src/gui/kwidgetlister.cpp
diff options
context:
space:
mode:
authortpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2011-07-02 06:40:27 +0000
committertpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2011-07-02 06:40:27 +0000
commit2595a15ebeb6fc46b7cb241d01ec0c2460ec2111 (patch)
tree18a8f0f4ac5a86dacfa74c3537551ec39bc85e75 /src/gui/kwidgetlister.cpp
parent1d90725a4001fab9d3922b2cbcceeee5e2d1686f (diff)
downloadtellico-2595a15ebeb6fc46b7cb241d01ec0c2460ec2111.tar.gz
tellico-2595a15ebeb6fc46b7cb241d01ec0c2460ec2111.zip
TQt4 port tellico
This enables compilation under both Qt3 and Qt4 git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/applications/tellico@1239054 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'src/gui/kwidgetlister.cpp')
-rw-r--r--src/gui/kwidgetlister.cpp60
1 files changed, 30 insertions, 30 deletions
diff --git a/src/gui/kwidgetlister.cpp b/src/gui/kwidgetlister.cpp
index 80bf31b..ea51900 100644
--- a/src/gui/kwidgetlister.cpp
+++ b/src/gui/kwidgetlister.cpp
@@ -19,11 +19,11 @@
In addition, as a special exception, the copyright holders give
permission to link the code of this library with any edition of
- the Qt library by Trolltech AS, Norway (or with modified versions
- of Qt that use the same license as Qt), and distribute linked
+ the TQt library by Trolltech AS, Norway (or with modified versions
+ of TQt that use the same license as TQt), and distribute linked
combinations including the two. You must obey the GNU General
Public License in all respects for all of the code used other than
- Qt. If you modify this file, you may extend this exception to
+ TQt. If you modify this file, you may extend this exception to
your version of the file, but you are not obligated to do so. If
you do not wish to do so, delete this exception statement from
your version.
@@ -36,47 +36,47 @@
#include <kpushbutton.h>
#include <kiconloader.h>
-#include <qlayout.h>
-#include <qhbox.h>
+#include <tqlayout.h>
+#include <tqhbox.h>
#include <assert.h>
-KWidgetLister::KWidgetLister( int minWidgets, int maxWidgets, QWidget *parent, const char* name )
- : QWidget( parent, name )
+KWidgetLister::KWidgetLister( int minWidgets, int maxWidgets, TQWidget *tqparent, const char* name )
+ : TQWidget( tqparent, name )
{
mWidgetList.setAutoDelete(TRUE);
- mMinWidgets = QMAX( minWidgets, 1 );
- mMaxWidgets = QMAX( maxWidgets, mMinWidgets + 1 );
+ mMinWidgets = TQMAX( minWidgets, 1 );
+ mMaxWidgets = TQMAX( maxWidgets, mMinWidgets + 1 );
//--------- the button box
- mLayout = new QVBoxLayout(this, 0, 4);
- mButtonBox = new QHBox(this);
+ mLayout = new TQVBoxLayout(this, 0, 4);
+ mButtonBox = new TQHBox(this);
mButtonBox->setSpacing(4);
mLayout->addWidget( mButtonBox );
mBtnMore = new KPushButton( i18n("more widgets","More"), mButtonBox );
- mBtnMore->setIconSet(SmallIconSet(QString::fromLatin1("down")));
+ mBtnMore->setIconSet(SmallIconSet(TQString::tqfromLatin1("down")));
mButtonBox->setStretchFactor( mBtnMore, 0 );
mBtnFewer = new KPushButton( i18n("fewer widgets","Fewer"), mButtonBox );
- mBtnFewer->setIconSet(SmallIconSet(QString::fromLatin1("up")));
+ mBtnFewer->setIconSet(SmallIconSet(TQString::tqfromLatin1("up")));
mButtonBox->setStretchFactor( mBtnFewer, 0 );
- QWidget *spacer = new QWidget( mButtonBox );
+ TQWidget *spacer = new TQWidget( mButtonBox );
mButtonBox->setStretchFactor( spacer, 1 );
mBtnClear = new KPushButton( i18n("clear widgets","Clear"), mButtonBox );
- mBtnClear->setIconSet(SmallIconSet(QString::fromLatin1("locationbar_erase")));
+ mBtnClear->setIconSet(SmallIconSet(TQString::tqfromLatin1("locationbar_erase")));
mButtonBox->setStretchFactor( mBtnClear, 0 );
//---------- connect everything
- connect( mBtnMore, SIGNAL(clicked()),
- this, SLOT(slotMore()) );
- connect( mBtnFewer, SIGNAL(clicked()),
- this, SLOT(slotFewer()) );
- connect( mBtnClear, SIGNAL(clicked()),
- this, SLOT(slotClear()) );
+ connect( mBtnMore, TQT_SIGNAL(clicked()),
+ this, TQT_SLOT(slotMore()) );
+ connect( mBtnFewer, TQT_SIGNAL(clicked()),
+ this, TQT_SLOT(slotFewer()) );
+ connect( mBtnClear, TQT_SIGNAL(clicked()),
+ this, TQT_SLOT(slotClear()) );
enableControls();
}
@@ -112,7 +112,7 @@ void KWidgetLister::slotClear()
setNumberOfShownWidgetsTo( mMinWidgets );
// clear remaining widgets
- QPtrListIterator<QWidget> it( mWidgetList );
+ TQPtrListIterator<TQWidget> it( mWidgetList );
for ( it.toFirst() ; it.current() ; ++it )
clearWidget( (*it) );
@@ -121,11 +121,11 @@ void KWidgetLister::slotClear()
emit clearWidgets();
}
-void KWidgetLister::addWidgetAtEnd(QWidget *w)
+void KWidgetLister::addWidgetAtEnd(TQWidget *w)
{
if (!w) w = this->createWidget(this);
- mLayout->insertWidget( mLayout->findWidget( mButtonBox ), w );
+ mLayout->insertWidget( mLayout->tqfindWidget( mButtonBox ), w );
mWidgetList.append( w );
w->show();
enableControls();
@@ -135,26 +135,26 @@ void KWidgetLister::addWidgetAtEnd(QWidget *w)
void KWidgetLister::removeLastWidget()
{
- // The layout will take care that the
+ // The tqlayout will take care that the
// widget is removed from screen, too.
mWidgetList.removeLast();
enableControls();
emit widgetRemoved();
}
-void KWidgetLister::clearWidget( QWidget* /*aWidget*/ )
+void KWidgetLister::clearWidget( TQWidget* /*aWidget*/ )
{
}
-QWidget* KWidgetLister::createWidget( QWidget* parent )
+TQWidget* KWidgetLister::createWidget( TQWidget* tqparent )
{
- return new QWidget( parent );
+ return new TQWidget( tqparent );
}
void KWidgetLister::setNumberOfShownWidgetsTo( int aNum )
{
- int superfluousWidgets = QMAX( (int)mWidgetList.count() - aNum, 0 );
- int missingWidgets = QMAX( aNum - (int)mWidgetList.count(), 0 );
+ int superfluousWidgets = TQMAX( (int)mWidgetList.count() - aNum, 0 );
+ int missingWidgets = TQMAX( aNum - (int)mWidgetList.count(), 0 );
// remove superfluous widgets
for ( ; superfluousWidgets ; superfluousWidgets-- )