diff options
Diffstat (limited to 'kftpgrabber/src/widgets/multitabbar.cpp')
-rw-r--r-- | kftpgrabber/src/widgets/multitabbar.cpp | 294 |
1 files changed, 147 insertions, 147 deletions
diff --git a/kftpgrabber/src/widgets/multitabbar.cpp b/kftpgrabber/src/widgets/multitabbar.cpp index 2b7c583..ecbad25 100644 --- a/kftpgrabber/src/widgets/multitabbar.cpp +++ b/kftpgrabber/src/widgets/multitabbar.cpp @@ -42,15 +42,15 @@ #include <math.h> -#include <qapplication.h> -#include <qbutton.h> -#include <qpopupmenu.h> -#include <qlayout.h> -#include <qpainter.h> -#include <qtooltip.h> -#include <qfontmetrics.h> -#include <qstyle.h> -#include <qtimer.h> +#include <ntqapplication.h> +#include <ntqbutton.h> +#include <ntqpopupmenu.h> +#include <ntqlayout.h> +#include <ntqpainter.h> +#include <ntqtooltip.h> +#include <ntqfontmetrics.h> +#include <ntqstyle.h> +#include <ntqtimer.h> #include <kiconloader.h> #include <kdebug.h> @@ -63,11 +63,11 @@ namespace KFTPWidgets { class MultiTabBarTabPrivate { public: - QPixmap pix; + TQPixmap pix; }; -MultiTabBarInternal::MultiTabBarInternal( QWidget *parent, MultiTabBar::MultiTabBarMode bm ) : QScrollView( parent ) +MultiTabBarInternal::MultiTabBarInternal( TQWidget *parent, MultiTabBar::MultiTabBarMode bm ) : TQScrollView( parent ) { m_expandedTabSize = -1; m_showActiveTabTexts = false; @@ -76,23 +76,23 @@ MultiTabBarInternal::MultiTabBarInternal( QWidget *parent, MultiTabBar::MultiTab setHScrollBarMode( AlwaysOff ); setVScrollBarMode( AlwaysOff ); if ( bm == MultiTabBar::Vertical ) { - box = new QWidget( viewport() ); - mainLayout = new QVBoxLayout( box ); + box = new TQWidget( viewport() ); + mainLayout = new TQVBoxLayout( box ); mainLayout->setAutoAdd( true ); box->setFixedWidth( 24 ); setFixedWidth( 24 ); } else { - box = new QWidget( viewport() ); - mainLayout = new QHBoxLayout( box ); + box = new TQWidget( viewport() ); + mainLayout = new TQHBoxLayout( box ); mainLayout->setAutoAdd( true ); box->setFixedHeight( 24 ); setFixedHeight( 24 ); } addChild( box ); setFrameStyle( NoFrame ); - viewport() ->setBackgroundMode( Qt::PaletteBackground ); - /* box->setPaletteBackgroundColor(Qt::red); - setPaletteBackgroundColor(Qt::green);*/ + viewport() ->setBackgroundMode( TQt::PaletteBackground ); + /* box->setPaletteBackgroundColor(TQt::red); + setPaletteBackgroundColor(TQt::green);*/ } void MultiTabBarInternal::setStyle( enum MultiTabBar::MultiTabBarStyle style ) @@ -109,13 +109,13 @@ void MultiTabBarInternal::setStyle( enum MultiTabBar::MultiTabBarStyle style ) resizeEvent( 0 ); } else if ( mainLayout == 0 ) { if ( m_barMode == MultiTabBar::Vertical ) { - box = new QWidget( viewport() ); - mainLayout = new QVBoxLayout( box ); + box = new TQWidget( viewport() ); + mainLayout = new TQVBoxLayout( box ); box->setFixedWidth( 24 ); setFixedWidth( 24 ); } else { - box = new QWidget( viewport() ); - mainLayout = new QHBoxLayout( box ); + box = new TQWidget( viewport() ); + mainLayout = new TQHBoxLayout( box ); box->setFixedHeight( 24 ); setFixedHeight( 24 ); } @@ -128,9 +128,9 @@ void MultiTabBarInternal::setStyle( enum MultiTabBar::MultiTabBarStyle style ) viewport() ->repaint(); } -void MultiTabBarInternal::drawContents ( QPainter * paint, int clipx, int clipy, int clipw, int cliph ) +void MultiTabBarInternal::drawContents ( TQPainter * paint, int clipx, int clipy, int clipw, int cliph ) { - QScrollView::drawContents ( paint , clipx, clipy, clipw, cliph ); + TQScrollView::drawContents ( paint , clipx, clipy, clipw, cliph ); if ( m_position == MultiTabBar::Right ) { @@ -167,12 +167,12 @@ void MultiTabBarInternal::drawContents ( QPainter * paint, int clipx, int clipy, } -void MultiTabBarInternal::contentsMousePressEvent( QMouseEvent *ev ) +void MultiTabBarInternal::contentsMousePressEvent( TQMouseEvent *ev ) { ev->ignore(); } -void MultiTabBarInternal::mousePressEvent( QMouseEvent *ev ) +void MultiTabBarInternal::mousePressEvent( TQMouseEvent *ev ) { ev->ignore(); } @@ -194,12 +194,12 @@ void MultiTabBarInternal::mousePressEvent( QMouseEvent *ev ) } else {diff=0; } -void MultiTabBarInternal::resizeEvent( QResizeEvent *ev ) +void MultiTabBarInternal::resizeEvent( TQResizeEvent *ev ) { /* kdDebug()<<"MultiTabBarInternal::resizeEvent"<<endl; kdDebug()<<"MultiTabBarInternal::resizeEvent - box geometry"<<box->geometry()<<endl; kdDebug()<<"MultiTabBarInternal::resizeEvent - geometry"<<geometry()<<endl;*/ - if ( ev ) QScrollView::resizeEvent( ev ); + if ( ev ) TQScrollView::resizeEvent( ev ); if ( ( m_style == MultiTabBar::KDEV3 ) || ( m_style == MultiTabBar::KDEV3ICON ) || @@ -335,20 +335,20 @@ void MultiTabBarInternal::showActiveTabTexts( bool show ) MultiTabBarTab* MultiTabBarInternal::tab( int id ) const { - for ( QPtrListIterator<MultiTabBarTab> it( m_tabs );it.current();++it ) { + for ( TQPtrListIterator<MultiTabBarTab> it( m_tabs );it.current();++it ) { if ( it.current() ->id() == id ) return it.current(); } return 0; } -bool MultiTabBarInternal::eventFilter( QObject *, QEvent *e ) +bool MultiTabBarInternal::eventFilter( TQObject *, TQEvent *e ) { - if ( e->type() == QEvent::Resize ) + if ( e->type() == TQEvent::Resize ) resizeEvent( 0 ); //PATCH by markey: Allow switching of tabs with mouse wheel - if ( e->type() == QEvent::Wheel ) { - QWheelEvent* event = static_cast<QWheelEvent*>( e ); + if ( e->type() == TQEvent::Wheel ) { + TQWheelEvent* event = static_cast<TQWheelEvent*>( e ); const int delta = event->delta() / 120; // Determine which tab is currently active @@ -371,7 +371,7 @@ bool MultiTabBarInternal::eventFilter( QObject *, QEvent *e ) return false; } -int MultiTabBarInternal::appendTab(const QPixmap &pic , int id, const QString &text) +int MultiTabBarInternal::appendTab(const TQPixmap &pic , int id, const TQString &text) { MultiTabBarTab *tab; @@ -379,7 +379,7 @@ int MultiTabBarInternal::appendTab(const QPixmap &pic , int id, const QString &t tab->installEventFilter(this); tab->showActiveTabText(m_showActiveTabTexts); - if (m_style == MultiTabBar::KONQSBC) { + if (m_style == MultiTabBar::KONTQSBC) { if (m_expandedTabSize < tab->neededSize()) { m_expandedTabSize = tab->neededSize(); @@ -418,13 +418,13 @@ void MultiTabBarInternal::setPosition( enum MultiTabBar::MultiTabBarPosition pos } -MultiTabBarButton::MultiTabBarButton(MultiTabBarInternal *tb, const QPixmap& pic, const QString& text, QPopupMenu *popup, - int id, QWidget *parent, MultiTabBar::MultiTabBarPosition pos, MultiTabBar::MultiTabBarStyle style ) - : QPushButton(QIconSet(), text, parent), +MultiTabBarButton::MultiTabBarButton(MultiTabBarInternal *tb, const TQPixmap& pic, const TQString& text, TQPopupMenu *popup, + int id, TQWidget *parent, MultiTabBar::MultiTabBarPosition pos, MultiTabBar::MultiTabBarStyle style ) + : TQPushButton(TQIconSet(), text, parent), m_tb(tb), m_style(style), m_animCount(0), - m_animTimer(new QTimer(this)) + m_animTimer(new TQTimer(this)) { setIconSet(pic); setText(text); @@ -443,13 +443,13 @@ MultiTabBarButton::MultiTabBarButton(MultiTabBarInternal *tb, const QPixmap& pic connect(m_animTimer, SIGNAL(timeout()), this, SLOT(slotAnimTimer())); } -MultiTabBarButton::MultiTabBarButton(MultiTabBarInternal *tb, const QString& text, QPopupMenu *popup, - int id, QWidget *parent, MultiTabBar::MultiTabBarPosition pos, MultiTabBar::MultiTabBarStyle style ) - : QPushButton(QIconSet(), text, parent), +MultiTabBarButton::MultiTabBarButton(MultiTabBarInternal *tb, const TQString& text, TQPopupMenu *popup, + int id, TQWidget *parent, MultiTabBar::MultiTabBarPosition pos, MultiTabBar::MultiTabBarStyle style ) + : TQPushButton(TQIconSet(), text, parent), m_tb(tb), m_style(style), m_animCount(0), - m_animTimer(new QTimer(this)) + m_animTimer(new TQTimer(this)) { setText(text); m_position = pos; @@ -474,9 +474,9 @@ int MultiTabBarButton::id() const return m_id; } -void MultiTabBarButton::setText(const QString& text) +void MultiTabBarButton::setText(const TQString& text) { - QPushButton::setText(text); + TQPushButton::setText(text); m_text = text; } @@ -497,25 +497,25 @@ void MultiTabBarButton::setStyle(MultiTabBar::MultiTabBarStyle style) repaint(); } -void MultiTabBarButton::hideEvent(QHideEvent* he) +void MultiTabBarButton::hideEvent(TQHideEvent* he) { - QPushButton::hideEvent(he); + TQPushButton::hideEvent(he); MultiTabBar *tb = dynamic_cast<MultiTabBar*>(parentWidget()); if (tb) tb->updateSeparator(); } -void MultiTabBarButton::showEvent(QShowEvent* he) +void MultiTabBarButton::showEvent(TQShowEvent* he) { - QPushButton::showEvent(he); + TQPushButton::showEvent(he); MultiTabBar *tb = dynamic_cast<MultiTabBar*>(parentWidget()); if (tb) tb->updateSeparator(); } -void MultiTabBarButton::enterEvent(QEvent*) +void MultiTabBarButton::enterEvent(TQEvent*) { m_animEnter = true; m_animCount = 0; @@ -523,7 +523,7 @@ void MultiTabBarButton::enterEvent(QEvent*) m_animTimer->start(ANIM_INTERVAL); } -void MultiTabBarButton::leaveEvent(QEvent*) +void MultiTabBarButton::leaveEvent(TQEvent*) { if (m_animCount == 0) m_animCount = 1; @@ -549,7 +549,7 @@ void MultiTabBarButton::slotAnimTimer() } } -QSize MultiTabBarButton::sizeHint() const +TQSize MultiTabBarButton::sizeHint() const { constPolish(); @@ -558,30 +558,30 @@ QSize MultiTabBarButton::sizeHint() const // calculate contents size... #ifndef QT_NO_ICONSET if ( iconSet() && !iconSet() ->isNull() ) { - int iw = iconSet() ->pixmap( QIconSet::Small, QIconSet::Normal ).width() + 4; - int ih = iconSet() ->pixmap( QIconSet::Small, QIconSet::Normal ).height(); + int iw = iconSet() ->pixmap( TQIconSet::Small, TQIconSet::Normal ).width() + 4; + int ih = iconSet() ->pixmap( TQIconSet::Small, TQIconSet::Normal ).height(); w += iw; - h = QMAX( h, ih ); + h = TQMAX( h, ih ); } #endif if ( isMenuButton() ) - w += style().pixelMetric( QStyle::PM_MenuButtonIndicator, this ); + w += style().pixelMetric( TQStyle::PM_MenuButtonIndicator, this ); if ( pixmap() ) { - QPixmap * pm = ( QPixmap * ) pixmap(); + TQPixmap * pm = ( TQPixmap * ) pixmap(); w += pm->width(); h += pm->height(); } else { - QString s( text() ); + TQString s( text() ); bool empty = s.isEmpty(); if ( empty ) - s = QString::fromLatin1( "XXXX" ); - QFontMetrics fm = fontMetrics(); - QSize sz = fm.size( ShowPrefix, s ); + s = TQString::fromLatin1( "XXXX" ); + TQFontMetrics fm = fontMetrics(); + TQSize sz = fm.size( ShowPrefix, s ); if ( !empty || !w ) w += sz.width(); if ( !empty || !h ) - h = QMAX( h, sz.height() ); + h = TQMAX( h, sz.height() ); } //PATCH by markey @@ -592,13 +592,13 @@ QSize MultiTabBarButton::sizeHint() const h = (parentWidget()->height() - 3) / m_tb->tabs()->count(); } - return ( style().sizeFromContents( QStyle::CT_ToolButton, this, QSize( w, h ) ). - expandedTo( QApplication::globalStrut() ) ); + return ( style().sizeFromContents( TQStyle::CT_ToolButton, this, TQSize( w, h ) ). + expandedTo( TQApplication::globalStrut() ) ); } -MultiTabBarTab::MultiTabBarTab( MultiTabBarInternal *tb, const QPixmap& pic, const QString& text, - int id, QWidget *parent, MultiTabBar::MultiTabBarPosition pos, +MultiTabBarTab::MultiTabBarTab( MultiTabBarInternal *tb, const TQPixmap& pic, const TQString& text, + int id, TQWidget *parent, MultiTabBar::MultiTabBarPosition pos, MultiTabBar::MultiTabBarStyle style ) : MultiTabBarButton(tb, text, 0, id, parent, pos, style), m_showActiveTabText(false) @@ -609,7 +609,7 @@ MultiTabBarTab::MultiTabBarTab( MultiTabBarInternal *tb, const QPixmap& pic, con setToggleButton( true ); // Prevent flicker on redraw - setWFlags( getWFlags() | Qt::WNoAutoErase ); + setWFlags( getWFlags() | TQt::WNoAutoErase ); } MultiTabBarTab::~MultiTabBarTab() @@ -622,7 +622,7 @@ void MultiTabBarTab::setTabsPosition( MultiTabBar::MultiTabBarPosition pos ) { if ( ( pos != m_position ) && ( ( pos == MultiTabBar::Left ) || ( pos == MultiTabBar::Right ) ) ) { if ( !d->pix.isNull() ) { - QWMatrix temp; // (1.0F, 0.0F, 0.0F, -1.0F, 0.0F, 0.0F); + TQWMatrix temp; // (1.0F, 0.0F, 0.0F, -1.0F, 0.0F, 0.0F); temp.rotate( 180 ); d->pix = d->pix.xForm( temp ); setIconSet( d->pix ); @@ -633,23 +633,23 @@ void MultiTabBarTab::setTabsPosition( MultiTabBar::MultiTabBarPosition pos ) // repaint(); } -void MultiTabBarTab::setIcon( const QString& icon ) +void MultiTabBarTab::setIcon( const TQString& icon ) { - QPixmap pic = SmallIcon( icon ); + TQPixmap pic = SmallIcon( icon ); setIcon( pic ); } -void MultiTabBarTab::setIcon( const QPixmap& icon ) +void MultiTabBarTab::setIcon( const TQPixmap& icon ) { if ( m_style != MultiTabBar::KDEV3 ) { if ( ( m_position == MultiTabBar::Left ) || ( m_position == MultiTabBar::Right ) ) { - QWMatrix rotateMatrix; + TQWMatrix rotateMatrix; if ( m_position == MultiTabBar::Left ) rotateMatrix.rotate( 90 ); else rotateMatrix.rotate( -90 ); - QPixmap pic = icon.xForm( rotateMatrix ); //TODO FIX THIS, THIS SHOWS WINDOW + TQPixmap pic = icon.xForm( rotateMatrix ); //TODO FIX THIS, THIS SHOWS WINDOW d->pix = pic; setIconSet( pic ); } else setIconSet( icon ); @@ -677,12 +677,12 @@ void MultiTabBarTab::setState(bool b) void MultiTabBarTab::updateState() { - if ( m_style != MultiTabBar::KONQSBC ) { + if ( m_style != MultiTabBar::KONTQSBC ) { if ( ( m_style == MultiTabBar::KDEV3 ) || ( m_style == MultiTabBar::KDEV3ICON ) || ( m_style == MultiTabBar::AMAROK ) || ( isOn() ) ) { - QPushButton::setText( m_text ); + TQPushButton::setText( m_text ); } else { - kdDebug() << "MultiTabBarTab::updateState(): setting text to an empty QString***************" << endl; - QPushButton::setText( QString::null ); + kdDebug() << "MultiTabBarTab::updateState(): setting text to an empty TQString***************" << endl; + TQPushButton::setText( TQString::null ); } if ( ( m_position == MultiTabBar::Right || m_position == MultiTabBar::Left ) ) { @@ -707,8 +707,8 @@ void MultiTabBarTab::updateState() else setFixedWidth( m_expandedSize ); } - QApplication::sendPostedEvents( 0, QEvent::Paint | QEvent::Move | QEvent::Resize | QEvent::LayoutHint ); - QApplication::flush(); + TQApplication::sendPostedEvents( 0, TQEvent::Paint | TQEvent::Move | TQEvent::Resize | TQEvent::LayoutHint ); + TQApplication::flush(); } int MultiTabBarTab::neededSize() @@ -719,7 +719,7 @@ int MultiTabBarTab::neededSize() else return (parentWidget()->width() - 3) / m_tb->tabs()->count(); } else { - return (((m_style != MultiTabBar::KDEV3 ) ? 24 : 0) + QFontMetrics(QFont()).width(m_text) + 6); + return (((m_style != MultiTabBar::KDEV3 ) ? 24 : 0) + TQFontMetrics(TQFont()).width(m_text) + 6); } } @@ -734,47 +734,47 @@ void MultiTabBarTab::showActiveTabText(bool show) m_showActiveTabText = show; } -void MultiTabBarTab::drawButtonLabel(QPainter *p) +void MultiTabBarTab::drawButtonLabel(TQPainter *p) { drawButton(p); } -void MultiTabBarTab::drawButton(QPainter *paint) +void MultiTabBarTab::drawButton(TQPainter *paint) { if (m_style == MultiTabBar::AMAROK) { drawButtonAmarok(paint); - } else if (m_style != MultiTabBar::KONQSBC) { + } else if (m_style != MultiTabBar::KONTQSBC) { drawButtonStyled(paint); } else { drawButtonClassic(paint); } } -void MultiTabBarTab::drawButtonStyled( QPainter *paint ) +void MultiTabBarTab::drawButtonStyled( TQPainter *paint ) { - QSize sh; + TQSize sh; const int width = 36; // rotated const int height = 24; if ( ( m_style == MultiTabBar::KDEV3 ) || ( m_style == MultiTabBar::KDEV3ICON ) || ( m_style == MultiTabBar::AMAROK ) || ( isOn() ) ) { if ( ( m_position == MultiTabBar::Left ) || ( m_position == MultiTabBar::Right ) ) - sh = QSize( this->height(), this->width() ); //MultiTabBarButton::sizeHint(); - else sh = QSize( this->width(), this->height() ); + sh = TQSize( this->height(), this->width() ); //MultiTabBarButton::sizeHint(); + else sh = TQSize( this->width(), this->height() ); } else - sh = QSize( width, height ); + sh = TQSize( width, height ); - QPixmap pixmap( sh.width(), height ); ///,sh.height()); + TQPixmap pixmap( sh.width(), height ); ///,sh.height()); pixmap.fill( eraseColor() ); - QPainter painter( &pixmap ); + TQPainter painter( &pixmap ); - QStyle::SFlags st = QStyle::Style_Default; + TQStyle::SFlags st = TQStyle::Style_Default; - st |= QStyle::Style_Enabled; + st |= TQStyle::Style_Enabled; - if ( isOn() ) st |= QStyle::Style_On; + if ( isOn() ) st |= TQStyle::Style_On; - style().drawControl( QStyle::CE_PushButton, &painter, this, QRect( 0, 0, pixmap.width(), pixmap.height() ), colorGroup(), st ); - style().drawControl( QStyle::CE_PushButtonLabel, &painter, this, QRect( 0, 0, pixmap.width(), pixmap.height() ), colorGroup(), st ); + style().drawControl( TQStyle::CE_PushButton, &painter, this, TQRect( 0, 0, pixmap.width(), pixmap.height() ), colorGroup(), st ); + style().drawControl( TQStyle::CE_PushButtonLabel, &painter, this, TQRect( 0, 0, pixmap.width(), pixmap.height() ), colorGroup(), st ); switch ( m_position ) { case MultiTabBar::Left: @@ -790,23 +790,23 @@ void MultiTabBarTab::drawButtonStyled( QPainter *paint ) paint->drawPixmap( 0, 0, pixmap ); break; } - // style().drawControl(QStyle::CE_PushButtonLabel,painter,this, QRect(0,0,pixmap.width(),pixmap.height()), - // colorGroup(),QStyle::Style_Enabled); + // style().drawControl(TQStyle::CE_PushButtonLabel,painter,this, TQRect(0,0,pixmap.width(),pixmap.height()), + // colorGroup(),TQStyle::Style_Enabled); } -void MultiTabBarTab::drawButtonClassic( QPainter *paint ) +void MultiTabBarTab::drawButtonClassic( TQPainter *paint ) { - QPixmap pixmap; + TQPixmap pixmap; if ( iconSet() ) - pixmap = iconSet() ->pixmap( QIconSet::Small, QIconSet::Normal ); + pixmap = iconSet() ->pixmap( TQIconSet::Small, TQIconSet::Normal ); paint->fillRect( 0, 0, 24, 24, colorGroup().background() ); if ( !isOn() ) { if ( m_position == MultiTabBar::Right ) { - paint->fillRect( 0, 0, 21, 21, QBrush( colorGroup().background() ) ); + paint->fillRect( 0, 0, 21, 21, TQBrush( colorGroup().background() ) ); paint->setPen( colorGroup().background().dark( 150 ) ); paint->drawLine( 0, 22, 23, 22 ); @@ -820,7 +820,7 @@ void MultiTabBarTab::drawButtonClassic( QPainter *paint ) } else if ( ( m_position == MultiTabBar::Bottom ) || ( m_position == MultiTabBar::Top ) ) { - paint->fillRect( 0, 1, 23, 22, QBrush( colorGroup().background() ) ); + paint->fillRect( 0, 1, 23, 22, TQBrush( colorGroup().background() ) ); paint->drawPixmap( 12 - pixmap.width() / 2, 12 - pixmap.height() / 2, pixmap ); @@ -839,7 +839,7 @@ void MultiTabBarTab::drawButtonClassic( QPainter *paint ) } else { paint->setPen( colorGroup().background().dark( 120 ) ); paint->drawLine( 0, 23, 23, 23 ); - paint->fillRect( 0, 0, 23, 21, QBrush( colorGroup().background() ) ); + paint->fillRect( 0, 0, 23, 21, TQBrush( colorGroup().background() ) ); paint->drawPixmap( 12 - pixmap.width() / 2, 12 - pixmap.height() / 2, pixmap ); paint->setPen( colorGroup().light() ); @@ -859,19 +859,19 @@ void MultiTabBarTab::drawButtonClassic( QPainter *paint ) paint->drawLine( 0, height() - 2, 23, height() - 2 ); paint->drawLine( 23, 0, 23, height() - 1 ); paint->drawLine( 22, 0, 22, height() - 1 ); - paint->fillRect( 0, 0, 21, height() - 3, QBrush( colorGroup().light() ) ); + paint->fillRect( 0, 0, 21, height() - 3, TQBrush( colorGroup().light() ) ); paint->drawPixmap( 10 - pixmap.width() / 2, 10 - pixmap.height() / 2, pixmap ); if ( m_showActiveTabText ) { if ( height() < 25 + 4 ) return ; - QPixmap tpixmap( height() - 25 - 3, width() - 2 ); - QPainter painter( &tpixmap ); + TQPixmap tpixmap( height() - 25 - 3, width() - 2 ); + TQPainter painter( &tpixmap ); - painter.fillRect( 0, 0, tpixmap.width(), tpixmap.height(), QBrush( colorGroup().light() ) ); + painter.fillRect( 0, 0, tpixmap.width(), tpixmap.height(), TQBrush( colorGroup().light() ) ); painter.setPen( colorGroup().text() ); - painter.drawText( 0, + width() / 2 + QFontMetrics( QFont() ).height() / 2, m_text ); + painter.drawText( 0, + width() / 2 + TQFontMetrics( TQFont() ).height() / 2, m_text ); paint->rotate( 90 ); kdDebug() << "tpixmap.width:" << tpixmap.width() << endl; @@ -880,22 +880,22 @@ void MultiTabBarTab::drawButtonClassic( QPainter *paint ) } else if ( m_position == MultiTabBar::Top ) { - paint->fillRect( 0, 0, width() - 1, 23, QBrush( colorGroup().light() ) ); + paint->fillRect( 0, 0, width() - 1, 23, TQBrush( colorGroup().light() ) ); paint->drawPixmap( 10 - pixmap.width() / 2, 10 - pixmap.height() / 2, pixmap ); if ( m_showActiveTabText ) { paint->setPen( colorGroup().text() ); - paint->drawText( 25, height() / 2 + QFontMetrics( QFont() ).height() / 2, m_text ); + paint->drawText( 25, height() / 2 + TQFontMetrics( TQFont() ).height() / 2, m_text ); } } else if ( m_position == MultiTabBar::Bottom ) { paint->setPen( colorGroup().shadow() ); paint->drawLine( 0, 23, width() - 1, 23 ); paint->drawLine( 0, 22, width() - 1, 22 ); - paint->fillRect( 0, 0, width() - 1, 21, QBrush( colorGroup().light() ) ); + paint->fillRect( 0, 0, width() - 1, 21, TQBrush( colorGroup().light() ) ); paint->drawPixmap( 10 - pixmap.width() / 2, 10 - pixmap.height() / 2, pixmap ); if ( m_showActiveTabText ) { paint->setPen( colorGroup().text() ); - paint->drawText( 25, height() / 2 + QFontMetrics( QFont() ).height() / 2, m_text ); + paint->drawText( 25, height() / 2 + TQFontMetrics( TQFont() ).height() / 2, m_text ); } } else { @@ -904,19 +904,19 @@ void MultiTabBarTab::drawButtonClassic( QPainter *paint ) paint->setPen( colorGroup().shadow() ); paint->drawLine( 0, height() - 1, 23, height() - 1 ); paint->drawLine( 0, height() - 2, 23, height() - 2 ); - paint->fillRect( 0, 0, 23, height() - 3, QBrush( colorGroup().light() ) ); + paint->fillRect( 0, 0, 23, height() - 3, TQBrush( colorGroup().light() ) ); paint->drawPixmap( 10 - pixmap.width() / 2, 10 - pixmap.height() / 2, pixmap ); if ( m_showActiveTabText ) { if ( height() < 25 + 4 ) return ; - QPixmap tpixmap( height() - 25 - 3, width() - 2 ); - QPainter painter( &tpixmap ); + TQPixmap tpixmap( height() - 25 - 3, width() - 2 ); + TQPainter painter( &tpixmap ); - painter.fillRect( 0, 0, tpixmap.width(), tpixmap.height(), QBrush( colorGroup().light() ) ); + painter.fillRect( 0, 0, tpixmap.width(), tpixmap.height(), TQBrush( colorGroup().light() ) ); painter.setPen( colorGroup().text() ); - painter.drawText( tpixmap.width() - QFontMetrics( QFont() ).width( m_text ), + width() / 2 + QFontMetrics( QFont() ).height() / 2, m_text ); + painter.drawText( tpixmap.width() - TQFontMetrics( TQFont() ).width( m_text ), + width() / 2 + TQFontMetrics( TQFont() ).height() / 2, m_text ); paint->rotate( -90 ); kdDebug() << "tpixmap.width:" << tpixmap.width() << endl; @@ -930,9 +930,9 @@ void MultiTabBarTab::drawButtonClassic( QPainter *paint ) } } -void MultiTabBarTab::drawButtonAmarok(QPainter *paint) +void MultiTabBarTab::drawButtonAmarok(TQPainter *paint) { - QColor fillColor, textColor; + TQColor fillColor, textColor; if (isOn()) { fillColor = blendColors(colorGroup().highlight(), colorGroup().background(), static_cast<int>(m_animCount * 3.5)); @@ -942,10 +942,10 @@ void MultiTabBarTab::drawButtonAmarok(QPainter *paint) textColor = blendColors(colorGroup().text(), colorGroup().highlightedText(), static_cast<int>(m_animCount * 4.5)); } - const QPixmap icon = iconSet()->pixmap(QIconSet::Small, QIconSet::Normal); + const TQPixmap icon = iconSet()->pixmap(TQIconSet::Small, TQIconSet::Normal); // Our pixmap - QPixmap pixmap; + TQPixmap pixmap; if (m_position == MultiTabBar::Left) pixmap.resize(height(), width()); @@ -953,7 +953,7 @@ void MultiTabBarTab::drawButtonAmarok(QPainter *paint) pixmap.resize(width(), height()); pixmap.fill(fillColor); - QPainter painter(&pixmap); + TQPainter painter(&pixmap); // Draw the frame painter.setPen(colorGroup().mid()); @@ -962,15 +962,15 @@ void MultiTabBarTab::drawButtonAmarok(QPainter *paint) painter.drawLine(0, pixmap.height() - 1, pixmap.width() - 1, pixmap.height() - 1); // Draw the text - QFont font; + TQFont font; font.setBold(isOn()); painter.setFont(font); - QString text = KStringHandler::rPixelSqueeze(m_text, QFontMetrics(font), pixmap.width() - icon.width() - 3); + TQString text = KStringHandler::rPixelSqueeze(m_text, TQFontMetrics(font), pixmap.width() - icon.width() - 3); text.replace( "...", ".." ); - const int textX = pixmap.width() / 2 - QFontMetrics( font ).width( text ) / 2; + const int textX = pixmap.width() / 2 - TQFontMetrics( font ).width( text ) / 2; painter.setPen(textColor); - const QRect rect(textX + icon.width() / 2 + 2, 0, pixmap.width(), pixmap.height()); - painter.drawText(rect, Qt::AlignLeft | Qt::AlignVCenter, text); + const TQRect rect(textX + icon.width() / 2 + 2, 0, pixmap.width(), pixmap.height()); + painter.drawText(rect, TQt::AlignLeft | TQt::AlignVCenter, text); // Draw the icon painter.drawPixmap(textX - icon.width() / 2 - 2, pixmap.height() / 2 - icon.height() / 2, icon); @@ -984,7 +984,7 @@ void MultiTabBarTab::drawButtonAmarok(QPainter *paint) } } -QColor MultiTabBarTab::blendColors( const QColor& color1, const QColor& color2, int percent ) +TQColor MultiTabBarTab::blendColors( const TQColor& color1, const TQColor& color2, int percent ) { const float factor1 = ( 100 - ( float ) percent ) / 100; const float factor2 = ( float ) percent / 100; @@ -993,7 +993,7 @@ QColor MultiTabBarTab::blendColors( const QColor& color1, const QColor& color2, const int g = static_cast<int>( color1.green() * factor1 + color2.green() * factor2 ); const int b = static_cast<int>( color1.blue() * factor1 + color2.blue() * factor2 ); - QColor result; + TQColor result; result.setRgb( r, g, b ); return result; @@ -1002,16 +1002,16 @@ QColor MultiTabBarTab::blendColors( const QColor& color1, const QColor& color2, -MultiTabBar::MultiTabBar( MultiTabBarMode bm, QWidget *parent, const char *name ) : QWidget( parent, name ) +MultiTabBar::MultiTabBar( MultiTabBarMode bm, TQWidget *parent, const char *name ) : TQWidget( parent, name ) { m_buttons.setAutoDelete( false ); if ( bm == Vertical ) { - m_l = new QVBoxLayout( this ); - setSizePolicy( QSizePolicy::Fixed, QSizePolicy::Expanding, true ); + m_l = new TQVBoxLayout( this ); + setSizePolicy( TQSizePolicy::Fixed, TQSizePolicy::Expanding, true ); // setFixedWidth(24); } else { - m_l = new QHBoxLayout( this ); - setSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed, true ); + m_l = new TQHBoxLayout( this ); + setSizePolicy( TQSizePolicy::Expanding, TQSizePolicy::Fixed, true ); // setFixedHeight(24); } m_l->setMargin( 0 ); @@ -1021,11 +1021,11 @@ MultiTabBar::MultiTabBar( MultiTabBarMode bm, QWidget *parent, const char *name setPosition( ( bm == MultiTabBar::Vertical ) ? MultiTabBar::Right : MultiTabBar::Bottom ); setStyle( VSNET ); // setStyle(KDEV3); - //setStyle(KONQSBC); + //setStyle(KONTQSBC); m_l->insertWidget( 0, m_internal ); - m_l->insertWidget( 0, m_btnTabSep = new QFrame( this ) ); + m_l->insertWidget( 0, m_btnTabSep = new TQFrame( this ) ); m_btnTabSep->setFixedHeight( 4 ); - m_btnTabSep->setFrameStyle( QFrame::Panel | QFrame::Sunken ); + m_btnTabSep->setFrameStyle( TQFrame::Panel | TQFrame::Sunken ); m_btnTabSep->setLineWidth( 2 ); m_btnTabSep->hide(); @@ -1035,16 +1035,16 @@ MultiTabBar::MultiTabBar( MultiTabBarMode bm, QWidget *parent, const char *name MultiTabBar::~MultiTabBar() {} -/*int MultiTabBar::insertButton(QPixmap pic,int id ,const QString&) +/*int MultiTabBar::insertButton(TQPixmap pic,int id ,const TQString&) { -(new KToolbarButton(pic,id,m_internal))->show(); +(new TDEToolbarButton(pic,id,m_internal))->show(); return 0; }*/ -int MultiTabBar::appendButton( const QPixmap &pic , int id, QPopupMenu *popup, const QString& ) +int MultiTabBar::appendButton( const TQPixmap &pic , int id, TQPopupMenu *popup, const TQString& ) { MultiTabBarButton * btn; - m_buttons.append(btn = new MultiTabBarButton(m_internal, pic, QString::null, popup, id, this, m_position, m_internal->m_style)); + m_buttons.append(btn = new MultiTabBarButton(m_internal, pic, TQString::null, popup, id, this, m_position, m_internal->m_style)); m_l->insertWidget( 0, btn ); btn->show(); @@ -1056,7 +1056,7 @@ int MultiTabBar::appendButton( const QPixmap &pic , int id, QPopupMenu *popup, c void MultiTabBar::updateSeparator() { bool hideSep = true; - for ( QPtrListIterator<MultiTabBarButton> it( m_buttons );it.current();++it ) { + for ( TQPtrListIterator<MultiTabBarButton> it( m_buttons );it.current();++it ) { if ( it.current() ->isVisibleTo( this ) ) { hideSep = false; break; @@ -1067,7 +1067,7 @@ void MultiTabBar::updateSeparator() } -int MultiTabBar::appendTab( const QPixmap &pic , int id , const QString& text ) +int MultiTabBar::appendTab( const TQPixmap &pic , int id , const TQString& text ) { m_internal->appendTab( pic, id, text ); return 0; @@ -1075,7 +1075,7 @@ int MultiTabBar::appendTab( const QPixmap &pic , int id , const QString& text ) MultiTabBarButton* MultiTabBar::button( int id ) const { - for ( QPtrListIterator<MultiTabBarButton> it( m_buttons );it.current();++it ) { + for ( TQPtrListIterator<MultiTabBarButton> it( m_buttons );it.current();++it ) { if ( it.current() ->id() == id ) return it.current(); } return 0; @@ -1140,19 +1140,19 @@ void MultiTabBar::setPosition( MultiTabBarPosition pos ) for ( uint i = 0;i < m_buttons.count();i++ ) m_buttons.at( i ) ->setPosition( pos ); } -void MultiTabBar::fontChange( const QFont& /* oldFont */ ) +void MultiTabBar::fontChange( const TQFont& /* oldFont */ ) { for ( uint i = 0;i < tabs() ->count();i++ ) tabs() ->at( i ) ->resize(); repaint(); } -QPtrList<MultiTabBarTab> *MultiTabBar::tabs() +TQPtrList<MultiTabBarTab> *MultiTabBar::tabs() { return m_internal->tabs(); } -QPtrList<MultiTabBarButton>* MultiTabBar::buttons() +TQPtrList<MultiTabBarButton>* MultiTabBar::buttons() { return & m_buttons; } |