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/formwindow.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/formwindow.cpp')
-rw-r--r-- | kdevdesigner/designer/formwindow.cpp | 942 |
1 files changed, 471 insertions, 471 deletions
diff --git a/kdevdesigner/designer/formwindow.cpp b/kdevdesigner/designer/formwindow.cpp index d9de42cc..9c90e383 100644 --- a/kdevdesigner/designer/formwindow.cpp +++ b/kdevdesigner/designer/formwindow.cpp @@ -48,30 +48,30 @@ #include <klocale.h> #include "kdevdesigner_part.h" -#include <qevent.h> -#include <qpainter.h> -#include <qpen.h> -#include <qlabel.h> -#include <qobjectlist.h> -#include <qtimer.h> -#include <qapplication.h> -#include <qlayout.h> -#include <qspinbox.h> -#include <qstatusbar.h> -#include <qapplication.h> -#include <qpalette.h> -#include <qmessagebox.h> -#include <qpopupmenu.h> -#include <qsizegrip.h> -#include <qpushbutton.h> -#include <qwhatsthis.h> -#include <qmetaobject.h> -#include <qtooltip.h> -#include <qfeatures.h> -#include <qaccel.h> -#include <qpixmapcache.h> -#include <qbitmap.h> -#include <qsplitter.h> +#include <tqevent.h> +#include <tqpainter.h> +#include <tqpen.h> +#include <tqlabel.h> +#include <tqobjectlist.h> +#include <tqtimer.h> +#include <tqapplication.h> +#include <tqlayout.h> +#include <tqspinbox.h> +#include <tqstatusbar.h> +#include <tqapplication.h> +#include <tqpalette.h> +#include <tqmessagebox.h> +#include <tqpopupmenu.h> +#include <tqsizegrip.h> +#include <tqpushbutton.h> +#include <tqwhatsthis.h> +#include <tqmetaobject.h> +#include <tqtooltip.h> +#include <tqfeatures.h> +#include <tqaccel.h> +#include <tqpixmapcache.h> +#include <tqbitmap.h> +#include <tqsplitter.h> // FormWindow should be able to work to some limited degree // (existance, loading) without a MainWindow. Functions which require @@ -81,36 +81,36 @@ #define CHECK_MAINWINDOW Q_ASSERT( mainWindow() ); if ( !mainWindow() ) return #define CHECK_MAINWINDOW_VALUE( v ) Q_ASSERT( mainWindow() ); if ( !mainWindow() ) return v -static void setCursorToAll( const QCursor &c, QWidget *start ) +static void setCursorToAll( const TQCursor &c, TQWidget *start ) { start->setCursor( c ); - QObjectList *l = (QObjectList*)start->children(); + TQObjectList *l = (TQObjectList*)start->children(); if ( l ) { - for ( QObject *o = l->first(); o; o = l->next() ) { + for ( TQObject *o = l->first(); o; o = l->next() ) { if ( o->isWidgetType() && !::qt_cast<SizeHandle*>(o) ) - setCursorToAll( c, ( (QWidget*)o ) ); + setCursorToAll( c, ( (TQWidget*)o ) ); } } } -static void restoreCursors( QWidget *start, FormWindow *fw ) +static void restoreCursors( TQWidget *start, FormWindow *fw ) { if ( fw->widgets()->find( start ) ) start->setCursor( MetaDataBase::cursor( start ) ); else start->setCursor( Qt::ArrowCursor ); - QObjectList *l = (QObjectList*)start->children(); + TQObjectList *l = (TQObjectList*)start->children(); if ( l ) { - for ( QObject *o = l->first(); o; o = l->next() ) { + for ( TQObject *o = l->first(); o; o = l->next() ) { if ( o->isWidgetType() && !::qt_cast<SizeHandle*>(o) ) - restoreCursors( ( (QWidget*)o ), fw ); + restoreCursors( ( (TQWidget*)o ), fw ); } } } #if defined(Q_WS_WIN32) // #### needed for the workaround for repaint problem on windows #include <qt_windows.h> -static void flickerfree_update( QWidget *w ) +static void flickerfree_update( TQWidget *w ) { InvalidateRect( w->winId(), 0, FALSE ); } @@ -134,8 +134,8 @@ static void flickerfree_update( QWidget *w ) event filter which is implemented in MainWindow::eventFilter(). */ -FormWindow::FormWindow( FormFile *f, MainWindow *mw, QWidget *parent, const char *name ) - : QWidget( parent, name, WDestructiveClose ), mainwindow( mw ), +FormWindow::FormWindow( FormFile *f, MainWindow *mw, TQWidget *parent, const char *name ) + : TQWidget( parent, name, WDestructiveClose ), mainwindow( mw ), commands( 100 ), pixInline( TRUE ), pixProject( FALSE ) { ff = f; @@ -143,8 +143,8 @@ FormWindow::FormWindow( FormFile *f, MainWindow *mw, QWidget *parent, const char initSlots(); } -FormWindow::FormWindow( FormFile *f, QWidget *parent, const char *name ) - : QWidget( parent, name, WDestructiveClose ), mainwindow( 0 ), +FormWindow::FormWindow( FormFile *f, TQWidget *parent, const char *name ) + : TQWidget( parent, name, WDestructiveClose ), mainwindow( 0 ), commands( 100 ), pixInline( TRUE ) { ff = f; @@ -171,34 +171,34 @@ void FormWindow::init() drawRubber = FALSE; setFocusPolicy( ClickFocus ); sizePreviewLabel = 0; - checkSelectionsTimer = new QTimer( this, "checkSelectionsTimer" ); - connect( checkSelectionsTimer, SIGNAL( timeout() ), - this, SLOT( invalidCheckedSelections() ) ); - updatePropertiesTimer = new QTimer( this ); - connect( updatePropertiesTimer, SIGNAL( timeout() ), - this, SLOT( updatePropertiesTimerDone() ) ); - showPropertiesTimer = new QTimer( this ); + checkSelectionsTimer = new TQTimer( this, "checkSelectionsTimer" ); + connect( checkSelectionsTimer, TQT_SIGNAL( timeout() ), + this, TQT_SLOT( invalidCheckedSelections() ) ); + updatePropertiesTimer = new TQTimer( this ); + connect( updatePropertiesTimer, TQT_SIGNAL( timeout() ), + this, TQT_SLOT( updatePropertiesTimerDone() ) ); + showPropertiesTimer = new TQTimer( this ); //!!!! - connect( showPropertiesTimer, SIGNAL( timeout() ), - this, SLOT( showPropertiesTimerDone() ) ); - selectionChangedTimer = new QTimer( this ); - connect( selectionChangedTimer, SIGNAL( timeout() ), - this, SLOT( selectionChangedTimerDone() ) ); - windowsRepaintWorkaroundTimer = new QTimer( this ); - connect( windowsRepaintWorkaroundTimer, SIGNAL( timeout() ), - this, SLOT( windowsRepaintWorkaroundTimerTimeout() ) ); + connect( showPropertiesTimer, TQT_SIGNAL( timeout() ), + this, TQT_SLOT( showPropertiesTimerDone() ) ); + selectionChangedTimer = new TQTimer( this ); + connect( selectionChangedTimer, TQT_SIGNAL( timeout() ), + this, TQT_SLOT( selectionChangedTimerDone() ) ); + windowsRepaintWorkaroundTimer = new TQTimer( this ); + connect( windowsRepaintWorkaroundTimer, TQT_SIGNAL( timeout() ), + this, TQT_SLOT( windowsRepaintWorkaroundTimerTimeout() ) ); insertParent = 0; - connect( &commands, SIGNAL( undoRedoChanged( bool, bool, const QString &, const QString & ) ), - this, SIGNAL( undoRedoChanged( bool, bool, const QString &, const QString & ) ) ); + connect( &commands, TQT_SIGNAL( undoRedoChanged( bool, bool, const TQString &, const TQString & ) ), + this, TQT_SIGNAL( undoRedoChanged( bool, bool, const TQString &, const TQString & ) ) ); propShowBlocked = FALSE; setIcon( SmallIcon( "designer_form.png" , KDevDesignerPartFactory::instance()) ); - connect( &commands, SIGNAL( modificationChanged( bool ) ), - this, SLOT( modificationChanged( bool ) ) ); + connect( &commands, TQT_SIGNAL( modificationChanged( bool ) ), + this, TQT_SLOT( modificationChanged( bool ) ) ); buffer = 0; - QWidget *w = WidgetFactory::create( WidgetDatabase::idFromClassName( "QFrame" ), this ); + TQWidget *w = WidgetFactory::create( WidgetDatabase::idFromClassName( "TQFrame" ), this ); setMainContainer( w ); propertyWidget = w; targetContainer = 0; @@ -225,7 +225,7 @@ void FormWindow::initSlots() return; Project *p = project() ? project() : MainWindow::self->currProject(); if ( p && p->isCpp() ) { - QString code = formFile()->code(); + TQString code = formFile()->code(); if ( code.isEmpty() ) formFile()->setCode( formFile()->codeComment() ); } @@ -242,28 +242,28 @@ FormWindow::~FormWindow() delete iface; } -void FormWindow::closeEvent( QCloseEvent *e ) +void FormWindow::closeEvent( TQCloseEvent *e ) { - QGuardedPtr<FormWindow> that = this; + TQGuardedPtr<FormWindow> that = this; if ( ff->closeEvent() && ( !that || ( mainwindow && mainwindow->unregisterClient( this ) ) ) ) e->accept(); else e->ignore(); } -void FormWindow::paintGrid( QWidget *w, QPaintEvent *e ) +void FormWindow::paintGrid( TQWidget *w, TQPaintEvent *e ) { if ( !mainWindow() || !mainWindow()->showGrid() ) return; - QPixmap grid; - QString grid_name; + TQPixmap grid; + TQString grid_name; grid_name.sprintf("FormWindowGrid_%d_%d", mainWindow()->grid().x(), mainWindow()->grid().y()); - if( !QPixmapCache::find( grid_name, grid ) ) { - grid = QPixmap( 350 + ( 350 % mainWindow()->grid().x() ), 350 + ( 350 % mainWindow()->grid().y() ) ); - grid.fill( colorGroup().color( QColorGroup::Foreground ) ); - QBitmap mask( grid.width(), grid.height() ); + if( !TQPixmapCache::find( grid_name, grid ) ) { + grid = TQPixmap( 350 + ( 350 % mainWindow()->grid().x() ), 350 + ( 350 % mainWindow()->grid().y() ) ); + grid.fill( colorGroup().color( TQColorGroup::Foreground ) ); + TQBitmap mask( grid.width(), grid.height() ); mask.fill( color0 ); - QPainter p( &mask ); + TQPainter p( &mask ); p.setPen( color1 ); for ( int y = 0; y < grid.width(); y += mainWindow()->grid().y()) { for ( int x = 0; x < grid.height(); x += mainWindow()->grid().x() ) { @@ -271,11 +271,11 @@ void FormWindow::paintGrid( QWidget *w, QPaintEvent *e ) } } grid.setMask( mask ); - QPixmapCache::insert( grid_name, grid ); + TQPixmapCache::insert( grid_name, grid ); } - QPainter p( w ); + TQPainter p( w ); p.setClipRegion( e->rect() ); - p.drawTiledPixmap( QRect( 0, 0, width(), height() ), grid ); + p.drawTiledPixmap( TQRect( 0, 0, width(), height() ), grid ); } /*! For operations like drawing a rubber band or drawing the rect @@ -293,7 +293,7 @@ void FormWindow::beginUnclippedPainter( bool doNot ) if ( !unclipped ) clearWFlags( WPaintUnclipped ); if ( doNot ) { - unclippedPainter->setPen( QPen( color0, 2 ) ); + unclippedPainter->setPen( TQPen( color0, 2 ) ); unclippedPainter->setRasterOp( NotROP ); } } @@ -312,32 +312,32 @@ void FormWindow::endUnclippedPainter() unclippedPainter = 0; } -QPoint FormWindow::gridPoint( const QPoint &p ) +TQPoint FormWindow::gridPoint( const TQPoint &p ) { - return QPoint( ( p.x() / grid().x() ) * grid().x(), + return TQPoint( ( p.x() / grid().x() ) * grid().x(), ( p.y() / grid().y() ) * grid().y() ); } -void FormWindow::drawSizePreview( const QPoint &pos, const QString& text ) +void FormWindow::drawSizePreview( const TQPoint &pos, const TQString& text ) { unclippedPainter->save(); - unclippedPainter->setPen( QPen( colorGroup().foreground(), 1 )); + unclippedPainter->setPen( TQPen( colorGroup().foreground(), 1 )); unclippedPainter->setRasterOp( CopyROP ); if ( !sizePreviewPixmap.isNull() ) unclippedPainter->drawPixmap( sizePreviewPos, sizePreviewPixmap ); if ( text.isNull() ) { - sizePreviewPixmap = QPixmap(); // set null again + sizePreviewPixmap = TQPixmap(); // set null again unclippedPainter->restore(); return; } - QRect r = fontMetrics().boundingRect( 0, 0, 0, 0, AlignCenter, text ); - r = QRect( pos + QPoint( 10, 10 ), r.size() + QSize( 5, 5 ) ); + TQRect r = fontMetrics().boundingRect( 0, 0, 0, 0, AlignCenter, text ); + r = TQRect( pos + TQPoint( 10, 10 ), r.size() + TQSize( 5, 5 ) ); checkPreviewGeometry( r ); sizePreviewPos = r.topLeft(); - sizePreviewPixmap = QPixmap::grabWindow( winId(), r.x(), r.y(), r.width(), r.height() ); - unclippedPainter->setBrush( QColor( 255, 255, 128 ) ); + sizePreviewPixmap = TQPixmap::grabWindow( winId(), r.x(), r.y(), r.width(), r.height() ); + unclippedPainter->setBrush( TQColor( 255, 255, 128 ) ); unclippedPainter->drawRect( r ); unclippedPainter->drawText( r, AlignCenter, text ); unclippedPainter->restore(); @@ -354,57 +354,57 @@ void FormWindow::insertWidget() bool useSizeHint = !oldRectValid || ( currRect.width() < 2 && currRect.height() < 2 ); Orientation orient = Horizontal; - QString n = WidgetDatabase::className( currTool ); - if ( useSizeHint && ( n == "Spacer" || n == "QSlider" || n == "Line" || n == "QScrollBar" ) ) { - QPopupMenu m( mainWindow() ); + TQString n = WidgetDatabase::className( currTool ); + if ( useSizeHint && ( n == "Spacer" || n == "TQSlider" || n == "Line" || n == "TQScrollBar" ) ) { + TQPopupMenu m( mainWindow() ); m.insertItem( i18n( "&Horizontal" ) ); int ver = m.insertItem( i18n( "&Vertical" ) ); - int r = m.exec( QCursor::pos() ); + int r = m.exec( TQCursor::pos() ); if ( r == ver ) orient = Vertical; } - QWidget *w = WidgetFactory::create( currTool, insertParent, 0, TRUE, &currRect, orient ); + TQWidget *w = WidgetFactory::create( currTool, insertParent, 0, TRUE, &currRect, orient ); if ( !w ) return; if ( !savePixmapInline() && currTool == WidgetDatabase::idFromClassName( "PixmapLabel" ) ) { // ### what to do for pixmaps in project - QPixmap pix; + TQPixmap pix; // we have to force the pixmap to get a new and unique serial number. Unfortunately detatch() doesn't do that pix.convertFromImage( SmallIcon( "designer_image.png" , KDevDesignerPartFactory::instance()).convertToImage() ); - ( (QLabel*)w )->setPixmap( pix ); + ( (TQLabel*)w )->setPixmap( pix ); } int id = WidgetDatabase::idFromClassName( WidgetFactory::classNameOf(w) ); if ( WidgetDatabase::isCustomWidget( id ) ) { - QWhatsThis::add( w, i18n("<b>A %1 (custom widget)</b> " + TQWhatsThis::add( w, i18n("<b>A %1 (custom widget)</b> " "<p>Click <b>Edit Custom Widgets...</b> in the <b>Tools|Custom</b> " "menu to add and change custom widgets. You can add " "properties as well as signals and slots to integrate custom widgets into " "<i>Qt Designer</i>, and provide a pixmap which will be used to represent " "the widget on the form.</p>") .arg(WidgetDatabase::toolTip( id )) ); - QToolTip::add( w, i18n("A %1 (custom widget)").arg(WidgetDatabase::toolTip( id )) ); + TQToolTip::add( w, i18n("A %1 (custom widget)").arg(WidgetDatabase::toolTip( id )) ); } else { - QString tt = WidgetDatabase::toolTip( id ); - QString wt = WidgetDatabase::whatsThis( id ); + TQString tt = WidgetDatabase::toolTip( id ); + TQString wt = WidgetDatabase::whatsThis( id ); if ( !wt.isEmpty() && !tt.isEmpty() ) - QWhatsThis::add( w, QString("<b>A %1</b><p>%2</p>").arg( tt ).arg( wt ) ); + TQWhatsThis::add( w, TQString("<b>A %1</b><p>%2</p>").arg( tt ).arg( wt ) ); } - QString s = w->name(); + TQString s = w->name(); unify( w, s, TRUE ); w->setName( s ); insertWidget( w ); - QRect r( currRect ); + TQRect r( currRect ); if ( !oldRectValid || ( currRect.width() < 2 && currRect.height() < 2 ) ) - r = QRect( rectAnchor, QSize( 0, 0 ) ); + r = TQRect( rectAnchor, TQSize( 0, 0 ) ); - QPoint p = r.topLeft(); + TQPoint p = r.topLeft(); p = mapToGlobal( p ); p = insertParent->mapFromGlobal( p ); - r = QRect( p, r.size() ); + r = TQRect( p, r.size() ); if ( useSizeHint ) { if ( n == "Spacer" ) { @@ -426,31 +426,31 @@ void FormWindow::insertWidget() if ( r.height() < 2 * grid().y() ) r.setHeight( 2 * grid().y() ); - const QObjectList *l = insertParent->children(); - QObjectListIt it( *l ); - QWidgetList lst; + const TQObjectList *l = insertParent->children(); + TQObjectListIt it( *l ); + TQWidgetList lst; if ( WidgetDatabase::isContainer( WidgetDatabase::idFromClassName( WidgetFactory::classNameOf( w ) ) ) ) { for ( ; it.current(); ) { - QObject *o = it.current(); + TQObject *o = it.current(); ++it; if ( o->isWidgetType() && - ( (QWidget*)o )->isVisibleTo( this ) && - insertedWidgets.find( (QWidget*)o ) && o != w ) { - QRect r2( ( (QWidget*)o )->pos(), - ( (QWidget*)o )->size() ); + ( (TQWidget*)o )->isVisibleTo( this ) && + insertedWidgets.find( (TQWidget*)o ) && o != w ) { + TQRect r2( ( (TQWidget*)o )->pos(), + ( (TQWidget*)o )->size() ); if ( r.contains( r2 ) ) - lst.append( (QWidget*)o ); + lst.append( (TQWidget*)o ); } } } if ( !lst.isEmpty() ) { - QWidget *pw = WidgetFactory::containerOfWidget( w ); + TQWidget *pw = WidgetFactory::containerOfWidget( w ); if (pw) { - QValueList<QPoint> op, np; - for ( QWidget *i = lst.first(); i; i = lst.next() ) { + TQValueList<TQPoint> op, np; + for ( TQWidget *i = lst.first(); i; i = lst.next() ) { op.append( i->pos() ); - QPoint pos = pw->mapFromGlobal( i->mapToGlobal( QPoint( 0, 0 ) ) ); + TQPoint pos = pw->mapFromGlobal( i->mapToGlobal( TQPoint( 0, 0 ) ) ); pos -= r.topLeft(); np.append( pos ); } @@ -465,7 +465,7 @@ void FormWindow::insertWidget() InsertCommand *cmd = new InsertCommand( i18n( "Insert %1" ).arg( w->name() ), this, w, r ); - QPtrList<Command> commands; + TQPtrList<Command> commands; commands.append( mv ); commands.append( cmd ); @@ -491,12 +491,12 @@ void FormWindow::insertWidget() } } -void FormWindow::insertWidget( QWidget *w, bool checkName ) +void FormWindow::insertWidget( TQWidget *w, bool checkName ) { if ( !w ) return; if ( checkName ) { - QString s = w->name(); + TQString s = w->name(); unify( w, s, TRUE ); w->setName( s ); } @@ -504,19 +504,19 @@ void FormWindow::insertWidget( QWidget *w, bool checkName ) MetaDataBase::addEntry( w ); int id = WidgetDatabase::idFromClassName( WidgetFactory::classNameOf(w) ); if ( WidgetDatabase::isCustomWidget( id ) ) { - QWhatsThis::add( w, i18n("<b>A %1 (custom widget)</b> " + TQWhatsThis::add( w, i18n("<b>A %1 (custom widget)</b> " "<p>Click <b>Edit Custom Widgets...</b> in the <b>Tools|Custom</b> " "menu to add and change custom widgets. You can add " "properties as well as signals and slots to integrate custom widgets into " "<i>Qt Designer</i>, and provide a pixmap which will be used to represent " "the widget on the form.</p>") .arg(WidgetDatabase::toolTip( id )) ); - QToolTip::add( w, i18n("A %1 (custom widget)").arg(WidgetDatabase::toolTip( id )) ); + TQToolTip::add( w, i18n("A %1 (custom widget)").arg(WidgetDatabase::toolTip( id )) ); } else { - QString tt = WidgetDatabase::toolTip( id ); - QString wt = WidgetDatabase::whatsThis( id ); + TQString tt = WidgetDatabase::toolTip( id ); + TQString wt = WidgetDatabase::whatsThis( id ); if ( !wt.isEmpty() && !tt.isEmpty() ) - QWhatsThis::add( w, QString("<b>A %1</b><p>%2</p>").arg( tt ).arg( wt ) ); + TQWhatsThis::add( w, TQString("<b>A %1</b><p>%2</p>").arg( tt ).arg( wt ) ); } restoreCursors( w, this ); @@ -524,13 +524,13 @@ void FormWindow::insertWidget( QWidget *w, bool checkName ) w->show(); } -void FormWindow::removeWidget( QWidget *w ) +void FormWindow::removeWidget( TQWidget *w ) { MetaDataBase::removeEntry( w ); widgets()->take( w ); } -void FormWindow::handleContextMenu( QContextMenuEvent *e, QWidget *w ) +void FormWindow::handleContextMenu( TQContextMenuEvent *e, TQWidget *w ) { CHECK_MAINWINDOW; switch ( currTool ) { @@ -539,12 +539,12 @@ void FormWindow::handleContextMenu( QContextMenuEvent *e, QWidget *w ) raiseChildSelections( w ); // raise selections and select widget selectWidget( w ); // if widget is laid out, find the first non-laid out super-widget - QWidget *realWidget = w; // but store the original one + TQWidget *realWidget = w; // but store the original one while ( w->parentWidget() && ( WidgetFactory::layoutType( w->parentWidget()) != WidgetFactory::NoLayout || !insertedWidgets.find(w) ) ) w = w->parentWidget(); - if ( ::qt_cast<QMainWindow*>(mainContainer()) && ((QMainWindow*)mainContainer())->centralWidget() == realWidget ) { + if ( ::qt_cast<TQMainWindow*>(mainContainer()) && ((TQMainWindow*)mainContainer())->centralWidget() == realWidget ) { e->accept(); mainwindow->popupFormWindowMenu( e->globalPos(), this ); } else { @@ -562,16 +562,16 @@ void FormWindow::handleContextMenu( QContextMenuEvent *e, QWidget *w ) } } -void FormWindow::handleMousePress( QMouseEvent *e, QWidget *w ) +void FormWindow::handleMousePress( TQMouseEvent *e, TQWidget *w ) { CHECK_MAINWINDOW; checkedSelectionsForMove = FALSE; checkSelectionsTimer->stop(); if ( !sizePreviewLabel ) { - sizePreviewLabel = new QLabel( this ); + sizePreviewLabel = new TQLabel( this ); sizePreviewLabel->hide(); - sizePreviewLabel->setBackgroundColor( QColor( 255, 255, 128 ) ); - sizePreviewLabel->setFrameStyle( QFrame::Plain | QFrame::Box ); + sizePreviewLabel->setBackgroundColor( TQColor( 255, 255, 128 ) ); + sizePreviewLabel->setFrameStyle( TQFrame::Plain | TQFrame::Box ); } switch ( currTool ) { @@ -582,7 +582,7 @@ void FormWindow::handleMousePress( QMouseEvent *e, QWidget *w ) w->raise(); if ( ( e->state() & ControlButton ) ) { // with control pressed, always start rubber band selection drawRubber = TRUE; - currRect = QRect( 0, 0, -1, -1 ); + currRect = TQRect( 0, 0, -1, -1 ); startRectDraw( mapFromGlobal( e->globalPos() ), e->globalPos(), this, Rubber ); break; } @@ -594,13 +594,13 @@ void FormWindow::handleMousePress( QMouseEvent *e, QWidget *w ) } else { // ...widget selected // only if widget has a layout (it is a layout meta widget or a laid out container!), unselect its childs if ( WidgetFactory::layoutType( w ) != WidgetFactory::NoLayout ) { - QObjectList *l = w->queryList( "QWidget" ); + TQObjectList *l = w->queryList( "TQWidget" ); setPropertyShowingBlocked( TRUE ); - for ( QObject *o = l->first(); o; o = l->next() ) { + for ( TQObject *o = l->first(); o; o = l->next() ) { if ( !o->isWidgetType() ) continue; - if ( insertedWidgets.find( (QWidget*)o ) ) - selectWidget( (QWidget*)o, FALSE ); + if ( insertedWidgets.find( (TQWidget*)o ) ) + selectWidget( (TQWidget*)o, FALSE ); } setPropertyShowingBlocked( FALSE ); delete l; @@ -624,7 +624,7 @@ void FormWindow::handleMousePress( QMouseEvent *e, QWidget *w ) if ( e->button() == LeftButton ) { // left button: store original geometry and more as the widget might start moving widgetPressed = TRUE; - widgetGeom = QRect( w->pos(), w->size() ); + widgetGeom = TQRect( w->pos(), w->size() ); oldPressPos = w->mapFromGlobal( e->globalPos() ); origPressPos = oldPressPos; checkedSelectionsForMove = FALSE; @@ -640,12 +640,12 @@ void FormWindow::handleMousePress( QMouseEvent *e, QWidget *w ) drawRubber = TRUE; if ( !( ( e->state() & ControlButton ) || ( e->state() & ShiftButton ) ) ) { clearSelection( FALSE ); - QObject *opw = propertyWidget; + TQObject *opw = propertyWidget; propertyWidget = mainContainer(); if ( opw->isWidgetType() ) - repaintSelection( (QWidget*)opw ); + repaintSelection( (TQWidget*)opw ); } - currRect = QRect( 0, 0, -1, -1 ); + currRect = TQRect( 0, 0, -1, -1 ); startRectDraw( mapFromGlobal( e->globalPos() ), e->globalPos(), this, Rubber ); } } @@ -656,7 +656,7 @@ void FormWindow::handleMousePress( QMouseEvent *e, QWidget *w ) break; validForBuddy = FALSE; if ( currTool == BUDDY_TOOL ) { - if ( !::qt_cast<QLabel*>(w) ) + if ( !::qt_cast<TQLabel*>(w) ) break; clearSelection( FALSE ); validForBuddy = TRUE; @@ -676,14 +676,14 @@ void FormWindow::handleMousePress( QMouseEvent *e, QWidget *w ) if ( !isMainContainer( w ) ) { // press on a child widget orderedWidgets.removeRef( w ); orderedWidgets.append( w ); - for ( QWidget *wid = orderedWidgets.last(); wid; wid = orderedWidgets.prev() ) { + for ( TQWidget *wid = orderedWidgets.last(); wid; wid = orderedWidgets.prev() ) { int i = stackedWidgets.findRef( wid ); if ( i != -1 ) { stackedWidgets.removeRef( wid ); stackedWidgets.insert( 0, wid ); } } - QWidgetList oldl = MetaDataBase::tabOrder( this ); + TQWidgetList oldl = MetaDataBase::tabOrder( this ); TabOrderCommand *cmd = new TabOrderCommand( i18n( "Change Tab Order" ), this, oldl, stackedWidgets ); cmd->execute(); commandHistory()->addCommand( cmd, TRUE ); @@ -694,11 +694,11 @@ void FormWindow::handleMousePress( QMouseEvent *e, QWidget *w ) if ( e->button() == LeftButton ) { insertParent = WidgetFactory::containerOfWidget( mainContainer() ); // default parent for new widget is the formwindow if ( !isMainContainer( w ) ) { // press was not on formwindow, check if we can find another parent - QWidget *wid = w; + TQWidget *wid = w; for (;;) { int id = WidgetDatabase::idFromClassName( WidgetFactory::classNameOf( wid ) ); if ( ( WidgetDatabase::isContainer( id ) || wid == mainContainer() ) && - !::qt_cast<QLayoutWidget*>(wid) && !::qt_cast<QSplitter*>(wid) ) { + !::qt_cast<QLayoutWidget*>(wid) && !::qt_cast<TQSplitter*>(wid) ) { insertParent = WidgetFactory::containerOfWidget( wid ); // found another parent, store it break; } else { @@ -714,7 +714,7 @@ void FormWindow::handleMousePress( QMouseEvent *e, QWidget *w ) } } -void FormWindow::handleMouseDblClick( QMouseEvent *, QWidget *w ) +void FormWindow::handleMouseDblClick( TQMouseEvent *, TQWidget *w ) { CHECK_MAINWINDOW; switch ( currTool ) { @@ -722,14 +722,14 @@ void FormWindow::handleMouseDblClick( QMouseEvent *, QWidget *w ) if ( !isMainContainer( w ) ) { // press on a child widget orderedWidgets.clear(); orderedWidgets.append( w ); - for ( QWidget *wid = orderedWidgets.last(); wid; wid = orderedWidgets.prev() ) { + for ( TQWidget *wid = orderedWidgets.last(); wid; wid = orderedWidgets.prev() ) { int i = stackedWidgets.findRef( wid ); if ( i != -1 ) { stackedWidgets.removeRef( wid ); stackedWidgets.insert( 0, wid ); } } - QWidgetList oldl = MetaDataBase::tabOrder( this ); + TQWidgetList oldl = MetaDataBase::tabOrder( this ); TabOrderCommand *cmd = new TabOrderCommand( i18n( "Change Tab Order" ), this, oldl, stackedWidgets ); cmd->execute(); commandHistory()->addCommand( cmd, TRUE ); @@ -743,13 +743,13 @@ void FormWindow::handleMouseDblClick( QMouseEvent *, QWidget *w ) } } -void FormWindow::handleMouseMove( QMouseEvent *e, QWidget *w ) +void FormWindow::handleMouseMove( TQMouseEvent *e, TQWidget *w ) { CHECK_MAINWINDOW; if ( ( e->state() & LeftButton ) != LeftButton ) return; - QWidget *newendWidget = endWidget, *oldendWidget = endWidget, *wid; + TQWidget *newendWidget = endWidget, *oldendWidget = endWidget, *wid; bool drawRecRect; switch ( currTool ) { case POINTER_TOOL: @@ -761,23 +761,23 @@ void FormWindow::handleMouseMove( QMouseEvent *e, QWidget *w ) w = w->parentWidget(); // calc correct position - QPoint pos = w->mapFromGlobal( e->globalPos() ); + TQPoint pos = w->mapFromGlobal( e->globalPos() ); #if 0 - QPoint mpos = w->mapToParent( pos ); + TQPoint mpos = w->mapToParent( pos ); // check if we are not outside the visible area, else correct coords if ( mpos.x() < 0 ) - pos.setX( w->mapFromParent( QPoint( 0, mpos.y() ) ).x() ); + pos.setX( w->mapFromParent( TQPoint( 0, mpos.y() ) ).x() ); if ( mpos.y() < 0 ) - pos.setY( w->mapFromParent( QPoint( mpos.x(), 0 ) ).y() ); + pos.setY( w->mapFromParent( TQPoint( mpos.x(), 0 ) ).y() ); if ( mpos.x() > w->parentWidget()->width() ) - pos.setX( w->mapFromParent( QPoint( w->parentWidget()->width(), mpos.y() ) ).x() ); + pos.setX( w->mapFromParent( TQPoint( w->parentWidget()->width(), mpos.y() ) ).x() ); if ( mpos.y() > w->parentWidget()->height() ) - pos.setY( w->mapFromParent( QPoint( mpos.x(), w->parentWidget()->height() ) ).y() ); + pos.setY( w->mapFromParent( TQPoint( mpos.x(), w->parentWidget()->height() ) ).y() ); #endif // calc move distance and store it - QPoint d = oldPressPos - pos; + TQPoint d = oldPressPos - pos; if ( QABS( d.x() ) < grid().x() ) d.setX( 0 ); if ( QABS( d.y() ) < grid().y() ) @@ -795,7 +795,7 @@ void FormWindow::handleMouseMove( QMouseEvent *e, QWidget *w ) int y = widgetGeom.y() - d.y(); widgetGeom.setY( y ); y = ( y / grid().y() ) * grid().y(); - QPoint p = w->pos(); + TQPoint p = w->pos(); if ( x - p.x() != 0 || y - p.y() != 0 ) { // if we actually have to move if ( !checkedSelectionsForMove ) { // if not checked yet, check if the correct widget are selected... @@ -808,8 +808,8 @@ void FormWindow::handleMouseMove( QMouseEvent *e, QWidget *w ) } // check whether we would have to reparent the selection and highlight the possible new parent container - QMapConstIterator<QWidget*, QPoint> it = moving.begin(); - QWidget* wa = containerAt( e->globalPos(), it.key() ); + TQMapConstIterator<TQWidget*, TQPoint> it = moving.begin(); + TQWidget* wa = containerAt( e->globalPos(), it.key() ); if ( wa && !isMainContainer( wa ) && !isCentralWidget( wa ) ) { wa = WidgetFactory::containerOfWidget( wa ); // ok, looks like we moved onto a container @@ -839,7 +839,7 @@ void FormWindow::handleMouseMove( QMouseEvent *e, QWidget *w ) moveSelectedWidgets( x - p.x(), y - p.y() ); sizePreviewLabel->setText( i18n( "%1/%2" ).arg( w->pos().x() ).arg( w->pos().y() ) ); sizePreviewLabel->adjustSize(); - QRect lg( mapFromGlobal( e->globalPos() ) + QPoint( 16, 16 ), sizePreviewLabel->size() ); + TQRect lg( mapFromGlobal( e->globalPos() ) + TQPoint( 16, 16 ), sizePreviewLabel->size() ); checkPreviewGeometry( lg ); sizePreviewLabel->setGeometry( lg ); sizePreviewLabel->raise(); @@ -848,7 +848,7 @@ void FormWindow::handleMouseMove( QMouseEvent *e, QWidget *w ) windowsRepaintWorkaroundTimer->start( 100, TRUE ); #endif } else { // if we don't need to move, do some indication - QRect lg( mapFromGlobal( e->globalPos() ) + QPoint( 16, 16 ), sizePreviewLabel->size() ); + TQRect lg( mapFromGlobal( e->globalPos() ) + TQPoint( 16, 16 ), sizePreviewLabel->size() ); checkPreviewGeometry( lg ); sizePreviewLabel->move( lg.x(), lg.y() ); } @@ -866,7 +866,7 @@ void FormWindow::handleMouseMove( QMouseEvent *e, QWidget *w ) if ( wid && ( isMainContainer( wid ) || insertedWidgets.find( wid ) ) && wid->isVisibleTo( this ) ) newendWidget = wid; if ( ::qt_cast<QLayoutWidget*>(newendWidget) || ::qt_cast<Spacer*>(newendWidget) ) - newendWidget = (QWidget*)endWidget; + newendWidget = (TQWidget*)endWidget; drawRecRect = newendWidget != endWidget; if ( newendWidget && ( isMainContainer( newendWidget ) || insertedWidgets.find( newendWidget ) ) && !isCentralWidget( newendWidget ) ) @@ -876,8 +876,8 @@ void FormWindow::handleMouseMove( QMouseEvent *e, QWidget *w ) currentPos = mapFromGlobal( e->globalPos() ); qApp->processEvents(); if ( drawRecRect ) - restoreRect( QRect( mapToForm( ( (QWidget*)oldendWidget )->parentWidget(), ( (QWidget*)oldendWidget )->pos() ), - ( (QWidget*)oldendWidget )->size() ) ); + restoreRect( TQRect( mapToForm( ( (TQWidget*)oldendWidget )->parentWidget(), ( (TQWidget*)oldendWidget )->pos() ), + ( (TQWidget*)oldendWidget )->size() ) ); drawConnectionLine(); break; case BUDDY_TOOL: @@ -892,7 +892,7 @@ void FormWindow::handleMouseMove( QMouseEvent *e, QWidget *w ) else newendWidget = 0; if ( ::qt_cast<QLayoutWidget*>(newendWidget) || ::qt_cast<Spacer*>(newendWidget) ) - newendWidget = (QWidget*)endWidget; + newendWidget = (TQWidget*)endWidget; drawRecRect = newendWidget != endWidget; if ( !newendWidget ) endWidget = newendWidget; @@ -906,8 +906,8 @@ void FormWindow::handleMouseMove( QMouseEvent *e, QWidget *w ) currentPos = mapFromGlobal( e->globalPos() ); qApp->processEvents(); if ( drawRecRect && oldendWidget ) - restoreRect( QRect( mapToForm( ( (QWidget*)oldendWidget )->parentWidget(), ( (QWidget*)oldendWidget )->pos() ), - ( (QWidget*)oldendWidget )->size() ) ); + restoreRect( TQRect( mapToForm( ( (TQWidget*)oldendWidget )->parentWidget(), ( (TQWidget*)oldendWidget )->pos() ), + ( (TQWidget*)oldendWidget )->size() ) ); drawConnectionLine(); break; case ORDER_TOOL: @@ -919,7 +919,7 @@ void FormWindow::handleMouseMove( QMouseEvent *e, QWidget *w ) } } -void FormWindow::handleMouseRelease( QMouseEvent *e, QWidget *w ) +void FormWindow::handleMouseRelease( TQMouseEvent *e, TQWidget *w ) { CHECK_MAINWINDOW; if ( e->button() != LeftButton ) @@ -945,11 +945,11 @@ void FormWindow::handleMouseRelease( QMouseEvent *e, QWidget *w ) if ( propertyWidget && propertyWidget->isWidgetType() && !isMainContainer( propertyWidget ) ) emitUpdateProperties( propertyWidget ); - QMapConstIterator<QWidget*,QPoint> it = moving.begin(); - QWidget *oldParent = it.key()->parentWidget(); - QWidget *newParent = oldParent; + TQMapConstIterator<TQWidget*,TQPoint> it = moving.begin(); + TQWidget *oldParent = it.key()->parentWidget(); + TQWidget *newParent = oldParent; // check whether we have to reparent the selection - QWidget* wa = containerAt( e->globalPos(), it.key() ); + TQWidget* wa = containerAt( e->globalPos(), it.key() ); if ( wa ) { wa = WidgetFactory::containerOfWidget( wa ); // ok, looks like we moved onto a container @@ -960,7 +960,7 @@ void FormWindow::handleMouseRelease( QMouseEvent *e, QWidget *w ) // break layout if necessary if ( WidgetFactory::layoutType( wa ) != WidgetFactory::NoLayout ) { - if ( QMessageBox::information( mainWindow(), i18n( "Inserting Widget" ), + if ( TQMessageBox::information( mainWindow(), i18n( "Inserting Widget" ), i18n( "You tried to insert a widget into the " "layout Container Widget '%1'.\n" "This is not possible. " @@ -975,18 +975,18 @@ void FormWindow::handleMouseRelease( QMouseEvent *e, QWidget *w ) // doesn't need to be a command, the MoveCommand does reparenting too bool emitSelChanged = FALSE; - for ( QMap<QWidget*, QPoint>::Iterator it = moving.begin(); it != moving.end(); ++it ) { - QWidget *i = it.key(); - if ( !emitSelChanged && ::qt_cast<QButton*>(i) ) { - if ( ::qt_cast<QButtonGroup*>(i->parentWidget()) || ::qt_cast<QButtonGroup*>(wa) ) + for ( TQMap<TQWidget*, TQPoint>::Iterator it = moving.begin(); it != moving.end(); ++it ) { + TQWidget *i = it.key(); + if ( !emitSelChanged && ::qt_cast<TQButton*>(i) ) { + if ( ::qt_cast<TQButtonGroup*>(i->parentWidget()) || ::qt_cast<TQButtonGroup*>(wa) ) emitSelChanged = TRUE; - if ( !::qt_cast<QButtonGroup*>(wa) ) { + if ( !::qt_cast<TQButtonGroup*>(wa) ) { MetaDataBase::setPropertyChanged( i, "buttonGroupId", FALSE ); - if ( ::qt_cast<QButtonGroup*>(i->parentWidget()) ) - ( (QButtonGroup*)i->parentWidget() )->remove( (QButton*)i ); + if ( ::qt_cast<TQButtonGroup*>(i->parentWidget()) ) + ( (TQButtonGroup*)i->parentWidget() )->remove( (TQButton*)i ); } } - QPoint pos = wa->mapFromGlobal( i->mapToGlobal( QPoint(0,0) ) ); + TQPoint pos = wa->mapFromGlobal( i->mapToGlobal( TQPoint(0,0) ) ); i->reparent( wa, pos, TRUE ); raiseSelection( i ); raiseChildSelections( i ); @@ -1002,8 +1002,8 @@ void FormWindow::handleMouseRelease( QMouseEvent *e, QWidget *w ) } make_move_command: - QWidgetList widgets; // collect the widgets and its old and new positions which have been moved - QValueList<QPoint> oldPos, newPos; + TQWidgetList widgets; // collect the widgets and its old and new positions which have been moved + TQValueList<TQPoint> oldPos, newPos; for ( it = moving.begin(); it != moving.end(); ++it ) { widgets.append( it.key() ); oldPos.append( *it ); @@ -1027,13 +1027,13 @@ void FormWindow::handleMouseRelease( QMouseEvent *e, QWidget *w ) case BUDDY_TOOL: restoreConnectionLine(); if ( startWidget ) - restoreRect( QRect( mapToForm( ( (QWidget*)startWidget )->parentWidget(), - ( (QWidget*)startWidget )->pos() ), - ((QWidget*)startWidget )->size() ) ); + restoreRect( TQRect( mapToForm( ( (TQWidget*)startWidget )->parentWidget(), + ( (TQWidget*)startWidget )->pos() ), + ((TQWidget*)startWidget )->size() ) ); if ( endWidget ) - restoreRect( QRect( mapToForm( ( (QWidget*)endWidget )->parentWidget(), - ( (QWidget*)endWidget )->pos() ), - ( (QWidget*)endWidget )->size() ) ); + restoreRect( TQRect( mapToForm( ( (TQWidget*)endWidget )->parentWidget(), + ( (TQWidget*)endWidget )->pos() ), + ( (TQWidget*)endWidget )->size() ) ); endUnclippedPainter(); qApp->processEvents(); @@ -1041,7 +1041,7 @@ void FormWindow::handleMouseRelease( QMouseEvent *e, QWidget *w ) if ( currTool == CONNECT_TOOL ) editConnections(); else if ( currTool == BUDDY_TOOL && validForBuddy && startWidget != endWidget ) { - QString oldBuddy = startWidget->property( "buddy" ).toString(); + TQString oldBuddy = startWidget->property( "buddy" ).toString(); if ( oldBuddy.isNull() ) oldBuddy = ""; SetPropertyCommand *cmd = new SetPropertyCommand( i18n( "Set Buddy for %1" ).arg( startWidget->name() ), @@ -1065,7 +1065,7 @@ void FormWindow::handleMouseRelease( QMouseEvent *e, QWidget *w ) if ( insertParent ) { // we should insert the new widget now endRectDraw(); if ( WidgetFactory::layoutType( insertParent ) != WidgetFactory::NoLayout ) { - if ( QMessageBox::information( mainWindow(), i18n( "Inserting Widget" ), + if ( TQMessageBox::information( mainWindow(), i18n( "Inserting Widget" ), i18n( "You tried to insert a widget into the " "layout Container Widget '%1'.\n" "This is not possible. " @@ -1092,7 +1092,7 @@ void FormWindow::handleMouseRelease( QMouseEvent *e, QWidget *w ) buffer = 0; } -void FormWindow::handleKeyPress( QKeyEvent *e, QWidget *w ) +void FormWindow::handleKeyPress( TQKeyEvent *e, TQWidget *w ) { CHECK_MAINWINDOW; e->ignore(); @@ -1103,12 +1103,12 @@ void FormWindow::handleKeyPress( QKeyEvent *e, QWidget *w ) e->key() == Key_Up || e->key() == Key_Down ) && propertyWidget->isWidgetType() ) - checkSelectionsForMove( (QWidget*)propertyWidget ); + checkSelectionsForMove( (TQWidget*)propertyWidget ); checkSelectionsTimer->start( 1000, TRUE ); if ( e->key() == Key_Left || e->key() == Key_Right || e->key() == Key_Up || e->key() == Key_Down ) { - QWidgetList widgets; - QValueList<QPoint> oldPos, newPos; + TQWidgetList widgets; + TQValueList<TQPoint> oldPos, newPos; for ( WidgetSelection *s = selections.first(); s; s = selections.next() ) { if ( s->isUsed() ) { int dx = 0, dy = 0; @@ -1149,7 +1149,7 @@ void FormWindow::handleKeyPress( QKeyEvent *e, QWidget *w ) widgets.append( s->widget() ); oldPos.append( s->widget()->pos() ); - newPos.append( s->widget()->pos() + QPoint( dx, dy ) ); + newPos.append( s->widget()->pos() + TQPoint( dx, dy ) ); } } if ( !widgets.isEmpty() ) { @@ -1160,7 +1160,7 @@ void FormWindow::handleKeyPress( QKeyEvent *e, QWidget *w ) } } if ( !e->isAccepted() ) { - QObjectList *l = queryList( "QWidget" ); + TQObjectList *l = queryList( "TQWidget" ); if ( !l ) return; if ( l->find( w ) != -1 ) @@ -1170,35 +1170,35 @@ void FormWindow::handleKeyPress( QKeyEvent *e, QWidget *w ) } -void FormWindow::handleKeyRelease( QKeyEvent *e, QWidget * ) +void FormWindow::handleKeyRelease( TQKeyEvent *e, TQWidget * ) { e->ignore(); } -void FormWindow::selectWidget( QObject *o, bool select ) +void FormWindow::selectWidget( TQObject *o, bool select ) { CHECK_MAINWINDOW; if ( !o->isWidgetType() ) { - // ########### do QObject stuff + // ########### do TQObject stuff return; } - QWidget *w = (QWidget*)o; + TQWidget *w = (TQWidget*)o; if ( isMainContainer( w ) ) { - QObject *opw = propertyWidget; + TQObject *opw = propertyWidget; propertyWidget = mainContainer(); if ( opw->isWidgetType() ) - repaintSelection( (QWidget*)opw ); + repaintSelection( (TQWidget*)opw ); emitShowProperties( propertyWidget ); return; } - if ( ::qt_cast<QMainWindow*>(mainContainer()) && w == ( (QMainWindow*)mainContainer() )->centralWidget() ) { - QObject *opw = propertyWidget; + if ( ::qt_cast<TQMainWindow*>(mainContainer()) && w == ( (TQMainWindow*)mainContainer() )->centralWidget() ) { + TQObject *opw = propertyWidget; propertyWidget = mainContainer(); if ( opw->isWidgetType() ) - repaintSelection( (QWidget*)opw ); + repaintSelection( (TQWidget*)opw ); emitShowProperties( propertyWidget ); return; } @@ -1207,10 +1207,10 @@ void FormWindow::selectWidget( QObject *o, bool select ) return; if ( select ) { - QObject *opw = propertyWidget; + TQObject *opw = propertyWidget; propertyWidget = w; if ( opw->isWidgetType() ) - repaintSelection( (QWidget*)opw ); + repaintSelection( (TQWidget*)opw ); if ( !isPropertyShowingBlocked() ) emitShowProperties( propertyWidget ); WidgetSelection *s = usedSelections.find( w ); @@ -1236,27 +1236,27 @@ void FormWindow::selectWidget( QObject *o, bool select ) WidgetSelection *s = usedSelections.find( w ); if ( s ) s->setWidget( 0 ); - QObject *opw = propertyWidget; + TQObject *opw = propertyWidget; if ( !usedSelections.isEmpty() ) - propertyWidget = QPtrDictIterator<WidgetSelection>( usedSelections ).current()->widget(); + propertyWidget = TQPtrDictIterator<WidgetSelection>( usedSelections ).current()->widget(); else propertyWidget = mainContainer(); if ( opw->isWidgetType() ) - repaintSelection( (QWidget*)opw ); + repaintSelection( (TQWidget*)opw ); if ( !isPropertyShowingBlocked() ) emitShowProperties( propertyWidget ); emitSelectionChanged(); } } -QPoint FormWindow::grid() const +TQPoint FormWindow::grid() const { if ( !mainWindow() || !mainWindow()->snapGrid() ) - return QPoint( 1, 1 ); + return TQPoint( 1, 1 ); return mainWindow()->grid(); } -void FormWindow::updateSelection( QWidget *w ) +void FormWindow::updateSelection( TQWidget *w ) { WidgetSelection *s = usedSelections.find( w ); if ( !w->isVisibleTo( this ) ) @@ -1265,14 +1265,14 @@ void FormWindow::updateSelection( QWidget *w ) s->updateGeometry(); } -void FormWindow::raiseSelection( QWidget *w ) +void FormWindow::raiseSelection( TQWidget *w ) { WidgetSelection *s = usedSelections.find( w ); if ( s ) s->show(); } -void FormWindow::repaintSelection( QWidget *w ) +void FormWindow::repaintSelection( TQWidget *w ) { WidgetSelection *s = usedSelections.find( w ); if ( s ) @@ -1281,52 +1281,52 @@ void FormWindow::repaintSelection( QWidget *w ) void FormWindow::clearSelection( bool changePropertyDisplay ) { - QPtrDictIterator<WidgetSelection> it( usedSelections ); + TQPtrDictIterator<WidgetSelection> it( usedSelections ); for ( ; it.current(); ++it ) it.current()->setWidget( 0, FALSE ); usedSelections.clear(); if ( changePropertyDisplay ) { - QObject *opw = propertyWidget; + TQObject *opw = propertyWidget; propertyWidget = mainContainer(); if ( opw->isWidgetType() ) - repaintSelection( (QWidget*)opw ); + repaintSelection( (TQWidget*)opw ); emitShowProperties( propertyWidget ); } emitSelectionChanged(); } -void FormWindow::startRectDraw( const QPoint &p, const QPoint &global, QWidget *, RectType t ) +void FormWindow::startRectDraw( const TQPoint &p, const TQPoint &global, TQWidget *, RectType t ) { - QPoint pos( p ); + TQPoint pos( p ); pos = mapFromGlobal( global ); oldRectValid = FALSE; beginUnclippedPainter( TRUE ); if ( t == Rubber ) - unclippedPainter->setPen( QPen( color0, 1 ) ); + unclippedPainter->setPen( TQPen( color0, 1 ) ); if ( t == Insert ) rectAnchor = gridPoint( pos ); else if ( t == Rubber ) rectAnchor = pos; - currRect = QRect( rectAnchor, QPoint( 0, 0 ) ); + currRect = TQRect( rectAnchor, TQPoint( 0, 0 ) ); if ( t == Insert ) drawSizePreview( pos, i18n("Use Size Hint") ); } -void FormWindow::continueRectDraw( const QPoint &p, const QPoint &global, QWidget *, RectType t ) +void FormWindow::continueRectDraw( const TQPoint &p, const TQPoint &global, TQWidget *, RectType t ) { - QPoint pos =p; + TQPoint pos =p; pos = mapFromGlobal( global ); - QPoint p2; + TQPoint p2; if ( t == Insert ) p2 = gridPoint( pos ); else if ( t == Rubber ) p2 = pos; - QRect r( rectAnchor, p2 ); + TQRect r( rectAnchor, p2 ); r = r.normalize(); if ( currRect == r ) { - QString t = i18n( "%1/%2" ); + TQString t = i18n( "%1/%2" ); t = t.arg( r.width() - 1 ).arg( r.height() - 1 ); drawSizePreview( pos, t ); return; @@ -1338,11 +1338,11 @@ void FormWindow::continueRectDraw( const QPoint &p, const QPoint &global, QWidge oldRectValid = TRUE; currRect = r; if ( t == Insert ) { - QString t = i18n( "%1/%2" ); + TQString t = i18n( "%1/%2" ); t = t.arg( r.width() - 1 ).arg( r.height() - 1 ); drawSizePreview( pos, t ); } - unclippedPainter->setClipRegion( QRegion( rect() ).subtract( QRect( sizePreviewPos, sizePreviewPixmap.size() ) ) ); + unclippedPainter->setClipRegion( TQRegion( rect() ).subtract( TQRect( sizePreviewPos, sizePreviewPixmap.size() ) ) ); unclippedPainter->drawRect( currRect ); unclippedPainter->setClipping( FALSE ); } else { @@ -1359,22 +1359,22 @@ void FormWindow::endRectDraw() if ( oldRectValid ) unclippedPainter->drawRect( currRect ); - drawSizePreview( QPoint(-1,-1), QString::null ); + drawSizePreview( TQPoint(-1,-1), TQString::null ); endUnclippedPainter(); } void FormWindow::selectWidgets() { - QObjectList *l = mainContainer()->queryList( "QWidget" ); + TQObjectList *l = mainContainer()->queryList( "TQWidget" ); if ( l ) { - for ( QObject *o = l->first(); o; o = l->next() ) { - if ( ( (QWidget*)o )->isVisibleTo( this ) && + for ( TQObject *o = l->first(); o; o = l->next() ) { + if ( ( (TQWidget*)o )->isVisibleTo( this ) && insertedWidgets[ (void*)o ] ) { - QPoint p = ( (QWidget*)o )->mapToGlobal( QPoint(0,0) ); + TQPoint p = ( (TQWidget*)o )->mapToGlobal( TQPoint(0,0) ); p = mapFromGlobal( p ); - QRect r( p, ( (QWidget*)o )->size() ); + TQRect r( p, ( (TQWidget*)o )->size() ); if ( r.intersects( currRect ) && !r.contains( currRect ) ) - selectWidget( (QWidget*)o ); + selectWidget( (TQWidget*)o ); } } delete l; @@ -1382,19 +1382,19 @@ void FormWindow::selectWidgets() emitSelectionChanged(); } -bool FormWindow::isWidgetSelected( QObject *w ) +bool FormWindow::isWidgetSelected( TQObject *w ) { if ( w->isWidgetType() ) - return usedSelections.find( (QWidget*)w ) != 0; + return usedSelections.find( (TQWidget*)w ) != 0; return FALSE; // #### do stuff for QObjects } void FormWindow::moveSelectedWidgets( int dx, int dy ) { - QPtrDictIterator<WidgetSelection> it( usedSelections ); + TQPtrDictIterator<WidgetSelection> it( usedSelections ); for ( ; it.current(); ++it ) { WidgetSelection *s = it.current(); - QWidget *w = s->widget(); + TQWidget *w = s->widget(); if ( w->parentWidget() && WidgetFactory::layoutType( w->parentWidget() ) != WidgetFactory::NoLayout ) continue; w->move( w->x() + dx, w->y() + dy ); @@ -1418,15 +1418,15 @@ void FormWindow::redo() commandHistory()->redo(); } -void FormWindow::raiseChildSelections( QWidget *w ) +void FormWindow::raiseChildSelections( TQWidget *w ) { - QObjectList *l = w->queryList( "QWidget" ); + TQObjectList *l = w->queryList( "TQWidget" ); if ( !l || !l->first() ) { delete l; return; } - QPtrDictIterator<WidgetSelection> it( usedSelections ); + TQPtrDictIterator<WidgetSelection> it( usedSelections ); for ( ; it.current(); ++it ) { if ( l->findRef( it.current()->widget() ) != -1 ) it.current()->show(); @@ -1434,27 +1434,27 @@ void FormWindow::raiseChildSelections( QWidget *w ) delete l; } -void FormWindow::updateChildSelections( QWidget *w ) +void FormWindow::updateChildSelections( TQWidget *w ) { - QObjectList *l = w->queryList( "QWidget" ); + TQObjectList *l = w->queryList( "TQWidget" ); if ( l ) { - for ( QObject *o = l->first(); o; o = l->next() ) { + for ( TQObject *o = l->first(); o; o = l->next() ) { if ( o->isWidgetType() && - insertedWidgets.find( (QWidget*)o ) ) - updateSelection( (QWidget*)o ); + insertedWidgets.find( (TQWidget*)o ) ) + updateSelection( (TQWidget*)o ); } delete l; } } -void FormWindow::checkSelectionsForMove( QWidget *w ) +void FormWindow::checkSelectionsForMove( TQWidget *w ) { checkedSelectionsForMove = TRUE; - QObjectList *l = w->parentWidget()->queryList( "QWidget", 0, FALSE, FALSE ); + TQObjectList *l = w->parentWidget()->queryList( "TQWidget", 0, FALSE, FALSE ); moving.clear(); if ( l ) { - QPtrDictIterator<WidgetSelection> it( usedSelections ); + TQPtrDictIterator<WidgetSelection> it( usedSelections ); WidgetSelection *sel; while ( ( sel = it.current() ) != 0 ) { if ( it.current()->widget() == mainContainer() ) @@ -1479,10 +1479,10 @@ void FormWindow::checkSelectionsForMove( QWidget *w ) void FormWindow::deleteWidgets() { CHECK_MAINWINDOW; - QWidgetList widgets; - QPtrDictIterator<WidgetSelection> it( usedSelections ); + TQWidgetList widgets; + TQPtrDictIterator<WidgetSelection> it( usedSelections ); for ( ; it.current(); ++it ) { - QWidget *tb = 0; + TQWidget *tb = 0; if ( !( tb = mainWindow()->isAToolBarChild( it.current()->widget() ) ) ) widgets.append( it.current()->widget() ); else @@ -1499,28 +1499,28 @@ void FormWindow::deleteWidgets() void FormWindow::editAdjustSize() { - QPtrList<Command> commands; - QWidgetList widgets = selectedWidgets(); + TQPtrList<Command> commands; + TQWidgetList widgets = selectedWidgets(); if ( widgets.isEmpty() ) { - QRect oldr = geometry(); + TQRect oldr = geometry(); mainContainer()->adjustSize(); resize( mainContainer()->size() ); // check whether our own size constraint hit us if ( size() != mainContainer()->size() ) mainContainer()->resize( size() ); - QRect nr = geometry(); + TQRect nr = geometry(); if ( oldr != nr ) { ResizeCommand *cmd = new ResizeCommand( i18n( "Adjust Size" ), this, this, oldr, nr ); commandHistory()->addCommand( cmd ); } return; } - for ( QWidget* w = widgets.first(); w; w = widgets.next() ) { + for ( TQWidget* w = widgets.first(); w; w = widgets.next() ) { if ( w->parentWidget() && WidgetFactory::layoutType( w->parentWidget() ) != WidgetFactory::NoLayout ) continue; - QRect oldr = w->geometry(); + TQRect oldr = w->geometry(); w->adjustSize(); - QRect nr = w->geometry(); + TQRect nr = w->geometry(); if ( oldr != nr ) commands.append( new ResizeCommand( i18n("Adjust Size"), this, w, oldr, nr ) ); } @@ -1535,29 +1535,29 @@ void FormWindow::editAdjustSize() } -QWidgetList FormWindow::selectedWidgets() const +TQWidgetList FormWindow::selectedWidgets() const { - QWidgetList widgets; - QPtrDictIterator<WidgetSelection> it( usedSelections ); + TQWidgetList widgets; + TQPtrDictIterator<WidgetSelection> it( usedSelections ); for ( ; it.current(); ++it ) widgets.append( it.current()->widget() ); return widgets; } -void FormWindow::widgetChanged( QObject *w ) +void FormWindow::widgetChanged( TQObject *w ) { if ( w->isWidgetType() ) - updateSelection( (QWidget*)w ); - // ########## do QObject stuff + updateSelection( (TQWidget*)w ); + // ########## do TQObject stuff } -QLabel *FormWindow::sizePreview() const +TQLabel *FormWindow::sizePreview() const { if ( !sizePreviewLabel ) { - ( (FormWindow*)this )->sizePreviewLabel = new QLabel( (FormWindow*)this ); + ( (FormWindow*)this )->sizePreviewLabel = new TQLabel( (FormWindow*)this ); ( (FormWindow*)this )->sizePreviewLabel->hide(); - ( (FormWindow*)this )->sizePreviewLabel->setBackgroundColor( QColor( 255, 255, 128 ) ); - ( (FormWindow*)this )->sizePreviewLabel->setFrameStyle( QFrame::Plain | QFrame::Box ); + ( (FormWindow*)this )->sizePreviewLabel->setBackgroundColor( TQColor( 255, 255, 128 ) ); + ( (FormWindow*)this )->sizePreviewLabel->setFrameStyle( TQFrame::Plain | TQFrame::Box ); } return sizePreviewLabel; } @@ -1567,39 +1567,39 @@ void FormWindow::invalidCheckedSelections() checkedSelectionsForMove = FALSE; } -void FormWindow::checkPreviewGeometry( QRect &r ) +void FormWindow::checkPreviewGeometry( TQRect &r ) { if ( !rect().contains( r ) ) { if ( r.left() < rect().left() ) - r.moveTopLeft( QPoint( 0, r.top() ) ); + r.moveTopLeft( TQPoint( 0, r.top() ) ); if ( r.right() > rect().right() ) - r.moveBottomRight( QPoint( rect().right(), r.bottom() ) ); + r.moveBottomRight( TQPoint( rect().right(), r.bottom() ) ); if ( r.top() < rect().top() ) - r.moveTopLeft( QPoint( r.left(), rect().top() ) ); + r.moveTopLeft( TQPoint( r.left(), rect().top() ) ); if ( r.bottom() > rect().bottom() ) - r.moveBottomRight( QPoint( r.right(), rect().bottom() ) ); + r.moveBottomRight( TQPoint( r.right(), rect().bottom() ) ); } } -void FormWindow::focusInEvent( QFocusEvent * ){ +void FormWindow::focusInEvent( TQFocusEvent * ){ if (ff) ff->checkTimeStamp(); } -void FormWindow::focusOutEvent( QFocusEvent * ) +void FormWindow::focusOutEvent( TQFocusEvent * ) { if ( propertyWidget && !isMainContainer( propertyWidget ) && !isWidgetSelected( propertyWidget ) ) { - QObject *opw = propertyWidget; + TQObject *opw = propertyWidget; propertyWidget = mainContainer(); if ( opw->isWidgetType() ) - repaintSelection( (QWidget*)opw ); + repaintSelection( (TQWidget*)opw ); } } -void FormWindow::resizeEvent( QResizeEvent *e ) +void FormWindow::resizeEvent( TQResizeEvent *e ) { - QWidget::resizeEvent( e ); + TQWidget::resizeEvent( e ); if ( currTool == ORDER_TOOL ) repositionOrderIndicators(); if ( isVisible() ) @@ -1613,44 +1613,44 @@ void FormWindow::resizeEvent( QResizeEvent *e ) void FormWindow::windowsRepaintWorkaroundTimerTimeout() { #if defined(Q_WS_WIN32) - QObjectList *l = queryList( "QWidget" ); - for ( QObject *o = l->first(); o; o = l->next() ) { - flickerfree_update( (QWidget*)o ); + TQObjectList *l = queryList( "TQWidget" ); + for ( TQObject *o = l->first(); o; o = l->next() ) { + flickerfree_update( (TQWidget*)o ); } flickerfree_update( this ); delete l; #endif } -QPtrDict<QWidget> *FormWindow::widgets() +TQPtrDict<TQWidget> *FormWindow::widgets() { return &insertedWidgets; } -QWidget *FormWindow::designerWidget( QObject *o ) const +TQWidget *FormWindow::designerWidget( TQObject *o ) const { if ( !o || !o->isWidgetType() ) return 0; - QWidget *w = (QWidget*)o; + TQWidget *w = (TQWidget*)o; while ( w && !isMainContainer( w ) && !insertedWidgets[ (void*)w ] || isCentralWidget( w ) ) - w = (QWidget*)w->parent(); + w = (TQWidget*)w->parent(); return w; } -void FormWindow::emitShowProperties( QObject *w ) +void FormWindow::emitShowProperties( TQObject *w ) { if ( w ) { - QObject *opw = propertyWidget; + TQObject *opw = propertyWidget; propertyWidget = w; if ( opw->isWidgetType() ) - repaintSelection( (QWidget*)opw ); + repaintSelection( (TQWidget*)opw ); } showPropertiesTimer->stop(); // showPropertiesTimer->start( 0, TRUE ); showPropertiesTimerDone(); } -void FormWindow::emitUpdateProperties( QObject *w ) +void FormWindow::emitUpdateProperties( TQObject *w ) { if ( w == propertyWidget ) { updatePropertiesTimer->stop(); @@ -1700,13 +1700,13 @@ void FormWindow::currentToolChanged() case BUDDY_TOOL: restoreConnectionLine(); if ( startWidget ) - restoreRect( QRect( mapToForm( ( (QWidget*)startWidget )->parentWidget(), - ( (QWidget*)startWidget )->pos() ), - ( (QWidget*)startWidget )->size() ) ); + restoreRect( TQRect( mapToForm( ( (TQWidget*)startWidget )->parentWidget(), + ( (TQWidget*)startWidget )->pos() ), + ( (TQWidget*)startWidget )->size() ) ); if ( endWidget ) - restoreRect( QRect( mapToForm( ( (QWidget*)endWidget )->parentWidget(), - ( (QWidget*)endWidget )->pos() ), - ( (QWidget*)endWidget )->size() ) ); + restoreRect( TQRect( mapToForm( ( (TQWidget*)endWidget )->parentWidget(), + ( (TQWidget*)endWidget )->pos() ), + ( (TQWidget*)endWidget )->size() ) ); endUnclippedPainter(); break; case POINTER_TOOL: @@ -1771,12 +1771,12 @@ void FormWindow::showOrderIndicators() { hideOrderIndicators(); orderIndicators.setAutoDelete( TRUE ); - QObjectList *l = mainContainer()->queryList( "QWidget" ); + TQObjectList *l = mainContainer()->queryList( "TQWidget" ); stackedWidgets = MetaDataBase::tabOrder( this ); if ( l ) { int order = 1; - for ( QObject *o = l->first(); o; o = l->next() ) { - QWidget* w = (QWidget*) o; + for ( TQObject *o = l->first(); o; o = l->next() ) { + TQWidget* w = (TQWidget*) o; if ( w->isShown() && insertedWidgets[ (void*)w ] && w->focusPolicy() != NoFocus ) { @@ -1799,7 +1799,7 @@ void FormWindow::hideOrderIndicators() void FormWindow::updateOrderIndicators() { int order = 1; - for ( QWidget *w = stackedWidgets.first(); w; w = stackedWidgets.next() ) { + for ( TQWidget *w = stackedWidgets.first(); w; w = stackedWidgets.next() ) { for ( OrderIndicator* i = orderIndicators.first(); i; i = orderIndicators.next() ) i->setOrder( order, w ); order++; @@ -1820,25 +1820,25 @@ void FormWindow::updateUndoInfo() bool FormWindow::checkCustomWidgets() { - QStringList missingCustomWidgets; - QPtrDictIterator<QWidget> it( insertedWidgets ); + TQStringList missingCustomWidgets; + TQPtrDictIterator<TQWidget> it( insertedWidgets ); for ( ; it.current(); ++it ) { if ( it.current()->isA( "CustomWidget" ) ) { - QString className = WidgetFactory::classNameOf( it.current() ); + TQString className = WidgetFactory::classNameOf( it.current() ); if ( !MetaDataBase::hasCustomWidget( className ) ) missingCustomWidgets << className; } } if ( !missingCustomWidgets.isEmpty() ) { - QString txt = i18n( "The following custom widgets are used in '%1',\n" + TQString txt = i18n( "The following custom widgets are used in '%1',\n" "but are not known to Qt Designer:\n" ).arg( name() ); - for ( QStringList::Iterator sit = missingCustomWidgets.begin(); sit != missingCustomWidgets.end(); ++sit ) + for ( TQStringList::Iterator sit = missingCustomWidgets.begin(); sit != missingCustomWidgets.end(); ++sit ) txt += " " + *sit + "\n"; txt += i18n( "If you save this form and generate code for it using uic, \n" "the generated code will not compile.\n" "Do you want to save this form now?" ); - if ( QMessageBox::information( mainWindow(), i18n( "Save Form" ), txt ) == 1 ) + if ( TQMessageBox::information( mainWindow(), i18n( "Save Form" ), txt ) == 1 ) return FALSE; } return TRUE; @@ -1859,9 +1859,9 @@ int FormWindow::numSelectedWidgets() const return usedSelections.count(); } -QString FormWindow::copy() +TQString FormWindow::copy() { - CHECK_MAINWINDOW_VALUE( QString::null ); + CHECK_MAINWINDOW_VALUE( TQString::null ); Resource resource( mainWindow() ); resource.setWidget( this ); return resource.copy(); @@ -1869,8 +1869,8 @@ QString FormWindow::copy() void FormWindow::lowerWidgets() { - QWidgetList widgets; - QPtrDictIterator<WidgetSelection> it( usedSelections ); + TQWidgetList widgets; + TQPtrDictIterator<WidgetSelection> it( usedSelections ); for ( ; it.current(); ++it ) widgets.append( it.current()->widget() ); @@ -1879,22 +1879,22 @@ void FormWindow::lowerWidgets() commandHistory()->addCommand( cmd ); } -void find_accel( const QString &txt, QMap<QChar, QWidgetList > &accels, QWidget *w ) +void find_accel( const TQString &txt, TQMap<TQChar, TQWidgetList > &accels, TQWidget *w ) { int i = txt.find( "&" ); if ( i == -1 ) return; - QChar c = txt[ i + 1 ]; + TQChar c = txt[ i + 1 ]; if ( c.isNull() || c == '&' ) return; c = c.lower(); - QMap<QChar, QWidgetList >::Iterator it = accels.find( c ); + TQMap<TQChar, TQWidgetList >::Iterator it = accels.find( c ); if ( it == accels.end() ) { - QWidgetList wl; + TQWidgetList wl; wl.append( w ); accels.insert( c, wl ); } else { - QWidgetList *wl = &*it; + TQWidgetList *wl = &*it; wl->append( w ); } } @@ -1902,18 +1902,18 @@ void find_accel( const QString &txt, QMap<QChar, QWidgetList > &accels, QWidget void FormWindow::checkAccels() { CHECK_MAINWINDOW; - QMap<QChar, QWidgetList > accels; - QObjectList *l = mainContainer()->queryList( "QWidget" ); + TQMap<TQChar, TQWidgetList > accels; + TQObjectList *l = mainContainer()->queryList( "TQWidget" ); if ( l ) { - for ( QObject *o = l->first(); o; o = l->next() ) { - if ( ( (QWidget*)o )->isVisibleTo( this ) && + for ( TQObject *o = l->first(); o; o = l->next() ) { + if ( ( (TQWidget*)o )->isVisibleTo( this ) && insertedWidgets[ (void*)o ] ) { - QWidget *w = (QWidget*)o; - const QMetaProperty* text = + TQWidget *w = (TQWidget*)o; + const TQMetaProperty* text = w->metaObject()->property( w->metaObject()->findProperty( "text", TRUE ), TRUE ); - const QMetaProperty* title = + const TQMetaProperty* title = w->metaObject()->property( w->metaObject()->findProperty( "title", TRUE ), TRUE ); - const QMetaProperty* pageTitle = + const TQMetaProperty* pageTitle = w->metaObject()->property( w->metaObject()->findProperty( "pageTitle", TRUE ), TRUE ); if ( text ) find_accel( w->property( "text" ).toString(), accels, w ); @@ -1929,15 +1929,15 @@ void FormWindow::checkAccels() } bool ok = TRUE; - QWidget *wid; - for ( QMap<QChar, QWidgetList >::Iterator it = accels.begin(); it != accels.end(); ++it ) { + TQWidget *wid; + for ( TQMap<TQChar, TQWidgetList >::Iterator it = accels.begin(); it != accels.end(); ++it ) { if ( (*it).count() > 1 ) { ok = FALSE; - switch ( QMessageBox::information( mainWindow(), i18n( "Check Accelerators" ), + switch ( TQMessageBox::information( mainWindow(), i18n( "Check Accelerators" ), i18n( "Accelerator '%1' is used once.", "Accelerator '%1' is used %n times.", (*it).count() ).arg( it.key().upper() ), i18n( "&Select" ), - i18n( "&Cancel" ), QString::null, 2 ) ) { + i18n( "&Cancel" ), TQString::null, 2 ) ) { case 0: // select clearSelection( FALSE ); for ( wid = (*it).first(); wid; wid = (*it).next() ) @@ -1950,14 +1950,14 @@ void FormWindow::checkAccels() } if ( ok ) - QMessageBox::information( mainWindow(), i18n( "Check Accelerators" ), + TQMessageBox::information( mainWindow(), i18n( "Check Accelerators" ), i18n( "No accelerator is used more than once." ) ); } void FormWindow::raiseWidgets() { - QWidgetList widgets; - QPtrDictIterator<WidgetSelection> it( usedSelections ); + TQWidgetList widgets; + TQPtrDictIterator<WidgetSelection> it( usedSelections ); for ( ; it.current(); ++it ) widgets.append( it.current()->widget() ); @@ -1966,7 +1966,7 @@ void FormWindow::raiseWidgets() commandHistory()->addCommand( cmd ); } -void FormWindow::paste( const QString &cb, QWidget *parent ) +void FormWindow::paste( const TQString &cb, TQWidget *parent ) { CHECK_MAINWINDOW; Resource resource( mainWindow() ); @@ -1978,12 +1978,12 @@ void FormWindow::selectAll() { checkedSelectionsForMove = FALSE; blockSignals( TRUE ); - QObjectList *l = mainContainer()->queryList( "QWidget" ); + TQObjectList *l = mainContainer()->queryList( "TQWidget" ); if ( l ) { - for ( QObject *o = l->first(); o; o = l->next() ) { - if ( ( (QWidget*)o )->isVisibleTo( this ) && + for ( TQObject *o = l->first(); o; o = l->next() ) { + if ( ( (TQWidget*)o )->isVisibleTo( this ) && insertedWidgets[ (void*)o ] ) { - selectWidget( (QWidget*)o ); + selectWidget( (TQWidget*)o ); } } delete l; @@ -1998,7 +1998,7 @@ void FormWindow::selectAll() void FormWindow::layoutHorizontal() { - QWidgetList widgets( selectedWidgets() ); + TQWidgetList widgets( selectedWidgets() ); LayoutHorizontalCommand *cmd = new LayoutHorizontalCommand( i18n( "Lay Out Horizontally" ), this, mainContainer(), 0, widgets ); clearSelection( FALSE ); @@ -2008,7 +2008,7 @@ void FormWindow::layoutHorizontal() void FormWindow::layoutVertical() { - QWidgetList widgets( selectedWidgets() ); + TQWidgetList widgets( selectedWidgets() ); LayoutVerticalCommand *cmd = new LayoutVerticalCommand( i18n( "Lay Out Vertically" ), this, mainContainer(), 0, widgets ); clearSelection( FALSE ); @@ -2018,7 +2018,7 @@ void FormWindow::layoutVertical() void FormWindow::layoutHorizontalSplit() { - QWidgetList widgets( selectedWidgets() ); + TQWidgetList widgets( selectedWidgets() ); LayoutHorizontalSplitCommand *cmd = new LayoutHorizontalSplitCommand( i18n( "Lay Out Horizontally (in splitter)" ), this, mainContainer(), 0, widgets ); clearSelection( FALSE ); @@ -2028,7 +2028,7 @@ void FormWindow::layoutHorizontalSplit() void FormWindow::layoutVerticalSplit() { - QWidgetList widgets( selectedWidgets() ); + TQWidgetList widgets( selectedWidgets() ); LayoutVerticalSplitCommand *cmd = new LayoutVerticalSplitCommand( i18n( "Lay Out Vertically (in splitter)" ), this, mainContainer(), 0, widgets ); clearSelection( FALSE ); @@ -2041,7 +2041,7 @@ void FormWindow::layoutGrid() int xres = grid().x(); int yres = grid().y(); - QWidgetList widgets( selectedWidgets() ); + TQWidgetList widgets( selectedWidgets() ); LayoutGridCommand *cmd = new LayoutGridCommand( i18n( "Lay Out in a Grid" ), this, mainContainer(), 0, widgets, xres, yres ); clearSelection( FALSE ); @@ -2049,19 +2049,19 @@ void FormWindow::layoutGrid() cmd->execute(); } -void FormWindow::layoutHorizontalContainer( QWidget *w ) +void FormWindow::layoutHorizontalContainer( TQWidget *w ) { if ( w == this ) w = mainContainer(); - QObjectList *l = (QObjectList*)WidgetFactory::containerOfWidget(w)->children(); + TQObjectList *l = (TQObjectList*)WidgetFactory::containerOfWidget(w)->children(); if ( !l ) return; - QWidgetList widgets; - for ( QObject *o = l->first(); o; o = l->next() ) { + TQWidgetList widgets; + for ( TQObject *o = l->first(); o; o = l->next() ) { if ( o->isWidgetType() && - ( (QWidget*)o )->isVisibleTo( this ) && - insertedWidgets.find( (QWidget*)o ) ) - widgets.append( (QWidget*)o ); + ( (TQWidget*)o )->isVisibleTo( this ) && + insertedWidgets.find( (TQWidget*)o ) ) + widgets.append( (TQWidget*)o ); } LayoutHorizontalCommand *cmd = new LayoutHorizontalCommand( i18n( "Lay Out Children Horizontally" ), this, mainContainer(), w, widgets ); @@ -2070,19 +2070,19 @@ void FormWindow::layoutHorizontalContainer( QWidget *w ) cmd->execute(); } -void FormWindow::layoutVerticalContainer( QWidget *w ) +void FormWindow::layoutVerticalContainer( TQWidget *w ) { if ( w == this ) w = mainContainer(); - QObjectList *l = (QObjectList*)WidgetFactory::containerOfWidget(w)->children(); + TQObjectList *l = (TQObjectList*)WidgetFactory::containerOfWidget(w)->children(); if ( !l ) return; - QWidgetList widgets; - for ( QObject *o = l->first(); o; o = l->next() ) { + TQWidgetList widgets; + for ( TQObject *o = l->first(); o; o = l->next() ) { if ( o->isWidgetType() && - ( (QWidget*)o )->isVisibleTo( this ) && - insertedWidgets.find( (QWidget*)o ) ) - widgets.append( (QWidget*)o ); + ( (TQWidget*)o )->isVisibleTo( this ) && + insertedWidgets.find( (TQWidget*)o ) ) + widgets.append( (TQWidget*)o ); } LayoutVerticalCommand *cmd = new LayoutVerticalCommand( i18n( "Lay Out Children Vertically" ), this, mainContainer(), w, widgets ); @@ -2091,22 +2091,22 @@ void FormWindow::layoutVerticalContainer( QWidget *w ) cmd->execute(); } -void FormWindow::layoutGridContainer( QWidget *w ) +void FormWindow::layoutGridContainer( TQWidget *w ) { if ( w == this ) w = mainContainer(); int xres = grid().x(); int yres = grid().y(); - QObjectList *l = (QObjectList*)WidgetFactory::containerOfWidget(w)->children(); + TQObjectList *l = (TQObjectList*)WidgetFactory::containerOfWidget(w)->children(); if ( !l ) return; - QWidgetList widgets; - for ( QObject *o = l->first(); o; o = l->next() ) { + TQWidgetList widgets; + for ( TQObject *o = l->first(); o; o = l->next() ) { if ( o->isWidgetType() && - ( (QWidget*)o )->isVisibleTo( this ) && - insertedWidgets.find( (QWidget*)o ) ) - widgets.append( (QWidget*)o ); + ( (TQWidget*)o )->isVisibleTo( this ) && + insertedWidgets.find( (TQWidget*)o ) ) + widgets.append( (TQWidget*)o ); } LayoutGridCommand *cmd = new LayoutGridCommand( i18n( "Lay Out Children in a Grid" ), this, mainContainer(), w, widgets, xres, yres ); @@ -2115,12 +2115,12 @@ void FormWindow::layoutGridContainer( QWidget *w ) cmd->execute(); } -void FormWindow::breakLayout( QWidget *w ) +void FormWindow::breakLayout( TQWidget *w ) { if ( w == this ) w = mainContainer(); w = WidgetFactory::containerOfWidget( w ); - QPtrList<Command> commands; + TQPtrList<Command> commands; for (;;) { if ( !w || w == this ) @@ -2130,7 +2130,7 @@ void FormWindow::breakLayout( QWidget *w ) Command *cmd = breakLayoutCommand( w ); if ( cmd ) commands.insert( 0, cmd ); - if ( !::qt_cast<QLayoutWidget*>(w) && !::qt_cast<QSplitter*>(w) ) + if ( !::qt_cast<QLayoutWidget*>(w) && !::qt_cast<TQSplitter*>(w) ) break; } w = w->parentWidget(); @@ -2145,27 +2145,27 @@ void FormWindow::breakLayout( QWidget *w ) cmd->execute(); } -BreakLayoutCommand *FormWindow::breakLayoutCommand( QWidget *w ) +BreakLayoutCommand *FormWindow::breakLayoutCommand( TQWidget *w ) { CHECK_MAINWINDOW_VALUE( 0 ); - QObjectList *l = (QObjectList*)w->children(); + TQObjectList *l = (TQObjectList*)w->children(); if ( !l ) return 0; - QWidgetList widgets; - for ( QObject *o = l->first(); o; o = l->next() ) { + TQWidgetList widgets; + for ( TQObject *o = l->first(); o; o = l->next() ) { if ( o->isWidgetType() && - !mainWindow()->isAToolBarChild( (QWidget*)o ) && - ( (QWidget*)o )->isVisibleTo( this ) && - insertedWidgets.find( (QWidget*)o ) ) - widgets.append( (QWidget*)o ); + !mainWindow()->isAToolBarChild( (TQWidget*)o ) && + ( (TQWidget*)o )->isVisibleTo( this ) && + insertedWidgets.find( (TQWidget*)o ) ) + widgets.append( (TQWidget*)o ); } return new BreakLayoutCommand( i18n( "Break Layout" ), this, WidgetFactory::widgetOfContainer( w ), widgets ); } int FormWindow::numVisibleWidgets() const { - QPtrDictIterator<QWidget> it( insertedWidgets ); + TQPtrDictIterator<TQWidget> it( insertedWidgets ); int visible = 0; for ( ; it.current(); ++it ) { if ( it.current()->isVisibleTo( (FormWindow*)this ) ) @@ -2174,23 +2174,23 @@ int FormWindow::numVisibleWidgets() const return visible; } -bool FormWindow::hasInsertedChildren( QWidget *w ) const +bool FormWindow::hasInsertedChildren( TQWidget *w ) const { if ( !w ) return FALSE; w = WidgetFactory::containerOfWidget( w ); if ( !w ) return FALSE; - QObjectList *l = w->queryList( "QWidget" ); + TQObjectList *l = w->queryList( "TQWidget" ); if ( !l || !l->first() ) { delete l; return FALSE; } - for ( QObject *o = l->first(); o; o = l->next() ) { + for ( TQObject *o = l->first(); o; o = l->next() ) { if ( o->isWidgetType() && - ( (QWidget*)o )->isVisibleTo( (FormWindow*)this ) && - insertedWidgets.find( (QWidget*)o ) ) { + ( (TQWidget*)o )->isVisibleTo( (FormWindow*)this ) && + insertedWidgets.find( (TQWidget*)o ) ) { delete l; return TRUE; } @@ -2200,7 +2200,7 @@ bool FormWindow::hasInsertedChildren( QWidget *w ) const return FALSE; } -bool FormWindow::allowMove( QWidget *w ) +bool FormWindow::allowMove( TQWidget *w ) { w = w->parentWidget(); while ( w ) { @@ -2221,8 +2221,8 @@ void FormWindow::editConnections() ConnectionDialog dlg( mainwindow ); mainWindow()->statusMessage( i18n( "Edit connections...") ); - dlg.addConnection( startWidget, endWidget, QString::null, QString::null ); - QTimer::singleShot( 0, &dlg, SLOT(ensureConnectionVisible()) ); + dlg.addConnection( startWidget, endWidget, TQString::null, TQString::null ); + TQTimer::singleShot( 0, &dlg, TQT_SLOT(ensureConnectionVisible()) ); dlg.exec(); } @@ -2230,8 +2230,8 @@ void FormWindow::saveBackground() { if ( buffer ) delete buffer; - buffer = new QPixmap( width(), height() ); - *buffer = QPixmap::grabWindow( winId() ); + buffer = new TQPixmap( width(), height() ); + *buffer = TQPixmap::grabWindow( winId() ); } void FormWindow::restoreConnectionLine() @@ -2241,7 +2241,7 @@ void FormWindow::restoreConnectionLine() int a =QABS( startPos.x() - currentPos.x() ); int b = QABS( startPos.y() - currentPos.y() ); - QRect r( startPos, currentPos ); + TQRect r( startPos, currentPos ); if ( a < 32 || b < 32 ) { // special case: vertical or horizontal line r = r.normalize(); @@ -2265,7 +2265,7 @@ void FormWindow::restoreConnectionLine() int dx = 2 * w / 3; int dy = 2 * h / 3; - QPoint p( startPos ); + TQPoint p( startPos ); if ( r.x() > r.right() ) { dx = dx * -1; @@ -2281,7 +2281,7 @@ void FormWindow::restoreConnectionLine() w = h = 64; r = r.normalize(); while ( r.contains( p ) ) { - unclippedPainter->drawPixmap( p, *buffer, QRect( p, QSize( w, h ) ) ); + unclippedPainter->drawPixmap( p, *buffer, TQRect( p, TQSize( w, h ) ) ); unclippedPainter->setPen( red ); p.setX( p.x() + dx ); p.setY( p.y() + dy ); @@ -2291,15 +2291,15 @@ void FormWindow::restoreConnectionLine() startPos.x() - 10, startPos.y() - 10, 20, 20 ); } -void FormWindow::restoreRect( const QRect &rect ) +void FormWindow::restoreRect( const TQRect &rect ) { if (!unclippedPainter || !buffer) return; - QRect r( rect ); + TQRect r( rect ); r = r.normalize(); - r = QRect( r.x() + 2, r.y() + 2, r.width() - 4, r.height() - 4 ); + r = TQRect( r.x() + 2, r.y() + 2, r.width() - 4, r.height() - 4 ); unclippedPainter->drawPixmap( r.x() - 2, r.y() - 2, *buffer, r.x() - 2, r.y() - 2, r.width() + 4, 4 ); unclippedPainter->drawPixmap( r.x() - 2, r.y() - 2, *buffer, r.x() - 2, r.y() - 2, 4, r.height() + 4 ); @@ -2312,36 +2312,36 @@ void FormWindow::drawConnectionLine() if ( !unclippedPainter ) return; - unclippedPainter->setPen( QPen( white, 2 ) ); + unclippedPainter->setPen( TQPen( white, 2 ) ); unclippedPainter->drawLine( startPos, currentPos ); if ( validForBuddy ) - unclippedPainter->setPen( QPen( darkRed, 1 ) ); + unclippedPainter->setPen( TQPen( darkRed, 1 ) ); else - unclippedPainter->setPen( QPen( darkCyan, 1 ) ); + unclippedPainter->setPen( TQPen( darkCyan, 1 ) ); unclippedPainter->drawLine( startPos, currentPos ); if ( validForBuddy ) - unclippedPainter->setPen( QPen( darkGreen, 1 ) ); + unclippedPainter->setPen( TQPen( darkGreen, 1 ) ); else - unclippedPainter->setPen( QPen( magenta, 1 ) ); + unclippedPainter->setPen( TQPen( magenta, 1 ) ); if ( startWidget ) { - QWidget *s = (QWidget*)startWidget; - QPoint p = mapToForm( s, QPoint(0,0) ); - unclippedPainter->drawRect( QRect( p + QPoint( 2, 2 ), s->size() - QSize( 4, 4 ) ) ); + TQWidget *s = (TQWidget*)startWidget; + TQPoint p = mapToForm( s, TQPoint(0,0) ); + unclippedPainter->drawRect( TQRect( p + TQPoint( 2, 2 ), s->size() - TQSize( 4, 4 ) ) ); } if ( endWidget ) { - QWidget *e = (QWidget*)endWidget; - QPoint p = mapToForm( e, QPoint(0,0) ); - unclippedPainter->drawRect( QRect( p + QPoint( 2, 2 ), e->size() - QSize( 4, 4 ) ) ); + TQWidget *e = (TQWidget*)endWidget; + TQPoint p = mapToForm( e, TQPoint(0,0) ); + unclippedPainter->drawRect( TQRect( p + TQPoint( 2, 2 ), e->size() - TQSize( 4, 4 ) ) ); } } -QString FormWindow::fileName() const +TQString FormWindow::fileName() const { return ff->absFileName(); } -void FormWindow::setFileName( const QString &fn ) +void FormWindow::setFileName( const TQString &fn ) { ff->setFileName( fn ); emit fileNameChanged( ff->fileName(), this ); @@ -2353,33 +2353,33 @@ void FormWindow::modificationChanged( bool m ) emit modificationChanged( m, ff->fileName() ); } -bool FormWindow::unify( QObject *w, QString &s, bool changeIt ) +bool FormWindow::unify( TQObject *w, TQString &s, bool changeIt ) { bool found = !isMainContainer( w ) && qstrcmp( name(), s.latin1() ) == 0; if ( !found ) { - QString orig = s; + TQString orig = s; int num = 1; - QPtrDictIterator<QWidget> it( insertedWidgets ); + TQPtrDictIterator<TQWidget> it( insertedWidgets ); for ( ; it.current();) { if ( it.current() != w && qstrcmp( it.current()->name(), s.latin1() ) == 0 ) { found = TRUE; if ( !changeIt ) break; - s = orig + "_" + QString::number( ++num ); + s = orig + "_" + TQString::number( ++num ); it.toFirst(); } else { ++it; } } if ( !found ) { - QPtrList<QAction> al; - QAction *a = 0; + TQPtrList<TQAction> al; + TQAction *a = 0; for ( a = actions.first(); a; a = actions.next() ) { - QObjectList *l = a->queryList( "QAction" ); + TQObjectList *l = a->queryList( "TQAction" ); al.append( a ); - for ( QObject *ao = l->first(); ao; ao = l->next() ) - al.append( (QAction*)ao ); + for ( TQObject *ao = l->first(); ao; ao = l->next() ) + al.append( (TQAction*)ao ); delete l; } for ( a = al.first(); a; a = al.next() ) { @@ -2388,35 +2388,35 @@ bool FormWindow::unify( QObject *w, QString &s, bool changeIt ) found = TRUE; if ( !changeIt ) break; - s = orig + "_" + QString::number( ++num ); + s = orig + "_" + TQString::number( ++num ); a = actions.first(); } } } - if ( ::qt_cast<QMainWindow*>(mainContainer()) && !found ) { - QObjectList *l = mainContainer()->queryList( "PopupMenuEditor" ); - for ( QObject *o = l->first(); o; o = l->next() ) { + if ( ::qt_cast<TQMainWindow*>(mainContainer()) && !found ) { + TQObjectList *l = mainContainer()->queryList( "PopupMenuEditor" ); + for ( TQObject *o = l->first(); o; o = l->next() ) { if ( o != w && qstrcmp ( o->name(), s.latin1() ) == 0 ) { found = TRUE; if ( !changeIt ) break; - s = orig + "_" + QString::number( ++num ); + s = orig + "_" + TQString::number( ++num ); o = l->first(); } } delete l; } - if ( ::qt_cast<QMainWindow*>(mainContainer()) ) { + if ( ::qt_cast<TQMainWindow*>(mainContainer()) ) { if ( !found ) { - QObjectList *l = mainContainer()->queryList( "QDockWindow", 0, TRUE ); - for ( QObject *o = l->first(); o; o = l->next() ) { + TQObjectList *l = mainContainer()->queryList( "TQDockWindow", 0, TRUE ); + for ( TQObject *o = l->first(); o; o = l->next() ) { if ( o != w && qstrcmp( o->name(), s.latin1() ) == 0 ) { found = TRUE; if ( !changeIt ) break; - s = orig + "_" + QString::number( ++num ); + s = orig + "_" + TQString::number( ++num ); o = l->first(); } } @@ -2432,7 +2432,7 @@ bool FormWindow::unify( QObject *w, QString &s, bool changeIt ) bool FormWindow::isCustomWidgetUsed( MetaDataBase::CustomWidget *w ) { - QPtrDictIterator<QWidget> it( insertedWidgets ); + TQPtrDictIterator<TQWidget> it( insertedWidgets ); for ( ; it.current(); ++it ) { if ( it.current()->isA( "CustomWidget" ) ) { if ( qstrcmp( WidgetFactory::classNameOf( it.current() ), w->className.utf8() ) == 0 ) @@ -2446,11 +2446,11 @@ bool FormWindow::isCustomWidgetUsed( MetaDataBase::CustomWidget *w ) bool FormWindow::isDatabaseWidgetUsed() const { #ifndef QT_NO_SQL - QStringList dbClasses; - dbClasses << "QDataTable"; // add more here - QPtrDictIterator<QWidget> it( insertedWidgets ); + TQStringList dbClasses; + dbClasses << "TQDataTable"; // add more here + TQPtrDictIterator<TQWidget> it( insertedWidgets ); for ( ; it.current(); ++it ) { - QString c( it.current()->className() ); + TQString c( it.current()->className() ); if ( dbClasses.contains( c ) > 0 ) { return TRUE; } @@ -2462,7 +2462,7 @@ bool FormWindow::isDatabaseWidgetUsed() const bool FormWindow::isDatabaseAware() const { #ifndef QT_NO_SQL - if ( QString(mContainer->className()) == "QDesignerDataBrowser" || QString(mContainer->className()) == "QDesignerDataView" ) + if ( TQString(mContainer->className()) == "QDesignerDataBrowser" || TQString(mContainer->className()) == "QDesignerDataView" ) return TRUE; return isDatabaseWidgetUsed(); #else @@ -2487,18 +2487,18 @@ void FormWindow::visibilityChanged() This is the equivalent to mapFromGlobal(w->mapToGlobal(pos) ) but avoids the two roundtrips to the X-Server on Unix/X11. */ -QPoint FormWindow::mapToForm( const QWidget* w, const QPoint& pos ) const +TQPoint FormWindow::mapToForm( const TQWidget* w, const TQPoint& pos ) const { - QPoint p = pos; - const QWidget* i = w; - while ( i && !i->isTopLevel() && !isMainContainer( (QWidget*)i ) ) { + TQPoint p = pos; + const TQWidget* i = w; + while ( i && !i->isTopLevel() && !isMainContainer( (TQWidget*)i ) ) { p = i->mapToParent( p ); i = i->parentWidget(); } return mapFromGlobal( w->mapToGlobal( pos ) ); } -static int widgetDepth( QWidget *w ) +static int widgetDepth( TQWidget *w ) { int d = -1; while ( w && !w->isTopLevel() ) { @@ -2509,7 +2509,7 @@ static int widgetDepth( QWidget *w ) return d; } -static bool isChildOf( QWidget *c, QWidget *p ) +static bool isChildOf( TQWidget *c, TQWidget *p ) { while ( c && !c->isTopLevel() ) { if ( c == p ) @@ -2519,12 +2519,12 @@ static bool isChildOf( QWidget *c, QWidget *p ) return FALSE; } -QWidget *FormWindow::containerAt( const QPoint &pos, QWidget *notParentOf ) +TQWidget *FormWindow::containerAt( const TQPoint &pos, TQWidget *notParentOf ) { - QPtrDictIterator<QWidget> it( insertedWidgets ); - QWidget *container = 0; + TQPtrDictIterator<TQWidget> it( insertedWidgets ); + TQWidget *container = 0; int depth = -1; - QWidgetList selected = selectedWidgets(); + TQWidgetList selected = selectedWidgets(); if ( rect().contains( mapFromGlobal( pos ) ) ) { container = mainContainer(); depth = widgetDepth( container ); @@ -2532,7 +2532,7 @@ QWidget *FormWindow::containerAt( const QPoint &pos, QWidget *notParentOf ) for ( ; it.current(); ++it ) { if ( ::qt_cast<QLayoutWidget*>(it.current()) - || ::qt_cast<QSplitter*>(it.current()) ) + || ::qt_cast<TQSplitter*>(it.current()) ) continue; if ( !it.current()->isVisibleTo( this ) ) continue; @@ -2543,7 +2543,7 @@ QWidget *FormWindow::containerAt( const QPoint &pos, QWidget *notParentOf ) continue; // the rectangles of all ancestors of the container must contain the insert position - QWidget *w = it.current(); + TQWidget *w = it.current(); while ( w && !w->isTopLevel() ) { if ( !w->rect().contains( ( w->mapFromGlobal( pos ) ) ) ) break; @@ -2553,8 +2553,8 @@ QWidget *FormWindow::containerAt( const QPoint &pos, QWidget *notParentOf ) int wd = widgetDepth( it.current() ); if ( wd == depth && container ) { - if ( ( (QObjectList*)it.current()->parentWidget()->children() )->find( it.current() ) > - ( (QObjectList*)container->parentWidget()->children() )->find( container ) ) + if ( ( (TQObjectList*)it.current()->parentWidget()->children() )->find( it.current() ) > + ( (TQObjectList*)container->parentWidget()->children() )->find( container ) ) wd++; } if ( wd > depth && !isChildOf( it.current(), notParentOf ) ) { @@ -2566,12 +2566,12 @@ QWidget *FormWindow::containerAt( const QPoint &pos, QWidget *notParentOf ) return container; } -bool FormWindow::isMainContainer( QObject *w ) const +bool FormWindow::isMainContainer( TQObject *w ) const { - return w && w->isWidgetType() && ( w == (QWidget*)this || w == mainContainer() ); + return w && w->isWidgetType() && ( w == (TQWidget*)this || w == mainContainer() ); } -void FormWindow::setMainContainer( QWidget *w ) +void FormWindow::setMainContainer( TQWidget *w ) { bool resetPropertyWidget = isMainContainer( propertyWidget ); if ( mContainer ) @@ -2582,13 +2582,13 @@ void FormWindow::setMainContainer( QWidget *w ) mContainer = w; insertedWidgets.insert( mContainer, mContainer ); delete layout(); - QHBoxLayout *l = new QHBoxLayout( this ); + TQHBoxLayout *l = new TQHBoxLayout( this ); l->addWidget( w ); if ( resetPropertyWidget ) { - QObject *opw = propertyWidget; + TQObject *opw = propertyWidget; propertyWidget = mContainer; if ( opw && opw->isWidgetType() ) - repaintSelection( (QWidget*)opw ); + repaintSelection( (TQWidget*)opw ); } if ( project() ) { LanguageInterface *iface = MetaDataBase::languageInterface( project()->language() ); @@ -2618,7 +2618,7 @@ bool FormWindow::savePixmapInProject() const return pixProject; } -QString FormWindow::pixmapLoaderFunction() const +TQString FormWindow::pixmapLoaderFunction() const { return pixLoader; } @@ -2637,12 +2637,12 @@ void FormWindow::setSavePixmapInProject( bool b ) pixInline = FALSE; } -void FormWindow::setPixmapLoaderFunction( const QString &func ) +void FormWindow::setPixmapLoaderFunction( const TQString &func ) { pixLoader = func; } -void FormWindow::setActiveObject( QObject *o ) +void FormWindow::setActiveObject( TQObject *o ) { emitShowProperties( o ); propertyWidget = o; @@ -2658,25 +2658,25 @@ Project *FormWindow::project() const return proj; } -QAction *FormWindow::findAction( const QString &name ) +TQAction *FormWindow::findAction( const TQString &name ) { - for ( QAction *a = actionList().first(); a; a = actionList().next() ) { - if ( QString( a->name() ) == name ) + for ( TQAction *a = actionList().first(); a; a = actionList().next() ) { + if ( TQString( a->name() ) == name ) return a; - QAction *ac = (QAction*)a->child( name.latin1(), "QAction" ); + TQAction *ac = (TQAction*)a->child( name.latin1(), "TQAction" ); if ( ac ) return ac; } return 0; } -void FormWindow::killAccels( QObject *top ) +void FormWindow::killAccels( TQObject *top ) { - QObjectList *l = top->queryList( "QAccel" ); + TQObjectList *l = top->queryList( "TQAccel" ); if ( !l ) return; - for ( QObject *o = l->first(); o; o = l->next() ) - ( (QAccel*)o )->setEnabled( FALSE ); + for ( TQObject *o = l->first(); o; o = l->next() ) + ( (TQAccel*)o )->setEnabled( FALSE ); delete l; } @@ -2687,11 +2687,11 @@ DesignerFormWindow *FormWindow::iFace() return iface; } -bool FormWindow::isCentralWidget( QObject *w ) const +bool FormWindow::isCentralWidget( TQObject *w ) const { - if ( !::qt_cast<QMainWindow*>(mainContainer()) ) + if ( !::qt_cast<TQMainWindow*>(mainContainer()) ) return FALSE; - return w == ( (QMainWindow*)mainContainer() )->centralWidget(); + return w == ( (TQMainWindow*)mainContainer() )->centralWidget(); } int FormWindow::layoutDefaultSpacing() const @@ -2714,12 +2714,12 @@ void FormWindow::setLayoutDefaultMargin( int s ) defMargin = s; } -void FormWindow::setSpacingFunction( const QString &funct ) +void FormWindow::setSpacingFunction( const TQString &funct ) { spacFunction = funct; } -QString FormWindow::spacingFunction() const +TQString FormWindow::spacingFunction() const { return spacFunction; } @@ -2734,12 +2734,12 @@ bool FormWindow::hasLayoutFunctions() const return hasLayoutFunc; } -void FormWindow::setMarginFunction( const QString &funct ) +void FormWindow::setMarginFunction( const TQString &funct ) { margFunction = funct; } -QString FormWindow::marginFunction() const +TQString FormWindow::marginFunction() const { return margFunction; } @@ -2753,17 +2753,17 @@ void FormWindow::setFormFile( FormFile *f ) { ff = f; if ( ff ) - connect( this, SIGNAL( modificationChanged(bool, const QString&) ), ff, SLOT( formWindowChangedSomehow() ) ); + connect( this, TQT_SIGNAL( modificationChanged(bool, const TQString&) ), ff, TQT_SLOT( formWindowChangedSomehow() ) ); } -bool FormWindow::canBeBuddy( const QWidget *w ) const +bool FormWindow::canBeBuddy( const TQWidget *w ) const { - return w->focusPolicy() != QWidget::NoFocus; + return w->focusPolicy() != TQWidget::NoFocus; } -bool FormWindow::event( QEvent *e ) +bool FormWindow::event( TQEvent *e ) { - if (e->type() == QEvent::ShowMaximized) + if (e->type() == TQEvent::ShowMaximized) { #if QT_VERSION >= 0x030300 if ( isMaximized() ) @@ -2771,5 +2771,5 @@ bool FormWindow::event( QEvent *e ) #endif return true; } - return QWidget::event(e); + return TQWidget::event(e); } |