diff options
Diffstat (limited to 'krecipes/src/widgets/paneldeco.cpp')
-rw-r--r-- | krecipes/src/widgets/paneldeco.cpp | 80 |
1 files changed, 40 insertions, 40 deletions
diff --git a/krecipes/src/widgets/paneldeco.cpp b/krecipes/src/widgets/paneldeco.cpp index c1dde32..8db7921 100644 --- a/krecipes/src/widgets/paneldeco.cpp +++ b/krecipes/src/widgets/paneldeco.cpp @@ -9,9 +9,9 @@ ***************************************************************************/ #include "paneldeco.h" -#include <qpainter.h> -#include <qpoint.h> -#include <qrect.h> +#include <ntqpainter.h> +#include <ntqpoint.h> +#include <ntqrect.h> #include <kiconloader.h> #include <kpixmap.h> @@ -20,20 +20,20 @@ // Panel decoration -PanelDeco::PanelDeco( QWidget *parent, const char *name, const QString &title, const QString &iconName ) : QVBox( parent, name ) +PanelDeco::PanelDeco( TQWidget *parent, const char *name, const TQString &title, const TQString &iconName ) : TQVBox( parent, name ) { // Top decoration tDeco = new TopDeco( this, "TopDecoration", title, iconName ); - hbox = new QHBox( this ); + hbox = new TQHBox( this ); //Left decoration lDeco = new LeftDeco( hbox, "LeftDecoration" ); //The widget stack (panels) - stack = new QWidgetStack( hbox ); - stack->setSizePolicy( QSizePolicy( QSizePolicy::MinimumExpanding, QSizePolicy::MinimumExpanding ) ); + stack = new TQWidgetStack( hbox ); + stack->setSizePolicy( TQSizePolicy( TQSizePolicy::MinimumExpanding, TQSizePolicy::MinimumExpanding ) ); } @@ -41,27 +41,27 @@ PanelDeco::PanelDeco( QWidget *parent, const char *name, const QString &title, c PanelDeco::~PanelDeco() {} -void PanelDeco::childEvent( QChildEvent *e ) +void PanelDeco::childEvent( TQChildEvent *e ) { - if ( e->type() == QEvent::ChildInserted ) { - QObject * obj = e->child(); - if ( obj->inherits( "QWidget" ) ) { - QWidget * w = ( QWidget* ) obj; + if ( e->type() == TQEvent::ChildInserted ) { + TQObject * obj = e->child(); + if ( obj->inherits( "TQWidget" ) ) { + TQWidget * w = ( TQWidget* ) obj; if ( w != hbox && w != tDeco ) - w->reparent( stack, QPoint( 0, 0 ) ); + w->reparent( stack, TQPoint( 0, 0 ) ); } } } -int PanelDeco::id( QWidget* w ) +int PanelDeco::id( TQWidget* w ) { return ( stack->id( w ) ); } -void PanelDeco::raise( QWidget *w ) +void PanelDeco::raise( TQWidget *w ) { - QWidget * old_w = visiblePanel(); + TQWidget * old_w = visiblePanel(); stack->raiseWidget( w ); @@ -69,23 +69,23 @@ void PanelDeco::raise( QWidget *w ) emit panelRaised( w, old_w ); } -QWidget* PanelDeco::visiblePanel( void ) +TQWidget* PanelDeco::visiblePanel( void ) { return ( stack->visibleWidget() ); } -void PanelDeco::setHeader( const QString &title, const QString &icon ) +void PanelDeco::setHeader( const TQString &title, const TQString &icon ) { tDeco->setHeader( title, icon ); } // Left part of the decoration -LeftDeco::LeftDeco( QWidget *parent, const char *name ) : -#if QT_VERSION >= 0x030200 - QWidget( parent, name, Qt::WNoAutoErase ) +LeftDeco::LeftDeco( TQWidget *parent, const char *name ) : +#if TQT_VERSION >= 0x030200 + TQWidget( parent, name, TQt::WNoAutoErase ) #else - QWidget( parent, name ) + TQWidget( parent, name ) #endif {} @@ -94,19 +94,19 @@ LeftDeco::~LeftDeco() // Top part of the decoration -TopDeco::TopDeco( QWidget *parent, const char *name, const QString &title, const QString &iconName ) : -#if QT_VERSION >= 0x030200 - QWidget( parent, name, Qt::WNoAutoErase ) +TopDeco::TopDeco( TQWidget *parent, const char *name, const TQString &title, const TQString &iconName ) : +#if TQT_VERSION >= 0x030200 + TQWidget( parent, name, TQt::WNoAutoErase ) #else - QWidget( parent, name ) + TQWidget( parent, name ) #endif { setMinimumHeight( 30 ); icon = 0; - panelTitle = QString::null; + panelTitle = TQString::null; if ( !iconName.isNull() ) { KIconLoader il; - icon = new QPixmap( il.loadIcon( iconName, KIcon::NoGroup, 22 ) ); + icon = new TQPixmap( il.loadIcon( iconName, KIcon::NoGroup, 22 ) ); } if ( !title.isNull() ) { @@ -120,11 +120,11 @@ TopDeco::~TopDeco() } -void TopDeco::paintEvent( QPaintEvent * ) +void TopDeco::paintEvent( TQPaintEvent * ) { // Get gradient colors - QColor c1 = colorGroup().button().light( 120 ); - QColor c2 = paletteBackgroundColor(); + TQColor c1 = colorGroup().button().light( 120 ); + TQColor c2 = paletteBackgroundColor(); // Draw the gradient KPixmap kpm; @@ -132,7 +132,7 @@ void TopDeco::paintEvent( QPaintEvent * ) KPixmapEffect::unbalancedGradient ( kpm, c1, c2, KPixmapEffect::VerticalGradient, 150, 150 ); // Add a line on top - QPainter painter( &kpm ); + TQPainter painter( &kpm ); painter.setPen( colorGroup().button().dark( 130 ) ); painter.drawLine( 0, 0, width(), 0 ); @@ -148,34 +148,34 @@ void TopDeco::paintEvent( QPaintEvent * ) // Finally, draw the text besides the icon if ( !panelTitle.isNull() ) { xpos += 15; - QRect r = rect(); + TQRect r = rect(); r.setLeft( xpos ); - painter.setPen( QColor( 0x00, 0x00, 0x00 ) ); - QFont ft = font(); + painter.setPen( TQColor( 0x00, 0x00, 0x00 ) ); + TQFont ft = font(); ft.setBold( true ); painter.setFont( ft ); - painter.drawText( r, Qt::AlignVCenter, panelTitle ); + painter.drawText( r, TQt::AlignVCenter, panelTitle ); } painter.end(); // Copy the pixmap to the widget bitBlt( this, 0, 0, &kpm ); } -void TopDeco::setHeader( const QString &title, const QString &iconName ) +void TopDeco::setHeader( const TQString &title, const TQString &iconName ) { if ( !title.isNull() ) panelTitle = title; if ( !iconName.isNull() ) { KIconLoader il; - icon = new QPixmap( il.loadIcon( iconName, KIcon::NoGroup, 22 ) ); + icon = new TQPixmap( il.loadIcon( iconName, KIcon::NoGroup, 22 ) ); } if ( !title.isNull() || !iconName.isNull() ) update(); } -QSize TopDeco::sizeHint( void ) +TQSize TopDeco::sizeHint( void ) { - return ( QSize( parentWidget() ->width(), 30 ) ); + return ( TQSize( parentWidget() ->width(), 30 ) ); } #include "paneldeco.moc" |