diff options
Diffstat (limited to 'kdevdesigner')
25 files changed, 259 insertions, 259 deletions
diff --git a/kdevdesigner/designer/actiondnd.cpp b/kdevdesigner/designer/actiondnd.cpp index df158288..51593ca0 100644 --- a/kdevdesigner/designer/actiondnd.cpp +++ b/kdevdesigner/designer/actiondnd.cpp @@ -155,7 +155,7 @@ void QDesignerToolBarSeparator::styleChange( TQStyle& ) TQSize QDesignerToolBarSeparator::sizeHint() const { - int extent = tqstyle().pixelMetric( TQStyle::PM_DockWindowSeparatorExtent, + int extent = style().pixelMetric( TQStyle::PM_DockWindowSeparatorExtent, this ); if ( orient ==Qt::Horizontal ) return TQSize( extent, 0 ); @@ -171,7 +171,7 @@ void QDesignerToolBarSeparator::paintEvent( TQPaintEvent * ) if ( orientation() ==Qt::Horizontal ) flags |= TQStyle::Style_Horizontal; - tqstyle().tqdrawPrimitive( TQStyle::PE_DockWindowSeparator, &p, rect(), + style().tqdrawPrimitive( TQStyle::PE_DockWindowSeparator, &p, rect(), colorGroup(), flags ); } diff --git a/kdevdesigner/designer/command.cpp b/kdevdesigner/designer/command.cpp index 95f9e68a..a4a13428 100644 --- a/kdevdesigner/designer/command.cpp +++ b/kdevdesigner/designer/command.cpp @@ -674,21 +674,21 @@ void SetPropertyCommand::setProperty( const TQVariant &v, const TQString ¤ LayoutHorizontalCommand::LayoutHorizontalCommand( const TQString &n, FormWindow *fw, TQWidget *parent, TQWidget *layoutBase, const TQWidgetList &wl ) - : Command( n, fw ), tqlayout( wl, parent, fw, layoutBase ) + : Command( n, fw ), layout( wl, parent, fw, layoutBase ) { } void LayoutHorizontalCommand::execute() { formWindow()->clearSelection( FALSE ); - tqlayout.doLayout(); + layout.doLayout(); formWindow()->mainWindow()->objectHierarchy()->rebuild(); } void LayoutHorizontalCommand::unexecute() { formWindow()->clearSelection( FALSE ); - tqlayout.undoLayout(); + layout.undoLayout(); formWindow()->mainWindow()->objectHierarchy()->rebuild(); } @@ -697,21 +697,21 @@ void LayoutHorizontalCommand::unexecute() LayoutHorizontalSplitCommand::LayoutHorizontalSplitCommand( const TQString &n, FormWindow *fw, TQWidget *parent, TQWidget *layoutBase, const TQWidgetList &wl ) - : Command( n, fw ), tqlayout( wl, parent, fw, layoutBase, TRUE, TRUE ) + : Command( n, fw ), layout( wl, parent, fw, layoutBase, TRUE, TRUE ) { } void LayoutHorizontalSplitCommand::execute() { formWindow()->clearSelection( FALSE ); - tqlayout.doLayout(); + layout.doLayout(); formWindow()->mainWindow()->objectHierarchy()->rebuild(); } void LayoutHorizontalSplitCommand::unexecute() { formWindow()->clearSelection( FALSE ); - tqlayout.undoLayout(); + layout.undoLayout(); formWindow()->mainWindow()->objectHierarchy()->rebuild(); } @@ -720,21 +720,21 @@ void LayoutHorizontalSplitCommand::unexecute() LayoutVerticalCommand::LayoutVerticalCommand( const TQString &n, FormWindow *fw, TQWidget *parent, TQWidget *layoutBase, const TQWidgetList &wl ) - : Command( n, fw ), tqlayout( wl, parent, fw, layoutBase ) + : Command( n, fw ), layout( wl, parent, fw, layoutBase ) { } void LayoutVerticalCommand::execute() { formWindow()->clearSelection( FALSE ); - tqlayout.doLayout(); + layout.doLayout(); formWindow()->mainWindow()->objectHierarchy()->rebuild(); } void LayoutVerticalCommand::unexecute() { formWindow()->clearSelection( FALSE ); - tqlayout.undoLayout(); + layout.undoLayout(); formWindow()->mainWindow()->objectHierarchy()->rebuild(); } @@ -743,21 +743,21 @@ void LayoutVerticalCommand::unexecute() LayoutVerticalSplitCommand::LayoutVerticalSplitCommand( const TQString &n, FormWindow *fw, TQWidget *parent, TQWidget *layoutBase, const TQWidgetList &wl ) - : Command( n, fw ), tqlayout( wl, parent, fw, layoutBase, TRUE, TRUE ) + : Command( n, fw ), layout( wl, parent, fw, layoutBase, TRUE, TRUE ) { } void LayoutVerticalSplitCommand::execute() { formWindow()->clearSelection( FALSE ); - tqlayout.doLayout(); + layout.doLayout(); formWindow()->mainWindow()->objectHierarchy()->rebuild(); } void LayoutVerticalSplitCommand::unexecute() { formWindow()->clearSelection( FALSE ); - tqlayout.undoLayout(); + layout.undoLayout(); formWindow()->mainWindow()->objectHierarchy()->rebuild(); } @@ -766,21 +766,21 @@ void LayoutVerticalSplitCommand::unexecute() LayoutGridCommand::LayoutGridCommand( const TQString &n, FormWindow *fw, TQWidget *parent, TQWidget *layoutBase, const TQWidgetList &wl, int xres, int yres ) - : Command( n, fw ), tqlayout( wl, parent, fw, layoutBase, TQSize( TQMAX(5,xres), TQMAX(5,yres) ) ) + : Command( n, fw ), layout( wl, parent, fw, layoutBase, TQSize( TQMAX(5,xres), TQMAX(5,yres) ) ) { } void LayoutGridCommand::execute() { formWindow()->clearSelection( FALSE ); - tqlayout.doLayout(); + layout.doLayout(); formWindow()->mainWindow()->objectHierarchy()->rebuild(); } void LayoutGridCommand::unexecute() { formWindow()->clearSelection( FALSE ); - tqlayout.undoLayout(); + layout.undoLayout(); formWindow()->mainWindow()->objectHierarchy()->rebuild(); } @@ -793,21 +793,21 @@ BreakLayoutCommand::BreakLayoutCommand( const TQString &n, FormWindow *fw, WidgetFactory::LayoutType lay = WidgetFactory::layoutType( layoutBase ); spacing = MetaDataBase::spacing( TQT_TQOBJECT(layoutBase) ); margin = MetaDataBase::margin( TQT_TQOBJECT(layoutBase) ); - tqlayout = 0; + layout = 0; if ( lay == WidgetFactory::HBox ) - tqlayout = new HorizontalLayout( wl, layoutBase, fw, layoutBase, FALSE, ::tqqt_cast<TQSplitter*>(layoutBase) != 0 ); + layout = new HorizontalLayout( wl, layoutBase, fw, layoutBase, FALSE, ::tqqt_cast<TQSplitter*>(layoutBase) != 0 ); else if ( lay == WidgetFactory::VBox ) - tqlayout = new VerticalLayout( wl, layoutBase, fw, layoutBase, FALSE, ::tqqt_cast<TQSplitter*>(layoutBase) != 0 ); + layout = new VerticalLayout( wl, layoutBase, fw, layoutBase, FALSE, ::tqqt_cast<TQSplitter*>(layoutBase) != 0 ); else if ( lay == WidgetFactory::Grid ) - tqlayout = new GridLayout( wl, layoutBase, fw, layoutBase, TQSize( TQMAX( 5, fw->grid().x()), TQMAX( 5, fw->grid().y()) ), FALSE ); + layout = new GridLayout( wl, layoutBase, fw, layoutBase, TQSize( TQMAX( 5, fw->grid().x()), TQMAX( 5, fw->grid().y()) ), FALSE ); } void BreakLayoutCommand::execute() { - if ( !tqlayout ) + if ( !layout ) return; formWindow()->clearSelection( FALSE ); - tqlayout->breakLayout(); + layout->breakLayout(); formWindow()->mainWindow()->objectHierarchy()->rebuild(); for ( TQWidget *w = widgets.first(); w; w = widgets.next() ) w->resize( TQMAX( 16, w->width() ), TQMAX( 16, w->height() ) ); @@ -815,10 +815,10 @@ void BreakLayoutCommand::execute() void BreakLayoutCommand::unexecute() { - if ( !tqlayout ) + if ( !layout ) return; formWindow()->clearSelection( FALSE ); - tqlayout->doLayout(); + layout->doLayout(); formWindow()->mainWindow()->objectHierarchy()->rebuild(); MetaDataBase::setSpacing( TQT_TQOBJECT(WidgetFactory::containerOfWidget( lb )), spacing ); MetaDataBase::setMargin( TQT_TQOBJECT(WidgetFactory::containerOfWidget( lb )), margin ); diff --git a/kdevdesigner/designer/command.h b/kdevdesigner/designer/command.h index 92b08dd3..b2c2d161 100644 --- a/kdevdesigner/designer/command.h +++ b/kdevdesigner/designer/command.h @@ -290,7 +290,7 @@ public: Type type() const { return LayoutHorizontal; } private: - HorizontalLayout tqlayout; + HorizontalLayout layout; }; @@ -306,7 +306,7 @@ public: Type type() const { return LayoutHorizontalSplitter; } private: - HorizontalLayout tqlayout; + HorizontalLayout layout; }; @@ -322,7 +322,7 @@ public: Type type() const { return LayoutVertical; } private: - VerticalLayout tqlayout; + VerticalLayout layout; }; @@ -338,7 +338,7 @@ public: Type type() const { return LayoutVerticalSplitter; } private: - VerticalLayout tqlayout; + VerticalLayout layout; }; @@ -354,7 +354,7 @@ public: Type type() const { return LayoutGrid; } private: - GridLayout tqlayout; + GridLayout layout; }; @@ -369,7 +369,7 @@ public: Type type() const { return BreakLayout; } private: - Layout *tqlayout; + Layout *layout; int spacing; int margin; TQWidget *lb; diff --git a/kdevdesigner/designer/filechooser.cpp b/kdevdesigner/designer/filechooser.cpp index 961cfee0..9c2bb751 100644 --- a/kdevdesigner/designer/filechooser.cpp +++ b/kdevdesigner/designer/filechooser.cpp @@ -35,18 +35,18 @@ FileChooser::FileChooser( TQWidget *parent, const char *name ) : TQWidget( parent, name ), md( File ) { - TQHBoxLayout *tqlayout = new TQHBoxLayout( this ); - tqlayout->setMargin( 0 ); + TQHBoxLayout *layout = new TQHBoxLayout( this ); + layout->setMargin( 0 ); lineEdit = new TQLineEdit( this, "filechooser_lineedit" ); - tqlayout->addWidget( lineEdit ); + layout->addWidget( lineEdit ); connect( lineEdit, TQT_SIGNAL( textChanged( const TQString & ) ), this, TQT_SIGNAL( fileNameChanged( const TQString & ) ) ); button = new TQPushButton( "...", this, "filechooser_button" ); button->setFixedWidth( button->fontMetrics().width( " ... " ) ); - tqlayout->addWidget( button ); + layout->addWidget( button ); connect( button, TQT_SIGNAL( clicked() ), this, TQT_SLOT( chooseFile() ) ); diff --git a/kdevdesigner/designer/formwindow.cpp b/kdevdesigner/designer/formwindow.cpp index 77fb2c3f..b4e681da 100644 --- a/kdevdesigner/designer/formwindow.cpp +++ b/kdevdesigner/designer/formwindow.cpp @@ -577,7 +577,7 @@ 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 the clicked widget is not in a tqlayout, raise it + // 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 @@ -592,7 +592,7 @@ void FormWindow::handleMousePress( TQMouseEvent *e, TQWidget *w ) if ( !sel ) { // ...and widget no selectted: unselect all clearSelection( FALSE ); } else { // ...widget selected - // only if widget has a tqlayout (it is a tqlayout meta widget or a laid out container!), unselect its childs + // 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_OBJECT_NAME_STRING ); setPropertyShowingBlocked( TRUE ); @@ -958,15 +958,15 @@ void FormWindow::handleMouseRelease( TQMouseEvent *e, TQWidget *w ) if ( wa == it.key()->parentWidget() ) goto make_move_command; - // break tqlayout if necessary + // break layout if necessary if ( WidgetFactory::layoutType( wa ) != WidgetFactory::NoLayout ) { if ( TQMessageBox::information( mainWindow(), i18n( "Inserting Widget" ), i18n( "You tried to insert a widget into the " - "tqlayout Container Widget '%1'.\n" + "layout Container Widget '%1'.\n" "This is not possible. " - "In order to insert the widget, the tqlayout of '%1'\n" + "In order to insert the widget, the layout of '%1'\n" "must first be broken.\n" - "Break the tqlayout or cancel the operation?" ). + "Break the layout or cancel the operation?" ). arg( wa->name() ). arg( wa->name() ), i18n( "&Break Layout" ), i18n( "&Cancel" ) ) ) goto make_move_command; // cancel @@ -1067,11 +1067,11 @@ void FormWindow::handleMouseRelease( TQMouseEvent *e, TQWidget *w ) if ( WidgetFactory::layoutType( insertParent ) != WidgetFactory::NoLayout ) { if ( TQMessageBox::information( mainWindow(), i18n( "Inserting Widget" ), i18n( "You tried to insert a widget into the " - "tqlayout Container Widget '%1'.\n" + "layout Container Widget '%1'.\n" "This is not possible. " - "In order to insert the widget, the tqlayout of '%1'\n" + "In order to insert the widget, the layout of '%1'\n" "must first be broken.\n" - "Break the tqlayout or cancel the operation?" ). + "Break the layout or cancel the operation?" ). arg( insertParent->name() ). arg( insertParent->name() ), i18n( "&Break Layout" ), i18n( "&Cancel" ) ) == 0 ) { breakLayout( insertParent ); @@ -2581,7 +2581,7 @@ void FormWindow::setMainContainer( TQWidget *w ) delete mContainer; mContainer = w; insertedWidgets.insert( mContainer, mContainer ); - delete tqlayout(); + delete layout(); TQHBoxLayout *l = new TQHBoxLayout( this ); l->addWidget( w ); if ( resetPropertyWidget ) { diff --git a/kdevdesigner/designer/kdevdesigner_part.cpp b/kdevdesigner/designer/kdevdesigner_part.cpp index 991a1b7c..a9d045d6 100644 --- a/kdevdesigner/designer/kdevdesigner_part.cpp +++ b/kdevdesigner/designer/kdevdesigner_part.cpp @@ -146,9 +146,9 @@ void KDevDesignerPart::setupActions( ) action = new KAction(i18n("Adjust &Size"), createPartIconSet("designer_adjustsize.png"), CTRL + Key_J, this, TQT_SLOT(layoutAdjustSize()), actionCollection(), "layout_adjustsize"); stateSync(action, m_widget->actionEditAdjustSize); - action = new KAction(i18n("Lay Out &Horizontally"), createPartIconSet("designer_edithtqlayout.png"), CTRL + Key_H, this, TQT_SLOT(layoutHLayout()), actionCollection(), "layout_h"); + action = new KAction(i18n("Lay Out &Horizontally"), createPartIconSet("designer_edithlayout.png"), CTRL + Key_H, this, TQT_SLOT(layoutHLayout()), actionCollection(), "layout_h"); stateSync(action, m_widget->actionEditHLayout); - action = new KAction(i18n("Lay Out &Vertically"), createPartIconSet("designer_editvtqlayout.png"), CTRL + Key_V, this, TQT_SLOT(layoutVLayout()), actionCollection(), "layout_v"); + action = new KAction(i18n("Lay Out &Vertically"), createPartIconSet("designer_editvlayout.png"), CTRL + Key_V, this, TQT_SLOT(layoutVLayout()), actionCollection(), "layout_v"); stateSync(action, m_widget->actionEditVLayout); action = new KAction(i18n("Lay Out in &Grid"), createPartIconSet("designer_editgrid.png"), CTRL + Key_G, this, TQT_SLOT(layoutGridLayout()), actionCollection(), "layout_grid"); stateSync(action, m_widget->actionEditGridLayout); diff --git a/kdevdesigner/designer/layout.cpp b/kdevdesigner/designer/layout.cpp index 56694eda..2e786a73 100644 --- a/kdevdesigner/designer/layout.cpp +++ b/kdevdesigner/designer/layout.cpp @@ -85,7 +85,7 @@ void Layout::setup() TQWidget *w = 0; // Go through all widgets of the list we got. As we can only - // tqlayout widgets which have the same parent, we first do some + // layout widgets which have the same parent, we first do some // sorting which means create a list for each parent containing // its child here. After that we keep working on the list of // childs which has the most entries. @@ -120,7 +120,7 @@ void Layout::setup() } // If we found no list (because no widget did fit at all) or the - // best list has only one entry and we do not tqlayout a container, + // best list has only one entry and we do not layout a container, // we leave here. if ( !lastList || ( lastList->count() < 2 && ( !layoutBase || @@ -133,11 +133,11 @@ void Layout::setup() } // Now we have a new and clean widget list, which makes sense - // to tqlayout + // to layout widgets = *lastList; // Also use the only correct parent later, so store it parent = WidgetFactory::widgetOfContainer( widgets.first()->parentWidget() ); - // Now calculate the position where the tqlayout-meta-widget should + // Now calculate the position where the layout-meta-widget should // be placed and connect to widgetDestroyed() signals of the // widgets to get informed if one gets deleted to be able to // handle that and do not crash in this case @@ -149,7 +149,7 @@ void Layout::setup() geometries.insert( w, TQRect( w->pos(), w->size() ) ); // Change the Z-order, as saving/loading uses the Z-order for // writing/creating widgets and this has to be the same as in - // the tqlayout. Else saving + loading will give different results + // the layout. Else saving + loading will give different results w->raise(); } } @@ -182,7 +182,7 @@ bool Layout::prepareLayout( bool &needMove, bool &needReparent ) return TRUE; } -void Layout::finishLayout( bool needMove, TQLayout *tqlayout ) +void Layout::finishLayout( bool needMove, TQLayout *layout ) { if ( needMove ) layoutBase->move( startPoint ); @@ -193,7 +193,7 @@ void Layout::finishLayout( bool needMove, TQLayout *tqlayout ) layoutBase->setGeometry( oldGeometry ); oldGeometry = g; layoutBase->show(); - tqlayout->activate(); + layout->activate(); formWindow->insertWidget( layoutBase ); formWindow->selectWidget( TQT_TQOBJECT(layoutBase) ); TQString n = layoutBase->name(); @@ -311,16 +311,16 @@ void HorizontalLayout::doLayout() if ( !prepareLayout( needMove, needReparent ) ) return; - TQHBoxLayout *tqlayout = (TQHBoxLayout*)WidgetFactory::createLayout( layoutBase, 0, WidgetFactory::HBox ); + TQHBoxLayout *layout = (TQHBoxLayout*)WidgetFactory::createLayout( layoutBase, 0, WidgetFactory::HBox ); for ( TQWidget *w = widgets.first(); w; w = widgets.next() ) { if ( needReparent && TQT_BASE_OBJECT(w->parent()) != TQT_BASE_OBJECT(layoutBase) ) w->reparent( layoutBase, 0, TQPoint( 0, 0 ), FALSE ); if ( !useSplitter ) { if ( qstrcmp( w->className(), "Spacer" ) == 0 ) - tqlayout->addWidget( w, 0, ( (Spacer*)w )->alignment() ); + layout->addWidget( w, 0, ( (Spacer*)w )->alignment() ); else - tqlayout->addWidget( w ); + layout->addWidget( w ); if ( ::tqqt_cast<TQLayoutWidget*>(w) ) ( (TQLayoutWidget*)w )->updateSizePolicy(); } @@ -330,7 +330,7 @@ void HorizontalLayout::doLayout() if ( ::tqqt_cast<TQSplitter*>(layoutBase) ) ( (TQSplitter*)layoutBase )->setOrientation( Qt::Horizontal ); - finishLayout( needMove, tqlayout ); + finishLayout( needMove, layout ); } @@ -375,16 +375,16 @@ void VerticalLayout::doLayout() if ( !prepareLayout( needMove, needReparent ) ) return; - TQVBoxLayout *tqlayout = (TQVBoxLayout*)WidgetFactory::createLayout( layoutBase, 0, WidgetFactory::VBox ); + TQVBoxLayout *layout = (TQVBoxLayout*)WidgetFactory::createLayout( layoutBase, 0, WidgetFactory::VBox ); for ( TQWidget *w = widgets.first(); w; w = widgets.next() ) { if ( needReparent && TQT_BASE_OBJECT(w->parent()) != TQT_BASE_OBJECT(layoutBase) ) w->reparent( layoutBase, 0, TQPoint( 0, 0 ), FALSE ); if ( !useSplitter ) { if ( qstrcmp( w->className(), "Spacer" ) == 0 ) - tqlayout->addWidget( w, 0, ( (Spacer*)w )->alignment() ); + layout->addWidget( w, 0, ( (Spacer*)w )->alignment() ); else - tqlayout->addWidget( w ); + layout->addWidget( w ); if ( ::tqqt_cast<TQLayoutWidget*>(w) ) ( (TQLayoutWidget*)w )->updateSizePolicy(); } @@ -394,7 +394,7 @@ void VerticalLayout::doLayout() if ( ::tqqt_cast<TQSplitter*>(layoutBase) ) ( (TQSplitter*)layoutBase )->setOrientation( Qt::Vertical ); - finishLayout( needMove, tqlayout ); + finishLayout( needMove, layout ); } @@ -747,7 +747,7 @@ void GridLayout::doLayout() if ( !prepareLayout( needMove, needReparent ) ) return; - QDesignerGridLayout *tqlayout = (QDesignerGridLayout*)WidgetFactory::createLayout( layoutBase, 0, WidgetFactory::Grid ); + QDesignerGridLayout *layout = (QDesignerGridLayout*)WidgetFactory::createLayout( layoutBase, 0, WidgetFactory::Grid ); if ( !grid ) buildGrid(); @@ -759,18 +759,18 @@ void GridLayout::doLayout() if ( needReparent && TQT_BASE_OBJECT(w->parent()) != TQT_BASE_OBJECT(layoutBase) ) w->reparent( layoutBase, 0, TQPoint( 0, 0 ), FALSE ); if ( rs * cs == 1 ) { - tqlayout->addWidget( w, r, c, ::tqqt_cast<Spacer*>(w) ? ( (Spacer*)w )->alignment() : 0 ); + layout->addWidget( w, r, c, ::tqqt_cast<Spacer*>(w) ? ( (Spacer*)w )->alignment() : 0 ); } else { - tqlayout->addMultiCellWidget( w, r, r+rs-1, c, c+cs-1, ::tqqt_cast<Spacer*>(w) ? ( (Spacer*)w )->alignment() : 0 ); + layout->addMultiCellWidget( w, r, r+rs-1, c, c+cs-1, ::tqqt_cast<Spacer*>(w) ? ( (Spacer*)w )->alignment() : 0 ); } if ( ::tqqt_cast<TQLayoutWidget*>(w) ) ( (TQLayoutWidget*)w )->updateSizePolicy(); w->show(); } else { - qWarning("ooops, widget '%s' does not fit in tqlayout", w->name() ); + qWarning("ooops, widget '%s' does not fit in layout", w->name() ); } } - finishLayout( needMove, tqlayout ); + finishLayout( needMove, layout ); } void GridLayout::setup() @@ -787,7 +787,7 @@ void GridLayout::buildGrid() // Pixel to cell conversion: // By keeping a list of start'n'stop values (x & y) for each widget, // it is possible to create a very small grid of cells to represent - // the widget tqlayout. + // the widget layout. // ----------------------------------------------------------------- // We need a list of both start and stop values for x- & y-axis @@ -829,7 +829,7 @@ void GridLayout::buildGrid() current++; } - // Create the smallest grid possible to represent the current tqlayout + // Create the smallest grid possible to represent the current layout // Since no widget will be placed in the last row and column, we'll // skip them to increase speed even further delete grid; diff --git a/kdevdesigner/designer/layout.h b/kdevdesigner/designer/layout.h index deddd499..34891ae0 100644 --- a/kdevdesigner/designer/layout.h +++ b/kdevdesigner/designer/layout.h @@ -51,7 +51,7 @@ public: virtual void undoLayout(); virtual void breakLayout(); virtual bool prepareLayout( bool &needMove, bool &needReparent ); - virtual void finishLayout( bool needMove, TQLayout *tqlayout ); + virtual void finishLayout( bool needMove, TQLayout *layout ); protected: TQWidgetList widgets; diff --git a/kdevdesigner/designer/mainwindow.cpp b/kdevdesigner/designer/mainwindow.cpp index e6a6b575..5221ec9c 100644 --- a/kdevdesigner/designer/mainwindow.cpp +++ b/kdevdesigner/designer/mainwindow.cpp @@ -822,7 +822,7 @@ void MainWindow::helpAbout() dlg.aboutLicense->setText( iface->aboutText() ); } dlg.aboutVersion->setText(TQString("Version ") + TQString(TQT_VERSION_STR)); - dlg.resize( dlg.width(), dlg.tqlayout()->heightForWidth(dlg.width()) ); + dlg.resize( dlg.width(), dlg.layout()->heightForWidth(dlg.width()) ); dlg.exec(); } @@ -1279,7 +1279,7 @@ void MainWindow::insertFormWindow( FormWindow *fw ) { if ( fw ) TQWhatsThis::add( fw, i18n( "<b>The Form Window</b>" - "<p>Use the various tools to add widgets or to change the tqlayout " + "<p>Use the various tools to add widgets or to change the layout " "and behavior of the components in the form. Select one or multiple " "widgets to move them or lay them out. If a single widget is chosen it can " "be resized using the resize handles.</p>" diff --git a/kdevdesigner/designer/mainwindowactions.cpp b/kdevdesigner/designer/mainwindowactions.cpp index b7fc6b33..4fec152e 100644 --- a/kdevdesigner/designer/mainwindowactions.cpp +++ b/kdevdesigner/designer/mainwindowactions.cpp @@ -330,14 +330,14 @@ void MainWindow::setupLayoutActions() connect( actionEditAdjustSize, TQT_SIGNAL( activated() ), TQT_TQOBJECT(this), TQT_SLOT( editAdjustSize() ) ); actionEditAdjustSize->setEnabled( FALSE ); - actionEditHLayout = new DesignerAction( i18n( "Lay OutQt::Horizontally" ), createIconSet("designer_edithtqlayout.png"), + actionEditHLayout = new DesignerAction( i18n( "Lay OutQt::Horizontally" ), createIconSet("designer_edithlayout.png"), i18n( "Lay Out &Horizontally" ), CTRL + Key_H, TQT_TQOBJECT(this), 0 ); actionEditHLayout->setStatusTip(i18n("Lays out the selected widgets horizontally") ); actionEditHLayout->setWhatsThis( whatsThisFrom( "Layout|Lay OutQt::Horizontally" ) ); connect( actionEditHLayout, TQT_SIGNAL( activated() ), TQT_TQOBJECT(this), TQT_SLOT( editLayoutHorizontal() ) ); actionEditHLayout->setEnabled( FALSE ); - actionEditVLayout = new DesignerAction( i18n( "Lay OutQt::Vertically" ), createIconSet("designer_editvtqlayout.png"), + actionEditVLayout = new DesignerAction( i18n( "Lay OutQt::Vertically" ), createIconSet("designer_editvlayout.png"), i18n( "Lay Out &Vertically" ), CTRL + Key_L, TQT_TQOBJECT(this), 0 ); actionEditVLayout->setStatusTip(i18n("Lays out the selected widgets vertically") ); actionEditVLayout->setWhatsThis( whatsThisFrom( "Layout|Lay OutQt::Vertically" ) ); @@ -367,7 +367,7 @@ void MainWindow::setupLayoutActions() actionEditBreakLayout = new DesignerAction( i18n( "Break Layout" ), createIconSet("designer_editbreaklayout.png"), i18n( "&Break Layout" ), CTRL + Key_B, TQT_TQOBJECT(this), 0 ); - actionEditBreakLayout->setStatusTip(i18n("Breaks the selected tqlayout") ); + actionEditBreakLayout->setStatusTip(i18n("Breaks the selected layout") ); actionEditBreakLayout->setWhatsThis( whatsThisFrom( "Layout|Break Layout" ) ); connect( actionEditBreakLayout, TQT_SIGNAL( activated() ), TQT_TQOBJECT(this), TQT_SLOT( editBreakLayout() ) ); actionEditBreakLayout->setEnabled( FALSE ); @@ -1567,7 +1567,7 @@ void MainWindow::editPaste() } else { TQMessageBox::information( this, i18n( "Paste Error" ), i18n( "Cannot paste widgets. Designer could not find a container\n" - "to paste into which does not contain a tqlayout. Break the tqlayout\n" + "to paste into which does not contain a layout. Break the layout\n" "of the container you want to paste into and select this container\n" "and then paste again." ) ); } diff --git a/kdevdesigner/designer/menubareditor.cpp b/kdevdesigner/designer/menubareditor.cpp index 550c9b60..0618b078 100644 --- a/kdevdesigner/designer/menubareditor.cpp +++ b/kdevdesigner/designer/menubareditor.cpp @@ -585,7 +585,7 @@ void MenuBarEditor::paintEvent( TQPaintEvent * ) { TQPainter p( this ); TQRect r = rect(); - tqstyle().tqdrawPrimitive( TQStyle::PE_PanelMenuBar, &p, + style().tqdrawPrimitive( TQStyle::PE_PanelMenuBar, &p, r, colorGroup() ); drawItems( p ); } diff --git a/kdevdesigner/designer/metadatabase.cpp b/kdevdesigner/designer/metadatabase.cpp index 6ac84af6..6e248e08 100644 --- a/kdevdesigner/designer/metadatabase.cpp +++ b/kdevdesigner/designer/metadatabase.cpp @@ -303,16 +303,16 @@ void MetaDataBase::setSpacing( TQObject *o, int spacing ) } r->spacing = spacing; - TQLayout * tqlayout = 0; - WidgetFactory::layoutType( (TQWidget*)o, tqlayout ); - if ( tqlayout ) { + TQLayout * layout = 0; + WidgetFactory::layoutType( (TQWidget*)o, layout ); + if ( layout ) { int spadef = 6; if ( MainWindow::self->formWindow() ) spadef = MainWindow::self->formWindow()->layoutDefaultSpacing(); if ( spacing == -1 ) - tqlayout->setSpacing( spadef ); + layout->setSpacing( spadef ); else - tqlayout->setSpacing( spacing ); + layout->setSpacing( spacing ); } } @@ -346,8 +346,8 @@ void MetaDataBase::setMargin( TQObject *o, int margin ) } r->margin = margin; - TQLayout * tqlayout = 0; - WidgetFactory::layoutType( (TQWidget*)o, tqlayout ); + TQLayout * layout = 0; + WidgetFactory::layoutType( (TQWidget*)o, layout ); bool isInnerLayout = TRUE; @@ -358,18 +358,18 @@ void MetaDataBase::setMargin( TQObject *o, int margin ) isInnerLayout = FALSE; - if ( tqlayout ) { + if ( layout ) { int mardef = 11; if ( MainWindow::self->formWindow() ) mardef = MainWindow::self->formWindow()->layoutDefaultMargin(); if ( margin == -1 ) { if ( isInnerLayout ) - tqlayout->setMargin( 1 ); + layout->setMargin( 1 ); else - tqlayout->setMargin( TQMAX( 1, mardef ) ); + layout->setMargin( TQMAX( 1, mardef ) ); } else - tqlayout->setMargin( TQMAX( 1, margin ) ); + layout->setMargin( TQMAX( 1, margin ) ); } } diff --git a/kdevdesigner/designer/paletteeditoradvancedimpl.cpp b/kdevdesigner/designer/paletteeditoradvancedimpl.cpp index e8c780fc..903c1a4f 100644 --- a/kdevdesigner/designer/paletteeditoradvancedimpl.cpp +++ b/kdevdesigner/designer/paletteeditoradvancedimpl.cpp @@ -250,15 +250,15 @@ void PaletteEditorAdvanced::onCentral( int item ) case 0: default: c = editPalette.active().color( centralFromItem(item) ); - p = editPalette.active().tqbrush( centralFromItem(item) ).pixmap(); + p = editPalette.active().brush( centralFromItem(item) ).pixmap(); break; case 1: c = editPalette.inactive().color( centralFromItem(item) ); - p = editPalette.inactive().tqbrush( centralFromItem(item) ).pixmap(); + p = editPalette.inactive().brush( centralFromItem(item) ).pixmap(); break; case 2: c = editPalette.disabled().color( centralFromItem(item) ); - p = editPalette.disabled().tqbrush( centralFromItem(item) ).pixmap(); + p = editPalette.disabled().brush( centralFromItem(item) ).pixmap(); break; } @@ -514,17 +514,17 @@ void PaletteEditorAdvanced::updateStyledButtons() default: central = editPalette.active().color( centralFromItem( comboCentral->currentItem() ) ); effect = editPalette.active().color( effectFromItem( comboEffect->currentItem() ) ); - pm = editPalette.active().tqbrush( centralFromItem( comboCentral->currentItem() ) ).pixmap(); + pm = editPalette.active().brush( centralFromItem( comboCentral->currentItem() ) ).pixmap(); break; case 1: central = editPalette.inactive().color( centralFromItem( comboCentral->currentItem() ) ); effect = editPalette.inactive().color( effectFromItem( comboEffect->currentItem() ) ); - pm = editPalette.inactive().tqbrush( centralFromItem( comboCentral->currentItem() ) ).pixmap(); + pm = editPalette.inactive().brush( centralFromItem( comboCentral->currentItem() ) ).pixmap(); break; case 2: central = editPalette.disabled().color( centralFromItem( comboCentral->currentItem() ) ); effect = editPalette.disabled().color( effectFromItem( comboEffect->currentItem() ) ); - pm = editPalette.disabled().tqbrush( centralFromItem( comboCentral->currentItem() ) ).pixmap(); + pm = editPalette.disabled().brush( centralFromItem( comboCentral->currentItem() ) ).pixmap(); break; } diff --git a/kdevdesigner/designer/popupmenueditor.cpp b/kdevdesigner/designer/popupmenueditor.cpp index c9575f23..ab6e6d97 100644 --- a/kdevdesigner/designer/popupmenueditor.cpp +++ b/kdevdesigner/designer/popupmenueditor.cpp @@ -730,7 +730,7 @@ void PopupMenuEditor::paintEvent( TQPaintEvent * ) rect().width() - borderSize * 2, rect().height() - borderSize * 2 ); reg -= mid; p.setClipRegion( reg ); - tqstyle().tqdrawPrimitive( TQStyle::PE_PanelPopup, &p, rect(), colorGroup() ); + style().tqdrawPrimitive( TQStyle::PE_PanelPopup, &p, rect(), colorGroup() ); p.restore(); drawItems( &p ); } @@ -1034,7 +1034,7 @@ void PopupMenuEditor::drawItem( TQPainter * p, PopupMenuEditorItem * i, p->fillRect( r, colorGroup().brush( TQColorGroup::Background ) ); if ( i->isSeparator() ) { - tqstyle().tqdrawPrimitive( TQStyle::PE_Separator, p, + style().tqdrawPrimitive( TQStyle::PE_Separator, p, TQRect( r.x(), r.y() + 2, r.width(), 1 ), colorGroup(), TQStyle::Style_Sunken | f ); return; @@ -1042,7 +1042,7 @@ void PopupMenuEditor::drawItem( TQPainter * p, PopupMenuEditorItem * i, const TQAction * a = i->action(); if ( a->isToggleAction() && a->isOn() ) { - tqstyle().tqdrawPrimitive( TQStyle::PE_CheckMark, p, + style().tqdrawPrimitive( TQStyle::PE_CheckMark, p, TQRect( x , y, iconWidth, h ), colorGroup(), f ); } else { @@ -1064,7 +1064,7 @@ void PopupMenuEditor::drawItem( TQPainter * p, PopupMenuEditorItem * i, TQPainter::AlignLeft | TQPainter::AlignVCenter, a->accel() ); if ( i->count() ) // Item has submenu - tqstyle().tqdrawPrimitive( TQStyle::PE_ArrowRight, p, + style().tqdrawPrimitive( TQStyle::PE_ArrowRight, p, TQRect( r.width() - arrowWidth, r.y(), arrowWidth, r.height() ), colorGroup(), f ); } @@ -1093,7 +1093,7 @@ void PopupMenuEditor::drawItems( TQPainter * p ) int idx = 0; TQColorGroup enabled = colorGroup(); - TQColorGroup disabled = tqpalette().disabled(); + TQColorGroup disabled = palette().disabled(); TQRect focus; TQRect rect( borderSize, borderSize, width() - borderSize * 2, 0 ); diff --git a/kdevdesigner/designer/preferences.ui b/kdevdesigner/designer/preferences.ui index 1b0aefaa..363164ed 100644 --- a/kdevdesigner/designer/preferences.ui +++ b/kdevdesigner/designer/preferences.ui @@ -95,7 +95,7 @@ </widget> <widget class="TQLayoutWidget"> <property name="name"> - <cstring>tqlayout3</cstring> + <cstring>layout3</cstring> </property> <hbox> <property name="name"> diff --git a/kdevdesigner/designer/propertyeditor.cpp b/kdevdesigner/designer/propertyeditor.cpp index 7bae00b5..83bdedd3 100644 --- a/kdevdesigner/designer/propertyeditor.cpp +++ b/kdevdesigner/designer/propertyeditor.cpp @@ -294,7 +294,7 @@ void PropertyItem::paintBranches( TQPainter * p, const TQColorGroup & cg, void PropertyItem::paintFocus( TQPainter *p, const TQColorGroup &cg, const TQRect &r ) { p->save(); - TQApplication::tqstyle().tqdrawPrimitive(TQStyle::PE_Panel, p, r, cg, + TQApplication::style().tqdrawPrimitive(TQStyle::PE_Panel, p, r, cg, TQStyle::Style_Sunken, TQStyleOption(1,1) ); p->restore(); } @@ -414,7 +414,7 @@ void PropertyItem::createResetButton() setupStyle( resetButton ); resetButton->setPixmap( DesignerResetPix ); resetButton->setFixedWidth( resetButton->sizeHint().width() ); - hbox->tqlayout()->setAlignment( TQt::AlignRight ); + hbox->layout()->setAlignment( TQt::AlignRight ); listview->addChild( hbox ); hbox->hide(); TQObject::connect( resetButton, TQT_SIGNAL( clicked() ), @@ -2692,13 +2692,13 @@ void EnumBox::paintEvent( TQPaintEvent * ) &g.brush( TQColorGroup::Button ) ); return; } - tqstyle().drawComplexControl( TQStyle::CC_ComboBox, &p, this, rect(), g, + style().drawComplexControl( TQStyle::CC_ComboBox, &p, this, rect(), g, flags, TQStyle::SC_All, (arrowDown ? TQStyle::SC_ComboBoxArrow : TQStyle::SC_None )); - TQRect re = tqstyle().querySubControlMetrics( TQStyle::CC_ComboBox, this, + TQRect re = style().querySubControlMetrics( TQStyle::CC_ComboBox, this, TQStyle::SC_ComboBoxEditField ); re = TQStyle::visualRect(re, this); p.setClipRect( re ); @@ -2742,7 +2742,7 @@ void EnumBox::mousePressEvent( TQMouseEvent *e ) if ( e->button() != Qt::LeftButton ) return; - TQRect arrowRect = tqstyle().querySubControlMetrics( TQStyle::CC_ComboBox, this, + TQRect arrowRect = style().querySubControlMetrics( TQStyle::CC_ComboBox, this, TQStyle::SC_ComboBoxArrow); arrowRect = TQStyle::visualRect(arrowRect, this); diff --git a/kdevdesigner/designer/resource.cpp b/kdevdesigner/designer/resource.cpp index e15b68c1..168de589 100644 --- a/kdevdesigner/designer/resource.cpp +++ b/kdevdesigner/designer/resource.cpp @@ -238,7 +238,7 @@ static TQString platformNeutralKeySequence(const TQKeySequence &ks) ++i; } // If we can't find the actual translatable keyname, - // fall back on the tqunicode representation of it... + // fall back on the unicode representation of it... // Or else characters like Key_aring may not get displayed // ( Really depends on you locale ) if ( !keyname[i].name ) @@ -622,8 +622,8 @@ bool Resource::load( FormFile *ff, TQIODevice* dev, Project *defProject ) if ( formwindow ) { formwindow->killAccels( TQT_TQOBJECT(formwindow) ); - if ( formwindow->tqlayout() ) - formwindow->tqlayout()->activate(); + if ( formwindow->layout() ) + formwindow->layout()->activate(); if ( hadGeometry ) formwindow->resize( formwindow->size().expandedTo( formwindow->minimumSize(). expandedTo( formwindow->minimumSizeHint() ) ) ); @@ -1347,14 +1347,14 @@ void Resource::saveChildrenOf( TQObject* obj, TQTextStream &ts, int indent ) return; // no children to save TQString closeTag; - // if the widget has a tqlayout we pretend that all widget's childs are childs of the tqlayout - makes the structure nicer - TQLayout *tqlayout = 0; + // if the widget has a layout we pretend that all widget's childs are childs of the layout - makes the structure nicer + TQLayout *layout = 0; QDesignerGridLayout* grid = 0; if ( !::tqqt_cast<TQSplitter*>(obj) && WidgetDatabase::isContainer( WidgetDatabase::idFromClassName( WidgetFactory::classNameOf( obj ) ) ) && obj->isWidgetType() && - WidgetFactory::layoutType( (TQWidget*)obj, tqlayout ) != WidgetFactory::NoLayout ) { - WidgetFactory::LayoutType lay = WidgetFactory::layoutType( (TQWidget*)obj, tqlayout ); + WidgetFactory::layoutType( (TQWidget*)obj, layout ) != WidgetFactory::NoLayout ) { + WidgetFactory::LayoutType lay = WidgetFactory::layoutType( (TQWidget*)obj, layout ); switch ( lay ) { case WidgetFactory::HBox: closeTag = makeIndent( indent ) + "</hbox>"; @@ -1370,15 +1370,15 @@ void Resource::saveChildrenOf( TQObject* obj, TQTextStream &ts, int indent ) closeTag = makeIndent( indent ) + "</grid>"; ts << makeIndent( indent ) << "<grid>" << endl; ++indent; - grid = (QDesignerGridLayout*) tqlayout; + grid = (QDesignerGridLayout*) layout; break; default: break; } - // save properties of tqlayout + // save properties of layout if ( lay != WidgetFactory::NoLayout ) - saveObjectProperties( TQT_TQOBJECT(tqlayout), ts, indent ); + saveObjectProperties( TQT_TQOBJECT(layout), ts, indent ); } @@ -1743,7 +1743,7 @@ void Resource::saveColorGroup( TQTextStream &ts, int indent, const TQColorGroup saveColor( ts, indent, cg.color( (TQColorGroup::ColorRole)r ) ); indent--; ts << makeIndent( indent ) << "</color>" << endl; - TQPixmap* pm = cg.tqbrush( (TQColorGroup::ColorRole)r ).pixmap(); + TQPixmap* pm = cg.brush( (TQColorGroup::ColorRole)r ).pixmap(); if ( pm && !pm->isNull() ) savePixmap( *pm, ts, indent ); } @@ -1756,7 +1756,7 @@ void Resource::saveColor( TQTextStream &ts, int indent, const TQColor &c ) ts << makeIndent( indent ) << "<blue>" << TQString::number( c.blue() ) << "</blue>" << endl; } -TQObject *Resource::createObject( const TQDomElement &e, TQWidget *parent, TQLayout* tqlayout ) +TQObject *Resource::createObject( const TQDomElement &e, TQWidget *parent, TQLayout* layout ) { lastItem = 0; TQDomElement n = e.firstChild().toElement(); @@ -1798,16 +1798,16 @@ TQObject *Resource::createObject( const TQDomElement &e, TQWidget *parent, TQLay w = (TQWidget*)obj; if ( ::tqqt_cast<TQMainWindow*>(w) ) w = ( (TQMainWindow*)w )->centralWidget(); - if ( tqlayout ) { - switch ( WidgetFactory::layoutType( tqlayout ) ) { + if ( layout ) { + switch ( WidgetFactory::layoutType( layout ) ) { case WidgetFactory::HBox: - ( (TQHBoxLayout*)tqlayout )->addWidget( w ); + ( (TQHBoxLayout*)layout )->addWidget( w ); break; case WidgetFactory::VBox: - ( (TQVBoxLayout*)tqlayout )->addWidget( w ); + ( (TQVBoxLayout*)layout )->addWidget( w ); break; case WidgetFactory::Grid: - ( (QDesignerGridLayout*)tqlayout )->addMultiCellWidget( w, row, row + rowspan - 1, + ( (QDesignerGridLayout*)layout )->addMultiCellWidget( w, row, row + rowspan - 1, col, col + colspan - 1 ); break; default: @@ -1817,7 +1817,7 @@ TQObject *Resource::createObject( const TQDomElement &e, TQWidget *parent, TQLay if ( !toplevel ) toplevel = w; - tqlayout = 0; + layout = 0; if ( w && formwindow ) { if ( !parent || @@ -1848,22 +1848,22 @@ TQObject *Resource::createObject( const TQDomElement &e, TQWidget *parent, TQLay while ( !n.isNull() ) { if ( n.tagName() == "spacer" ) { - createSpacer( n, w, tqlayout, Qt::Horizontal ); + createSpacer( n, w, layout, Qt::Horizontal ); } else if ( n.tagName() == "widget" ) { - createObject( n, w, tqlayout ); + createObject( n, w, layout ); } else if ( n.tagName() == "hbox" ) { - tqlayout = WidgetFactory::createLayout( w, tqlayout, WidgetFactory::HBox ); - obj = TQT_TQOBJECT(tqlayout); + layout = WidgetFactory::createLayout( w, layout, WidgetFactory::HBox ); + obj = TQT_TQOBJECT(layout); n = n.firstChild().toElement(); continue; } else if ( n.tagName() == "grid" ) { - tqlayout = WidgetFactory::createLayout( w, tqlayout, WidgetFactory::Grid ); - obj = TQT_TQOBJECT(tqlayout); + layout = WidgetFactory::createLayout( w, layout, WidgetFactory::Grid ); + obj = TQT_TQOBJECT(layout); n = n.firstChild().toElement(); continue; } else if ( n.tagName() == "vbox" ) { - tqlayout = WidgetFactory::createLayout( w, tqlayout, WidgetFactory::VBox ); - obj = TQT_TQOBJECT(tqlayout); + layout = WidgetFactory::createLayout( w, layout, WidgetFactory::VBox ); + obj = TQT_TQOBJECT(layout); n = n.firstChild().toElement(); continue; } else if ( n.tagName() == "property" && obj ) { @@ -2104,7 +2104,7 @@ void Resource::createItem( const TQDomElement &e, TQWidget *widget, TQListViewIt } } -TQWidget *Resource::createSpacer( const TQDomElement &e, TQWidget *parent, TQLayout *tqlayout, Qt::Orientation o ) +TQWidget *Resource::createSpacer( const TQDomElement &e, TQWidget *parent, TQLayout *layout, Qt::Orientation o ) { TQDomElement n = e.firstChild().toElement(); int row = e.attribute( "row" ).toInt(); @@ -2128,11 +2128,11 @@ TQWidget *Resource::createSpacer( const TQDomElement &e, TQWidget *parent, TQLay spacer->setInteraciveMode( TRUE ); if ( formwindow ) formwindow->insertWidget( spacer, pasting ); - if ( tqlayout ) { - if ( ::tqqt_cast<TQBoxLayout*>(tqlayout) ) - ( (TQBoxLayout*)tqlayout )->addWidget( spacer, 0, spacer->alignment() ); + if ( layout ) { + if ( ::tqqt_cast<TQBoxLayout*>(layout) ) + ( (TQBoxLayout*)layout )->addWidget( spacer, 0, spacer->alignment() ); else - ( (QDesignerGridLayout*)tqlayout )->addMultiCellWidget( spacer, row, row + rowspan - 1, col, col + colspan - 1, + ( (QDesignerGridLayout*)layout )->addMultiCellWidget( spacer, row, row + rowspan - 1, col, col + colspan - 1, spacer->alignment() ); } return spacer; diff --git a/kdevdesigner/designer/resource.h b/kdevdesigner/designer/resource.h index ddbffb07..06598254 100644 --- a/kdevdesigner/designer/resource.h +++ b/kdevdesigner/designer/resource.h @@ -111,8 +111,8 @@ private: void saveMenuBar( TQMainWindow *mw, TQTextStream &ts, int indent ); void savePopupMenu( PopupMenuEditor *pm, TQMainWindow *mw, TQTextStream &ts, int indent ); - TQObject *createObject( const TQDomElement &e, TQWidget *parent, TQLayout* tqlayout = 0 ); - TQWidget *createSpacer( const TQDomElement &e, TQWidget *parent, TQLayout *tqlayout, Qt::Orientation o ); + TQObject *createObject( const TQDomElement &e, TQWidget *parent, TQLayout* layout = 0 ); + TQWidget *createSpacer( const TQDomElement &e, TQWidget *parent, TQLayout *layout, Qt::Orientation o ); void createItem( const TQDomElement &e, TQWidget *widget, TQListViewItem *i = 0 ); void createColumn( const TQDomElement &e, TQWidget *widget ); void setObjectProperty( TQObject* widget, const TQString &prop, const TQDomElement &e); diff --git a/kdevdesigner/designer/styledbutton.cpp b/kdevdesigner/designer/styledbutton.cpp index 351ab247..82c9ddb8 100644 --- a/kdevdesigner/designer/styledbutton.cpp +++ b/kdevdesigner/designer/styledbutton.cpp @@ -151,21 +151,21 @@ void StyledButton::resizeEvent( TQResizeEvent* e ) void StyledButton::drawButton( TQPainter *paint ) { - tqstyle().tqdrawPrimitive(TQStyle::PE_ButtonBevel, paint, rect(), colorGroup(), + style().tqdrawPrimitive(TQStyle::PE_ButtonBevel, paint, rect(), colorGroup(), isDown() ? TQStyle::Style_Sunken : TQStyle::Style_Raised); drawButtonLabel(paint); if (hasFocus()) - tqstyle().tqdrawPrimitive(TQStyle::PE_FocusRect, paint, - tqstyle().subRect(TQStyle::SR_PushButtonFocusRect, this), + style().tqdrawPrimitive(TQStyle::PE_FocusRect, paint, + style().subRect(TQStyle::SR_PushButtonFocusRect, this), colorGroup(), TQStyle::Style_Default); } void StyledButton::drawButtonLabel( TQPainter *paint ) { TQColor pen = isEnabled() ? - hasFocus() ? tqpalette().active().buttonText() : tqpalette().inactive().buttonText() - : tqpalette().disabled().buttonText(); + hasFocus() ? palette().active().buttonText() : palette().inactive().buttonText() + : palette().disabled().buttonText(); paint->setPen( pen ); if(!isEnabled()) { @@ -184,7 +184,7 @@ void StyledButton::onEditor() { switch (edit) { case ColorEditor: { - TQColor c = TQColorDialog::getColor( tqpalette().active().background(), this ); + TQColor c = TQColorDialog::getColor( palette().active().background(), this ); if ( c.isValid() ) { setColor( c ); emit changed(); diff --git a/kdevdesigner/designer/widgetfactory.cpp b/kdevdesigner/designer/widgetfactory.cpp index 11d7b5d9..d27cfc30 100644 --- a/kdevdesigner/designer/widgetfactory.cpp +++ b/kdevdesigner/designer/widgetfactory.cpp @@ -553,11 +553,11 @@ TQWidget *WidgetFactory::create( int id, TQWidget *parent, const char *name, boo return w; } -/*! Creates a tqlayout on the widget \a widget of the type \a type +/*! Creates a layout on the widget \a widget of the type \a type which can be \c HBox, \c VBox or \c Grid. */ -TQLayout *WidgetFactory::createLayout( TQWidget *widget, TQLayout *tqlayout, LayoutType type ) +TQLayout *WidgetFactory::createLayout( TQWidget *widget, TQLayout *layout, LayoutType type ) { int spacing = MainWindow::self->currentLayoutDefaultSpacing(); int margin = 0; @@ -570,40 +570,40 @@ TQLayout *WidgetFactory::createLayout( TQWidget *widget, TQLayout *tqlayout, Lay widget && ::tqqt_cast<FormWindow*>(widget->parentWidget()) ) ) margin = MainWindow::self->currentLayoutDefaultMargin(); - if ( !tqlayout && ::tqqt_cast<TQTabWidget*>(widget) ) + if ( !layout && ::tqqt_cast<TQTabWidget*>(widget) ) widget = ((TQTabWidget*)widget)->currentPage(); - if ( !tqlayout && ::tqqt_cast<TQWizard*>(widget) ) + if ( !layout && ::tqqt_cast<TQWizard*>(widget) ) widget = ((TQWizard*)widget)->currentPage(); - if ( !tqlayout && ::tqqt_cast<TQMainWindow*>(widget) ) + if ( !layout && ::tqqt_cast<TQMainWindow*>(widget) ) widget = ((TQMainWindow*)widget)->centralWidget(); - if ( !tqlayout && ::tqqt_cast<TQWidgetStack*>(widget) ) + if ( !layout && ::tqqt_cast<TQWidgetStack*>(widget) ) widget = ((TQWidgetStack*)widget)->visibleWidget(); - if ( !tqlayout && ::tqqt_cast<TQToolBox*>(widget) ) + if ( !layout && ::tqqt_cast<TQToolBox*>(widget) ) widget = ((TQToolBox*)widget)->currentItem(); MetaDataBase::addEntry( TQT_TQOBJECT(widget) ); TQLayout *l = 0; int align = 0; - if ( !tqlayout && ::tqqt_cast<TQGroupBox*>(widget) ) { + if ( !layout && ::tqqt_cast<TQGroupBox*>(widget) ) { TQGroupBox *gb = (TQGroupBox*)widget; gb->setColumnLayout( 0, Qt::Vertical ); - tqlayout = gb->tqlayout(); - tqlayout->setMargin( 0 ); - tqlayout->setSpacing( 0 ); + layout = gb->layout(); + layout->setMargin( 0 ); + layout->setSpacing( 0 ); switch ( type ) { case HBox: - l = new TQHBoxLayout( tqlayout ); + l = new TQHBoxLayout( layout ); break; case VBox: - l = new TQVBoxLayout( tqlayout ); + l = new TQVBoxLayout( layout ); break; case Grid: - l = new QDesignerGridLayout( tqlayout ); + l = new QDesignerGridLayout( layout ); break; default: return 0; @@ -612,16 +612,16 @@ TQLayout *WidgetFactory::createLayout( TQWidget *widget, TQLayout *tqlayout, Lay MetaDataBase::setMargin( TQT_TQOBJECT(gb), metamargin ); MetaDataBase::setSpacing( TQT_TQOBJECT(gb), metaspacing ); } else { - if ( tqlayout ) { + if ( layout ) { switch ( type ) { case HBox: - l = new TQHBoxLayout( tqlayout ); + l = new TQHBoxLayout( layout ); break; case VBox: - l = new TQVBoxLayout( tqlayout ); + l = new TQVBoxLayout( layout ); break; case Grid: - l = new QDesignerGridLayout( tqlayout ); + l = new QDesignerGridLayout( layout ); break; default: return 0; @@ -673,7 +673,7 @@ void WidgetFactory::deleteLayout( TQWidget *widget ) widget = ((TQWidgetStack*)widget)->visibleWidget(); if ( ::tqqt_cast<TQToolBox*>(widget) ) widget = ((TQToolBox*)widget)->currentItem(); - delete widget->tqlayout(); + delete widget->layout(); } /*! Factory functions for creating a widget of the type \a className @@ -1001,14 +1001,14 @@ TQWidget *WidgetFactory::createWidget( const TQString &className, TQWidget *pare -/*! Find out which type the tqlayout of the widget is. Returns \c HBox, - \c VBox, \c Grid or \c NoLayout. \a tqlayout points to this - TQWidget::tqlayout() of \a w or to 0 after the function call. +/*! Find out which type the layout of the widget is. Returns \c HBox, + \c VBox, \c Grid or \c NoLayout. \a layout points to this + TQWidget::layout() of \a w or to 0 after the function call. */ -WidgetFactory::LayoutType WidgetFactory::layoutType( TQWidget *w, TQLayout *&tqlayout ) +WidgetFactory::LayoutType WidgetFactory::layoutType( TQWidget *w, TQLayout *&layout ) { - tqlayout = 0; + layout = 0; if ( ::tqqt_cast<TQTabWidget*>(w) ) w = ((TQTabWidget*)w)->currentPage(); @@ -1024,9 +1024,9 @@ WidgetFactory::LayoutType WidgetFactory::layoutType( TQWidget *w, TQLayout *&tql if ( ::tqqt_cast<TQSplitter*>(w) ) return ( (TQSplitter*)w )->orientation() ==Qt::Horizontal ? HBox : VBox; - if ( !w || !w->tqlayout() ) + if ( !w || !w->layout() ) return NoLayout; - TQLayout *lay = w->tqlayout(); + TQLayout *lay = w->layout(); if ( ::tqqt_cast<TQGroupBox*>(w) ) { TQObjectList *l = TQT_TQOBJECT(lay)->queryList( TQLAYOUT_OBJECT_NAME_STRING ); @@ -1034,7 +1034,7 @@ WidgetFactory::LayoutType WidgetFactory::layoutType( TQWidget *w, TQLayout *&tql lay = (TQLayout*)l->first(); delete l; } - tqlayout = lay; + layout = lay; if ( ::tqqt_cast<TQHBoxLayout*>(lay) ) return HBox; @@ -1048,13 +1048,13 @@ WidgetFactory::LayoutType WidgetFactory::layoutType( TQWidget *w, TQLayout *&tql /*! \overload */ -WidgetFactory::LayoutType WidgetFactory::layoutType( TQLayout *tqlayout ) +WidgetFactory::LayoutType WidgetFactory::layoutType( TQLayout *layout ) { - if ( ::tqqt_cast<TQHBoxLayout*>(tqlayout) ) + if ( ::tqqt_cast<TQHBoxLayout*>(layout) ) return HBox; - else if ( ::tqqt_cast<TQVBoxLayout*>(tqlayout) ) + else if ( ::tqqt_cast<TQVBoxLayout*>(layout) ) return VBox; - else if ( ::tqqt_cast<TQGridLayout*>(tqlayout) ) + else if ( ::tqqt_cast<TQGridLayout*>(layout) ) return Grid; return NoLayout; } @@ -1069,9 +1069,9 @@ WidgetFactory::LayoutType WidgetFactory::layoutType( TQWidget *w ) } -TQWidget *WidgetFactory::layoutParent( TQLayout *tqlayout ) +TQWidget *WidgetFactory::layoutParent( TQLayout *layout ) { - TQObject *o = TQT_TQOBJECT(tqlayout); + TQObject *o = TQT_TQOBJECT(layout); while ( o ) { if ( o->isWidgetType() ) return (TQWidget*)o; @@ -1601,7 +1601,7 @@ bool TQLayoutWidget::event( TQEvent *e ) /* This function must be called on TQLayoutWidget creation and whenever - the TQLayoutWidget's parent tqlayout changes (e.g., from a TQHBoxLayout + the TQLayoutWidget's parent layout changes (e.g., from a TQHBoxLayout to a TQVBoxLayout), because of the (illogical) way layouting works. */ void TQLayoutWidget::updateSizePolicy() @@ -1624,14 +1624,14 @@ void TQLayoutWidget::updateSizePolicy() int ht = (int) TQSizePolicy::Preferred; int vt = (int) TQSizePolicy::Preferred; - if ( tqlayout() ) { + if ( layout() ) { /* - parentLayout is set to the parent tqlayout if there is one and if it is + parentLayout is set to the parent layout if there is one and if it is top level, in which case layouting is illogical. */ TQLayout *parentLayout = 0; if ( parent() && parent()->isWidgetType() ) { - parentLayout = ((TQWidget *)parent())->tqlayout(); + parentLayout = ((TQWidget *)parent())->layout(); if ( parentLayout && ::tqqt_cast<TQLayoutWidget*>(parentLayout->mainWidget()) ) parentLayout = 0; @@ -1640,7 +1640,7 @@ void TQLayoutWidget::updateSizePolicy() TQObjectListIt it( childrenListObject() ); TQObject *o; - if ( ::tqqt_cast<TQVBoxLayout*>(tqlayout()) ) { + if ( ::tqqt_cast<TQVBoxLayout*>(layout()) ) { if ( ::tqqt_cast<TQHBoxLayout*>(parentLayout) ) vt = TQSizePolicy::Minimum; else @@ -1661,7 +1661,7 @@ void TQLayoutWidget::updateSizePolicy() if ( w->sizePolicy().mayShrinkVertically() ) vt |= TQSizePolicy::Maximum; } - } else if ( ::tqqt_cast<TQHBoxLayout*>(tqlayout()) ) { + } else if ( ::tqqt_cast<TQHBoxLayout*>(layout()) ) { if ( ::tqqt_cast<TQVBoxLayout*>(parentLayout) ) ht = TQSizePolicy::Minimum; else @@ -1682,7 +1682,7 @@ void TQLayoutWidget::updateSizePolicy() if ( !w->sizePolicy().mayShrinkVertically() ) vt &= ~TQSizePolicy::Maximum; } - } else if ( ::tqqt_cast<TQGridLayout*>(tqlayout()) ) { + } else if ( ::tqqt_cast<TQGridLayout*>(layout()) ) { ht = TQSizePolicy::Fixed; vt = TQSizePolicy::Fixed; if ( parentLayout ) { @@ -1709,19 +1709,19 @@ void TQLayoutWidget::updateSizePolicy() } } #ifdef USE_QT4 - if ( tqlayout()->expanding() & TQSizePolicy::Horizontally ) + if ( layout()->expanding() & TQSizePolicy::Horizontally ) #else // USE_QT4 - if ( tqlayout()->expanding() & TQSizePolicy::Horizontally ) + if ( layout()->expanding() & TQSizePolicy::Horizontally ) #endif // USE_QT4 ht = TQSizePolicy::Expanding; #ifdef USE_QT4 - if ( tqlayout()->expanding() & TQSizePolicy::Vertically ) + if ( layout()->expanding() & TQSizePolicy::Vertically ) #else // USE_QT4 - if ( tqlayout()->expanding() & TQSizePolicy::Vertically ) + if ( layout()->expanding() & TQSizePolicy::Vertically ) #endif // USE_QT4 vt = TQSizePolicy::Expanding; - tqlayout()->invalidate(); + layout()->invalidate(); } sp = TQSizePolicy( (TQSizePolicy::SizeType) ht, (TQSizePolicy::SizeType) vt ); diff --git a/kdevdesigner/designer/widgetfactory.h b/kdevdesigner/designer/widgetfactory.h index a2bf5ff1..80c43f8f 100644 --- a/kdevdesigner/designer/widgetfactory.h +++ b/kdevdesigner/designer/widgetfactory.h @@ -78,13 +78,13 @@ public: static TQWidget *create( int id, TQWidget *parent, const char *name = 0, bool init = TRUE, const TQRect *rect = 0, Qt::Orientation orient = Qt::Horizontal ); - static TQLayout *createLayout( TQWidget *widget, TQLayout* tqlayout, LayoutType type ); + static TQLayout *createLayout( TQWidget *widget, TQLayout* layout, LayoutType type ); static void deleteLayout( TQWidget *widget ); static LayoutType layoutType( TQWidget *w ); - static LayoutType layoutType( TQWidget *w, TQLayout *&tqlayout ); - static LayoutType layoutType( TQLayout *tqlayout ); - static TQWidget *layoutParent( TQLayout *tqlayout ); + static LayoutType layoutType( TQWidget *w, TQLayout *&layout ); + static LayoutType layoutType( TQLayout *layout ); + static TQWidget *layoutParent( TQLayout *layout ); static TQWidget* containerOfWidget( TQWidget *w ); static TQWidget* widgetOfContainer( TQWidget *w ); diff --git a/kdevdesigner/designer/workspace.cpp b/kdevdesigner/designer/workspace.cpp index 28514b22..5845e516 100644 --- a/kdevdesigner/designer/workspace.cpp +++ b/kdevdesigner/designer/workspace.cpp @@ -121,8 +121,8 @@ void WorkspaceItem::paintCell( TQPainter *p, const TQColorGroup &cg, int column, ( !formFile->hasFormCode() || ( formFile->codeFileState() == FormFile::Deleted && formFile->formWindow() ) ) && parent() && parent()->parent() && ( (WorkspaceItem*)parent()->parent() )->project && ( (WorkspaceItem*)parent()->parent() )->project->isCpp() ) { - g.setColor( TQColorGroup::Text, listView()->tqpalette().disabled().color( TQColorGroup::Text) ); - g.setColor( TQColorGroup::HighlightedText, listView()->tqpalette().disabled().color( TQColorGroup::Text) ); + g.setColor( TQColorGroup::Text, listView()->palette().disabled().color( TQColorGroup::Text) ); + g.setColor( TQColorGroup::HighlightedText, listView()->palette().disabled().color( TQColorGroup::Text) ); } else { g.setColor( TQColorGroup::Text, TQt::black ); } diff --git a/kdevdesigner/shared/ui2uib.cpp b/kdevdesigner/shared/ui2uib.cpp index 66cddfbb..5cff46e0 100644 --- a/kdevdesigner/shared/ui2uib.cpp +++ b/kdevdesigner/shared/ui2uib.cpp @@ -470,7 +470,7 @@ static void outputLayoutWidgetsSubLayout( TQMap<int, TQStringList>& buddies, if ( subLayoutNo != -1 ) { /* - Remove the sub-tqlayout's Object_End marker, append the grid + Remove the sub-layout's Object_End marker, append the grid cell and the correct name property, and put the Object_End marker back. */ diff --git a/kdevdesigner/uilib/qwidgetfactory.cpp b/kdevdesigner/uilib/qwidgetfactory.cpp index f2a326a3..5c7c70b9 100644 --- a/kdevdesigner/uilib/qwidgetfactory.cpp +++ b/kdevdesigner/uilib/qwidgetfactory.cpp @@ -907,7 +907,7 @@ TQObject *TQWidgetFactory::inputObject( TQObject **objects, int& numObjects, { TQObject *obj = 0; TQWidget *widget = 0; - TQLayout *tqlayout = 0; + TQLayout *layout = 0; TQWidget *parentWidget = 0; TQLayout *parentLayout = 0; @@ -942,11 +942,11 @@ TQObject *TQWidgetFactory::inputObject( TQObject **objects, int& numObjects, type = VBox; } if ( parentLayout != 0 && parentLayout->inherits(TQGRIDLAYOUT_OBJECT_NAME_STRING) ) { - tqlayout = createLayout( 0, 0, type ); + layout = createLayout( 0, 0, type ); } else { - tqlayout = createLayout( parentWidget, parentLayout, type ); + layout = createLayout( parentWidget, parentLayout, type ); } - obj = TQT_TQOBJECT(tqlayout); + obj = TQT_TQOBJECT(layout); } else if ( className == TQMENUBAR_OBJECT_NAME_STRING ) { unpackCString( strings, in, className ); widget = ((TQMainWindow *) parent)->menuBar(); @@ -1092,7 +1092,7 @@ TQObject *TQWidgetFactory::inputObject( TQObject **objects, int& numObjects, inputColumnOrRow( strings, in, obj, TRUE ); break; case Object_Spacer: - inputSpacer( strings, in, tqlayout ); + inputSpacer( strings, in, layout ); break; case Object_Separator: ((TQToolBar *) widget)->addSeparator(); @@ -1160,10 +1160,10 @@ TQObject *TQWidgetFactory::inputObject( TQObject **objects, int& numObjects, } else { ((TQBoxLayout *) parentLayout)->addWidget( widget ); } - } else if ( tqlayout != 0 ) { + } else if ( layout != 0 ) { if ( parentLayout->inherits(TQGRIDLAYOUT_OBJECT_NAME_STRING) ) { ((TQGridLayout *) parentLayout)->addMultiCellLayout( - tqlayout, row, row + rowspan - 1, column, + layout, row, row + rowspan - 1, column, column + colspan - 1 ); } } @@ -1568,7 +1568,7 @@ bool TQWidgetFactory::supportsWidget( const TQString &widget ) } TQWidget *TQWidgetFactory::createWidgetInternal( const TQDomElement &e, TQWidget *parent, - TQLayout* tqlayout, const TQString &classNameArg ) + TQLayout* layout, const TQString &classNameArg ) { d->lastItem = 0; TQDomElement n = e.firstChild().toElement(); @@ -1589,12 +1589,12 @@ TQWidget *TQWidgetFactory::createWidgetInternal( const TQDomElement &e, TQWidget bool isTQLayoutWidget = FALSE; if ( !className.isEmpty() ) { - if ( !tqlayout && className == TQLAYOUTWIDGET_OBJECT_NAME_STRING ) { + if ( !layout && className == TQLAYOUTWIDGET_OBJECT_NAME_STRING ) { className = TQWIDGET_OBJECT_NAME_STRING; isTQLayoutWidget = TRUE; } - if ( tqlayout && className == TQLAYOUTWIDGET_OBJECT_NAME_STRING ) { - // hide tqlayout widgets + if ( layout && className == TQLAYOUTWIDGET_OBJECT_NAME_STRING ) { + // hide layout widgets w = parent; } else { obj = TQT_TQOBJECT(TQWidgetFactory::createWidget( className, parent, 0 )); @@ -1605,16 +1605,16 @@ TQWidget *TQWidgetFactory::createWidgetInternal( const TQDomElement &e, TQWidget toplevel = w; if ( w->inherits( TQMAINWINDOW_OBJECT_NAME_STRING ) ) w = ( (TQMainWindow*)w )->centralWidget(); - if ( tqlayout ) { - switch( layoutType( tqlayout ) ) { + if ( layout ) { + switch( layoutType( layout ) ) { case HBox: - ( (TQHBoxLayout*)tqlayout )->addWidget( w ); + ( (TQHBoxLayout*)layout )->addWidget( w ); break; case VBox: - ( (TQVBoxLayout*)tqlayout )->addWidget( w ); + ( (TQVBoxLayout*)layout )->addWidget( w ); break; case Grid: - ( (TQGridLayout*)tqlayout )->addMultiCellWidget( w, row, row + rowspan - 1, + ( (TQGridLayout*)layout )->addMultiCellWidget( w, row, row + rowspan - 1, col, col + colspan - 1 ); break; default: @@ -1622,7 +1622,7 @@ TQWidget *TQWidgetFactory::createWidgetInternal( const TQDomElement &e, TQWidget } } - tqlayout = 0; + layout = 0; } } #ifdef TQT_CONTAINER_CUSTOM_WIDGETS @@ -1636,45 +1636,45 @@ TQWidget *TQWidgetFactory::createWidgetInternal( const TQDomElement &e, TQWidget int idx = 0; while ( !n.isNull() ) { if ( n.tagName() == "spacer" ) { - createSpacer( n, tqlayout ); + createSpacer( n, layout ); } else if ( n.tagName() == "widget" ) { TQMap< TQString, TQString> *oldDbControls = dbControls; - createWidgetInternal( n, w, tqlayout, n.attribute( "class", TQWIDGET_OBJECT_NAME_STRING ) ); + createWidgetInternal( n, w, layout, n.attribute( "class", TQWIDGET_OBJECT_NAME_STRING ) ); dbControls = oldDbControls; } else if ( n.tagName() == "hbox" ) { - TQLayout *parentLayout = tqlayout; - if ( tqlayout && tqlayout->inherits( TQGRIDLAYOUT_OBJECT_NAME_STRING ) ) - tqlayout = createLayout( 0, 0, TQWidgetFactory::HBox, isTQLayoutWidget ); + TQLayout *parentLayout = layout; + if ( layout && layout->inherits( TQGRIDLAYOUT_OBJECT_NAME_STRING ) ) + layout = createLayout( 0, 0, TQWidgetFactory::HBox, isTQLayoutWidget ); else - tqlayout = createLayout( w, tqlayout, TQWidgetFactory::HBox, isTQLayoutWidget ); - obj = TQT_TQOBJECT(tqlayout); + layout = createLayout( w, layout, TQWidgetFactory::HBox, isTQLayoutWidget ); + obj = TQT_TQOBJECT(layout); n = n.firstChild().toElement(); if ( parentLayout && parentLayout->inherits( TQGRIDLAYOUT_OBJECT_NAME_STRING ) ) - ( (TQGridLayout*)parentLayout )->addMultiCellLayout( tqlayout, row, + ( (TQGridLayout*)parentLayout )->addMultiCellLayout( layout, row, row + rowspan - 1, col, col + colspan - 1 ); continue; } else if ( n.tagName() == "grid" ) { - TQLayout *parentLayout = tqlayout; - if ( tqlayout && tqlayout->inherits( TQGRIDLAYOUT_OBJECT_NAME_STRING ) ) - tqlayout = createLayout( 0, 0, TQWidgetFactory::Grid, isTQLayoutWidget ); + TQLayout *parentLayout = layout; + if ( layout && layout->inherits( TQGRIDLAYOUT_OBJECT_NAME_STRING ) ) + layout = createLayout( 0, 0, TQWidgetFactory::Grid, isTQLayoutWidget ); else - tqlayout = createLayout( w, tqlayout, TQWidgetFactory::Grid, isTQLayoutWidget ); - obj = TQT_TQOBJECT(tqlayout); + layout = createLayout( w, layout, TQWidgetFactory::Grid, isTQLayoutWidget ); + obj = TQT_TQOBJECT(layout); n = n.firstChild().toElement(); if ( parentLayout && parentLayout->inherits( TQGRIDLAYOUT_OBJECT_NAME_STRING ) ) - ( (TQGridLayout*)parentLayout )->addMultiCellLayout( tqlayout, row, + ( (TQGridLayout*)parentLayout )->addMultiCellLayout( layout, row, row + rowspan - 1, col, col + colspan - 1 ); continue; } else if ( n.tagName() == "vbox" ) { - TQLayout *parentLayout = tqlayout; - if ( tqlayout && tqlayout->inherits( TQGRIDLAYOUT_OBJECT_NAME_STRING ) ) - tqlayout = createLayout( 0, 0, TQWidgetFactory::VBox, isTQLayoutWidget ); + TQLayout *parentLayout = layout; + if ( layout && layout->inherits( TQGRIDLAYOUT_OBJECT_NAME_STRING ) ) + layout = createLayout( 0, 0, TQWidgetFactory::VBox, isTQLayoutWidget ); else - tqlayout = createLayout( w, tqlayout, TQWidgetFactory::VBox, isTQLayoutWidget ); - obj = TQT_TQOBJECT(tqlayout); + layout = createLayout( w, layout, TQWidgetFactory::VBox, isTQLayoutWidget ); + obj = TQT_TQOBJECT(layout); n = n.firstChild().toElement(); if ( parentLayout && parentLayout->inherits( TQGRIDLAYOUT_OBJECT_NAME_STRING ) ) - ( (TQGridLayout*)parentLayout )->addMultiCellLayout( tqlayout, row, + ( (TQGridLayout*)parentLayout )->addMultiCellLayout( layout, row, row + rowspan - 1, col, col + colspan - 1 ); continue; } else if ( n.tagName() == "property" && obj ) { @@ -1728,47 +1728,47 @@ TQWidget *TQWidgetFactory::createWidgetInternal( const TQDomElement &e, TQWidget return w; } -TQLayout *TQWidgetFactory::createLayout( TQWidget *widget, TQLayout* tqlayout, +TQLayout *TQWidgetFactory::createLayout( TQWidget *widget, TQLayout* layout, LayoutType type, bool isTQLayoutWidget ) { int spacing = defSpacing; int margin = defMargin; - if ( tqlayout || !widget || isTQLayoutWidget ) + if ( layout || !widget || isTQLayoutWidget ) margin = 0; - if ( !tqlayout && widget && widget->inherits( TQTABWIDGET_OBJECT_NAME_STRING ) ) + if ( !layout && widget && widget->inherits( TQTABWIDGET_OBJECT_NAME_STRING ) ) widget = ((TQTabWidget*)widget)->currentPage(); - if ( !tqlayout && widget && widget->inherits( TQWIZARD_OBJECT_NAME_STRING ) ) + if ( !layout && widget && widget->inherits( TQWIZARD_OBJECT_NAME_STRING ) ) widget = ((TQWizard*)widget)->currentPage(); - if ( !tqlayout && widget && widget->inherits( TQWIDGETSTACK_OBJECT_NAME_STRING ) ) + if ( !layout && widget && widget->inherits( TQWIDGETSTACK_OBJECT_NAME_STRING ) ) widget = ((TQWidgetStack*)widget)->visibleWidget(); - if ( !tqlayout && widget && widget->inherits( TQTOOLBOX_OBJECT_NAME_STRING ) ) + if ( !layout && widget && widget->inherits( TQTOOLBOX_OBJECT_NAME_STRING ) ) widget = ((TQToolBox*)widget)->currentItem(); TQLayout *l = 0; int align = 0; - if ( !tqlayout && widget && widget->inherits( TQGROUPBOX_OBJECT_NAME_STRING ) ) { + if ( !layout && widget && widget->inherits( TQGROUPBOX_OBJECT_NAME_STRING ) ) { TQGroupBox *gb = (TQGroupBox*)widget; gb->setColumnLayout( 0, Qt::Vertical ); - tqlayout = gb->tqlayout(); - tqlayout->setMargin( 0 ); - tqlayout->setSpacing( 0 ); + layout = gb->layout(); + layout->setMargin( 0 ); + layout->setSpacing( 0 ); align = TQt::AlignTop; } - if ( tqlayout ) { + if ( layout ) { switch ( type ) { case HBox: - l = new TQHBoxLayout( tqlayout ); + l = new TQHBoxLayout( layout ); break; case VBox: - l = new TQVBoxLayout( tqlayout ); + l = new TQVBoxLayout( layout ); break; case Grid: - l = new TQGridLayout( tqlayout ); + l = new TQGridLayout( layout ); break; default: return 0; @@ -1794,13 +1794,13 @@ TQLayout *TQWidgetFactory::createLayout( TQWidget *widget, TQLayout* tqlayout, return l; } -TQWidgetFactory::LayoutType TQWidgetFactory::layoutType( TQLayout *tqlayout ) const +TQWidgetFactory::LayoutType TQWidgetFactory::layoutType( TQLayout *layout ) const { - if ( tqlayout->inherits( TQHBOXLAYOUT_OBJECT_NAME_STRING ) ) + if ( layout->inherits( TQHBOXLAYOUT_OBJECT_NAME_STRING ) ) return HBox; - else if ( tqlayout->inherits( TQVBOXLAYOUT_OBJECT_NAME_STRING ) ) + else if ( layout->inherits( TQVBOXLAYOUT_OBJECT_NAME_STRING ) ) return VBox; - else if ( tqlayout->inherits( TQGRIDLAYOUT_OBJECT_NAME_STRING ) ) + else if ( layout->inherits( TQGRIDLAYOUT_OBJECT_NAME_STRING ) ) return Grid; return NoLayout; } @@ -1917,7 +1917,7 @@ void TQWidgetFactory::setProperty( TQObject* widget, const TQString &prop, const setProperty( widget, prop, value ); } -void TQWidgetFactory::createSpacer( const TQDomElement &e, TQLayout *tqlayout ) +void TQWidgetFactory::createSpacer( const TQDomElement &e, TQLayout *layout ) { TQDomElement n = e.firstChild().toElement(); int row = e.attribute( "row" ).toInt(); @@ -1952,11 +1952,11 @@ void TQWidgetFactory::createSpacer( const TQDomElement &e, TQLayout *tqlayout ) colspan = 1; TQSpacerItem *item = new TQSpacerItem( w, h, orient == Qt::Horizontal ? sizeType : TQSizePolicy::Minimum, orient == Qt::Vertical ? sizeType : TQSizePolicy::Minimum ); - if ( tqlayout ) { - if ( tqlayout->inherits( TQBOXLAYOUT_OBJECT_NAME_STRING ) ) - ( (TQBoxLayout*)tqlayout )->addItem( item ); + if ( layout ) { + if ( layout->inherits( TQBOXLAYOUT_OBJECT_NAME_STRING ) ) + ( (TQBoxLayout*)layout )->addItem( item ); else - ( (TQGridLayout*)tqlayout )->addMultiCell( item, row, row + rowspan - 1, col, col + colspan - 1, + ( (TQGridLayout*)layout )->addMultiCell( item, row, row + rowspan - 1, col, col + colspan - 1, orient == Qt::Horizontal ? TQt::AlignVCenter : TQt::AlignHCenter ); } } diff --git a/kdevdesigner/uilib/qwidgetfactory.h b/kdevdesigner/uilib/qwidgetfactory.h index c6770341..8f2b1427 100644 --- a/kdevdesigner/uilib/qwidgetfactory.h +++ b/kdevdesigner/uilib/qwidgetfactory.h @@ -66,12 +66,12 @@ private: void loadImageCollection( const TQDomElement &e ); void loadConnections( const TQDomElement &e, TQObject *connector ); void loadTabOrder( const TQDomElement &e ); - TQWidget *createWidgetInternal( const TQDomElement &e, TQWidget *parent, TQLayout* tqlayout, const TQString &classNameArg ); - TQLayout *createLayout( TQWidget *widget, TQLayout* tqlayout, LayoutType type, bool isTQLayoutWidget = FALSE ); + TQWidget *createWidgetInternal( const TQDomElement &e, TQWidget *parent, TQLayout* layout, const TQString &classNameArg ); + TQLayout *createLayout( TQWidget *widget, TQLayout* layout, LayoutType type, bool isTQLayoutWidget = FALSE ); LayoutType layoutType( TQLayout *l ) const; void setProperty( TQObject* widget, const TQString &prop, TQVariant value ); void setProperty( TQObject* widget, const TQString &prop, const TQDomElement &e ); - void createSpacer( const TQDomElement &e, TQLayout *tqlayout ); + void createSpacer( const TQDomElement &e, TQLayout *layout ); TQImage loadFromCollection( const TQString &name ); TQPixmap loadPixmap( const TQString &name ); TQPixmap loadPixmap( const TQDomElement &e ); |