diff options
author | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2011-06-14 16:45:05 +0000 |
---|---|---|
committer | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2011-06-14 16:45:05 +0000 |
commit | 48d4a26399959121f33d2bc3bfe51c7827b654fc (patch) | |
tree | 5ae5e6e00d3ba330b7b8be9bc097154b6bc739e8 /kdevdesigner/designer/formwindow.cpp | |
parent | 7e701ace6592d09e1f2c0cf28c7d6d872d78f4f5 (diff) | |
download | tdevelop-48d4a26399959121f33d2bc3bfe51c7827b654fc.tar.gz tdevelop-48d4a26399959121f33d2bc3bfe51c7827b654fc.zip |
TQt4 port kdevelop
This enables compilation under both Qt3 and Qt4
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdevelop@1236710 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'kdevdesigner/designer/formwindow.cpp')
-rw-r--r-- | kdevdesigner/designer/formwindow.cpp | 662 |
1 files changed, 330 insertions, 332 deletions
diff --git a/kdevdesigner/designer/formwindow.cpp b/kdevdesigner/designer/formwindow.cpp index b34a49e1..cd097c54 100644 --- a/kdevdesigner/designer/formwindow.cpp +++ b/kdevdesigner/designer/formwindow.cpp @@ -1,15 +1,15 @@ /********************************************************************** ** Copyright (C) 2000 Trolltech AS. All rights reserved. ** -** This file is part of Qt Designer. +** This file is part of TQt Designer. ** ** This file may be distributed and/or modified under the terms of the ** GNU General Public License version 2 as published by the Free Software ** Foundation and appearing in the file LICENSE.GPL included in the ** packaging of this file. ** -** Licensees holding valid Qt Enterprise Edition or Qt Professional Edition -** licenses may use this file in accordance with the Qt Commercial License +** Licensees holding valid TQt Enterprise Edition or TQt Professional Edition +** licenses may use this file in accordance with the TQt Commercial License ** Agreement provided with the Software. ** ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE @@ -17,7 +17,7 @@ ** ** See http://www.trolltech.com/gpl/ for GPL licensing information. ** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for -** information about Qt Commercial License Agreements. +** information about TQt Commercial License Agreements. ** ** Contact info@trolltech.com if any conditions of this licensing are ** not clear to you. @@ -31,7 +31,7 @@ #include "sizehandle.h" #include "metadatabase.h" #include "resource.h" -#include "layout.h" +#include "tqlayout.h" #include "connectiondialog.h" #include <widgetdatabase.h> #include "pixmapchooser.h" @@ -84,10 +84,10 @@ static void setCursorToAll( const TQCursor &c, TQWidget *start ) { start->setCursor( c ); - TQObjectList *l = (TQObjectList*)start->children(); - if ( l ) { - for ( TQObject *o = l->first(); o; o = l->next() ) { - if ( o->isWidgetType() && !::qt_cast<SizeHandle*>(o) ) + TQObjectList l = start->childrenListObject(); + if ( !l.isEmpty() ) { + for ( TQObject *o = l.first(); o; o = l.next() ) { + if ( o->isWidgetType() && !::tqqt_cast<SizeHandle*>(o) ) setCursorToAll( c, ( (TQWidget*)o ) ); } } @@ -95,21 +95,21 @@ static void setCursorToAll( const TQCursor &c, TQWidget *start ) static void restoreCursors( TQWidget *start, FormWindow *fw ) { - if ( fw->widgets()->find( start ) ) + if ( fw->widgets()->tqfind( start ) ) start->setCursor( MetaDataBase::cursor( start ) ); else - start->setCursor( Qt::ArrowCursor ); - TQObjectList *l = (TQObjectList*)start->children(); - if ( l ) { - for ( TQObject *o = l->first(); o; o = l->next() ) { - if ( o->isWidgetType() && !::qt_cast<SizeHandle*>(o) ) + start->setCursor( TQt::ArrowCursor ); + TQObjectList l = start->childrenListObject(); + if ( !l.isEmpty() ) { + for ( TQObject *o = l.first(); o; o = l.next() ) { + if ( o->isWidgetType() && !::tqqt_cast<SizeHandle*>(o) ) restoreCursors( ( (TQWidget*)o ), fw ); } } } -#if defined(Q_WS_WIN32) // #### needed for the workaround for repaint problem on windows -#include <qt_windows.h> +#if defined(TQ_WS_WIN32) // #### needed for the workaround for tqrepaint problem on windows +#include <tqt_windows.h> static void flickerfree_update( TQWidget *w ) { InvalidateRect( w->winId(), 0, FALSE ); @@ -134,8 +134,8 @@ static void flickerfree_update( TQWidget *w ) event filter which is implemented in MainWindow::eventFilter(). */ -FormWindow::FormWindow( FormFile *f, MainWindow *mw, TQWidget *parent, const char *name ) - : TQWidget( parent, name, WDestructiveClose ), mainwindow( mw ), +FormWindow::FormWindow( FormFile *f, MainWindow *mw, TQWidget *tqparent, const char *name ) + : TQWidget( tqparent, name, WDestructiveClose ), mainwindow( mw ), commands( 100 ), pixInline( TRUE ), pixProject( FALSE ) { ff = f; @@ -143,8 +143,8 @@ FormWindow::FormWindow( FormFile *f, MainWindow *mw, TQWidget *parent, const cha initSlots(); } -FormWindow::FormWindow( FormFile *f, TQWidget *parent, const char *name ) - : TQWidget( parent, name, WDestructiveClose ), mainwindow( 0 ), +FormWindow::FormWindow( FormFile *f, TQWidget *tqparent, const char *name ) + : TQWidget( tqparent, name, WDestructiveClose ), mainwindow( 0 ), commands( 100 ), pixInline( TRUE ) { ff = f; @@ -153,10 +153,10 @@ FormWindow::FormWindow( FormFile *f, TQWidget *parent, const char *name ) void FormWindow::init() { - setWFlags(getWFlags() & Qt::WStyle_Maximize); + setWFlags(getWFlags() & TQt::WStyle_Maximize); fake = qstrcmp( name(), "qt_fakewindow" ) == 0; - MetaDataBase::addEntry( this ); + MetaDataBase::addEntry( TQT_TQOBJECT(this) ); ff->setFormWindow( this ); iface = 0; proj = 0; @@ -169,7 +169,7 @@ void FormWindow::init() unclippedPainter = 0; widgetPressed = FALSE; drawRubber = FALSE; - setFocusPolicy( ClickFocus ); + setFocusPolicy( TQ_ClickFocus ); sizePreviewLabel = 0; checkSelectionsTimer = new TQTimer( this, "checkSelectionsTimer" ); connect( checkSelectionsTimer, TQT_SIGNAL( timeout() ), @@ -200,7 +200,7 @@ void FormWindow::init() TQWidget *w = WidgetFactory::create( WidgetDatabase::idFromClassName( TQFRAME_OBJECT_NAME_STRING ), this ); setMainContainer( w ); - propertyWidget = w; + propertyWidget = TQT_TQOBJECT(w); targetContainer = 0; hadOwnPalette = FALSE; @@ -212,7 +212,7 @@ void FormWindow::init() void FormWindow::setMainWindow( MainWindow *w ) { mainwindow = w; - MetaDataBase::addEntry( this ); + MetaDataBase::addEntry( TQT_TQOBJECT(this) ); initSlots(); } @@ -236,7 +236,7 @@ FormWindow::~FormWindow() if ( MainWindow::self && MainWindow::self->objectHierarchy()->formWindow() == this ) MainWindow::self->objectHierarchy()->setFormWindow( 0, 0 ); - MetaDataBase::clear( this ); + MetaDataBase::clear( TQT_TQOBJECT(this) ); if ( ff ) ff->setFormWindow( 0 ); delete iface; @@ -258,19 +258,19 @@ void FormWindow::paintGrid( TQWidget *w, TQPaintEvent *e ) TQPixmap grid; TQString grid_name; grid_name.sprintf("FormWindowGrid_%d_%d", mainWindow()->grid().x(), mainWindow()->grid().y()); - if( !TQPixmapCache::find( grid_name, grid ) ) { + if( !TQPixmapCache::tqfind( 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 ); - TQPainter p( &mask ); + grid.fill( tqcolorGroup().color( TQColorGroup::Foreground ) ); + TQBitmap tqmask( grid.width(), grid.height() ); + tqmask.fill( color0 ); + TQPainter p( &tqmask ); 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() ) { p.drawPoint( x, y ); } } - grid.setMask( mask ); + grid.setMask( tqmask ); TQPixmapCache::insert( grid_name, grid ); } TQPainter p( w ); @@ -321,7 +321,7 @@ TQPoint FormWindow::gridPoint( const TQPoint &p ) void FormWindow::drawSizePreview( const TQPoint &pos, const TQString& text ) { unclippedPainter->save(); - unclippedPainter->setPen( TQPen( colorGroup().foreground(), 1 )); + unclippedPainter->setPen( TQPen( tqcolorGroup().foreground(), 1 )); unclippedPainter->setRasterOp( CopyROP ); if ( !sizePreviewPixmap.isNull() ) unclippedPainter->drawPixmap( sizePreviewPos, sizePreviewPixmap ); @@ -353,7 +353,7 @@ void FormWindow::insertWidget() return; bool useSizeHint = !oldRectValid || ( currRect.width() < 2 && currRect.height() < 2 ); - Orientation orient = Horizontal; + Qt::Orientation orient =Qt::Horizontal; TQString n = WidgetDatabase::className( currTool ); if ( useSizeHint && ( n == "Spacer" || n == TQSLIDER_OBJECT_NAME_STRING || n == "Line" || n == TQSCROLLBAR_OBJECT_NAME_STRING ) ) { TQPopupMenu m( mainWindow() ); @@ -361,7 +361,7 @@ void FormWindow::insertWidget() int ver = m.insertItem( i18n( "&Vertical" ) ); int r = m.exec( TQCursor::pos() ); if ( r == ver ) - orient = Vertical; + orient =Qt::Vertical; } @@ -375,25 +375,25 @@ void FormWindow::insertWidget() pix.convertFromImage( SmallIcon( "designer_image.png" , KDevDesignerPartFactory::instance()).convertToImage() ); ( (TQLabel*)w )->setPixmap( pix ); } - int id = WidgetDatabase::idFromClassName( WidgetFactory::classNameOf(w) ); + int id = WidgetDatabase::idFromClassName( WidgetFactory::classNameOf(TQT_TQOBJECT(w)) ); if ( WidgetDatabase::isCustomWidget( id ) ) { 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 " + "<i>TQt Designer</i>, and provide a pixmap which will be used to represent " "the widget on the form.</p>") - .arg(WidgetDatabase::toolTip( id )) ); - TQToolTip::add( w, i18n("A %1 (custom widget)").arg(WidgetDatabase::toolTip( id )) ); + .tqarg(WidgetDatabase::toolTip( id )) ); + TQToolTip::add( w, i18n("A %1 (custom widget)").tqarg(WidgetDatabase::toolTip( id )) ); } else { TQString tt = WidgetDatabase::toolTip( id ); TQString wt = WidgetDatabase::whatsThis( id ); if ( !wt.isEmpty() && !tt.isEmpty() ) - TQWhatsThis::add( w, TQString("<b>A %1</b><p>%2</p>").arg( tt ).arg( wt ) ); + TQWhatsThis::add( w, TQString("<b>A %1</b><p>%2</p>").tqarg( tt ).tqarg( wt ) ); } TQString s = w->name(); - unify( w, s, TRUE ); + unify( TQT_TQOBJECT(w), s, TRUE ); w->setName( s ); insertWidget( w ); TQRect r( currRect ); @@ -408,7 +408,7 @@ void FormWindow::insertWidget() if ( useSizeHint ) { if ( n == "Spacer" ) { - if ( orient == Vertical ) { + if ( orient ==Qt::Vertical ) { r.setWidth( 20 ); r.setHeight( 40 ); } else { @@ -416,8 +416,8 @@ void FormWindow::insertWidget() r.setHeight( 20 ); } } else { - r.setWidth( w->sizeHint().width() ); - r.setHeight( w->sizeHint().height() ); + r.setWidth( w->tqsizeHint().width() ); + r.setHeight( w->tqsizeHint().height() ); } } @@ -426,19 +426,19 @@ void FormWindow::insertWidget() if ( r.height() < 2 * grid().y() ) r.setHeight( 2 * grid().y() ); - const TQObjectList *l = insertParent->children(); - TQObjectListIt it( *l ); + const TQObjectList l = insertParent->childrenListObject(); + TQObjectListIt it( l ); TQWidgetList lst; - if ( WidgetDatabase::isContainer( WidgetDatabase::idFromClassName( WidgetFactory::classNameOf( w ) ) ) ) { + if ( WidgetDatabase::isContainer( WidgetDatabase::idFromClassName( WidgetFactory::classNameOf( TQT_TQOBJECT(w) ) ) ) ) { for ( ; it.current(); ) { TQObject *o = it.current(); ++it; if ( o->isWidgetType() && ( (TQWidget*)o )->isVisibleTo( this ) && - insertedWidgets.find( (TQWidget*)o ) && o != w ) { + insertedWidgets.tqfind( TQT_TQWIDGET(o) ) && TQT_BASE_OBJECT(o) != TQT_BASE_OBJECT(w) ) { TQRect r2( ( (TQWidget*)o )->pos(), ( (TQWidget*)o )->size() ); - if ( r.contains( r2 ) ) + if ( r.tqcontains( r2 ) ) lst.append( (TQWidget*)o ); } } @@ -455,7 +455,7 @@ void FormWindow::insertWidget() np.append( pos ); } - MoveCommand *mv = new MoveCommand( i18n( "Reparent Widgets" ), this, + MoveCommand *mv = new MoveCommand( i18n( "Retqparent Widgets" ), this, lst, op, np, insertParent, pw ); if ( !toolFixed ) @@ -463,13 +463,13 @@ void FormWindow::insertWidget() else setCursorToAll( CrossCursor, w ); - InsertCommand *cmd = new InsertCommand( i18n( "Insert %1" ).arg( w->name() ), this, w, r ); + InsertCommand *cmd = new InsertCommand( i18n( "Insert %1" ).tqarg( w->name() ), this, w, r ); TQPtrList<Command> commands; commands.append( mv ); commands.append( cmd ); - MacroCommand *mc = new MacroCommand( i18n( "Insert %1" ).arg( w->name() ), this, commands ); + MacroCommand *mc = new MacroCommand( i18n( "Insert %1" ).tqarg( w->name() ), this, commands ); commandHistory()->addCommand( mc ); mc->execute(); } @@ -479,7 +479,7 @@ void FormWindow::insertWidget() else setCursorToAll( CrossCursor, w ); - InsertCommand *cmd = new InsertCommand( i18n( "Insert %1" ).arg( w->name() ), this, w, r ); + InsertCommand *cmd = new InsertCommand( i18n( "Insert %1" ).tqarg( w->name() ), this, w, r ); commandHistory()->addCommand( cmd ); cmd->execute(); } @@ -497,26 +497,26 @@ void FormWindow::insertWidget( TQWidget *w, bool checkName ) return; if ( checkName ) { TQString s = w->name(); - unify( w, s, TRUE ); + unify( TQT_TQOBJECT(w), s, TRUE ); w->setName( s ); } - MetaDataBase::addEntry( w ); - int id = WidgetDatabase::idFromClassName( WidgetFactory::classNameOf(w) ); + MetaDataBase::addEntry( TQT_TQOBJECT(w) ); + int id = WidgetDatabase::idFromClassName( WidgetFactory::classNameOf(TQT_TQOBJECT(w)) ); if ( WidgetDatabase::isCustomWidget( id ) ) { 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 " + "<i>TQt Designer</i>, and provide a pixmap which will be used to represent " "the widget on the form.</p>") - .arg(WidgetDatabase::toolTip( id )) ); - TQToolTip::add( w, i18n("A %1 (custom widget)").arg(WidgetDatabase::toolTip( id )) ); + .tqarg(WidgetDatabase::toolTip( id )) ); + TQToolTip::add( w, i18n("A %1 (custom widget)").tqarg(WidgetDatabase::toolTip( id )) ); } else { TQString tt = WidgetDatabase::toolTip( id ); TQString wt = WidgetDatabase::whatsThis( id ); if ( !wt.isEmpty() && !tt.isEmpty() ) - TQWhatsThis::add( w, TQString("<b>A %1</b><p>%2</p>").arg( tt ).arg( wt ) ); + TQWhatsThis::add( w, TQString("<b>A %1</b><p>%2</p>").tqarg( tt ).tqarg( wt ) ); } restoreCursors( w, this ); @@ -526,7 +526,7 @@ void FormWindow::insertWidget( TQWidget *w, bool checkName ) void FormWindow::removeWidget( TQWidget *w ) { - MetaDataBase::removeEntry( w ); + MetaDataBase::removeEntry( TQT_TQOBJECT(w) ); widgets()->take( w ); } @@ -535,16 +535,16 @@ void FormWindow::handleContextMenu( TQContextMenuEvent *e, TQWidget *w ) CHECK_MAINWINDOW; switch ( currTool ) { case POINTER_TOOL: { - if ( !isMainContainer( w ) && qstrcmp( w->name(), "central widget" ) != 0 ) { // press on a child widget + if ( !isMainContainer( TQT_TQOBJECT(w) ) && qstrcmp( w->name(), "central widget" ) != 0 ) { // press on a child widget raiseChildSelections( w ); // raise selections and select widget - selectWidget( w ); + selectWidget( TQT_TQOBJECT(w) ); // if widget is laid out, find the first non-laid out super-widget 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<TQMainWindow*>(mainContainer()) && ((TQMainWindow*)mainContainer())->centralWidget() == realWidget ) { + while ( w->tqparentWidget() && + ( WidgetFactory::tqlayoutType( w->tqparentWidget()) != WidgetFactory::NoLayout || + !insertedWidgets.tqfind(w) ) ) + w = w->tqparentWidget(); + if ( ::tqqt_cast<TQMainWindow*>(mainContainer()) && ((TQMainWindow*)mainContainer())->centralWidget() == realWidget ) { e->accept(); mainwindow->popupFormWindowMenu( e->globalPos(), this ); } else { @@ -576,9 +576,9 @@ void FormWindow::handleMousePress( TQMouseEvent *e, TQWidget *w ) switch ( currTool ) { case POINTER_TOOL: - if ( !isMainContainer( w ) && qstrcmp( w->name(), "central widget" ) != 0 ) { // press on a child widget - // if the clicked widget is not in a layout, raise it - if ( !w->parentWidget() || WidgetFactory::layoutType( w->parentWidget() ) == WidgetFactory::NoLayout ) + if ( !isMainContainer( TQT_TQOBJECT(w) ) && qstrcmp( w->name(), "central widget" ) != 0 ) { // press on a child widget + // if the clicked widget is not in a tqlayout, raise it + if ( !w->tqparentWidget() || WidgetFactory::tqlayoutType( w->tqparentWidget() ) == WidgetFactory::NoLayout ) w->raise(); if ( ( e->state() & ControlButton ) ) { // with control pressed, always start rubber band selection drawRubber = TRUE; @@ -587,63 +587,63 @@ void FormWindow::handleMousePress( TQMouseEvent *e, TQWidget *w ) break; } - bool sel = isWidgetSelected( w ); + bool sel = isWidgetSelected( TQT_TQOBJECT(w) ); if ( !( ( e->state() & ControlButton ) || ( e->state() & ShiftButton ) ) ) { // control not pressed... if ( !sel ) { // ...and widget no selectted: unselect all clearSelection( FALSE ); } 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 ) { + // only if widget has a tqlayout (it is a tqlayout meta widget or a laid out container!), unselect its childs + if ( WidgetFactory::tqlayoutType( w ) != WidgetFactory::NoLayout ) { TQObjectList *l = w->queryList( TQWIDGET_OBJECT_NAME_STRING ); setPropertyShowingBlocked( TRUE ); for ( TQObject *o = l->first(); o; o = l->next() ) { if ( !o->isWidgetType() ) continue; - if ( insertedWidgets.find( (TQWidget*)o ) ) - selectWidget( (TQWidget*)o, FALSE ); + if ( insertedWidgets.tqfind( (TQWidget*)o ) ) + selectWidget( TQT_TQOBJECT(o), FALSE ); } setPropertyShowingBlocked( FALSE ); delete l; } } - qApp->processEvents(); + tqApp->processEvents(); } if ( ( ( e->state() & ControlButton ) || ( e->state() & ShiftButton ) ) && - sel && e->button() == LeftButton ) { // control pressed and selected, unselect widget - selectWidget( w, FALSE ); + sel && e->button() == Qt::LeftButton ) { // control pressed and selected, unselect widget + selectWidget( TQT_TQOBJECT(w), FALSE ); break; } raiseChildSelections( w ); // raise selections and select widget - selectWidget( w ); + selectWidget( TQT_TQOBJECT(w) ); // if widget is laid out, find the first non-laid out super-widget - while ( w->parentWidget() && - ( WidgetFactory::layoutType( w->parentWidget()) != WidgetFactory::NoLayout || !insertedWidgets.find(w) ) ) - w = w->parentWidget(); + while ( w->tqparentWidget() && + ( WidgetFactory::tqlayoutType( w->tqparentWidget()) != WidgetFactory::NoLayout || !insertedWidgets.tqfind(w) ) ) + w = w->tqparentWidget(); - if ( e->button() == LeftButton ) { // left button: store original geometry and more as the widget might start moving + if ( e->button() == Qt::LeftButton ) { // left button: store original tqgeometry and more as the widget might start moving widgetPressed = TRUE; widgetGeom = TQRect( w->pos(), w->size() ); oldPressPos = w->mapFromGlobal( e->globalPos() ); origPressPos = oldPressPos; checkedSelectionsForMove = FALSE; moving.clear(); - if ( w->parentWidget() && !isMainContainer( w->parentWidget() ) && !isCentralWidget( w->parentWidget() ) ) { - targetContainer = w->parentWidget(); - hadOwnPalette = w->parentWidget()->ownPalette(); - restorePalette = w->parentWidget()->palette(); + if ( w->tqparentWidget() && !isMainContainer( TQT_TQOBJECT(w->tqparentWidget()) ) && !isCentralWidget( TQT_TQOBJECT(w->tqparentWidget()) ) ) { + targetContainer = w->tqparentWidget(); + hadOwnPalette = w->tqparentWidget()->ownPalette(); + restorePalette = w->tqparentWidget()->palette(); } } } else { // press was on the formwindow - if ( e->button() == LeftButton ) { // left button: start rubber selection and show formwindow properties + if ( e->button() == Qt::LeftButton ) { // left button: start rubber selection and show formwindow properties drawRubber = TRUE; if ( !( ( e->state() & ControlButton ) || ( e->state() & ShiftButton ) ) ) { clearSelection( FALSE ); TQObject *opw = propertyWidget; - propertyWidget = mainContainer(); + propertyWidget = TQT_TQOBJECT(mainContainer()); if ( opw->isWidgetType() ) - repaintSelection( (TQWidget*)opw ); + tqrepaintSelection( (TQWidget*)opw ); } currRect = TQRect( 0, 0, -1, -1 ); startRectDraw( mapFromGlobal( e->globalPos() ), e->globalPos(), this, Rubber ); @@ -652,32 +652,32 @@ void FormWindow::handleMousePress( TQMouseEvent *e, TQWidget *w ) break; case CONNECT_TOOL: case BUDDY_TOOL: - if ( e->button() != LeftButton ) + if ( e->button() != Qt::LeftButton ) break; validForBuddy = FALSE; if ( currTool == BUDDY_TOOL ) { - if ( !::qt_cast<TQLabel*>(w) ) + if ( !::tqqt_cast<TQLabel*>(w) ) break; clearSelection( FALSE ); validForBuddy = TRUE; - mainWindow()->statusMessage( i18n( "Set buddy for '%1' to..." ).arg( w->name() ) ); + mainWindow()->statusMessage( i18n( "Set buddy for '%1' to..." ).tqarg( w->name() ) ); } else { - mainWindow()->statusMessage( i18n( "Connect '%1' with..." ).arg( w->name() ) ); + mainWindow()->statusMessage( i18n( "Connect '%1' with..." ).tqarg( w->name() ) ); } saveBackground(); startPos = mapFromGlobal( e->globalPos() ); currentPos = startPos; - startWidget = designerWidget( w ); + startWidget = designerWidget( TQT_TQOBJECT(w) ); endWidget = startWidget; beginUnclippedPainter( FALSE ); drawConnectionLine(); break; case ORDER_TOOL: - if ( !isMainContainer( w ) ) { // press on a child widget + if ( !isMainContainer( TQT_TQOBJECT(w) ) ) { // press on a child widget orderedWidgets.removeRef( w ); orderedWidgets.append( w ); for ( TQWidget *wid = orderedWidgets.last(); wid; wid = orderedWidgets.prev() ) { - int i = stackedWidgets.findRef( wid ); + int i = stackedWidgets.tqfindRef( wid ); if ( i != -1 ) { stackedWidgets.removeRef( wid ); stackedWidgets.insert( 0, wid ); @@ -691,18 +691,18 @@ void FormWindow::handleMousePress( TQMouseEvent *e, TQWidget *w ) } break; default: // any insert widget tool - 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 + if ( e->button() == Qt::LeftButton ) { + insertParent = WidgetFactory::containerOfWidget( mainContainer() ); // default tqparent for new widget is the formwindow + if ( !isMainContainer( TQT_TQOBJECT(w) ) ) { // press was not on formwindow, check if we can find another tqparent TQWidget *wid = w; for (;;) { - int id = WidgetDatabase::idFromClassName( WidgetFactory::classNameOf( wid ) ); + int id = WidgetDatabase::idFromClassName( WidgetFactory::classNameOf( TQT_TQOBJECT(wid) ) ); if ( ( WidgetDatabase::isContainer( id ) || wid == mainContainer() ) && - !::qt_cast<QLayoutWidget*>(wid) && !::qt_cast<TQSplitter*>(wid) ) { - insertParent = WidgetFactory::containerOfWidget( wid ); // found another parent, store it + !::tqqt_cast<TQLayoutWidget*>(wid) && !::tqqt_cast<TQSplitter*>(wid) ) { + insertParent = WidgetFactory::containerOfWidget( wid ); // found another tqparent, store it break; } else { - wid = wid->parentWidget(); + wid = wid->tqparentWidget(); if ( !wid ) break; } @@ -719,11 +719,11 @@ void FormWindow::handleMouseDblClick( TQMouseEvent *, TQWidget *w ) CHECK_MAINWINDOW; switch ( currTool ) { case ORDER_TOOL: - if ( !isMainContainer( w ) ) { // press on a child widget + if ( !isMainContainer( TQT_TQOBJECT(w) ) ) { // press on a child widget orderedWidgets.clear(); orderedWidgets.append( w ); for ( TQWidget *wid = orderedWidgets.last(); wid; wid = orderedWidgets.prev() ) { - int i = stackedWidgets.findRef( wid ); + int i = stackedWidgets.tqfindRef( wid ); if ( i != -1 ) { stackedWidgets.removeRef( wid ); stackedWidgets.insert( 0, wid ); @@ -736,8 +736,8 @@ void FormWindow::handleMouseDblClick( TQMouseEvent *, TQWidget *w ) updateOrderIndicators(); } default: - if ( !WidgetFactory::isPassiveInteractor( w ) && - ( isMainContainer( w ) || w == this ) ) + if ( !WidgetFactory::isPassiveInteractor( TQT_TQOBJECT(w) ) && + ( isMainContainer( TQT_TQOBJECT(w) ) || TQT_BASE_OBJECT(w) == TQT_BASE_OBJECT(this) ) ) mainWindow()->editSource(); break; } @@ -746,7 +746,7 @@ void FormWindow::handleMouseDblClick( TQMouseEvent *, TQWidget *w ) void FormWindow::handleMouseMove( TQMouseEvent *e, TQWidget *w ) { CHECK_MAINWINDOW; - if ( ( e->state() & LeftButton ) != LeftButton ) + if ( ( e->state() & Qt::LeftButton ) != Qt::LeftButton ) return; TQWidget *newendWidget = endWidget, *oldendWidget = endWidget, *wid; @@ -756,9 +756,9 @@ void FormWindow::handleMouseMove( TQMouseEvent *e, TQWidget *w ) if ( widgetPressed && allowMove( w ) ) { // we are prepated for a move // if widget is laid out, find the first non-laid out super-widget - while ( w->parentWidget() && - ( WidgetFactory::layoutType( w->parentWidget() ) != WidgetFactory::NoLayout || !insertedWidgets.find(w ) ) ) - w = w->parentWidget(); + while ( w->tqparentWidget() && + ( WidgetFactory::tqlayoutType( w->tqparentWidget() ) != WidgetFactory::NoLayout || !insertedWidgets.tqfind(w ) ) ) + w = w->tqparentWidget(); // calc correct position TQPoint pos = w->mapFromGlobal( e->globalPos() ); @@ -770,17 +770,17 @@ void FormWindow::handleMouseMove( TQMouseEvent *e, TQWidget *w ) pos.setX( w->mapFromParent( TQPoint( 0, mpos.y() ) ).x() ); if ( mpos.y() < 0 ) pos.setY( w->mapFromParent( TQPoint( mpos.x(), 0 ) ).y() ); - if ( mpos.x() > w->parentWidget()->width() ) - pos.setX( w->mapFromParent( TQPoint( w->parentWidget()->width(), mpos.y() ) ).x() ); - if ( mpos.y() > w->parentWidget()->height() ) - pos.setY( w->mapFromParent( TQPoint( mpos.x(), w->parentWidget()->height() ) ).y() ); + if ( mpos.x() > w->tqparentWidget()->width() ) + pos.setX( w->mapFromParent( TQPoint( w->tqparentWidget()->width(), mpos.y() ) ).x() ); + if ( mpos.y() > w->tqparentWidget()->height() ) + pos.setY( w->mapFromParent( TQPoint( mpos.x(), w->tqparentWidget()->height() ) ).y() ); #endif // calc move distance and store it TQPoint d = oldPressPos - pos; - if ( QABS( d.x() ) < grid().x() ) + if ( TQABS( d.x() ) < grid().x() ) d.setX( 0 ); - if ( QABS( d.y() ) < grid().y() ) + if ( TQABS( d.y() ) < grid().y() ) d.setY( 0 ); if ( d.x() == 0 ) pos.setX( oldPressPos.x() ); @@ -799,18 +799,18 @@ void FormWindow::handleMouseMove( TQMouseEvent *e, TQWidget *w ) 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... - if ( !isWidgetSelected( w ) ) { // and unselect others. Only siblings can be moved at the same time + if ( !isWidgetSelected( TQT_TQOBJECT(w) ) ) { // and unselect others. Only siblings can be moved at the same time setPropertyShowingBlocked( TRUE ); - selectWidget( w ); + selectWidget( TQT_TQOBJECT(w) ); setPropertyShowingBlocked( FALSE ); } checkSelectionsForMove( w ); } - // check whether we would have to reparent the selection and highlight the possible new parent container + // check whether we would have to reparent the selection and highlight the possible new tqparent container TQMapConstIterator<TQWidget*, TQPoint> it = moving.begin(); TQWidget* wa = containerAt( e->globalPos(), it.key() ); - if ( wa && !isMainContainer( wa ) && !isCentralWidget( wa ) ) { + if ( wa && !isMainContainer( TQT_TQOBJECT(wa) ) && !isCentralWidget( TQT_TQOBJECT(wa) ) ) { wa = WidgetFactory::containerOfWidget( wa ); // ok, looks like we moved onto a container @@ -824,7 +824,7 @@ void FormWindow::handleMouseMove( TQMouseEvent *e, TQWidget *w ) targetContainer = wa; hadOwnPalette = wa->ownPalette(); restorePalette = wa->palette(); - wa->setPaletteBackgroundColor( wa->colorGroup().midlight() ); + wa->setPaletteBackgroundColor( wa->tqcolorGroup().midlight() ); } } else if ( targetContainer ) { @@ -837,14 +837,14 @@ void FormWindow::handleMouseMove( TQMouseEvent *e, TQWidget *w ) // finally move the selected widgets and show/update preview label moveSelectedWidgets( x - p.x(), y - p.y() ); - sizePreviewLabel->setText( i18n( "%1/%2" ).arg( w->pos().x() ).arg( w->pos().y() ) ); + sizePreviewLabel->setText( i18n( "%1/%2" ).tqarg( w->pos().x() ).tqarg( w->pos().y() ) ); sizePreviewLabel->adjustSize(); TQRect lg( mapFromGlobal( e->globalPos() ) + TQPoint( 16, 16 ), sizePreviewLabel->size() ); checkPreviewGeometry( lg ); sizePreviewLabel->setGeometry( lg ); sizePreviewLabel->raise(); sizePreviewLabel->show(); -#if defined(Q_WS_WIN32) +#if defined(TQ_WS_WIN32) windowsRepaintWorkaroundTimer->start( 100, TRUE ); #endif } else { // if we don't need to move, do some indication @@ -860,23 +860,23 @@ void FormWindow::handleMouseMove( TQMouseEvent *e, TQWidget *w ) break; case CONNECT_TOOL: restoreConnectionLine(); - wid = qApp->widgetAt( e->globalPos(), TRUE ); + wid = tqApp->widgetAt( e->globalPos(), TRUE ); if ( wid ) - wid = designerWidget( wid ); - if ( wid && ( isMainContainer( wid ) || insertedWidgets.find( wid ) ) && wid->isVisibleTo( this ) ) + wid = designerWidget( TQT_TQOBJECT(wid) ); + if ( wid && ( isMainContainer( TQT_TQOBJECT(wid) ) || insertedWidgets.tqfind( wid ) ) && wid->isVisibleTo( this ) ) newendWidget = wid; - if ( ::qt_cast<QLayoutWidget*>(newendWidget) || ::qt_cast<Spacer*>(newendWidget) ) + if ( ::tqqt_cast<TQLayoutWidget*>(newendWidget) || ::tqqt_cast<Spacer*>(newendWidget) ) newendWidget = (TQWidget*)endWidget; drawRecRect = newendWidget != endWidget; if ( newendWidget && - ( isMainContainer( newendWidget ) || insertedWidgets.find( newendWidget ) ) && !isCentralWidget( newendWidget ) ) + ( isMainContainer( TQT_TQOBJECT(newendWidget) ) || insertedWidgets.tqfind( newendWidget ) ) && !isCentralWidget( TQT_TQOBJECT(newendWidget) ) ) endWidget = newendWidget; - mainWindow()->statusMessage( i18n( "Connect '%1' to '%2'" ).arg( startWidget->name() ). + mainWindow()->statusMessage( i18n( "Connect '%1' to '%2'" ).tqarg( startWidget->name() ). arg( endWidget->name() ) ); currentPos = mapFromGlobal( e->globalPos() ); - qApp->processEvents(); + tqApp->processEvents(); if ( drawRecRect ) - restoreRect( TQRect( mapToForm( ( (TQWidget*)oldendWidget )->parentWidget(), ( (TQWidget*)oldendWidget )->pos() ), + restoreRect( TQRect( mapToForm( ( (TQWidget*)oldendWidget )->tqparentWidget(), ( (TQWidget*)oldendWidget )->pos() ), ( (TQWidget*)oldendWidget )->size() ) ); drawConnectionLine(); break; @@ -884,29 +884,29 @@ void FormWindow::handleMouseMove( TQMouseEvent *e, TQWidget *w ) if ( !validForBuddy ) break; restoreConnectionLine(); - wid = qApp->widgetAt( e->globalPos(), TRUE ); + wid = tqApp->widgetAt( e->globalPos(), TRUE ); if ( wid ) - wid = designerWidget( wid ); + wid = designerWidget( TQT_TQOBJECT(wid) ); if ( wid && canBeBuddy( wid ) && wid->isVisibleTo( this ) ) newendWidget = wid; else newendWidget = 0; - if ( ::qt_cast<QLayoutWidget*>(newendWidget) || ::qt_cast<Spacer*>(newendWidget) ) + if ( ::tqqt_cast<TQLayoutWidget*>(newendWidget) || ::tqqt_cast<Spacer*>(newendWidget) ) newendWidget = (TQWidget*)endWidget; drawRecRect = newendWidget != endWidget; if ( !newendWidget ) endWidget = newendWidget; - else if ( insertedWidgets.find( newendWidget ) && !isCentralWidget( newendWidget ) ) + else if ( insertedWidgets.tqfind( newendWidget ) && !isCentralWidget( TQT_TQOBJECT(newendWidget) ) ) endWidget = newendWidget; if ( endWidget ) - mainWindow()->statusMessage( i18n( "Set buddy '%1' to '%2'" ).arg( startWidget->name() ). + mainWindow()->statusMessage( i18n( "Set buddy '%1' to '%2'" ).tqarg( startWidget->name() ). arg( endWidget->name() ) ); else - mainWindow()->statusMessage( i18n( "Set buddy '%1' to ..." ).arg( startWidget->name() ) ); + mainWindow()->statusMessage( i18n( "Set buddy '%1' to ..." ).tqarg( startWidget->name() ) ); currentPos = mapFromGlobal( e->globalPos() ); - qApp->processEvents(); + tqApp->processEvents(); if ( drawRecRect && oldendWidget ) - restoreRect( TQRect( mapToForm( ( (TQWidget*)oldendWidget )->parentWidget(), ( (TQWidget*)oldendWidget )->pos() ), + restoreRect( TQRect( mapToForm( ( (TQWidget*)oldendWidget )->tqparentWidget(), ( (TQWidget*)oldendWidget )->pos() ), ( (TQWidget*)oldendWidget )->size() ) ); drawConnectionLine(); break; @@ -922,7 +922,7 @@ void FormWindow::handleMouseMove( TQMouseEvent *e, TQWidget *w ) void FormWindow::handleMouseRelease( TQMouseEvent *e, TQWidget *w ) { CHECK_MAINWINDOW; - if ( e->button() != LeftButton ) + if ( e->button() != Qt::LeftButton ) return; switch ( currTool ) { @@ -930,7 +930,7 @@ void FormWindow::handleMouseRelease( TQMouseEvent *e, TQWidget *w ) if ( widgetPressed && allowMove( w ) ) { // we moved the widget sizePreviewLabel->hide(); - if ( moving.isEmpty() || w->pos() == *moving.find(w) ) + if ( moving.isEmpty() || w->pos() == *moving.tqfind(w) ) break; // restore targetContainer @@ -946,7 +946,7 @@ void FormWindow::handleMouseRelease( TQMouseEvent *e, TQWidget *w ) emitUpdateProperties( propertyWidget ); TQMapConstIterator<TQWidget*,TQPoint> it = moving.begin(); - TQWidget *oldParent = it.key()->parentWidget(); + TQWidget *oldParent = it.key()->tqparentWidget(); TQWidget *newParent = oldParent; // check whether we have to reparent the selection TQWidget* wa = containerAt( e->globalPos(), it.key() ); @@ -954,19 +954,19 @@ void FormWindow::handleMouseRelease( TQMouseEvent *e, TQWidget *w ) wa = WidgetFactory::containerOfWidget( wa ); // ok, looks like we moved onto a container - // check whether we really have different parents. - if ( wa == it.key()->parentWidget() ) + // check whether we really have different tqparents. + if ( wa == it.key()->tqparentWidget() ) goto make_move_command; - // break layout if necessary - if ( WidgetFactory::layoutType( wa ) != WidgetFactory::NoLayout ) { + // break tqlayout if necessary + if ( WidgetFactory::tqlayoutType( wa ) != WidgetFactory::NoLayout ) { if ( TQMessageBox::information( mainWindow(), i18n( "Inserting Widget" ), i18n( "You tried to insert a widget into the " - "layout Container Widget '%1'.\n" + "tqlayout Container Widget '%1'.\n" "This is not possible. " - "In order to insert the widget, the layout of '%1'\n" + "In order to insert the widget, the tqlayout of '%1'\n" "must first be broken.\n" - "Break the layout or cancel the operation?" ). + "Break the tqlayout or cancel the operation?" ). arg( wa->name() ). arg( wa->name() ), i18n( "&Break Layout" ), i18n( "&Cancel" ) ) ) goto make_move_command; // cancel @@ -977,25 +977,25 @@ void FormWindow::handleMouseRelease( TQMouseEvent *e, TQWidget *w ) bool emitSelChanged = FALSE; 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) ) + if ( !emitSelChanged && ::tqqt_cast<TQButton*>(i) ) { + if ( ::tqqt_cast<TQButtonGroup*>(i->tqparentWidget()) || ::tqqt_cast<TQButtonGroup*>(wa) ) emitSelChanged = TRUE; - if ( !::qt_cast<TQButtonGroup*>(wa) ) { - MetaDataBase::setPropertyChanged( i, "buttonGroupId", FALSE ); - if ( ::qt_cast<TQButtonGroup*>(i->parentWidget()) ) - ( (TQButtonGroup*)i->parentWidget() )->remove( (TQButton*)i ); + if ( !::tqqt_cast<TQButtonGroup*>(wa) ) { + MetaDataBase::setPropertyChanged( TQT_TQOBJECT(i), "buttonGroupId", FALSE ); + if ( ::tqqt_cast<TQButtonGroup*>(i->tqparentWidget()) ) + ( (TQButtonGroup*)i->tqparentWidget() )->remove( (TQButton*)i ); } } TQPoint pos = wa->mapFromGlobal( i->mapToGlobal( TQPoint(0,0) ) ); i->reparent( wa, pos, TRUE ); raiseSelection( i ); raiseChildSelections( i ); - widgetChanged( i ); + widgetChanged( TQT_TQOBJECT(i) ); mainWindow()->objectHierarchy()->widgetRemoved( i ); mainWindow()->objectHierarchy()->widgetInserted( i ); } if ( emitSelChanged ) { - emit showProperties( wa ); + emit showProperties( TQT_TQOBJECT(wa) ); emit showProperties( propertyWidget ); } newParent = wa; @@ -1027,15 +1027,15 @@ void FormWindow::handleMouseRelease( TQMouseEvent *e, TQWidget *w ) case BUDDY_TOOL: restoreConnectionLine(); if ( startWidget ) - restoreRect( TQRect( mapToForm( ( (TQWidget*)startWidget )->parentWidget(), + restoreRect( TQRect( mapToForm( ( (TQWidget*)startWidget )->tqparentWidget(), ( (TQWidget*)startWidget )->pos() ), ((TQWidget*)startWidget )->size() ) ); if ( endWidget ) - restoreRect( TQRect( mapToForm( ( (TQWidget*)endWidget )->parentWidget(), + restoreRect( TQRect( mapToForm( ( (TQWidget*)endWidget )->tqparentWidget(), ( (TQWidget*)endWidget )->pos() ), ( (TQWidget*)endWidget )->size() ) ); endUnclippedPainter(); - qApp->processEvents(); + tqApp->processEvents(); if ( startWidget && endWidget ) { if ( currTool == CONNECT_TOOL ) @@ -1044,14 +1044,14 @@ void FormWindow::handleMouseRelease( TQMouseEvent *e, TQWidget *w ) TQString oldBuddy = startWidget->property( "buddy" ).toString(); if ( oldBuddy.isNull() ) oldBuddy = ""; - SetPropertyCommand *cmd = new SetPropertyCommand( i18n( "Set Buddy for %1" ).arg( startWidget->name() ), - this, startWidget, mainWindow()->propertyeditor(), + SetPropertyCommand *cmd = new SetPropertyCommand( i18n( "Set Buddy for %1" ).tqarg( startWidget->name() ), + this, TQT_TQOBJECT(startWidget), mainWindow()->propertyeditor(), "buddy", startWidget->property( "buddy" ), endWidget->name(), endWidget->name(), oldBuddy ); commandHistory()->addCommand( cmd, TRUE ); cmd->execute(); - emitUpdateProperties( startWidget ); + emitUpdateProperties( TQT_TQOBJECT(startWidget) ); } } if ( !toolFixed ) @@ -1064,14 +1064,14 @@ void FormWindow::handleMouseRelease( TQMouseEvent *e, TQWidget *w ) default: // any insert widget tool is active if ( insertParent ) { // we should insert the new widget now endRectDraw(); - if ( WidgetFactory::layoutType( insertParent ) != WidgetFactory::NoLayout ) { + if ( WidgetFactory::tqlayoutType( insertParent ) != WidgetFactory::NoLayout ) { if ( TQMessageBox::information( mainWindow(), i18n( "Inserting Widget" ), i18n( "You tried to insert a widget into the " - "layout Container Widget '%1'.\n" + "tqlayout Container Widget '%1'.\n" "This is not possible. " - "In order to insert the widget, the layout of '%1'\n" + "In order to insert the widget, the tqlayout of '%1'\n" "must first be broken.\n" - "Break the layout or cancel the operation?" ). + "Break the tqlayout or cancel the operation?" ). arg( insertParent->name() ). arg( insertParent->name() ), i18n( "&Break Layout" ), i18n( "&Cancel" ) ) == 0 ) { breakLayout( insertParent ); @@ -1163,7 +1163,7 @@ void FormWindow::handleKeyPress( TQKeyEvent *e, TQWidget *w ) TQObjectList *l = queryList( TQWIDGET_OBJECT_NAME_STRING ); if ( !l ) return; - if ( l->find( w ) != -1 ) + if ( l->tqfind( TQT_TQOBJECT(w) ) != -1 ) e->accept(); delete l; } @@ -1185,35 +1185,35 @@ void FormWindow::selectWidget( TQObject *o, bool select ) TQWidget *w = (TQWidget*)o; - if ( isMainContainer( w ) ) { + if ( isMainContainer( TQT_TQOBJECT(w) ) ) { TQObject *opw = propertyWidget; - propertyWidget = mainContainer(); + propertyWidget = TQT_TQOBJECT(mainContainer()); if ( opw->isWidgetType() ) - repaintSelection( (TQWidget*)opw ); + tqrepaintSelection( (TQWidget*)opw ); emitShowProperties( propertyWidget ); return; } - if ( ::qt_cast<TQMainWindow*>(mainContainer()) && w == ( (TQMainWindow*)mainContainer() )->centralWidget() ) { + if ( ::tqqt_cast<TQMainWindow*>(mainContainer()) && w == ( (TQMainWindow*)mainContainer() )->centralWidget() ) { TQObject *opw = propertyWidget; - propertyWidget = mainContainer(); + propertyWidget = TQT_TQOBJECT(mainContainer()); if ( opw->isWidgetType() ) - repaintSelection( (TQWidget*)opw ); + tqrepaintSelection( (TQWidget*)opw ); emitShowProperties( propertyWidget ); return; } - if ( ::qt_cast<QDesignerToolBar*>(o) ) + if ( ::tqqt_cast<TQDesignerToolBar*>(o) ) return; if ( select ) { TQObject *opw = propertyWidget; - propertyWidget = w; + propertyWidget = TQT_TQOBJECT(w); if ( opw->isWidgetType() ) - repaintSelection( (TQWidget*)opw ); + tqrepaintSelection( (TQWidget*)opw ); if ( !isPropertyShowingBlocked() ) emitShowProperties( propertyWidget ); - WidgetSelection *s = usedSelections.find( w ); + WidgetSelection *s = usedSelections.tqfind( w ); if ( s ) { s->show(); return; @@ -1233,16 +1233,16 @@ void FormWindow::selectWidget( TQObject *o, bool select ) s->setWidget( w ); emitSelectionChanged(); } else { - WidgetSelection *s = usedSelections.find( w ); + WidgetSelection *s = usedSelections.tqfind( w ); if ( s ) s->setWidget( 0 ); TQObject *opw = propertyWidget; if ( !usedSelections.isEmpty() ) - propertyWidget = TQPtrDictIterator<WidgetSelection>( usedSelections ).current()->widget(); + propertyWidget = TQT_TQOBJECT(TQPtrDictIterator<WidgetSelection>( usedSelections ).current()->widget()); else - propertyWidget = mainContainer(); + propertyWidget = TQT_TQOBJECT(mainContainer()); if ( opw->isWidgetType() ) - repaintSelection( (TQWidget*)opw ); + tqrepaintSelection( (TQWidget*)opw ); if ( !isPropertyShowingBlocked() ) emitShowProperties( propertyWidget ); emitSelectionChanged(); @@ -1258,23 +1258,23 @@ TQPoint FormWindow::grid() const void FormWindow::updateSelection( TQWidget *w ) { - WidgetSelection *s = usedSelections.find( w ); + WidgetSelection *s = usedSelections.tqfind( w ); if ( !w->isVisibleTo( this ) ) - selectWidget( w, FALSE ); + selectWidget( TQT_TQOBJECT(w), FALSE ); else if ( s ) s->updateGeometry(); } void FormWindow::raiseSelection( TQWidget *w ) { - WidgetSelection *s = usedSelections.find( w ); + WidgetSelection *s = usedSelections.tqfind( w ); if ( s ) s->show(); } -void FormWindow::repaintSelection( TQWidget *w ) +void FormWindow::tqrepaintSelection( TQWidget *w ) { - WidgetSelection *s = usedSelections.find( w ); + WidgetSelection *s = usedSelections.tqfind( w ); if ( s ) s->update(); } @@ -1288,9 +1288,9 @@ void FormWindow::clearSelection( bool changePropertyDisplay ) usedSelections.clear(); if ( changePropertyDisplay ) { TQObject *opw = propertyWidget; - propertyWidget = mainContainer(); + propertyWidget = TQT_TQOBJECT(mainContainer()); if ( opw->isWidgetType() ) - repaintSelection( (TQWidget*)opw ); + tqrepaintSelection( (TQWidget*)opw ); emitShowProperties( propertyWidget ); } emitSelectionChanged(); @@ -1327,7 +1327,7 @@ void FormWindow::continueRectDraw( const TQPoint &p, const TQPoint &global, TQWi if ( currRect == r ) { TQString t = i18n( "%1/%2" ); - t = t.arg( r.width() - 1 ).arg( r.height() - 1 ); + t = t.tqarg( r.width() - 1 ).tqarg( r.height() - 1 ); drawSizePreview( pos, t ); return; } @@ -1339,7 +1339,7 @@ void FormWindow::continueRectDraw( const TQPoint &p, const TQPoint &global, TQWi currRect = r; if ( t == Insert ) { TQString t = i18n( "%1/%2" ); - t = t.arg( r.width() - 1 ).arg( r.height() - 1 ); + t = t.tqarg( r.width() - 1 ).tqarg( r.height() - 1 ); drawSizePreview( pos, t ); } unclippedPainter->setClipRegion( TQRegion( rect() ).subtract( TQRect( sizePreviewPos, sizePreviewPixmap.size() ) ) ); @@ -1359,7 +1359,7 @@ void FormWindow::endRectDraw() if ( oldRectValid ) unclippedPainter->drawRect( currRect ); - drawSizePreview( TQPoint(-1,-1), TQString::null ); + drawSizePreview( TQPoint(-1,-1), TQString() ); endUnclippedPainter(); } @@ -1373,8 +1373,8 @@ void FormWindow::selectWidgets() TQPoint p = ( (TQWidget*)o )->mapToGlobal( TQPoint(0,0) ); p = mapFromGlobal( p ); TQRect r( p, ( (TQWidget*)o )->size() ); - if ( r.intersects( currRect ) && !r.contains( currRect ) ) - selectWidget( (TQWidget*)o ); + if ( r.intersects( currRect ) && !r.tqcontains( currRect ) ) + selectWidget( TQT_TQOBJECT(o) ); } } delete l; @@ -1385,8 +1385,8 @@ void FormWindow::selectWidgets() bool FormWindow::isWidgetSelected( TQObject *w ) { if ( w->isWidgetType() ) - return usedSelections.find( (TQWidget*)w ) != 0; - return FALSE; // #### do stuff for QObjects + return usedSelections.tqfind( (TQWidget*)w ) != 0; + return FALSE; // #### do stuff for TQObjects } void FormWindow::moveSelectedWidgets( int dx, int dy ) @@ -1395,7 +1395,7 @@ void FormWindow::moveSelectedWidgets( int dx, int dy ) for ( ; it.current(); ++it ) { WidgetSelection *s = it.current(); TQWidget *w = s->widget(); - if ( w->parentWidget() && WidgetFactory::layoutType( w->parentWidget() ) != WidgetFactory::NoLayout ) + if ( w->tqparentWidget() && WidgetFactory::tqlayoutType( w->tqparentWidget() ) != WidgetFactory::NoLayout ) continue; w->move( w->x() + dx, w->y() + dy ); s->updateGeometry(); @@ -1428,7 +1428,7 @@ void FormWindow::raiseChildSelections( TQWidget *w ) TQPtrDictIterator<WidgetSelection> it( usedSelections ); for ( ; it.current(); ++it ) { - if ( l->findRef( it.current()->widget() ) != -1 ) + if ( l->tqfindRef( TQT_TQOBJECT(it.current()->widget()) ) != -1 ) it.current()->show(); } delete l; @@ -1440,7 +1440,7 @@ void FormWindow::updateChildSelections( TQWidget *w ) if ( l ) { for ( TQObject *o = l->first(); o; o = l->next() ) { if ( o->isWidgetType() && - insertedWidgets.find( (TQWidget*)o ) ) + insertedWidgets.tqfind( (TQWidget*)o ) ) updateSelection( (TQWidget*)o ); } delete l; @@ -1451,7 +1451,7 @@ void FormWindow::checkSelectionsForMove( TQWidget *w ) { checkedSelectionsForMove = TRUE; - TQObjectList *l = w->parentWidget()->queryList( TQWIDGET_OBJECT_NAME_STRING, 0, FALSE, FALSE ); + TQObjectList *l = w->tqparentWidget()->queryList( TQWIDGET_OBJECT_NAME_STRING, 0, FALSE, FALSE ); moving.clear(); if ( l ) { TQPtrDictIterator<WidgetSelection> it( usedSelections ); @@ -1460,11 +1460,11 @@ void FormWindow::checkSelectionsForMove( TQWidget *w ) if ( it.current()->widget() == mainContainer() ) continue; ++it; - if ( l->find( sel->widget() ) == -1 ) { - if ( WidgetFactory::layoutType( w ) == WidgetFactory::NoLayout ) + if ( l->tqfind( TQT_TQOBJECT(sel->widget()) ) == -1 ) { + if ( WidgetFactory::tqlayoutType( w ) == WidgetFactory::NoLayout ) sel->setWidget( 0 ); } else { - if ( WidgetFactory::layoutType( sel->widget()->parentWidget() ) == WidgetFactory::NoLayout ) { + if ( WidgetFactory::tqlayoutType( sel->widget()->tqparentWidget() ) == WidgetFactory::NoLayout ) { moving.insert( sel->widget(), sel->widget()->pos() ); sel->widget()->raise(); raiseChildSelections( sel->widget() ); @@ -1483,10 +1483,10 @@ void FormWindow::deleteWidgets() TQPtrDictIterator<WidgetSelection> it( usedSelections ); for ( ; it.current(); ++it ) { TQWidget *tb = 0; - if ( !( tb = mainWindow()->isAToolBarChild( it.current()->widget() ) ) ) + if ( !( tb = mainWindow()->isAToolBarChild( TQT_TQOBJECT(it.current()->widget()) ) ) ) widgets.append( it.current()->widget() ); else - ( (QDesignerToolBar*)tb )->removeWidget( it.current()->widget() ); + ( (TQDesignerToolBar*)tb )->removeWidget( it.current()->widget() ); } if ( widgets.isEmpty() ) @@ -1502,13 +1502,13 @@ void FormWindow::editAdjustSize() TQPtrList<Command> commands; TQWidgetList widgets = selectedWidgets(); if ( widgets.isEmpty() ) { - TQRect oldr = geometry(); + TQRect oldr = tqgeometry(); mainContainer()->adjustSize(); resize( mainContainer()->size() ); // check whether our own size constraint hit us if ( size() != mainContainer()->size() ) mainContainer()->resize( size() ); - TQRect nr = geometry(); + TQRect nr = tqgeometry(); if ( oldr != nr ) { ResizeCommand *cmd = new ResizeCommand( i18n( "Adjust Size" ), this, this, oldr, nr ); commandHistory()->addCommand( cmd ); @@ -1516,11 +1516,11 @@ void FormWindow::editAdjustSize() return; } for ( TQWidget* w = widgets.first(); w; w = widgets.next() ) { - if ( w->parentWidget() && WidgetFactory::layoutType( w->parentWidget() ) != WidgetFactory::NoLayout ) + if ( w->tqparentWidget() && WidgetFactory::tqlayoutType( w->tqparentWidget() ) != WidgetFactory::NoLayout ) continue; - TQRect oldr = w->geometry(); + TQRect oldr = w->tqgeometry(); w->adjustSize(); - TQRect nr = w->geometry(); + TQRect nr = w->tqgeometry(); if ( oldr != nr ) commands.append( new ResizeCommand( i18n("Adjust Size"), this, w, oldr, nr ) ); } @@ -1569,7 +1569,7 @@ void FormWindow::invalidCheckedSelections() void FormWindow::checkPreviewGeometry( TQRect &r ) { - if ( !rect().contains( r ) ) { + if ( !TQT_TQRECT_OBJECT(rect()).tqcontains( r ) ) { if ( r.left() < rect().left() ) r.moveTopLeft( TQPoint( 0, r.top() ) ); if ( r.right() > rect().right() ) @@ -1591,9 +1591,9 @@ void FormWindow::focusOutEvent( TQFocusEvent * ) { if ( propertyWidget && !isMainContainer( propertyWidget ) && !isWidgetSelected( propertyWidget ) ) { TQObject *opw = propertyWidget; - propertyWidget = mainContainer(); + propertyWidget = TQT_TQOBJECT(mainContainer()); if ( opw->isWidgetType() ) - repaintSelection( (TQWidget*)opw ); + tqrepaintSelection( (TQWidget*)opw ); } } @@ -1605,14 +1605,14 @@ void FormWindow::resizeEvent( TQResizeEvent *e ) if ( isVisible() ) formFile()->setModified( TRUE, FormFile::WFormWindow ); -#if defined(Q_WS_WIN32) +#if defined(TQ_WS_WIN32) windowsRepaintWorkaroundTimer->start( 100, TRUE ); #endif } void FormWindow::windowsRepaintWorkaroundTimerTimeout() { -#if defined(Q_WS_WIN32) +#if defined(TQ_WS_WIN32) TQObjectList *l = queryList( TQWIDGET_OBJECT_NAME_STRING ); for ( TQObject *o = l->first(); o; o = l->next() ) { flickerfree_update( (TQWidget*)o ); @@ -1632,8 +1632,8 @@ TQWidget *FormWindow::designerWidget( TQObject *o ) const if ( !o || !o->isWidgetType() ) return 0; TQWidget *w = (TQWidget*)o; - while ( w && !isMainContainer( w ) && !insertedWidgets[ (void*)w ] || isCentralWidget( w ) ) - w = (TQWidget*)w->parent(); + while ( w && !isMainContainer( TQT_TQOBJECT(w) ) && !insertedWidgets[ (void*)w ] || isCentralWidget( TQT_TQOBJECT(w) ) ) + w = (TQWidget*)w->tqparent(); return w; } @@ -1643,7 +1643,7 @@ void FormWindow::emitShowProperties( TQObject *w ) TQObject *opw = propertyWidget; propertyWidget = w; if ( opw->isWidgetType() ) - repaintSelection( (TQWidget*)opw ); + tqrepaintSelection( (TQWidget*)opw ); } showPropertiesTimer->stop(); // showPropertiesTimer->start( 0, TRUE ); @@ -1700,11 +1700,11 @@ void FormWindow::currentToolChanged() case BUDDY_TOOL: restoreConnectionLine(); if ( startWidget ) - restoreRect( TQRect( mapToForm( ( (TQWidget*)startWidget )->parentWidget(), + restoreRect( TQRect( mapToForm( ( (TQWidget*)startWidget )->tqparentWidget(), ( (TQWidget*)startWidget )->pos() ), ( (TQWidget*)startWidget )->size() ) ); if ( endWidget ) - restoreRect( TQRect( mapToForm( ( (TQWidget*)endWidget )->parentWidget(), + restoreRect( TQRect( mapToForm( ( (TQWidget*)endWidget )->tqparentWidget(), ( (TQWidget*)endWidget )->pos() ), ( (TQWidget*)endWidget )->size() ) ); endUnclippedPainter(); @@ -1735,7 +1735,7 @@ void FormWindow::currentToolChanged() switch ( currTool ) { case POINTER_TOOL: if ( propertyWidget && !isMainContainer( propertyWidget ) && !isWidgetSelected( propertyWidget ) ) - emitShowProperties( mainContainer() ); + emitShowProperties( TQT_TQOBJECT(mainContainer()) ); restoreCursors( this, this ); break; case ORDER_TOOL: @@ -1744,7 +1744,7 @@ void FormWindow::currentToolChanged() orderedWidgets.clear(); showOrderIndicators(); if ( mainWindow()->formWindow() == this ) - emitShowProperties( mainContainer() ); + emitShowProperties( TQT_TQOBJECT(mainContainer()) ); setCursorToAll( ArrowCursor, this ); } break; @@ -1756,13 +1756,13 @@ void FormWindow::currentToolChanged() mainWindow()->statusMessage( i18n( "Drag a line to set a buddy...") ); setCursorToAll( CrossCursor, this ); if ( mainWindow()->formWindow() == this ) - emitShowProperties( mainContainer() ); + emitShowProperties( TQT_TQOBJECT(mainContainer()) ); break; default: - mainWindow()->statusMessage( i18n( "Click on the form to insert a %1..." ).arg( WidgetDatabase::toolTip( currTool ).lower() ) ); + mainWindow()->statusMessage( i18n( "Click on the form to insert a %1..." ).tqarg( WidgetDatabase::toolTip( currTool ).lower() ) ); setCursorToAll( CrossCursor, this ); if ( mainWindow()->formWindow() == this ) - emitShowProperties( mainContainer() ); + emitShowProperties( TQT_TQOBJECT(mainContainer()) ); break; } } @@ -1779,10 +1779,10 @@ void FormWindow::showOrderIndicators() TQWidget* w = (TQWidget*) o; if ( w->isShown() && insertedWidgets[ (void*)w ] && - w->focusPolicy() != NoFocus ) { + w->focusPolicy() != TQ_NoFocus ) { OrderIndicator* ind = new OrderIndicator( order++, w, this ); orderIndicators.append( ind ); - if ( stackedWidgets.findRef( w ) == -1 ) + if ( stackedWidgets.tqfindRef( w ) == -1 ) stackedWidgets.append( w ); } } @@ -1824,7 +1824,7 @@ bool FormWindow::checkCustomWidgets() TQPtrDictIterator<TQWidget> it( insertedWidgets ); for ( ; it.current(); ++it ) { if ( it.current()->isA( "CustomWidget" ) ) { - TQString className = WidgetFactory::classNameOf( it.current() ); + TQString className = WidgetFactory::classNameOf( TQT_TQOBJECT(it.current()) ); if ( !MetaDataBase::hasCustomWidget( className ) ) missingCustomWidgets << className; } @@ -1832,7 +1832,7 @@ bool FormWindow::checkCustomWidgets() if ( !missingCustomWidgets.isEmpty() ) { TQString txt = i18n( "The following custom widgets are used in '%1',\n" - "but are not known to Qt Designer:\n" ).arg( name() ); + "but are not known to TQt Designer:\n" ).tqarg( name() ); 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" @@ -1861,7 +1861,7 @@ int FormWindow::numSelectedWidgets() const TQString FormWindow::copy() { - CHECK_MAINWINDOW_VALUE( TQString::null ); + CHECK_MAINWINDOW_VALUE( TQString() ); Resource resource( mainWindow() ); resource.setWidget( this ); return resource.copy(); @@ -1881,14 +1881,14 @@ void FormWindow::lowerWidgets() void find_accel( const TQString &txt, TQMap<TQChar, TQWidgetList > &accels, TQWidget *w ) { - int i = txt.find( "&" ); + int i = txt.tqfind( "&" ); if ( i == -1 ) return; TQChar c = txt[ i + 1 ]; if ( c.isNull() || c == '&' ) return; c = c.lower(); - TQMap<TQChar, TQWidgetList >::Iterator it = accels.find( c ); + TQMap<TQChar, TQWidgetList >::Iterator it = accels.tqfind( c ); if ( it == accels.end() ) { TQWidgetList wl; wl.append( w ); @@ -1910,18 +1910,18 @@ void FormWindow::checkAccels() insertedWidgets[ (void*)o ] ) { TQWidget *w = (TQWidget*)o; const TQMetaProperty* text = - w->metaObject()->property( w->metaObject()->findProperty( "text", TRUE ), TRUE ); + w->tqmetaObject()->property( w->tqmetaObject()->tqfindProperty( "text", TRUE ), TRUE ); const TQMetaProperty* title = - w->metaObject()->property( w->metaObject()->findProperty( "title", TRUE ), TRUE ); + w->tqmetaObject()->property( w->tqmetaObject()->tqfindProperty( "title", TRUE ), TRUE ); const TQMetaProperty* pageTitle = - w->metaObject()->property( w->metaObject()->findProperty( "pageTitle", TRUE ), TRUE ); + w->tqmetaObject()->property( w->tqmetaObject()->tqfindProperty( "pageTitle", TRUE ), TRUE ); if ( text ) find_accel( w->property( "text" ).toString(), accels, w ); if ( title ) find_accel( w->property( "title" ).toString(), accels, w ); if ( pageTitle ) find_accel( w->property( "pageTitle" ).toString(), accels, w ); - } else if ( ::qt_cast<MenuBarEditor*>(o) ) { + } else if ( ::tqqt_cast<MenuBarEditor*>(o) ) { ((MenuBarEditor *)o)->checkAccels( accels ); } } @@ -1935,13 +1935,13 @@ void FormWindow::checkAccels() ok = FALSE; 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() ), + ).tqarg( it.key().upper() ), i18n( "&Select" ), - i18n( "&Cancel" ), TQString::null, 2 ) ) { + i18n( "&Cancel" ), TQString(), 2 ) ) { case 0: // select clearSelection( FALSE ); for ( wid = (*it).first(); wid; wid = (*it).next() ) - selectWidget( wid, TRUE ); + selectWidget( TQT_TQOBJECT(wid), TRUE ); return; case 1: // cancel return; @@ -1966,12 +1966,12 @@ void FormWindow::raiseWidgets() commandHistory()->addCommand( cmd ); } -void FormWindow::paste( const TQString &cb, TQWidget *parent ) +void FormWindow::paste( const TQString &cb, TQWidget *tqparent ) { CHECK_MAINWINDOW; Resource resource( mainWindow() ); resource.setWidget( this ); - resource.paste( cb, parent ); + resource.paste( cb, tqparent ); } void FormWindow::selectAll() @@ -1983,7 +1983,7 @@ void FormWindow::selectAll() for ( TQObject *o = l->first(); o; o = l->next() ) { if ( ( (TQWidget*)o )->isVisibleTo( this ) && insertedWidgets[ (void*)o ] ) { - selectWidget( (TQWidget*)o ); + selectWidget( TQT_TQOBJECT(o) ); } } delete l; @@ -1996,47 +1996,47 @@ void FormWindow::selectAll() emitSelectionChanged(); } -void FormWindow::layoutHorizontal() +void FormWindow::tqlayoutHorizontal() { TQWidgetList widgets( selectedWidgets() ); - LayoutHorizontalCommand *cmd = new LayoutHorizontalCommand( i18n( "Lay Out Horizontally" ), + LayoutHorizontalCommand *cmd = new LayoutHorizontalCommand( i18n( "Lay OutQt::Horizontally" ), this, mainContainer(), 0, widgets ); clearSelection( FALSE ); commandHistory()->addCommand( cmd ); cmd->execute(); } -void FormWindow::layoutVertical() +void FormWindow::tqlayoutVertical() { TQWidgetList widgets( selectedWidgets() ); - LayoutVerticalCommand *cmd = new LayoutVerticalCommand( i18n( "Lay Out Vertically" ), + LayoutVerticalCommand *cmd = new LayoutVerticalCommand( i18n( "Lay OutQt::Vertically" ), this, mainContainer(), 0, widgets ); clearSelection( FALSE ); commandHistory()->addCommand( cmd ); cmd->execute(); } -void FormWindow::layoutHorizontalSplit() +void FormWindow::tqlayoutHorizontalSplit() { TQWidgetList widgets( selectedWidgets() ); - LayoutHorizontalSplitCommand *cmd = new LayoutHorizontalSplitCommand( i18n( "Lay Out Horizontally (in splitter)" ), + LayoutHorizontalSplitCommand *cmd = new LayoutHorizontalSplitCommand( i18n( "Lay OutQt::Horizontally (in splitter)" ), this, mainContainer(), 0, widgets ); clearSelection( FALSE ); commandHistory()->addCommand( cmd ); cmd->execute(); } -void FormWindow::layoutVerticalSplit() +void FormWindow::tqlayoutVerticalSplit() { TQWidgetList widgets( selectedWidgets() ); - LayoutVerticalSplitCommand *cmd = new LayoutVerticalSplitCommand( i18n( "Lay Out Vertically (in splitter)" ), + LayoutVerticalSplitCommand *cmd = new LayoutVerticalSplitCommand( i18n( "Lay OutQt::Vertically (in splitter)" ), this, mainContainer(), 0, widgets ); clearSelection( FALSE ); commandHistory()->addCommand( cmd ); cmd->execute(); } -void FormWindow::layoutGrid() +void FormWindow::tqlayoutGrid() { int xres = grid().x(); int yres = grid().y(); @@ -2049,63 +2049,63 @@ void FormWindow::layoutGrid() cmd->execute(); } -void FormWindow::layoutHorizontalContainer( TQWidget *w ) +void FormWindow::tqlayoutHorizontalContainer( TQWidget *w ) { if ( w == this ) w = mainContainer(); - TQObjectList *l = (TQObjectList*)WidgetFactory::containerOfWidget(w)->children(); - if ( !l ) + TQObjectList l = WidgetFactory::containerOfWidget(w)->childrenListObject(); + if ( l.isEmpty() ) return; TQWidgetList widgets; - for ( TQObject *o = l->first(); o; o = l->next() ) { + for ( TQObject *o = l.first(); o; o = l.next() ) { if ( o->isWidgetType() && ( (TQWidget*)o )->isVisibleTo( this ) && - insertedWidgets.find( (TQWidget*)o ) ) + insertedWidgets.tqfind( (TQWidget*)o ) ) widgets.append( (TQWidget*)o ); } - LayoutHorizontalCommand *cmd = new LayoutHorizontalCommand( i18n( "Lay Out Children Horizontally" ), + LayoutHorizontalCommand *cmd = new LayoutHorizontalCommand( i18n( "Lay Out ChildrenQt::Horizontally" ), this, mainContainer(), w, widgets ); clearSelection( FALSE ); commandHistory()->addCommand( cmd ); cmd->execute(); } -void FormWindow::layoutVerticalContainer( TQWidget *w ) +void FormWindow::tqlayoutVerticalContainer( TQWidget *w ) { if ( w == this ) w = mainContainer(); - TQObjectList *l = (TQObjectList*)WidgetFactory::containerOfWidget(w)->children(); - if ( !l ) + TQObjectList l = WidgetFactory::containerOfWidget(w)->childrenListObject(); + if ( l.isEmpty() ) return; TQWidgetList widgets; - for ( TQObject *o = l->first(); o; o = l->next() ) { + for ( TQObject *o = l.first(); o; o = l.next() ) { if ( o->isWidgetType() && ( (TQWidget*)o )->isVisibleTo( this ) && - insertedWidgets.find( (TQWidget*)o ) ) + insertedWidgets.tqfind( (TQWidget*)o ) ) widgets.append( (TQWidget*)o ); } - LayoutVerticalCommand *cmd = new LayoutVerticalCommand( i18n( "Lay Out Children Vertically" ), + LayoutVerticalCommand *cmd = new LayoutVerticalCommand( i18n( "Lay Out ChildrenQt::Vertically" ), this, mainContainer(), w, widgets ); clearSelection( FALSE ); commandHistory()->addCommand( cmd ); cmd->execute(); } -void FormWindow::layoutGridContainer( TQWidget *w ) +void FormWindow::tqlayoutGridContainer( TQWidget *w ) { if ( w == this ) w = mainContainer(); int xres = grid().x(); int yres = grid().y(); - TQObjectList *l = (TQObjectList*)WidgetFactory::containerOfWidget(w)->children(); - if ( !l ) + TQObjectList l = WidgetFactory::containerOfWidget(w)->childrenListObject(); + if ( l.isEmpty() ) return; TQWidgetList widgets; - for ( TQObject *o = l->first(); o; o = l->next() ) { + for ( TQObject *o = l.first(); o; o = l.next() ) { if ( o->isWidgetType() && ( (TQWidget*)o )->isVisibleTo( this ) && - insertedWidgets.find( (TQWidget*)o ) ) + insertedWidgets.tqfind( (TQWidget*)o ) ) widgets.append( (TQWidget*)o ); } LayoutGridCommand *cmd = new LayoutGridCommand( i18n( "Lay Out Children in a Grid" ), @@ -2125,15 +2125,15 @@ void FormWindow::breakLayout( TQWidget *w ) for (;;) { if ( !w || w == this ) break; - if ( WidgetFactory::layoutType( w ) != WidgetFactory::NoLayout && - WidgetDatabase::isContainer( WidgetDatabase::idFromClassName( WidgetFactory::classNameOf( w ) ) ) ) { + if ( WidgetFactory::tqlayoutType( w ) != WidgetFactory::NoLayout && + WidgetDatabase::isContainer( WidgetDatabase::idFromClassName( WidgetFactory::classNameOf( TQT_TQOBJECT(w) ) ) ) ) { Command *cmd = breakLayoutCommand( w ); if ( cmd ) commands.insert( 0, cmd ); - if ( !::qt_cast<QLayoutWidget*>(w) && !::qt_cast<TQSplitter*>(w) ) + if ( !::tqqt_cast<TQLayoutWidget*>(w) && !::tqqt_cast<TQSplitter*>(w) ) break; } - w = w->parentWidget(); + w = w->tqparentWidget(); } if ( commands.isEmpty() ) @@ -2148,16 +2148,16 @@ void FormWindow::breakLayout( TQWidget *w ) BreakLayoutCommand *FormWindow::breakLayoutCommand( TQWidget *w ) { CHECK_MAINWINDOW_VALUE( 0 ); - TQObjectList *l = (TQObjectList*)w->children(); - if ( !l ) + TQObjectList l = w->childrenListObject(); + if ( l.isEmpty() ) return 0; TQWidgetList widgets; - for ( TQObject *o = l->first(); o; o = l->next() ) { + for ( TQObject *o = l.first(); o; o = l.next() ) { if ( o->isWidgetType() && - !mainWindow()->isAToolBarChild( (TQWidget*)o ) && + !mainWindow()->isAToolBarChild( TQT_TQOBJECT(o) ) && ( (TQWidget*)o )->isVisibleTo( this ) && - insertedWidgets.find( (TQWidget*)o ) ) + insertedWidgets.tqfind( (TQWidget*)o ) ) widgets.append( (TQWidget*)o ); } return new BreakLayoutCommand( i18n( "Break Layout" ), this, WidgetFactory::widgetOfContainer( w ), widgets ); @@ -2190,7 +2190,7 @@ bool FormWindow::hasInsertedChildren( TQWidget *w ) const for ( TQObject *o = l->first(); o; o = l->next() ) { if ( o->isWidgetType() && ( (TQWidget*)o )->isVisibleTo( (FormWindow*)this ) && - insertedWidgets.find( (TQWidget*)o ) ) { + insertedWidgets.tqfind( (TQWidget*)o ) ) { delete l; return TRUE; } @@ -2202,11 +2202,11 @@ bool FormWindow::hasInsertedChildren( TQWidget *w ) const bool FormWindow::allowMove( TQWidget *w ) { - w = w->parentWidget(); + w = w->tqparentWidget(); while ( w ) { - if ( ( isMainContainer( w ) || insertedWidgets.find( w ) ) && WidgetFactory::layoutType( w ) == WidgetFactory::NoLayout ) + if ( ( isMainContainer( TQT_TQOBJECT(w) ) || insertedWidgets.tqfind( w ) ) && WidgetFactory::tqlayoutType( w ) == WidgetFactory::NoLayout ) return TRUE; - w = w->parentWidget(); + w = w->tqparentWidget(); } return FALSE; } @@ -2221,7 +2221,7 @@ void FormWindow::editConnections() ConnectionDialog dlg( mainwindow ); mainWindow()->statusMessage( i18n( "Edit connections...") ); - dlg.addConnection( startWidget, endWidget, TQString::null, TQString::null ); + dlg.addConnection( TQT_TQOBJECT(startWidget), TQT_TQOBJECT(endWidget), TQString(), TQString() ); TQTimer::singleShot( 0, &dlg, TQT_SLOT(ensureConnectionVisible()) ); dlg.exec(); } @@ -2239,8 +2239,8 @@ void FormWindow::restoreConnectionLine() if (!unclippedPainter || !buffer) // designer will occasionally crash if buffer is not tested to be non-zero return; - int a =QABS( startPos.x() - currentPos.x() ); - int b = QABS( startPos.y() - currentPos.y() ); + int a =TQABS( startPos.x() - currentPos.x() ); + int b = TQABS( startPos.y() - currentPos.y() ); TQRect r( startPos, currentPos ); if ( a < 32 || b < 32 ) { // special case: vertical or horizontal line @@ -2280,7 +2280,7 @@ void FormWindow::restoreConnectionLine() w = h = 64; r = r.normalize(); - while ( r.contains( p ) ) { + while ( r.tqcontains( p ) ) { unclippedPainter->drawPixmap( p, *buffer, TQRect( p, TQSize( w, h ) ) ); unclippedPainter->setPen( red ); p.setX( p.x() + dx ); @@ -2361,7 +2361,7 @@ bool FormWindow::unify( TQObject *w, TQString &s, bool changeIt ) int num = 1; TQPtrDictIterator<TQWidget> it( insertedWidgets ); for ( ; it.current();) { - if ( it.current() != w && + if ( TQT_BASE_OBJECT(it.current()) != TQT_BASE_OBJECT(w) && qstrcmp( it.current()->name(), s.latin1() ) == 0 ) { found = TRUE; if ( !changeIt ) @@ -2393,7 +2393,7 @@ bool FormWindow::unify( TQObject *w, TQString &s, bool changeIt ) } } } - if ( ::qt_cast<TQMainWindow*>(mainContainer()) && !found ) { + if ( ::tqqt_cast<TQMainWindow*>(mainContainer()) && !found ) { TQObjectList *l = mainContainer()->queryList( "PopupMenuEditor" ); for ( TQObject *o = l->first(); o; o = l->next() ) { if ( o != w && @@ -2407,7 +2407,7 @@ bool FormWindow::unify( TQObject *w, TQString &s, bool changeIt ) } delete l; } - if ( ::qt_cast<TQMainWindow*>(mainContainer()) ) { + if ( ::tqqt_cast<TQMainWindow*>(mainContainer()) ) { if ( !found ) { TQObjectList *l = mainContainer()->queryList( TQDOCKWINDOW_OBJECT_NAME_STRING, 0, TRUE ); for ( TQObject *o = l->first(); o; o = l->next() ) { @@ -2435,7 +2435,7 @@ bool FormWindow::isCustomWidgetUsed( MetaDataBase::CustomWidget *w ) TQPtrDictIterator<TQWidget> it( insertedWidgets ); for ( ; it.current(); ++it ) { if ( it.current()->isA( "CustomWidget" ) ) { - if ( qstrcmp( WidgetFactory::classNameOf( it.current() ), w->className.utf8() ) == 0 ) + if ( qstrcmp( WidgetFactory::classNameOf( TQT_TQOBJECT(it.current()) ), w->className.utf8() ) == 0 ) return TRUE; } } @@ -2445,13 +2445,13 @@ bool FormWindow::isCustomWidgetUsed( MetaDataBase::CustomWidget *w ) bool FormWindow::isDatabaseWidgetUsed() const { -#ifndef QT_NO_SQL +#ifndef TQT_NO_SQL TQStringList dbClasses; dbClasses << TQDATATABLE_OBJECT_NAME_STRING; // add more here TQPtrDictIterator<TQWidget> it( insertedWidgets ); for ( ; it.current(); ++it ) { TQString c( it.current()->className() ); - if ( dbClasses.contains( c ) > 0 ) { + if ( dbClasses.tqcontains( c ) > 0 ) { return TRUE; } } @@ -2461,8 +2461,8 @@ bool FormWindow::isDatabaseWidgetUsed() const bool FormWindow::isDatabaseAware() const { -#ifndef QT_NO_SQL - if ( TQString(mContainer->className()) == "QDesignerDataBrowser" || TQString(mContainer->className()) == "QDesignerDataView" ) +#ifndef TQT_NO_SQL + if ( TQString(mContainer->className()) == "TQDesignerDataBrowser" || TQString(mContainer->className()) == "TQDesignerDataView" ) return TRUE; return isDatabaseWidgetUsed(); #else @@ -2473,7 +2473,7 @@ bool FormWindow::isDatabaseAware() const void FormWindow::visibilityChanged() { if ( currTool != ORDER_TOOL ) { - emitUpdateProperties( currentWidget() ); + emitUpdateProperties( TQT_TQOBJECT(currentWidget()) ); } else { updateOrderIndicators(); repositionOrderIndicators(); @@ -2491,9 +2491,9 @@ TQPoint FormWindow::mapToForm( const TQWidget* w, const TQPoint& pos ) const { TQPoint p = pos; const TQWidget* i = w; - while ( i && !i->isTopLevel() && !isMainContainer( (TQWidget*)i ) ) { + while ( i && !i->isTopLevel() && !isMainContainer( TQT_TQOBJECT(const_cast<TQWidget*>(i)) ) ) { p = i->mapToParent( p ); - i = i->parentWidget(); + i = i->tqparentWidget(); } return mapFromGlobal( w->mapToGlobal( pos ) ); } @@ -2503,7 +2503,7 @@ static int widgetDepth( TQWidget *w ) int d = -1; while ( w && !w->isTopLevel() ) { d++; - w = w->parentWidget(); + w = w->tqparentWidget(); } return d; @@ -2514,7 +2514,7 @@ static bool isChildOf( TQWidget *c, TQWidget *p ) while ( c && !c->isTopLevel() ) { if ( c == p ) return TRUE; - c = c->parentWidget(); + c = c->tqparentWidget(); } return FALSE; } @@ -2525,36 +2525,36 @@ TQWidget *FormWindow::containerAt( const TQPoint &pos, TQWidget *notParentOf ) TQWidget *container = 0; int depth = -1; TQWidgetList selected = selectedWidgets(); - if ( rect().contains( mapFromGlobal( pos ) ) ) { + if ( TQT_TQRECT_OBJECT(rect()).tqcontains( mapFromGlobal( pos ) ) ) { container = mainContainer(); depth = widgetDepth( container ); } for ( ; it.current(); ++it ) { - if ( ::qt_cast<QLayoutWidget*>(it.current()) - || ::qt_cast<TQSplitter*>(it.current()) ) + if ( ::tqqt_cast<TQLayoutWidget*>(it.current()) + || ::tqqt_cast<TQSplitter*>(it.current()) ) continue; if ( !it.current()->isVisibleTo( this ) ) continue; - if ( selected.find( it.current() ) != -1 ) + if ( selected.tqfind( it.current() ) != -1 ) continue; - if ( !WidgetDatabase::isContainer( WidgetDatabase::idFromClassName( WidgetFactory::classNameOf( it.current() ) ) ) && + if ( !WidgetDatabase::isContainer( WidgetDatabase::idFromClassName( WidgetFactory::classNameOf( TQT_TQOBJECT(it.current()) ) ) ) && it.current() != mainContainer() ) continue; // the rectangles of all ancestors of the container must contain the insert position TQWidget *w = it.current(); while ( w && !w->isTopLevel() ) { - if ( !w->rect().contains( ( w->mapFromGlobal( pos ) ) ) ) + if ( !TQT_TQRECT_OBJECT(w->rect()).tqcontains( ( w->mapFromGlobal( pos ) ) ) ) break; - w = w->parentWidget(); + w = w->tqparentWidget(); } if ( !( w == 0 || w->isTopLevel() ) ) continue; // we did not get through the full while loop int wd = widgetDepth( it.current() ); if ( wd == depth && container ) { - if ( ( (TQObjectList*)it.current()->parentWidget()->children() )->find( it.current() ) > - ( (TQObjectList*)container->parentWidget()->children() )->find( container ) ) + if ( ( it.current()->tqparentWidget()->childrenListObject() ).tqfind( TQT_TQOBJECT(it.current()) ) > + ( container->tqparentWidget()->childrenListObject() ).tqfind( TQT_TQOBJECT(container) ) ) wd++; } if ( wd > depth && !isChildOf( it.current(), notParentOf ) ) { @@ -2568,7 +2568,7 @@ TQWidget *FormWindow::containerAt( const TQPoint &pos, TQWidget *notParentOf ) bool FormWindow::isMainContainer( TQObject *w ) const { - return w && w->isWidgetType() && ( w == (TQWidget*)this || w == mainContainer() ); + return w && w->isWidgetType() && ( TQT_BASE_OBJECT(w) == this || TQT_BASE_OBJECT(w) == mainContainer() ); } void FormWindow::setMainContainer( TQWidget *w ) @@ -2576,34 +2576,34 @@ void FormWindow::setMainContainer( TQWidget *w ) bool resetPropertyWidget = isMainContainer( propertyWidget ); if ( mContainer ) insertedWidgets.remove( mContainer ); - if ( propertyWidget == mContainer ) + if ( TQT_BASE_OBJECT(propertyWidget) == TQT_BASE_OBJECT(mContainer) ) propertyWidget = 0; delete mContainer; mContainer = w; insertedWidgets.insert( mContainer, mContainer ); - delete layout(); + delete tqlayout(); TQHBoxLayout *l = new TQHBoxLayout( this ); l->addWidget( w ); if ( resetPropertyWidget ) { TQObject *opw = propertyWidget; - propertyWidget = mContainer; + propertyWidget = TQT_TQOBJECT(mContainer); if ( opw && opw->isWidgetType() ) - repaintSelection( (TQWidget*)opw ); + tqrepaintSelection( (TQWidget*)opw ); } if ( project() ) { LanguageInterface *iface = MetaDataBase::languageInterface( project()->language() ); if ( iface && !project()->isCpp() && !isFake() ) { - if ( !MetaDataBase::hasFunction( this, "init()" ) ) - MetaDataBase::addFunction( this, "init()", "", "private", "function", + if ( !MetaDataBase::hasFunction( TQT_TQOBJECT(this), "init()" ) ) + MetaDataBase::addFunction( TQT_TQOBJECT(this), "init()", "", "private", "function", project()->language(), "void" ); - if ( !MetaDataBase::hasFunction( this, "destroy()" ) ) - MetaDataBase::addFunction( this, "destroy()", "", "private", "function", + if ( !MetaDataBase::hasFunction( TQT_TQOBJECT(this), "destroy()" ) ) + MetaDataBase::addFunction( TQT_TQOBJECT(this), "destroy()", "", "private", "function", project()->language(), "void" ); - if ( !MetaDataBase::hasConnection( this, mainContainer(), "shown()", mainContainer(), "init" ) ) - MetaDataBase::addConnection( this, mainContainer(), "shown()", mainContainer(), "init" ); - if ( !MetaDataBase::hasConnection( this, mainContainer(), "destroyed()", mainContainer(), "destroy" ) ) - MetaDataBase::addConnection( this, mainContainer(), "destroyed()", - mainContainer(), "destroy" ); + if ( !MetaDataBase::hasConnection( TQT_TQOBJECT(this), TQT_TQOBJECT(mainContainer()), "shown()", TQT_TQOBJECT(mainContainer()), "init" ) ) + MetaDataBase::addConnection( TQT_TQOBJECT(this), TQT_TQOBJECT(mainContainer()), "shown()", TQT_TQOBJECT(mainContainer()), "init" ); + if ( !MetaDataBase::hasConnection( TQT_TQOBJECT(this), TQT_TQOBJECT(mainContainer()), "destroyed()", TQT_TQOBJECT(mainContainer()), "destroy" ) ) + MetaDataBase::addConnection( TQT_TQOBJECT(this), TQT_TQOBJECT(mainContainer()), "destroyed()", + TQT_TQOBJECT(mainContainer()), "destroy" ); } } } @@ -2689,17 +2689,17 @@ DesignerFormWindow *FormWindow::iFace() bool FormWindow::isCentralWidget( TQObject *w ) const { - if ( !::qt_cast<TQMainWindow*>(mainContainer()) ) + if ( !::tqqt_cast<TQMainWindow*>(mainContainer()) ) return FALSE; - return w == ( (TQMainWindow*)mainContainer() )->centralWidget(); + return TQT_BASE_OBJECT(w) == TQT_BASE_OBJECT(( (TQMainWindow*)mainContainer() )->centralWidget()); } -int FormWindow::layoutDefaultSpacing() const +int FormWindow::tqlayoutDefaultSpacing() const { return defSpacing; } -int FormWindow::layoutDefaultMargin() const +int FormWindow::tqlayoutDefaultMargin() const { return defMargin; } @@ -2758,17 +2758,15 @@ void FormWindow::setFormFile( FormFile *f ) bool FormWindow::canBeBuddy( const TQWidget *w ) const { - return w->focusPolicy() != TQWidget::NoFocus; + return w->focusPolicy() != TQ_NoFocus; } bool FormWindow::event( TQEvent *e ) { if (e->type() == TQEvent::ShowMaximized) { -#if QT_VERSION >= 0x030300 if ( isMaximized() ) setWindowState( windowState() & ~WindowMaximized | WindowActive); -#endif return true; } return TQWidget::event(e); |