summaryrefslogtreecommitdiffstats
path: root/kdevdesigner/designer/widgetfactory.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'kdevdesigner/designer/widgetfactory.cpp')
-rw-r--r--kdevdesigner/designer/widgetfactory.cpp88
1 files changed, 44 insertions, 44 deletions
diff --git a/kdevdesigner/designer/widgetfactory.cpp b/kdevdesigner/designer/widgetfactory.cpp
index 00a4fa07..8d800061 100644
--- a/kdevdesigner/designer/widgetfactory.cpp
+++ b/kdevdesigner/designer/widgetfactory.cpp
@@ -543,12 +543,12 @@ TQWidget *WidgetFactory::create( int id, TQWidget *parent, const char *name, boo
w = createCustomWidget( parent, name ? name : s, MetaDataBase::customWidget( id ) );
if ( !w )
return 0;
- MetaDataBase::addEntry( TQT_TQOBJECT(w) );
+ MetaDataBase::addEntry( w );
if ( !defaultProperties->contains( id ) )
- saveDefaultProperties( TQT_TQOBJECT(w), id );
+ saveDefaultProperties( w, id );
if ( !changedProperties->contains( id ) )
- saveChangedProperties( TQT_TQOBJECT(w), id );
+ saveChangedProperties( w, id );
return w;
}
@@ -562,11 +562,11 @@ TQLayout *WidgetFactory::createLayout( TQWidget *widget, TQLayout *layout, Layou
int spacing = MainWindow::self->currentLayoutDefaultSpacing();
int margin = 0;
- int metaspacing = MetaDataBase::spacing( TQT_TQOBJECT(widget) );
- int metamargin = MetaDataBase::margin( TQT_TQOBJECT(widget) );
+ int metaspacing = MetaDataBase::spacing( widget );
+ int metamargin = MetaDataBase::margin( widget );
if ( ::tqt_cast<TQLayoutWidget*>(widget) &&
- ( WidgetDatabase::isContainer( WidgetDatabase::idFromClassName( WidgetFactory::classNameOf( TQT_TQOBJECT(widget) ) ) ) ||
+ ( WidgetDatabase::isContainer( WidgetDatabase::idFromClassName( WidgetFactory::classNameOf( widget ) ) ) ||
widget && ::tqt_cast<FormWindow*>(widget->parentWidget()) ) )
margin = MainWindow::self->currentLayoutDefaultMargin();
@@ -585,7 +585,7 @@ TQLayout *WidgetFactory::createLayout( TQWidget *widget, TQLayout *layout, Layou
if ( !layout && ::tqt_cast<TQToolBox*>(widget) )
widget = ((TQToolBox*)widget)->currentItem();
- MetaDataBase::addEntry( TQT_TQOBJECT(widget) );
+ MetaDataBase::addEntry( widget );
TQLayout *l = 0;
int align = 0;
@@ -609,8 +609,8 @@ TQLayout *WidgetFactory::createLayout( TQWidget *widget, TQLayout *layout, Layou
return 0;
}
align = TQt::AlignTop;
- MetaDataBase::setMargin( TQT_TQOBJECT(gb), metamargin );
- MetaDataBase::setSpacing( TQT_TQOBJECT(gb), metaspacing );
+ MetaDataBase::setMargin( gb, metamargin );
+ MetaDataBase::setSpacing( gb, metaspacing );
} else {
if ( layout ) {
switch ( type ) {
@@ -626,7 +626,7 @@ TQLayout *WidgetFactory::createLayout( TQWidget *widget, TQLayout *layout, Layou
default:
return 0;
}
- MetaDataBase::addEntry( TQT_TQOBJECT(l) );
+ MetaDataBase::addEntry( l );
l->setSpacing( spacing );
l->setMargin( margin );
} else {
@@ -643,10 +643,10 @@ TQLayout *WidgetFactory::createLayout( TQWidget *widget, TQLayout *layout, Layou
default:
return 0;
}
- MetaDataBase::addEntry( TQT_TQOBJECT(l) );
+ MetaDataBase::addEntry( l );
if ( widget ) {
- MetaDataBase::setMargin( TQT_TQOBJECT(widget), metamargin );
- MetaDataBase::setSpacing( TQT_TQOBJECT(widget), metaspacing );
+ MetaDataBase::setMargin( widget, metamargin );
+ MetaDataBase::setSpacing( widget, metaspacing );
} else {
l->setMargin( margin );
l->setSpacing( spacing );
@@ -654,7 +654,7 @@ TQLayout *WidgetFactory::createLayout( TQWidget *widget, TQLayout *layout, Layou
}
}
l->setAlignment( align );
- MetaDataBase::addEntry( TQT_TQOBJECT(l) );
+ MetaDataBase::addEntry( l );
return l;
}
@@ -790,8 +790,8 @@ TQWidget *WidgetFactory::createWidget( const TQString &className, TQWidget *pare
QDesignerLabel *l = new QDesignerLabel( parent, name );
if ( init ) {
l->setText( TQString::fromLatin1( name ) );
- MetaDataBase::addEntry( TQT_TQOBJECT(l) );
- MetaDataBase::setPropertyChanged( TQT_TQOBJECT(l), "text", TRUE );
+ MetaDataBase::addEntry( l );
+ MetaDataBase::setPropertyChanged( l, "text", TRUE );
}
return l;
} else if ( className == "PixmapLabel" ) {
@@ -799,9 +799,9 @@ TQWidget *WidgetFactory::createWidget( const TQString &className, TQWidget *pare
if ( init ) {
l->setPixmap( BarIcon( "designer_qtlogo.png", KDevDesignerPartFactory::instance() ) );
l->setScaledContents( TRUE );
- MetaDataBase::addEntry( TQT_TQOBJECT(l) );
- MetaDataBase::setPropertyChanged( TQT_TQOBJECT(l), "pixmap", TRUE );
- MetaDataBase::setPropertyChanged( TQT_TQOBJECT(l), "scaledContents", TRUE );
+ MetaDataBase::addEntry( l );
+ MetaDataBase::setPropertyChanged( l, "pixmap", TRUE );
+ MetaDataBase::setPropertyChanged( l, "scaledContents", TRUE );
}
return l;
} else if ( className == "TQLayoutWidget" )
@@ -812,11 +812,11 @@ TQWidget *WidgetFactory::createWidget( const TQString &className, TQWidget *pare
FormWindow *fw = find_formwindow( parent );
TQWidget *w = fw ? new QDesignerWidget( fw, tw, "tab" ) : new TQWidget( tw, "tab" );
tw->addTab( w, i18n("Tab 1") );
- MetaDataBase::addEntry( TQT_TQOBJECT(w) );
+ MetaDataBase::addEntry( w );
w = fw ? new QDesignerWidget( fw, tw, "tab" ) : new TQWidget( tw, "tab" );
tw->addTab( w, i18n("Tab 2") );
- MetaDataBase::addEntry( TQT_TQOBJECT(tw) );
- MetaDataBase::addEntry( TQT_TQOBJECT(w) );
+ MetaDataBase::addEntry( tw );
+ MetaDataBase::addEntry( w );
}
return tw;
} else if ( className == "TQWidgetStack" ) {
@@ -825,8 +825,8 @@ TQWidget *WidgetFactory::createWidget( const TQString &className, TQWidget *pare
FormWindow *fw = find_formwindow( parent );
TQWidget *w = fw ? new QDesignerWidget( fw, ws, "WStackPage" ) : new TQWidget( ws, "WStackPage" );
ws->insertPage( w );
- MetaDataBase::addEntry( TQT_TQOBJECT(w) );
- MetaDataBase::addEntry( TQT_TQOBJECT(ws) );
+ MetaDataBase::addEntry( w );
+ MetaDataBase::addEntry( ws );
}
return ws;
} else if ( className == "TQComboBox" ) {
@@ -842,7 +842,7 @@ TQWidget *WidgetFactory::createWidget( const TQString &className, TQWidget *pare
FormWindow *fw = find_formwindow( parent );
if ( fw ) {
QDesignerWidget *dw = new QDesignerWidget( fw, parent, name );
- MetaDataBase::addEntry( TQT_TQOBJECT(dw) );
+ MetaDataBase::addEntry( dw );
return dw;
}
}
@@ -862,16 +862,16 @@ TQWidget *WidgetFactory::createWidget( const TQString &className, TQWidget *pare
wiz->reparent( parent, TQPoint( 0, 0 ), TRUE );
if ( init && ::tqt_cast<FormWindow*>(parent) ) {
QDesignerWidget *dw = new QDesignerWidget( (FormWindow*)parent, wiz, "WizardPage" );
- MetaDataBase::addEntry( TQT_TQOBJECT(dw) );
+ MetaDataBase::addEntry( dw );
wiz->addPage( dw, i18n( "Page" ) );
TQTimer::singleShot( 0, wiz, TQT_SLOT( next() ) );
}
return wiz;
} else if ( className == "Spacer" ) {
Spacer *s = new Spacer( parent, name );
- MetaDataBase::addEntry( TQT_TQOBJECT(s) );
- MetaDataBase::setPropertyChanged( TQT_TQOBJECT(s), "orientation", TRUE );
- MetaDataBase::setPropertyChanged( TQT_TQOBJECT(s), "sizeType", TRUE );
+ MetaDataBase::addEntry( s );
+ MetaDataBase::setPropertyChanged( s, "orientation", TRUE );
+ MetaDataBase::setPropertyChanged( s, "sizeType", TRUE );
if ( !r )
return s;
if ( !r->isValid() || r->width() < 2 && r->height() < 2 )
@@ -899,8 +899,8 @@ TQWidget *WidgetFactory::createWidget( const TQString &className, TQWidget *pare
s->setOrientation( orient );
else if ( r->width() > r->height() )
s->setOrientation( TQt::Horizontal );
- MetaDataBase::addEntry( TQT_TQOBJECT(s) );
- MetaDataBase::setPropertyChanged( TQT_TQOBJECT(s), "orientation", TRUE );
+ MetaDataBase::addEntry( s );
+ MetaDataBase::setPropertyChanged( s, "orientation", TRUE );
return s;
} else if ( className == "TQScrollBar" ) {
TQScrollBar *s = new TQScrollBar( parent, name );
@@ -910,8 +910,8 @@ TQWidget *WidgetFactory::createWidget( const TQString &className, TQWidget *pare
s->setOrientation( orient );
else if ( r->width() > r->height() )
s->setOrientation( TQt::Horizontal );
- MetaDataBase::addEntry( TQT_TQOBJECT(s) );
- MetaDataBase::setPropertyChanged( TQT_TQOBJECT(s), "orientation", TRUE );
+ MetaDataBase::addEntry( s );
+ MetaDataBase::setPropertyChanged( s, "orientation", TRUE );
return s;
} else if ( className == "TQFrame" ) {
if ( !init )
@@ -921,10 +921,10 @@ TQWidget *WidgetFactory::createWidget( const TQString &className, TQWidget *pare
return f;
} else if ( className == "Line" ) {
Line *l = new Line( parent, name );
- MetaDataBase::addEntry( TQT_TQOBJECT(l) );
- MetaDataBase::setPropertyChanged( TQT_TQOBJECT(l), "orientation", TRUE );
- MetaDataBase::setPropertyChanged( TQT_TQOBJECT(l), "frameShadow", TRUE );
- MetaDataBase::setPropertyChanged( TQT_TQOBJECT(l), "frameShape", TRUE );
+ MetaDataBase::addEntry( l );
+ MetaDataBase::setPropertyChanged( l, "orientation", TRUE );
+ MetaDataBase::setPropertyChanged( l, "frameShadow", TRUE );
+ MetaDataBase::setPropertyChanged( l, "frameShape", TRUE );
if ( !r )
return l;
if ( !r->isValid() || r->width() < 2 && r->height() < 2 )
@@ -937,7 +937,7 @@ TQWidget *WidgetFactory::createWidget( const TQString &className, TQWidget *pare
mw->setDockEnabled( TQt::DockMinimized, FALSE );
QDesignerWidget *dw = new QDesignerWidget( (FormWindow*)parent, mw, "central widget" );
mw->setDockMenuEnabled( FALSE );
- MetaDataBase::addEntry( TQT_TQOBJECT(dw) );
+ MetaDataBase::addEntry( dw );
mw->setCentralWidget( dw );
(void)mw->statusBar();
dw->show();
@@ -950,11 +950,11 @@ TQWidget *WidgetFactory::createWidget( const TQString &className, TQWidget *pare
TQWidget *w = fw ? new QDesignerWidget( fw, tb, "page1" ) :
new TQWidget( tb, "page1" );
tb->addItem( w, i18n("Page 1") );
- MetaDataBase::addEntry( TQT_TQOBJECT(w) );
+ MetaDataBase::addEntry( w );
w = fw ? new QDesignerWidget( fw, tb, "page2" ) : new TQWidget( tb, "page2" );
tb->addItem( w, i18n("Page 2") );
- MetaDataBase::addEntry( TQT_TQOBJECT(tb) );
- MetaDataBase::addEntry( TQT_TQOBJECT(w) );
+ MetaDataBase::addEntry( tb );
+ MetaDataBase::addEntry( w );
return tb;
}
#ifndef TQT_NO_SQL
@@ -1021,7 +1021,7 @@ WidgetFactory::LayoutType WidgetFactory::layoutType( TQWidget *w, TQLayout *&lay
TQLayout *lay = w->layout();
if ( ::tqt_cast<TQGroupBox*>(w) ) {
- TQObjectList *l = TQT_TQOBJECT(lay)->queryList( "TQLayout" );
+ TQObjectList *l = lay->queryList( "TQLayout" );
if ( l && l->first() )
lay = (TQLayout*)l->first();
delete l;
@@ -1063,7 +1063,7 @@ WidgetFactory::LayoutType WidgetFactory::layoutType( TQWidget *w )
TQWidget *WidgetFactory::layoutParent( TQLayout *layout )
{
- TQObject *o = TQT_TQOBJECT(layout);
+ TQObject *o = layout;
while ( o ) {
if ( o->isWidgetType() )
return (TQWidget*)o;
@@ -1132,7 +1132,7 @@ TQWidget* WidgetFactory::widgetOfContainer( TQWidget *w )
::tqt_cast<TQToolBox*>(w->parentWidget()->parentWidget()->parentWidget()) )
return w->parentWidget()->parentWidget()->parentWidget();
while ( w ) {
- int id = WidgetDatabase::idFromClassName( WidgetFactory::classNameOf( TQT_TQOBJECT(w) ) );
+ int id = WidgetDatabase::idFromClassName( WidgetFactory::classNameOf( w ) );
if ( WidgetDatabase::isContainer( id ) ||
w && ::tqt_cast<FormWindow*>(w->parentWidget()) )
return w;