diff options
author | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2010-07-31 19:53:50 +0000 |
---|---|---|
committer | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2010-07-31 19:53:50 +0000 |
commit | 7be55ffa061c026e35e2d6a0effe1161ddb0d41f (patch) | |
tree | 8474f9b444b2756228600050f07a7ff25de532b2 /akregator/src/tabwidget.cpp | |
parent | f587f20a6d09f1729dd0a8c1cd8ee0110aec7451 (diff) | |
download | tdepim-7be55ffa061c026e35e2d6a0effe1161ddb0d41f.tar.gz tdepim-7be55ffa061c026e35e2d6a0effe1161ddb0d41f.zip |
Trinity Qt initial conversion
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdepim@1157655 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'akregator/src/tabwidget.cpp')
-rw-r--r-- | akregator/src/tabwidget.cpp | 82 |
1 files changed, 41 insertions, 41 deletions
diff --git a/akregator/src/tabwidget.cpp b/akregator/src/tabwidget.cpp index 561b93e5d..df969aacc 100644 --- a/akregator/src/tabwidget.cpp +++ b/akregator/src/tabwidget.cpp @@ -24,15 +24,15 @@ #include "tabwidget.h" -#include <qstyle.h> -#include <qapplication.h> -#include <qiconset.h> -#include <qclipboard.h> -#include <qmap.h> -#include <qptrdict.h> -#include <qstring.h> -#include <qtoolbutton.h> -#include <qtooltip.h> +#include <tqstyle.h> +#include <tqapplication.h> +#include <tqiconset.h> +#include <tqclipboard.h> +#include <tqmap.h> +#include <tqptrdict.h> +#include <tqstring.h> +#include <tqtoolbutton.h> +#include <tqtooltip.h> #include <kapplication.h> #include <kdebug.h> @@ -57,32 +57,32 @@ namespace Akregator { class TabWidget::TabWidgetPrivate { public: - QPtrDict<Frame> frames; + TQPtrDict<Frame> frames; uint CurrentMaxLength; - QWidget* currentItem; - QToolButton* tabsClose; + TQWidget* currentItem; + TQToolButton* tabsClose; }; -TabWidget::TabWidget(QWidget * parent, const char *name) +TabWidget::TabWidget(TQWidget * parent, const char *name) :KTabWidget(parent, name), d(new TabWidgetPrivate) { d->CurrentMaxLength = 30; d->currentItem = 0; setMinimumSize(250,150); setTabReorderingEnabled(false); - connect( this, SIGNAL( currentChanged(QWidget *) ), this, - SLOT( slotTabChanged(QWidget *) ) ); - connect(this, SIGNAL(closeRequest(QWidget*)), this, SLOT(slotCloseRequest(QWidget*))); + connect( this, TQT_SIGNAL( currentChanged(TQWidget *) ), this, + TQT_SLOT( slotTabChanged(TQWidget *) ) ); + connect(this, TQT_SIGNAL(closeRequest(TQWidget*)), this, TQT_SLOT(slotCloseRequest(TQWidget*))); setHoverCloseButton(Settings::closeButtonOnTabs()); - d->tabsClose = new QToolButton(this); - d->tabsClose->setAccel(QKeySequence("Ctrl+W")); - connect( d->tabsClose, SIGNAL( clicked() ), this, - SLOT( slotRemoveCurrentFrame() ) ); + d->tabsClose = new TQToolButton(this); + d->tabsClose->setAccel(TQKeySequence("Ctrl+W")); + connect( d->tabsClose, TQT_SIGNAL( clicked() ), this, + TQT_SLOT( slotRemoveCurrentFrame() ) ); d->tabsClose->setIconSet( SmallIconSet( "tab_remove" ) ); d->tabsClose->adjustSize(); - QToolTip::add(d->tabsClose, i18n("Close the current tab")); + TQToolTip::add(d->tabsClose, i18n("Close the current tab")); setCornerWidget( d->tabsClose, TopRight ); } @@ -117,21 +117,21 @@ void TabWidget::addFrame(Frame *f) return; d->frames.insert(f->widget(), f); addTab(f->widget(), f->title()); - connect(f, SIGNAL(titleChanged(Frame*, const QString& )), this, SLOT(slotSetTitle(Frame*, const QString& ))); + connect(f, TQT_SIGNAL(titleChanged(Frame*, const TQString& )), this, TQT_SLOT(slotSetTitle(Frame*, const TQString& ))); slotSetTitle(f, f->title()); } Frame *TabWidget::currentFrame() { - QWidget* w = currentPage(); + TQWidget* w = currentPage(); return w ? d->frames[w] : 0; } -QPtrList<Frame> TabWidget::frames() const +TQPtrList<Frame> TabWidget::frames() const { - QPtrList<Frame> result; - QPtrDictIterator<Frame> it(d->frames); + TQPtrList<Frame> result; + TQPtrDictIterator<Frame> it(d->frames); while (it.current()) { result.append(it.current()); @@ -141,7 +141,7 @@ QPtrList<Frame> TabWidget::frames() const return result; } -void TabWidget::slotTabChanged(QWidget *w) +void TabWidget::slotTabChanged(TQWidget *w) { // FIXME: Don't hardcode the tab position of main frame d->tabsClose->setDisabled(currentPageIndex() == 0); @@ -166,34 +166,34 @@ void TabWidget::removeFrame(Frame *f) uint TabWidget::tabBarWidthForMaxChars( uint maxLength ) { int hframe, overlap; - hframe = tabBar()->style().pixelMetric( QStyle::PM_TabBarTabHSpace, this ); - overlap = tabBar()->style().pixelMetric( QStyle::PM_TabBarTabOverlap, this ); + hframe = tabBar()->style().pixelMetric( TQStyle::PM_TabBarTabHSpace, this ); + overlap = tabBar()->style().pixelMetric( TQStyle::PM_TabBarTabOverlap, this ); - QFontMetrics fm = tabBar()->fontMetrics(); + TQFontMetrics fm = tabBar()->fontMetrics(); int x = 0; for( int i=0; i < count(); ++i ) { Frame *f=d->frames[page(i)]; - QString newTitle=f->title(); + TQString newTitle=f->title(); if ( newTitle.length() > maxLength ) newTitle = newTitle.left( maxLength-3 ) + "..."; - QTab* tab = tabBar()->tabAt( i ); + TQTab* tab = tabBar()->tabAt( i ); int lw = fm.width( newTitle ); int iw = 0; if ( tab->iconSet() ) - iw = tab->iconSet()->pixmap( QIconSet::Small, QIconSet::Normal ).width() + 4; + iw = tab->iconSet()->pixmap( TQIconSet::Small, TQIconSet::Normal ).width() + 4; - x += ( tabBar()->style().sizeFromContents( QStyle::CT_TabBarTab, this, QSize( QMAX( lw + hframe + iw, QApplication::globalStrut().width() ), 0 ), QStyleOption( tab ) ) ).width(); + x += ( tabBar()->style().sizeFromContents( TQStyle::CT_TabBarTab, this, TQSize( QMAX( lw + hframe + iw, TQApplication::globalStrut().width() ), 0 ), TQStyleOption( tab ) ) ).width(); } return x; } -void TabWidget::slotSetTitle(Frame* frame, const QString& title) +void TabWidget::slotSetTitle(Frame* frame, const TQString& title) { setTitle(title, frame->widget()); } -void TabWidget::setTitle( const QString &title , QWidget* sender) +void TabWidget::setTitle( const TQString &title , TQWidget* sender) { removeTabToolTip( sender ); @@ -211,7 +211,7 @@ void TabWidget::setTitle( const QString &title , QWidget* sender) if ( tabBarWidthForMaxChars( newMaxLength ) < maxTabBarWidth ) break; } - QString newTitle = title; + TQString newTitle = title; if ( newTitle.length() > newMaxLength ) { setTabToolTip( sender, newTitle ); @@ -243,13 +243,13 @@ void TabWidget::setTitle( const QString &title , QWidget* sender) } } -void TabWidget::contextMenu(int i, const QPoint &p) +void TabWidget::contextMenu(int i, const TQPoint &p) { - QWidget* w = ActionManager::getInstance()->container("tab_popup"); + TQWidget* w = ActionManager::getInstance()->container("tab_popup"); d->currentItem = page(i); //kdDebug() << indexOf(d->currentItem) << endl; if (w && indexOf(d->currentItem) != 0) - static_cast<QPopupMenu *>(w)->exec(p); + static_cast<TQPopupMenu *>(w)->exec(p); d->currentItem = 0; } @@ -321,7 +321,7 @@ void TabWidget::initiateDrag(int tab) } } -void TabWidget::slotCloseRequest(QWidget* widget) +void TabWidget::slotCloseRequest(TQWidget* widget) { if (d->frames.find(widget) != NULL) removeFrame(d->frames.find(widget)); |