diff options
Diffstat (limited to 'kdevdesigner/uilib/qwidgetfactory.cpp')
-rw-r--r-- | kdevdesigner/uilib/qwidgetfactory.cpp | 416 |
1 files changed, 208 insertions, 208 deletions
diff --git a/kdevdesigner/uilib/qwidgetfactory.cpp b/kdevdesigner/uilib/qwidgetfactory.cpp index c431253e..be26d088 100644 --- a/kdevdesigner/uilib/qwidgetfactory.cpp +++ b/kdevdesigner/uilib/qwidgetfactory.cpp @@ -41,7 +41,7 @@ #include <tqtooltip.h> #include <tqwhatsthis.h> #include <tqobjectlist.h> -#include <tqpluginmanager_p.h> +#include <private/tqpluginmanager_p.h> #include <tqmime.h> #include <tqdragobject.h> @@ -115,8 +115,8 @@ static TQStringList *availableWidgetList = 0; TQMap<TQWidget*, TQString> *qwf_forms = 0; TQString *qwf_language = 0; -bool qwf_execute_code = TRUE; -bool qwf_stays_on_top = FALSE; +bool qwf_execute_code = true; +bool qwf_stays_on_top = false; TQString qwf_currFileName = ""; TQObject *qwf_form_object = 0; TQString *qwf_plugin_dir = 0; @@ -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 = @@ -158,7 +158,7 @@ static void setupWidgetListAndMap() availableWidgetMap = new TQMap<TQString, bool>; for ( it = availableWidgetList->begin(); it != availableWidgetList->end(); ++it ) - availableWidgetMap->insert( *it, TRUE ); + availableWidgetMap->insert( *it, true ); } static TQImage loadImageData( const TQString& format, ulong len, TQByteArray data ) @@ -243,10 +243,10 @@ static TQSizePolicy::SizeType stringToSizeType( const TQString& str ) TQWidgetFactory::TQWidgetFactory() : d( new TQWidgetFactoryPrivate() ), dbControls( 0 ), - usePixmapCollection( FALSE ), defMargin( 11 ), defSpacing( 6 ) + usePixmapCollection( false ), defMargin( 11 ), defSpacing( 6 ) { - widgetFactories.setAutoDelete( TRUE ); - d->customWidgets.setAutoDelete( TRUE ); + widgetFactories.setAutoDelete( true ); + d->customWidgets.setAutoDelete( true ); } /*! \fn TQWidgetFactory::~TQWidgetFactory() @@ -282,9 +282,9 @@ TQWidget *TQWidgetFactory::create( const TQString &uiFile, TQObject *connector, { setupPluginDir(); TQFile f( uiFile ); - bool failed = FALSE; + bool failed = false; if ( !f.open( IO_ReadOnly ) ) - failed = TRUE; + failed = true; if ( failed && tqApp->type() == TQApplication::Tty ) { // for TQSA: If we have no GUI, we have no form definition // files, but just the code. So try if only the code exists. @@ -295,7 +295,7 @@ TQWidget *TQWidgetFactory::create( const TQString &uiFile, TQObject *connector, return 0; qwf_currFileName = uiFile; - TQWidget *w = TQWidgetFactory::create( TQT_TQIODEVICE(&f), connector, parent, name ); + TQWidget *w = TQWidgetFactory::create( &f, connector, parent, name ); if ( !qwf_forms ) qwf_forms = new TQMap<TQWidget*, TQString>; qwf_forms->insert( w, uiFile ); @@ -356,15 +356,15 @@ TQWidget *TQWidgetFactory::create( TQIODevice *dev, TQObject *connector, TQWidge continue; if ( cit.key()->inherits( "QDesignerDataBrowser2" ) ) ( (QDesignerDataBrowser2*)cit.key() )->initPreview( (*cit).conn, (*cit).table, - TQT_TQOBJECT(cit.key()), *(*cit).dbControls ); + cit.key(), *(*cit).dbControls ); else if ( cit.key()->inherits( "QDesignerDataView2" ) ) ( (QDesignerDataView2*)cit.key() )->initPreview( (*cit).conn, (*cit).table, - TQT_TQOBJECT(cit.key()), *(*cit).dbControls ); + cit.key(), *(*cit).dbControls ); } 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() ) != @@ -379,10 +379,10 @@ TQWidget *TQWidgetFactory::create( TQIODevice *dev, TQObject *connector, TQWidge c = new TQSqlCursor( (*it)[ 1 ] ); } else { db = TQSqlDatabase::database( conn ); - c = new TQSqlCursor( (*it)[ 1 ], TRUE, db ); + c = new TQSqlCursor( (*it)[ 1 ], true, db ); } if ( db ) { - table->setSqlCursor( c, fieldMap.isEmpty(), TRUE ); + table->setSqlCursor( c, fieldMap.isEmpty(), true ); table->refresh( TQDataTable::RefreshAll ); } } @@ -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 ); } @@ -455,7 +455,7 @@ TQWidget *TQWidgetFactory::createFromUiFile( TQDomDocument doc, TQObject *connec } else if ( e.tagName() == "widget" ) { widget = e; } else if ( e.tagName() == "pixmapinproject" ) { - usePixmapCollection = TRUE; + usePixmapCollection = true; } else if ( e.tagName() == "layoutdefaults" ) { defSpacing = e.attribute( "spacing", TQString::number( defSpacing ) ).toInt(); defMargin = e.attribute( "margin", TQString::number( defMargin ) ).toInt(); @@ -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; @@ -658,7 +658,7 @@ void TQWidgetFactory::inputSpacer( const UibStrTable& strings, TQDataStream& in, TQVariant value; TQCString comment; TQSizePolicy::SizeType sizeType = TQSizePolicy::Preferred; - bool vertical = FALSE; + bool vertical = false; int w = 0; int h = 0; TQ_UINT16 column = 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 ); @@ -720,8 +720,8 @@ void TQWidgetFactory::inputColumnOrRow( const UibStrTable& strings, TQString text; TQPixmap pixmap; TQString field; - bool clickable = TRUE; - bool resizable = TRUE; + bool clickable = true; + bool resizable = true; TQCString name; TQVariant value; @@ -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,8 +786,8 @@ void TQWidgetFactory::inputItem( const UibStrTable& strings, TQDataStream& in, TQ_UINT8 objectTag; TQListView *listView = 0; - if ( parent != 0 && parent->inherits(TQLISTVIEW_OBJECT_NAME_STRING) ) - parent = TQT_TQOBJECT((TQListView *) parent); + if ( parent != 0 && parent->inherits("TQListView") ) + parent = (TQListView *) parent; TQListViewItem *item = 0; if ( listView != 0 ) { if ( parentItem == 0 ) { @@ -803,7 +803,7 @@ void TQWidgetFactory::inputItem( const UibStrTable& strings, TQDataStream& in, switch ( objectTag ) { case Object_Item: if ( listView != 0 ) - d->lastItem->setOpen( TRUE ); + d->lastItem->setOpen( true ); inputItem( strings, in, parent, item ); break; case Object_TextProperty: @@ -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,53 +915,53 @@ 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 ) { + obj = layout; + } else if ( className == "TQMenuBar" ) { unpackCString( strings, in, className ); widget = ((TQMainWindow *) parent)->menuBar(); - obj = TQT_TQOBJECT(widget); - } else if ( className == TQTOOLBAR_OBJECT_NAME_STRING ) { + obj = widget; + } 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 ) { + obj = widget; + } else if ( className == "TQWidget" ) { unpackCString( strings, in, className ); widget = createWidget( className, parentWidget, 0 ); - obj = TQT_TQOBJECT(widget); + obj = widget; } if ( widget != 0 ) @@ -994,7 +994,7 @@ TQObject *TQWidgetFactory::inputObject( TQObject **objects, int& numObjects, metAttribute = 2; break; case Object_Column: - inputColumnOrRow( strings, in, obj, FALSE ); + inputColumnOrRow( strings, in, obj, false ); break; case Object_Event: unpackCString( strings, in, name ); @@ -1020,13 +1020,13 @@ TQObject *TQWidgetFactory::inputObject( TQObject **objects, int& numObjects, font.setPointSize( pointSize ); } if ( fontFlags & Font_Bold ) - font.setBold( TRUE ); + font.setBold( true ); if ( fontFlags & Font_Italic ) - font.setItalic( TRUE ); + font.setItalic( true ); if ( fontFlags & Font_Underline ) - font.setUnderline( TRUE ); + font.setUnderline( true ); if ( fontFlags & Font_StrikeOut ) - font.setStrikeOut( TRUE ); + font.setStrikeOut( true ); if ( obj != 0 ) setProperty( obj, name, font ); @@ -1089,7 +1089,7 @@ TQObject *TQWidgetFactory::inputObject( TQObject **objects, int& numObjects, } break; case Object_Row: - inputColumnOrRow( strings, in, obj, TRUE ); + inputColumnOrRow( strings, in, obj, true ); break; case Object_Spacer: inputSpacer( strings, in, layout ); @@ -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 ); @@ -1208,7 +1208,7 @@ TQWidget *TQWidgetFactory::createFromUibFile( TQDataStream& in, switch ( blockType ) { case Block_Actions: - inputObject( objects, numObjects, strings, in, toplevel, TQT_TQOBJECT(toplevel) ); + inputObject( objects, numObjects, strings, in, toplevel, toplevel ); break; case Block_Buddies: { @@ -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() ); @@ -1291,7 +1291,7 @@ TQWidget *TQWidgetFactory::createFromUibFile( TQDataStream& in, unpackCString( strings, in, d->translationContext ); if ( introFlags & Intro_Pixmapinproject ) - usePixmapCollection = TRUE; + usePixmapCollection = true; if ( defaultMargin != -32768 ) defMargin = defaultMargin; if ( defaultSpacing != -32768 ) @@ -1300,8 +1300,8 @@ TQWidget *TQWidgetFactory::createFromUibFile( TQDataStream& in, } break; case Block_Menubar: - inputObject( objects, numObjects, strings, in, toplevel, TQT_TQOBJECT(toplevel), - TQMENUBAR_OBJECT_NAME_STRING ); + inputObject( objects, numObjects, strings, in, toplevel, toplevel, + "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 ); + toplevel, "TQToolBar" ); } while ( !END_OF_BLOCK() ); break; case Block_Variables: @@ -1344,8 +1344,8 @@ TQWidget *TQWidgetFactory::createFromUibFile( TQDataStream& in, break; case Block_Widget: toplevel = (TQWidget *) - inputObject( objects, numObjects, strings, in, toplevel, TQT_TQOBJECT(parent), - TQWIDGET_OBJECT_NAME_STRING ); + inputObject( objects, numObjects, strings, in, toplevel, parent, + "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 ) { - return new TQComboBox( FALSE, parent, name ); - } else if ( className == TQWIDGET_OBJECT_NAME_STRING ) { + } else if ( className == "TQComboBox" ) { + return new TQComboBox( false, parent, name ); + } 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 ) { + return new TQDialog( parent, name, false, TQt::WStyle_StaysOnTop ); + } 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 @@ -1534,7 +1534,7 @@ TQWidget *TQWidgetFactory::createWidget( const TQString &className, TQWidget *pa if ( iface ) { TQWidget *w = iface->create( className, parent, name ); if ( w ) { - d->customWidgets.replace( className.latin1(), new bool(TRUE) ); + d->customWidgets.replace( className.latin1(), new bool(true) ); return w; } } @@ -1586,24 +1586,24 @@ TQWidget *TQWidgetFactory::createWidgetInternal( const TQDomElement &e, TQWidget if ( colspan < 1 ) colspan = 1; - bool isTQLayoutWidget = FALSE; + bool isTQLayoutWidget = false; if ( !className.isEmpty() ) { - if ( !layout && className == TQLAYOUTWIDGET_OBJECT_NAME_STRING ) { - className = TQWIDGET_OBJECT_NAME_STRING; - isTQLayoutWidget = TRUE; + 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 { - obj = TQT_TQOBJECT(TQWidgetFactory::createWidget( className, parent, 0 )); + obj = TQWidgetFactory::createWidget( className, parent, 0 ); if ( !obj ) return 0; 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 ) ) { @@ -1627,7 +1627,7 @@ TQWidget *TQWidgetFactory::createWidgetInternal( const TQDomElement &e, TQWidget } #ifdef TQT_CONTAINER_CUSTOM_WIDGETS TQString parentClassName = parent ? parent->className() : 0; - bool isPlugin = parent ? !!d->customWidgets.find( parent->className() ) : FALSE; + bool isPlugin = parent ? d->customWidgets.find( parent->className() ) : false; if ( isPlugin ) tqWarning( "####### loading custom container widgets without page support not implemented!" ); // ### TODO loading for custom container widgets without pages @@ -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); + obj = 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); + obj = 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); + obj = 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,23 +1737,23 @@ 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 ); + gb->setColumnLayout( 0, TQt::Vertical ); layout = gb->layout(); layout->setMargin( 0 ); layout->setSpacing( 0 ); @@ -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; } @@ -1808,10 +1808,10 @@ TQWidgetFactory::LayoutType TQWidgetFactory::layoutType( TQLayout *layout ) cons void TQWidgetFactory::setProperty( TQObject* obj, const TQString &prop, TQVariant value ) { - int offset = obj->metaObject()->findProperty( prop.ascii(), TRUE ); + int offset = obj->metaObject()->findProperty( prop.ascii(), true ); if ( offset != -1 ) { - if ( prop == "geometry" && TQT_BASE_OBJECT(obj) == TQT_BASE_OBJECT(toplevel) ) { + if ( prop == "geometry" && obj == toplevel ) { toplevel->resize( value.toRect().size() ); } else if ( prop == "accel" ) { obj->setProperty( prop.ascii(), TQVariant(value.toKeySequence()) ); @@ -1819,7 +1819,7 @@ void TQWidgetFactory::setProperty( TQObject* obj, const TQString &prop, if ( value.type() == TQVariant::String || value.type() == TQVariant::CString ) { const TQMetaProperty *metaProp = - obj->metaObject()->property( offset, TRUE ); + obj->metaObject()->property( offset, true ); if ( metaProp != 0 && metaProp->isEnumType() ) { if ( metaProp->isSetType() ) { TQStrList flagsCStr; @@ -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; @@ -1925,7 +1925,7 @@ void TQWidgetFactory::createSpacer( const TQDomElement &e, TQLayout *layout ) int rowspan = e.attribute( "rowspan" ).toInt(); int colspan = e.attribute( "colspan" ).toInt(); - Qt::Orientation orient = Qt::Horizontal; + TQt::Orientation orient = TQt::Horizontal; int w = 0, h = 0; TQSizePolicy::SizeType sizeType = TQSizePolicy::Preferred; while ( !n.isNull() ) { @@ -1933,9 +1933,9 @@ void TQWidgetFactory::createSpacer( const TQDomElement &e, TQLayout *layout ) TQString prop = n.attribute( "name" ); if ( prop == "orientation" ) { if ( n.firstChild().firstChild().toText().data() == "Horizontal" ) - orient = Qt::Horizontal; + orient = TQt::Horizontal; else - orient = Qt::Vertical; + orient = TQt::Vertical; } else if ( prop == "sizeType" ) { sizeType = stringToSizeType( n.firstChild().firstChild().toText().data() ); } else if ( prop == "sizeHint" ) { @@ -1950,14 +1950,14 @@ void TQWidgetFactory::createSpacer( const TQDomElement &e, TQLayout *layout ) rowspan = 1; if ( colspan < 1 ) colspan = 1; - TQSpacerItem *item = new TQSpacerItem( w, h, orient == Qt::Horizontal ? sizeType : TQSizePolicy::Minimum, - orient == Qt::Vertical ? sizeType : TQSizePolicy::Minimum ); + TQSpacerItem *item = new TQSpacerItem( w, h, orient == TQt::Horizontal ? sizeType : TQSizePolicy::Minimum, + orient == TQt::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, - orient == Qt::Horizontal ? TQt::AlignVCenter : TQt::AlignHCenter ); + orient == TQt::Horizontal ? TQt::AlignVCenter : TQt::AlignHCenter ); } } @@ -2069,11 +2069,11 @@ void TQWidgetFactory::loadConnections( const TQDomElement &e, TQObject *connecto if ( n2.tagName() == "sender" ) { TQString name = n2.firstChild().toText().data(); if ( name == "this" || qstrcmp( toplevel->name(), name.ascii() ) == 0 ) { - conn.sender = TQT_TQOBJECT(toplevel); + conn.sender = toplevel; } else { if ( name == "this" ) name = toplevel->name(); - TQObjectList *l = toplevel->queryList( 0, name.ascii(), FALSE ); + TQObjectList *l = toplevel->queryList( 0, name.ascii(), false ); if ( l ) { if ( l->first() ) conn.sender = l->first(); @@ -2087,9 +2087,9 @@ void TQWidgetFactory::loadConnections( const TQDomElement &e, TQObject *connecto } else if ( n2.tagName() == "receiver" ) { TQString name = n2.firstChild().toText().data(); if ( name == "this" || qstrcmp( toplevel->name(), name.ascii() ) == 0 ) { - conn.receiver = TQT_TQOBJECT(toplevel); + conn.receiver = toplevel; } else { - TQObjectList *l = toplevel->queryList( 0, name.ascii(), FALSE ); + TQObjectList *l = toplevel->queryList( 0, name.ascii(), false ); if ( l ) { if ( l->first() ) conn.receiver = l->first(); @@ -2111,9 +2111,9 @@ void TQWidgetFactory::loadConnections( const TQDomElement &e, TQObject *connecto } TQObject *sender = 0, *receiver = 0; - TQObjectList *l = toplevel->queryList( 0, conn.sender->name(), FALSE ); + TQObjectList *l = toplevel->queryList( 0, conn.sender->name(), false ); if ( qstrcmp( conn.sender->name(), toplevel->name() ) == 0 ) { - sender = TQT_TQOBJECT(toplevel); + sender = toplevel; } else { if ( !l || !l->first() ) { delete l; @@ -2127,9 +2127,9 @@ void TQWidgetFactory::loadConnections( const TQDomElement &e, TQObject *connecto sender = findAction( conn.sender->name() ); if ( qstrcmp( conn.receiver->name(), toplevel->name() ) == 0 ) { - receiver = TQT_TQOBJECT(toplevel); + receiver = toplevel; } else { - l = toplevel->queryList( 0, conn.receiver->name(), FALSE ); + l = toplevel->queryList( 0, conn.receiver->name(), false ); if ( !l || !l->first() ) { delete l; n = n.nextSibling().toElement(); @@ -2144,12 +2144,12 @@ void TQWidgetFactory::loadConnections( const TQDomElement &e, TQObject *connecto TQString s2 = "1""%1"; s2 = s2.arg( conn.slot.data() ); - TQStrList signalList = sender->metaObject()->signalNames( TRUE ); - TQStrList slotList = receiver->metaObject()->slotNames( TRUE ); + TQStrList signalList = sender->metaObject()->signalNames( true ); + TQStrList slotList = receiver->metaObject()->slotNames( true ); // if this is a connection to a custom slot and we have a connector, try this as receiver - if ( slotList.find( conn.slot ) == -1 && (TQT_BASE_OBJECT(receiver) == TQT_BASE_OBJECT(toplevel)) && connector ) { - slotList = connector->metaObject()->slotNames( TRUE ); + if ( slotList.find( conn.slot ) == -1 && (receiver == toplevel) && connector ) { + slotList = connector->metaObject()->slotNames( true ); receiver = connector; } @@ -2172,7 +2172,7 @@ void TQWidgetFactory::loadTabOrder( const TQDomElement &e ) while ( !n.isNull() ) { if ( n.tagName() == "tabstop" ) { TQString name = n.firstChild().toText().data(); - TQObjectList *l = toplevel->queryList( 0, name.ascii(), FALSE ); + TQObjectList *l = toplevel->queryList( 0, name.ascii(), false ); if ( l ) { if ( l->first() ) { TQWidget *w = (TQWidget*)l->first(); @@ -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,12 +2256,12 @@ 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; TQString txt; - bool clickable = TRUE, resizable = TRUE; + bool clickable = true, resizable = true; while ( !n.isNull() ) { if ( n.tagName() == "property" ) { TQString attrib = n.attribute( "name" ); @@ -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(); @@ -2310,7 +2310,7 @@ void TQWidgetFactory::createColumn( const TQDomElement &e, TQWidget *widget ) void TQWidgetFactory::loadItem( const TQDomElement &e, TQPixmap &pix, TQString &txt, bool &hasPixmap ) { TQDomElement n = e; - hasPixmap = FALSE; + hasPixmap = false; while ( !n.isNull() ) { if ( n.tagName() == "property" ) { TQString attrib = n.attribute( "name" ); @@ -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; + 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,17 +2345,17 @@ 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; + bool hasPixmap = false; TQString txt; loadItem( n, pix, txt, hasPixmap ); 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; @@ -2382,7 +2382,7 @@ void TQWidgetFactory::createItem( const TQDomElement &e, TQWidget *widget, TQLis } } } else if ( n.tagName() == "item" ) { - item->setOpen( TRUE ); + item->setOpen( true ); createItem( n, widget, item ); } @@ -2403,7 +2403,7 @@ void TQWidgetFactory::loadChildAction( TQObject *parent, const TQDomElement &e ) { TQDomElement n = e; TQAction *a = 0; - bool hasMenuText = FALSE; + bool hasMenuText = false; if ( n.tagName() == "action" ) { a = new TQAction( parent ); TQDomElement n2 = n.firstChild().toElement(); @@ -2412,12 +2412,12 @@ void TQWidgetFactory::loadChildAction( TQObject *parent, const TQDomElement &e ) if ( n2.tagName() == "property" ) { TQString prop(n2.attribute("name")); if (prop == "menuText") - hasMenuText = TRUE; + hasMenuText = true; setProperty( a, prop, n2.firstChild().toElement() ); } 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 ); @@ -2426,7 +2426,7 @@ void TQWidgetFactory::loadChildAction( TQObject *parent, const TQDomElement &e ) if ( n2.tagName() == "property" ) { TQString prop(n2.attribute("name")); if (prop == "menuText") - hasMenuText = TRUE; + hasMenuText = true; setProperty( a, prop, n2.firstChild().toElement() ); } else if ( n2.tagName() == "action" || n2.tagName() == "actiongroup" ) { @@ -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 ); } @@ -2448,9 +2448,9 @@ void TQWidgetFactory::loadActions( const TQDomElement &e ) TQDomElement n = e.firstChild().toElement(); while ( !n.isNull() ) { if ( n.tagName() == "action" ) { - loadChildAction( TQT_TQOBJECT(toplevel), n ); + loadChildAction( toplevel, n ); } else if ( n.tagName() == "actiongroup" ) { - loadChildAction( TQT_TQOBJECT(toplevel), n ); + loadChildAction( toplevel, n ); } n = n.nextSibling().toElement(); } @@ -2476,9 +2476,9 @@ 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() ); + setProperty( tb, n2.attribute( "name" ), n2.firstChild().toElement() ); } n2 = n2.nextSibling().toElement(); } @@ -2499,7 +2499,7 @@ void TQWidgetFactory::loadMenuBar( const TQDomElement &e ) popup->setName( n.attribute( "name" ).ascii() ); mb->insertItem( translate( n.attribute( "text" ) ), popup ); } else if ( n.tagName() == "property" ) { - setProperty( TQT_TQOBJECT(mb), n.attribute( "name" ), n.firstChild().toElement() ); + setProperty( mb, n.attribute( "name" ), n.firstChild().toElement() ); } else if ( n.tagName() == "separator" ) { mb->insertSeparator(); } @@ -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; } |