diff options
author | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2010-09-06 20:59:29 +0000 |
---|---|---|
committer | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2010-09-06 20:59:29 +0000 |
commit | 11f31c37e5fa4889d9989f10272f44845449cb7b (patch) | |
tree | 4383da04a76c497950d957fc6120b0fd0d9082c2 /src/gui/kdeext/klearlook.cpp | |
parent | 832eb69d571e8e518db45d0c0e6fbc0f00690209 (diff) | |
download | rosegarden-11f31c37e5fa4889d9989f10272f44845449cb7b.tar.gz rosegarden-11f31c37e5fa4889d9989f10272f44845449cb7b.zip |
Initial TQt conversion
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/applications/rosegarden@1172292 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'src/gui/kdeext/klearlook.cpp')
-rw-r--r-- | src/gui/kdeext/klearlook.cpp | 930 |
1 files changed, 465 insertions, 465 deletions
diff --git a/src/gui/kdeext/klearlook.cpp b/src/gui/kdeext/klearlook.cpp index 3e5b986..7263370 100644 --- a/src/gui/kdeext/klearlook.cpp +++ b/src/gui/kdeext/klearlook.cpp @@ -36,47 +36,47 @@ DEALINGS IN THE SOFTWARE. */ #include <kdeversion.h> -#include <qmenubar.h> -#include <qapplication.h> -#include <qpainter.h> -#include <qpalette.h> -#include <qframe.h> -#include <qpushbutton.h> -#include <qdrawutil.h> -#include <qscrollbar.h> -#include <qtabbar.h> -#include <qtabwidget.h> -#include <qguardedptr.h> -#include <qlayout.h> -#include <qlineedit.h> -#include <qlistview.h> -#include <qbitmap.h> -#include <qcleanuphandler.h> -#include <qimage.h> -#include <qcombobox.h> -#include <qspinbox.h> -#include <qslider.h> -#include <qstylefactory.h> -#include <qcleanuphandler.h> -#include <qcheckbox.h> -#include <qradiobutton.h> -#include <qtoolbutton.h> -#include <qtoolbar.h> -#include <qprogressbar.h> -#include <qcursor.h> -#include <qheader.h> -#include <qwidgetstack.h> -#include <qsplitter.h> +#include <tqmenubar.h> +#include <tqapplication.h> +#include <tqpainter.h> +#include <tqpalette.h> +#include <tqframe.h> +#include <tqpushbutton.h> +#include <tqdrawutil.h> +#include <tqscrollbar.h> +#include <tqtabbar.h> +#include <tqtabwidget.h> +#include <tqguardedptr.h> +#include <tqlayout.h> +#include <tqlineedit.h> +#include <tqlistview.h> +#include <tqbitmap.h> +#include <tqcleanuphandler.h> +#include <tqimage.h> +#include <tqcombobox.h> +#include <tqspinbox.h> +#include <tqslider.h> +#include <tqstylefactory.h> +#include <tqcleanuphandler.h> +#include <tqcheckbox.h> +#include <tqradiobutton.h> +#include <tqtoolbutton.h> +#include <tqtoolbar.h> +#include <tqprogressbar.h> +#include <tqcursor.h> +#include <tqheader.h> +#include <tqwidgetstack.h> +#include <tqsplitter.h> #include <math.h> #include <stdlib.h> #include <unistd.h> #include <sys/types.h> #include "klearlook.h" -#include <qsettings.h> +#include <tqsettings.h> #if KDE_VERSION >= 0x30200 -#include <qfile.h> -#include <qdir.h> +#include <tqfile.h> +#include <tqdir.h> #endif // Uncomment the following to enable gradients in toolbars and menubars @@ -105,29 +105,29 @@ static const int rightBorder = 12; #if KDE_VERSION >= 0x30200 // Try to read $KDEHOME/share/config/kickerrc to find out if kicker is transparent... -static QString readEnvPath( const char *env ) { - QCString path = getenv( env ); +static TQString readEnvPath( const char *env ) { + TQCString path = getenv( env ); return path.isEmpty() - ? QString::null - : QFile::decodeName( path ); + ? TQString::null + : TQFile::decodeName( path ); } static bool kickerIsTrans() { - QString kdeHome( readEnvPath( getuid() ? "KDEHOME" : "KDEROOTHOME" ) ), + TQString kdeHome( readEnvPath( getuid() ? "KDEHOME" : "KDEROOTHOME" ) ), cfgFileName; bool trans = false; if ( kdeHome.isEmpty() ) - cfgFileName = QDir::homeDirPath() + "/.kde/share/config/kickerrc"; + cfgFileName = TQDir::homeDirPath() + "/.kde/share/config/kickerrc"; else - cfgFileName = QString( kdeHome ) + "/share/config/kickerrc"; + cfgFileName = TQString( kdeHome ) + "/share/config/kickerrc"; - QFile cfgFile( cfgFileName ); + TQFile cfgFile( cfgFileName ); if ( cfgFile.open( IO_ReadOnly ) ) { - QTextStream stream( &cfgFile ); - QString line; + TQTextStream stream( &cfgFile ); + TQString line; bool stop = false, inGen = false; @@ -140,7 +140,7 @@ static bool kickerIsTrans() { if ( -1 != line.find( "true" ) ) trans = true; stop = true; - } else if ( line[ 0 ] == QChar( '[' ) ) // Then wasn't in General section... + } else if ( line[ 0 ] == TQChar( '[' ) ) // Then wasn't in General section... stop = true; } else if ( 0 == line.find( "[General]" ) ) inGen = true; @@ -160,27 +160,27 @@ inline int limit( double c ) { : ( int ) c; } -inline QColor midColor( const QColor &a, const QColor &b, double factor = 1.0 ) { - return QColor( ( a.red() + limit( b.red() * factor ) ) >> 1, +inline TQColor midColor( const TQColor &a, const TQColor &b, double factor = 1.0 ) { + return TQColor( ( a.red() + limit( b.red() * factor ) ) >> 1, ( a.green() + limit( b.green() * factor ) ) >> 1, ( a.blue() + limit( b.blue() * factor ) ) >> 1 ); } // Copied from Keramik... -static bool isFormWidget( const QWidget *widget ) { +static bool isFormWidget( const TQWidget *widget ) { //Form widgets are in the KHTMLView, but that has 2 further inner levels //of widgets - QClipperWidget, and outside of that, QViewportWidget - QWidget * potentialClipPort = widget->parentWidget(); + TQWidget * potentialClipPort = widget->parentWidget(); if ( !potentialClipPort || potentialClipPort->isTopLevel() ) return false; - QWidget *potentialViewPort = potentialClipPort->parentWidget(); + TQWidget *potentialViewPort = potentialClipPort->parentWidget(); if ( !potentialViewPort || potentialViewPort->isTopLevel() || qstrcmp( potentialViewPort->name(), "qt_viewport" ) ) return false; - QWidget *potentialKHTML = potentialViewPort->parentWidget(); + TQWidget *potentialKHTML = potentialViewPort->parentWidget(); if ( !potentialKHTML || potentialKHTML->isTopLevel() || qstrcmp( potentialKHTML->className(), "KHTMLView" ) ) return false; @@ -337,7 +337,7 @@ static bool equal( double d1, double d2 ) { return ( fabs( d1 - d2 ) < 0.0001 ); } -static void shade( const QColor &a, QColor *b, float k ) { +static void shade( const TQColor &a, TQColor *b, float k ) { if ( equal( k, 1.0 ) ) * b = a; @@ -366,7 +366,7 @@ static void shade( const QColor &a, QColor *b, float k ) { } } -static void shadeGradient( const QColor &base, QColor *vals ) { +static void shadeGradient( const TQColor &base, TQColor *vals ) { vals[ KlearlookStyle::GRADIENT_BASE ] = base; shade( vals[ KlearlookStyle::GRADIENT_BASE ], @@ -381,7 +381,7 @@ static void shadeGradient( const QColor &base, QColor *vals ) { &( vals[ KlearlookStyle::GRADIENT_DARK ] ), SHADE_GRADIENT_DARK ); } -static void drawLines( QPainter *p, const QRect &r, bool horiz, int nLines, int offset, const QColor *cols, +static void drawLines( TQPainter *p, const TQRect &r, bool horiz, int nLines, int offset, const TQColor *cols, int startOffset, bool etched, bool lightGradient ) { int space = ( nLines * 2 ) + ( nLines - 1 ), x = horiz ? r.x() : r.x() + ( ( r.width() - space ) >> 1 ), @@ -416,16 +416,16 @@ static void drawLines( QPainter *p, const QRect &r, bool horiz, int nLines, int } } -inline QColor getFill( QStyle::SFlags flags, const QColor *use ) { - return !( flags & QStyle::Style_Enabled ) +inline TQColor getFill( TQStyle::SFlags flags, const TQColor *use ) { + return !( flags & TQStyle::Style_Enabled ) ? use[ 1 ] - : flags & QStyle::Style_Down + : flags & TQStyle::Style_Down ? use[ 3 ] - : flags & QStyle::Style_MouseOver - ? flags & ( QStyle::Style_On | QStyle::Style_Sunken ) + : flags & TQStyle::Style_MouseOver + ? flags & ( TQStyle::Style_On | TQStyle::Style_Sunken ) ? use[ 3 ].light( QTC_HIGHLIGHT_FACTOR ) : use[ NUM_SHADES ].light( QTC_HIGHLIGHT_FACTOR ) - : flags & ( QStyle::Style_On | QStyle::Style_Sunken ) + : flags & ( TQStyle::Style_On | TQStyle::Style_Sunken ) ? use[ 3 ] : use[ NUM_SHADES ]; } @@ -453,7 +453,7 @@ oldCursor( -1, -1 ), formMode( false ), hoverWidget( NULL ), hoverSect( QTC_NO_SECT ) { - QSettings s; + TQSettings s; contrast = s.readNumEntry( "/Qt/KDE/contrast", 7 ); if ( contrast < 0 || contrast > 10 ) @@ -466,24 +466,24 @@ hoverSect( QTC_NO_SECT ) { darkMenubar = s.readBoolEntry( "/klearlookstyle/Settings/darkMenubar", true ); popupmenuHighlightLevel = s.readNumEntry( "/klearlookstyle/Settings/popupmenuHighlightLevel", 3); - QString tmp = s.readEntry( "/klearlookstyle/Settings/toolbarBorders", QString::null ); + TQString tmp = s.readEntry( "/klearlookstyle/Settings/toolbarBorders", TQString::null ); toolbarBorders = tmp.isEmpty() ? TB_LIGHT : qtc_to_tbar_border( tmp.latin1() ); bool etched = s.readBoolEntry( "/klearlookstyle/Settings/etched", true ); - tmp = s.readEntry( "/klearlookstyle/Settings/sliderThumbs", QString::null ); + tmp = s.readEntry( "/klearlookstyle/Settings/sliderThumbs", TQString::null ); sliderThumbs = tmp.isEmpty() ? etched ? GROOVE_SUNKEN : GROOVE_RAISED : qtc_to_groove( tmp.latin1() ); - tmp = s.readEntry( "/klearlookstyle/Settings/lvExpander", QString::null ); + tmp = s.readEntry( "/klearlookstyle/Settings/lvExpander", TQString::null ); lvExpander = tmp.isEmpty() ? LV_EXP_ARR : qtc_to_lv_expander( tmp.latin1() ); - tmp = s.readEntry( "/klearlookstyle/Settings/lvLines", QString::null ); + tmp = s.readEntry( "/klearlookstyle/Settings/lvLines", TQString::null ); lvLines = tmp.isEmpty() ? LV_LINES_SOLID : qtc_to_lv_lines( tmp.latin1() ); @@ -518,7 +518,7 @@ hoverSect( QTC_NO_SECT ) { shadeColors( qApp->palette().active().button(), button ); } -void KlearlookStyle::polish( QApplication *app ) { +void KlearlookStyle::polish( TQApplication *app ) { if ( !qstrcmp( app->argv() [ 0 ], "kicker" ) || !qstrcmp( app->argv() [ 0 ], "appletproxy" ) ) { themedApp = APP_KICKER; #if KDE_VERSION >= 0x30200 @@ -537,8 +537,8 @@ void KlearlookStyle::polish( QApplication *app ) { themedApp = qstrcmp( qApp->argv() [ 0 ], "soffice.bin" ) ? APP_OTHER : APP_OPENOFFICE; } -void KlearlookStyle::polish( QPalette &pal ) { - int c = QSettings().readNumEntry( "/Qt/KDE/contrast", 7 ); +void KlearlookStyle::polish( TQPalette &pal ) { + int c = TQSettings().readNumEntry( "/Qt/KDE/contrast", 7 ); bool newContrast = false; if ( c < 0 || c > 10 ) @@ -562,100 +562,100 @@ void KlearlookStyle::polish( QPalette &pal ) { if ( qApp->palette().active().highlight() != menuPbar[ GRADIENT_BASE ] ) shadeGradient( qApp->palette().active().highlight(), menuPbar ); - const QColorGroup &actGroup = pal.active(), + const TQColorGroup &actGroup = pal.active(), &inactGroup = pal.inactive(); - const QColor *use = backgroundColors( actGroup ); - QColorGroup newAct( actGroup.foreground(), actGroup.button(), + const TQColor *use = backgroundColors( actGroup ); + TQColorGroup newAct( actGroup.foreground(), actGroup.button(), use[ 0 ], use[ 5 ], actGroup.mid(), actGroup.text(), actGroup.brightText(), actGroup.base(), actGroup.background() ); - newAct.setColor( QColorGroup::Highlight, actGroup.color( QColorGroup::Highlight ) ); + newAct.setColor( TQColorGroup::Highlight, actGroup.color( TQColorGroup::Highlight ) ); pal.setActive( newAct ); use = backgroundColors( inactGroup ); - QColorGroup newInact( inactGroup.foreground(), inactGroup.button(), + TQColorGroup newInact( inactGroup.foreground(), inactGroup.button(), use[ 0 ], use[ 5 ], inactGroup.mid(), inactGroup.text(), inactGroup.brightText(), inactGroup.base(), inactGroup.background() ); - newInact.setColor( QColorGroup::Highlight, inactGroup.color( QColorGroup::Highlight ) ); + newInact.setColor( TQColorGroup::Highlight, inactGroup.color( TQColorGroup::Highlight ) ); pal.setInactive( newInact ); } static const char * kdeToolbarWidget = "kde toolbar widget"; -void KlearlookStyle::polish( QWidget *widget ) { - if ( ::qt_cast<QRadioButton *>( widget ) - || ::qt_cast<QCheckBox *>( widget ) - || ::qt_cast<QSpinWidget *>( widget ) +void KlearlookStyle::polish( TQWidget *widget ) { + if ( tqqt_cast<TQRadioButton *>( widget ) + || tqqt_cast<TQCheckBox *>( widget ) + || tqqt_cast<TQSpinWidget *>( widget ) || widget->inherits( "QSplitterHandle" ) ) { #if QT_VERSION >= 0x030200 widget->setMouseTracking( true ); #endif widget->installEventFilter( this ); - } else if ( ::qt_cast<QButton *>( widget ) || ::qt_cast<QComboBox *>( widget ) || + } else if ( tqqt_cast<TQButton *>( widget ) || tqqt_cast<TQComboBox *>( widget ) || widget->inherits( "QToolBarExtensionWidget" ) ) { - widget->setBackgroundMode( QWidget::PaletteBackground ); + widget->setBackgroundMode( TQWidget::PaletteBackground ); widget->installEventFilter( this ); - } else if ( ::qt_cast<QMenuBar *>( widget ) - || ::qt_cast<QToolBar *>( widget ) - || ::qt_cast<QPopupMenu *>( widget ) ) - widget->setBackgroundMode( QWidget::PaletteBackground ); + } else if ( tqqt_cast<TQMenuBar *>( widget ) + || tqqt_cast<TQToolBar *>( widget ) + || tqqt_cast<TQPopupMenu *>( widget ) ) + widget->setBackgroundMode( TQWidget::PaletteBackground ); else if ( widget->inherits( "KToolBarSeparator" ) ) { - widget->setBackgroundMode( QWidget::NoBackground ); + widget->setBackgroundMode( TQWidget::NoBackground ); widget->installEventFilter( this ); - } else if ( ::qt_cast<QScrollBar *>( widget ) ) { + } else if ( tqqt_cast<TQScrollBar *>( widget ) ) { widget->setMouseTracking( true ); widget->installEventFilter( this ); - widget->setBackgroundMode( QWidget::NoBackground ); + widget->setBackgroundMode( TQWidget::NoBackground ); - } else if ( ::qt_cast<QSlider *>( widget ) || ::qt_cast<QHeader *>( widget ) ) { + } else if ( tqqt_cast<TQSlider *>( widget ) || tqqt_cast<TQHeader *>( widget ) ) { widget->setMouseTracking( true ); widget->installEventFilter( this ); } else if ( 0 == qstrcmp( widget->name(), kdeToolbarWidget ) ) { widget->installEventFilter( this ); - widget->setBackgroundMode( QWidget::NoBackground ); // We paint the whole background. + widget->setBackgroundMode( TQWidget::NoBackground ); // We paint the whole background. } KStyle::polish( widget ); } -void KlearlookStyle::unPolish( QWidget *widget ) { - if ( ::qt_cast<QRadioButton *>( widget ) || - ::qt_cast<QCheckBox *>( widget ) || - ::qt_cast<QSpinWidget *>( widget ) || +void KlearlookStyle::unPolish( TQWidget *widget ) { + if ( tqqt_cast<TQRadioButton *>( widget ) || + tqqt_cast<TQCheckBox *>( widget ) || + tqqt_cast<TQSpinWidget *>( widget ) || widget->inherits( "QSplitterHandle" ) ) { #if QT_VERSION >= 0x030200 widget->setMouseTracking( false ); #endif widget->removeEventFilter( this ); - } else if ( ::qt_cast<QButton *>( widget ) || ::qt_cast<QComboBox *>( widget ) || + } else if ( tqqt_cast<TQButton *>( widget ) || tqqt_cast<TQComboBox *>( widget ) || widget->inherits( "QToolBarExtensionWidget" ) ) { - widget->setBackgroundMode( QWidget::PaletteButton ); + widget->setBackgroundMode( TQWidget::PaletteButton ); widget->removeEventFilter( this ); - } else if ( ::qt_cast<QMenuBar *>( widget ) || - ::qt_cast<QToolBar *>( widget ) || - ::qt_cast<QPopupMenu *>( widget ) ) - widget->setBackgroundMode( QWidget::PaletteBackground ); + } else if ( tqqt_cast<TQMenuBar *>( widget ) || + tqqt_cast<TQToolBar *>( widget ) || + tqqt_cast<TQPopupMenu *>( widget ) ) + widget->setBackgroundMode( TQWidget::PaletteBackground ); else if ( widget->inherits( "KToolBarSeparator" ) ) { widget->setBackgroundMode( PaletteBackground ); widget->removeEventFilter( this ); - } else if ( ::qt_cast<QScrollBar *>( widget ) ) { + } else if ( tqqt_cast<TQScrollBar *>( widget ) ) { widget->setMouseTracking( false ); widget->removeEventFilter( this ); - widget->setBackgroundMode( QWidget::PaletteButton ); + widget->setBackgroundMode( TQWidget::PaletteButton ); - } else if ( ::qt_cast<QSlider *>( widget ) || - ::qt_cast<QHeader *>( widget ) ) { + } else if ( tqqt_cast<TQSlider *>( widget ) || + tqqt_cast<TQHeader *>( widget ) ) { widget->setMouseTracking( false ); widget->removeEventFilter( this ); @@ -667,12 +667,12 @@ void KlearlookStyle::unPolish( QWidget *widget ) { KStyle::unPolish( widget ); } -bool KlearlookStyle::eventFilter( QObject *object, QEvent *event ) { +bool KlearlookStyle::eventFilter( TQObject *object, TQEvent *event ) { if ( object->parent() && 0 == qstrcmp( object->name(), kdeToolbarWidget ) ) { // Draw background for custom widgets in the toolbar that have specified a "kde toolbar widget" name. - if ( QEvent::Paint == event->type() ) { - QWidget * widget = static_cast<QWidget*>( object ), - *parent = static_cast<QWidget*>( object->parent() ); + if ( TQEvent::Paint == event->type() ) { + TQWidget * widget = static_cast<TQWidget*>( object ), + *parent = static_cast<TQWidget*>( object->parent() ); #ifdef QTC_GRADIENT_TOOLBARS_AND_MENUBARS // Find the top-level toolbar of this widget, since it may be nested in other // widgets that are on the toolbar. @@ -682,37 +682,37 @@ bool KlearlookStyle::eventFilter( QObject *object, QEvent *event ) { while ( parent && parent->parent() && !qstrcmp( parent->name(), kdeToolbarWidget ) ) { x_offset += parent->x(); y_offset += parent->y(); - parent = static_cast<QWidget*>( parent->parent() ); + parent = static_cast<TQWidget*>( parent->parent() ); } - QRect pr( parent->rect() ); + TQRect pr( parent->rect() ); bool horiz_grad = pr.width() < pr.height(); // Check if the parent is a QToolbar, and use its orientation, else guess. - QToolBar *toolbar = dynamic_cast<QToolBar*>( parent ); + TQToolBar *toolbar = dynamic_cast<TQToolBar*>( parent ); if ( toolbar ) horiz_grad = toolbar->orientation() == Qt::Vertical; - drawBevelGradient( parent->colorGroup().background(), true, 1, &QPainter( widget ), - QRect( x_offset, y_offset, pr.width(), pr.height() ), + drawBevelGradient( parent->colorGroup().background(), true, 1, &TQPainter( widget ), + TQRect( x_offset, y_offset, pr.width(), pr.height() ), horiz_grad, SHADE_BAR_LIGHT, SHADE_BAR_DARK ); #else - QPainter( widget ).fillRect( widget->rect(), parent->colorGroup().background() ); + TQPainter( widget ).fillRect( widget->rect(), parent->colorGroup().background() ); #endif return false; // Now draw the contents } - } else if ( object->inherits( "KToolBarSeparator" ) && QEvent::Paint == event->type() ) { - QFrame * frame = dynamic_cast<QFrame*>( object ); + } else if ( object->inherits( "KToolBarSeparator" ) && TQEvent::Paint == event->type() ) { + TQFrame * frame = dynamic_cast<TQFrame*>( object ); - if ( frame && QFrame::NoFrame != frame->frameShape() ) { - QPainter painter( frame ); - if ( QFrame::VLine == frame->frameShape() ) + if ( frame && TQFrame::NoFrame != frame->frameShape() ) { + TQPainter painter( frame ); + if ( TQFrame::VLine == frame->frameShape() ) drawPrimitive( PE_DockWindowSeparator, &painter, frame->rect(), frame->colorGroup(), Style_Horizontal ); - else if ( QFrame::HLine == frame->frameShape() ) + else if ( TQFrame::HLine == frame->frameShape() ) drawPrimitive( PE_DockWindowSeparator, &painter, frame->rect(), frame->colorGroup() ); else @@ -721,36 +721,36 @@ bool KlearlookStyle::eventFilter( QObject *object, QEvent *event ) { } } switch ( event->type() ) { - case QEvent::Enter: + case TQEvent::Enter: if ( object->isWidgetType() ) { - hoverWidget = ( QWidget * ) object; + hoverWidget = ( TQWidget * ) object; if ( hoverWidget && hoverWidget->isEnabled() ) { if ( redrawHoverWidget() ) { hoverWidget->repaint( false ); if ( APP_KICKER == themedApp ) hover = HOVER_NONE; } - oldCursor = QCursor::pos(); + oldCursor = TQCursor::pos(); } else hoverWidget = NULL; } break; - case QEvent::Leave: + case TQEvent::Leave: if ( hoverWidget && object == hoverWidget ) { oldCursor.setX( -1 ); oldCursor.setY( -1 ); hoverWidget = NULL; - ( ( QWidget * ) object ) ->repaint( false ); + ( ( TQWidget * ) object ) ->repaint( false ); } break; - case QEvent::MouseMove: + case TQEvent::MouseMove: if ( hoverWidget && object->isWidgetType() ) { if ( redrawHoverWidget() ) { hoverWidget->repaint( false ); if ( APP_KICKER == themedApp ) hover = HOVER_NONE; } - oldCursor = QCursor::pos(); + oldCursor = TQCursor::pos(); } break; default: @@ -761,18 +761,18 @@ bool KlearlookStyle::eventFilter( QObject *object, QEvent *event ) { } void KlearlookStyle::drawLightBevelButton( - QPainter *p, - const QRect &r, - const QColorGroup &cg, - QStyle::SFlags flags, + TQPainter *p, + const TQRect &r, + const TQColorGroup &cg, + TQStyle::SFlags flags, bool useGrad, ERound round, - const QColor &fill, - const QColor *custom, + const TQColor &fill, + const TQColor *custom, bool light ) const { - QRect br( r ); - bool sunken = ( flags & ( QStyle::Style_Down | QStyle::Style_On | QStyle::Style_Sunken ) ); + TQRect br( r ); + bool sunken = ( flags & ( TQStyle::Style_Down | TQStyle::Style_On | TQStyle::Style_Sunken ) ); int dark = borderButton ? 4 : 5, c1 = sunken ? dark : light ? 6 : 0; @@ -781,7 +781,7 @@ void KlearlookStyle::drawLightBevelButton( if ( !borderButton ) br.addCoords( -1, -1, 1, 1 ); - if ( ( sunken && !borderButton ) || ( !sunken && flags & QStyle::Style_Raised ) ) { + if ( ( sunken && !borderButton ) || ( !sunken && flags & TQStyle::Style_Raised ) ) { p->setPen( custom ? custom[ c1 ] : gray[ c1 ] ); if ( APPEARANCE_LIGHT_GRADIENT != appearance ) { int c2 = sunken ? 0 : dark; @@ -809,7 +809,7 @@ void KlearlookStyle::drawLightBevelButton( // fill if ( useGrad && APPEARANCE_FLAT != appearance ) { drawBevelGradient( fill.dark( 100 ), !sunken, 0, p, - QRect( br.left() - 1, br.top() - 1, br.width() + 2, br.height() + 2 ), flags & Style_Horizontal, + TQRect( br.left() - 1, br.top() - 1, br.width() + 2, br.height() + 2 ), flags & Style_Horizontal, sunken ? SHADE_BEVEL_BUTTON_GRAD_LIGHT( appearance ) : SHADE_BEVEL_BUTTON_GRAD_LIGHT( appearance ), @@ -823,7 +823,7 @@ void KlearlookStyle::drawLightBevelButton( if ( rounded && ROUNDED_NONE != round ) { bool wide = r.width() >= QTC_MIN_BTN_SIZE, tall = r.height() >= QTC_MIN_BTN_SIZE; - QColor border( flags & Style_ButtonDefault && IND_FONT_COLOUR == defBtnIndicator & flags & Style_Enabled + TQColor border( flags & Style_ButtonDefault && IND_FONT_COLOUR == defBtnIndicator & flags & Style_Enabled ? cg.text() : custom ? custom[ 5 ] : gray[ 5 ] ); p->setPen( border.light(80) ); @@ -977,18 +977,18 @@ void KlearlookStyle::drawLightBevelButton( p->restore(); } void KlearlookStyle::drawLightBevel( - QPainter *p, - const QRect &r, - const QColorGroup &cg, - QStyle::SFlags flags, + TQPainter *p, + const TQRect &r, + const TQColorGroup &cg, + TQStyle::SFlags flags, bool useGrad, ERound round, - const QColor &fill, - const QColor *custom, + const TQColor &fill, + const TQColor *custom, bool light ) const { - QRect br( r ); - bool sunken = ( flags & ( QStyle::Style_Down | QStyle::Style_On | QStyle::Style_Sunken ) ); + TQRect br( r ); + bool sunken = ( flags & ( TQStyle::Style_Down | TQStyle::Style_On | TQStyle::Style_Sunken ) ); int dark = borderButton ? 4 : 5, c1 = sunken ? dark : light ? 6 : 0; p->save(); @@ -996,7 +996,7 @@ void KlearlookStyle::drawLightBevel( if ( !borderButton ) br.addCoords( -1, -1, 1, 1 ); - if ( ( sunken && !borderButton ) || ( !sunken && flags & QStyle::Style_Raised ) ) { + if ( ( sunken && !borderButton ) || ( !sunken && flags & TQStyle::Style_Raised ) ) { p->setPen( custom ? custom[ c1 ] : gray[ c1 ] ); if ( APPEARANCE_LIGHT_GRADIENT != appearance ) { int c2 = sunken ? 0 : dark; @@ -1023,7 +1023,7 @@ void KlearlookStyle::drawLightBevel( // fill if ( useGrad && APPEARANCE_FLAT != appearance ) { drawBevelGradient( fill, !sunken, 0, p, - QRect( br.left() - 1, br.top() - 1, br.width() + 2, br.height() + 2 ), + TQRect( br.left() - 1, br.top() - 1, br.width() + 2, br.height() + 2 ), flags & Style_Horizontal, sunken ? SHADE_BEVEL_GRAD_SEL_LIGHT( appearance ) : @@ -1040,7 +1040,7 @@ void KlearlookStyle::drawLightBevel( bool wide = r.width() >= QTC_MIN_BTN_SIZE, tall = r.height() >= QTC_MIN_BTN_SIZE; - QColor border = menuPbar[ GRADIENT_BASE ].dark( 130 ); + TQColor border = menuPbar[ GRADIENT_BASE ].dark( 130 ); p->setPen( border ); @@ -1193,10 +1193,10 @@ void KlearlookStyle::drawLightBevel( p->restore(); } -void KlearlookStyle::drawArrow( QPainter *p, const QRect &r, const QColorGroup &cg, QStyle::SFlags flags, - QStyle::PrimitiveElement pe, bool small, bool checkActive ) const { - QPointArray a; - const QColor &col = flags & Style_Enabled +void KlearlookStyle::drawArrow( TQPainter *p, const TQRect &r, const TQColorGroup &cg, TQStyle::SFlags flags, + TQStyle::PrimitiveElement pe, bool small, bool checkActive ) const { + TQPointArray a; + const TQColor &col = flags & Style_Enabled ? checkActive && flags & Style_Active ? cg.highlightedText() : cg.text() @@ -1205,16 +1205,16 @@ void KlearlookStyle::drawArrow( QPainter *p, const QRect &r, const QColorGroup & if ( vArrow ) if ( small ) switch ( pe ) { - case QStyle::PE_ArrowUp: + case TQStyle::PE_ArrowUp: a.setPoints( 7, 2, 1, 2, 0, 0, -2, -2, 0, -2, 1, -2, 0, 2, 0 ); break; - case QStyle::PE_ArrowDown: + case TQStyle::PE_ArrowDown: a.setPoints( 7, 2, -1, 2, 0, 0, 2, -2, 0, -2, -1, -2, 0, 2, 0 ); break; - case QStyle::PE_ArrowRight: + case TQStyle::PE_ArrowRight: a.setPoints( 7, 1, -2, 0, -2, -2, 0, 0, 2, 1, 2, 0, 2, 0, -2 ); break; - case QStyle::PE_ArrowLeft: + case TQStyle::PE_ArrowLeft: a.setPoints( 7, -1, -2, 0, -2, 2, 0, 0, 2, -1, 2, 0, 2, 0, -2 ); break; default: @@ -1222,16 +1222,16 @@ void KlearlookStyle::drawArrow( QPainter *p, const QRect &r, const QColorGroup & } else switch ( pe ) { - case QStyle::PE_ArrowUp: + case TQStyle::PE_ArrowUp: a.setPoints( 7, 3, 1, 0, -2, -3, 1, -2, 2, -1, 1, 1, 1, 2, 2 ); break; - case QStyle::PE_ArrowDown: + case TQStyle::PE_ArrowDown: a.setPoints( 7, 3, -1, 0, 2, -3, -1, -2, -2, -1, -1, 1, -1, 2, -2 ); break; - case QStyle::PE_ArrowRight: + case TQStyle::PE_ArrowRight: a.setPoints( 7, -1, -3, 2, 0, -1, 3, -2, 2, -1, 1, -1, -1, -2, -2 ); break; - case QStyle::PE_ArrowLeft: + case TQStyle::PE_ArrowLeft: a.setPoints( 7, 1, -3, -2, 0, 1, 3, 2, 2, 1, 1, 1, -1, 2, -2 ); break; default: @@ -1240,16 +1240,16 @@ void KlearlookStyle::drawArrow( QPainter *p, const QRect &r, const QColorGroup & else if ( small ) switch ( pe ) { - case QStyle::PE_ArrowUp: + case TQStyle::PE_ArrowUp: a.setPoints( 4, 2, 0, 0, -2, -2, 0, 2, 0 ); break; - case QStyle::PE_ArrowDown: + case TQStyle::PE_ArrowDown: a.setPoints( 4, 2, 0, 0, 2, -2, 0, 2, 0 ); break; - case QStyle::PE_ArrowRight: + case TQStyle::PE_ArrowRight: a.setPoints( 4, 0, -2, -2, 0, 0, 2, 0, -2 ); break; - case QStyle::PE_ArrowLeft: + case TQStyle::PE_ArrowLeft: a.setPoints( 4, 0, -2, 2, 0, 0, 2, 0, -2 ); break; default: @@ -1257,16 +1257,16 @@ void KlearlookStyle::drawArrow( QPainter *p, const QRect &r, const QColorGroup & } else switch ( pe ) { - case QStyle::PE_ArrowUp: + case TQStyle::PE_ArrowUp: a.setPoints( 4, 3, 1, 0, -2, -3, 1, 3, 1 ); break; - case QStyle::PE_ArrowDown: + case TQStyle::PE_ArrowDown: a.setPoints( 4, 3, -1, 0, 2, -3, -1, 3, -1 ); break; - case QStyle::PE_ArrowRight: + case TQStyle::PE_ArrowRight: a.setPoints( 4, -1, -3, 2, 0, -1, 3, -1, -3 ); break; - case QStyle::PE_ArrowLeft: + case TQStyle::PE_ArrowLeft: a.setPoints( 4, 1, -3, -2, 0, 1, 3, 1, -3 ); break; default: @@ -1284,13 +1284,13 @@ void KlearlookStyle::drawArrow( QPainter *p, const QRect &r, const QColorGroup & p->restore(); } -void KlearlookStyle::drawPrimitiveMenu( PrimitiveElement pe, QPainter *p, const QRect &r, const QColorGroup &cg, - SFlags flags, const QStyleOption &data ) const { +void KlearlookStyle::drawPrimitiveMenu( PrimitiveElement pe, TQPainter *p, const TQRect &r, const TQColorGroup &cg, + SFlags flags, const TQStyleOption &data ) const { switch ( pe ) { case PE_CheckMark: if ( flags & Style_On || !( flags & Style_Off ) ) // !(flags&Style_Off) is for tri-state { - QPointArray check; + TQPointArray check; int x = r.center().x() - 3, y = r.center().y() - 3; @@ -1323,15 +1323,15 @@ void KlearlookStyle::drawPrimitiveMenu( PrimitiveElement pe, QPainter *p, const } } -void KlearlookStyle::drawPrimitive( PrimitiveElement pe, QPainter *p, const QRect &r, const QColorGroup &cg, - SFlags flags, const QStyleOption &data ) const { +void KlearlookStyle::drawPrimitive( PrimitiveElement pe, TQPainter *p, const TQRect &r, const TQColorGroup &cg, + SFlags flags, const TQStyleOption &data ) const { int x, y, w, h; r.rect(&x, &y, &w, &h); switch ( pe ) { case PE_HeaderSection: { - const QColor * use = buttonColors( cg ); + const TQColor * use = buttonColors( cg ); if ( APP_KICKER == themedApp ) { @@ -1359,7 +1359,7 @@ void KlearlookStyle::drawPrimitive( PrimitiveElement pe, QPainter *p, const QRec flags = ( ( flags | Style_Sunken ) ^ Style_Sunken ) | Style_Raised; if ( QTC_NO_SECT != hoverSect && HOVER_HEADER == hover && hoverWidget ) { - QHeader * hd = dynamic_cast<QHeader *>( hoverWidget ); + TQHeader * hd = dynamic_cast<TQHeader *>( hoverWidget ); if ( hd && hd->isClickEnabled( hoverSect ) && r == hd->sectionRect( hoverSect ) ) flags |= Style_MouseOver; @@ -1376,10 +1376,10 @@ void KlearlookStyle::drawPrimitive( PrimitiveElement pe, QPainter *p, const QRec case PE_ButtonBevel: case PE_ButtonTool: case PE_ButtonDropDown: { - const QColor *use = buttonColors( cg ); + const TQColor *use = buttonColors( cg ); - if ( !( flags & QStyle::Style_Sunken ) ) // If its not sunken, its raised-don't want flat buttons. - flags |= QStyle::Style_Raised; + if ( !( flags & TQStyle::Style_Sunken ) ) // If its not sunken, its raised-don't want flat buttons. + flags |= TQStyle::Style_Raised; drawLightBevelButton( p, r, cg, flags | Style_Horizontal, true, r.width() < 16 || r.height() < 16 @@ -1396,7 +1396,7 @@ void KlearlookStyle::drawPrimitive( PrimitiveElement pe, QPainter *p, const QRec p->setBrush( NoBrush ); if ( rounded ) // borderButton) CPD Only use color[4] for rounded def buttons! { - const QColor * use = buttonColors( cg ); + const TQColor * use = buttonColors( cg ); p->setPen( use[ 4 ] ); int offset = r.width() >= QTC_MIN_BTN_SIZE && r.height() >= QTC_MIN_BTN_SIZE ? 4 : 3; @@ -1413,9 +1413,9 @@ void KlearlookStyle::drawPrimitive( PrimitiveElement pe, QPainter *p, const QRec } break; case IND_CORNER: { - const QColor *use = buttonColors( cg ); - QPointArray points; - bool sunken = flags & Style_Down || flags & QStyle::Style_Sunken; + const TQColor *use = buttonColors( cg ); + TQPointArray points; + bool sunken = flags & Style_Down || flags & TQStyle::Style_Sunken; int offset = sunken ? 4 : 3; points.setPoints( 3, r.x() + offset, r.y() + offset, r.x() + offset + 6, r.y() + offset, @@ -1445,7 +1445,7 @@ void KlearlookStyle::drawPrimitive( PrimitiveElement pe, QPainter *p, const QRec case PE_CheckMark: if ( flags & Style_On || !( flags & Style_Off ) ) // !(flags&Style_Off) is for tri-state { - QPointArray check; + TQPointArray check; int x = r.center().x() - 3, y = r.center().y() - 3; @@ -1472,66 +1472,66 @@ void KlearlookStyle::drawPrimitive( PrimitiveElement pe, QPainter *p, const QRec } break; case PE_CheckListController: { - QCheckListItem *item = data.checkListItem(); + TQCheckListItem *item = data.checkListItem(); if ( item ) { - QListView * lv = item->listView(); + TQListView * lv = item->listView(); int x = r.x(), y = r.y(), w = r.width(), h = r.height(), marg = lv->itemMargin(); - p->setPen( QPen( flags & Style_Enabled ? cg.text() - : lv->palette().color( QPalette::Disabled, QColorGroup::Text ) ) ); + p->setPen( TQPen( flags & Style_Enabled ? cg.text() + : lv->palette().color( TQPalette::Disabled, TQColorGroup::Text ) ) ); if ( flags & Style_Selected && !lv->rootIsDecorated() && !( ( item->parent() && 1 == item->parent() ->rtti() && - QCheckListItem::Controller == ( ( QCheckListItem* ) item->parent() ) ->type() ) )) { + TQCheckListItem::Controller == ( ( TQCheckListItem* ) item->parent() ) ->type() ) )) { p->fillRect( 0, 0, x + marg + w + 4, item->height(), - cg.brush( QColorGroup::Highlight ) ); + cg.brush( TQColorGroup::Highlight ) ); if ( item->isEnabled() ) - p->setPen( QPen( cg.highlightedText() ) ); + p->setPen( TQPen( cg.highlightedText() ) ); } if ( flags & Style_NoChange ) - p->setBrush( cg.brush( QColorGroup::Button ) ); + p->setBrush( cg.brush( TQColorGroup::Button ) ); p->drawRect( x + marg + 2, y + 4 + 2, w - 7, h - 8 ); p->drawRect( x + marg, y + 4, w - 7, h - 8 ); } break; } case PE_CheckListIndicator: { - QCheckListItem *item = data.checkListItem(); + TQCheckListItem *item = data.checkListItem(); if ( item ) { - QListView * lv = item->listView(); + TQListView * lv = item->listView(); - p->setPen( QPen( flags & Style_Enabled ? cg.text() - : lv->palette().color( QPalette::Disabled, QColorGroup::Text ), 2 ) ); + p->setPen( TQPen( flags & Style_Enabled ? cg.text() + : lv->palette().color( TQPalette::Disabled, TQColorGroup::Text ), 2 ) ); if ( flags & Style_Selected ) { flags -= Style_Selected; if ( !lv->rootIsDecorated() && !( ( item->parent() && 1 == item->parent() ->rtti() && - QCheckListItem::Controller == - ( ( QCheckListItem* ) item->parent() ) ->type() ) ) ) { + TQCheckListItem::Controller == + ( ( TQCheckListItem* ) item->parent() ) ->type() ) ) ) { p->fillRect( 0, 0, r.x() + lv->itemMargin() + r.width() + 4, item->height(), - cg.brush( QColorGroup::Highlight ) ); + cg.brush( TQColorGroup::Highlight ) ); if ( item->isEnabled() ) { - p->setPen( QPen( cg.highlightedText(), 2 ) ); + p->setPen( TQPen( cg.highlightedText(), 2 ) ); flags += Style_Selected; } } } if ( flags & Style_NoChange ) - p->setBrush( cg.brush( QColorGroup::Button ) ); + p->setBrush( cg.brush( TQColorGroup::Button ) ); p->drawRect( r.x() + lv->itemMargin(), r.y() + 2, r.width() - 4, r.width() - 4 ); - if ( flags & QStyle::Style_On || !( flags & Style_Off ) ) - drawPrimitive( PE_CheckMark, p, QRect( r.x() + lv->itemMargin(), + if ( flags & TQStyle::Style_On || !( flags & Style_Off ) ) + drawPrimitive( PE_CheckMark, p, TQRect( r.x() + lv->itemMargin(), r.y() + 2, r.width() - 4, r.width() - 4 ), cg, flags ); } break; } case PE_Indicator: { - const QColor *use = buttonColors( cg ); - bool on = flags & QStyle::Style_On || !( flags & Style_Off ); + const TQColor *use = buttonColors( cg ); + bool on = flags & TQStyle::Style_On || !( flags & Style_Off ); if ( APPEARANCE_FLAT != appearance ) drawPrimitive( PE_ButtonTool, p, r, cg, flags ); @@ -1563,16 +1563,16 @@ void KlearlookStyle::drawPrimitive( PrimitiveElement pe, QPainter *p, const QRec break; } case PE_CheckListExclusiveIndicator: { - QCheckListItem *item = data.checkListItem(); + TQCheckListItem *item = data.checkListItem(); if ( item ) { - const QColor & bgnd = cg.background(), + const TQColor & bgnd = cg.background(), &on = flags & Style_Enabled ? cg.text() : cg.mid(); bool set - = flags & QStyle::Style_On; - QPointArray outer, + = flags & TQStyle::Style_On; + TQPointArray outer, inner, aa; int x = r.x(), y = r.y() + 2; @@ -1615,7 +1615,7 @@ void KlearlookStyle::drawPrimitive( PrimitiveElement pe, QPainter *p, const QRec case PE_ExclusiveIndicator: case PE_ExclusiveIndicatorMask: { int x = r.x(), y = r.y(); - QPointArray outer; + TQPointArray outer; outer.setPoints( 24, x, y + 8, x, y + 4, x + 1, y + 3, x + 1, y + 2, x + 2, y + 1, x + 3, y + 1, x + 4, y, x + 8, y, x + 9, y + 1, x + 10, y + 1, x + 11, y + 2, x + 11, y + 3, @@ -1629,21 +1629,21 @@ void KlearlookStyle::drawPrimitive( PrimitiveElement pe, QPainter *p, const QRec p->setBrush( Qt::color1 ); p->drawPolygon( outer ); } else { - QPointArray shadow; - const QColor &bgnd = flags & Style_Enabled ? cg.base() : cg.background(), + TQPointArray shadow; + const TQColor &bgnd = flags & Style_Enabled ? cg.base() : cg.background(), &on = flags & Style_Enabled ? flags & Style_Selected ? cg.highlightedText() : cg.text() : cg.mid(); - QColor indBgnd = bgnd; - const QColor *use = buttonColors( cg ); - QColor leftShadowColor, + TQColor indBgnd = bgnd; + const TQColor *use = buttonColors( cg ); + TQColor leftShadowColor, rightShadowColor, outerLeftColor, outerRightColor; bool set - = flags & QStyle::Style_On; + = flags & TQStyle::Style_On; if ( APPEARANCE_FLAT != appearance && !borderButton ) shadow.setPoints( 14, x + 1, y + 10, x + 1, y + 9, x, y + 8, x, y + 4, @@ -1660,9 +1660,9 @@ void KlearlookStyle::drawPrimitive( PrimitiveElement pe, QPainter *p, const QRec if ( APPEARANCE_FLAT != appearance ) { indBgnd = getFill( flags, use ); - p->setClipRegion( QRegion( outer ) ); + p->setClipRegion( TQRegion( outer ) ); drawBevelGradient( indBgnd, !set, 0, p, - QRect( x + 1, y + 1, r.width() - 2, r.height() - 2 ), true, + TQRect( x + 1, y + 1, r.width() - 2, r.height() - 2 ), true, set ? SHADE_BEVEL_GRAD_SEL_LIGHT( appearance ) : SHADE_BEVEL_GRAD_LIGHT( appearance ), set ? SHADE_BEVEL_GRAD_SEL_DARK( appearance ) : SHADE_BEVEL_GRAD_DARK( appearance ) ); @@ -1726,7 +1726,7 @@ void KlearlookStyle::drawPrimitive( PrimitiveElement pe, QPainter *p, const QRec } if ( !formMode ) { - QPointArray outerAaLeft, + TQPointArray outerAaLeft, outerAaRight; outerAaLeft.setPoints( 8, x, y + 3, x + 1, y + 1, x + 3, y, @@ -1746,7 +1746,7 @@ void KlearlookStyle::drawPrimitive( PrimitiveElement pe, QPainter *p, const QRec p->setPen( midColor( use[ 5 ], indBgnd, 1.5 ) ); if ( APPEARANCE_FLAT != appearance ) { - QPointArray innerAa; + TQPointArray innerAa; if ( !set && !( flags & Style_Down ) ) { @@ -1762,7 +1762,7 @@ void KlearlookStyle::drawPrimitive( PrimitiveElement pe, QPainter *p, const QRec } } } else { - QPointArray innerAa; + TQPointArray innerAa; innerAa.setPoints( 6, x + 4, y + 11, x + 8, y + 11, x + 10, y + 10, x + 11, y + 8, x + 11, y + 4, x + 10, y + 2 ); @@ -1773,20 +1773,20 @@ void KlearlookStyle::drawPrimitive( PrimitiveElement pe, QPainter *p, const QRec break; } case PE_DockWindowSeparator: { - QPoint p1, + TQPoint p1, p2; - //const QColor *use=backgroundColors(cg); + //const TQColor *use=backgroundColors(cg); if ( flags & Style_Horizontal ) { int offset = r.height() > 18 ? 6 : r.height() > 12 ? 4 : r.height() > 6 ? 2 : 0; - p1 = QPoint( r.width() >> 1, 0 + offset ); - p2 = QPoint( p1.x(), r.height() - offset ); + p1 = TQPoint( r.width() >> 1, 0 + offset ); + p2 = TQPoint( p1.x(), r.height() - offset ); } else { int offset = r.width() > 18 ? 6 : r.width() > 12 ? 4 : r.width() > 6 ? 2 : 0; - p1 = QPoint( 0 + offset, r.height() >> 1 ); - p2 = QPoint( r.width() - offset, p1.y() ); + p1 = TQPoint( 0 + offset, r.height() >> 1 ); + p2 = TQPoint( r.width() - offset, p1.y() ); } p->fillRect( r, cg.background() ); p->setPen( cg.background().dark( 111 ) ); @@ -1795,17 +1795,17 @@ void KlearlookStyle::drawPrimitive( PrimitiveElement pe, QPainter *p, const QRec break; } case PE_Splitter: { - const QColor *use = buttonColors( cg ); + const TQColor *use = buttonColors( cg ); if ( hoverWidget && hoverWidget == p->device() ) flags |= Style_MouseOver; if ( borderSplitter ) - drawLightBevelButton( p, r, cg, QStyle::Style_Raised, false, + drawLightBevelButton( p, r, cg, TQStyle::Style_Raised, false, ROUNDED_NONE, getFill( flags, use ), use ); else { p->fillRect( r, - QColor( flags & Style_MouseOver ? + TQColor( flags & Style_MouseOver ? cg.background().light( QTC_HIGHLIGHT_FACTOR ) : cg.background() ) ); drawLines( p, r, flags & Style_Horizontal, 70, 1, use, 0, TRUE, @@ -1839,14 +1839,14 @@ void KlearlookStyle::drawPrimitive( PrimitiveElement pe, QPainter *p, const QRec } case PE_PanelLineEdit: { - const QColor *use = backgroundColors( cg ); + const TQColor *use = backgroundColors( cg ); p->setPen( use[ 4 ].light(80) ); p->drawRect( r ); break; } case PE_PanelPopup: { - const QColor *use = backgroundColors( cg ); + const TQColor *use = backgroundColors( cg ); if ( borderFrame && ( data.isDefault() || data.lineWidth() > 1 ) ) { p->setPen( use[ 4 ].light(70) ); @@ -1856,7 +1856,7 @@ void KlearlookStyle::drawPrimitive( PrimitiveElement pe, QPainter *p, const QRec #ifdef MENU_POPUP_SHADOW qDrawShadePanel( p, r.x() + 1, r.y() + 1, r.width() - 2, r.height() - 2, - QColorGroup( use[ 4 ], use[ NUM_SHADES ], use[ 0 ], use[ 4 ], use[ 2 ], + TQColorGroup( use[ 4 ], use[ NUM_SHADES ], use[ 0 ], use[ 4 ], use[ 2 ], cg.text(), use[ NUM_SHADES ] ), flags & Style_Sunken, data.isDefault() ? QTC_BORDERED_FRAME_WIDTH - 1 : data.lineWidth() - 1 ); @@ -1864,7 +1864,7 @@ void KlearlookStyle::drawPrimitive( PrimitiveElement pe, QPainter *p, const QRec } else qDrawShadePanel( p, r, - QColorGroup( + TQColorGroup( use[ 5 ], use[ NUM_SHADES ], use[ 0 ], use[ 5 ], use[ 2 ], cg.text(), use[ NUM_SHADES ] ), @@ -1872,7 +1872,7 @@ void KlearlookStyle::drawPrimitive( PrimitiveElement pe, QPainter *p, const QRec break; } case PE_PanelTabWidget: { - const QColor *use = backgroundColors( cg ); + const TQColor *use = backgroundColors( cg ); if ( borderFrame && ( data.isDefault() || data.lineWidth() > 1 ) ) { p->setPen( use[ 4 ] ); @@ -1881,7 +1881,7 @@ void KlearlookStyle::drawPrimitive( PrimitiveElement pe, QPainter *p, const QRec #ifdef MENU_POPUP_SHADOW qDrawShadePanel( p, r.x() + 1, r.y() + 1, r.width() - 2, r.height() - 2, - QColorGroup( use[ 4 ], use[ NUM_SHADES ], use[ 0 ], use[ 4 ], use[ 2 ], + TQColorGroup( use[ 4 ], use[ NUM_SHADES ], use[ 0 ], use[ 4 ], use[ 2 ], cg.text(), use[ NUM_SHADES ] ), flags & Style_Sunken, data.isDefault() ? QTC_BORDERED_FRAME_WIDTH - 1 : data.lineWidth() - 1 ); @@ -1889,7 +1889,7 @@ void KlearlookStyle::drawPrimitive( PrimitiveElement pe, QPainter *p, const QRec } else qDrawShadePanel( p, r, - QColorGroup( + TQColorGroup( use[ 5 ], use[ NUM_SHADES ], use[ 0 ], use[ 5 ], use[ 2 ], cg.text(), use[ NUM_SHADES ] ), @@ -1898,12 +1898,12 @@ void KlearlookStyle::drawPrimitive( PrimitiveElement pe, QPainter *p, const QRec } case PE_PanelDockWindow: case PE_PanelMenuBar: { - const QColor *use = backgroundColors( cg ); + const TQColor *use = backgroundColors( cg ); switch ( toolbarBorders ) { case TB_DARK: qDrawShadePanel( p, r.x(), r.y(), r.width(), r.height(), - QColorGroup( + TQColorGroup( use[ 5 ].dark( 120 ), use[ NUM_SHADES ], use[ 0 ], use[ 5 ].dark( 120 ), use[ 2 ], cg.text(), use[ NUM_SHADES ] ), @@ -1923,7 +1923,7 @@ void KlearlookStyle::drawPrimitive( PrimitiveElement pe, QPainter *p, const QRec case TB_LIGHT: qDrawShadePanel( p, r.x(), r.y(), r.width(), r.height(), - QColorGroup( + TQColorGroup( use[ 3 ], use[ NUM_SHADES ], use[ 0 ], use[ 3 ], use[ 2 ], cg.text(), use[ NUM_SHADES ] @@ -1949,8 +1949,8 @@ void KlearlookStyle::drawPrimitive( PrimitiveElement pe, QPainter *p, const QRec } case PE_ScrollBarAddLine: case PE_ScrollBarSubLine: { - bool down = ( flags & ( QStyle::Style_Down | QStyle::Style_On | QStyle::Style_Sunken ) ); - const QColor *use = buttonColors( cg ); + bool down = ( flags & ( TQStyle::Style_Down | TQStyle::Style_On | TQStyle::Style_Sunken ) ); + const TQColor *use = buttonColors( cg ); pe = flags & Style_Horizontal ? PE_ScrollBarAddLine == pe @@ -1973,7 +1973,7 @@ void KlearlookStyle::drawPrimitive( PrimitiveElement pe, QPainter *p, const QRec } case PE_ScrollBarSubPage: case PE_ScrollBarAddPage: { - const QColor *use = backgroundColors( cg ); + const TQColor *use = backgroundColors( cg ); if ( borderButton ) { if ( flags & Style_Horizontal ) { @@ -1992,7 +1992,7 @@ void KlearlookStyle::drawPrimitive( PrimitiveElement pe, QPainter *p, const QRec break; } case PE_ScrollBarSlider: { - const QColor *use = buttonColors( cg ); + const TQColor *use = buttonColors( cg ); @@ -2020,8 +2020,8 @@ void KlearlookStyle::drawPrimitive( PrimitiveElement pe, QPainter *p, const QRec break; case PE_SpinWidgetUp: case PE_SpinWidgetDown: { - QRect sr( r ); - const QColor *use = buttonColors( cg ); + TQRect sr( r ); + const TQColor *use = buttonColors( cg ); drawLightBevelButton( p, sr, cg, flags | Style_Horizontal, true, PE_SpinWidgetDown == pe ? ROUNDED_BOTTOM : ROUNDED_TOP, @@ -2041,8 +2041,8 @@ void KlearlookStyle::drawPrimitive( PrimitiveElement pe, QPainter *p, const QRec } } -void KlearlookStyle::drawKStylePrimitive( KStylePrimitive kpe, QPainter *p, const QWidget *widget, const QRect &r, - const QColorGroup &cg, SFlags flags, const QStyleOption &opt ) const { +void KlearlookStyle::drawKStylePrimitive( KStylePrimitive kpe, TQPainter *p, const TQWidget *widget, const TQRect &r, + const TQColorGroup &cg, SFlags flags, const TQStyleOption &opt ) const { switch ( kpe ) { case KPE_ToolBarHandle: case KPE_GeneralHandle: @@ -2059,7 +2059,7 @@ void KlearlookStyle::drawKStylePrimitive( KStylePrimitive kpe, QPainter *p, cons break; case KPE_ListViewExpander: { int lvSize = QTC_LV_SIZE( lvExpander ); - QRect ar( r.x() + ( ( r.width() - ( lvSize + 4 ) ) >> 1 ), + TQRect ar( r.x() + ( ( r.width() - ( lvSize + 4 ) ) >> 1 ), r.y() + ( ( r.height() - ( lvSize + 4 ) ) >> 1 ), lvSize + 4, lvSize + 4 ); p->setPen( /*lvDark ? cg.text() : */cg.mid() ); @@ -2090,7 +2090,7 @@ void KlearlookStyle::drawKStylePrimitive( KStylePrimitive kpe, QPainter *p, cons if ( LV_EXP_ARR == lvExpander ) drawArrow( p, ar, cg, flags | Style_Enabled, flags & Style_On // Collapsed = On - ? QApplication::reverseLayout() + ? TQApplication::reverseLayout() ? PE_ArrowLeft : PE_ArrowRight : PE_ArrowDown ); @@ -2116,17 +2116,17 @@ void KlearlookStyle::drawKStylePrimitive( KStylePrimitive kpe, QPainter *p, cons // Taken and modified (colour wise) from kstyle.cpp - which in turn comes from // qwindowsstyl.cpp { - static QBitmap *verticalLine = 0, + static TQBitmap *verticalLine = 0, *horizontalLine = 0; - static QCleanupHandler<QBitmap> lvCleanupBitmap; + static TQCleanupHandler<TQBitmap> lvCleanupBitmap; // Create the dotline pixmaps if not already created if ( !verticalLine ) { // make 128*1 and 1*128 bitmaps that can be used for drawing the right sort of lines. - verticalLine = new QBitmap( 1, 129, true ); - horizontalLine = new QBitmap( 128, 1, true ); - QPointArray a( 64 ); - QPainter p2; + verticalLine = new TQBitmap( 1, 129, true ); + horizontalLine = new TQBitmap( 128, 1, true ); + TQPointArray a( 64 ); + TQPainter p2; p2.begin( verticalLine ); @@ -2137,7 +2137,7 @@ void KlearlookStyle::drawKStylePrimitive( KStylePrimitive kpe, QPainter *p, cons p2.setPen( color1 ); p2.drawPoints( a ); p2.end(); - QApplication::flushX(); + TQApplication::flushX(); verticalLine->setMask( *verticalLine ); p2.begin( horizontalLine ); @@ -2148,7 +2148,7 @@ void KlearlookStyle::drawKStylePrimitive( KStylePrimitive kpe, QPainter *p, cons p2.setPen( color1 ); p2.drawPoints( a ); p2.end(); - QApplication::flushX(); + TQApplication::flushX(); horizontalLine->setMask( *horizontalLine ); lvCleanupBitmap.add( &verticalLine ); @@ -2202,22 +2202,22 @@ void KlearlookStyle::drawKStylePrimitive( KStylePrimitive kpe, QPainter *p, cons void KlearlookStyle::drawControl( ControlElement control, - QPainter *p, - const QWidget *widget, - const QRect &r, - const QColorGroup &cg, SFlags flags, const QStyleOption &data ) const + TQPainter *p, + const TQWidget *widget, + const TQRect &r, + const TQColorGroup &cg, SFlags flags, const TQStyleOption &data ) const { if ( widget == hoverWidget ) flags |= Style_MouseOver; switch ( control ) { case CE_TabBarTab: { - const QTabBar * tb = ( const QTabBar * ) widget; + const TQTabBar * tb = ( const TQTabBar * ) widget; bool cornerWidget = false, firstTab = 0 == tb->indexOf( data.tab() ->identifier() ); - if ( ::qt_cast<const QTabWidget *>( tb->parent() ) ) { - const QTabWidget * tw = ( const QTabWidget* ) tb->parent(); + if ( tqqt_cast<const TQTabWidget *>( tb->parent() ) ) { + const TQTabWidget * tw = ( const TQTabWidget* ) tb->parent(); // is there a corner widget in the (top) left edge? if ( tw->cornerWidget( Qt::TopLeft ) ) @@ -2225,13 +2225,13 @@ void KlearlookStyle::drawControl( } if ( borderFrame ) { - QRect tr( r ), + TQRect tr( r ), fr( r ); int offset = rounded ? 2 : 0; switch ( tb->shape() ) { - case QTabBar::TriangularAbove: - case QTabBar::RoundedAbove: + case TQTabBar::TriangularAbove: + case TQTabBar::RoundedAbove: if ( flags & Style_Selected ) { tr.addCoords( 0, 0, 0, -1 ); fr.addCoords( 2, 2, -2, -2 ); @@ -2317,8 +2317,8 @@ void KlearlookStyle::drawControl( p->fillRect( fr, flags & Style_Selected ? cg.background() : gray[ 2 ] ); break; - case QTabBar::TriangularBelow: - case QTabBar::RoundedBelow: + case TQTabBar::TriangularBelow: + case TQTabBar::RoundedBelow: if ( flags & Style_Selected ) { fr.addCoords( 3, 2, -3, -3 ); p->setPen( gray[ 5 ] ); @@ -2382,11 +2382,11 @@ void KlearlookStyle::drawControl( KStyle::drawControl( control, p, widget, r, cg, flags, data ); } } else { - QRect br( r ); + TQRect br( r ); switch ( tb->shape() ) { - case QTabBar::TriangularAbove: - case QTabBar::RoundedAbove: + case TQTabBar::TriangularAbove: + case TQTabBar::RoundedAbove: if ( flags & Style_Selected ) { p->setPen( cg.background() ); p->drawLine( br.bottomLeft(), br.bottomRight() ); @@ -2419,8 +2419,8 @@ void KlearlookStyle::drawControl( else p->fillRect( br, flags & Style_Selected ? cg.background() : gray[ 2 ] ); break; - case QTabBar::TriangularBelow: - case QTabBar::RoundedBelow: + case TQTabBar::TriangularBelow: + case TQTabBar::RoundedBelow: if ( flags & Style_Selected ) { p->setPen( cg.background() ); p->drawLine( br.topLeft(), br.topRight() ); @@ -2465,16 +2465,16 @@ void KlearlookStyle::drawControl( if ( data.isDefault() ) break; - const QTabBar *tb = ( const QTabBar * ) widget; - QTab *t = data.tab(); - QRect tr = r; + const TQTabBar *tb = ( const TQTabBar * ) widget; + TQTab *t = data.tab(); + TQRect tr = r; if ( t->identifier() == tb->currentTab() ) { - if ( QTabBar::RoundedAbove == tb->shape() || QTabBar::TriangularAbove == tb->shape() ) - tr.setBottom( tr.bottom() - pixelMetric( QStyle::PM_TabBarTabShiftVertical, tb ) ); + if ( TQTabBar::RoundedAbove == tb->shape() || TQTabBar::TriangularAbove == tb->shape() ) + tr.setBottom( tr.bottom() - pixelMetric( TQStyle::PM_TabBarTabShiftVertical, tb ) ); } else - if ( QTabBar::RoundedBelow == tb->shape() || QTabBar::TriangularBelow == tb->shape() ) - tr.setTop( tr.top() + pixelMetric( QStyle::PM_TabBarTabShiftVertical, tb ) ); + if ( TQTabBar::RoundedBelow == tb->shape() || TQTabBar::TriangularBelow == tb->shape() ) + tr.setTop( tr.top() + pixelMetric( TQStyle::PM_TabBarTabShiftVertical, tb ) ); drawItem( p, tr, AlignCenter | ShowPrefix, cg, flags & Style_Enabled, 0, t->text() ); @@ -2489,7 +2489,7 @@ void KlearlookStyle::drawControl( r.rect( &x, &y, &w, &h ); - const QPushButton *button = static_cast<const QPushButton *>( widget ); + const TQPushButton *button = static_cast<const TQPushButton *>( widget ); bool active = button->isOn() || button->isDown(), cornArrow = false; @@ -2506,12 +2506,12 @@ void KlearlookStyle::drawControl( margin = pixelMetric( PM_ButtonMargin, widget ); if ( button->iconSet() && !button->iconSet() ->isNull() && - ( dx + button->iconSet() ->pixmap ( QIconSet::Small, QIconSet::Normal, - QIconSet::Off ).width() ) >= w ) + ( dx + button->iconSet() ->pixmap ( TQIconSet::Small, TQIconSet::Normal, + TQIconSet::Off ).width() ) >= w ) cornArrow = true; //To little room. Draw the arrow in the corner, don't adjust the widget else { drawPrimitive( PE_ArrowDown, - p, visualRect( QRect( + p, visualRect( TQRect( ( x + w ) - ( dx + margin ), y, dx, h ), r ), cg, flags, data ); @@ -2521,15 +2521,15 @@ void KlearlookStyle::drawControl( // Draw the icon if there is one if ( button->iconSet() && !button->iconSet() ->isNull() ) { - QIconSet::Mode mode = QIconSet::Disabled; - QIconSet::State state = QIconSet::Off; + TQIconSet::Mode mode = TQIconSet::Disabled; + TQIconSet::State state = TQIconSet::Off; if ( button->isEnabled() ) - mode = button->hasFocus() ? QIconSet::Active : QIconSet::Normal; + mode = button->hasFocus() ? TQIconSet::Active : TQIconSet::Normal; if ( button->isToggleButton() && button->isOn() ) - state = QIconSet::On; + state = TQIconSet::On; - QPixmap pixmap = button->iconSet() ->pixmap( QIconSet::Small, mode, state ); + TQPixmap pixmap = button->iconSet() ->pixmap( TQIconSet::Small, mode, state ); static const int constSpace = 2; @@ -2553,7 +2553,7 @@ void KlearlookStyle::drawControl( } if ( cornArrow ) //Draw over the icon - drawPrimitive( PE_ArrowDown, p, visualRect( QRect( x + w - 6, x + h - 6, 7, 7 ), r ), + drawPrimitive( PE_ArrowDown, p, visualRect( TQRect( x + w - 6, x + h - 6, 7, 7 ), r ), cg, flags, data ); if ( xo && iw ) { @@ -2570,7 +2570,7 @@ void KlearlookStyle::drawControl( j = boldDefText && button->isDefault() ? 2 : 1; for ( i = 0; i < j; i++ ) - drawItem( p, QRect( x + i, y, w, h ), + drawItem( p, TQRect( x + i, y, w, h ), AlignCenter | ShowPrefix, button->colorGroup(), button->isEnabled(), @@ -2581,7 +2581,7 @@ void KlearlookStyle::drawControl( //Draw a focus rect if the button has focus if ( flags & Style_HasFocus ) drawPrimitive( PE_FocusRect, p, - QStyle::visualRect( subRect( SR_PushButtonFocusRect, widget ), widget ), cg, flags ); + TQStyle::visualRect( subRect( SR_PushButtonFocusRect, widget ), widget ), cg, flags ); break; } @@ -2589,8 +2589,8 @@ void KlearlookStyle::drawControl( if ( !widget || data.isDefault() ) break; - const QPopupMenu *popupmenu = ( const QPopupMenu * ) widget; - QMenuItem *mi = data.menuItem(); + const TQPopupMenu *popupmenu = ( const TQPopupMenu * ) widget; + TQMenuItem *mi = data.menuItem(); int tab = data.tabWidth(), maxpmw = data.maxIconWidth(), x, y, w, h; @@ -2610,7 +2610,7 @@ void KlearlookStyle::drawControl( break; if ( mi->isSeparator() ) { - const QColor * use = backgroundColors( cg ); + const TQColor * use = backgroundColors( cg ); p->setPen( cg.background().dark(105) ); p->drawLine( r.left() + 5, r.top() + 3, r.right() - 5, r.top() + 3 ); break; @@ -2618,7 +2618,7 @@ void KlearlookStyle::drawControl( maxpmw = QMAX( maxpmw, 16 ); - QRect cr, ir, tr, sr; + TQRect cr, ir, tr, sr; if (menuIcons) { // check column cr.setRect( r.left(), r.top(), maxpmw, r.height() ); @@ -2639,7 +2639,7 @@ void KlearlookStyle::drawControl( tr.setCoords( sr.left() - tab - 4, r.top(), sr.left(), r.bottom() ); } - bool reverse = QApplication::reverseLayout(); + bool reverse = TQApplication::reverseLayout(); if ( reverse ) { cr = visualRect( cr, r ); @@ -2650,26 +2650,26 @@ void KlearlookStyle::drawControl( if ( mi->iconSet() && menuIcons ) { // Select the correct icon from the iconset - QIconSet::Mode mode = flags & Style_Active - ? ( mi->isEnabled() ? QIconSet::Active : QIconSet::Disabled ) - : ( mi->isEnabled() ? QIconSet::Normal : QIconSet::Disabled ); - cr = visualRect( QRect( x, y, maxpmw, h ), r ); + TQIconSet::Mode mode = flags & Style_Active + ? ( mi->isEnabled() ? TQIconSet::Active : TQIconSet::Disabled ) + : ( mi->isEnabled() ? TQIconSet::Normal : TQIconSet::Disabled ); + cr = visualRect( TQRect( x, y, maxpmw, h ), r ); // Do we have an icon and are checked at the same time? // Then draw a "pressed" background behind the icon if ( popupmenu->isCheckable() && mi->isChecked() ) { - QBrush brush( gray[ 3 ] ); + TQBrush brush( gray[ 3 ] ); qDrawShadePanel( p, cr.x() + 1, cr.y() + 2, cr.width() - 2, cr.height() - 4, - QColorGroup( gray[ 5 ], gray[ NUM_SHADES ], gray[ 0 ], gray[ 5 ], + TQColorGroup( gray[ 5 ], gray[ NUM_SHADES ], gray[ 0 ], gray[ 5 ], gray[ 2 ], cg.text(), gray[ NUM_SHADES ] ), true, 1, &brush ); } // Draw the icon - QPixmap pixmap = mi->iconSet() ->pixmap( QIconSet::Small, mode ); - QRect pmr( 0, 0, pixmap.width(), pixmap.height() ); + TQPixmap pixmap = mi->iconSet() ->pixmap( TQIconSet::Small, mode ); + TQRect pmr( 0, 0, pixmap.width(), pixmap.height() ); pmr.moveCenter( cr.center() ); p->drawPixmap( pmr.topLeft(), pixmap ); @@ -2685,12 +2685,12 @@ void KlearlookStyle::drawControl( // item column ir.setCoords( cr.right() + 2, r.top(), tr.right() - 4, r.bottom() ); - QBrush brush( mi->isEnabled() ? cg.highlightedText() : cg.background() ); + TQBrush brush( mi->isEnabled() ? cg.highlightedText() : cg.background() ); drawPrimitiveMenu( PE_CheckMark, p, cr, cg, ( flags & ( Style_Enabled | Style_Active ) ) | Style_On ); } - QColor textcolor, embosscolor; + TQColor textcolor, embosscolor; if ( flags & Style_Active ) { if ( !( flags & Style_Enabled ) ) { @@ -2721,7 +2721,7 @@ void KlearlookStyle::drawControl( p->restore(); } - QString text = mi->text(); + TQString text = mi->text(); if ( !text.isNull() ) { int t = text.find( '\t' ); @@ -2757,7 +2757,7 @@ void KlearlookStyle::drawControl( p->drawText( ir, alignFlag, text, t ); } else if ( mi->pixmap() ) { - QPixmap pixmap = *mi->pixmap(); + TQPixmap pixmap = *mi->pixmap(); if ( 1 == pixmap.depth() ) p->setBackgroundMode( OpaqueMode ); @@ -2774,7 +2774,7 @@ void KlearlookStyle::drawControl( if ( ( flags & Style_Enabled ) && ( flags & Style_Active ) && ( flags & Style_Down ) ) { - drawPBarOrMenu2( p, QRect(r.x(), r.y(), r.width(), r.height()), + drawPBarOrMenu2( p, TQRect(r.x(), r.y(), r.width(), r.height()), true, cg, true ); } else #ifdef QTC_GRADIENT_TOOLBARS_AND_MENUBARS @@ -2786,7 +2786,7 @@ void KlearlookStyle::drawControl( #endif if (darkMenubar) { drawBevelGradient( cg.background(), true, 1, p, - QRect(r.x()-1, r.y()-1, r.width()+2, r.height()+2), + TQRect(r.x()-1, r.y()-1, r.width()+2, r.height()+2), true, SHADE_BEVEL_MENU_GRAD_LIGHT( appearance ), SHADE_BEVEL_MENU_GRAD_DARK( appearance )); } else @@ -2795,7 +2795,7 @@ void KlearlookStyle::drawControl( if ( data.isDefault() ) break; - QMenuItem *mi = data.menuItem(); + TQMenuItem *mi = data.menuItem(); if ( flags & Style_Active && ( flags & Style_Down ) ) drawItem( p, r, AlignCenter | ShowPrefix | DontClip | SingleLine, @@ -2808,10 +2808,10 @@ void KlearlookStyle::drawControl( case CE_MenuBarEmptyArea: if (darkMenubar) { //p->fillRect( r, cg.background().dark( 106 ) ); - QColor b; + TQColor b; b.setRgb(cg.background().red(), cg.background().green(), cg.background().blue()); drawBevelGradient( b, true, 1, p, - QRect(r.x()-1, r.y()-1, r.width()+2, r.height()+2 ), + TQRect(r.x()-1, r.y()-1, r.width()+2, r.height()+2 ), true, SHADE_BEVEL_MENU_GRAD_LIGHT( appearance ), SHADE_BEVEL_MENU_GRAD_DARK( appearance )); } else @@ -2832,17 +2832,17 @@ void KlearlookStyle::drawControl( p->setBrush( gray[ NUM_SHADES ] ); p->drawRect( r ); qDrawShadePanel( p, r, - QColorGroup( gray[ 5 ], gray[ NUM_SHADES ], gray[ 0 ], gray[ 5 ], gray[ 2 ], + TQColorGroup( gray[ 5 ], gray[ NUM_SHADES ], gray[ 0 ], gray[ 5 ], gray[ 2 ], cg.text(), gray[ NUM_SHADES ] ), true, 1 ); break; case CE_ProgressBarContents: { // ### Take into account totalSteps()for busy indicator - const QProgressBar *pb = ( const QProgressBar* ) widget; - QRect cr = subRect( SR_ProgressBarContents, widget ); + const TQProgressBar *pb = ( const TQProgressBar* ) widget; + TQRect cr = subRect( SR_ProgressBarContents, widget ); double progress = pb->progress(); - bool reverse = QApplication::reverseLayout(); + bool reverse = TQApplication::reverseLayout(); int steps = pb->totalSteps(); if ( cr.isValid() && ( progress > 0 || steps == 0 ) ) { @@ -2868,23 +2868,23 @@ void KlearlookStyle::drawControl( } if ( reverse ) - drawPBarOrMenu( p, QRect( cr.x() + cr.width() - width - pstep, + drawPBarOrMenu( p, TQRect( cr.x() + cr.width() - width - pstep, cr.y(), width, cr.height() ), true, cg ); else - drawPBarOrMenu( p, QRect( cr.x() + pstep, cr.y(), width, + drawPBarOrMenu( p, TQRect( cr.x() + pstep, cr.y(), width, cr.height() ), true, cg ); } else if ( reverse ) - drawPBarOrMenu( p, QRect( cr.x() + ( cr.width() - width ), + drawPBarOrMenu( p, TQRect( cr.x() + ( cr.width() - width ), cr.y(), width, cr.height() ), true, cg ); else - drawPBarOrMenu( p, QRect( cr.x(), cr.y(), width, cr.height() ), true, cg ); + drawPBarOrMenu( p, TQRect( cr.x(), cr.y(), width, cr.height() ), true, cg ); } break; } case CE_PushButton: { - const QPushButton *button = static_cast<const QPushButton *>( widget ); - QRect br( r ); + const TQPushButton *button = static_cast<const TQPushButton *>( widget ); + TQRect br( r ); int dbi = pixelMetric( PM_ButtonDefaultIndicator, widget ); if ( rounded && isFormWidget( widget ) ) @@ -2913,7 +2913,7 @@ void KlearlookStyle::drawControl( break; case CE_CheckBoxLabel: if ( crLabelHighlight ) { - const QCheckBox * checkbox = ( const QCheckBox * ) widget; + const TQCheckBox * checkbox = ( const TQCheckBox * ) widget; if ( flags & Style_MouseOver && #if QT_VERSION >= 0x030200 @@ -2921,14 +2921,14 @@ void KlearlookStyle::drawControl( #endif !isFormWidget( widget ) ) { #if QT_VERSION >= 0x030200 - QRect cr( checkbox->rect() ); - QRegion r( QRect( cr.x(), cr.y(), + TQRect cr( checkbox->rect() ); + TQRegion r( TQRect( cr.x(), cr.y(), visualRect( subRect( SR_CheckBoxFocusRect, widget ), widget ).width() + pixelMetric( PM_IndicatorWidth ) + 4, cr.height() ) ); #else - QRegion r( checkbox->rect() ); + TQRegion r( checkbox->rect() ); #endif r -= visualRect( subRect( SR_CheckBoxIndicator, widget ), widget ); @@ -2936,7 +2936,7 @@ void KlearlookStyle::drawControl( p->fillRect( checkbox->rect(), cg.background().light( QTC_HIGHLIGHT_FACTOR ) ); p->setClipping( false ); } - int alignment = QApplication::reverseLayout() ? AlignRight : AlignLeft; + int alignment = TQApplication::reverseLayout() ? AlignRight : AlignLeft; drawItem( p, r, alignment | AlignVCenter | ShowPrefix, cg, flags & Style_Enabled, checkbox->pixmap(), checkbox->text() ); @@ -2954,7 +2954,7 @@ void KlearlookStyle::drawControl( break; case CE_RadioButtonLabel: if ( crLabelHighlight ) { - const QRadioButton * radiobutton = ( const QRadioButton * ) widget; + const TQRadioButton * radiobutton = ( const TQRadioButton * ) widget; if ( flags & Style_MouseOver && #if QT_VERSION >= 0x030200 @@ -2962,13 +2962,13 @@ void KlearlookStyle::drawControl( #endif !isFormWidget( widget ) ) { #if QT_VERSION >= 0x030200 - QRect rb( radiobutton->rect() ); - QRegion r( QRect( rb.x(), rb.y(), + TQRect rb( radiobutton->rect() ); + TQRegion r( TQRect( rb.x(), rb.y(), visualRect( subRect( SR_RadioButtonFocusRect, widget ), widget ).width() + pixelMetric( PM_ExclusiveIndicatorWidth ) + 4, rb.height() ) ); #else - QRegion r( radiobutton->rect() ); + TQRegion r( radiobutton->rect() ); #endif r -= visualRect( subRect( SR_RadioButtonIndicator, widget ), widget ); @@ -2977,7 +2977,7 @@ void KlearlookStyle::drawControl( p->setClipping( false ); } - int alignment = QApplication::reverseLayout() ? AlignRight : AlignLeft; + int alignment = TQApplication::reverseLayout() ? AlignRight : AlignLeft; drawItem( p, r, alignment | AlignVCenter | ShowPrefix, cg, flags & Style_Enabled, radiobutton->pixmap(), radiobutton->text() ); @@ -2992,8 +2992,8 @@ void KlearlookStyle::drawControl( } } -void KlearlookStyle::drawControlMask( ControlElement control, QPainter *p, const QWidget *widget, const QRect &r, - const QStyleOption &data ) const { +void KlearlookStyle::drawControlMask( ControlElement control, TQPainter *p, const TQWidget *widget, const TQRect &r, + const TQStyleOption &data ) const { switch ( control ) { case CE_PushButton: if ( rounded ) { @@ -3016,8 +3016,8 @@ void KlearlookStyle::drawControlMask( ControlElement control, QPainter *p, const } } -void KlearlookStyle::drawComplexControlMask( ComplexControl control, QPainter *p, const QWidget *widget, const QRect &r, - const QStyleOption &data ) const { +void KlearlookStyle::drawComplexControlMask( ComplexControl control, TQPainter *p, const TQWidget *widget, const TQRect &r, + const TQStyleOption &data ) const { switch ( control ) { case CC_ToolButton: case CC_ComboBox: @@ -3028,13 +3028,13 @@ void KlearlookStyle::drawComplexControlMask( ComplexControl control, QPainter *p } } -QRect KlearlookStyle::subRect( SubRect subrect, const QWidget *widget ) const { - QRect rect, +TQRect KlearlookStyle::subRect( SubRect subrect, const TQWidget *widget ) const { + TQRect rect, wrect( widget->rect() ); switch ( subrect ) { case SR_PushButtonFocusRect: { - // const QPushButton *button=(const QPushButton *)widget; + // const TQPushButton *button=(const TQPushButton *)widget; int dbw1 = 0, dbw2 = 0; @@ -3068,7 +3068,7 @@ QRect KlearlookStyle::subRect( SubRect subrect, const QWidget *widget ) const { break; } case SR_ProgressBarContents: - rect = QRect( wrect.x() + 1, + rect = TQRect( wrect.x() + 1, wrect.y() + 1, wrect.width() - 2, wrect.height() - 2 ); @@ -3082,14 +3082,14 @@ QRect KlearlookStyle::subRect( SubRect subrect, const QWidget *widget ) const { void KlearlookStyle::drawComplexControl( ComplexControl control, - QPainter *p, - const QWidget *widget, - const QRect &r, - const QColorGroup &cg, + TQPainter *p, + const TQWidget *widget, + const TQRect &r, + const TQColorGroup &cg, SFlags flags, SCFlags controls, SCFlags active, - const QStyleOption &data ) const + const TQStyleOption &data ) const { if ( widget == hoverWidget ) flags |= Style_MouseOver; @@ -3097,8 +3097,8 @@ void KlearlookStyle::drawComplexControl( switch ( control ) { case CC_ToolButton: { - const QToolButton * toolbutton = ( const QToolButton * ) widget; - QRect button ( querySubControlMetrics( control, widget, SC_ToolButton, data ) ), + const TQToolButton * toolbutton = ( const TQToolButton * ) widget; + TQRect button ( querySubControlMetrics( control, widget, SC_ToolButton, data ) ), menuarea( querySubControlMetrics( control, widget, SC_ToolButtonMenu, data ) ); SFlags bflags = flags, mflags = flags; @@ -3109,11 +3109,11 @@ void KlearlookStyle::drawComplexControl( } bool onControlButtons = false, - onToolbar = widget->parentWidget() && ::qt_cast<QToolBar *>( widget->parentWidget() ), + onToolbar = widget->parentWidget() && tqqt_cast<TQToolBar *>( widget->parentWidget() ), onExtender = !onToolbar && widget->parentWidget() && widget->parentWidget() ->inherits( "QToolBarExtensionWidget" ) && - ::qt_cast<QToolBar *>( widget->parentWidget() ->parentWidget() ); + tqqt_cast<TQToolBar *>( widget->parentWidget() ->parentWidget() ); if ( !onToolbar && !onExtender && widget->parentWidget() && !qstrcmp( widget->parentWidget() ->name(), "qt_maxcontrols" ) ) @@ -3149,8 +3149,8 @@ void KlearlookStyle::drawComplexControl( p->drawTiledPixmap( r, *( toolbutton->parentWidget() ->backgroundPixmap() ), toolbutton->pos() ); } else if ( widget->parent() ) { - if ( ::qt_cast<const QToolBar *>( widget->parent() ) ) { - QToolBar * parent = ( QToolBar* ) widget->parent(); + if ( tqqt_cast<const TQToolBar *>( widget->parent() ) ) { + TQToolBar * parent = ( TQToolBar* ) widget->parent(); #ifdef QTC_GRADIENT_TOOLBARS_AND_MENUBARS @@ -3162,8 +3162,8 @@ void KlearlookStyle::drawComplexControl( p->fillRect( parent->rect(), cg.background() ); } else if ( widget->parent() ->inherits( "QToolBarExtensionWidget" ) ) { - QWidget * parent = ( QWidget* ) widget->parent(); - QToolBar *toolbar = ( QToolBar* ) parent->parent(); + TQWidget * parent = ( TQWidget* ) widget->parent(); + TQToolBar *toolbar = ( TQToolBar* ) parent->parent(); #ifdef QTC_GRADIENT_TOOLBARS_AND_MENUBARS @@ -3185,33 +3185,33 @@ void KlearlookStyle::drawComplexControl( } if ( toolbutton->hasFocus() && !toolbutton->focusProxy() ) { - QRect fr = toolbutton->rect(); + TQRect fr = toolbutton->rect(); fr.addCoords( 3, 3, -3, -3 ); drawPrimitive( PE_FocusRect, p, fr, cg ); } break; } case CC_ComboBox: { - const QComboBox *combobox = ( const QComboBox * ) widget; + const TQComboBox *combobox = ( const TQComboBox * ) widget; - QRect frame( QStyle::visualRect( querySubControlMetrics( CC_ComboBox, + TQRect frame( TQStyle::visualRect( querySubControlMetrics( CC_ComboBox, widget,SC_ComboBoxFrame,data ),widget ) ), - arrow( QStyle::visualRect( querySubControlMetrics( CC_ComboBox, + arrow( TQStyle::visualRect( querySubControlMetrics( CC_ComboBox, widget,SC_ComboBoxArrow,data),widget)), - field( QStyle::visualRect( querySubControlMetrics(CC_ComboBox, + field( TQStyle::visualRect( querySubControlMetrics(CC_ComboBox, widget,SC_ComboBoxEditField,data),widget)); - const QColor *use = buttonColors( cg ); + const TQColor *use = buttonColors( cg ); if ( rounded && isFormWidget( widget ) ) formMode = true; if ( controls & SC_ComboBoxFrame && frame.isValid() ) { if ( controls & SC_ComboBoxEditField && field.isValid() && combobox->editable() ) { - QRect f2( field ); - QRegion reg( r ); + TQRect f2( field ); + TQRegion reg( r ); f2.addCoords( -1, -1, 1, 1 ); reg -= f2; @@ -3232,11 +3232,11 @@ void KlearlookStyle::drawComplexControl( if ( controls & SC_ComboBoxEditField && field.isValid() ) { if ( ( flags & Style_HasFocus ) && ( ! combobox->editable() ) ) { - QRect fr = QStyle::visualRect( subRect( SR_ComboBoxFocusRect, widget ), widget ); + TQRect fr = TQStyle::visualRect( subRect( SR_ComboBoxFocusRect, widget ), widget ); fr.addCoords( 0, 0, -2, 0 ); drawPrimitive( PE_FocusRect, - p, fr, cg, flags | Style_FocusAtBorder, QStyleOption( cg.highlight() ) ); + p, fr, cg, flags | Style_FocusAtBorder, TQStyleOption( cg.highlight() ) ); } } @@ -3245,8 +3245,8 @@ void KlearlookStyle::drawComplexControl( break; } case CC_SpinWidget: { - const QSpinWidget *spinwidget = ( const QSpinWidget * ) widget; - QRect frame( querySubControlMetrics( CC_SpinWidget, widget, SC_SpinWidgetFrame, data ) ), + const TQSpinWidget *spinwidget = ( const TQSpinWidget * ) widget; + TQRect frame( querySubControlMetrics( CC_SpinWidget, widget, SC_SpinWidgetFrame, data ) ), up( spinwidget->upRect() ), down( spinwidget->downRect() ); @@ -3255,7 +3255,7 @@ void KlearlookStyle::drawComplexControl( if ( ( controls & SC_SpinWidgetFrame ) && frame.isValid() ) qDrawShadePanel( - p, r, QColorGroup( gray[ 5 ], gray[ NUM_SHADES ], gray[ 0 ], + p, r, TQColorGroup( gray[ 5 ], gray[ NUM_SHADES ], gray[ 0 ], gray[ 5 ], gray[ 2 ], cg.text(), gray[ NUM_SHADES ] ), true, pixelMetric( PM_SpinBoxFrameWidth ) ); @@ -3264,7 +3264,7 @@ void KlearlookStyle::drawComplexControl( PrimitiveElement pe = PE_SpinWidgetUp; SFlags upflags = flags; - if ( spinwidget->buttonSymbols() == QSpinWidget::PlusMinus ) + if ( spinwidget->buttonSymbols() == TQSpinWidget::PlusMinus ) pe = PE_SpinWidgetPlus; if ( !spinwidget->isUpEnabled() ) upflags ^= Style_Enabled; @@ -3278,7 +3278,7 @@ void KlearlookStyle::drawComplexControl( PrimitiveElement pe = PE_SpinWidgetDown; SFlags downflags = flags; - if ( spinwidget->buttonSymbols() == QSpinWidget::PlusMinus ) + if ( spinwidget->buttonSymbols() == TQSpinWidget::PlusMinus ) pe = PE_SpinWidgetMinus; if ( !spinwidget->isDownEnabled() ) downflags ^= Style_Enabled; @@ -3287,15 +3287,15 @@ void KlearlookStyle::drawComplexControl( downflags | ( ( active == SC_SpinWidgetDown ) ? Style_On | Style_Sunken : Style_Raised ) ); } - const QColor *use = backgroundColors( cg ); + const TQColor *use = backgroundColors( cg ); p->setPen( use[ 4 ].light(80) ); p->drawRect( r ); break; } case CC_ScrollBar: { - const QScrollBar *scrollbar = ( const QScrollBar * ) widget; + const TQScrollBar *scrollbar = ( const TQScrollBar * ) widget; bool hw = hoverWidget == scrollbar; - QRect subline( querySubControlMetrics( control, widget, SC_ScrollBarSubLine, data ) ), + TQRect subline( querySubControlMetrics( control, widget, SC_ScrollBarSubLine, data ) ), addline( querySubControlMetrics( control, widget, SC_ScrollBarAddLine, data ) ), subpage( querySubControlMetrics( control, widget, SC_ScrollBarSubPage, data ) ), addpage( querySubControlMetrics( control, widget, SC_ScrollBarAddPage, data ) ), @@ -3349,13 +3349,13 @@ void KlearlookStyle::drawComplexControl( // ### perhaps this should not be able to accept focus if maxedOut? if ( scrollbar->hasFocus() ) drawPrimitive( PE_FocusRect, p, - QRect( slider.x() + 2, slider.y() + 2, slider.width() - 5, slider.height() - 5 ), + TQRect( slider.x() + 2, slider.y() + 2, slider.width() - 5, slider.height() - 5 ), cg, Style_Default ); } break; } case CC_Slider: { - QRect groove = querySubControlMetrics( CC_Slider, widget, SC_SliderGroove, data ), + TQRect groove = querySubControlMetrics( CC_Slider, widget, SC_SliderGroove, data ), handle = querySubControlMetrics( CC_Slider, widget, SC_SliderHandle, data ); if ( ( controls & SC_SliderGroove ) && groove.isValid() ) @@ -3363,7 +3363,7 @@ void KlearlookStyle::drawComplexControl( if ( ( controls & SC_SliderHandle ) && handle.isValid() ) drawSliderHandle( p, handle, cg, flags ); if ( controls & SC_SliderTickmarks ) - QCommonStyle::drawComplexControl( + TQCommonStyle::drawComplexControl( control, p, widget, r, cg, flags, SC_SliderTickmarks, active, data ); break; @@ -3373,21 +3373,21 @@ void KlearlookStyle::drawComplexControl( } } -QRect KlearlookStyle::querySubControlMetrics( ComplexControl control, const QWidget *widget, SubControl sc, - const QStyleOption &data ) const { +TQRect KlearlookStyle::querySubControlMetrics( ComplexControl control, const TQWidget *widget, SubControl sc, + const TQStyleOption &data ) const { switch ( control ) { case CC_SpinWidget: { if ( !widget ) - return QRect(); + return TQRect(); int fw = pixelMetric( PM_SpinBoxFrameWidth, 0 ); - QSize bs; + TQSize bs; bs.setHeight( widget->height() >> 1 ); if ( bs.height() < 8 ) bs.setHeight( 8 ); bs.setWidth( QMIN( bs.height() * 8 / 6, widget->width() / 4 ) ); - bs = bs.expandedTo( QApplication::globalStrut() ); + bs = bs.expandedTo( TQApplication::globalStrut() ); if ( !( bs.width() % 2 ) ) bs.setWidth( bs.width() + 1 ); @@ -3400,15 +3400,15 @@ QRect KlearlookStyle::querySubControlMetrics( ComplexControl control, const QWid switch ( sc ) { case SC_SpinWidgetUp: - return QRect( x, y, bs.width(), bs.height() ); + return TQRect( x, y, bs.width(), bs.height() ); case SC_SpinWidgetDown: - return QRect( x, y + bs.height(), bs.width(), bs.height() + extra ); + return TQRect( x, y + bs.height(), bs.width(), bs.height() + extra ); case SC_SpinWidgetButtonField: - return QRect( x, y, bs.width(), widget->height() - 2 * fw ); + return TQRect( x, y, bs.width(), widget->height() - 2 * fw ); case SC_SpinWidgetEditField: - return QRect( lx, fw, rx, widget->height() - 2 * fw ); + return TQRect( lx, fw, rx, widget->height() - 2 * fw ); case SC_SpinWidgetFrame: - return QRect( widget->x(), widget->y(), widget->width() - bs.width(), widget->height() ); + return TQRect( widget->x(), widget->y(), widget->width() - bs.width(), widget->height() ); } } default: @@ -3416,7 +3416,7 @@ QRect KlearlookStyle::querySubControlMetrics( ComplexControl control, const QWid } } -int KlearlookStyle::pixelMetric( PixelMetric metric, const QWidget *widget ) const { +int KlearlookStyle::pixelMetric( PixelMetric metric, const TQWidget *widget ) const { switch ( metric ) { case PM_MenuButtonIndicator: return 7; @@ -3428,9 +3428,9 @@ int KlearlookStyle::pixelMetric( PixelMetric metric, const QWidget *widget ) con #if QT_VERSION >= 0x030200 case PM_TabBarTabShiftVertical: { - const QTabBar *tb = ::qt_cast<const QTabBar *>( widget ); + const TQTabBar *tb = tqqt_cast<const TQTabBar *>( widget ); - return QTabBar::RoundedAbove == tb->shape() || QTabBar::TriangularAbove == tb->shape() + return TQTabBar::RoundedAbove == tb->shape() || TQTabBar::TriangularAbove == tb->shape() ? 1 : -1; } @@ -3439,9 +3439,9 @@ int KlearlookStyle::pixelMetric( PixelMetric metric, const QWidget *widget ) con #endif case PM_TabBarTabVSpace: { - const QTabBar * tb = ( const QTabBar * ) widget; - if ( tb->shape() == QTabBar::RoundedAbove || - tb->shape() == QTabBar::RoundedBelow ) + const TQTabBar * tb = ( const TQTabBar * ) widget; + if ( tb->shape() == TQTabBar::RoundedAbove || + tb->shape() == TQTabBar::RoundedBelow ) return 12; else return 4; @@ -3454,9 +3454,9 @@ int KlearlookStyle::pixelMetric( PixelMetric metric, const QWidget *widget ) con case PM_ButtonDefaultIndicator: return IND_BORDER == defBtnIndicator ? 1 : 0; case PM_DefaultFrameWidth: - return borderFrame && widget && ( ::qt_cast<const QTabBar *>( widget ) || - ::qt_cast<const QWidgetStack *>( widget ) || - ::qt_cast<const QPopupMenu *>( widget ) ) + return borderFrame && widget && ( tqqt_cast<const TQTabBar *>( widget ) || + tqqt_cast<const TQWidgetStack *>( widget ) || + tqqt_cast<const TQPopupMenu *>( widget ) ) ? 2 : QTC_DEF_FRAME_WIDTH; case PM_SpinBoxFrameWidth: @@ -3494,7 +3494,7 @@ int KlearlookStyle::pixelMetric( PixelMetric metric, const QWidget *widget ) con } } -int KlearlookStyle::kPixelMetric( KStylePixelMetric kpm, const QWidget *widget ) const { +int KlearlookStyle::kPixelMetric( KStylePixelMetric kpm, const TQWidget *widget ) const { switch ( kpm ) { case KPM_MenuItemSeparatorHeight: return 4; @@ -3503,17 +3503,17 @@ int KlearlookStyle::kPixelMetric( KStylePixelMetric kpm, const QWidget *widget ) } } -QSize KlearlookStyle::sizeFromContents( ContentsType t, - const QWidget *widget, - const QSize &s, - const QStyleOption &opt ) const { +TQSize KlearlookStyle::sizeFromContents( ContentsType t, + const TQWidget *widget, + const TQSize &s, + const TQStyleOption &opt ) const { switch ( t ) { case CT_PopupMenuItem: { if ( !widget || opt.isDefault() ) return s; - const QPopupMenu *popup = dynamic_cast<const QPopupMenu *>( widget ); - QMenuItem *mi = opt.menuItem(); + const TQPopupMenu *popup = dynamic_cast<const TQPopupMenu *>( widget ); + TQMenuItem *mi = opt.menuItem(); int maxpmw = opt.maxIconWidth(); int w = s.width(), h = s.height(); bool checkable = popup->isCheckable(); @@ -3533,7 +3533,7 @@ QSize KlearlookStyle::sizeFromContents( ContentsType t, h = QMAX( h, mi->pixmap() ->height() + 2 ); } else { h = QMAX( h, 21 ); - QSettings s; + TQSettings s; if ( menuIcons ) h = QMAX( h, popup->fontMetrics().height() + MENU_POPUP_ITEM_HIGH_HI ); else @@ -3541,7 +3541,7 @@ QSize KlearlookStyle::sizeFromContents( ContentsType t, } if ( mi->iconSet() ) { - h = QMAX( h, mi->iconSet() ->pixmap( QIconSet::Small, QIconSet::Normal ).height() + 2 ); + h = QMAX( h, mi->iconSet() ->pixmap( TQIconSet::Small, TQIconSet::Normal ).height() + 2 ); } } @@ -3563,23 +3563,23 @@ QSize KlearlookStyle::sizeFromContents( ContentsType t, w += rightBorder; - return QSize( w-25, h ); + return TQSize( w-25, h ); } case CT_PushButton: { - const QPushButton* btn = static_cast<const QPushButton*>( widget ); + const TQPushButton* btn = static_cast<const TQPushButton*>( widget ); int w = s.width() + 2 * pixelMetric( PM_ButtonMargin, widget ); int h = s.height() + 2 * pixelMetric( PM_ButtonMargin, widget ); if ( btn->text().isEmpty() && s.width() < 32 ) - return QSize( w, h ); + return TQSize( w, h ); // return button size - return QSize( w + 25, h + 3 ); + return TQSize( w + 25, h + 3 ); } case CT_ToolButton: { - if ( widget->parent() && ::qt_cast<QToolBar*>( widget->parent() ) ) - return QSize( s.width() + 2 * 4, s.height() + 2 * 4 ); + if ( widget->parent() && tqqt_cast<TQToolBar*>( widget->parent() ) ) + return TQSize( s.width() + 2 * 4, s.height() + 2 * 4 ); else { return KStyle::sizeFromContents ( t, widget, s, opt ); } @@ -3594,7 +3594,7 @@ QSize KlearlookStyle::sizeFromContents( ContentsType t, -int KlearlookStyle::styleHint( StyleHint stylehint, const QWidget *widget, const QStyleOption &option, QStyleHintReturn *returnData ) const { +int KlearlookStyle::styleHint( StyleHint stylehint, const TQWidget *widget, const TQStyleOption &option, QStyleHintReturn *returnData ) const { switch ( stylehint ) { case SH_EtchDisabledText: case SH_Slider_SnapToValue: @@ -3621,10 +3621,10 @@ int KlearlookStyle::styleHint( StyleHint stylehint, const QWidget *widget, const } void KlearlookStyle::drawPBarOrMenu( - QPainter *p, - QRect const &r, + TQPainter *p, + TQRect const &r, bool horiz, - const QColorGroup &cg, + const TQColorGroup &cg, bool menu ) const { switch ( pmProfile ) { @@ -3632,7 +3632,7 @@ void KlearlookStyle::drawPBarOrMenu( drawGradientWithBorder( p, r, horiz ); break; case PROFILE_RAISED: { - int flags = QStyle::Style_Raised; + int flags = TQStyle::Style_Raised; if ( horiz ) flags |= Style_Horizontal; @@ -3652,10 +3652,10 @@ void KlearlookStyle::drawPBarOrMenu( } } void KlearlookStyle::drawPBarOrMenu2( - QPainter *p, - QRect const &r, + TQPainter *p, + TQRect const &r, bool horiz, - const QColorGroup &cg, + const TQColorGroup &cg, bool menu ) const { switch ( pmProfile ) { @@ -3663,7 +3663,7 @@ void KlearlookStyle::drawPBarOrMenu2( drawGradientWithBorder( p, r, horiz ); break; case PROFILE_RAISED: { - int flags = QStyle::Style_Raised; + int flags = TQStyle::Style_Raised; if ( horiz ) flags |= Style_Horizontal; @@ -3684,11 +3684,11 @@ void KlearlookStyle::drawPBarOrMenu2( } void KlearlookStyle::drawGradientWithBorder( - QPainter *p, - QRect const &r, + TQPainter *p, + TQRect const &r, bool horiz ) const { - QRect r2( r ); + TQRect r2( r ); drawGradient( menuPbar[ GRADIENT_TOP ], menuPbar[ GRADIENT_BOTTOM ], true, borderFrame ? 2 : 1, p, r, horiz ); @@ -3709,15 +3709,15 @@ void KlearlookStyle::drawGradientWithBorder( } void KlearlookStyle::drawBevelGradient( - const QColor &base, + const TQColor &base, bool increase, int border, - QPainter *p, - QRect const &r, + TQPainter *p, + TQRect const &r, bool horiz, double shadeTop, double shadeBot ) const { //CPD TODO: Store last settings to make faster! - QColor top, bot; + TQColor top, bot; if ( equal( 1.0, shadeTop ) ) top = base; @@ -3732,16 +3732,16 @@ const { } void KlearlookStyle::drawGradient( - const QColor &top, - const QColor &bot, + const TQColor &top, + const TQColor &bot, bool increase, int border, - QPainter *p, - QRect const &r, + TQPainter *p, + TQRect const &r, bool horiz ) const { if ( r.width() > 0 && r.height() > 0 ) { - QRect grad( + TQRect grad( r.left() + border, r.top() + border, r.width() - ( border * 2 ), @@ -3751,7 +3751,7 @@ void KlearlookStyle::drawGradient( if ( top == bot ) p->fillRect( grad, top ); else { - QRect grad( + TQRect grad( r.left() + border, r.top() + border, r.width() - ( border * 2 ), @@ -3770,7 +3770,7 @@ void KlearlookStyle::drawGradient( if ( increase ) for ( i = s; i <= e ; i++ ) { - p->setPen( QColor( + p->setPen( TQColor( limit( top.red() + rc ), limit( top.green() + gc ), limit( top.blue() + bc ) @@ -3787,7 +3787,7 @@ void KlearlookStyle::drawGradient( else for ( i = e; i >= s; i-- ) { p->setPen( - QColor( + TQColor( limit( top.red() + rc ), limit( top.green() + gc ), limit( top.blue() + bc ) @@ -3808,21 +3808,21 @@ void KlearlookStyle::drawGradient( } -void KlearlookStyle::drawPopupRect( QPainter *p, const QRect &r, const QColorGroup &cg ) const +void KlearlookStyle::drawPopupRect( TQPainter *p, const TQRect &r, const TQColorGroup &cg ) const { - const QColor *use = backgroundColors( cg ); + const TQColor *use = backgroundColors( cg ); p->setPen( use[ 4 ].light(70) ); p->setBrush( NoBrush ); p->drawRect( r ); } void KlearlookStyle::drawSliderHandle( - QPainter *p, - const QRect &r, - const QColorGroup &cg, QStyle::SFlags flags + TQPainter *p, + const TQRect &r, + const TQColorGroup &cg, TQStyle::SFlags flags ) const { - const QColor * use = buttonColors( cg ); + const TQColor * use = buttonColors( cg ); if ( r.width() > r.height() ) flags |= Style_Horizontal; @@ -3840,19 +3840,19 @@ void KlearlookStyle::drawSliderHandle( } void KlearlookStyle::drawSliderGroove - ( QPainter *p, - const QRect &r, - QStyle::SFlags flags, - const QWidget *widget ) const + ( TQPainter *p, + const TQRect &r, + TQStyle::SFlags flags, + const TQWidget *widget ) const { - const QSlider * slider = ( const QSlider * ) widget; - QRect groove( r ); + const TQSlider * slider = ( const TQSlider * ) widget; + TQRect groove( r ); if ( flags & Style_HasFocus ) { - QRect fr( groove ); + TQRect fr( groove ); fr.addCoords( -1, -1, 1, 1 ); - drawPrimitive( PE_FocusRect, p, fr, QColorGroup() ); + drawPrimitive( PE_FocusRect, p, fr, TQColorGroup() ); } if ( Qt::Horizontal == slider->orientation() ) { @@ -3872,7 +3872,7 @@ void KlearlookStyle::drawSliderGroove p->drawLine( groove.x() + 1, groove.y() + 1, groove.x() + 1, groove.y() + groove.height() - 2 ); } -void KlearlookStyle::shadeColors( const QColor &base, QColor *vals ) const { +void KlearlookStyle::shadeColors( const TQColor &base, TQColor *vals ) const { QTC_SHADES int i; @@ -3883,7 +3883,7 @@ void KlearlookStyle::shadeColors( const QColor &base, QColor *vals ) const { vals[ NUM_SHADES ] = base; } -const QColor * KlearlookStyle::buttonColors( const QColorGroup &cg ) const { +const TQColor * KlearlookStyle::buttonColors( const TQColorGroup &cg ) const { if ( cg.button() != button[ NUM_SHADES ] ) { shadeColors( cg.button(), buttonColoured ); return buttonColoured; @@ -3892,7 +3892,7 @@ const QColor * KlearlookStyle::buttonColors( const QColorGroup &cg ) const { return button; } -const QColor * KlearlookStyle::backgroundColors( const QColorGroup &cg ) const { +const TQColor * KlearlookStyle::backgroundColors( const TQColorGroup &cg ) const { if ( cg.background() != gray[ NUM_SHADES ] ) { shadeColors( cg.background(), backgroundColoured ); return backgroundColoured; @@ -3905,8 +3905,8 @@ bool KlearlookStyle::redrawHoverWidget() { if ( !hoverWidget ) return false; - QPoint cursor( QCursor::pos() ), - widgetZero( hoverWidget->mapToGlobal( QPoint( 0, 0 ) ) ); + TQPoint cursor( TQCursor::pos() ), + widgetZero( hoverWidget->mapToGlobal( TQPoint( 0, 0 ) ) ); #if QT_VERSION >= 0x030200 @@ -3916,10 +3916,10 @@ bool KlearlookStyle::redrawHoverWidget() { // the widget can ocupy a larger area - and this whole are will react to mouse over. // This needs to be coounteracted // so that it looks as if only the sensitive area mouse-overs... - QRadioButton *rb = dynamic_cast<QRadioButton *>( hoverWidget ); + TQRadioButton *rb = dynamic_cast<TQRadioButton *>( hoverWidget ); if ( rb ) { - QRect rect( widgetZero.x(), widgetZero.y(), + TQRect rect( widgetZero.x(), widgetZero.y(), visualRect( subRect( SR_RadioButtonFocusRect, rb ), rb ).width() + pixelMetric( PM_ExclusiveIndicatorWidth ) + 4, hoverWidget->height() ); @@ -3927,10 +3927,10 @@ bool KlearlookStyle::redrawHoverWidget() { return ( HOVER_NONE != hover && !rect.contains( oldCursor ) ) || ( HOVER_NONE == hover && rect.contains( oldCursor ) ); } else { - QCheckBox *cb = dynamic_cast<QCheckBox *>( hoverWidget ); + TQCheckBox *cb = dynamic_cast<TQCheckBox *>( hoverWidget ); if ( cb ) { - QRect rect( widgetZero.x(), widgetZero.y(), + TQRect rect( widgetZero.x(), widgetZero.y(), visualRect( subRect( SR_CheckBoxFocusRect, cb ), cb ).width() + pixelMetric( PM_IndicatorWidth ) + 4, hoverWidget->height() ); @@ -3939,11 +3939,11 @@ bool KlearlookStyle::redrawHoverWidget() { ( HOVER_NONE == hover && rect.contains( oldCursor ) ); } else { #endif - QScrollBar *sb = dynamic_cast<QScrollBar *>( hoverWidget ); + TQScrollBar *sb = dynamic_cast<TQScrollBar *>( hoverWidget ); if ( sb ) // So, are we over add button, sub button, slider, or none? { - QRect subline( querySubControlMetrics( CC_ScrollBar, hoverWidget, SC_ScrollBarSubLine ) ), + TQRect subline( querySubControlMetrics( CC_ScrollBar, hoverWidget, SC_ScrollBarSubLine ) ), addline( querySubControlMetrics( CC_ScrollBar, hoverWidget, SC_ScrollBarAddLine ) ), slider( querySubControlMetrics( CC_ScrollBar, hoverWidget, SC_ScrollBarSlider ) ); @@ -3971,20 +3971,20 @@ bool KlearlookStyle::redrawHoverWidget() { ( HOVER_SB_ADD != hover && addline.contains( oldCursor ) ); } else { #if KDE_VERSION >= 0x30400 - QToolButton *tb = dynamic_cast<QToolButton *>( hoverWidget ); + TQToolButton *tb = dynamic_cast<TQToolButton *>( hoverWidget ); if ( tb ) { hover = APP_KICKER == themedApp ? HOVER_KICKER : HOVER_NONE; return HOVER_KICKER == hover; } else { #endif - QHeader *hd = dynamic_cast<QHeader *>( hoverWidget ); + TQHeader *hd = dynamic_cast<TQHeader *>( hoverWidget ); if ( hd ) { // Hmm... this ones tricky, as there's only 1 widget - but it has different sections... // and the ones that aren't clickable should not highlight on mouse over! - QRect rect( + TQRect rect( widgetZero.x(), widgetZero.y(), hoverWidget->width(), @@ -3998,7 +3998,7 @@ bool KlearlookStyle::redrawHoverWidget() { hoverSect = QTC_NO_SECT; for ( s = 0; s < hd->count() && ( QTC_NO_SECT == hoverSect || !redraw ); ++s ) { - QRect r( hd->sectionRect( s ) ); + TQRect r( hd->sectionRect( s ) ); r.moveLeft( r.x() + widgetZero.x() ); r.moveTop( r.y() + widgetZero.y() ); @@ -4017,7 +4017,7 @@ bool KlearlookStyle::redrawHoverWidget() { } return redraw; } else - return oldCursor == QPoint( -1, -1 ); + return oldCursor == TQPoint( -1, -1 ); #if KDE_VERSION >= 0x30400 } |