diff options
Diffstat (limited to 'kdgantt/KDGanttSemiSizingControl.cpp')
-rw-r--r-- | kdgantt/KDGanttSemiSizingControl.cpp | 104 |
1 files changed, 52 insertions, 52 deletions
diff --git a/kdgantt/KDGanttSemiSizingControl.cpp b/kdgantt/KDGanttSemiSizingControl.cpp index 91629662..1daa1409 100644 --- a/kdgantt/KDGanttSemiSizingControl.cpp +++ b/kdgantt/KDGanttSemiSizingControl.cpp @@ -26,19 +26,19 @@ ** licensing are not clear to you. ** ** As a special exception, permission is given to link this program - ** with any edition of Qt, and distribute the resulting executable, - ** without including the source code for Qt in the source distribution. + ** with any edition of TQt, and distribute the resulting executable, + ** without including the source code for TQt in the source distribution. ** **********************************************************************/ #include "KDGanttSemiSizingControl.h" -#include <qpushbutton.h> -#include <qpointarray.h> -#include <qpainter.h> -#include <qbitmap.h> -#include <qtooltip.h> -#include <qwhatsthis.h> +#include <tqpushbutton.h> +#include <tqpointarray.h> +#include <tqpainter.h> +#include <tqbitmap.h> +#include <tqtooltip.h> +#include <tqwhatsthis.h> /*! \class KDGanttSemiSizingControl KDGanttSemiSizingControl.h This class provides exactly one child widget with a button for @@ -57,15 +57,15 @@ orientation and the control arrow button on top of the controlled widget. - \param parent the parent widget. This parameter is passed to the + \param tqparent the tqparent widget. This parameter is passed to the base class. \param name the internal widget name. This parameter is passed to the base class. */ -KDGanttSemiSizingControl::KDGanttSemiSizingControl( QWidget* parent, +KDGanttSemiSizingControl::KDGanttSemiSizingControl( TQWidget* tqparent, const char* name ) : - KDGanttSizingControl( parent, name ), _orient( Horizontal ), + KDGanttSizingControl( tqparent, name ), _orient(Qt::Horizontal ), _arrowPos( Before ), _minimizedWidget(0), _maximizedWidget(0) { init(); @@ -78,16 +78,16 @@ KDGanttSemiSizingControl::KDGanttSemiSizingControl( QWidget* parent, the controlled widget (depending on the orientation). \param orientation the orientation of the splitter - \param parent the parent widget. This parameter is passed to the + \param tqparent the tqparent widget. This parameter is passed to the base class. \param name the internal widget name. This parameter is passed to the base class. */ -KDGanttSemiSizingControl::KDGanttSemiSizingControl( Orientation orientation, - QWidget* parent, +KDGanttSemiSizingControl::KDGanttSemiSizingControl( Qt::Orientation orientation, + TQWidget* tqparent, const char* name ) : - KDGanttSizingControl( parent, name ), _orient( orientation ), + KDGanttSizingControl( tqparent, name ), _orient( orientation ), _arrowPos( Before ), _minimizedWidget(0), _maximizedWidget(0) { init(); @@ -101,17 +101,17 @@ KDGanttSemiSizingControl::KDGanttSemiSizingControl( Orientation orientation, \param arrowPosition specifies whether the control arrow button should appear before or after the controlled widget \param orientation the orientation of the splitter - \param parent the parent widget. This parameter is passed to the + \param tqparent the tqparent widget. This parameter is passed to the base class. \param name the internal widget name. This parameter is passed to the base class. */ KDGanttSemiSizingControl::KDGanttSemiSizingControl( ArrowPosition arrowPosition, - Orientation orientation, - QWidget* parent, + Qt::Orientation orientation, + TQWidget* tqparent, const char* name ) : - KDGanttSizingControl( parent, name ), _orient( orientation ), + KDGanttSizingControl( tqparent, name ), _orient( orientation ), _arrowPos( arrowPosition ), _minimizedWidget(0), _maximizedWidget(0) { init(); @@ -127,7 +127,7 @@ KDGanttSemiSizingControl::KDGanttSemiSizingControl( ArrowPosition arrowPosition, \sa minimizedWidget() */ -void KDGanttSemiSizingControl::setMinimizedWidget( QWidget* widget ) +void KDGanttSemiSizingControl::setMinimizedWidget( TQWidget* widget ) { _minimizedWidget = widget; if( _minimizedWidget ) _minimizedWidget->hide(); @@ -143,7 +143,7 @@ void KDGanttSemiSizingControl::setMinimizedWidget( QWidget* widget ) \sa setMinimizedWidget() */ -QWidget* KDGanttSemiSizingControl::minimizedWidget() const +TQWidget* KDGanttSemiSizingControl::minimizedWidget() const { return _minimizedWidget; } @@ -157,7 +157,7 @@ QWidget* KDGanttSemiSizingControl::minimizedWidget() const \sa maximizedWidget() */ -void KDGanttSemiSizingControl::setMaximizedWidget( QWidget* widget ) +void KDGanttSemiSizingControl::setMaximizedWidget( TQWidget* widget ) { _maximizedWidget = widget; //if( _maximizedWidget ) _maximizedWidget->show(); @@ -172,7 +172,7 @@ void KDGanttSemiSizingControl::setMaximizedWidget( QWidget* widget ) \sa setMaximizedWidget() */ -QWidget* KDGanttSemiSizingControl::maximizedWidget() const +TQWidget* KDGanttSemiSizingControl::maximizedWidget() const { return _maximizedWidget; } @@ -246,31 +246,31 @@ KDGanttSemiSizingControl::ArrowPosition KDGanttSemiSizingControl::arrowPosition( void KDGanttSemiSizingControl::init() { - _but = new QPushButton( this ); - _but->setSizePolicy( QSizePolicy( QSizePolicy::Fixed, QSizePolicy::Fixed ) ); - connect( _but, SIGNAL( clicked() ), this, SLOT(changeState()) ); + _but = new TQPushButton( this ); + _but->tqsetSizePolicy( TQSizePolicy( TQSizePolicy::Fixed, TQSizePolicy::Fixed ) ); + connect( _but, TQT_SIGNAL( clicked() ), this, TQT_SLOT(changeState()) ); _layout = 0; - QWhatsThis::add( _but, "Click on this button to show the \nlegend at the bottom of the widget"); - QToolTip::add( _but, "Show / hide legend"); + TQWhatsThis::add( _but, "Click on this button to show the \nlegend at the bottom of the widget"); + TQToolTip::add( _but, "Show / hide legend"); } void KDGanttSemiSizingControl::setup() { - //-------------------------------------------------- Setup layout + //-------------------------------------------------- Setup tqlayout delete _layout; - QBoxLayout* butLayout; // _layout will delete me + TQBoxLayout* butLayout; // _layout will delete me - if ( _orient == Horizontal || isMinimized() ) - _layout = new QHBoxLayout( this ); + if ( _orient ==Qt::Horizontal || isMinimized() ) + _layout = new TQHBoxLayout( this ); else - _layout = new QVBoxLayout( this ); + _layout = new TQVBoxLayout( this ); - if ( _orient == Vertical && !isMinimized() ) - butLayout = new QHBoxLayout( _layout ); + if ( _orient ==Qt::Vertical && !isMinimized() ) + butLayout = new TQHBoxLayout( _layout ); else - butLayout = new QVBoxLayout( _layout ); + butLayout = new TQVBoxLayout( _layout ); @@ -288,24 +288,24 @@ void KDGanttSemiSizingControl::setup() } //------------------------------ Setup the button at the correct possition - if ( _arrowPos == After && _orient == Vertical && !isMinimized() ) { + if ( _arrowPos == After && _orient ==Qt::Vertical && !isMinimized() ) { butLayout->addStretch( 1 ); - butLayout->addWidget( _but, 0, Qt::AlignLeft ); + butLayout->addWidget( _but, 0, TQt::AlignLeft ); } else { - butLayout->addWidget( _but, 0, Qt::AlignRight ); + butLayout->addWidget( _but, 0, TQt::AlignRight ); butLayout->addStretch( 1 ); } // Set widget in the correct possition - QWidget* widget; + TQWidget* widget; /* ************************** old code *************** if ( isMinimized() ) widget = _minimizedWidget; else widget = _maximizedWidget; if( widget ) { - if ( _arrowPos == Before || _orient == Vertical && !isMinimized() ) + if ( _arrowPos == Before || _orient ==Qt::Vertical && !isMinimized() ) _layout->addWidget( widget, 1 ); else _layout->insertWidget( 0, widget, 1 ); @@ -313,25 +313,25 @@ void KDGanttSemiSizingControl::setup() ************************************************** */ // hack for the usage in KDGantt as pop-up legend widget // for this purpose, - // the _maximizedWidget must be a child of the parent of this widget + // the _maximizedWidget must be a child of the tqparent of this widget if ( isMinimized() ) { widget = _minimizedWidget; if( widget ) { - if ( _arrowPos == Before || _orient == Vertical && !isMinimized() ) + if ( _arrowPos == Before || _orient ==Qt::Vertical && !isMinimized() ) _layout->addWidget( widget, 1 ); else _layout->insertWidget( 0, widget, 1 ); } } else { - if ( _arrowPos == Before || _orient == Vertical && !isMinimized() ) + if ( _arrowPos == Before || _orient ==Qt::Vertical && !isMinimized() ) _layout->addStretch( 1 ); else _layout->insertStretch( 0, 1 ); widget = _maximizedWidget; // the following is only the special case - // arrowPos == Before and _orient == Vertical + // arrowPos == Before and _orient ==Qt::Vertical //widget->move( 0+x(), _but->height()+y()); } } @@ -380,12 +380,12 @@ void KDGanttSemiSizingControl::minimize( bool minimize ) } } -QPixmap KDGanttSemiSizingControl::pixmap( Direction direction ) { +TQPixmap KDGanttSemiSizingControl::pixmap( Direction direction ) { int s = 10; - QPixmap pix( s, s ); + TQPixmap pix( s, s ); pix.fill( blue ); - QPointArray arr; + TQPointArray arr; switch ( direction ) { case Up: arr.setPoints( 3, 0, s-1, s-1, s-1, 0, s/2 ); ;break; case Down: arr.setPoints( 3, 0, 0, s-1, 0, s/2, s-1 ); break; @@ -393,14 +393,14 @@ QPixmap KDGanttSemiSizingControl::pixmap( Direction direction ) { case Right: arr.setPoints( 3, 0,0, s-1, s/2, 0, s-1 ); break; } - QPainter p( &pix ); + TQPainter p( &pix ); p.setPen( black ); - p.setBrush( colorGroup().button() ); + p.setBrush( tqcolorGroup().button() ); p.drawPolygon( arr ); - QBitmap bit( s, s ); + TQBitmap bit( s, s ); bit.fill( color0 ); - QPainter p2( &bit ); + TQPainter p2( &bit ); p2.setPen( color1 ); p2.setBrush( color1 ); p2.drawPolygon( arr ); |