summaryrefslogtreecommitdiffstats
path: root/kdevdesigner/uilib/qwidgetfactory.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'kdevdesigner/uilib/qwidgetfactory.cpp')
-rw-r--r--kdevdesigner/uilib/qwidgetfactory.cpp258
1 files changed, 129 insertions, 129 deletions
diff --git a/kdevdesigner/uilib/qwidgetfactory.cpp b/kdevdesigner/uilib/qwidgetfactory.cpp
index c431253e..55aaa31d 100644
--- a/kdevdesigner/uilib/qwidgetfactory.cpp
+++ b/kdevdesigner/uilib/qwidgetfactory.cpp
@@ -133,19 +133,19 @@ static void setupWidgetListAndMap()
return;
setupPluginDir();
availableWidgetList = new TQStringList;
- (*availableWidgetList) << TQPUSHBUTTON_OBJECT_NAME_STRING << TQTOOLBUTTON_OBJECT_NAME_STRING << TQCHECKBOX_OBJECT_NAME_STRING << TQRADIOBUTTON_OBJECT_NAME_STRING
- << TQGROUPBOX_OBJECT_NAME_STRING << TQBUTTONGROUP_OBJECT_NAME_STRING << TQICONVIEW_OBJECT_NAME_STRING << TQTABLE_OBJECT_NAME_STRING
- << TQLISTBOX_OBJECT_NAME_STRING << TQLISTVIEW_OBJECT_NAME_STRING << TQLINEEDIT_OBJECT_NAME_STRING << TQSPINBOX_OBJECT_NAME_STRING
- << TQMULTILINEEDIT_OBJECT_NAME_STRING << TQLABEL_OBJECT_NAME_STRING << "TextLabel" << "PixmapLabel"
- << TQLAYOUTWIDGET_OBJECT_NAME_STRING << TQTABWIDGET_OBJECT_NAME_STRING << TQCOMBOBOX_OBJECT_NAME_STRING
- << TQWIDGET_OBJECT_NAME_STRING << TQDIALOG_OBJECT_NAME_STRING << TQWIZARD_OBJECT_NAME_STRING << TQLCDNUMBER_OBJECT_NAME_STRING;
+ (*availableWidgetList) << "TQPushButton" << "TQToolButton" << "TQCheckBox" << "TQRadioButton"
+ << "TQGroupBox" << "TQButtonGroup" << "TQIconView" << "TQTable"
+ << "TQListBox" << "TQListView" << "TQLineEdit" << "TQSpinBox"
+ << "TQMultiLineEdit" << "TQLabel" << "TextLabel" << "PixmapLabel"
+ << "TQLayoutWidget" << "TQTabWidget" << "TQComboBox"
+ << "TQWidget" << "TQDialog" << "TQWizard" << "TQLCDNumber";
// put less stress on the compiler by limiting the template nesting depth
- (*availableWidgetList) << TQPROGRESSBAR_OBJECT_NAME_STRING << TQTEXTVIEW_OBJECT_NAME_STRING << TQTEXTBROWSER_OBJECT_NAME_STRING
- << TQDIAL_OBJECT_NAME_STRING << TQSLIDER_OBJECT_NAME_STRING << TQFRAME_OBJECT_NAME_STRING << "Line" << TQTEXTEDIT_OBJECT_NAME_STRING
- << TQDATEEDIT_OBJECT_NAME_STRING << TQTIMEEDIT_OBJECT_NAME_STRING << TQDATETIMEEDIT_OBJECT_NAME_STRING << TQSCROLLBAR_OBJECT_NAME_STRING
- << TQPOPUPMENU_OBJECT_NAME_STRING << TQWIDGETSTACK_OBJECT_NAME_STRING << TQMAINWINDOW_OBJECT_NAME_STRING
- << TQDATATABLE_OBJECT_NAME_STRING << TQDATABROWSER_OBJECT_NAME_STRING << TQDATAVIEW_OBJECT_NAME_STRING
- << TQVBOX_OBJECT_NAME_STRING << TQHBOX_OBJECT_NAME_STRING << TQGRID_OBJECT_NAME_STRING << TQTOOLBOX_OBJECT_NAME_STRING;
+ (*availableWidgetList) << "TQProgressBar" << "TQTextView" << "TQTextBrowser"
+ << "TQDial" << "TQSlider" << "TQFrame" << "Line" << "TQTextEdit"
+ << "TQDateEdit" << "TQTimeEdit" << "TQDateTimeEdit" << "TQScrollBar"
+ << "TQPopupMenu" << "TQWidgetStack" << "TQMainWindow"
+ << "TQDataTable" << "TQDataBrowser" << "TQDataView"
+ << "TQVBox" << "TQHBox" << "TQGrid" << "TQToolBox";
if ( !widgetInterfaceManager )
widgetInterfaceManager =
@@ -364,7 +364,7 @@ TQWidget *TQWidgetFactory::create( TQIODevice *dev, TQObject *connector, TQWidge
for ( TQMap<TQString, TQStringList>::Iterator it = widgetFactory->dbTables.begin();
it != widgetFactory->dbTables.end(); ++it ) {
- TQDataTable *table = (TQDataTable*)widgetFactory->toplevel->child( it.key().ascii(), TQDATATABLE_OBJECT_NAME_STRING );
+ TQDataTable *table = (TQDataTable*)widgetFactory->toplevel->child( it.key().ascii(), "TQDataTable" );
if ( !table )
continue;
if ( widgetFactory->noDatabaseWidgets.find( table->name() ) !=
@@ -391,8 +391,8 @@ TQWidget *TQWidgetFactory::create( TQIODevice *dev, TQObject *connector, TQWidge
for ( TQMap<TQString, TQString>::Iterator it = widgetFactory->buddies.begin();
it != widgetFactory->buddies.end(); ++it ) {
- TQLabel *label = (TQLabel*)widgetFactory->toplevel->child( it.key().ascii(), TQLABEL_OBJECT_NAME_STRING );
- TQWidget *buddy = (TQWidget*)widgetFactory->toplevel->child( (*it).ascii(), TQWIDGET_OBJECT_NAME_STRING );
+ TQLabel *label = (TQLabel*)widgetFactory->toplevel->child( it.key().ascii(), "TQLabel" );
+ TQWidget *buddy = (TQWidget*)widgetFactory->toplevel->child( (*it).ascii(), "TQWidget" );
if ( label && buddy )
label->setBuddy( buddy );
}
@@ -466,7 +466,7 @@ TQWidget *TQWidgetFactory::createFromUiFile( TQDomDocument doc, TQObject *connec
if ( !imageCollection.isNull() )
loadImageCollection( imageCollection );
- createWidgetInternal( widget, parent, 0, widget.attribute("class", TQWIDGET_OBJECT_NAME_STRING) );
+ createWidgetInternal( widget, parent, 0, widget.attribute("class", "TQWidget") );
TQWidget *w = toplevel;
if ( !w )
return 0;
@@ -703,7 +703,7 @@ void TQWidgetFactory::inputSpacer( const UibStrTable& strings, TQDataStream& in,
spacer = new TQSpacerItem( w, h, sizeType, TQSizePolicy::Minimum );
}
- if ( parent->inherits(TQGRIDLAYOUT_OBJECT_NAME_STRING) ) {
+ if ( parent->inherits("TQGridLayout") ) {
((TQGridLayout *) parent)->addMultiCell( spacer, row,
row + rowspan - 1, column, column + colspan - 1,
vertical ? TQt::AlignHCenter : TQt::AlignVCenter );
@@ -763,11 +763,11 @@ void TQWidgetFactory::inputColumnOrRow( const UibStrTable& strings,
}
if ( parent != 0 ) {
- if ( parent->inherits(TQLISTVIEW_OBJECT_NAME_STRING) ) {
+ if ( parent->inherits("TQListView") ) {
createListViewColumn( (TQListView *) parent, text, pixmap, clickable,
resizable );
#ifndef TQT_NO_TABLE
- } else if ( parent->inherits(TQTABLE_OBJECT_NAME_STRING) ) {
+ } else if ( parent->inherits("TQTable") ) {
createTableColumnOrRow( (TQTable *) parent, text, pixmap, field,
isRow );
#endif
@@ -786,7 +786,7 @@ void TQWidgetFactory::inputItem( const UibStrTable& strings, TQDataStream& in,
TQ_UINT8 objectTag;
TQListView *listView = 0;
- if ( parent != 0 && parent->inherits(TQLISTVIEW_OBJECT_NAME_STRING) )
+ if ( parent != 0 && parent->inherits("TQListView") )
parent = TQT_TQOBJECT((TQListView *) parent);
TQListViewItem *item = 0;
if ( listView != 0 ) {
@@ -848,9 +848,9 @@ void TQWidgetFactory::inputItem( const UibStrTable& strings, TQDataStream& in,
TQPixmap pixmap = pixmaps.last();
if ( parent != 0 ) {
- if ( parent->inherits(TQCOMBOBOX_OBJECT_NAME_STRING) ||
- parent->inherits(TQLISTBOX_OBJECT_NAME_STRING) ) {
- TQListBox *listBox = (TQListBox *) parent->tqt_cast( TQLISTBOX_OBJECT_NAME_STRING );
+ if ( parent->inherits("TQComboBox") ||
+ parent->inherits("TQListBox") ) {
+ TQListBox *listBox = (TQListBox *) parent->tqt_cast( "TQListBox" );
if ( listBox == 0 )
listBox = ((TQComboBox *) parent)->listBox();
@@ -860,7 +860,7 @@ void TQWidgetFactory::inputItem( const UibStrTable& strings, TQDataStream& in,
(void) new TQListBoxPixmap( listBox, pixmap, text );
}
#ifndef TQT_NO_ICONVIEW
- } else if ( parent->inherits(TQICONVIEW_OBJECT_NAME_STRING) ) {
+ } else if ( parent->inherits("TQIconView") ) {
(void) new TQIconViewItem( (TQIconView *) parent, text, pixmap );
#endif
}
@@ -915,50 +915,50 @@ TQObject *TQWidgetFactory::inputObject( TQObject **objects, int& numObjects,
if ( isTQObject ) {
if ( parent != 0 ) {
if ( parent->isWidgetType() ) {
- if ( parent->inherits(TQMAINWINDOW_OBJECT_NAME_STRING) ) {
+ if ( parent->inherits("TQMainWindow") ) {
parentWidget = ((TQMainWindow *) parent)->centralWidget();
} else {
parentWidget = (TQWidget *) parent;
}
- } else if ( parent->inherits(TQLAYOUT_OBJECT_NAME_STRING) ) {
+ } else if ( parent->inherits("TQLayout") ) {
parentLayout = (TQLayout *) parent;
parentWidget = ancestorWidget;
}
}
- if ( className == TQACTION_OBJECT_NAME_STRING ) {
+ if ( className == "TQAction" ) {
unpackCString( strings, in, className );
- if ( className == TQACTIONGROUP_OBJECT_NAME_STRING ) {
+ if ( className == "TQActionGroup" ) {
obj = new TQActionGroup( parent );
} else {
obj = new TQAction( parent );
}
- } else if ( className == TQLAYOUT_OBJECT_NAME_STRING ) {
+ } else if ( className == "TQLayout" ) {
unpackCString( strings, in, className );
LayoutType type = Grid;
- if ( className == TQHBOXLAYOUT_OBJECT_NAME_STRING ) {
+ if ( className == "TQHBoxLayout" ) {
type = HBox;
- } else if ( className == TQVBOXLAYOUT_OBJECT_NAME_STRING ) {
+ } else if ( className == "TQVBoxLayout" ) {
type = VBox;
}
- if ( parentLayout != 0 && parentLayout->inherits(TQGRIDLAYOUT_OBJECT_NAME_STRING) ) {
+ if ( parentLayout != 0 && parentLayout->inherits("TQGridLayout") ) {
layout = createLayout( 0, 0, type );
} else {
layout = createLayout( parentWidget, parentLayout, type );
}
obj = TQT_TQOBJECT(layout);
- } else if ( className == TQMENUBAR_OBJECT_NAME_STRING ) {
+ } else if ( className == "TQMenuBar" ) {
unpackCString( strings, in, className );
widget = ((TQMainWindow *) parent)->menuBar();
obj = TQT_TQOBJECT(widget);
- } else if ( className == TQTOOLBAR_OBJECT_NAME_STRING ) {
+ } else if ( className == "TQToolBar" ) {
TQ_UINT8 dock;
in >> dock;
unpackCString( strings, in, className );
widget = new TQToolBar( TQString(), (TQMainWindow *) parent,
(TQt::Dock) dock );
obj = TQT_TQOBJECT(widget);
- } else if ( className == TQWIDGET_OBJECT_NAME_STRING ) {
+ } else if ( className == "TQWidget" ) {
unpackCString( strings, in, className );
widget = createWidget( className, parentWidget, 0 );
obj = TQT_TQOBJECT(widget);
@@ -1099,15 +1099,15 @@ TQObject *TQWidgetFactory::inputObject( TQObject **objects, int& numObjects,
break;
case Object_SubAction:
inputObject( objects, numObjects, strings, in, parentWidget,
- obj != 0 ? obj : parent, TQACTION_OBJECT_NAME_STRING );
+ obj != 0 ? obj : parent, "TQAction" );
break;
case Object_SubLayout:
inputObject( objects, numObjects, strings, in, parentWidget, obj,
- TQLAYOUT_OBJECT_NAME_STRING );
+ "TQLayout" );
break;
case Object_SubWidget:
inputObject( objects, numObjects, strings, in, parentWidget, obj,
- TQWIDGET_OBJECT_NAME_STRING );
+ "TQWidget" );
break;
case Object_TextProperty:
unpackCString( strings, in, name );
@@ -1118,9 +1118,9 @@ TQObject *TQWidgetFactory::inputObject( TQObject **objects, int& numObjects,
if ( metAttribute > 0 ) {
if ( name == "title" ) {
if ( parent != 0 ) {
- if ( parent->inherits(TQTABWIDGET_OBJECT_NAME_STRING) ) {
+ if ( parent->inherits("TQTabWidget") ) {
((TQTabWidget *) parent)->insertTab( widget, str );
- } else if ( parent->inherits(TQWIZARD_OBJECT_NAME_STRING) ) {
+ } else if ( parent->inherits("TQWizard") ) {
((TQWizard *) parent)->addPage( widget, str );
}
}
@@ -1136,7 +1136,7 @@ TQObject *TQWidgetFactory::inputObject( TQObject **objects, int& numObjects,
if ( metAttribute > 0 ) {
if ( name == "id" ) {
- if ( parent != 0 && parent->inherits(TQWIDGETSTACK_OBJECT_NAME_STRING) )
+ if ( parent != 0 && parent->inherits("TQWidgetStack") )
((TQWidgetStack *) parent)->addWidget( widget, value.toInt() );
}
} else {
@@ -1153,7 +1153,7 @@ TQObject *TQWidgetFactory::inputObject( TQObject **objects, int& numObjects,
if ( parentLayout != 0 ) {
if ( widget != 0 ) {
- if ( parentLayout->inherits(TQGRIDLAYOUT_OBJECT_NAME_STRING) ) {
+ if ( parentLayout->inherits("TQGridLayout") ) {
((TQGridLayout *) parentLayout)->addMultiCellWidget(
widget, row, row + rowspan - 1, column,
column + colspan - 1 );
@@ -1161,7 +1161,7 @@ TQObject *TQWidgetFactory::inputObject( TQObject **objects, int& numObjects,
((TQBoxLayout *) parentLayout)->addWidget( widget );
}
} else if ( layout != 0 ) {
- if ( parentLayout->inherits(TQGRIDLAYOUT_OBJECT_NAME_STRING) ) {
+ if ( parentLayout->inherits("TQGridLayout") ) {
((TQGridLayout *) parentLayout)->addMultiCellLayout(
layout, row, row + rowspan - 1, column,
column + colspan - 1 );
@@ -1219,7 +1219,7 @@ TQWidget *TQWidgetFactory::createFromUibFile( TQDataStream& in,
unpackUInt16( in, labelNo );
unpackUInt16( in, buddyNo );
TQLabel *label =
- (TQLabel *) objects[labelNo]->tqt_cast( TQLABEL_OBJECT_NAME_STRING );
+ (TQLabel *) objects[labelNo]->tqt_cast( "TQLabel" );
if ( label != 0 )
label->setBuddy( (TQWidget *) objects[buddyNo] );
} while ( !END_OF_BLOCK() );
@@ -1301,7 +1301,7 @@ TQWidget *TQWidgetFactory::createFromUibFile( TQDataStream& in,
break;
case Block_Menubar:
inputObject( objects, numObjects, strings, in, toplevel, TQT_TQOBJECT(toplevel),
- TQMENUBAR_OBJECT_NAME_STRING );
+ "TQMenuBar" );
break;
case Block_Slots:
{
@@ -1334,7 +1334,7 @@ TQWidget *TQWidgetFactory::createFromUibFile( TQDataStream& in,
case Block_Toolbars:
do {
inputObject( objects, numObjects, strings, in, toplevel,
- TQT_TQOBJECT(toplevel), TQTOOLBAR_OBJECT_NAME_STRING );
+ TQT_TQOBJECT(toplevel), "TQToolBar" );
} while ( !END_OF_BLOCK() );
break;
case Block_Variables:
@@ -1345,7 +1345,7 @@ TQWidget *TQWidgetFactory::createFromUibFile( TQDataStream& in,
case Block_Widget:
toplevel = (TQWidget *)
inputObject( objects, numObjects, strings, in, toplevel, TQT_TQOBJECT(parent),
- TQWIDGET_OBJECT_NAME_STRING );
+ "TQWidget" );
if ( toplevel != 0 )
toplevel->setName( name );
break;
@@ -1410,97 +1410,97 @@ TQWidget *TQWidgetFactory::createWidget( const TQString &className, TQWidget *pa
const char *name ) const
{
// create widgets we know
- if ( className == TQPUSHBUTTON_OBJECT_NAME_STRING ) {
+ if ( className == "TQPushButton" ) {
return new TQPushButton( parent, name );
- } else if ( className == TQTOOLBUTTON_OBJECT_NAME_STRING ) {
+ } else if ( className == "TQToolButton" ) {
return new TQToolButton( parent, name );
- } else if ( className == TQCHECKBOX_OBJECT_NAME_STRING ) {
+ } else if ( className == "TQCheckBox" ) {
return new TQCheckBox( parent, name );
- } else if ( className == TQRADIOBUTTON_OBJECT_NAME_STRING ) {
+ } else if ( className == "TQRadioButton" ) {
return new TQRadioButton( parent, name );
- } else if ( className == TQGROUPBOX_OBJECT_NAME_STRING ) {
+ } else if ( className == "TQGroupBox" ) {
return new TQGroupBox( parent, name );
- } else if ( className == TQBUTTONGROUP_OBJECT_NAME_STRING ) {
+ } else if ( className == "TQButtonGroup" ) {
return new TQButtonGroup( parent, name );
- } else if ( className == TQICONVIEW_OBJECT_NAME_STRING ) {
+ } else if ( className == "TQIconView" ) {
#if !defined(TQT_NO_ICONVIEW)
return new TQIconView( parent, name );
#endif
- } else if ( className == TQTABLE_OBJECT_NAME_STRING ) {
+ } else if ( className == "TQTable" ) {
#if !defined(TQT_NO_TABLE)
return new TQTable( parent, name );
#endif
- } else if ( className == TQLISTBOX_OBJECT_NAME_STRING ) {
+ } else if ( className == "TQListBox" ) {
return new TQListBox( parent, name );
- } else if ( className == TQLISTVIEW_OBJECT_NAME_STRING ) {
+ } else if ( className == "TQListView" ) {
return new TQListView( parent, name );
- } else if ( className == TQLINEEDIT_OBJECT_NAME_STRING ) {
+ } else if ( className == "TQLineEdit" ) {
return new TQLineEdit( parent, name );
- } else if ( className == TQSPINBOX_OBJECT_NAME_STRING ) {
+ } else if ( className == "TQSpinBox" ) {
return new TQSpinBox( parent, name );
- } else if ( className == TQMULTILINEEDIT_OBJECT_NAME_STRING ) {
+ } else if ( className == "TQMultiLineEdit" ) {
return new TQMultiLineEdit( parent, name );
- } else if ( className == TQLABEL_OBJECT_NAME_STRING || className == "TextLabel" || className == "PixmapLabel" ) {
+ } else if ( className == "TQLabel" || className == "TextLabel" || className == "PixmapLabel" ) {
return new TQLabel( parent, name );
- } else if ( className == TQLAYOUTWIDGET_OBJECT_NAME_STRING ) {
+ } else if ( className == "TQLayoutWidget" ) {
return new TQWidget( parent, name );
- } else if ( className == TQTABWIDGET_OBJECT_NAME_STRING ) {
+ } else if ( className == "TQTabWidget" ) {
return new TQTabWidget( parent, name );
- } else if ( className == TQCOMBOBOX_OBJECT_NAME_STRING ) {
+ } else if ( className == "TQComboBox" ) {
return new TQComboBox( FALSE, parent, name );
- } else if ( className == TQWIDGET_OBJECT_NAME_STRING ) {
+ } else if ( className == "TQWidget" ) {
if ( !qwf_stays_on_top )
return new TQWidget( parent, name );
return new TQWidget( parent, name, TQt::WStyle_StaysOnTop );
- } else if ( className == TQDIALOG_OBJECT_NAME_STRING ) {
+ } else if ( className == "TQDialog" ) {
if ( !qwf_stays_on_top )
return new TQDialog( parent, name );
return new TQDialog( parent, name, FALSE, TQt::WStyle_StaysOnTop );
- } else if ( className == TQWIZARD_OBJECT_NAME_STRING ) {
+ } else if ( className == "TQWizard" ) {
return new TQWizard( parent, name );
- } else if ( className == TQLCDNUMBER_OBJECT_NAME_STRING ) {
+ } else if ( className == "TQLCDNumber" ) {
return new TQLCDNumber( parent, name );
- } else if ( className == TQPROGRESSBAR_OBJECT_NAME_STRING ) {
+ } else if ( className == "TQProgressBar" ) {
return new TQProgressBar( parent, name );
- } else if ( className == TQTEXTVIEW_OBJECT_NAME_STRING ) {
+ } else if ( className == "TQTextView" ) {
return new TQTextView( parent, name );
- } else if ( className == TQTEXTBROWSER_OBJECT_NAME_STRING ) {
+ } else if ( className == "TQTextBrowser" ) {
return new TQTextBrowser( parent, name );
- } else if ( className == TQDIAL_OBJECT_NAME_STRING ) {
+ } else if ( className == "TQDial" ) {
return new TQDial( parent, name );
- } else if ( className == TQSLIDER_OBJECT_NAME_STRING ) {
+ } else if ( className == "TQSlider" ) {
return new TQSlider( parent, name );
- } else if ( className == TQFRAME_OBJECT_NAME_STRING ) {
+ } else if ( className == "TQFrame" ) {
return new TQFrame( parent, name );
- } else if ( className == TQSPLITTER_OBJECT_NAME_STRING ) {
+ } else if ( className == "TQSplitter" ) {
return new TQSplitter( parent, name );
} else if ( className == "Line" ) {
TQFrame *f = new TQFrame( parent, name );
f->setFrameStyle( TQFrame::HLine | TQFrame::Sunken );
return f;
- } else if ( className == TQTEXTEDIT_OBJECT_NAME_STRING ) {
+ } else if ( className == "TQTextEdit" ) {
return new TQTextEdit( parent, name );
- } else if ( className == TQDATEEDIT_OBJECT_NAME_STRING ) {
+ } else if ( className == "TQDateEdit" ) {
return new TQDateEdit( parent, name );
- } else if ( className == TQTIMEEDIT_OBJECT_NAME_STRING ) {
+ } else if ( className == "TQTimeEdit" ) {
return new TQTimeEdit( parent, name );
- } else if ( className == TQDATETIMEEDIT_OBJECT_NAME_STRING ) {
+ } else if ( className == "TQDateTimeEdit" ) {
return new TQDateTimeEdit( parent, name );
- } else if ( className == TQSCROLLBAR_OBJECT_NAME_STRING ) {
+ } else if ( className == "TQScrollBar" ) {
return new TQScrollBar( parent, name );
- } else if ( className == TQPOPUPMENU_OBJECT_NAME_STRING ) {
+ } else if ( className == "TQPopupMenu" ) {
return new TQPopupMenu( parent, name );
- } else if ( className == TQWIDGETSTACK_OBJECT_NAME_STRING ) {
+ } else if ( className == "TQWidgetStack" ) {
return new TQWidgetStack( parent, name );
- } else if ( className == TQTOOLBOX_OBJECT_NAME_STRING ) {
+ } else if ( className == "TQToolBox" ) {
return new TQToolBox( parent, name );
- } else if ( className == TQVBOX_OBJECT_NAME_STRING ) {
+ } else if ( className == "TQVBox" ) {
return new TQVBox( parent, name );
- } else if ( className == TQHBOX_OBJECT_NAME_STRING ) {
+ } else if ( className == "TQHBox" ) {
return new TQHBox( parent, name );
- } else if ( className == TQGRID_OBJECT_NAME_STRING ) {
+ } else if ( className == "TQGrid" ) {
return new TQGrid( 4, parent, name );
- } else if ( className == TQMAINWINDOW_OBJECT_NAME_STRING ) {
+ } else if ( className == "TQMainWindow" ) {
TQMainWindow *mw = 0;
if ( !qwf_stays_on_top )
mw = new TQMainWindow( parent, name );
@@ -1513,11 +1513,11 @@ TQWidget *TQWidgetFactory::createWidget( const TQString &className, TQWidget *pa
}
#if !defined(TQT_NO_SQL)
- else if ( className == TQDATATABLE_OBJECT_NAME_STRING ) {
+ else if ( className == "TQDataTable" ) {
return new TQDataTable( parent, name );
- } else if ( className == TQDATABROWSER_OBJECT_NAME_STRING ) {
+ } else if ( className == "TQDataBrowser" ) {
return new QDesignerDataBrowser2( parent, name );
- } else if ( className == TQDATAVIEW_OBJECT_NAME_STRING ) {
+ } else if ( className == "TQDataView" ) {
return new QDesignerDataView2( parent, name );
}
#endif
@@ -1589,11 +1589,11 @@ TQWidget *TQWidgetFactory::createWidgetInternal( const TQDomElement &e, TQWidget
bool isTQLayoutWidget = FALSE;
if ( !className.isEmpty() ) {
- if ( !layout && className == TQLAYOUTWIDGET_OBJECT_NAME_STRING ) {
- className = TQWIDGET_OBJECT_NAME_STRING;
+ if ( !layout && className == "TQLayoutWidget" ) {
+ className = "TQWidget";
isTQLayoutWidget = TRUE;
}
- if ( layout && className == TQLAYOUTWIDGET_OBJECT_NAME_STRING ) {
+ if ( layout && className == "TQLayoutWidget" ) {
// hide layout widgets
w = parent;
} else {
@@ -1603,7 +1603,7 @@ TQWidget *TQWidgetFactory::createWidgetInternal( const TQDomElement &e, TQWidget
w = (TQWidget*)obj;
if ( !toplevel )
toplevel = w;
- if ( w->inherits( TQMAINWINDOW_OBJECT_NAME_STRING ) )
+ if ( w->inherits( "TQMainWindow" ) )
w = ( (TQMainWindow*)w )->centralWidget();
if ( layout ) {
switch( layoutType( layout ) ) {
@@ -1639,41 +1639,41 @@ TQWidget *TQWidgetFactory::createWidgetInternal( const TQDomElement &e, TQWidget
createSpacer( n, layout );
} else if ( n.tagName() == "widget" ) {
TQMap< TQString, TQString> *oldDbControls = dbControls;
- createWidgetInternal( n, w, layout, n.attribute( "class", TQWIDGET_OBJECT_NAME_STRING ) );
+ createWidgetInternal( n, w, layout, n.attribute( "class", "TQWidget" ) );
dbControls = oldDbControls;
} else if ( n.tagName() == "hbox" ) {
TQLayout *parentLayout = layout;
- if ( layout && layout->inherits( TQGRIDLAYOUT_OBJECT_NAME_STRING ) )
+ if ( layout && layout->inherits( "TQGridLayout" ) )
layout = createLayout( 0, 0, TQWidgetFactory::HBox, isTQLayoutWidget );
else
layout = createLayout( w, layout, TQWidgetFactory::HBox, isTQLayoutWidget );
obj = TQT_TQOBJECT(layout);
n = n.firstChild().toElement();
- if ( parentLayout && parentLayout->inherits( TQGRIDLAYOUT_OBJECT_NAME_STRING ) )
+ if ( parentLayout && parentLayout->inherits( "TQGridLayout" ) )
( (TQGridLayout*)parentLayout )->addMultiCellLayout( layout, row,
row + rowspan - 1, col, col + colspan - 1 );
continue;
} else if ( n.tagName() == "grid" ) {
TQLayout *parentLayout = layout;
- if ( layout && layout->inherits( TQGRIDLAYOUT_OBJECT_NAME_STRING ) )
+ if ( layout && layout->inherits( "TQGridLayout" ) )
layout = createLayout( 0, 0, TQWidgetFactory::Grid, isTQLayoutWidget );
else
layout = createLayout( w, layout, TQWidgetFactory::Grid, isTQLayoutWidget );
obj = TQT_TQOBJECT(layout);
n = n.firstChild().toElement();
- if ( parentLayout && parentLayout->inherits( TQGRIDLAYOUT_OBJECT_NAME_STRING ) )
+ if ( parentLayout && parentLayout->inherits( "TQGridLayout" ) )
( (TQGridLayout*)parentLayout )->addMultiCellLayout( layout, row,
row + rowspan - 1, col, col + colspan - 1 );
continue;
} else if ( n.tagName() == "vbox" ) {
TQLayout *parentLayout = layout;
- if ( layout && layout->inherits( TQGRIDLAYOUT_OBJECT_NAME_STRING ) )
+ if ( layout && layout->inherits( "TQGridLayout" ) )
layout = createLayout( 0, 0, TQWidgetFactory::VBox, isTQLayoutWidget );
else
layout = createLayout( w, layout, TQWidgetFactory::VBox, isTQLayoutWidget );
obj = TQT_TQOBJECT(layout);
n = n.firstChild().toElement();
- if ( parentLayout && parentLayout->inherits( TQGRIDLAYOUT_OBJECT_NAME_STRING ) )
+ if ( parentLayout && parentLayout->inherits( "TQGridLayout" ) )
( (TQGridLayout*)parentLayout )->addMultiCellLayout( layout, row,
row + rowspan - 1, col, col + colspan - 1 );
continue;
@@ -1683,16 +1683,16 @@ TQWidget *TQWidgetFactory::createWidgetInternal( const TQDomElement &e, TQWidget
TQString attrib = n.attribute( "name" );
TQVariant v = DomTool::elementToVariant( n.firstChild().toElement(), TQVariant() );
if ( parent ) {
- if ( parent->inherits( TQTABWIDGET_OBJECT_NAME_STRING ) ) {
+ if ( parent->inherits( "TQTabWidget" ) ) {
if ( attrib == "title" )
( (TQTabWidget*)parent )->insertTab( w, translate( v.toString() ) );
- } else if ( parent->inherits( TQWIDGETSTACK_OBJECT_NAME_STRING ) ) {
+ } else if ( parent->inherits( "TQWidgetStack" ) ) {
if ( attrib == "id" )
( (TQWidgetStack*)parent )->addWidget( w, v.toInt() );
- } else if ( parent->inherits( TQTOOLBOX_OBJECT_NAME_STRING ) ) {
+ } else if ( parent->inherits( "TQToolBox" ) ) {
if ( attrib == "label" )
( (TQToolBox*)parent )->addItem( w, v.toString() );
- } else if ( parent->inherits( TQWIZARD_OBJECT_NAME_STRING ) ) {
+ } else if ( parent->inherits( "TQWizard" ) ) {
if ( attrib == "title" )
( (TQWizard*)parent )->addPage( w, translate( v.toString() ) );
#ifdef TQT_CONTAINER_CUSTOM_WIDGETS
@@ -1737,21 +1737,21 @@ TQLayout *TQWidgetFactory::createLayout( TQWidget *widget, TQLayout* layout,
if ( layout || !widget || isTQLayoutWidget )
margin = 0;
- if ( !layout && widget && widget->inherits( TQTABWIDGET_OBJECT_NAME_STRING ) )
+ if ( !layout && widget && widget->inherits( "TQTabWidget" ) )
widget = ((TQTabWidget*)widget)->currentPage();
- if ( !layout && widget && widget->inherits( TQWIZARD_OBJECT_NAME_STRING ) )
+ if ( !layout && widget && widget->inherits( "TQWizard" ) )
widget = ((TQWizard*)widget)->currentPage();
- if ( !layout && widget && widget->inherits( TQWIDGETSTACK_OBJECT_NAME_STRING ) )
+ if ( !layout && widget && widget->inherits( "TQWidgetStack" ) )
widget = ((TQWidgetStack*)widget)->visibleWidget();
- if ( !layout && widget && widget->inherits( TQTOOLBOX_OBJECT_NAME_STRING ) )
+ if ( !layout && widget && widget->inherits( "TQToolBox" ) )
widget = ((TQToolBox*)widget)->currentItem();
TQLayout *l = 0;
int align = 0;
- if ( !layout && widget && widget->inherits( TQGROUPBOX_OBJECT_NAME_STRING ) ) {
+ if ( !layout && widget && widget->inherits( "TQGroupBox" ) ) {
TQGroupBox *gb = (TQGroupBox*)widget;
gb->setColumnLayout( 0, Qt::Vertical );
layout = gb->layout();
@@ -1796,11 +1796,11 @@ TQLayout *TQWidgetFactory::createLayout( TQWidget *widget, TQLayout* layout,
TQWidgetFactory::LayoutType TQWidgetFactory::layoutType( TQLayout *layout ) const
{
- if ( layout->inherits( TQHBOXLAYOUT_OBJECT_NAME_STRING ) )
+ if ( layout->inherits( "TQHBoxLayout" ) )
return HBox;
- else if ( layout->inherits( TQVBOXLAYOUT_OBJECT_NAME_STRING ) )
+ else if ( layout->inherits( "TQVBoxLayout" ) )
return VBox;
- else if ( layout->inherits( TQGRIDLAYOUT_OBJECT_NAME_STRING ) )
+ else if ( layout->inherits( "TQGridLayout" ) )
return Grid;
return NoLayout;
}
@@ -1850,11 +1850,11 @@ void TQWidgetFactory::setProperty( TQObject* obj, const TQString &prop,
} else if ( prop == "buddy" ) {
buddies.insert( obj->name(), value.toCString() );
} else if ( prop == "buttonGroupId" ) {
- if ( obj->inherits( TQBUTTON_OBJECT_NAME_STRING ) && obj->parent()->inherits( TQBUTTONGROUP_OBJECT_NAME_STRING ) )
+ if ( obj->inherits( "TQButton" ) && obj->parent()->inherits( "TQButtonGroup" ) )
( (TQButtonGroup*)obj->parent() )->insert( (TQButton*)obj, value.toInt() );
#ifndef TQT_NO_SQL
- } else if ( prop == "database" && !obj->inherits( TQDATAVIEW_OBJECT_NAME_STRING )
- && !obj->inherits( TQDATABROWSER_OBJECT_NAME_STRING ) ) {
+ } else if ( prop == "database" && !obj->inherits( "TQDataView" )
+ && !obj->inherits( "TQDataBrowser" ) ) {
const TQStringList& lst = value.asStringList();
if ( lst.count() > 2 ) {
if ( dbControls )
@@ -1864,7 +1864,7 @@ void TQWidgetFactory::setProperty( TQObject* obj, const TQString &prop,
}
} else if ( prop == "database" ) {
const TQStringList& lst = value.asStringList();
- if ( lst.count() == 2 && obj->inherits( TQWIDGET_OBJECT_NAME_STRING ) ) {
+ if ( lst.count() == 2 && obj->inherits( "TQWidget" ) ) {
SqlWidgetConnection conn( lst[ 0 ], lst[ 1 ] );
sqlWidgetConnections.insert( (TQWidget*)obj, conn );
dbControls = conn.dbControls;
@@ -1953,7 +1953,7 @@ void TQWidgetFactory::createSpacer( const TQDomElement &e, TQLayout *layout )
TQSpacerItem *item = new TQSpacerItem( w, h, orient == Qt::Horizontal ? sizeType : TQSizePolicy::Minimum,
orient == Qt::Vertical ? sizeType : TQSizePolicy::Minimum );
if ( layout ) {
- if ( layout->inherits( TQBOXLAYOUT_OBJECT_NAME_STRING ) )
+ if ( layout->inherits( "TQBoxLayout" ) )
( (TQBoxLayout*)layout )->addItem( item );
else
( (TQGridLayout*)layout )->addMultiCell( item, row, row + rowspan - 1, col, col + colspan - 1,
@@ -2212,7 +2212,7 @@ void TQWidgetFactory::createTableColumnOrRow( TQTable *table, const TQString& tx
const TQString& field, bool isRow )
{
#ifndef TQT_NO_SQL
- bool isSql = table->inherits( TQDATATABLE_OBJECT_NAME_STRING );
+ bool isSql = table->inherits( "TQDataTable" );
#endif
if ( isRow )
table->setNumRows( table->numRows() + 1 );
@@ -2256,7 +2256,7 @@ void TQWidgetFactory::createTableColumnOrRow( TQTable *table, const TQString& tx
void TQWidgetFactory::createColumn( const TQDomElement &e, TQWidget *widget )
{
- if ( widget->inherits( TQLISTVIEW_OBJECT_NAME_STRING ) && e.tagName() == "column" ) {
+ if ( widget->inherits( "TQListView" ) && e.tagName() == "column" ) {
TQListView *lv = (TQListView*)widget;
TQDomElement n = e.firstChild().toElement();
TQPixmap pix;
@@ -2280,7 +2280,7 @@ void TQWidgetFactory::createColumn( const TQDomElement &e, TQWidget *widget )
createListViewColumn( lv, txt, pix, clickable, resizable );
}
#ifndef TQT_NO_TABLE
- else if ( widget->inherits( TQTABLE_OBJECT_NAME_STRING ) ) {
+ else if ( widget->inherits( "TQTable" ) ) {
TQTable *table = (TQTable*)widget;
TQDomElement n = e.firstChild().toElement();
@@ -2328,14 +2328,14 @@ void TQWidgetFactory::loadItem( const TQDomElement &e, TQPixmap &pix, TQString &
void TQWidgetFactory::createItem( const TQDomElement &e, TQWidget *widget, TQListViewItem *i )
{
- if ( widget->inherits( TQLISTBOX_OBJECT_NAME_STRING ) || widget->inherits( TQCOMBOBOX_OBJECT_NAME_STRING ) ) {
+ if ( widget->inherits( "TQListBox" ) || widget->inherits( "TQComboBox" ) ) {
TQDomElement n = e.firstChild().toElement();
TQPixmap pix;
bool hasPixmap = FALSE;
TQString txt;
loadItem( n, pix, txt, hasPixmap );
TQListBox *lb = 0;
- if ( widget->inherits( TQLISTBOX_OBJECT_NAME_STRING ) )
+ if ( widget->inherits( "TQListBox" ) )
lb = (TQListBox*)widget;
else
lb = ( (TQComboBox*)widget)->listBox();
@@ -2345,7 +2345,7 @@ void TQWidgetFactory::createItem( const TQDomElement &e, TQWidget *widget, TQLis
new TQListBoxText( lb, txt );
}
#ifndef TQT_NO_ICONVIEW
- } else if ( widget->inherits( TQICONVIEW_OBJECT_NAME_STRING ) ) {
+ } else if ( widget->inherits( "TQIconView" ) ) {
TQDomElement n = e.firstChild().toElement();
TQPixmap pix;
bool hasPixmap = FALSE;
@@ -2355,7 +2355,7 @@ void TQWidgetFactory::createItem( const TQDomElement &e, TQWidget *widget, TQLis
TQIconView *iv = (TQIconView*)widget;
new TQIconViewItem( iv, txt, pix );
#endif
- } else if ( widget->inherits( TQLISTVIEW_OBJECT_NAME_STRING ) ) {
+ } else if ( widget->inherits( "TQListView" ) ) {
TQDomElement n = e.firstChild().toElement();
TQPixmap pix;
TQValueList<TQPixmap> pixmaps;
@@ -2417,7 +2417,7 @@ void TQWidgetFactory::loadChildAction( TQObject *parent, const TQDomElement &e )
}
n2 = n2.nextSibling().toElement();
}
- if ( !parent->inherits( TQACTION_OBJECT_NAME_STRING ) )
+ if ( !parent->inherits( "TQAction" ) )
actionList.append( a );
} else if ( n.tagName() == "actiongroup" ) {
a = new TQActionGroup( parent );
@@ -2435,7 +2435,7 @@ void TQWidgetFactory::loadChildAction( TQObject *parent, const TQDomElement &e )
}
n2 = n2.nextSibling().toElement();
}
- if ( !parent->inherits( TQACTION_OBJECT_NAME_STRING ) )
+ if ( !parent->inherits( "TQAction" ) )
actionList.append( a );
}
@@ -2476,7 +2476,7 @@ void TQWidgetFactory::loadToolBars( const TQDomElement &e )
} else if ( n2.tagName() == "separator" ) {
tb->addSeparator();
} else if ( n2.tagName() == "widget" ) {
- (void)createWidgetInternal( n2, tb, 0, n2.attribute( "class", TQWIDGET_OBJECT_NAME_STRING ) );
+ (void)createWidgetInternal( n2, tb, 0, n2.attribute( "class", "TQWidget" ) );
} else if ( n2.tagName() == "property" ) {
setProperty( TQT_TQOBJECT(tb), n2.attribute( "name" ), n2.firstChild().toElement() );
}
@@ -2551,7 +2551,7 @@ TQAction *TQWidgetFactory::findAction( const TQString &name )
for ( TQAction *a = actionList.first(); a; a = actionList.next() ) {
if ( TQString( a->name() ) == name )
return a;
- TQAction *ac = (TQAction*)a->child( name.latin1(), TQACTION_OBJECT_NAME_STRING );
+ TQAction *ac = (TQAction*)a->child( name.latin1(), "TQAction" );
if ( ac )
return ac;
}