diff options
Diffstat (limited to 'kdevdesigner/designer/formwindow.cpp')
-rw-r--r-- | kdevdesigner/designer/formwindow.cpp | 408 |
1 files changed, 204 insertions, 204 deletions
diff --git a/kdevdesigner/designer/formwindow.cpp b/kdevdesigner/designer/formwindow.cpp index 2dc7bb9d..6bea093f 100644 --- a/kdevdesigner/designer/formwindow.cpp +++ b/kdevdesigner/designer/formwindow.cpp @@ -112,7 +112,7 @@ static void restoreCursors( TQWidget *start, FormWindow *fw ) #include <tqt_windows.h> static void flickerfree_update( TQWidget *w ) { - InvalidateRect( w->winId(), 0, FALSE ); + InvalidateRect( w->winId(), 0, false ); } #endif @@ -136,7 +136,7 @@ static void flickerfree_update( TQWidget *w ) FormWindow::FormWindow( FormFile *f, MainWindow *mw, TQWidget *parent, const char *name ) : TQWidget( parent, name, WDestructiveClose ), mainwindow( mw ), - commands( 100 ), pixInline( TRUE ), pixProject( FALSE ) + commands( 100 ), pixInline( true ), pixProject( false ) { ff = f; init(); @@ -145,7 +145,7 @@ FormWindow::FormWindow( FormFile *f, MainWindow *mw, TQWidget *parent, const cha FormWindow::FormWindow( FormFile *f, TQWidget *parent, const char *name ) : TQWidget( parent, name, WDestructiveClose ), mainwindow( 0 ), - commands( 100 ), pixInline( TRUE ) + commands( 100 ), pixInline( true ) { ff = f; init(); @@ -156,63 +156,63 @@ void FormWindow::init() setWFlags(getWFlags() & TQt::WStyle_Maximize); fake = qstrcmp( name(), "qt_fakewindow" ) == 0; - MetaDataBase::addEntry( TQT_TQOBJECT(this) ); + MetaDataBase::addEntry( this ); ff->setFormWindow( this ); iface = 0; proj = 0; propertyWidget = 0; - toolFixed = FALSE; - checkedSelectionsForMove = FALSE; + toolFixed = false; + checkedSelectionsForMove = false; mContainer = 0; startWidget = endWidget = 0; currTool = POINTER_TOOL; unclippedPainter = 0; - widgetPressed = FALSE; - drawRubber = FALSE; + widgetPressed = false; + drawRubber = false; setFocusPolicy( TQWidget::ClickFocus ); sizePreviewLabel = 0; checkSelectionsTimer = new TQTimer( this, "checkSelectionsTimer" ); - connect( checkSelectionsTimer, TQT_SIGNAL( timeout() ), - this, TQT_SLOT( invalidCheckedSelections() ) ); + connect( checkSelectionsTimer, TQ_SIGNAL( timeout() ), + this, TQ_SLOT( invalidCheckedSelections() ) ); updatePropertiesTimer = new TQTimer( this ); - connect( updatePropertiesTimer, TQT_SIGNAL( timeout() ), - this, TQT_SLOT( updatePropertiesTimerDone() ) ); + connect( updatePropertiesTimer, TQ_SIGNAL( timeout() ), + this, TQ_SLOT( updatePropertiesTimerDone() ) ); showPropertiesTimer = new TQTimer( this ); //!!!! - connect( showPropertiesTimer, TQT_SIGNAL( timeout() ), - this, TQT_SLOT( showPropertiesTimerDone() ) ); + connect( showPropertiesTimer, TQ_SIGNAL( timeout() ), + this, TQ_SLOT( showPropertiesTimerDone() ) ); selectionChangedTimer = new TQTimer( this ); - connect( selectionChangedTimer, TQT_SIGNAL( timeout() ), - this, TQT_SLOT( selectionChangedTimerDone() ) ); + connect( selectionChangedTimer, TQ_SIGNAL( timeout() ), + this, TQ_SLOT( selectionChangedTimerDone() ) ); windowsRepaintWorkaroundTimer = new TQTimer( this ); - connect( windowsRepaintWorkaroundTimer, TQT_SIGNAL( timeout() ), - this, TQT_SLOT( windowsRepaintWorkaroundTimerTimeout() ) ); + connect( windowsRepaintWorkaroundTimer, TQ_SIGNAL( timeout() ), + this, TQ_SLOT( windowsRepaintWorkaroundTimerTimeout() ) ); insertParent = 0; - connect( &commands, TQT_SIGNAL( undoRedoChanged( bool, bool, const TQString &, const TQString & ) ), - this, TQT_SIGNAL( undoRedoChanged( bool, bool, const TQString &, const TQString & ) ) ); - propShowBlocked = FALSE; + connect( &commands, TQ_SIGNAL( undoRedoChanged( bool, bool, const TQString &, const TQString & ) ), + this, TQ_SIGNAL( undoRedoChanged( bool, bool, const TQString &, const TQString & ) ) ); + propShowBlocked = false; setIcon( SmallIcon( "designer_form.png" , KDevDesignerPartFactory::instance()) ); - connect( &commands, TQT_SIGNAL( modificationChanged( bool ) ), - this, TQT_SLOT( modificationChanged( bool ) ) ); + connect( &commands, TQ_SIGNAL( modificationChanged( bool ) ), + this, TQ_SLOT( modificationChanged( bool ) ) ); buffer = 0; TQWidget *w = WidgetFactory::create( WidgetDatabase::idFromClassName( "TQFrame" ), this ); setMainContainer( w ); - propertyWidget = TQT_TQOBJECT(w); + propertyWidget = w; targetContainer = 0; - hadOwnPalette = FALSE; + hadOwnPalette = false; defSpacing = BOXLAYOUT_DEFAULT_SPACING; defMargin = BOXLAYOUT_DEFAULT_MARGIN; - hasLayoutFunc = FALSE; + hasLayoutFunc = false; } void FormWindow::setMainWindow( MainWindow *w ) { mainwindow = w; - MetaDataBase::addEntry( TQT_TQOBJECT(this) ); + MetaDataBase::addEntry( this ); initSlots(); } @@ -236,7 +236,7 @@ FormWindow::~FormWindow() if ( MainWindow::self && MainWindow::self->objectHierarchy()->formWindow() == this ) MainWindow::self->objectHierarchy()->setFormWindow( 0, 0 ); - MetaDataBase::clear( TQT_TQOBJECT(this) ); + MetaDataBase::clear( this ); if ( ff ) ff->setFormWindow( 0 ); delete iface; @@ -365,7 +365,7 @@ void FormWindow::insertWidget() } - TQWidget *w = WidgetFactory::create( currTool, insertParent, 0, TRUE, &currRect, orient ); + TQWidget *w = WidgetFactory::create( currTool, insertParent, 0, true, &currRect, orient ); if ( !w ) return; @@ -375,7 +375,7 @@ void FormWindow::insertWidget() pix.convertFromImage( SmallIcon( "designer_image.png" , KDevDesignerPartFactory::instance()).convertToImage() ); ( (TQLabel*)w )->setPixmap( pix ); } - int id = WidgetDatabase::idFromClassName( WidgetFactory::classNameOf(TQT_TQOBJECT(w)) ); + int id = WidgetDatabase::idFromClassName( WidgetFactory::classNameOf(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> " @@ -393,7 +393,7 @@ void FormWindow::insertWidget() } TQString s = w->name(); - unify( TQT_TQOBJECT(w), s, TRUE ); + unify( w, s, true ); w->setName( s ); insertWidget( w ); TQRect r( currRect ); @@ -429,7 +429,7 @@ void FormWindow::insertWidget() const TQObjectList l = insertParent->childrenListObject(); TQObjectListIt it( l ); TQWidgetList lst; - if ( WidgetDatabase::isContainer( WidgetDatabase::idFromClassName( WidgetFactory::classNameOf( TQT_TQOBJECT(w) ) ) ) ) { + if ( WidgetDatabase::isContainer( WidgetDatabase::idFromClassName( WidgetFactory::classNameOf( w ) ) ) ) { for ( ; it.current(); ) { TQObject *o = it.current(); ++it; @@ -497,12 +497,12 @@ void FormWindow::insertWidget( TQWidget *w, bool checkName ) return; if ( checkName ) { TQString s = w->name(); - unify( TQT_TQOBJECT(w), s, TRUE ); + unify( w, s, true ); w->setName( s ); } - MetaDataBase::addEntry( TQT_TQOBJECT(w) ); - int id = WidgetDatabase::idFromClassName( WidgetFactory::classNameOf(TQT_TQOBJECT(w)) ); + MetaDataBase::addEntry( w ); + int id = WidgetDatabase::idFromClassName( WidgetFactory::classNameOf(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> " @@ -526,7 +526,7 @@ void FormWindow::insertWidget( TQWidget *w, bool checkName ) void FormWindow::removeWidget( TQWidget *w ) { - MetaDataBase::removeEntry( TQT_TQOBJECT(w) ); + MetaDataBase::removeEntry( w ); widgets()->take( w ); } @@ -535,9 +535,9 @@ void FormWindow::handleContextMenu( TQContextMenuEvent *e, TQWidget *w ) CHECK_MAINWINDOW; switch ( currTool ) { case POINTER_TOOL: { - if ( !isMainContainer( TQT_TQOBJECT(w) ) && qstrcmp( w->name(), "central widget" ) != 0 ) { // press on a child widget + if ( !isMainContainer( w ) && qstrcmp( w->name(), "central widget" ) != 0 ) { // press on a child widget raiseChildSelections( w ); // raise selections and select widget - selectWidget( TQT_TQOBJECT(w) ); + selectWidget( 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() && @@ -565,7 +565,7 @@ void FormWindow::handleContextMenu( TQContextMenuEvent *e, TQWidget *w ) void FormWindow::handleMousePress( TQMouseEvent *e, TQWidget *w ) { CHECK_MAINWINDOW; - checkedSelectionsForMove = FALSE; + checkedSelectionsForMove = false; checkSelectionsTimer->stop(); if ( !sizePreviewLabel ) { sizePreviewLabel = new TQLabel( this ); @@ -576,33 +576,33 @@ void FormWindow::handleMousePress( TQMouseEvent *e, TQWidget *w ) switch ( currTool ) { case POINTER_TOOL: - if ( !isMainContainer( TQT_TQOBJECT(w) ) && qstrcmp( w->name(), "central widget" ) != 0 ) { // press on a child widget + 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 ) w->raise(); if ( ( e->state() & ControlButton ) ) { // with control pressed, always start rubber band selection - drawRubber = TRUE; + drawRubber = true; currRect = TQRect( 0, 0, -1, -1 ); startRectDraw( mapFromGlobal( e->globalPos() ), e->globalPos(), this, Rubber ); break; } - bool sel = isWidgetSelected( TQT_TQOBJECT(w) ); + bool sel = isWidgetSelected( w ); if ( !( ( e->state() & ControlButton ) || ( e->state() & ShiftButton ) ) ) { // control not pressed... if ( !sel ) { // ...and widget no selectted: unselect all - clearSelection( FALSE ); + 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 ) { TQObjectList *l = w->queryList( "TQWidget" ); - setPropertyShowingBlocked( TRUE ); + setPropertyShowingBlocked( true ); for ( TQObject *o = l->first(); o; o = l->next() ) { if ( !o->isWidgetType() ) continue; if ( insertedWidgets.find( (TQWidget*)o ) ) - selectWidget( TQT_TQOBJECT(o), FALSE ); + selectWidget( o, false ); } - setPropertyShowingBlocked( FALSE ); + setPropertyShowingBlocked( false ); delete l; } } @@ -610,12 +610,12 @@ void FormWindow::handleMousePress( TQMouseEvent *e, TQWidget *w ) } if ( ( ( e->state() & ControlButton ) || ( e->state() & ShiftButton ) ) && sel && e->button() == TQt::LeftButton ) { // control pressed and selected, unselect widget - selectWidget( TQT_TQOBJECT(w), FALSE ); + selectWidget( w, false ); break; } raiseChildSelections( w ); // raise selections and select widget - selectWidget( TQT_TQOBJECT(w) ); + selectWidget( w ); // if widget is laid out, find the first non-laid out super-widget while ( w->parentWidget() && @@ -623,13 +623,13 @@ void FormWindow::handleMousePress( TQMouseEvent *e, TQWidget *w ) w = w->parentWidget(); if ( e->button() == TQt::LeftButton ) { // left button: store original geometry and more as the widget might start moving - widgetPressed = TRUE; + widgetPressed = true; widgetGeom = TQRect( w->pos(), w->size() ); oldPressPos = w->mapFromGlobal( e->globalPos() ); origPressPos = oldPressPos; - checkedSelectionsForMove = FALSE; + checkedSelectionsForMove = false; moving.clear(); - if ( w->parentWidget() && !isMainContainer( TQT_TQOBJECT(w->parentWidget()) ) && !isCentralWidget( TQT_TQOBJECT(w->parentWidget()) ) ) { + if ( w->parentWidget() && !isMainContainer( w->parentWidget() ) && !isCentralWidget( w->parentWidget() ) ) { targetContainer = w->parentWidget(); hadOwnPalette = w->parentWidget()->ownPalette(); restorePalette = w->parentWidget()->palette(); @@ -637,11 +637,11 @@ void FormWindow::handleMousePress( TQMouseEvent *e, TQWidget *w ) } } else { // press was on the formwindow if ( e->button() == TQt::LeftButton ) { // left button: start rubber selection and show formwindow properties - drawRubber = TRUE; + drawRubber = true; if ( !( ( e->state() & ControlButton ) || ( e->state() & ShiftButton ) ) ) { - clearSelection( FALSE ); + clearSelection( false ); TQObject *opw = propertyWidget; - propertyWidget = TQT_TQOBJECT(mainContainer()); + propertyWidget = mainContainer(); if ( opw->isWidgetType() ) repaintSelection( (TQWidget*)opw ); } @@ -654,12 +654,12 @@ void FormWindow::handleMousePress( TQMouseEvent *e, TQWidget *w ) case BUDDY_TOOL: if ( e->button() != TQt::LeftButton ) break; - validForBuddy = FALSE; + validForBuddy = false; if ( currTool == BUDDY_TOOL ) { if ( !::tqt_cast<TQLabel*>(w) ) break; - clearSelection( FALSE ); - validForBuddy = TRUE; + clearSelection( false ); + validForBuddy = true; mainWindow()->statusMessage( i18n( "Set buddy for '%1' to..." ).arg( w->name() ) ); } else { mainWindow()->statusMessage( i18n( "Connect '%1' with..." ).arg( w->name() ) ); @@ -667,13 +667,13 @@ void FormWindow::handleMousePress( TQMouseEvent *e, TQWidget *w ) saveBackground(); startPos = mapFromGlobal( e->globalPos() ); currentPos = startPos; - startWidget = designerWidget( TQT_TQOBJECT(w) ); + startWidget = designerWidget( w ); endWidget = startWidget; - beginUnclippedPainter( FALSE ); + beginUnclippedPainter( false ); drawConnectionLine(); break; case ORDER_TOOL: - if ( !isMainContainer( TQT_TQOBJECT(w) ) ) { // press on a child widget + if ( !isMainContainer( w ) ) { // press on a child widget orderedWidgets.removeRef( w ); orderedWidgets.append( w ); for ( TQWidget *wid = orderedWidgets.last(); wid; wid = orderedWidgets.prev() ) { @@ -686,17 +686,17 @@ void FormWindow::handleMousePress( TQMouseEvent *e, TQWidget *w ) TQWidgetList oldl = MetaDataBase::tabOrder( this ); TabOrderCommand *cmd = new TabOrderCommand( i18n( "Change Tab Order" ), this, oldl, stackedWidgets ); cmd->execute(); - commandHistory()->addCommand( cmd, TRUE ); + commandHistory()->addCommand( cmd, true ); updateOrderIndicators(); } break; default: // any insert widget tool if ( e->button() == TQt::LeftButton ) { insertParent = WidgetFactory::containerOfWidget( mainContainer() ); // default parent for new widget is the formwindow - if ( !isMainContainer( TQT_TQOBJECT(w) ) ) { // press was not on formwindow, check if we can find another parent + if ( !isMainContainer( w ) ) { // press was not on formwindow, check if we can find another parent TQWidget *wid = w; for (;;) { - int id = WidgetDatabase::idFromClassName( WidgetFactory::classNameOf( TQT_TQOBJECT(wid) ) ); + int id = WidgetDatabase::idFromClassName( WidgetFactory::classNameOf( wid ) ); if ( ( WidgetDatabase::isContainer( id ) || wid == mainContainer() ) && !::tqt_cast<TQLayoutWidget*>(wid) && !::tqt_cast<TQSplitter*>(wid) ) { insertParent = WidgetFactory::containerOfWidget( wid ); // found another parent, store it @@ -719,7 +719,7 @@ void FormWindow::handleMouseDblClick( TQMouseEvent *, TQWidget *w ) CHECK_MAINWINDOW; switch ( currTool ) { case ORDER_TOOL: - if ( !isMainContainer( TQT_TQOBJECT(w) ) ) { // press on a child widget + if ( !isMainContainer( w ) ) { // press on a child widget orderedWidgets.clear(); orderedWidgets.append( w ); for ( TQWidget *wid = orderedWidgets.last(); wid; wid = orderedWidgets.prev() ) { @@ -732,11 +732,11 @@ void FormWindow::handleMouseDblClick( TQMouseEvent *, TQWidget *w ) TQWidgetList oldl = MetaDataBase::tabOrder( this ); TabOrderCommand *cmd = new TabOrderCommand( i18n( "Change Tab Order" ), this, oldl, stackedWidgets ); cmd->execute(); - commandHistory()->addCommand( cmd, TRUE ); + commandHistory()->addCommand( cmd, true ); updateOrderIndicators(); } default: - if ( !WidgetFactory::isPassiveInteractor( TQT_TQOBJECT(w) ) && + if ( !WidgetFactory::isPassiveInteractor( w ) && ( isMainContainer( w ) || w == this ) ) mainWindow()->editSource(); break; @@ -799,10 +799,10 @@ 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( TQT_TQOBJECT(w) ) ) { // and unselect others. Only siblings can be moved at the same time - setPropertyShowingBlocked( TRUE ); - selectWidget( TQT_TQOBJECT(w) ); - setPropertyShowingBlocked( FALSE ); + if ( !isWidgetSelected( w ) ) { // and unselect others. Only siblings can be moved at the same time + setPropertyShowingBlocked( true ); + selectWidget( w ); + setPropertyShowingBlocked( false ); } checkSelectionsForMove( w ); } @@ -810,7 +810,7 @@ void FormWindow::handleMouseMove( TQMouseEvent *e, TQWidget *w ) // check whether we would have to reparent the selection and highlight the possible new parent container TQMapConstIterator<TQWidget*, TQPoint> it = moving.begin(); TQWidget* wa = containerAt( e->globalPos(), it.key() ); - if ( wa && !isMainContainer( TQT_TQOBJECT(wa) ) && !isCentralWidget( TQT_TQOBJECT(wa) ) ) { + if ( wa && !isMainContainer( wa ) && !isCentralWidget( wa ) ) { wa = WidgetFactory::containerOfWidget( wa ); // ok, looks like we moved onto a container @@ -845,7 +845,7 @@ void FormWindow::handleMouseMove( TQMouseEvent *e, TQWidget *w ) sizePreviewLabel->raise(); sizePreviewLabel->show(); #if defined(TQ_WS_WIN32) - windowsRepaintWorkaroundTimer->start( 100, TRUE ); + windowsRepaintWorkaroundTimer->start( 100, true ); #endif } else { // if we don't need to move, do some indication TQRect lg( mapFromGlobal( e->globalPos() ) + TQPoint( 16, 16 ), sizePreviewLabel->size() ); @@ -860,16 +860,16 @@ void FormWindow::handleMouseMove( TQMouseEvent *e, TQWidget *w ) break; case CONNECT_TOOL: restoreConnectionLine(); - wid = tqApp->widgetAt( e->globalPos(), TRUE ); + wid = tqApp->widgetAt( e->globalPos(), true ); if ( wid ) - wid = designerWidget( TQT_TQOBJECT(wid) ); - if ( wid && ( isMainContainer( TQT_TQOBJECT(wid) ) || insertedWidgets.find( wid ) ) && wid->isVisibleTo( this ) ) + wid = designerWidget( wid ); + if ( wid && ( isMainContainer( wid ) || insertedWidgets.find( wid ) ) && wid->isVisibleTo( this ) ) newendWidget = wid; if ( ::tqt_cast<TQLayoutWidget*>(newendWidget) || ::tqt_cast<Spacer*>(newendWidget) ) newendWidget = (TQWidget*)endWidget; drawRecRect = newendWidget != endWidget; if ( newendWidget && - ( isMainContainer( TQT_TQOBJECT(newendWidget) ) || insertedWidgets.find( newendWidget ) ) && !isCentralWidget( TQT_TQOBJECT(newendWidget) ) ) + ( isMainContainer( newendWidget ) || insertedWidgets.find( newendWidget ) ) && !isCentralWidget( newendWidget ) ) endWidget = newendWidget; mainWindow()->statusMessage( i18n( "Connect '%1' to '%2'" ).arg( startWidget->name() ). arg( endWidget->name() ) ); @@ -884,9 +884,9 @@ void FormWindow::handleMouseMove( TQMouseEvent *e, TQWidget *w ) if ( !validForBuddy ) break; restoreConnectionLine(); - wid = tqApp->widgetAt( e->globalPos(), TRUE ); + wid = tqApp->widgetAt( e->globalPos(), true ); if ( wid ) - wid = designerWidget( TQT_TQOBJECT(wid) ); + wid = designerWidget( wid ); if ( wid && canBeBuddy( wid ) && wid->isVisibleTo( this ) ) newendWidget = wid; else @@ -896,7 +896,7 @@ void FormWindow::handleMouseMove( TQMouseEvent *e, TQWidget *w ) drawRecRect = newendWidget != endWidget; if ( !newendWidget ) endWidget = newendWidget; - else if ( insertedWidgets.find( newendWidget ) && !isCentralWidget( TQT_TQOBJECT(newendWidget) ) ) + else if ( insertedWidgets.find( newendWidget ) && !isCentralWidget( newendWidget ) ) endWidget = newendWidget; if ( endWidget ) mainWindow()->statusMessage( i18n( "Set buddy '%1' to '%2'" ).arg( startWidget->name() ). @@ -974,28 +974,28 @@ void FormWindow::handleMouseRelease( TQMouseEvent *e, TQWidget *w ) } // doesn't need to be a command, the MoveCommand does reparenting too - bool emitSelChanged = FALSE; + bool emitSelChanged = false; for ( TQMap<TQWidget*, TQPoint>::Iterator it = moving.begin(); it != moving.end(); ++it ) { TQWidget *i = it.key(); if ( !emitSelChanged && ::tqt_cast<TQButton*>(i) ) { if ( ::tqt_cast<TQButtonGroup*>(i->parentWidget()) || ::tqt_cast<TQButtonGroup*>(wa) ) - emitSelChanged = TRUE; + emitSelChanged = true; if ( !::tqt_cast<TQButtonGroup*>(wa) ) { - MetaDataBase::setPropertyChanged( TQT_TQOBJECT(i), "buttonGroupId", FALSE ); + MetaDataBase::setPropertyChanged( i, "buttonGroupId", false ); if ( ::tqt_cast<TQButtonGroup*>(i->parentWidget()) ) ( (TQButtonGroup*)i->parentWidget() )->remove( (TQButton*)i ); } } TQPoint pos = wa->mapFromGlobal( i->mapToGlobal( TQPoint(0,0) ) ); - i->reparent( wa, pos, TRUE ); + i->reparent( wa, pos, true ); raiseSelection( i ); raiseChildSelections( i ); - widgetChanged( TQT_TQOBJECT(i) ); + widgetChanged( i ); mainWindow()->objectHierarchy()->widgetRemoved( i ); mainWindow()->objectHierarchy()->widgetInserted( i ); } if ( emitSelChanged ) { - emit showProperties( TQT_TQOBJECT(wa) ); + emit showProperties( wa ); emit showProperties( propertyWidget ); } newParent = wa; @@ -1015,9 +1015,9 @@ void FormWindow::handleMouseRelease( TQMouseEvent *e, TQWidget *w ) oldPos, newPos, oldParent, newParent ) ); } else if ( drawRubber ) { // we were drawing a rubber selection endRectDraw(); // get rid of the rectangle - blockSignals( TRUE ); + blockSignals( true ); selectWidgets(); // select widgets which intersect the rect - blockSignals( FALSE ); + blockSignals( false ); emitSelectionChanged(); // inform about selection changes if ( propertyWidget ) emitShowProperties( propertyWidget ); @@ -1045,13 +1045,13 @@ void FormWindow::handleMouseRelease( TQMouseEvent *e, TQWidget *w ) if ( oldBuddy.isNull() ) oldBuddy = ""; SetPropertyCommand *cmd = new SetPropertyCommand( i18n( "Set Buddy for %1" ).arg( startWidget->name() ), - this, TQT_TQOBJECT(startWidget), mainWindow()->propertyeditor(), + this, startWidget, mainWindow()->propertyeditor(), "buddy", startWidget->property( "buddy" ), endWidget->name(), endWidget->name(), oldBuddy ); - commandHistory()->addCommand( cmd, TRUE ); + commandHistory()->addCommand( cmd, true ); cmd->execute(); - emitUpdateProperties( TQT_TQOBJECT(startWidget) ); + emitUpdateProperties( startWidget ); } } if ( !toolFixed ) @@ -1085,8 +1085,8 @@ void FormWindow::handleMouseRelease( TQMouseEvent *e, TQWidget *w ) } break; } - widgetPressed = FALSE; - drawRubber = FALSE; + widgetPressed = false; + drawRubber = false; insertParent = 0; delete buffer; buffer = 0; @@ -1104,7 +1104,7 @@ void FormWindow::handleKeyPress( TQKeyEvent *e, TQWidget *w ) e->key() == Key_Down ) && propertyWidget->isWidgetType() ) checkSelectionsForMove( (TQWidget*)propertyWidget ); - checkSelectionsTimer->start( 1000, TRUE ); + checkSelectionsTimer->start( 1000, true ); if ( e->key() == Key_Left || e->key() == Key_Right || e->key() == Key_Up || e->key() == Key_Down ) { TQWidgetList widgets; @@ -1155,7 +1155,7 @@ void FormWindow::handleKeyPress( TQKeyEvent *e, TQWidget *w ) if ( !widgets.isEmpty() ) { MoveCommand *cmd = new MoveCommand( i18n( "Move" ), this, widgets, oldPos, newPos, 0, 0 ); - commandHistory()->addCommand( cmd, TRUE ); + commandHistory()->addCommand( cmd, true ); cmd->execute(); } } @@ -1163,7 +1163,7 @@ void FormWindow::handleKeyPress( TQKeyEvent *e, TQWidget *w ) TQObjectList *l = queryList( "TQWidget" ); if ( !l ) return; - if ( l->find( TQT_TQOBJECT(w) ) != -1 ) + if ( l->find( w ) != -1 ) e->accept(); delete l; } @@ -1185,9 +1185,9 @@ void FormWindow::selectWidget( TQObject *o, bool select ) TQWidget *w = (TQWidget*)o; - if ( isMainContainer( TQT_TQOBJECT(w) ) ) { + if ( isMainContainer( w ) ) { TQObject *opw = propertyWidget; - propertyWidget = TQT_TQOBJECT(mainContainer()); + propertyWidget = mainContainer(); if ( opw->isWidgetType() ) repaintSelection( (TQWidget*)opw ); emitShowProperties( propertyWidget ); @@ -1196,7 +1196,7 @@ void FormWindow::selectWidget( TQObject *o, bool select ) if ( ::tqt_cast<TQMainWindow*>(mainContainer()) && w == ( (TQMainWindow*)mainContainer() )->centralWidget() ) { TQObject *opw = propertyWidget; - propertyWidget = TQT_TQOBJECT(mainContainer()); + propertyWidget = mainContainer(); if ( opw->isWidgetType() ) repaintSelection( (TQWidget*)opw ); emitShowProperties( propertyWidget ); @@ -1208,7 +1208,7 @@ void FormWindow::selectWidget( TQObject *o, bool select ) if ( select ) { TQObject *opw = propertyWidget; - propertyWidget = TQT_TQOBJECT(w); + propertyWidget = w; if ( opw->isWidgetType() ) repaintSelection( (TQWidget*)opw ); if ( !isPropertyShowingBlocked() ) @@ -1238,9 +1238,9 @@ void FormWindow::selectWidget( TQObject *o, bool select ) s->setWidget( 0 ); TQObject *opw = propertyWidget; if ( !usedSelections.isEmpty() ) - propertyWidget = TQT_TQOBJECT(TQPtrDictIterator<WidgetSelection>( usedSelections ).current()->widget()); + propertyWidget = TQPtrDictIterator<WidgetSelection>( usedSelections ).current()->widget(); else - propertyWidget = TQT_TQOBJECT(mainContainer()); + propertyWidget = mainContainer(); if ( opw->isWidgetType() ) repaintSelection( (TQWidget*)opw ); if ( !isPropertyShowingBlocked() ) @@ -1260,7 +1260,7 @@ void FormWindow::updateSelection( TQWidget *w ) { WidgetSelection *s = usedSelections.find( w ); if ( !w->isVisibleTo( this ) ) - selectWidget( TQT_TQOBJECT(w), FALSE ); + selectWidget( w, false ); else if ( s ) s->updateGeometry(); } @@ -1283,12 +1283,12 @@ void FormWindow::clearSelection( bool changePropertyDisplay ) { TQPtrDictIterator<WidgetSelection> it( usedSelections ); for ( ; it.current(); ++it ) - it.current()->setWidget( 0, FALSE ); + it.current()->setWidget( 0, false ); usedSelections.clear(); if ( changePropertyDisplay ) { TQObject *opw = propertyWidget; - propertyWidget = TQT_TQOBJECT(mainContainer()); + propertyWidget = mainContainer(); if ( opw->isWidgetType() ) repaintSelection( (TQWidget*)opw ); emitShowProperties( propertyWidget ); @@ -1300,8 +1300,8 @@ void FormWindow::startRectDraw( const TQPoint &p, const TQPoint &global, TQWidge { TQPoint pos( p ); pos = mapFromGlobal( global ); - oldRectValid = FALSE; - beginUnclippedPainter( TRUE ); + oldRectValid = false; + beginUnclippedPainter( true ); if ( t == Rubber ) unclippedPainter->setPen( TQPen( color0, 1 ) ); if ( t == Insert ) @@ -1335,7 +1335,7 @@ void FormWindow::continueRectDraw( const TQPoint &p, const TQPoint &global, TQWi if ( oldRectValid ) unclippedPainter->drawRect( currRect ); if ( r.width() > 1 || r.height() > 1 ) { - oldRectValid = TRUE; + oldRectValid = true; currRect = r; if ( t == Insert ) { TQString t = i18n( "%1/%2" ); @@ -1344,9 +1344,9 @@ void FormWindow::continueRectDraw( const TQPoint &p, const TQPoint &global, TQWi } unclippedPainter->setClipRegion( TQRegion( rect() ).subtract( TQRect( sizePreviewPos, sizePreviewPixmap.size() ) ) ); unclippedPainter->drawRect( currRect ); - unclippedPainter->setClipping( FALSE ); + unclippedPainter->setClipping( false ); } else { - oldRectValid = FALSE; + oldRectValid = false; if ( t == Insert ) drawSizePreview( pos, i18n("Use Size Hint") ); } @@ -1374,7 +1374,7 @@ void FormWindow::selectWidgets() p = mapFromGlobal( p ); TQRect r( p, ( (TQWidget*)o )->size() ); if ( r.intersects( currRect ) && !r.contains( currRect ) ) - selectWidget( TQT_TQOBJECT(o) ); + selectWidget( o ); } } delete l; @@ -1386,7 +1386,7 @@ bool FormWindow::isWidgetSelected( TQObject *w ) { if ( w->isWidgetType() ) return usedSelections.find( (TQWidget*)w ) != 0; - return FALSE; // #### do stuff for TQObjects + return false; // #### do stuff for TQObjects } void FormWindow::moveSelectedWidgets( int dx, int dy ) @@ -1428,7 +1428,7 @@ void FormWindow::raiseChildSelections( TQWidget *w ) TQPtrDictIterator<WidgetSelection> it( usedSelections ); for ( ; it.current(); ++it ) { - if ( l->findRef( TQT_TQOBJECT(it.current()->widget()) ) != -1 ) + if ( l->findRef( it.current()->widget() ) != -1 ) it.current()->show(); } delete l; @@ -1449,9 +1449,9 @@ void FormWindow::updateChildSelections( TQWidget *w ) void FormWindow::checkSelectionsForMove( TQWidget *w ) { - checkedSelectionsForMove = TRUE; + checkedSelectionsForMove = true; - TQObjectList *l = w->parentWidget()->queryList( "TQWidget", 0, FALSE, FALSE ); + TQObjectList *l = w->parentWidget()->queryList( "TQWidget", 0, false, false ); moving.clear(); if ( l ) { TQPtrDictIterator<WidgetSelection> it( usedSelections ); @@ -1460,7 +1460,7 @@ void FormWindow::checkSelectionsForMove( TQWidget *w ) if ( it.current()->widget() == mainContainer() ) continue; ++it; - if ( l->find( TQT_TQOBJECT(sel->widget()) ) == -1 ) { + if ( l->find( sel->widget() ) == -1 ) { if ( WidgetFactory::layoutType( w ) == WidgetFactory::NoLayout ) sel->setWidget( 0 ); } else { @@ -1483,7 +1483,7 @@ void FormWindow::deleteWidgets() TQPtrDictIterator<WidgetSelection> it( usedSelections ); for ( ; it.current(); ++it ) { TQWidget *tb = 0; - if ( !( tb = mainWindow()->isAToolBarChild( TQT_TQOBJECT(it.current()->widget()) ) ) ) + if ( !( tb = mainWindow()->isAToolBarChild( it.current()->widget() ) ) ) widgets.append( it.current()->widget() ); else ( (QDesignerToolBar*)tb )->removeWidget( it.current()->widget() ); @@ -1564,7 +1564,7 @@ TQLabel *FormWindow::sizePreview() const void FormWindow::invalidCheckedSelections() { - checkedSelectionsForMove = FALSE; + checkedSelectionsForMove = false; } void FormWindow::checkPreviewGeometry( TQRect &r ) @@ -1591,7 +1591,7 @@ void FormWindow::focusOutEvent( TQFocusEvent * ) { if ( propertyWidget && !isMainContainer( propertyWidget ) && !isWidgetSelected( propertyWidget ) ) { TQObject *opw = propertyWidget; - propertyWidget = TQT_TQOBJECT(mainContainer()); + propertyWidget = mainContainer(); if ( opw->isWidgetType() ) repaintSelection( (TQWidget*)opw ); } @@ -1603,10 +1603,10 @@ void FormWindow::resizeEvent( TQResizeEvent *e ) if ( currTool == ORDER_TOOL ) repositionOrderIndicators(); if ( isVisible() ) - formFile()->setModified( TRUE, FormFile::WFormWindow ); + formFile()->setModified( true, FormFile::WFormWindow ); #if defined(TQ_WS_WIN32) - windowsRepaintWorkaroundTimer->start( 100, TRUE ); + windowsRepaintWorkaroundTimer->start( 100, true ); #endif } @@ -1632,7 +1632,7 @@ TQWidget *FormWindow::designerWidget( TQObject *o ) const if ( !o || !o->isWidgetType() ) return 0; TQWidget *w = (TQWidget*)o; - while ( w && !isMainContainer( TQT_TQOBJECT(w) ) && !insertedWidgets[ (void*)w ] || isCentralWidget( TQT_TQOBJECT(w) ) ) + while ( w && !isMainContainer( w ) && !insertedWidgets[ (void*)w ] || isCentralWidget( w ) ) w = (TQWidget*)w->parent(); return w; } @@ -1646,7 +1646,7 @@ void FormWindow::emitShowProperties( TQObject *w ) repaintSelection( (TQWidget*)opw ); } showPropertiesTimer->stop(); -// showPropertiesTimer->start( 0, TRUE ); +// showPropertiesTimer->start( 0, true ); showPropertiesTimerDone(); } @@ -1654,14 +1654,14 @@ void FormWindow::emitUpdateProperties( TQObject *w ) { if ( w == propertyWidget ) { updatePropertiesTimer->stop(); - updatePropertiesTimer->start( 0, TRUE ); + updatePropertiesTimer->start( 0, true ); } } void FormWindow::emitSelectionChanged() { selectionChangedTimer->stop(); - selectionChangedTimer->start( 0, TRUE ); + selectionChangedTimer->start( 0, true ); } void FormWindow::updatePropertiesTimerDone() @@ -1686,7 +1686,7 @@ void FormWindow::selectionChangedTimerDone() void FormWindow::currentToolChanged() { CHECK_MAINWINDOW; - toolFixed = FALSE; + toolFixed = false; int t = mainwindow->currentTool(); if ( currTool == t && t != ORDER_TOOL ) return; @@ -1718,8 +1718,8 @@ void FormWindow::currentToolChanged() } startWidget = endWidget = 0; - widgetPressed = FALSE; - drawRubber = FALSE; + widgetPressed = false; + drawRubber = false; insertParent = 0; delete buffer; buffer = 0; @@ -1727,7 +1727,7 @@ void FormWindow::currentToolChanged() currTool = t; if ( hasFocus() ) - clearSelection( FALSE ); + clearSelection( false ); mainWindow()->statusBar()->clear(); @@ -1735,7 +1735,7 @@ void FormWindow::currentToolChanged() switch ( currTool ) { case POINTER_TOOL: if ( propertyWidget && !isMainContainer( propertyWidget ) && !isWidgetSelected( propertyWidget ) ) - emitShowProperties( TQT_TQOBJECT(mainContainer()) ); + emitShowProperties( mainContainer() ); restoreCursors( this, this ); break; case ORDER_TOOL: @@ -1744,7 +1744,7 @@ void FormWindow::currentToolChanged() orderedWidgets.clear(); showOrderIndicators(); if ( mainWindow()->formWindow() == this ) - emitShowProperties( TQT_TQOBJECT(mainContainer()) ); + emitShowProperties( 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( TQT_TQOBJECT(mainContainer()) ); + emitShowProperties( mainContainer() ); break; default: mainWindow()->statusMessage( i18n( "Click on the form to insert a %1..." ).arg( WidgetDatabase::toolTip( currTool ).lower() ) ); setCursorToAll( CrossCursor, this ); if ( mainWindow()->formWindow() == this ) - emitShowProperties( TQT_TQOBJECT(mainContainer()) ); + emitShowProperties( mainContainer() ); break; } } @@ -1770,7 +1770,7 @@ void FormWindow::currentToolChanged() void FormWindow::showOrderIndicators() { hideOrderIndicators(); - orderIndicators.setAutoDelete( TRUE ); + orderIndicators.setAutoDelete( true ); TQObjectList *l = mainContainer()->queryList( "TQWidget" ); stackedWidgets = MetaDataBase::tabOrder( this ); if ( l ) { @@ -1824,7 +1824,7 @@ bool FormWindow::checkCustomWidgets() TQPtrDictIterator<TQWidget> it( insertedWidgets ); for ( ; it.current(); ++it ) { if ( it.current()->isA( "CustomWidget" ) ) { - TQString className = WidgetFactory::classNameOf( TQT_TQOBJECT(it.current()) ); + TQString className = WidgetFactory::classNameOf( it.current() ); if ( !MetaDataBase::hasCustomWidget( className ) ) missingCustomWidgets << className; } @@ -1839,9 +1839,9 @@ bool FormWindow::checkCustomWidgets() "the generated code will not compile.\n" "Do you want to save this form now?" ); if ( TQMessageBox::information( mainWindow(), i18n( "Save Form" ), txt ) == 1 ) - return FALSE; + return false; } - return TRUE; + return true; } void FormWindow::setPropertyShowingBlocked( bool b ) @@ -1910,11 +1910,11 @@ void FormWindow::checkAccels() insertedWidgets[ (void*)o ] ) { TQWidget *w = (TQWidget*)o; const TQMetaProperty* text = - w->metaObject()->property( w->metaObject()->findProperty( "text", TRUE ), TRUE ); + w->metaObject()->property( w->metaObject()->findProperty( "text", true ), true ); const TQMetaProperty* title = - w->metaObject()->property( w->metaObject()->findProperty( "title", TRUE ), TRUE ); + w->metaObject()->property( w->metaObject()->findProperty( "title", true ), true ); const TQMetaProperty* pageTitle = - w->metaObject()->property( w->metaObject()->findProperty( "pageTitle", TRUE ), TRUE ); + w->metaObject()->property( w->metaObject()->findProperty( "pageTitle", true ), true ); if ( text ) find_accel( w->property( "text" ).toString(), accels, w ); if ( title ) @@ -1928,20 +1928,20 @@ void FormWindow::checkAccels() delete l; } - bool ok = TRUE; + bool ok = true; TQWidget *wid; for ( TQMap<TQChar, TQWidgetList >::Iterator it = accels.begin(); it != accels.end(); ++it ) { if ( (*it).count() > 1 ) { - ok = FALSE; + 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() ), i18n( "&Select" ), i18n( "&Cancel" ), TQString(), 2 ) ) { case 0: // select - clearSelection( FALSE ); + clearSelection( false ); for ( wid = (*it).first(); wid; wid = (*it).next() ) - selectWidget( TQT_TQOBJECT(wid), TRUE ); + selectWidget( wid, true ); return; case 1: // cancel return; @@ -1976,20 +1976,20 @@ void FormWindow::paste( const TQString &cb, TQWidget *parent ) void FormWindow::selectAll() { - checkedSelectionsForMove = FALSE; - blockSignals( TRUE ); + checkedSelectionsForMove = false; + blockSignals( true ); TQObjectList *l = mainContainer()->queryList( "TQWidget" ); if ( l ) { for ( TQObject *o = l->first(); o; o = l->next() ) { if ( ( (TQWidget*)o )->isVisibleTo( this ) && insertedWidgets[ (void*)o ] ) { - selectWidget( TQT_TQOBJECT(o) ); + selectWidget( o ); } } delete l; } - blockSignals( FALSE ); + blockSignals( false ); emitSelectionChanged(); if ( propertyWidget ) emitShowProperties( propertyWidget ); @@ -2001,7 +2001,7 @@ void FormWindow::layoutHorizontal() TQWidgetList widgets( selectedWidgets() ); LayoutHorizontalCommand *cmd = new LayoutHorizontalCommand( i18n( "Lay Out Horizontally" ), this, mainContainer(), 0, widgets ); - clearSelection( FALSE ); + clearSelection( false ); commandHistory()->addCommand( cmd ); cmd->execute(); } @@ -2011,7 +2011,7 @@ void FormWindow::layoutVertical() TQWidgetList widgets( selectedWidgets() ); LayoutVerticalCommand *cmd = new LayoutVerticalCommand( i18n( "Lay Out Vertically" ), this, mainContainer(), 0, widgets ); - clearSelection( FALSE ); + clearSelection( false ); commandHistory()->addCommand( cmd ); cmd->execute(); } @@ -2021,7 +2021,7 @@ void FormWindow::layoutHorizontalSplit() TQWidgetList widgets( selectedWidgets() ); LayoutHorizontalSplitCommand *cmd = new LayoutHorizontalSplitCommand( i18n( "Lay Out Horizontally (in splitter)" ), this, mainContainer(), 0, widgets ); - clearSelection( FALSE ); + clearSelection( false ); commandHistory()->addCommand( cmd ); cmd->execute(); } @@ -2031,7 +2031,7 @@ void FormWindow::layoutVerticalSplit() TQWidgetList widgets( selectedWidgets() ); LayoutVerticalSplitCommand *cmd = new LayoutVerticalSplitCommand( i18n( "Lay Out Vertically (in splitter)" ), this, mainContainer(), 0, widgets ); - clearSelection( FALSE ); + clearSelection( false ); commandHistory()->addCommand( cmd ); cmd->execute(); } @@ -2044,7 +2044,7 @@ void FormWindow::layoutGrid() TQWidgetList widgets( selectedWidgets() ); LayoutGridCommand *cmd = new LayoutGridCommand( i18n( "Lay Out in a Grid" ), this, mainContainer(), 0, widgets, xres, yres ); - clearSelection( FALSE ); + clearSelection( false ); commandHistory()->addCommand( cmd ); cmd->execute(); } @@ -2065,7 +2065,7 @@ void FormWindow::layoutHorizontalContainer( TQWidget *w ) } LayoutHorizontalCommand *cmd = new LayoutHorizontalCommand( i18n( "Lay Out Children Horizontally" ), this, mainContainer(), w, widgets ); - clearSelection( FALSE ); + clearSelection( false ); commandHistory()->addCommand( cmd ); cmd->execute(); } @@ -2086,7 +2086,7 @@ void FormWindow::layoutVerticalContainer( TQWidget *w ) } LayoutVerticalCommand *cmd = new LayoutVerticalCommand( i18n( "Lay Out Children Vertically" ), this, mainContainer(), w, widgets ); - clearSelection( FALSE ); + clearSelection( false ); commandHistory()->addCommand( cmd ); cmd->execute(); } @@ -2110,7 +2110,7 @@ void FormWindow::layoutGridContainer( TQWidget *w ) } LayoutGridCommand *cmd = new LayoutGridCommand( i18n( "Lay Out Children in a Grid" ), this, mainContainer(), w, widgets, xres, yres ); - clearSelection( FALSE ); + clearSelection( false ); commandHistory()->addCommand( cmd ); cmd->execute(); } @@ -2126,7 +2126,7 @@ void FormWindow::breakLayout( TQWidget *w ) if ( !w || w == this ) break; if ( WidgetFactory::layoutType( w ) != WidgetFactory::NoLayout && - WidgetDatabase::isContainer( WidgetDatabase::idFromClassName( WidgetFactory::classNameOf( TQT_TQOBJECT(w) ) ) ) ) { + WidgetDatabase::isContainer( WidgetDatabase::idFromClassName( WidgetFactory::classNameOf( w ) ) ) ) { Command *cmd = breakLayoutCommand( w ); if ( cmd ) commands.insert( 0, cmd ); @@ -2139,7 +2139,7 @@ void FormWindow::breakLayout( TQWidget *w ) if ( commands.isEmpty() ) return; - clearSelection( FALSE ); + clearSelection( false ); MacroCommand *cmd = new MacroCommand( i18n( "Break Layout" ), this, commands ); commandHistory()->addCommand( cmd ); cmd->execute(); @@ -2155,7 +2155,7 @@ BreakLayoutCommand *FormWindow::breakLayoutCommand( TQWidget *w ) TQWidgetList widgets; for ( TQObject *o = l.first(); o; o = l.next() ) { if ( o->isWidgetType() && - !mainWindow()->isAToolBarChild( TQT_TQOBJECT(o) ) && + !mainWindow()->isAToolBarChild( o ) && ( (TQWidget*)o )->isVisibleTo( this ) && insertedWidgets.find( (TQWidget*)o ) ) widgets.append( (TQWidget*)o ); @@ -2177,14 +2177,14 @@ int FormWindow::numVisibleWidgets() const bool FormWindow::hasInsertedChildren( TQWidget *w ) const { if ( !w ) - return FALSE; + return false; w = WidgetFactory::containerOfWidget( w ); if ( !w ) - return FALSE; + return false; TQObjectList *l = w->queryList( "TQWidget" ); if ( !l || !l->first() ) { delete l; - return FALSE; + return false; } for ( TQObject *o = l->first(); o; o = l->next() ) { @@ -2192,23 +2192,23 @@ bool FormWindow::hasInsertedChildren( TQWidget *w ) const ( (TQWidget*)o )->isVisibleTo( (FormWindow*)this ) && insertedWidgets.find( (TQWidget*)o ) ) { delete l; - return TRUE; + return true; } } delete l; - return FALSE; + return false; } bool FormWindow::allowMove( TQWidget *w ) { w = w->parentWidget(); while ( w ) { - if ( ( isMainContainer( TQT_TQOBJECT(w) ) || insertedWidgets.find( w ) ) && WidgetFactory::layoutType( w ) == WidgetFactory::NoLayout ) - return TRUE; + if ( ( isMainContainer( w ) || insertedWidgets.find( w ) ) && WidgetFactory::layoutType( w ) == WidgetFactory::NoLayout ) + return true; w = w->parentWidget(); } - return FALSE; + return false; } @@ -2221,8 +2221,8 @@ void FormWindow::editConnections() ConnectionDialog dlg( mainwindow ); mainWindow()->statusMessage( i18n( "Edit connections...") ); - dlg.addConnection( TQT_TQOBJECT(startWidget), TQT_TQOBJECT(endWidget), TQString(), TQString() ); - TQTimer::singleShot( 0, &dlg, TQT_SLOT(ensureConnectionVisible()) ); + dlg.addConnection( startWidget, endWidget, TQString(), TQString() ); + TQTimer::singleShot( 0, &dlg, TQ_SLOT(ensureConnectionVisible()) ); dlg.exec(); } @@ -2363,7 +2363,7 @@ bool FormWindow::unify( TQObject *w, TQString &s, bool changeIt ) for ( ; it.current();) { if ( it.current() != w && qstrcmp( it.current()->name(), s.latin1() ) == 0 ) { - found = TRUE; + found = true; if ( !changeIt ) break; s = orig + "_" + TQString::number( ++num ); @@ -2385,7 +2385,7 @@ bool FormWindow::unify( TQObject *w, TQString &s, bool changeIt ) for ( a = al.first(); a; a = al.next() ) { if ( a != w && qstrcmp( a->name(), s.latin1() ) == 0 ) { - found = TRUE; + found = true; if ( !changeIt ) break; s = orig + "_" + TQString::number( ++num ); @@ -2398,7 +2398,7 @@ bool FormWindow::unify( TQObject *w, TQString &s, bool changeIt ) for ( TQObject *o = l->first(); o; o = l->next() ) { if ( o != w && qstrcmp ( o->name(), s.latin1() ) == 0 ) { - found = TRUE; + found = true; if ( !changeIt ) break; s = orig + "_" + TQString::number( ++num ); @@ -2409,11 +2409,11 @@ bool FormWindow::unify( TQObject *w, TQString &s, bool changeIt ) } if ( ::tqt_cast<TQMainWindow*>(mainContainer()) ) { if ( !found ) { - TQObjectList *l = mainContainer()->queryList( "TQDockWindow", 0, TRUE ); + 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; + found = true; if ( !changeIt ) break; s = orig + "_" + TQString::number( ++num ); @@ -2426,8 +2426,8 @@ bool FormWindow::unify( TQObject *w, TQString &s, bool changeIt ) } if ( !found ) - return TRUE; - return FALSE; + return true; + return false; } bool FormWindow::isCustomWidgetUsed( MetaDataBase::CustomWidget *w ) @@ -2435,12 +2435,12 @@ bool FormWindow::isCustomWidgetUsed( MetaDataBase::CustomWidget *w ) TQPtrDictIterator<TQWidget> it( insertedWidgets ); for ( ; it.current(); ++it ) { if ( it.current()->isA( "CustomWidget" ) ) { - if ( qstrcmp( WidgetFactory::classNameOf( TQT_TQOBJECT(it.current()) ), w->className.utf8() ) == 0 ) - return TRUE; + if ( qstrcmp( WidgetFactory::classNameOf( it.current() ), w->className.utf8() ) == 0 ) + return true; } } - return FALSE; + return false; } bool FormWindow::isDatabaseWidgetUsed() const @@ -2452,28 +2452,28 @@ bool FormWindow::isDatabaseWidgetUsed() const for ( ; it.current(); ++it ) { TQString c( it.current()->className() ); if ( dbClasses.contains( c ) > 0 ) { - return TRUE; + return true; } } #endif - return FALSE; + return false; } bool FormWindow::isDatabaseAware() const { #ifndef TQT_NO_SQL if ( TQString(mContainer->className()) == "QDesignerDataBrowser" || TQString(mContainer->className()) == "QDesignerDataView" ) - return TRUE; + return true; return isDatabaseWidgetUsed(); #else - return FALSE; + return false; #endif } void FormWindow::visibilityChanged() { if ( currTool != ORDER_TOOL ) { - emitUpdateProperties( TQT_TQOBJECT(currentWidget()) ); + emitUpdateProperties( currentWidget() ); } else { updateOrderIndicators(); repositionOrderIndicators(); @@ -2491,7 +2491,7 @@ TQPoint FormWindow::mapToForm( const TQWidget* w, const TQPoint& pos ) const { TQPoint p = pos; const TQWidget* i = w; - while ( i && !i->isTopLevel() && !isMainContainer( TQT_TQOBJECT(const_cast<TQWidget*>(i)) ) ) { + while ( i && !i->isTopLevel() && !isMainContainer( const_cast<TQWidget*>(i) ) ) { p = i->mapToParent( p ); i = i->parentWidget(); } @@ -2513,10 +2513,10 @@ static bool isChildOf( TQWidget *c, TQWidget *p ) { while ( c && !c->isTopLevel() ) { if ( c == p ) - return TRUE; + return true; c = c->parentWidget(); } - return FALSE; + return false; } TQWidget *FormWindow::containerAt( const TQPoint &pos, TQWidget *notParentOf ) @@ -2538,7 +2538,7 @@ TQWidget *FormWindow::containerAt( const TQPoint &pos, TQWidget *notParentOf ) continue; if ( selected.find( it.current() ) != -1 ) continue; - if ( !WidgetDatabase::isContainer( WidgetDatabase::idFromClassName( WidgetFactory::classNameOf( TQT_TQOBJECT(it.current()) ) ) ) && + if ( !WidgetDatabase::isContainer( WidgetDatabase::idFromClassName( WidgetFactory::classNameOf( it.current() ) ) ) && it.current() != mainContainer() ) continue; @@ -2553,8 +2553,8 @@ TQWidget *FormWindow::containerAt( const TQPoint &pos, TQWidget *notParentOf ) int wd = widgetDepth( it.current() ); if ( wd == depth && container ) { - if ( ( it.current()->parentWidget()->childrenListObject() ).find( TQT_TQOBJECT(it.current()) ) > - ( container->parentWidget()->childrenListObject() ).find( TQT_TQOBJECT(container) ) ) + if ( ( it.current()->parentWidget()->childrenListObject() ).find( it.current() ) > + ( container->parentWidget()->childrenListObject() ).find( container ) ) wd++; } if ( wd > depth && !isChildOf( it.current(), notParentOf ) ) { @@ -2586,24 +2586,24 @@ void FormWindow::setMainContainer( TQWidget *w ) l->addWidget( w ); if ( resetPropertyWidget ) { TQObject *opw = propertyWidget; - propertyWidget = TQT_TQOBJECT(mContainer); + propertyWidget = mContainer; if ( opw && opw->isWidgetType() ) repaintSelection( (TQWidget*)opw ); } if ( project() ) { LanguageInterface *iface = MetaDataBase::languageInterface( project()->language() ); if ( iface && !project()->isCpp() && !isFake() ) { - if ( !MetaDataBase::hasFunction( TQT_TQOBJECT(this), "init()" ) ) - MetaDataBase::addFunction( TQT_TQOBJECT(this), "init()", "", "private", "function", + if ( !MetaDataBase::hasFunction( this, "init()" ) ) + MetaDataBase::addFunction( this, "init()", "", "private", "function", project()->language(), "void" ); - if ( !MetaDataBase::hasFunction( TQT_TQOBJECT(this), "destroy()" ) ) - MetaDataBase::addFunction( TQT_TQOBJECT(this), "destroy()", "", "private", "function", + if ( !MetaDataBase::hasFunction( this, "destroy()" ) ) + MetaDataBase::addFunction( this, "destroy()", "", "private", "function", project()->language(), "void" ); - 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" ); + 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" ); } } } @@ -2627,14 +2627,14 @@ void FormWindow::setSavePixmapInline( bool b ) { pixInline = b; if ( b ) - pixProject = FALSE; + pixProject = false; } void FormWindow::setSavePixmapInProject( bool b ) { pixProject = b; if ( b ) - pixInline = FALSE; + pixInline = false; } void FormWindow::setPixmapLoaderFunction( const TQString &func ) @@ -2676,7 +2676,7 @@ void FormWindow::killAccels( TQObject *top ) if ( !l ) return; for ( TQObject *o = l->first(); o; o = l->next() ) - ( (TQAccel*)o )->setEnabled( FALSE ); + ( (TQAccel*)o )->setEnabled( false ); delete l; } @@ -2690,7 +2690,7 @@ DesignerFormWindow *FormWindow::iFace() bool FormWindow::isCentralWidget( TQObject *w ) const { if ( !::tqt_cast<TQMainWindow*>(mainContainer()) ) - return FALSE; + return false; return w == ((TQMainWindow*)mainContainer())->centralWidget(); } @@ -2753,7 +2753,7 @@ void FormWindow::setFormFile( FormFile *f ) { ff = f; if ( ff ) - connect( this, TQT_SIGNAL( modificationChanged(bool, const TQString&) ), ff, TQT_SLOT( formWindowChangedSomehow() ) ); + connect( this, TQ_SIGNAL( modificationChanged(bool, const TQString&) ), ff, TQ_SLOT( formWindowChangedSomehow() ) ); } bool FormWindow::canBeBuddy( const TQWidget *w ) const |