diff options
Diffstat (limited to 'kdevdesigner/designer/resource.cpp')
-rw-r--r-- | kdevdesigner/designer/resource.cpp | 80 |
1 files changed, 40 insertions, 40 deletions
diff --git a/kdevdesigner/designer/resource.cpp b/kdevdesigner/designer/resource.cpp index 74ef9862..0d83cb1e 100644 --- a/kdevdesigner/designer/resource.cpp +++ b/kdevdesigner/designer/resource.cpp @@ -761,7 +761,7 @@ TQString Resource::copy() } -void Resource::paste( const TQString &cb, TQWidget *tqparent ) +void Resource::paste( const TQString &cb, TQWidget *parent ) { if ( !formwindow ) return; @@ -795,30 +795,30 @@ void Resource::paste( const TQString &cb, TQWidget *tqparent ) formwindow->clearSelection( FALSE ); while ( !firstWidget.isNull() ) { if ( firstWidget.tagName() == "widget" ) { - TQWidget *w = (TQWidget*)createObject( firstWidget, tqparent, 0 ); + TQWidget *w = (TQWidget*)createObject( firstWidget, parent, 0 ); if ( !w ) continue; widgets.append( w ); int x = w->x() + formwindow->grid().x(); int y = w->y() + formwindow->grid().y(); - if ( w->x() + w->width() > tqparent->width() ) - x = TQMAX( 0, tqparent->width() - w->width() ); - if ( w->y() + w->height() > tqparent->height() ) - y = TQMAX( 0, tqparent->height() - w->height() ); + if ( w->x() + w->width() > parent->width() ) + x = TQMAX( 0, parent->width() - w->width() ); + if ( w->y() + w->height() > parent->height() ) + y = TQMAX( 0, parent->height() - w->height() ); if ( x != w->x() || y != w->y() ) w->move( x, y ); formwindow->selectWidget( TQT_TQOBJECT(w) ); } else if ( firstWidget.tagName() == "spacer" ) { - TQWidget *w = createSpacer( firstWidget, tqparent, 0, firstWidget.tagName() == "vspacer" ? Qt::Vertical : Qt::Horizontal ); + TQWidget *w = createSpacer( firstWidget, parent, 0, firstWidget.tagName() == "vspacer" ? Qt::Vertical : Qt::Horizontal ); if ( !w ) continue; widgets.append( w ); int x = w->x() + formwindow->grid().x(); int y = w->y() + formwindow->grid().y(); - if ( w->x() + w->width() > tqparent->width() ) - x = TQMAX( 0, tqparent->width() - w->width() ); - if ( w->y() + w->height() > tqparent->height() ) - y = TQMAX( 0, tqparent->height() - w->height() ); + if ( w->x() + w->width() > parent->width() ) + x = TQMAX( 0, parent->width() - w->width() ); + if ( w->y() + w->height() > parent->height() ) + y = TQMAX( 0, parent->height() - w->height() ); if ( x != w->x() || y != w->y() ) w->move( x, y ); formwindow->selectWidget( TQT_TQOBJECT(w) ); @@ -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 *tqparent, TQLayout* tqlayout ) +TQObject *Resource::createObject( const TQDomElement &e, TQWidget *parent, TQLayout* tqlayout ) { lastItem = 0; TQDomElement n = e.firstChild().toElement(); @@ -1774,7 +1774,7 @@ TQObject *Resource::createObject( const TQDomElement &e, TQWidget *tqparent, TQL TQString className = e.attribute( "class", TQWIDGET_OBJECT_NAME_STRING ); #ifdef TQT_CONTAINER_CUSTOM_WIDGETS - TQString parentClassName = WidgetFactory::classNameOf( tqparent ); + TQString parentClassName = WidgetFactory::classNameOf( parent ); bool isPlugin = WidgetDatabase::isCustomPluginWidget( WidgetDatabase::idFromClassName( parentClassName ) ); if ( isPlugin ) @@ -1782,7 +1782,7 @@ TQObject *Resource::createObject( const TQDomElement &e, TQWidget *tqparent, TQL // ### TODO loading for custom container widgets without pages #endif if ( !className.isNull() ) { - obj = TQT_TQOBJECT(WidgetFactory::create( WidgetDatabase::idFromClassName( className ), tqparent, 0, FALSE )); + obj = TQT_TQOBJECT(WidgetFactory::create( WidgetDatabase::idFromClassName( className ), parent, 0, FALSE )); if ( !obj ) { TQMessageBox::critical( MainWindow::self, i18n( "Loading File" ), i18n( "Error loading %1.\n" @@ -1820,21 +1820,21 @@ TQObject *Resource::createObject( const TQDomElement &e, TQWidget *tqparent, TQL tqlayout = 0; if ( w && formwindow ) { - if ( !tqparent || - ( !::tqqt_cast<TQTabWidget*>(tqparent) && - !::tqqt_cast<TQWidgetStack*>(tqparent) && - !::tqqt_cast<TQToolBox*>(tqparent) && - !::tqqt_cast<TQWizard*>(tqparent) + if ( !parent || + ( !::tqqt_cast<TQTabWidget*>(parent) && + !::tqqt_cast<TQWidgetStack*>(parent) && + !::tqqt_cast<TQToolBox*>(parent) && + !::tqqt_cast<TQWizard*>(parent) #ifdef TQT_CONTAINER_CUSTOM_WIDGETS && !isPlugin #endif ) ) formwindow->insertWidget( w, pasting ); - else if ( tqparent && - ( ::tqqt_cast<TQTabWidget*>(tqparent) || - ::tqqt_cast<TQWidgetStack*>(tqparent) || - ::tqqt_cast<TQToolBox*>(tqparent) || - ::tqqt_cast<TQWizard*>(tqparent) + else if ( parent && + ( ::tqqt_cast<TQTabWidget*>(parent) || + ::tqqt_cast<TQWidgetStack*>(parent) || + ::tqqt_cast<TQToolBox*>(parent) || + ::tqqt_cast<TQWizard*>(parent) #ifdef TQT_CONTAINER_CUSTOM_WIDGETS || isPlugin #endif @@ -1877,18 +1877,18 @@ TQObject *Resource::createObject( const TQDomElement &e, TQWidget *tqparent, TQL } else if ( n.tagName() == "attribute" && w ) { TQString attrib = n.attribute( "name" ); TQVariant v = DomTool::elementToVariant( n.firstChild().toElement(), TQVariant() ); - if ( ::tqqt_cast<TQTabWidget*>(tqparent) ) { + if ( ::tqqt_cast<TQTabWidget*>(parent) ) { if ( attrib == "title" ) - ( (TQTabWidget*)tqparent )->insertTab( w, v.toString() ); - } else if ( ::tqqt_cast<TQWidgetStack*>(tqparent) ) { + ( (TQTabWidget*)parent )->insertTab( w, v.toString() ); + } else if ( ::tqqt_cast<TQWidgetStack*>(parent) ) { if ( attrib == "id" ) - ( (QDesignerWidgetStack*)tqparent )->insertPage( w, v.toInt() ); - } else if ( ::tqqt_cast<TQToolBox*>(tqparent) ) { + ( (QDesignerWidgetStack*)parent )->insertPage( w, v.toInt() ); + } else if ( ::tqqt_cast<TQToolBox*>(parent) ) { if ( attrib == "label" ) - ( (TQToolBox*)tqparent )->addItem( w, v.toString() ); - } else if ( ::tqqt_cast<TQWizard*>(tqparent) ) { + ( (TQToolBox*)parent )->addItem( w, v.toString() ); + } else if ( ::tqqt_cast<TQWizard*>(parent) ) { if ( attrib == "title" ) - ( (TQWizard*)tqparent )->addPage( w, v.toString() ); + ( (TQWizard*)parent )->addPage( w, v.toString() ); #ifdef TQT_CONTAINER_CUSTOM_WIDGETS } else if ( isPlugin ) { if ( attrib == "label" ) { @@ -1899,7 +1899,7 @@ TQObject *Resource::createObject( const TQDomElement &e, TQWidget *tqparent, TQL iface->queryInterface( IID_TQWidgetContainer, (TQUnknownInterface**)&iface2 ); if ( iface2 ) { iface2->insertPage( parentClassName, - (TQWidget*)tqparent, v.toString(), -1, w ); + (TQWidget*)parent, v.toString(), -1, w ); iface2->release(); } iface->release(); @@ -2104,7 +2104,7 @@ void Resource::createItem( const TQDomElement &e, TQWidget *widget, TQListViewIt } } -TQWidget *Resource::createSpacer( const TQDomElement &e, TQWidget *tqparent, TQLayout *tqlayout, Qt::Orientation o ) +TQWidget *Resource::createSpacer( const TQDomElement &e, TQWidget *parent, TQLayout *tqlayout, Qt::Orientation o ) { TQDomElement n = e.firstChild().toElement(); int row = e.attribute( "row" ).toInt(); @@ -2117,7 +2117,7 @@ TQWidget *Resource::createSpacer( const TQDomElement &e, TQWidget *tqparent, TQL colspan = 1; Spacer *spacer = (Spacer*) WidgetFactory::create( WidgetDatabase::idFromClassName("Spacer"), - tqparent, "spacer", FALSE); + parent, "spacer", FALSE); spacer->setOrientation( o ); spacer->setInteraciveMode( FALSE ); while ( !n.isNull() ) { @@ -3000,12 +3000,12 @@ void Resource::saveActions( const TQPtrList<TQAction> &actions, TQTextStream &ts ts << makeIndent( indent ) << "</actions>" << endl; } -void Resource::loadChildAction( TQObject *tqparent, const TQDomElement &e ) +void Resource::loadChildAction( TQObject *parent, const TQDomElement &e ) { TQDomElement n = e; TQAction *a = 0; if ( n.tagName() == "action" ) { - a = new QDesignerAction( tqparent ); + a = new QDesignerAction( parent ); MetaDataBase::addEntry( a ); TQDomElement n2 = n.firstChild().toElement(); bool hasMenuText = FALSE; @@ -3022,10 +3022,10 @@ void Resource::loadChildAction( TQObject *tqparent, const TQDomElement &e ) } n2 = n2.nextSibling().toElement(); } - if ( !::tqqt_cast<TQAction*>(tqparent) ) + if ( !::tqqt_cast<TQAction*>(parent) ) formwindow->actionList().append( a ); } else if ( n.tagName() == "actiongroup" ) { - a = new QDesignerActionGroup( tqparent ); + a = new QDesignerActionGroup( parent ); MetaDataBase::addEntry( a ); TQDomElement n2 = n.firstChild().toElement(); bool hasMenuText = FALSE; @@ -3045,7 +3045,7 @@ void Resource::loadChildAction( TQObject *tqparent, const TQDomElement &e ) } n2 = n2.nextSibling().toElement(); } - if ( !::tqqt_cast<TQAction*>(tqparent) ) + if ( !::tqqt_cast<TQAction*>(parent) ) formwindow->actionList().append( a ); } } |