diff options
author | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2010-07-31 19:56:07 +0000 |
---|---|---|
committer | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2010-07-31 19:56:07 +0000 |
commit | d6f8bbb45b267065a6907e71ff9c98bb6d161241 (patch) | |
tree | d109539636691d7b03036ca1c0ed29dbae6577cf /kdevdesigner/designer/sizehandle.cpp | |
parent | 3331a47a9cad24795c7440ee8107143ce444ef34 (diff) | |
download | tdevelop-d6f8bbb45b267065a6907e71ff9c98bb6d161241.tar.gz tdevelop-d6f8bbb45b267065a6907e71ff9c98bb6d161241.zip |
Trinity Qt initial conversion
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdevelop@1157658 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'kdevdesigner/designer/sizehandle.cpp')
-rw-r--r-- | kdevdesigner/designer/sizehandle.cpp | 50 |
1 files changed, 25 insertions, 25 deletions
diff --git a/kdevdesigner/designer/sizehandle.cpp b/kdevdesigner/designer/sizehandle.cpp index a63a3404..eef86747 100644 --- a/kdevdesigner/designer/sizehandle.cpp +++ b/kdevdesigner/designer/sizehandle.cpp @@ -24,19 +24,19 @@ ** **********************************************************************/ -#include <qvariant.h> // HP-UX compiler needs this here +#include <tqvariant.h> // HP-UX compiler needs this here #include "sizehandle.h" #include "formwindow.h" #include "widgetfactory.h" -#include <qwidget.h> -#include <qapplication.h> -#include <qlabel.h> +#include <tqwidget.h> +#include <tqapplication.h> +#include <tqlabel.h> #include <klocale.h> SizeHandle::SizeHandle( FormWindow *parent, Direction d, WidgetSelection *s ) - : QWidget( parent ) + : TQWidget( parent ) { active = TRUE; setBackgroundMode( active ? PaletteText : PaletteDark ); @@ -91,37 +91,37 @@ void SizeHandle::setActive( bool a ) updateCursor(); } -void SizeHandle::setWidget( QWidget *w ) +void SizeHandle::setWidget( TQWidget *w ) { widget = w; } -void SizeHandle::paintEvent( QPaintEvent * ) +void SizeHandle::paintEvent( TQPaintEvent * ) { if ( ( (FormWindow*)parentWidget() )->currentWidget() != widget ) return; - QPainter p( this ); + TQPainter p( this ); p.setPen( blue ); p.drawRect( 0, 0, width(), height() ); } -void SizeHandle::mousePressEvent( QMouseEvent *e ) +void SizeHandle::mousePressEvent( TQMouseEvent *e ) { if ( !widget || e->button() != LeftButton || !active ) return; oldPressPos = e->pos(); - geom = origGeom = QRect( widget->pos(), widget->size() ); + geom = origGeom = TQRect( widget->pos(), widget->size() ); } -void SizeHandle::mouseMoveEvent( QMouseEvent *e ) +void SizeHandle::mouseMoveEvent( TQMouseEvent *e ) { if ( !widget || ( e->state() & LeftButton ) != LeftButton || !active ) return; - QPoint rp = mapFromGlobal( e->globalPos() ); - QPoint d = oldPressPos - rp; + TQPoint rp = mapFromGlobal( e->globalPos() ); + TQPoint d = oldPressPos - rp; oldPressPos = rp; - QPoint checkPos = widget->parentWidget()->mapFromGlobal( e->globalPos() ); - QRect pr = widget->parentWidget()->rect(); + TQPoint checkPos = widget->parentWidget()->mapFromGlobal( e->globalPos() ); + TQRect pr = widget->parentWidget()->rect(); // ##### move code around a bit to reduce duplicated code here switch ( dir ) { @@ -209,13 +209,13 @@ void SizeHandle::mouseMoveEvent( QMouseEvent *e ) } break; } - QPoint p = pos(); + TQPoint p = pos(); sel->updateGeometry(); oldPressPos += ( p - pos() ); formWindow->sizePreview()->setText( i18n( "%1/%2" ).arg( widget->width() ).arg( widget->height() ) ); formWindow->sizePreview()->adjustSize(); - QRect lg( formWindow->mapFromGlobal( e->globalPos() ) + QPoint( 16, 16 ), + TQRect lg( formWindow->mapFromGlobal( e->globalPos() ) + TQPoint( 16, 16 ), formWindow->sizePreview()->size() ); formWindow->checkPreviewGeometry( lg ); formWindow->sizePreview()->setGeometry( lg ); @@ -225,7 +225,7 @@ void SizeHandle::mouseMoveEvent( QMouseEvent *e ) formWindow->updateChildSelections( widget ); } -void SizeHandle::mouseReleaseEvent( QMouseEvent *e ) +void SizeHandle::mouseReleaseEvent( TQMouseEvent *e ) { if ( e->button() != LeftButton || !active ) return; @@ -239,7 +239,7 @@ void SizeHandle::mouseReleaseEvent( QMouseEvent *e ) formWindow->emitUpdateProperties( widget ); } -void SizeHandle::trySetGeometry( QWidget *w, int x, int y, int width, int height ) +void SizeHandle::trySetGeometry( TQWidget *w, int x, int y, int width, int height ) { int minw = QMAX( w->minimumSizeHint().width(), w->minimumSize().width() ); minw = QMAX( minw, 2 * formWindow->grid().x() ); @@ -255,7 +255,7 @@ void SizeHandle::trySetGeometry( QWidget *w, int x, int y, int width, int height w->setGeometry( x, y, QMAX( minw, width ), QMAX( minh, height ) ); } -void SizeHandle::tryResize( QWidget *w, int width, int height ) +void SizeHandle::tryResize( TQWidget *w, int width, int height ) { int minw = QMAX( w->minimumSizeHint().width(), w->minimumSize().width() ); minw = QMAX( minw, 16 ); @@ -266,7 +266,7 @@ void SizeHandle::tryResize( QWidget *w, int width, int height ) // ------------------------------------------------------------------------ -WidgetSelection::WidgetSelection( FormWindow *parent, QPtrDict<WidgetSelection> *selDict ) +WidgetSelection::WidgetSelection( FormWindow *parent, TQPtrDict<WidgetSelection> *selDict ) : selectionDict( selDict ) { formWindow = parent; @@ -276,7 +276,7 @@ WidgetSelection::WidgetSelection( FormWindow *parent, QPtrDict<WidgetSelection> hide(); } -void WidgetSelection::setWidget( QWidget *w, bool updateDict ) +void WidgetSelection::setWidget( TQWidget *w, bool updateDict ) { if ( !w ) { hide(); @@ -311,9 +311,9 @@ void WidgetSelection::updateGeometry() if ( !wid || !wid->parentWidget() ) return; - QPoint p = wid->parentWidget()->mapToGlobal( wid->pos() ); + TQPoint p = wid->parentWidget()->mapToGlobal( wid->pos() ); p = formWindow->mapFromGlobal( p ); - QRect r( p, wid->size() ); + TQRect r( p, wid->size() ); int w = 6; int h = 6; @@ -382,7 +382,7 @@ void WidgetSelection::update() } } -QWidget *WidgetSelection::widget() const +TQWidget *WidgetSelection::widget() const { return wid; } |