diff options
Diffstat (limited to 'kommander/editor/widgetfactory.cpp')
-rw-r--r-- | kommander/editor/widgetfactory.cpp | 405 |
1 files changed, 201 insertions, 204 deletions
diff --git a/kommander/editor/widgetfactory.cpp b/kommander/editor/widgetfactory.cpp index 15f9ad1d..f4b7eaac 100644 --- a/kommander/editor/widgetfactory.cpp +++ b/kommander/editor/widgetfactory.cpp @@ -18,6 +18,10 @@ ** **********************************************************************/ +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + #include <tdelocale.h> #include <kommanderfactory.h> @@ -184,7 +188,7 @@ int QDesignerTabWidget::count() const bool QDesignerTabWidget::eventFilter( TQObject *o, TQEvent *e ) { - if ( TQT_BASE_OBJECT(o) != TQT_BASE_OBJECT(tabBar()) ) return false; + if ( o != tabBar() ) return false; switch ( e->type() ) { case TQEvent::MouseButtonPress: { @@ -413,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 ); } @@ -464,7 +468,7 @@ int EditorTabWidget::count() const bool EditorTabWidget::eventFilter( TQObject *o, TQEvent *e ) { - if ( TQT_BASE_OBJECT(o) != TQT_BASE_OBJECT(tabBar()) ) return false; + if ( o != tabBar() ) return false; switch ( e->type() ) { case TQEvent::MouseButtonPress: { @@ -636,7 +640,7 @@ int EditorToolBox::count() const created. */ -TQWidget *WidgetFactory::create( int id, TQWidget *parent, const char *name, bool init, const TQRect *r, Qt::Orientation orient ) +TQWidget *WidgetFactory::create( int id, TQWidget *parent, const char *name, bool init, const TQRect *r, TQt::Orientation orient ) { TQString n = WidgetDatabase::className(id); //tqDebug("Trying to create '%s'", n.latin1()); @@ -658,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); @@ -677,55 +681,55 @@ TQLayout *WidgetFactory::createLayout( TQWidget *widget, TQLayout *layout, Layou int spacing = MainWindow::self->currentLayoutDefaultSpacing(); int margin = 0; - if ( widget && !widget->inherits( TQLAYOUTWIDGET_OBJECT_NAME_STRING ) && - ( WidgetDatabase::isContainer( WidgetDatabase::idFromClassName( WidgetFactory::classNameOf( TQT_TQOBJECT(widget) ) ) ) || + if ( widget && !widget->inherits( "TQLayoutWidget" ) && + ( WidgetDatabase::isContainer( WidgetDatabase::idFromClassName( WidgetFactory::classNameOf( widget ) ) ) || widget && widget->parentWidget() && widget->parentWidget()->inherits( "FormWindow" ) ) ) margin = MainWindow::self->currentLayoutDefaultMargin(); - if ( !layout && widget && widget->inherits( TQTABWIDGET_OBJECT_NAME_STRING ) ) + if ( !layout && widget && widget->inherits( "TQTabWidget" ) ) widget = ((TQTabWidget*)widget)->currentPage(); - if ( !layout && widget && widget->inherits( TQTOOLBOX_OBJECT_NAME_STRING ) ) + if ( !layout && widget && widget->inherits( "TQToolBox" ) ) widget = ((TQToolBox*)widget)->currentItem(); - if ( !layout && widget && widget->inherits( TQWIZARD_OBJECT_NAME_STRING ) ) + if ( !layout && widget && widget->inherits( "TQWizard" ) ) widget = ((TQWizard*)widget)->currentPage(); - if ( !layout && widget && widget->inherits( TQMAINWINDOW_OBJECT_NAME_STRING ) ) + if ( !layout && widget && widget->inherits( "TQMainWindow" ) ) widget = ((TQMainWindow*)widget)->centralWidget(); - if ( !layout && widget && widget->inherits( TQWIDGETSTACK_OBJECT_NAME_STRING ) ) + if ( !layout && widget && widget->inherits( "TQWidgetStack" ) ) widget = ((TQWidgetStack*)widget)->visibleWidget(); - MetaDataBase::addEntry( TQT_TQOBJECT(widget) ); + MetaDataBase::addEntry( widget ); - 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 ); gb->layout()->setMargin( 0 ); gb->layout()->setSpacing( 0 ); TQLayout *l; 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; @@ -736,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: @@ -764,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: @@ -811,13 +815,13 @@ void WidgetFactory::deleteLayout( TQWidget *widget ) if ( !widget ) return; - if ( widget->inherits( TQTABWIDGET_OBJECT_NAME_STRING ) ) + if ( widget->inherits( "TQTabWidget" ) ) widget = ((TQTabWidget*)widget)->currentPage(); - if ( widget->inherits( TQWIZARD_OBJECT_NAME_STRING ) ) + if ( widget->inherits( "TQWizard" ) ) widget = ((TQWizard*)widget)->currentPage(); - if ( widget->inherits( TQMAINWINDOW_OBJECT_NAME_STRING ) ) + if ( widget->inherits( "TQMainWindow" ) ) widget = ((TQMainWindow*)widget)->centralWidget(); - if ( widget->inherits( TQWIDGETSTACK_OBJECT_NAME_STRING ) ) + if ( widget->inherits( "TQWidgetStack" ) ) widget = ((TQWidgetStack*)widget)->visibleWidget(); delete widget->layout(); } @@ -830,9 +834,9 @@ void WidgetFactory::deleteLayout( TQWidget *widget ) */ TQWidget *WidgetFactory::createWidget( const TQString &className, TQWidget *parent, const char *name, bool init, - const TQRect *r, Qt::Orientation orient ) + const TQRect *r, TQt::Orientation orient ) { - if (className == TQPUSHBUTTON_OBJECT_NAME_STRING) + if (className == "TQPushButton") { TQPushButton *b = 0; if (init) @@ -844,9 +848,9 @@ TQWidget *WidgetFactory::createWidget( const TQString &className, TQWidget *pare b = new QDesignerPushButton(parent, name); } TQWidget *w = find_formwindow(b); - b->setAutoDefault(w && ((FormWindow *) w)->mainContainer()->inherits(TQDIALOG_OBJECT_NAME_STRING)); + b->setAutoDefault(w && ((FormWindow *) w)->mainContainer()->inherits("TQDialog")); return b; - } else if (className == TQTOOLBUTTON_OBJECT_NAME_STRING) + } else if (className == "TQToolButton") { if (init) { @@ -855,7 +859,7 @@ TQWidget *WidgetFactory::createWidget( const TQString &className, TQWidget *pare return tb; } return new QDesignerToolButton(parent, name); - } else if (className == TQCHECKBOX_OBJECT_NAME_STRING) + } else if (className == "TQCheckBox") { if (init) { @@ -864,7 +868,7 @@ TQWidget *WidgetFactory::createWidget( const TQString &className, TQWidget *pare return cb; } return new QDesignerCheckBox(parent, name); - } else if (className == TQRADIOBUTTON_OBJECT_NAME_STRING) + } else if (className == "TQRadioButton") { if (init) { @@ -873,17 +877,17 @@ TQWidget *WidgetFactory::createWidget( const TQString &className, TQWidget *pare return rb; } return new QDesignerRadioButton(parent, name); - } else if (className == TQGROUPBOX_OBJECT_NAME_STRING) + } else if (className == "TQGroupBox") { if (init) return new TQGroupBox(TQString::fromLatin1(name), parent, name); return new TQGroupBox(parent, name); - } else if (className == TQBUTTONGROUP_OBJECT_NAME_STRING) + } else if (className == "TQButtonGroup") { if (init) return new TQButtonGroup(TQString::fromLatin1(name), parent, name); return new TQButtonGroup(parent, name); - } else if (className == TQICONVIEW_OBJECT_NAME_STRING) + } else if (className == "TQIconView") { #if !defined(TQT_NO_ICONVIEW) TQIconView *iv = new TQIconView(parent, name); @@ -893,7 +897,7 @@ TQWidget *WidgetFactory::createWidget( const TQString &className, TQWidget *pare #else return 0; #endif - } else if (className == TQTABLE_OBJECT_NAME_STRING) + } else if (className == "TQTable") { #if !defined(TQT_NO_TABLE) if (init) @@ -903,20 +907,20 @@ TQWidget *WidgetFactory::createWidget( const TQString &className, TQWidget *pare return 0; #endif #ifndef TQT_NO_SQL - } else if (className == TQDATATABLE_OBJECT_NAME_STRING) + } else if (className == "TQDataTable") { return new TQDataTable(parent, name); #endif //TQT_NO_SQL - } 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 == TQLISTBOX_OBJECT_NAME_STRING) + } else if (className == "TQListBox") { TQListBox *lb = new TQListBox(parent, name); if (init) @@ -925,7 +929,7 @@ TQWidget *WidgetFactory::createWidget( const TQString &className, TQWidget *pare lb->setCurrentItem(0); } return lb; - } else if (className == TQLISTVIEW_OBJECT_NAME_STRING) + } else if (className == "TQListView") { TQListView *lv = new TQListView(parent, name); lv->setSorting(-1); @@ -935,29 +939,29 @@ TQWidget *WidgetFactory::createWidget( const TQString &className, TQWidget *pare lv->setCurrentItem(new TQListViewItem(lv, i18n("New Item"))); } return lv; - } 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 == TQSPLITTER_OBJECT_NAME_STRING) + else if (className == "TQSplitter") return new TQSplitter(parent, name); - else if (className == TQMULTILINEEDIT_OBJECT_NAME_STRING) + else if (className == "TQMultiLineEdit") return new TQMultiLineEdit(parent, name); - else if (className == TQTEXTEDIT_OBJECT_NAME_STRING) + else if (className == "TQTextEdit") return new TQTextEdit(parent, name); - else if (className == TQLABEL_OBJECT_NAME_STRING) + else if (className == "TQLabel") { QDesignerLabel *l = new QDesignerLabel(parent, name); if (init) { l->setText(TQString::fromLatin1(name)); - MetaDataBase::addEntry(TQT_TQOBJECT(l)); - MetaDataBase::setPropertyChanged(TQT_TQOBJECT(l), "text", true); + MetaDataBase::addEntry(l); + MetaDataBase::setPropertyChanged(l, "text", true); } return l; - } else if (className == TQLAYOUTWIDGET_OBJECT_NAME_STRING) + } else if (className == "TQLayoutWidget") return new TQLayoutWidget(parent, name); - else if (className == TQTABWIDGET_OBJECT_NAME_STRING) + else if (className == "TQTabWidget") { TQTabWidget *tw = new QDesignerTabWidget(parent, name); if (init) @@ -965,32 +969,32 @@ 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_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 (parent && - (parent->inherits("FormWindow") || parent->inherits(TQWIZARD_OBJECT_NAME_STRING) - || parent->inherits(TQTABWIDGET_OBJECT_NAME_STRING) || parent->inherits(TQTOOLBOX_OBJECT_NAME_STRING) || parent->inherits(TQMAINWINDOW_OBJECT_NAME_STRING))) + (parent->inherits("FormWindow") || parent->inherits("TQWizard") + || parent->inherits("TQTabWidget") || parent->inherits("TQToolBox") || parent->inherits("TQMainWindow"))) { FormWindow *fw = find_formwindow(parent); if (fw) { QDesignerWidget *dw = new QDesignerWidget(fw, parent, name); - MetaDataBase::addEntry(TQT_TQOBJECT(dw)); + MetaDataBase::addEntry(dw); return dw; } } return new TQWidget(parent, name); - } else if (className == TQDIALOG_OBJECT_NAME_STRING) + } else if (className == "TQDialog") { TQDialog *dia = 0; if (parent && parent->inherits("FormWindow")) @@ -1000,7 +1004,7 @@ TQWidget *WidgetFactory::createWidget( const TQString &className, TQWidget *pare if (parent && !parent->inherits("MainWindow")) dia->reparent(parent, TQPoint(0, 0), true); return dia; - } else if (className == TQWIZARD_OBJECT_NAME_STRING) + } else if (className == "TQWizard") { TQWizard *wiz = new QDesignerWizard(parent, name); if (parent && !parent->inherits("MainWindow")) @@ -1010,37 +1014,37 @@ 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())); + TQTimer::singleShot(0, wiz, TQ_SLOT(next())); } return wiz; } else if (className == "Spacer") { Spacer *s = new Spacer(parent, name); - MetaDataBase::addEntry(TQT_TQOBJECT(s)); - MetaDataBase::setPropertyChanged(TQT_TQOBJECT(s), "orientation", true); - MetaDataBase::setPropertyChanged(TQT_TQOBJECT(s), "sizeType", true); + MetaDataBase::addEntry(s); + MetaDataBase::setPropertyChanged(s, "orientation", true); + MetaDataBase::setPropertyChanged(s, "sizeType", true); if (!r) return s; if (!r->isValid() || r->width() < 2 && r->height() < 2) s->setOrientation(orient); else if (r->width() < r->height()) - s->setOrientation(Qt::Vertical); + s->setOrientation(TQt::Vertical); else - s->setOrientation(Qt::Horizontal); + s->setOrientation(TQt::Horizontal); return s; - } 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") { TQSlider *s = new TQSlider(parent, name); if (!r) @@ -1048,11 +1052,11 @@ TQWidget *WidgetFactory::createWidget( const TQString &className, TQWidget *pare if (!r->isValid() || r->width() < 2 && r->height() < 2) s->setOrientation(orient); else if (r->width() > r->height()) - s->setOrientation(Qt::Horizontal); - MetaDataBase::addEntry(TQT_TQOBJECT(s)); - MetaDataBase::setPropertyChanged(TQT_TQOBJECT(s), "orientation", true); + s->setOrientation(TQt::Horizontal); + MetaDataBase::addEntry(s); + MetaDataBase::setPropertyChanged(s, "orientation", true); return s; - } else if (className == TQSCROLLBAR_OBJECT_NAME_STRING) + } else if (className == "TQScrollBar") { TQScrollBar *s = new TQScrollBar(parent, name); if (!r) @@ -1060,11 +1064,11 @@ TQWidget *WidgetFactory::createWidget( const TQString &className, TQWidget *pare if (!r->isValid() || r->width() < 2 && r->height() < 2) s->setOrientation(orient); else if (r->width() > r->height()) - s->setOrientation(Qt::Horizontal); - MetaDataBase::addEntry(TQT_TQOBJECT(s)); - MetaDataBase::setPropertyChanged(TQT_TQOBJECT(s), "orientation", true); + s->setOrientation(TQt::Horizontal); + MetaDataBase::addEntry(s); + MetaDataBase::setPropertyChanged(s, "orientation", true); return s; - } else if (className == TQFRAME_OBJECT_NAME_STRING) + } else if (className == "TQFrame") { if (!init) return new TQFrame(parent, name); @@ -1074,37 +1078,37 @@ 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) l->setOrientation(orient); else if (r->width() < r->height()) - l->setOrientation(Qt::Vertical); + l->setOrientation(TQt::Vertical); return l; - } else if (className == TQMAINWINDOW_OBJECT_NAME_STRING) + } else if (className == "TQMainWindow") { TQMainWindow *mw = new KmdrMainWindow(parent, name, 0); 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(); return mw; } #ifndef TQT_NO_SQL - else if (className == TQDATABROWSER_OBJECT_NAME_STRING) + else if (className == "TQDataBrowser") { TQWidget *w = new QDesignerDataBrowser(parent, name); if (parent) w->reparent(parent, TQPoint(0, 0), true); return w; - } else if (className == TQDATAVIEW_OBJECT_NAME_STRING) + } else if (className == "TQDataView") { TQWidget *w = new QDesignerDataView(parent, name); if (parent) @@ -1152,10 +1156,10 @@ 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())); + TQTimer::singleShot(0, wiz, TQ_SLOT(next())); } return wiz; } @@ -1167,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") @@ -1182,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; } @@ -1244,9 +1248,9 @@ TQWidget *WidgetFactory::createWidget( const TQString &className, TQWidget *pare if (!r->isValid() || r->width() < 2 && r->height() < 2) s->setOrientation(orient); else if (r->width() > r->height()) - s->setOrientation(Qt::Horizontal); - MetaDataBase::addEntry(TQT_TQOBJECT(s)); - MetaDataBase::setPropertyChanged(TQT_TQOBJECT(s), "orientation", true); + s->setOrientation(TQt::Horizontal); + MetaDataBase::addEntry(s); + MetaDataBase::setPropertyChanged(s, "orientation", true); return s; } #endif @@ -1266,37 +1270,37 @@ WidgetFactory::LayoutType WidgetFactory::layoutType( TQWidget *w, TQLayout *&lay { layout = 0; - if ( w && w->inherits( TQTABWIDGET_OBJECT_NAME_STRING ) ) + if ( w && w->inherits( "TQTabWidget" ) ) w = ((TQTabWidget*)w)->currentPage(); - if ( w->inherits( TQTOOLBOX_OBJECT_NAME_STRING ) ) + if ( w->inherits( "TQToolBox" ) ) w = ((TQToolBox*)w)->currentItem(); - if ( w && w->inherits( TQWIZARD_OBJECT_NAME_STRING ) ) + if ( w && w->inherits( "TQWizard" ) ) w = ((TQWizard*)w)->currentPage(); - if ( w && w->inherits( TQMAINWINDOW_OBJECT_NAME_STRING ) ) + if ( w && w->inherits( "TQMainWindow" ) ) w = ((TQMainWindow*)w)->centralWidget(); - if ( w && w->inherits( TQWIDGETSTACK_OBJECT_NAME_STRING ) ) + if ( w && w->inherits( "TQWidgetStack" ) ) w = ((TQWidgetStack*)w)->visibleWidget(); - if ( w && w->inherits( TQSPLITTER_OBJECT_NAME_STRING ) ) - return ( (TQSplitter*)w )->orientation() ==Qt::Horizontal ? HBox : VBox; + if ( w && w->inherits( "TQSplitter" ) ) + return ( (TQSplitter*)w )->orientation() ==TQt::Horizontal ? HBox : VBox; if ( !w || !w->layout() ) return NoLayout; TQLayout *lay = w->layout(); - if ( w->inherits( TQGROUPBOX_OBJECT_NAME_STRING ) ) { - TQObjectList *l = TQT_TQOBJECT(lay)->queryList( TQLAYOUT_OBJECT_NAME_STRING ); + if ( w->inherits( "TQGroupBox" ) ) { + TQObjectList *l = lay->queryList( "TQLayout" ); if ( l && l->first() ) lay = (TQLayout*)l->first(); delete l; } layout = lay; - if ( lay->inherits( TQHBOXLAYOUT_OBJECT_NAME_STRING ) ) + if ( lay->inherits( "TQHBoxLayout" ) ) return HBox; - else if ( lay->inherits( TQVBOXLAYOUT_OBJECT_NAME_STRING ) ) + else if ( lay->inherits( "TQVBoxLayout" ) ) return VBox; - else if ( lay->inherits( TQGRIDLAYOUT_OBJECT_NAME_STRING ) ) + else if ( lay->inherits( "TQGridLayout" ) ) return Grid; return NoLayout; } @@ -1306,11 +1310,11 @@ WidgetFactory::LayoutType WidgetFactory::layoutType( TQWidget *w, TQLayout *&lay */ WidgetFactory::LayoutType WidgetFactory::layoutType( TQLayout *layout ) { - 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; } @@ -1327,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; @@ -1349,15 +1353,15 @@ TQWidget* WidgetFactory::containerOfWidget( TQWidget *w ) { if ( !w ) return w; - if ( w->inherits( TQTABWIDGET_OBJECT_NAME_STRING ) ) + if ( w->inherits( "TQTabWidget" ) ) return ((TQTabWidget*)w)->currentPage(); - if ( w->inherits( TQTOOLBOX_OBJECT_NAME_STRING ) ) + if ( w->inherits( "TQToolBox" ) ) return ((TQToolBox*)w)->currentItem(); - if ( w->inherits( TQWIZARD_OBJECT_NAME_STRING ) ) + if ( w->inherits( "TQWizard" ) ) return ((TQWizard*)w)->currentPage(); - if ( w->inherits( TQWIDGETSTACK_OBJECT_NAME_STRING ) ) + if ( w->inherits( "TQWidgetStack" ) ) return ((TQWidgetStack*)w)->visibleWidget(); - if ( w->inherits( TQMAINWINDOW_OBJECT_NAME_STRING ) ) + if ( w->inherits( "TQMainWindow" ) ) return ((TQMainWindow*)w)->centralWidget(); return w; } @@ -1372,10 +1376,10 @@ TQWidget* WidgetFactory::containerOfWidget( TQWidget *w ) TQWidget* WidgetFactory::widgetOfContainer( TQWidget *w ) { - if ( w->parentWidget() && w->parentWidget()->inherits( TQWIDGETSTACK_OBJECT_NAME_STRING ) ) + 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(); @@ -1391,19 +1395,19 @@ bool WidgetFactory::isPassiveInteractor( TQObject* o ) if ( TQApplication::activePopupWidget() ) // if a popup is open, we have to make sure that this one is closed, else X might do funny things return true; - if ( o->inherits( TQTABBAR_OBJECT_NAME_STRING ) || ::tqqt_cast<TQToolBox*>(o->parent()) ) + if ( o->inherits( "TQTabBar" ) || ::tqt_cast<TQToolBox*>(o->parent()) ) return true; - else if ( o->inherits( TQSIZEGRIP_OBJECT_NAME_STRING ) ) + else if ( o->inherits( "TQSizeGrip" ) ) return true; - else if ( o->inherits( TQTOOLBUTTON_OBJECT_NAME_STRING ) && o->parent() && o->parent()->inherits( TQTABBAR_OBJECT_NAME_STRING ) ) + else if ( o->inherits( "TQToolButton" ) && o->parent() && o->parent()->inherits( "TQTabBar" ) ) return true; - else if ( o->parent() && o->parent()->inherits( TQWIZARD_OBJECT_NAME_STRING ) && o->inherits( TQPUSHBUTTON_OBJECT_NAME_STRING ) ) + else if ( o->parent() && o->parent()->inherits( "TQWizard" ) && o->inherits( "TQPushButton" ) ) return true; - else if ( o->parent() && o->parent()->inherits( TQMAINWINDOW_OBJECT_NAME_STRING ) && o->inherits( TQMENUBAR_OBJECT_NAME_STRING ) ) + else if ( o->parent() && o->parent()->inherits( "TQMainWindow" ) && o->inherits( "TQMenuBar" ) ) return true; - else if ( o->inherits( TQDOCKWINDOWHANDLE_OBJECT_NAME_STRING ) ) + else if ( o->inherits( "TQDockWindowHandle" ) ) return true; - else if ( o->inherits( TQHIDEDOCK_OBJECT_NAME_STRING ) ) + else if ( o->inherits( "TQHideDock" ) ) return true; return false; @@ -1416,7 +1420,7 @@ bool WidgetFactory::isPassiveInteractor( TQObject* o ) const char* WidgetFactory::classNameOf( TQObject* o ) { if (o->inherits("QDesignerTabWidget")) - return TQTABWIDGET_OBJECT_NAME_STRING; + return "TQTabWidget"; #ifdef KOMMANDER else if (o->inherits("EditorTabWidget")) return "TabWidget"; @@ -1424,34 +1428,34 @@ const char* WidgetFactory::classNameOf( TQObject* o ) return "ToolBox"; #endif else if (o->inherits("QDesignerDialog")) - return TQDIALOG_OBJECT_NAME_STRING; + return "TQDialog"; else if (o->inherits("QDesignerWidget")) - return TQWIDGET_OBJECT_NAME_STRING; + return "TQWidget"; else if (o->inherits("CustomWidget")) return ((CustomWidget *) o)->realClassName().latin1(); else if (o->inherits("QDesignerLabel")) - return TQLABEL_OBJECT_NAME_STRING; + return "TQLabel"; else if (o->inherits("QDesignerWizard")) - return TQWIZARD_OBJECT_NAME_STRING; + return "TQWizard"; else if (o->inherits("EditorWizard")) return "Wizard"; else if (o->inherits("QDesignerPushButton")) - return TQPUSHBUTTON_OBJECT_NAME_STRING; + return "TQPushButton"; else if (o->inherits("QDesignerToolButton")) - return TQTOOLBUTTON_OBJECT_NAME_STRING; + return "TQToolButton"; else if (o->inherits("QDesignerRadioButton")) - return TQRADIOBUTTON_OBJECT_NAME_STRING; + return "TQRadioButton"; else if (o->inherits("QDesignerCheckBox")) - return TQCHECKBOX_OBJECT_NAME_STRING; + return "TQCheckBox"; else if (o->inherits("QDesignerMenuBar")) - return TQMENUBAR_OBJECT_NAME_STRING; + return "TQMenuBar"; else if (o->inherits("QDesignerToolBar")) - return TQTOOLBAR_OBJECT_NAME_STRING; + return "TQToolBar"; #ifndef TQT_NO_SQL else if (o->inherits("QDesignerDataBrowser")) - return TQDATABROWSER_OBJECT_NAME_STRING; + return "TQDataBrowser"; else if (o->inherits("QDesignerDataView")) - return TQDATAVIEW_OBJECT_NAME_STRING; + return "TQDataView"; #endif else if (o->inherits("EditorDialog")) return "Dialog"; @@ -1469,23 +1473,23 @@ void WidgetFactory::initChangedProperties( TQObject *o ) if ( !o->inherits( "QDesignerToolBar" ) && !o->inherits( "QDesignerMenuBar" ) ) MetaDataBase::setPropertyChanged( o, "geometry", true ); - if ( o->inherits( TQPUSHBUTTON_OBJECT_NAME_STRING ) || o->inherits(TQRADIOBUTTON_OBJECT_NAME_STRING) || o->inherits( TQCHECKBOX_OBJECT_NAME_STRING ) || o->inherits( TQTOOLBUTTON_OBJECT_NAME_STRING ) ) + if ( o->inherits( "TQPushButton" ) || o->inherits("TQRadioButton") || o->inherits( "TQCheckBox" ) || o->inherits( "TQToolButton" ) ) MetaDataBase::setPropertyChanged( o, "text", true ); - else if (::tqqt_cast<TQToolButton*>(o) && ::tqqt_cast<TQToolBox*>(widgetOfContainer((TQWidget*)o->parent()))) { + else if (::tqt_cast<TQToolButton*>(o) && ::tqt_cast<TQToolBox*>(widgetOfContainer((TQWidget*)o->parent()))) { MetaDataBase::setPropertyChanged( o, "usesTextLabel", TRUE ); MetaDataBase::setPropertyChanged( o, "textLabel", TRUE ); MetaDataBase::setPropertyChanged( o, "autoRaise", TRUE ); MetaDataBase::setPropertyChanged( o, "textPosition", TRUE ); - } else if ( o->inherits( TQGROUPBOX_OBJECT_NAME_STRING ) ) + } else if ( o->inherits( "TQGroupBox" ) ) MetaDataBase::setPropertyChanged( o, "title", true ); - else if ( o->isA( TQFRAME_OBJECT_NAME_STRING ) ) { + else if ( o->isA( "TQFrame" ) ) { MetaDataBase::setPropertyChanged( o, "frameShadow", true ); MetaDataBase::setPropertyChanged( o, "frameShape", true ); - } else if ( o->inherits( TQTABWIDGET_OBJECT_NAME_STRING ) || o->inherits( TQWIZARD_OBJECT_NAME_STRING ) ) { + } else if ( o->inherits( "TQTabWidget" ) || o->inherits( "TQWizard" ) ) { MetaDataBase::setPropertyChanged( o, "pageTitle", true ); MetaDataBase::setPropertyChanged( o, "pageName", true ); #ifndef TQT_NO_TABLE - } else if ( o->inherits( TQTABLE_OBJECT_NAME_STRING ) && !o->inherits( TQDATATABLE_OBJECT_NAME_STRING ) ) { + } else if ( o->inherits( "TQTable" ) && !o->inherits( "TQDataTable" ) ) { MetaDataBase::setPropertyChanged( o, "numRows", true ); MetaDataBase::setPropertyChanged( o, "numCols", true ); TQTable *t = (TQTable*)o; @@ -1494,14 +1498,14 @@ void WidgetFactory::initChangedProperties( TQObject *o ) t->verticalHeader()->setLabel( i, TQString::number( i + 1 ) ); } #endif - } else if ( ::tqqt_cast<TQToolBox*>(o) ) { + } else if ( ::tqt_cast<TQToolBox*>(o) ) { MetaDataBase::setPropertyChanged( o, "currentIndex", true ); MetaDataBase::setPropertyChanged( o, "itemName", true ); MetaDataBase::setPropertyChanged( o, "itemLabel", true ); MetaDataBase::setPropertyChanged( o, "itemIconSet", true ); MetaDataBase::setPropertyChanged( o, "itemToolTip", true ); MetaDataBase::setPropertyChanged( o, "itemBackgroundMode", true ); - } else if ( o->inherits( TQSPLITTER_OBJECT_NAME_STRING ) ) { + } else if ( o->inherits( "TQSplitter" ) ) { MetaDataBase::setPropertyChanged( o, "orientation", true ); } else if ( o->inherits( "QDesignerToolBar" ) ) { MetaDataBase::setPropertyChanged( o, "label", true ); @@ -1528,7 +1532,7 @@ bool WidgetFactory::hasSpecialEditor( int id ) return true; if (className.mid(1) == "IconView") return true; - if (className == TQTEXTEDIT_OBJECT_NAME_STRING || className == TQMULTILINEEDIT_OBJECT_NAME_STRING) + if (className == "TQTextEdit" || className == "TQMultiLineEdit") return true; if (className.contains("Table")) return true; @@ -1557,7 +1561,7 @@ void WidgetFactory::editWidget( int id, TQWidget *parent, TQWidget *editWidget, #ifdef KOMMANDER if (className == "ComboBox") { - if (!editWidget->inherits(TQCOMBOBOX_OBJECT_NAME_STRING)) + if (!editWidget->inherits("TQComboBox")) return; TQComboBox *cb = (TQComboBox *) editWidget; @@ -1579,7 +1583,7 @@ void WidgetFactory::editWidget( int id, TQWidget *parent, TQWidget *editWidget, } if (className == "TreeWidget") { - if (!editWidget->inherits(TQLISTVIEW_OBJECT_NAME_STRING)) + if (!editWidget->inherits("TQListView")) return; TQListView *lv = (TQListView *) editWidget; ListViewEditor *e = new ListViewEditor(parent, lv, fw); @@ -1589,7 +1593,7 @@ void WidgetFactory::editWidget( int id, TQWidget *parent, TQWidget *editWidget, } if (className == "ListBox") { - if (!editWidget->inherits(TQLISTBOX_OBJECT_NAME_STRING)) + if (!editWidget->inherits("TQListBox")) return; ListBoxEditor *e = new ListBoxEditor(parent, editWidget, fw); e->exec(); @@ -1599,7 +1603,7 @@ void WidgetFactory::editWidget( int id, TQWidget *parent, TQWidget *editWidget, #endif if (className.mid(1) == "ListBox") { - if (!editWidget->inherits(TQLISTBOX_OBJECT_NAME_STRING)) + if (!editWidget->inherits("TQListBox")) return; ListBoxEditor *e = new ListBoxEditor(parent, editWidget, fw); e->exec(); @@ -1609,7 +1613,7 @@ void WidgetFactory::editWidget( int id, TQWidget *parent, TQWidget *editWidget, if (className.mid(1) == "ComboBox") { - if (!editWidget->inherits(TQCOMBOBOX_OBJECT_NAME_STRING)) + if (!editWidget->inherits("TQComboBox")) return; TQComboBox *cb = (TQComboBox *) editWidget; ListBoxEditor *e = new ListBoxEditor(parent, cb->listBox(), fw); @@ -1621,7 +1625,7 @@ void WidgetFactory::editWidget( int id, TQWidget *parent, TQWidget *editWidget, if (className.mid(1) == "ListView") { - if (!editWidget->inherits(TQLISTVIEW_OBJECT_NAME_STRING)) + if (!editWidget->inherits("TQListView")) return; TQListView *lv = (TQListView *) editWidget; ListViewEditor *e = new ListViewEditor(parent, lv, fw); @@ -1632,7 +1636,7 @@ void WidgetFactory::editWidget( int id, TQWidget *parent, TQWidget *editWidget, if (className.mid(1) == "IconView") { - if (!editWidget->inherits(TQICONVIEW_OBJECT_NAME_STRING)) + if (!editWidget->inherits("TQIconView")) return; IconViewEditor *e = new IconViewEditor(parent, editWidget, fw); e->exec(); @@ -1640,7 +1644,7 @@ void WidgetFactory::editWidget( int id, TQWidget *parent, TQWidget *editWidget, return; } - if (className == TQMULTILINEEDIT_OBJECT_NAME_STRING || className == TQTEXTEDIT_OBJECT_NAME_STRING) + if (className == "TQMultiLineEdit" || className == "TQTextEdit") { MultiLineEditor *e = new MultiLineEditor(parent, editWidget, fw); e->exec(); @@ -1669,7 +1673,7 @@ bool WidgetFactory::canResetProperty( TQObject *w, const TQString &propName ) bool WidgetFactory::resetProperty( TQObject *w, const TQString &propName ) { const TQMetaProperty *p = w->metaObject()->property( w->metaObject()-> - findProperty( propName, true ), true ); + findProperty( propName.latin1(), true ), true ); if (!p ) return false; return p->reset( w ); @@ -1679,15 +1683,15 @@ TQVariant WidgetFactory::defaultValue( TQObject *w, const TQString &propName ) { if ( propName == "wordwrap" ) { int v = defaultValue( w, "alignment" ).toInt(); - return TQVariant( ( v & WordBreak ) == WordBreak, 0 ); + return TQVariant( ( v & WordBreak ) == WordBreak ); } else if ( propName == "toolTip" || propName == "whatsThis" ) { return TQVariant( TQString::fromLatin1( "" ) ); } else if ( w->inherits( "CustomWidget" ) ) { return TQVariant(); } else if ( propName == "frameworkCode" ) { - return TQVariant( true, 0 ); + return TQVariant( true ); } else if ( propName == "layoutMargin" ) { - if ( w->inherits( TQLAYOUTWIDGET_OBJECT_NAME_STRING ) ) + if ( w->inherits( "TQLayoutWidget" ) ) return TQVariant( 0 ); else if ( MainWindow::self->formWindow() ) return TQVariant( MainWindow::self->formWindow()->layoutDefaultMargin() ); @@ -1702,7 +1706,7 @@ TQVariant WidgetFactory::defaultValue( TQObject *w, const TQString &propName ) TQString WidgetFactory::defaultCurrentItem( TQObject *w, const TQString &propName ) { const TQMetaProperty *p = w->metaObject()-> - property( w->metaObject()->findProperty( propName, true ), true ); + property( w->metaObject()->findProperty( propName.latin1(), true ), true ); if ( !p ) { int v = defaultValue( w, "alignment" ).toInt(); if ( propName == "hAlign" ) { @@ -1751,7 +1755,7 @@ void QDesignerLabel::updateBuddy() if ( myBuddy.isEmpty() ) return; - TQObjectList *l = topLevelWidget()->queryList( TQWIDGET_OBJECT_NAME_STRING, myBuddy, false, true ); + TQObjectList *l = topLevelWidget()->queryList( "TQWidget", myBuddy, false, true ); if ( !l || !l->first() ) { delete l; return; @@ -1825,15 +1829,15 @@ void TQLayoutWidget::updateSizePolicy() TQLayout *parentLayout = 0; if ( parent() && parent()->isWidgetType() ) { parentLayout = ((TQWidget *)parent())->layout(); - if ( parentLayout && parentLayout->mainWidget()->inherits(TQLAYOUTWIDGET_OBJECT_NAME_STRING) ) + if ( parentLayout && parentLayout->mainWidget()->inherits("TQLayoutWidget") ) parentLayout = 0; } TQObjectListIt it( childrenListObject() ); TQObject *o; - if ( layout()->inherits(TQVBOXLAYOUT_OBJECT_NAME_STRING) ) { - if ( parentLayout && parentLayout->inherits(TQHBOXLAYOUT_OBJECT_NAME_STRING) ) + if ( layout()->inherits("TQVBoxLayout") ) { + if ( parentLayout && parentLayout->inherits("TQHBoxLayout") ) vt = TQSizePolicy::Minimum; else vt = TQSizePolicy::Fixed; @@ -1853,8 +1857,8 @@ void TQLayoutWidget::updateSizePolicy() if ( w->sizePolicy().mayShrinkVertically() ) vt |= TQSizePolicy::Maximum; } - } else if ( layout()->inherits(TQHBOXLAYOUT_OBJECT_NAME_STRING) ) { - if ( parentLayout && parentLayout->inherits(TQVBOXLAYOUT_OBJECT_NAME_STRING) ) + } else if ( layout()->inherits("TQHBoxLayout") ) { + if ( parentLayout && parentLayout->inherits("TQVBoxLayout") ) ht = TQSizePolicy::Minimum; else ht = TQSizePolicy::Fixed; @@ -1874,13 +1878,13 @@ void TQLayoutWidget::updateSizePolicy() if ( !w->sizePolicy().mayShrinkVertically() ) vt &= ~TQSizePolicy::Maximum; } - } else if ( layout()->inherits(TQGRIDLAYOUT_OBJECT_NAME_STRING) ) { + } else if ( layout()->inherits("TQGridLayout") ) { ht = TQSizePolicy::Fixed; vt = TQSizePolicy::Fixed; if ( parentLayout ) { - if ( parentLayout->inherits(TQVBOXLAYOUT_OBJECT_NAME_STRING) ) + if ( parentLayout->inherits("TQVBoxLayout") ) ht = TQSizePolicy::Minimum; - else if ( parentLayout->inherits(TQHBOXLAYOUT_OBJECT_NAME_STRING) ) + else if ( parentLayout->inherits("TQHBoxLayout") ) vt = TQSizePolicy::Minimum; } @@ -1900,17 +1904,10 @@ void TQLayoutWidget::updateSizePolicy() vt |= TQSizePolicy::Maximum; } } -#ifdef USE_QT4 - if ( layout()->expanding() & TQSizePolicy::Horizontally ) - ht = TQSizePolicy::Expanding; - if ( layout()->expanding() & TQSizePolicy::Vertically ) - vt = TQSizePolicy::Expanding; -#else // USE_QT4 if ( layout()->expanding() & TQSizePolicy::Horizontally ) ht = TQSizePolicy::Expanding; if ( layout()->expanding() & TQSizePolicy::Vertically ) vt = TQSizePolicy::Expanding; -#endif // USE_QT4 layout()->invalidate(); } |