summaryrefslogtreecommitdiffstats
path: root/kommander/editor/widgetfactory.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'kommander/editor/widgetfactory.cpp')
-rw-r--r--kommander/editor/widgetfactory.cpp124
1 files changed, 62 insertions, 62 deletions
diff --git a/kommander/editor/widgetfactory.cpp b/kommander/editor/widgetfactory.cpp
index b1bf1f83..4b07bb37 100644
--- a/kommander/editor/widgetfactory.cpp
+++ b/kommander/editor/widgetfactory.cpp
@@ -417,7 +417,7 @@ void WidgetFactory::saveDefaultProperties( TQWidget *w, int id )
static void saveChangedProperties( TQWidget *w, int id )
{
- TQStringList l = MetaDataBase::changedProperties( TQT_TQOBJECT(w) );
+ TQStringList l = MetaDataBase::changedProperties( w );
changedProperties->insert( id, l );
}
@@ -662,7 +662,7 @@ 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(w, id);
@@ -682,7 +682,7 @@ TQLayout *WidgetFactory::createLayout( TQWidget *widget, TQLayout *layout, Layou
int margin = 0;
if ( widget && !widget->inherits( "TQLayoutWidget" ) &&
- ( WidgetDatabase::isContainer( WidgetDatabase::idFromClassName( WidgetFactory::classNameOf( TQT_TQOBJECT(widget) ) ) ) ||
+ ( WidgetDatabase::isContainer( WidgetDatabase::idFromClassName( WidgetFactory::classNameOf( widget ) ) ) ||
widget && widget->parentWidget() && widget->parentWidget()->inherits( "FormWindow" ) ) )
margin = MainWindow::self->currentLayoutDefaultMargin();
@@ -701,7 +701,7 @@ TQLayout *WidgetFactory::createLayout( TQWidget *widget, TQLayout *layout, Layou
if ( !layout && widget && widget->inherits( "TQWidgetStack" ) )
widget = ((TQWidgetStack*)widget)->visibleWidget();
- MetaDataBase::addEntry( TQT_TQOBJECT(widget) );
+ MetaDataBase::addEntry( widget );
if ( !layout && widget && widget->inherits( "TQGroupBox" ) ) {
TQGroupBox *gb = (TQGroupBox*)widget;
@@ -712,24 +712,24 @@ TQLayout *WidgetFactory::createLayout( TQWidget *widget, TQLayout *layout, Layou
switch ( type ) {
case HBox:
l = new TQHBoxLayout( gb->layout() );
- MetaDataBase::setMargin( TQT_TQOBJECT(gb), margin );
- MetaDataBase::setSpacing( TQT_TQOBJECT(gb), spacing );
+ MetaDataBase::setMargin( gb, margin );
+ MetaDataBase::setSpacing( gb, spacing );
l->setAlignment( AlignTop );
- MetaDataBase::addEntry( TQT_TQOBJECT(l) );
+ MetaDataBase::addEntry( l );
return l;
case VBox:
l = new TQVBoxLayout( gb->layout(), spacing );
- MetaDataBase::setMargin( TQT_TQOBJECT(gb), margin );
- MetaDataBase::setSpacing( TQT_TQOBJECT(gb), spacing );
+ MetaDataBase::setMargin( gb, margin );
+ MetaDataBase::setSpacing( gb, spacing );
l->setAlignment( AlignTop );
- MetaDataBase::addEntry( TQT_TQOBJECT(l) );
+ MetaDataBase::addEntry( l );
return l;
case Grid:
l = new QDesignerGridLayout( gb->layout() );
- MetaDataBase::setMargin( TQT_TQOBJECT(gb), margin );
- MetaDataBase::setSpacing( TQT_TQOBJECT(gb), spacing );
+ MetaDataBase::setMargin( gb, margin );
+ MetaDataBase::setSpacing( gb, spacing );
l->setAlignment( AlignTop );
- MetaDataBase::addEntry( TQT_TQOBJECT(l) );
+ MetaDataBase::addEntry( l );
return l;
default:
return 0;
@@ -740,24 +740,24 @@ TQLayout *WidgetFactory::createLayout( TQWidget *widget, TQLayout *layout, Layou
switch ( type ) {
case HBox:
l = new TQHBoxLayout( layout );
- MetaDataBase::addEntry( TQT_TQOBJECT(l) );
+ MetaDataBase::addEntry( l );
l->setSpacing( spacing );
l->setMargin( margin );
- MetaDataBase::addEntry( TQT_TQOBJECT(l) );
+ MetaDataBase::addEntry( l );
return l;
case VBox:
l = new TQVBoxLayout( layout );
- MetaDataBase::addEntry( TQT_TQOBJECT(l) );
+ MetaDataBase::addEntry( l );
l->setSpacing( spacing );
l->setMargin( margin );
- MetaDataBase::addEntry( TQT_TQOBJECT(l) );
+ MetaDataBase::addEntry( l );
return l;
case Grid: {
l = new QDesignerGridLayout( layout );
- MetaDataBase::addEntry( TQT_TQOBJECT(l) );
+ MetaDataBase::addEntry( l );
l->setSpacing( spacing );
l->setMargin( margin );
- MetaDataBase::addEntry( TQT_TQOBJECT(l) );
+ MetaDataBase::addEntry( l );
return l;
}
default:
@@ -768,39 +768,39 @@ TQLayout *WidgetFactory::createLayout( TQWidget *widget, TQLayout *layout, Layou
switch ( type ) {
case HBox:
l = new TQHBoxLayout( widget );
- MetaDataBase::addEntry( TQT_TQOBJECT(l) );
+ MetaDataBase::addEntry( l );
if ( widget ) {
- MetaDataBase::setMargin( TQT_TQOBJECT(widget), margin );
- MetaDataBase::setSpacing( TQT_TQOBJECT(widget), spacing );
+ MetaDataBase::setMargin( widget, margin );
+ MetaDataBase::setSpacing( widget, spacing );
} else {
l->setMargin( margin );
l->setSpacing( margin );
}
- MetaDataBase::addEntry( TQT_TQOBJECT(l) );
+ MetaDataBase::addEntry( l );
return l;
case VBox:
l = new TQVBoxLayout( widget );
- MetaDataBase::addEntry( TQT_TQOBJECT(l) );
+ MetaDataBase::addEntry( l );
if ( widget ) {
- MetaDataBase::setMargin( TQT_TQOBJECT(widget), margin );
- MetaDataBase::setSpacing( TQT_TQOBJECT(widget), spacing );
+ MetaDataBase::setMargin( widget, margin );
+ MetaDataBase::setSpacing( widget, spacing );
} else {
l->setMargin( margin );
l->setSpacing( margin );
}
- MetaDataBase::addEntry( TQT_TQOBJECT(l) );
+ MetaDataBase::addEntry( l );
return l;
case Grid: {
l = new QDesignerGridLayout( widget );
- MetaDataBase::addEntry( TQT_TQOBJECT(l) );
+ MetaDataBase::addEntry( l );
if ( widget ) {
- MetaDataBase::setMargin( TQT_TQOBJECT(widget), margin );
- MetaDataBase::setSpacing( TQT_TQOBJECT(widget), spacing );
+ MetaDataBase::setMargin( widget, margin );
+ MetaDataBase::setSpacing( widget, spacing );
} else {
l->setMargin( margin );
l->setSpacing( margin );
}
- MetaDataBase::addEntry( TQT_TQOBJECT(l) );
+ MetaDataBase::addEntry( l );
return l;
}
default:
@@ -955,8 +955,8 @@ TQWidget *WidgetFactory::createWidget( const TQString &className, TQWidget *pare
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 == "TQLayoutWidget")
@@ -969,11 +969,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 == "TQComboBox")
@@ -989,7 +989,7 @@ TQWidget *WidgetFactory::createWidget( const TQString &className, TQWidget *pare
if (fw)
{
QDesignerWidget *dw = new QDesignerWidget(fw, parent, name);
- MetaDataBase::addEntry(TQT_TQOBJECT(dw));
+ MetaDataBase::addEntry(dw);
return dw;
}
}
@@ -1014,7 +1014,7 @@ TQWidget *WidgetFactory::createWidget( const TQString &className, TQWidget *pare
if (init && parent && parent->inherits("FormWindow"))
{
QDesignerWidget *dw = new QDesignerWidget((FormWindow *) parent, wiz, "page");
- MetaDataBase::addEntry(TQT_TQOBJECT(dw));
+ MetaDataBase::addEntry(dw);
wiz->addPage(dw, i18n("Page"));
TQTimer::singleShot(0, wiz, TQT_SLOT(next()));
}
@@ -1022,9 +1022,9 @@ TQWidget *WidgetFactory::createWidget( const TQString &className, TQWidget *pare
} 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)
@@ -1053,8 +1053,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")
{
@@ -1065,8 +1065,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")
{
@@ -1078,10 +1078,10 @@ TQWidget *WidgetFactory::createWidget( const TQString &className, TQWidget *pare
} 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)
@@ -1095,7 +1095,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();
@@ -1156,7 +1156,7 @@ TQWidget *WidgetFactory::createWidget( const TQString &className, TQWidget *pare
if (init && parent && parent->inherits("FormWindow"))
{
QDesignerWidget *dw = new QDesignerWidget((FormWindow *) parent, wiz, "page");
- MetaDataBase::addEntry(TQT_TQOBJECT(dw));
+ MetaDataBase::addEntry(dw);
wiz->addPage(dw, i18n("Page 1"));
wiz->addPage(dw, i18n("Page 2"));
TQTimer::singleShot(0, wiz, TQT_SLOT(next()));
@@ -1171,11 +1171,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 == "ToolBox")
@@ -1186,11 +1186,11 @@ TQWidget *WidgetFactory::createWidget( const TQString &className, TQWidget *pare
FormWindow *fw = find_formwindow(parent);
TQWidget *w = fw ? new QDesignerWidget(fw, tw, "toolbox") : new TQWidget(tw, "toolbox");
tw->addItem(w, i18n("Page 1"));
- MetaDataBase::addEntry(TQT_TQOBJECT(w));
+ MetaDataBase::addEntry(w);
w = fw ? new QDesignerWidget(fw, tw, "toolbox") : new TQWidget(tw, "toolbox");
tw->addItem(w, i18n("Page 2"));
- MetaDataBase::addEntry(TQT_TQOBJECT(tw));
- MetaDataBase::addEntry(TQT_TQOBJECT(w));
+ MetaDataBase::addEntry(tw);
+ MetaDataBase::addEntry(w);
}
return tw;
}
@@ -1249,8 +1249,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;
}
#endif
@@ -1289,7 +1289,7 @@ WidgetFactory::LayoutType WidgetFactory::layoutType( TQWidget *w, TQLayout *&lay
TQLayout *lay = w->layout();
if ( w->inherits( "TQGroupBox" ) ) {
- TQObjectList *l = TQT_TQOBJECT(lay)->queryList( "TQLayout" );
+ TQObjectList *l = lay->queryList( "TQLayout" );
if ( l && l->first() )
lay = (TQLayout*)l->first();
delete l;
@@ -1331,7 +1331,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;
@@ -1379,7 +1379,7 @@ TQWidget* WidgetFactory::widgetOfContainer( TQWidget *w )
if ( w->parentWidget() && w->parentWidget()->inherits( "TQWidgetStack" ) )
w = w->parentWidget();
while ( w ) {
- if ( WidgetDatabase::isContainer( WidgetDatabase::idFromClassName( WidgetFactory::classNameOf( TQT_TQOBJECT(w) ) ) ) ||
+ if ( WidgetDatabase::isContainer( WidgetDatabase::idFromClassName( WidgetFactory::classNameOf( w ) ) ) ||
w && w->parentWidget() && w->parentWidget()->inherits( "FormWindow" ) )
return w;
w = w->parentWidget();