diff options
Diffstat (limited to 'kdevdesigner/designer/widgetfactory.cpp')
-rw-r--r-- | kdevdesigner/designer/widgetfactory.cpp | 72 |
1 files changed, 36 insertions, 36 deletions
diff --git a/kdevdesigner/designer/widgetfactory.cpp b/kdevdesigner/designer/widgetfactory.cpp index 5d47c863..c4b0b947 100644 --- a/kdevdesigner/designer/widgetfactory.cpp +++ b/kdevdesigner/designer/widgetfactory.cpp @@ -109,9 +109,9 @@ FormWindow *find_formwindow( TQWidget *w ) for (;;) { if ( ::tqqt_cast<FormWindow*>(w) ) return (FormWindow*)w; - if ( !w->tqparentWidget() ) + if ( !w->parentWidget() ) return 0; - w = w->tqparentWidget(); + w = w->parentWidget(); } } @@ -486,10 +486,10 @@ TQMap< int, TQStringList > *changedProperties = 0; /*! \class WidgetFactory widgetfactory.h - \brief Set of static functions for creating widgets, tqlayouts and do other stuff + \brief Set of static functions for creating widgets, layouts and do other stuff The widget factory offers functions to create widgets, create and - delete tqlayouts find out other details - all based on the + delete layouts find out other details - all based on the WidgetDatabase's data. So the functions that use ids use the same ids as in the WidgetDatabase. */ @@ -567,7 +567,7 @@ TQLayout *WidgetFactory::createLayout( TQWidget *widget, TQLayout *tqlayout, Lay if ( ::tqqt_cast<TQLayoutWidget*>(widget) && ( WidgetDatabase::isContainer( WidgetDatabase::idFromClassName( WidgetFactory::classNameOf( TQT_TQOBJECT(widget) ) ) ) || - widget && ::tqqt_cast<FormWindow*>(widget->tqparentWidget()) ) ) + widget && ::tqqt_cast<FormWindow*>(widget->parentWidget()) ) ) margin = MainWindow::self->currentLayoutDefaultMargin(); if ( !tqlayout && ::tqqt_cast<TQTabWidget*>(widget) ) @@ -1006,7 +1006,7 @@ TQWidget *WidgetFactory::createWidget( const TQString &className, TQWidget *tqpa TQWidget::tqlayout() of \a w or to 0 after the function call. */ -WidgetFactory::LayoutType WidgetFactory::tqlayoutType( TQWidget *w, TQLayout *&tqlayout ) +WidgetFactory::LayoutType WidgetFactory::layoutType( TQWidget *w, TQLayout *&tqlayout ) { tqlayout = 0; @@ -1048,7 +1048,7 @@ WidgetFactory::LayoutType WidgetFactory::tqlayoutType( TQWidget *w, TQLayout *&t /*! \overload */ -WidgetFactory::LayoutType WidgetFactory::tqlayoutType( TQLayout *tqlayout ) +WidgetFactory::LayoutType WidgetFactory::layoutType( TQLayout *tqlayout ) { if ( ::tqqt_cast<TQHBoxLayout*>(tqlayout) ) return HBox; @@ -1062,14 +1062,14 @@ WidgetFactory::LayoutType WidgetFactory::tqlayoutType( TQLayout *tqlayout ) /*! \overload */ -WidgetFactory::LayoutType WidgetFactory::tqlayoutType( TQWidget *w ) +WidgetFactory::LayoutType WidgetFactory::layoutType( TQWidget *w ) { TQLayout *l = 0; - return tqlayoutType( w, l ); + return layoutType( w, l ); } -TQWidget *WidgetFactory::tqlayoutParent( TQLayout *tqlayout ) +TQWidget *WidgetFactory::layoutParent( TQLayout *tqlayout ) { TQObject *o = TQT_TQOBJECT(tqlayout); while ( o ) { @@ -1126,25 +1126,25 @@ TQWidget* WidgetFactory::containerOfWidget( TQWidget *w ) /*! Returns the actual designer widget of the container \a w. This is normally \a w itself, but might be a tqparent or grand tqparent of \a w (e.g. when working with a tabwidget and \a w is the container which - contains and tqlayouts childs, but the actual widget known to the + contains and layouts childs, but the actual widget known to the designer is the tabwidget which is the tqparent of \a w. So this function returns the tabwidget then.) */ TQWidget* WidgetFactory::widgetOfContainer( TQWidget *w ) { - if ( w && ::tqqt_cast<TQWidgetStack*>(w->tqparentWidget()) ) - w = w->tqparentWidget(); - if ( w->tqparentWidget() && w->tqparentWidget()->tqparentWidget() && - w->tqparentWidget()->tqparentWidget()->tqparentWidget() && - ::tqqt_cast<TQToolBox*>(w->tqparentWidget()->tqparentWidget()->tqparentWidget()) ) - return w->tqparentWidget()->tqparentWidget()->tqparentWidget(); + if ( w && ::tqqt_cast<TQWidgetStack*>(w->parentWidget()) ) + w = w->parentWidget(); + if ( w->parentWidget() && w->parentWidget()->parentWidget() && + w->parentWidget()->parentWidget()->parentWidget() && + ::tqqt_cast<TQToolBox*>(w->parentWidget()->parentWidget()->parentWidget()) ) + return w->parentWidget()->parentWidget()->parentWidget(); while ( w ) { int id = WidgetDatabase::idFromClassName( WidgetFactory::classNameOf( TQT_TQOBJECT(w) ) ); if ( WidgetDatabase::isContainer( id ) || - w && ::tqqt_cast<FormWindow*>(w->tqparentWidget()) ) + w && ::tqqt_cast<FormWindow*>(w->parentWidget()) ) return w; - w = w->tqparentWidget(); + w = w->parentWidget(); } return w; } @@ -1191,7 +1191,7 @@ bool WidgetFactory::isPassiveInteractor( TQObject* o ) TQWidget *w = (TQWidget*)o; while ( !iface && w && !::tqqt_cast<FormWindow*>(w) ) { widgetManager()->queryInterface( classNameOf( w ), &iface ); - w = w->tqparentWidget(); + w = w->parentWidget(); } if ( !iface ) return ( lastWasAPassiveInteractor = FALSE ); @@ -1487,7 +1487,7 @@ TQVariant WidgetFactory::defaultValue( TQObject *w, const TQString &propName ) return TQVariant(); } else if ( propName == "frameworkCode" ) { return TQVariant( TRUE, 0 ); - } else if ( propName == "tqlayoutMargin" || propName == "tqlayoutSpacing" ) { + } else if ( propName == "layoutMargin" || propName == "layoutSpacing" ) { return TQVariant( -1 ); } @@ -1602,7 +1602,7 @@ bool TQLayoutWidget::event( TQEvent *e ) /* This function must be called on TQLayoutWidget creation and whenever the TQLayoutWidget's tqparent tqlayout changes (e.g., from a TQHBoxLayout - to a TQVBoxLayout), because of the (illogical) way tqlayouting works. + to a TQVBoxLayout), because of the (illogical) way layouting works. */ void TQLayoutWidget::updateSizePolicy() { @@ -1626,22 +1626,22 @@ void TQLayoutWidget::updateSizePolicy() if ( tqlayout() ) { /* - tqparentLayout is set to the tqparent tqlayout if there is one and if it is - top level, in which case tqlayouting is illogical. + parentLayout is set to the tqparent tqlayout if there is one and if it is + top level, in which case layouting is illogical. */ - TQLayout *tqparentLayout = 0; + TQLayout *parentLayout = 0; if ( tqparent() && tqparent()->isWidgetType() ) { - tqparentLayout = ((TQWidget *)tqparent())->tqlayout(); - if ( tqparentLayout && - ::tqqt_cast<TQLayoutWidget*>(tqparentLayout->mainWidget()) ) - tqparentLayout = 0; + parentLayout = ((TQWidget *)tqparent())->tqlayout(); + if ( parentLayout && + ::tqqt_cast<TQLayoutWidget*>(parentLayout->mainWidget()) ) + parentLayout = 0; } TQObjectListIt it( childrenListObject() ); TQObject *o; if ( ::tqqt_cast<TQVBoxLayout*>(tqlayout()) ) { - if ( ::tqqt_cast<TQHBoxLayout*>(tqparentLayout) ) + if ( ::tqqt_cast<TQHBoxLayout*>(parentLayout) ) vt = TQSizePolicy::Minimum; else vt = TQSizePolicy::Fixed; @@ -1662,7 +1662,7 @@ void TQLayoutWidget::updateSizePolicy() vt |= TQSizePolicy::Maximum; } } else if ( ::tqqt_cast<TQHBoxLayout*>(tqlayout()) ) { - if ( ::tqqt_cast<TQVBoxLayout*>(tqparentLayout) ) + if ( ::tqqt_cast<TQVBoxLayout*>(parentLayout) ) ht = TQSizePolicy::Minimum; else ht = TQSizePolicy::Fixed; @@ -1685,10 +1685,10 @@ void TQLayoutWidget::updateSizePolicy() } else if ( ::tqqt_cast<TQGridLayout*>(tqlayout()) ) { ht = TQSizePolicy::Fixed; vt = TQSizePolicy::Fixed; - if ( tqparentLayout ) { - if ( ::tqqt_cast<TQVBoxLayout*>(tqparentLayout) ) + if ( parentLayout ) { + if ( ::tqqt_cast<TQVBoxLayout*>(parentLayout) ) ht = TQSizePolicy::Minimum; - else if ( ::tqqt_cast<TQHBoxLayout*>(tqparentLayout) ) + else if ( ::tqqt_cast<TQHBoxLayout*>(parentLayout) ) vt = TQSizePolicy::Minimum; } @@ -1730,8 +1730,8 @@ void TQLayoutWidget::updateSizePolicy() void CustomWidget::paintEvent( TQPaintEvent *e ) { - if ( ::tqqt_cast<FormWindow*>(tqparentWidget()) ) { - ( (FormWindow*)tqparentWidget() )->paintGrid( this, e ); + if ( ::tqqt_cast<FormWindow*>(parentWidget()) ) { + ( (FormWindow*)parentWidget() )->paintGrid( this, e ); } else { TQPainter p( this ); p.fillRect( rect(), tqcolorGroup().dark() ); |