diff options
Diffstat (limited to 'kdevdesigner/designer/widgetfactory.cpp')
-rw-r--r-- | kdevdesigner/designer/widgetfactory.cpp | 494 |
1 files changed, 239 insertions, 255 deletions
diff --git a/kdevdesigner/designer/widgetfactory.cpp b/kdevdesigner/designer/widgetfactory.cpp index 9423b6a6..7db821df 100644 --- a/kdevdesigner/designer/widgetfactory.cpp +++ b/kdevdesigner/designer/widgetfactory.cpp @@ -107,7 +107,7 @@ FormWindow *find_formwindow( TQWidget *w ) if ( !w ) return 0; for (;;) { - if ( ::tqqt_cast<FormWindow*>(w) ) + if ( ::tqt_cast<FormWindow*>(w) ) return (FormWindow*)w; if ( !w->parentWidget() ) return 0; @@ -170,7 +170,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: { @@ -301,8 +301,8 @@ QDesignerWidgetStack::QDesignerWidgetStack( TQWidget *parent, const char *name ) next->setAutoRaise( TRUE ); next->setAutoRepeat( TRUE ); next->setSizePolicy( TQSizePolicy( TQSizePolicy::Ignored, TQSizePolicy::Ignored ) ); - connect( prev, TQT_SIGNAL( clicked() ), this, TQT_SLOT( prevPage() ) ); - connect( next, TQT_SIGNAL( clicked() ), this, TQT_SLOT( nextPage() ) ); + connect( prev, TQ_SIGNAL( clicked() ), this, TQ_SLOT( prevPage() ) ); + connect( next, TQ_SIGNAL( clicked() ), this, TQ_SLOT( nextPage() ) ); updateButtons(); } @@ -522,7 +522,7 @@ void WidgetFactory::saveChangedProperties( TQObject *w, int id ) 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 ); if ( n.isEmpty() ) @@ -537,18 +537,18 @@ TQWidget *WidgetFactory::create( int id, TQWidget *parent, const char *name, boo TQString str = WidgetDatabase::createWidgetName( id ); const char *s = str.latin1(); w = createWidget( n, parent, name ? name : s, init, r, orient ); - if ( ::tqqt_cast<TQScrollView*>(w) ) + if ( ::tqt_cast<TQScrollView*>(w) ) ( (TQScrollView*)w )->disableSizeHintCaching(); if ( !w && WidgetDatabase::isCustomWidget( id ) ) w = createCustomWidget( parent, name ? name : s, MetaDataBase::customWidget( id ) ); if ( !w ) return 0; - MetaDataBase::addEntry( TQT_TQOBJECT(w) ); + MetaDataBase::addEntry( w ); if ( !defaultProperties->contains( id ) ) - saveDefaultProperties( TQT_TQOBJECT(w), id ); + saveDefaultProperties( w, id ); if ( !changedProperties->contains( id ) ) - saveChangedProperties( TQT_TQOBJECT(w), id ); + saveChangedProperties( w, id ); return w; } @@ -562,36 +562,36 @@ TQLayout *WidgetFactory::createLayout( TQWidget *widget, TQLayout *layout, Layou int spacing = MainWindow::self->currentLayoutDefaultSpacing(); int margin = 0; - int metaspacing = MetaDataBase::spacing( TQT_TQOBJECT(widget) ); - int metamargin = MetaDataBase::margin( TQT_TQOBJECT(widget) ); + int metaspacing = MetaDataBase::spacing( widget ); + int metamargin = MetaDataBase::margin( widget ); - if ( ::tqqt_cast<TQLayoutWidget*>(widget) && - ( WidgetDatabase::isContainer( WidgetDatabase::idFromClassName( WidgetFactory::classNameOf( TQT_TQOBJECT(widget) ) ) ) || - widget && ::tqqt_cast<FormWindow*>(widget->parentWidget()) ) ) + if ( ::tqt_cast<TQLayoutWidget*>(widget) && + ( WidgetDatabase::isContainer( WidgetDatabase::idFromClassName( WidgetFactory::classNameOf( widget ) ) ) || + widget && ::tqt_cast<FormWindow*>(widget->parentWidget()) ) ) margin = MainWindow::self->currentLayoutDefaultMargin(); - if ( !layout && ::tqqt_cast<TQTabWidget*>(widget) ) + if ( !layout && ::tqt_cast<TQTabWidget*>(widget) ) widget = ((TQTabWidget*)widget)->currentPage(); - if ( !layout && ::tqqt_cast<TQWizard*>(widget) ) + if ( !layout && ::tqt_cast<TQWizard*>(widget) ) widget = ((TQWizard*)widget)->currentPage(); - if ( !layout && ::tqqt_cast<TQMainWindow*>(widget) ) + if ( !layout && ::tqt_cast<TQMainWindow*>(widget) ) widget = ((TQMainWindow*)widget)->centralWidget(); - if ( !layout && ::tqqt_cast<TQWidgetStack*>(widget) ) + if ( !layout && ::tqt_cast<TQWidgetStack*>(widget) ) widget = ((TQWidgetStack*)widget)->visibleWidget(); - if ( !layout && ::tqqt_cast<TQToolBox*>(widget) ) + if ( !layout && ::tqt_cast<TQToolBox*>(widget) ) widget = ((TQToolBox*)widget)->currentItem(); - MetaDataBase::addEntry( TQT_TQOBJECT(widget) ); + MetaDataBase::addEntry( widget ); TQLayout *l = 0; int align = 0; - if ( !layout && ::tqqt_cast<TQGroupBox*>(widget) ) { + if ( !layout && ::tqt_cast<TQGroupBox*>(widget) ) { TQGroupBox *gb = (TQGroupBox*)widget; - gb->setColumnLayout( 0, Qt::Vertical ); + gb->setColumnLayout( 0, TQt::Vertical ); layout = gb->layout(); layout->setMargin( 0 ); layout->setSpacing( 0 ); @@ -609,8 +609,8 @@ TQLayout *WidgetFactory::createLayout( TQWidget *widget, TQLayout *layout, Layou return 0; } align = TQt::AlignTop; - MetaDataBase::setMargin( TQT_TQOBJECT(gb), metamargin ); - MetaDataBase::setSpacing( TQT_TQOBJECT(gb), metaspacing ); + MetaDataBase::setMargin( gb, metamargin ); + MetaDataBase::setSpacing( gb, metaspacing ); } else { if ( layout ) { switch ( type ) { @@ -626,7 +626,7 @@ TQLayout *WidgetFactory::createLayout( TQWidget *widget, TQLayout *layout, Layou default: return 0; } - MetaDataBase::addEntry( TQT_TQOBJECT(l) ); + MetaDataBase::addEntry( l ); l->setSpacing( spacing ); l->setMargin( margin ); } else { @@ -643,10 +643,10 @@ TQLayout *WidgetFactory::createLayout( TQWidget *widget, TQLayout *layout, Layou default: return 0; } - MetaDataBase::addEntry( TQT_TQOBJECT(l) ); + MetaDataBase::addEntry( l ); if ( widget ) { - MetaDataBase::setMargin( TQT_TQOBJECT(widget), metamargin ); - MetaDataBase::setSpacing( TQT_TQOBJECT(widget), metaspacing ); + MetaDataBase::setMargin( widget, metamargin ); + MetaDataBase::setSpacing( widget, metaspacing ); } else { l->setMargin( margin ); l->setSpacing( spacing ); @@ -654,7 +654,7 @@ TQLayout *WidgetFactory::createLayout( TQWidget *widget, TQLayout *layout, Layou } } l->setAlignment( align ); - MetaDataBase::addEntry( TQT_TQOBJECT(l) ); + MetaDataBase::addEntry( l ); return l; } @@ -663,15 +663,15 @@ void WidgetFactory::deleteLayout( TQWidget *widget ) if ( !widget ) return; - if ( ::tqqt_cast<TQTabWidget*>(widget) ) + if ( ::tqt_cast<TQTabWidget*>(widget) ) widget = ((TQTabWidget*)widget)->currentPage(); - if ( ::tqqt_cast<TQWizard*>(widget) ) + if ( ::tqt_cast<TQWizard*>(widget) ) widget = ((TQWizard*)widget)->currentPage(); - if ( ::tqqt_cast<TQMainWindow*>(widget) ) + if ( ::tqt_cast<TQMainWindow*>(widget) ) widget = ((TQMainWindow*)widget)->centralWidget(); - if ( ::tqqt_cast<TQWidgetStack*>(widget) ) + if ( ::tqt_cast<TQWidgetStack*>(widget) ) widget = ((TQWidgetStack*)widget)->visibleWidget(); - if ( ::tqqt_cast<TQToolBox*>(widget) ) + if ( ::tqt_cast<TQToolBox*>(widget) ) widget = ((TQToolBox*)widget)->currentItem(); delete widget->layout(); } @@ -684,9 +684,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 ) { b = new QDesignerPushButton( parent, name ); @@ -695,12 +695,12 @@ TQWidget *WidgetFactory::createWidget( const TQString &className, TQWidget *pare b = new QDesignerPushButton( parent, name ); } TQWidget *w = find_formwindow( b ); - b->setAutoDefault( w && ::tqqt_cast<TQDialog*>(((FormWindow*)w)->mainContainer()) ); + b->setAutoDefault( w && ::tqt_cast<TQDialog*>(((FormWindow*)w)->mainContainer()) ); return b; - } else if ( className == TQTOOLBUTTON_OBJECT_NAME_STRING ) { + } else if ( className == "TQToolButton" ) { if ( init ) { QDesignerToolButton *tb = new QDesignerToolButton( parent, name ); - if ( ::tqqt_cast<TQToolBox*>(widgetOfContainer(parent))) { + if ( ::tqt_cast<TQToolBox*>(widgetOfContainer(parent))) { tb->setUsesTextLabel(TRUE); tb->setTextLabel("..."); tb->setAutoRaise(TRUE); @@ -711,29 +711,29 @@ 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 ) { QDesignerCheckBox *cb = new QDesignerCheckBox( parent, name ); cb->setText( TQString::fromLatin1( name ) ); return cb; } return new QDesignerCheckBox( parent, name ); - } else if ( className == TQRADIOBUTTON_OBJECT_NAME_STRING ) { + } else if ( className == "TQRadioButton" ) { if ( init ) { QDesignerRadioButton *rb = new QDesignerRadioButton( parent, name ); rb->setText( TQString::fromLatin1( name ) ); 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 ); if ( init ) @@ -742,7 +742,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 ) return new TQTable( 3, 3, parent, name ); @@ -751,24 +751,24 @@ 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 ) { lb->insertItem( i18n( "New Item" ) ); 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 ); if ( init ) { @@ -776,22 +776,22 @@ 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 || className == "TextLabel" ) { + else if ( className == "TQLabel" || className == "TextLabel" ) { QDesignerLabel *l = new QDesignerLabel( parent, name ); if ( init ) { l->setText( TQString::fromLatin1( name ) ); - MetaDataBase::addEntry( TQT_TQOBJECT(l) ); - MetaDataBase::setPropertyChanged( TQT_TQOBJECT(l), "text", TRUE ); + MetaDataBase::addEntry( l ); + MetaDataBase::setPropertyChanged( l, "text", TRUE ); } return l; } else if ( className == "PixmapLabel" ) { @@ -799,129 +799,121 @@ TQWidget *WidgetFactory::createWidget( const TQString &className, TQWidget *pare if ( init ) { l->setPixmap( BarIcon( "designer_qtlogo.png", KDevDesignerPartFactory::instance() ) ); l->setScaledContents( TRUE ); - MetaDataBase::addEntry( TQT_TQOBJECT(l) ); - MetaDataBase::setPropertyChanged( TQT_TQOBJECT(l), "pixmap", TRUE ); - MetaDataBase::setPropertyChanged( TQT_TQOBJECT(l), "scaledContents", TRUE ); + MetaDataBase::addEntry( l ); + MetaDataBase::setPropertyChanged( l, "pixmap", TRUE ); + MetaDataBase::setPropertyChanged( l, "scaledContents", TRUE ); } return l; - } else if ( className == TQLAYOUTWIDGET_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 ) { FormWindow *fw = find_formwindow( parent ); TQWidget *w = fw ? new QDesignerWidget( fw, tw, "tab" ) : new TQWidget( tw, "tab" ); tw->addTab( w, i18n("Tab 1") ); - MetaDataBase::addEntry( TQT_TQOBJECT(w) ); + MetaDataBase::addEntry( w ); w = fw ? new QDesignerWidget( fw, tw, "tab" ) : new TQWidget( tw, "tab" ); tw->addTab( w, i18n("Tab 2") ); - MetaDataBase::addEntry( TQT_TQOBJECT(tw) ); - MetaDataBase::addEntry( TQT_TQOBJECT(w) ); + MetaDataBase::addEntry( tw ); + MetaDataBase::addEntry( w ); } return tw; - } else if ( className == TQWIDGETSTACK_OBJECT_NAME_STRING ) { + } else if ( className == "TQWidgetStack" ) { QDesignerWidgetStack *ws = new QDesignerWidgetStack( parent, name ); if ( init ) { FormWindow *fw = find_formwindow( parent ); TQWidget *w = fw ? new QDesignerWidget( fw, ws, "WStackPage" ) : new TQWidget( ws, "WStackPage" ); ws->insertPage( w ); - MetaDataBase::addEntry( TQT_TQOBJECT(w) ); - MetaDataBase::addEntry( TQT_TQOBJECT(ws) ); + MetaDataBase::addEntry( w ); + MetaDataBase::addEntry( ws ); } return ws; - } else if ( className == TQCOMBOBOX_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 && - ( ::tqqt_cast<FormWindow*>(parent) || - ::tqqt_cast<TQWizard*>(parent) || - ::tqqt_cast<TQTabWidget*>(parent) || - ::tqqt_cast<TQWidgetStack*>(parent) || - ::tqqt_cast<TQToolBox*>(parent) || - ::tqqt_cast<TQMainWindow*>(parent) ) ) { + ( ::tqt_cast<FormWindow*>(parent) || + ::tqt_cast<TQWizard*>(parent) || + ::tqt_cast<TQTabWidget*>(parent) || + ::tqt_cast<TQWidgetStack*>(parent) || + ::tqt_cast<TQToolBox*>(parent) || + ::tqt_cast<TQMainWindow*>(parent) ) ) { 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 ( ::tqqt_cast<FormWindow*>(parent) ) + if ( ::tqt_cast<FormWindow*>(parent) ) dia = new QDesignerDialog( (FormWindow*)parent, parent, name ); else dia = new TQDialog( parent, name ); -#if defined(TQT_NON_COMMERCIAL) - if ( ::tqqt_cast<MainWindow*>(parent) ) -#else if ( parent ) -#endif 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 defined(TQT_NON_COMMERCIAL) - if ( ::tqqt_cast<MainWindow*>(parent) ) -#else if ( parent ) -#endif wiz->reparent( parent, TQPoint( 0, 0 ), TRUE ); - if ( init && ::tqqt_cast<FormWindow*>(parent) ) { + if ( init && ::tqt_cast<FormWindow*>(parent) ) { QDesignerWidget *dw = new QDesignerWidget( (FormWindow*)parent, wiz, "WizardPage" ); - MetaDataBase::addEntry( TQT_TQOBJECT(dw) ); + MetaDataBase::addEntry( dw ); wiz->addPage( dw, i18n( "Page" ) ); - TQTimer::singleShot( 0, wiz, TQT_SLOT( next() ) ); + 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 ) return s; 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 ) return s; 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 ); TQFrame *f = new TQFrame( parent, name ); @@ -929,28 +921,28 @@ TQWidget *WidgetFactory::createWidget( const TQString &className, TQWidget *pare return f; } else if ( className == "Line" ) { Line *l = new Line( parent, name ); - MetaDataBase::addEntry( TQT_TQOBJECT(l) ); - MetaDataBase::setPropertyChanged( TQT_TQOBJECT(l), "orientation", TRUE ); - MetaDataBase::setPropertyChanged( TQT_TQOBJECT(l), "frameShadow", TRUE ); - MetaDataBase::setPropertyChanged( TQT_TQOBJECT(l), "frameShape", TRUE ); + MetaDataBase::addEntry( l ); + MetaDataBase::setPropertyChanged( l, "orientation", TRUE ); + MetaDataBase::setPropertyChanged( l, "frameShadow", TRUE ); + MetaDataBase::setPropertyChanged( l, "frameShape", TRUE ); if ( !r ) return l; if ( !r->isValid() || r->width() < 2 && r->height() < 2 ) 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 TQMainWindow( 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; - } else if ( className == TQTOOLBOX_OBJECT_NAME_STRING ) { + } else if ( className == "TQToolBox" ) { if ( !init ) return new QDesignerToolBox( parent, name ); TQToolBox *tb = new QDesignerToolBox( parent, name ); @@ -958,20 +950,20 @@ TQWidget *WidgetFactory::createWidget( const TQString &className, TQWidget *pare TQWidget *w = fw ? new QDesignerWidget( fw, tb, "page1" ) : new TQWidget( tb, "page1" ); tb->addItem( w, i18n("Page 1") ); - MetaDataBase::addEntry( TQT_TQOBJECT(w) ); + MetaDataBase::addEntry( w ); w = fw ? new QDesignerWidget( fw, tb, "page2" ) : new TQWidget( tb, "page2" ); tb->addItem( w, i18n("Page 2") ); - MetaDataBase::addEntry( TQT_TQOBJECT(tb) ); - MetaDataBase::addEntry( TQT_TQOBJECT(w) ); + MetaDataBase::addEntry( tb ); + MetaDataBase::addEntry( w ); return tb; } #ifndef TQT_NO_SQL - 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 ) w->reparent( parent, TQPoint( 0, 0 ), TRUE ); @@ -1010,37 +1002,37 @@ WidgetFactory::LayoutType WidgetFactory::layoutType( TQWidget *w, TQLayout *&lay { layout = 0; - if ( ::tqqt_cast<TQTabWidget*>(w) ) + if ( ::tqt_cast<TQTabWidget*>(w) ) w = ((TQTabWidget*)w)->currentPage(); - if ( ::tqqt_cast<TQWizard*>(w) ) + if ( ::tqt_cast<TQWizard*>(w) ) w = ((TQWizard*)w)->currentPage(); - if ( ::tqqt_cast<TQMainWindow*>(w) ) + if ( ::tqt_cast<TQMainWindow*>(w) ) w = ((TQMainWindow*)w)->centralWidget(); - if ( ::tqqt_cast<TQWidgetStack*>(w) ) + if ( ::tqt_cast<TQWidgetStack*>(w) ) w = ((TQWidgetStack*)w)->visibleWidget(); - if ( ::tqqt_cast<TQToolBox*>(w) ) + if ( ::tqt_cast<TQToolBox*>(w) ) w = ((TQToolBox*)w)->currentItem(); - if ( ::tqqt_cast<TQSplitter*>(w) ) - return ( (TQSplitter*)w )->orientation() ==Qt::Horizontal ? HBox : VBox; + if ( ::tqt_cast<TQSplitter*>(w) ) + return ( (TQSplitter*)w )->orientation() ==TQt::Horizontal ? HBox : VBox; if ( !w || !w->layout() ) return NoLayout; TQLayout *lay = w->layout(); - if ( ::tqqt_cast<TQGroupBox*>(w) ) { - TQObjectList *l = TQT_TQOBJECT(lay)->queryList( TQLAYOUT_OBJECT_NAME_STRING ); + if ( ::tqt_cast<TQGroupBox*>(w) ) { + TQObjectList *l = lay->queryList( "TQLayout" ); if ( l && l->first() ) lay = (TQLayout*)l->first(); delete l; } layout = lay; - if ( ::tqqt_cast<TQHBoxLayout*>(lay) ) + if ( ::tqt_cast<TQHBoxLayout*>(lay) ) return HBox; - else if ( ::tqqt_cast<TQVBoxLayout*>(lay) ) + else if ( ::tqt_cast<TQVBoxLayout*>(lay) ) return VBox; - else if ( ::tqqt_cast<TQGridLayout*>(lay) ) + else if ( ::tqt_cast<TQGridLayout*>(lay) ) return Grid; return NoLayout; } @@ -1050,11 +1042,11 @@ WidgetFactory::LayoutType WidgetFactory::layoutType( TQWidget *w, TQLayout *&lay */ WidgetFactory::LayoutType WidgetFactory::layoutType( TQLayout *layout ) { - if ( ::tqqt_cast<TQHBoxLayout*>(layout) ) + if ( ::tqt_cast<TQHBoxLayout*>(layout) ) return HBox; - else if ( ::tqqt_cast<TQVBoxLayout*>(layout) ) + else if ( ::tqt_cast<TQVBoxLayout*>(layout) ) return VBox; - else if ( ::tqqt_cast<TQGridLayout*>(layout) ) + else if ( ::tqt_cast<TQGridLayout*>(layout) ) return Grid; return NoLayout; } @@ -1071,7 +1063,7 @@ WidgetFactory::LayoutType WidgetFactory::layoutType( TQWidget *w ) TQWidget *WidgetFactory::layoutParent( TQLayout *layout ) { - TQObject *o = TQT_TQOBJECT(layout); + TQObject *o = layout; while ( o ) { if ( o->isWidgetType() ) return (TQWidget*)o; @@ -1093,15 +1085,15 @@ TQWidget* WidgetFactory::containerOfWidget( TQWidget *w ) { if ( !w ) return w; - if ( ::tqqt_cast<TQTabWidget*>(w) ) + if ( ::tqt_cast<TQTabWidget*>(w) ) return ((TQTabWidget*)w)->currentPage(); - if ( ::tqqt_cast<TQWizard*>(w) ) + if ( ::tqt_cast<TQWizard*>(w) ) return ((TQWizard*)w)->currentPage(); - if ( ::tqqt_cast<TQWidgetStack*>(w) ) + if ( ::tqt_cast<TQWidgetStack*>(w) ) return ((TQWidgetStack*)w)->visibleWidget(); - if ( ::tqqt_cast<TQToolBox*>(w) ) + if ( ::tqt_cast<TQToolBox*>(w) ) return ((TQToolBox*)w)->currentItem(); - if ( ::tqqt_cast<TQMainWindow*>(w) ) + if ( ::tqt_cast<TQMainWindow*>(w) ) return ((TQMainWindow*)w)->centralWidget(); #ifdef TQT_CONTAINER_CUSTOM_WIDGETS if ( !WidgetDatabase::isCustomPluginWidget( WidgetDatabase::idFromClassName( classNameOf( w ) ) ) ) @@ -1133,16 +1125,16 @@ TQWidget* WidgetFactory::containerOfWidget( TQWidget *w ) TQWidget* WidgetFactory::widgetOfContainer( TQWidget *w ) { - if ( w && ::tqqt_cast<TQWidgetStack*>(w->parentWidget()) ) + if ( w && ::tqt_cast<TQWidgetStack*>(w->parentWidget()) ) w = w->parentWidget(); if ( w->parentWidget() && w->parentWidget()->parentWidget() && w->parentWidget()->parentWidget()->parentWidget() && - ::tqqt_cast<TQToolBox*>(w->parentWidget()->parentWidget()->parentWidget()) ) + ::tqt_cast<TQToolBox*>(w->parentWidget()->parentWidget()->parentWidget()) ) return w->parentWidget()->parentWidget()->parentWidget(); while ( w ) { - int id = WidgetDatabase::idFromClassName( WidgetFactory::classNameOf( TQT_TQOBJECT(w) ) ); + int id = WidgetDatabase::idFromClassName( WidgetFactory::classNameOf( w ) ); if ( WidgetDatabase::isContainer( id ) || - w && ::tqqt_cast<FormWindow*>(w->parentWidget()) ) + w && ::tqt_cast<FormWindow*>(w->parentWidget()) ) return w; w = w->parentWidget(); } @@ -1165,22 +1157,22 @@ 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 ( lastWasAPassiveInteractor = TRUE ); - if ( ::tqqt_cast<TQTabBar*>(o) ) + if ( ::tqt_cast<TQTabBar*>(o) ) return ( lastWasAPassiveInteractor = TRUE ); - else if ( ::tqqt_cast<TQSizeGrip*>(o) ) + else if ( ::tqt_cast<TQSizeGrip*>(o) ) return ( lastWasAPassiveInteractor = TRUE ); - else if ( ::tqqt_cast<TQButton*>(o) && - ( ::tqqt_cast<TQTabBar*>(o->parent()) || ::tqqt_cast<TQToolBox*>(o->parent()) ) ) + else if ( ::tqt_cast<TQButton*>(o) && + ( ::tqt_cast<TQTabBar*>(o->parent()) || ::tqt_cast<TQToolBox*>(o->parent()) ) ) return ( lastWasAPassiveInteractor = TRUE ); - else if ( ::tqqt_cast<TQPushButton*>(o) && ::tqqt_cast<TQWizard*>(o->parent()) ) + else if ( ::tqt_cast<TQPushButton*>(o) && ::tqt_cast<TQWizard*>(o->parent()) ) return ( lastWasAPassiveInteractor = TRUE ); - else if ( ::tqqt_cast<TQMenuBar*>(o) && ::tqqt_cast<TQMainWindow*>(o->parent()) ) + else if ( ::tqt_cast<TQMenuBar*>(o) && ::tqt_cast<TQMainWindow*>(o->parent()) ) return ( lastWasAPassiveInteractor = TRUE ); -// else if ( ::tqqt_cast<TQDockWindowHandle*>(o) ) - else if ( o->inherits( TQDOCKWINDOWHANDLE_OBJECT_NAME_STRING ) ) +// else if ( ::tqt_cast<TQDockWindowHandle*>(o) ) + else if ( o->inherits( "TQDockWindowHandle" ) ) return ( lastWasAPassiveInteractor = TRUE ); -// else if ( ::tqqt_cast<TQHideDock*>(o) ) - else if ( o->inherits( TQHIDEDOCK_OBJECT_NAME_STRING ) ) +// else if ( ::tqt_cast<TQHideDock*>(o) ) + else if ( o->inherits( "TQHideDock" ) ) return ( lastWasAPassiveInteractor = TRUE ); else if ( qstrcmp( o->name(), "designer_wizardstack_button" ) == 0 ) return ( lastWasAPassiveInteractor = TRUE ); @@ -1189,7 +1181,7 @@ bool WidgetFactory::isPassiveInteractor( TQObject* o ) return ( lastWasAPassiveInteractor = FALSE ); WidgetInterface *iface = 0; TQWidget *w = (TQWidget*)o; - while ( !iface && w && !::tqqt_cast<FormWindow*>(w) ) { + while ( !iface && w && !::tqt_cast<FormWindow*>(w) ) { widgetManager()->queryInterface( classNameOf( w ), &iface ); w = w->parentWidget(); } @@ -1222,76 +1214,76 @@ const char* WidgetFactory::classNameOf( TQObject* o ) return o->className(); if (WidgetDatabase::isCustomPluginWidget(WidgetDatabase::idFromClassName(o->className()))) return o->className(); - else if ( ::tqqt_cast<QDesignerTabWidget*>(o) ) - return TQTABWIDGET_OBJECT_NAME_STRING; - else if ( ::tqqt_cast<QDesignerWidgetStack*>(o) ) - return TQWIDGETSTACK_OBJECT_NAME_STRING; - else if ( ::tqqt_cast<TQWidgetStack*>(o) ) + else if ( ::tqt_cast<QDesignerTabWidget*>(o) ) + return "TQTabWidget"; + else if ( ::tqt_cast<QDesignerWidgetStack*>(o) ) + return "TQWidgetStack"; + else if ( ::tqt_cast<TQWidgetStack*>(o) ) return "TQWeDoNotWantToBreakTabWidget"; - else if ( ::tqqt_cast<QDesignerDialog*>(o) ) - return TQDIALOG_OBJECT_NAME_STRING; - else if ( ::tqqt_cast<QDesignerWidget*>(o) ) - return TQWIDGET_OBJECT_NAME_STRING; + else if ( ::tqt_cast<QDesignerDialog*>(o) ) + return "TQDialog"; + else if ( ::tqt_cast<QDesignerWidget*>(o) ) + return "TQWidget"; else if ( o->inherits( "CustomWidget" ) ) return ( (CustomWidget*)o )->realClassName().latin1(); - else if ( ::tqqt_cast<QDesignerLabel*>(o) ) - return TQLABEL_OBJECT_NAME_STRING; - else if ( ::tqqt_cast<QDesignerWizard*>(o) ) - return TQWIZARD_OBJECT_NAME_STRING; - else if ( ::tqqt_cast<QDesignerPushButton*>(o) ) - return TQPUSHBUTTON_OBJECT_NAME_STRING; - else if ( ::tqqt_cast<QDesignerToolButton*>(o) ) - return TQTOOLBUTTON_OBJECT_NAME_STRING; - else if ( ::tqqt_cast<QDesignerRadioButton*>(o) ) - return TQRADIOBUTTON_OBJECT_NAME_STRING; - else if ( ::tqqt_cast<QDesignerCheckBox*>(o) ) - return TQCHECKBOX_OBJECT_NAME_STRING; - else if ( ::tqqt_cast<MenuBarEditor*>(o) ) - return TQMENUBAR_OBJECT_NAME_STRING; - else if ( ::tqqt_cast<QDesignerToolBar*>(o) ) - return TQTOOLBAR_OBJECT_NAME_STRING; - else if ( ::tqqt_cast<QDesignerAction*>(o) ) - return TQACTION_OBJECT_NAME_STRING; - else if ( ::tqqt_cast<QDesignerActionGroup*>(o) ) - return TQACTIONGROUP_OBJECT_NAME_STRING; - else if ( ::tqqt_cast<PopupMenuEditor*>(o) ) - return TQPOPUPMENU_OBJECT_NAME_STRING; - else if ( ::tqqt_cast<QDesignerToolBox*>(o) ) - return TQTOOLBOX_OBJECT_NAME_STRING; + else if ( ::tqt_cast<QDesignerLabel*>(o) ) + return "TQLabel"; + else if ( ::tqt_cast<QDesignerWizard*>(o) ) + return "TQWizard"; + else if ( ::tqt_cast<QDesignerPushButton*>(o) ) + return "TQPushButton"; + else if ( ::tqt_cast<QDesignerToolButton*>(o) ) + return "TQToolButton"; + else if ( ::tqt_cast<QDesignerRadioButton*>(o) ) + return "TQRadioButton"; + else if ( ::tqt_cast<QDesignerCheckBox*>(o) ) + return "TQCheckBox"; + else if ( ::tqt_cast<MenuBarEditor*>(o) ) + return "TQMenuBar"; + else if ( ::tqt_cast<QDesignerToolBar*>(o) ) + return "TQToolBar"; + else if ( ::tqt_cast<QDesignerAction*>(o) ) + return "TQAction"; + else if ( ::tqt_cast<QDesignerActionGroup*>(o) ) + return "TQActionGroup"; + else if ( ::tqt_cast<PopupMenuEditor*>(o) ) + return "TQPopupMenu"; + else if ( ::tqt_cast<QDesignerToolBox*>(o) ) + return "TQToolBox"; #ifndef TQT_NO_SQL - else if ( ::tqqt_cast<QDesignerDataBrowser*>(o) ) - return TQDATABROWSER_OBJECT_NAME_STRING; - else if ( ::tqqt_cast<QDesignerDataView*>(o) ) - return TQDATAVIEW_OBJECT_NAME_STRING; + else if ( ::tqt_cast<QDesignerDataBrowser*>(o) ) + return "TQDataBrowser"; + else if ( ::tqt_cast<QDesignerDataView*>(o) ) + return "TQDataView"; #endif return o->className(); } TQString WidgetFactory::defaultSignal( TQObject *w ) { - if ( ::tqqt_cast<TQRadioButton*>(w) || ::tqqt_cast<TQCheckBox*>(w) ) + if ( ::tqt_cast<TQRadioButton*>(w) || ::tqt_cast<TQCheckBox*>(w) ) return "toggled"; - else if ( ::tqqt_cast<TQButton*>(w) || ::tqqt_cast<TQButtonGroup*>(w) ) + else if ( ::tqt_cast<TQButton*>(w) || ::tqt_cast<TQButtonGroup*>(w) ) return "clicked"; - else if ( ::tqqt_cast<TQTextBrowser*>(w) ) + else if ( ::tqt_cast<TQTextBrowser*>(w) ) return "linkClicked"; - else if ( ::tqqt_cast<TQLineEdit*>(w) || ::tqqt_cast<TQTextEdit*>(w) ) + else if ( ::tqt_cast<TQLineEdit*>(w) || ::tqt_cast<TQTextEdit*>(w) ) return "textChanged"; - else if ( ::tqqt_cast<TQListView*>(w) || ::tqqt_cast<TQIconView*>(w) || - ::tqqt_cast<TQListBox*>(w) || ::tqqt_cast<TQTable*>(w) ) + else if ( ::tqt_cast<TQListView*>(w) || ::tqt_cast<TQIconView*>(w) || + ::tqt_cast<TQListBox*>(w) || ::tqt_cast<TQTable*>(w) ) return "selectionChanged"; - else if ( ::tqqt_cast<TQTabWidget*>(w) ) + else if ( ::tqt_cast<TQTabWidget*>(w) ) return "selected"; - else if ( ::tqqt_cast<TQToolBox*>(w) ) + else if ( ::tqt_cast<TQToolBox*>(w) ) return "currentChanged"; - else if ( ::tqqt_cast<TQWidgetStack*>(w) ) + else if ( ::tqt_cast<TQWidgetStack*>(w) ) return "aboutToShow"; - else if ( ::tqqt_cast<TQSpinBox*>(w) || ::tqqt_cast<TQSlider*>(w) || - ::tqqt_cast<TQScrollBar*>(w) || ::tqqt_cast<TQDateEdit*>(w) || - ::tqqt_cast<TQTimeEdit*>(w) || ::tqqt_cast<TQDateTimeEdit*>(w) || - ::tqqt_cast<TQDial*>(w) ) + else if ( ::tqt_cast<TQSpinBox*>(w) || ::tqt_cast<TQSlider*>(w) || + ::tqt_cast<TQScrollBar*>(w) || ::tqt_cast<TQDateEdit*>(w) || + ::tqt_cast<TQTimeEdit*>(w) || ::tqt_cast<TQDateTimeEdit*>(w) || + ::tqt_cast<TQDial*>(w) ) return "valueChanged"; - else if ( ::tqqt_cast<TQComboBox*>(w) ) + else if ( ::tqt_cast<TQComboBox*>(w) ) return "activated"; return TQString(); } @@ -1307,14 +1299,14 @@ void WidgetFactory::initChangedProperties( TQObject *o ) MainWindow::self->currProject()->fakeFormFileFor( o ) ) return; MetaDataBase::setPropertyChanged( o, "name", TRUE ); - if ( !::tqqt_cast<QDesignerToolBar*>(o) && !::tqqt_cast<MenuBarEditor*>(o) ) + if ( !::tqt_cast<QDesignerToolBar*>(o) && !::tqt_cast<MenuBarEditor*>(o) ) MetaDataBase::setPropertyChanged( o, "geometry", TRUE ); - if ( ::tqqt_cast<TQPushButton*>(o) || - ::tqqt_cast<TQRadioButton*>(o) || - ::tqqt_cast<TQCheckBox*>(o) || - ::tqqt_cast<TQToolButton*>(o) ) { - if (::tqqt_cast<TQToolButton*>(o) && ::tqqt_cast<TQToolBox*>(widgetOfContainer((TQWidget*)o->parent()))) { + if ( ::tqt_cast<TQPushButton*>(o) || + ::tqt_cast<TQRadioButton*>(o) || + ::tqt_cast<TQCheckBox*>(o) || + ::tqt_cast<TQToolButton*>(o) ) { + 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 ); @@ -1323,19 +1315,19 @@ void WidgetFactory::initChangedProperties( TQObject *o ) MetaDataBase::setPropertyChanged( o, "text", TRUE ); } } - else if ( ::tqqt_cast<TQGroupBox*>(o) ) + else if ( ::tqt_cast<TQGroupBox*>(o) ) 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 ( ::tqqt_cast<TQTabWidget*>(o) || ::tqqt_cast<TQWizard*>(o) ) { + } else if ( ::tqt_cast<TQTabWidget*>(o) || ::tqt_cast<TQWizard*>(o) ) { MetaDataBase::setPropertyChanged( o, "pageTitle", TRUE ); MetaDataBase::setPropertyChanged( o, "pageName", TRUE ); MetaDataBase::setPropertyChanged( o, "currentPage", TRUE ); - } else if ( ::tqqt_cast<TQWidgetStack*>(o) ) { + } else if ( ::tqt_cast<TQWidgetStack*>(o) ) { MetaDataBase::setPropertyChanged( o, "currentPage", TRUE ); MetaDataBase::setPropertyChanged( o, "pageName", TRUE ); - } 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 ); @@ -1343,9 +1335,9 @@ void WidgetFactory::initChangedProperties( TQObject *o ) MetaDataBase::setPropertyChanged( o, "itemToolTip", TRUE ); MetaDataBase::setPropertyChanged( o, "itemBackgroundMode", TRUE ); #ifndef TQT_NO_TABLE - } else if ( ::tqqt_cast<TQTable*>(o) ) { + } else if ( ::tqt_cast<TQTable*>(o) ) { # ifndef TQT_NO_SQL - if (!::tqqt_cast<TQDataTable*>(o) ) + if (!::tqt_cast<TQDataTable*>(o) ) # endif { MetaDataBase::setPropertyChanged( o, "numRows", TRUE ); @@ -1357,11 +1349,11 @@ void WidgetFactory::initChangedProperties( TQObject *o ) } } #endif - } else if ( ::tqqt_cast<TQSplitter*>(o) ) { + } else if ( ::tqt_cast<TQSplitter*>(o) ) { MetaDataBase::setPropertyChanged( o, "orientation", TRUE ); - } else if ( ::tqqt_cast<QDesignerToolBar*>(o) ) { + } else if ( ::tqt_cast<QDesignerToolBar*>(o) ) { MetaDataBase::setPropertyChanged( o, "label", TRUE ); - } else if ( ::tqqt_cast<MenuBarEditor*>(o) ) { + } else if ( ::tqt_cast<MenuBarEditor*>(o) ) { MetaDataBase::setPropertyChanged( o, "itemName", TRUE ); MetaDataBase::setPropertyChanged( o, "itemNumber", TRUE ); MetaDataBase::setPropertyChanged( o, "itemText", TRUE ); @@ -1380,9 +1372,9 @@ bool WidgetFactory::hasSpecialEditor( int id, TQObject *editorWidget ) return TRUE; if ( className.contains( "IconView" ) ) return TRUE; - if ( className == TQTEXTEDIT_OBJECT_NAME_STRING || className == TQMULTILINEEDIT_OBJECT_NAME_STRING ) + if ( className == "TQTextEdit" || className == "TQMultiLineEdit" ) return TRUE; - if ( ::tqqt_cast<TQTable*>(editorWidget) != 0 ) + if ( ::tqt_cast<TQTable*>(editorWidget) != 0 ) return TRUE; return FALSE; @@ -1394,7 +1386,7 @@ bool WidgetFactory::hasItems( int id, TQObject *editorWidget ) if ( className.contains( "ListBox" ) || className.contains( "ListView" ) || className.contains( "IconView" ) || className.contains( "ComboBox" ) || - ::tqqt_cast<TQTable*>(editorWidget) != 0 ) + ::tqt_cast<TQTable*>(editorWidget) != 0 ) return TRUE; return FALSE; @@ -1405,7 +1397,7 @@ void WidgetFactory::editWidget( int id, TQWidget *parent, TQWidget *editWidget, TQString className = WidgetDatabase::className( id ); if ( className.contains( "ListBox" ) ) { - if ( !::tqqt_cast<TQListBox*>(editWidget) ) + if ( !::tqt_cast<TQListBox*>(editWidget) ) return; ListBoxEditor *e = new ListBoxEditor( parent, editWidget, fw ); e->exec(); @@ -1414,7 +1406,7 @@ void WidgetFactory::editWidget( int id, TQWidget *parent, TQWidget *editWidget, } if ( className.contains( "ComboBox" ) ) { - if ( !::tqqt_cast<TQComboBox*>(editWidget) ) + if ( !::tqt_cast<TQComboBox*>(editWidget) ) return; TQComboBox *cb = (TQComboBox*)editWidget; ListBoxEditor *e = new ListBoxEditor( parent, cb->listBox(), fw ); @@ -1425,7 +1417,7 @@ void WidgetFactory::editWidget( int id, TQWidget *parent, TQWidget *editWidget, } if ( className.contains( "ListView" ) ) { - if ( !::tqqt_cast<TQListView*>(editWidget) ) + if ( !::tqt_cast<TQListView*>(editWidget) ) return; TQListView *lv = (TQListView*)editWidget; ListViewEditor *e = new ListViewEditor( parent, lv, fw ); @@ -1435,7 +1427,7 @@ void WidgetFactory::editWidget( int id, TQWidget *parent, TQWidget *editWidget, } if ( className.contains( "IconView" ) ) { - if ( !::tqqt_cast<TQIconView*>(editWidget) ) + if ( !::tqt_cast<TQIconView*>(editWidget) ) return; IconViewEditor *e = new IconViewEditor( parent, editWidget, fw ); e->exec(); @@ -1443,14 +1435,14 @@ 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( FALSE, TRUE, parent, editWidget, fw ); e->exec(); delete e; return; } #ifndef TQT_NO_TABLE - if (::tqqt_cast<TQTable*>(editWidget) != 0) { + if (::tqt_cast<TQTable*>(editWidget) != 0) { TableEditor *e = new TableEditor( parent, editWidget, fw ); e->exec(); delete e; @@ -1549,7 +1541,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; @@ -1633,15 +1625,15 @@ void TQLayoutWidget::updateSizePolicy() if ( parent() && parent()->isWidgetType() ) { parentLayout = ((TQWidget *)parent())->layout(); if ( parentLayout && - ::tqqt_cast<TQLayoutWidget*>(parentLayout->mainWidget()) ) + ::tqt_cast<TQLayoutWidget*>(parentLayout->mainWidget()) ) parentLayout = 0; } TQObjectListIt it( childrenListObject() ); TQObject *o; - if ( ::tqqt_cast<TQVBoxLayout*>(layout()) ) { - if ( ::tqqt_cast<TQHBoxLayout*>(parentLayout) ) + if ( ::tqt_cast<TQVBoxLayout*>(layout()) ) { + if ( ::tqt_cast<TQHBoxLayout*>(parentLayout) ) vt = TQSizePolicy::Minimum; else vt = TQSizePolicy::Fixed; @@ -1661,8 +1653,8 @@ void TQLayoutWidget::updateSizePolicy() if ( w->sizePolicy().mayShrinkVertically() ) vt |= TQSizePolicy::Maximum; } - } else if ( ::tqqt_cast<TQHBoxLayout*>(layout()) ) { - if ( ::tqqt_cast<TQVBoxLayout*>(parentLayout) ) + } else if ( ::tqt_cast<TQHBoxLayout*>(layout()) ) { + if ( ::tqt_cast<TQVBoxLayout*>(parentLayout) ) ht = TQSizePolicy::Minimum; else ht = TQSizePolicy::Fixed; @@ -1682,13 +1674,13 @@ void TQLayoutWidget::updateSizePolicy() if ( !w->sizePolicy().mayShrinkVertically() ) vt &= ~TQSizePolicy::Maximum; } - } else if ( ::tqqt_cast<TQGridLayout*>(layout()) ) { + } else if ( ::tqt_cast<TQGridLayout*>(layout()) ) { ht = TQSizePolicy::Fixed; vt = TQSizePolicy::Fixed; if ( parentLayout ) { - if ( ::tqqt_cast<TQVBoxLayout*>(parentLayout) ) + if ( ::tqt_cast<TQVBoxLayout*>(parentLayout) ) ht = TQSizePolicy::Minimum; - else if ( ::tqqt_cast<TQHBoxLayout*>(parentLayout) ) + else if ( ::tqt_cast<TQHBoxLayout*>(parentLayout) ) vt = TQSizePolicy::Minimum; } @@ -1708,17 +1700,9 @@ void TQLayoutWidget::updateSizePolicy() vt |= TQSizePolicy::Maximum; } } -#ifdef USE_QT4 - if ( layout()->expanding() & TQSizePolicy::Horizontally ) -#else // USE_QT4 if ( layout()->expanding() & TQSizePolicy::Horizontally ) -#endif // USE_QT4 ht = TQSizePolicy::Expanding; -#ifdef USE_QT4 - if ( layout()->expanding() & TQSizePolicy::Vertically ) -#else // USE_QT4 if ( layout()->expanding() & TQSizePolicy::Vertically ) -#endif // USE_QT4 vt = TQSizePolicy::Expanding; layout()->invalidate(); @@ -1730,7 +1714,7 @@ void TQLayoutWidget::updateSizePolicy() void CustomWidget::paintEvent( TQPaintEvent *e ) { - if ( ::tqqt_cast<FormWindow*>(parentWidget()) ) { + if ( ::tqt_cast<FormWindow*>(parentWidget()) ) { ( (FormWindow*)parentWidget() )->paintGrid( this, e ); } else { TQPainter p( this ); |