@ -686,7 +686,7 @@ void WidgetFactory::deleteLayout( TQWidget *widget )
TQWidget * WidgetFactory : : createWidget ( const TQString & className , TQWidget * parent , const char * name , bool init ,
TQWidget * WidgetFactory : : createWidget ( const TQString & className , TQWidget * parent , const char * name , bool init ,
const TQRect * r , Qt : : Orientation orient )
const TQRect * r , Qt : : Orientation orient )
{
{
if ( className = = " TQPushButton " ) {
if ( className = = TQPUSHBUTTON_OBJECT_NAME_STRING ) {
TQPushButton * b = 0 ;
TQPushButton * b = 0 ;
if ( init ) {
if ( init ) {
b = new QDesignerPushButton ( parent , name ) ;
b = new QDesignerPushButton ( parent , name ) ;
@ -697,7 +697,7 @@ TQWidget *WidgetFactory::createWidget( const TQString &className, TQWidget *pare
TQWidget * w = find_formwindow ( b ) ;
TQWidget * w = find_formwindow ( b ) ;
b - > setAutoDefault ( w & & : : qt_cast < TQDialog * > ( ( ( FormWindow * ) w ) - > mainContainer ( ) ) ) ;
b - > setAutoDefault ( w & & : : qt_cast < TQDialog * > ( ( ( FormWindow * ) w ) - > mainContainer ( ) ) ) ;
return b ;
return b ;
} else if ( className = = " TQToolButton " ) {
} else if ( className = = TQTOOLBUTTON_OBJECT_NAME_STRING ) {
if ( init ) {
if ( init ) {
QDesignerToolButton * tb = new QDesignerToolButton ( parent , name ) ;
QDesignerToolButton * tb = new QDesignerToolButton ( parent , name ) ;
if ( : : qt_cast < TQToolBox * > ( widgetOfContainer ( parent ) ) ) {
if ( : : qt_cast < TQToolBox * > ( widgetOfContainer ( parent ) ) ) {
@ -711,29 +711,29 @@ TQWidget *WidgetFactory::createWidget( const TQString &className, TQWidget *pare
return tb ;
return tb ;
}
}
return new QDesignerToolButton ( parent , name ) ;
return new QDesignerToolButton ( parent , name ) ;
} else if ( className = = " TQCheckBox " ) {
} else if ( className = = TQCHECKBOX_OBJECT_NAME_STRING ) {
if ( init ) {
if ( init ) {
QDesignerCheckBox * cb = new QDesignerCheckBox ( parent , name ) ;
QDesignerCheckBox * cb = new QDesignerCheckBox ( parent , name ) ;
cb - > setText ( TQString : : fromLatin1 ( name ) ) ;
cb - > setText ( TQString : : fromLatin1 ( name ) ) ;
return cb ;
return cb ;
}
}
return new QDesignerCheckBox ( parent , name ) ;
return new QDesignerCheckBox ( parent , name ) ;
} else if ( className = = " TQRadioButton " ) {
} else if ( className = = TQRADIOBUTTON_OBJECT_NAME_STRING ) {
if ( init ) {
if ( init ) {
QDesignerRadioButton * rb = new QDesignerRadioButton ( parent , name ) ;
QDesignerRadioButton * rb = new QDesignerRadioButton ( parent , name ) ;
rb - > setText ( TQString : : fromLatin1 ( name ) ) ;
rb - > setText ( TQString : : fromLatin1 ( name ) ) ;
return rb ;
return rb ;
}
}
return new QDesignerRadioButton ( parent , name ) ;
return new QDesignerRadioButton ( parent , name ) ;
} else if ( className = = " TQGroupBox " ) {
} else if ( className = = TQGROUPBOX_OBJECT_NAME_STRING ) {
if ( init )
if ( init )
return new TQGroupBox ( TQString : : fromLatin1 ( name ) , parent , name ) ;
return new TQGroupBox ( TQString : : fromLatin1 ( name ) , parent , name ) ;
return new TQGroupBox ( parent , name ) ;
return new TQGroupBox ( parent , name ) ;
} else if ( className = = " TQButtonGroup " ) {
} else if ( className = = TQBUTTONGROUP_OBJECT_NAME_STRING ) {
if ( init )
if ( init )
return new TQButtonGroup ( TQString : : fromLatin1 ( name ) , parent , name ) ;
return new TQButtonGroup ( TQString : : fromLatin1 ( name ) , parent , name ) ;
return new TQButtonGroup ( parent , name ) ;
return new TQButtonGroup ( parent , name ) ;
} else if ( className = = " TQIconView " ) {
} else if ( className = = TQICONVIEW_OBJECT_NAME_STRING ) {
# if !defined(QT_NO_ICONVIEW)
# if !defined(QT_NO_ICONVIEW)
TQIconView * iv = new TQIconView ( parent , name ) ;
TQIconView * iv = new TQIconView ( parent , name ) ;
if ( init )
if ( init )
@ -742,7 +742,7 @@ TQWidget *WidgetFactory::createWidget( const TQString &className, TQWidget *pare
# else
# else
return 0 ;
return 0 ;
# endif
# endif
} else if ( className = = " TQTable " ) {
} else if ( className = = TQTABLE_OBJECT_NAME_STRING ) {
# if !defined(QT_NO_TABLE)
# if !defined(QT_NO_TABLE)
if ( init )
if ( init )
return new TQTable ( 3 , 3 , parent , name ) ;
return new TQTable ( 3 , 3 , parent , name ) ;
@ -751,24 +751,24 @@ TQWidget *WidgetFactory::createWidget( const TQString &className, TQWidget *pare
return 0 ;
return 0 ;
# endif
# endif
# ifndef QT_NO_SQL
# ifndef QT_NO_SQL
} else if ( className = = " TQDataTable " ) {
} else if ( className = = TQDATATABLE_OBJECT_NAME_STRING ) {
return new TQDataTable ( parent , name ) ;
return new TQDataTable ( parent , name ) ;
# endif //QT_NO_SQL
# endif //QT_NO_SQL
} else if ( className = = " QDateEdit " ) {
} else if ( className = = TQDATEEDIT_OBJECT_NAME_STRING ) {
return new QDateEdit ( parent , name ) ;
return new QDateEdit ( parent , name ) ;
} else if ( className = = " QTimeEdit " ) {
} else if ( className = = TQTIMEEDIT_OBJECT_NAME_STRING ) {
return new QTimeEdit ( parent , name ) ;
return new QTimeEdit ( parent , name ) ;
} else if ( className = = " QDateTimeEdit " ) {
} else if ( className = = TQDATETIMEEDIT_OBJECT_NAME_STRING ) {
return new QDateTimeEdit ( parent , name ) ;
return new QDateTimeEdit ( parent , name ) ;
}
}
else if ( className = = " TQListBox " ) {
else if ( className = = TQLISTBOX_OBJECT_NAME_STRING ) {
TQListBox * lb = new TQListBox ( parent , name ) ;
TQListBox * lb = new TQListBox ( parent , name ) ;
if ( init ) {
if ( init ) {
lb - > insertItem ( i18n ( " New Item " ) ) ;
lb - > insertItem ( i18n ( " New Item " ) ) ;
lb - > setCurrentItem ( 0 ) ;
lb - > setCurrentItem ( 0 ) ;
}
}
return lb ;
return lb ;
} else if ( className = = " TQListView " ) {
} else if ( className = = TQLISTVIEW_OBJECT_NAME_STRING ) {
TQListView * lv = new TQListView ( parent , name ) ;
TQListView * lv = new TQListView ( parent , name ) ;
lv - > setSorting ( - 1 ) ;
lv - > setSorting ( - 1 ) ;
if ( init ) {
if ( init ) {
@ -776,17 +776,17 @@ TQWidget *WidgetFactory::createWidget( const TQString &className, TQWidget *pare
lv - > setCurrentItem ( new TQListViewItem ( lv , i18n ( " New Item " ) ) ) ;
lv - > setCurrentItem ( new TQListViewItem ( lv , i18n ( " New Item " ) ) ) ;
}
}
return lv ;
return lv ;
} else if ( className = = " TQLineEdit " )
} else if ( className = = TQLINEEDIT_OBJECT_NAME_STRING )
return new TQLineEdit ( parent , name ) ;
return new TQLineEdit ( parent , name ) ;
else if ( className = = " TQSpinBox " )
else if ( className = = TQSPINBOX_OBJECT_NAME_STRING )
return new TQSpinBox ( parent , name ) ;
return new TQSpinBox ( parent , name ) ;
else if ( className = = " TQSplitter " )
else if ( className = = TQSPLITTER_OBJECT_NAME_STRING )
return new TQSplitter ( parent , name ) ;
return new TQSplitter ( parent , name ) ;
else if ( className = = " TQMultiLineEdit " )
else if ( className = = TQMULTILINEEDIT_OBJECT_NAME_STRING )
return new TQMultiLineEdit ( parent , name ) ;
return new TQMultiLineEdit ( parent , name ) ;
else if ( className = = " TQTextEdit " )
else if ( className = = TQTEXTEDIT_OBJECT_NAME_STRING )
return new TQTextEdit ( parent , name ) ;
return new TQTextEdit ( parent , name ) ;
else if ( className = = " TQLabel " | | className = = " TextLabel " ) {
else if ( className = = TQLABEL_OBJECT_NAME_STRING | | className = = " TextLabel " ) {
QDesignerLabel * l = new QDesignerLabel ( parent , name ) ;
QDesignerLabel * l = new QDesignerLabel ( parent , name ) ;
if ( init ) {
if ( init ) {
l - > setText ( TQString : : fromLatin1 ( name ) ) ;
l - > setText ( TQString : : fromLatin1 ( name ) ) ;
@ -804,9 +804,9 @@ TQWidget *WidgetFactory::createWidget( const TQString &className, TQWidget *pare
MetaDataBase : : setPropertyChanged ( l , " scaledContents " , TRUE ) ;
MetaDataBase : : setPropertyChanged ( l , " scaledContents " , TRUE ) ;
}
}
return l ;
return l ;
} else if ( className = = " QLayoutWidget " )
} else if ( className = = TQLAYOUTWIDGET_OBJECT_NAME_STRING )
return new QLayoutWidget ( parent , name ) ;
return new QLayoutWidget ( parent , name ) ;
else if ( className = = " TQTabWidget " ) {
else if ( className = = TQTABWIDGET_OBJECT_NAME_STRING ) {
TQTabWidget * tw = new QDesignerTabWidget ( parent , name ) ;
TQTabWidget * tw = new QDesignerTabWidget ( parent , name ) ;
if ( init ) {
if ( init ) {
FormWindow * fw = find_formwindow ( parent ) ;
FormWindow * fw = find_formwindow ( parent ) ;
@ -819,7 +819,7 @@ TQWidget *WidgetFactory::createWidget( const TQString &className, TQWidget *pare
MetaDataBase : : addEntry ( w ) ;
MetaDataBase : : addEntry ( w ) ;
}
}
return tw ;
return tw ;
} else if ( className = = " TQWidgetStack " ) {
} else if ( className = = TQWIDGETSTACK_OBJECT_NAME_STRING ) {
QDesignerWidgetStack * ws = new QDesignerWidgetStack ( parent , name ) ;
QDesignerWidgetStack * ws = new QDesignerWidgetStack ( parent , name ) ;
if ( init ) {
if ( init ) {
FormWindow * fw = find_formwindow ( parent ) ;
FormWindow * fw = find_formwindow ( parent ) ;
@ -829,9 +829,9 @@ TQWidget *WidgetFactory::createWidget( const TQString &className, TQWidget *pare
MetaDataBase : : addEntry ( ws ) ;
MetaDataBase : : addEntry ( ws ) ;
}
}
return ws ;
return ws ;
} else if ( className = = " TQComboBox " ) {
} else if ( className = = TQCOMBOBOX_OBJECT_NAME_STRING ) {
return new TQComboBox ( FALSE , parent , name ) ;
return new TQComboBox ( FALSE , parent , name ) ;
} else if ( className = = " TQWidget " ) {
} else if ( className = = TQWIDGET_OBJECT_NAME_STRING ) {
if ( parent & &
if ( parent & &
( : : qt_cast < FormWindow * > ( parent ) | |
( : : qt_cast < FormWindow * > ( parent ) | |
: : qt_cast < TQWizard * > ( parent ) | |
: : qt_cast < TQWizard * > ( parent ) | |
@ -847,7 +847,7 @@ TQWidget *WidgetFactory::createWidget( const TQString &className, TQWidget *pare
}
}
}
}
return new TQWidget ( parent , name ) ;
return new TQWidget ( parent , name ) ;
} else if ( className = = " TQDialog " ) {
} else if ( className = = TQDIALOG_OBJECT_NAME_STRING ) {
TQDialog * dia = 0 ;
TQDialog * dia = 0 ;
if ( : : qt_cast < FormWindow * > ( parent ) )
if ( : : qt_cast < FormWindow * > ( parent ) )
dia = new QDesignerDialog ( ( FormWindow * ) parent , parent , name ) ;
dia = new QDesignerDialog ( ( FormWindow * ) parent , parent , name ) ;
@ -860,7 +860,7 @@ TQWidget *WidgetFactory::createWidget( const TQString &className, TQWidget *pare
# endif
# endif
dia - > reparent ( parent , TQPoint ( 0 , 0 ) , TRUE ) ;
dia - > reparent ( parent , TQPoint ( 0 , 0 ) , TRUE ) ;
return dia ;
return dia ;
} else if ( className = = " TQWizard " ) {
} else if ( className = = TQWIZARD_OBJECT_NAME_STRING ) {
TQWizard * wiz = new QDesignerWizard ( parent , name ) ;
TQWizard * wiz = new QDesignerWizard ( parent , name ) ;
# if defined(QT_NON_COMMERCIAL)
# if defined(QT_NON_COMMERCIAL)
if ( : : qt_cast < MainWindow * > ( parent ) )
if ( : : qt_cast < MainWindow * > ( parent ) )
@ -889,17 +889,17 @@ TQWidget *WidgetFactory::createWidget( const TQString &className, TQWidget *pare
else
else
s - > setOrientation ( Qt : : Horizontal ) ;
s - > setOrientation ( Qt : : Horizontal ) ;
return s ;
return s ;
} else if ( className = = " TQLCDNumber " )
} else if ( className = = TQLCDNUMBER_OBJECT_NAME_STRING )
return new TQLCDNumber ( parent , name ) ;
return new TQLCDNumber ( parent , name ) ;
else if ( className = = " TQProgressBar " )
else if ( className = = TQPROGRESSBAR_OBJECT_NAME_STRING )
return new TQProgressBar ( parent , name ) ;
return new TQProgressBar ( parent , name ) ;
else if ( className = = " TQTextView " )
else if ( className = = TQTEXTVIEW_OBJECT_NAME_STRING )
return new TQTextView ( parent , name ) ;
return new TQTextView ( parent , name ) ;
else if ( className = = " TQTextBrowser " )
else if ( className = = TQTEXTBROWSER_OBJECT_NAME_STRING )
return new TQTextBrowser ( parent , name ) ;
return new TQTextBrowser ( parent , name ) ;
else if ( className = = " TQDial " )
else if ( className = = TQDIAL_OBJECT_NAME_STRING )
return new TQDial ( parent , name ) ;
return new TQDial ( parent , name ) ;
else if ( className = = " TQSlider " ) {
else if ( className = = TQSLIDER_OBJECT_NAME_STRING ) {
TQSlider * s = new TQSlider ( parent , name ) ;
TQSlider * s = new TQSlider ( parent , name ) ;
if ( ! r )
if ( ! r )
return s ;
return s ;
@ -910,7 +910,7 @@ TQWidget *WidgetFactory::createWidget( const TQString &className, TQWidget *pare
MetaDataBase : : addEntry ( s ) ;
MetaDataBase : : addEntry ( s ) ;
MetaDataBase : : setPropertyChanged ( s , " orientation " , TRUE ) ;
MetaDataBase : : setPropertyChanged ( s , " orientation " , TRUE ) ;
return s ;
return s ;
} else if ( className = = " TQScrollBar " ) {
} else if ( className = = TQSCROLLBAR_OBJECT_NAME_STRING ) {
TQScrollBar * s = new TQScrollBar ( parent , name ) ;
TQScrollBar * s = new TQScrollBar ( parent , name ) ;
if ( ! r )
if ( ! r )
return s ;
return s ;
@ -921,7 +921,7 @@ TQWidget *WidgetFactory::createWidget( const TQString &className, TQWidget *pare
MetaDataBase : : addEntry ( s ) ;
MetaDataBase : : addEntry ( s ) ;
MetaDataBase : : setPropertyChanged ( s , " orientation " , TRUE ) ;
MetaDataBase : : setPropertyChanged ( s , " orientation " , TRUE ) ;
return s ;
return s ;
} else if ( className = = " TQFrame " ) {
} else if ( className = = TQFRAME_OBJECT_NAME_STRING ) {
if ( ! init )
if ( ! init )
return new TQFrame ( parent , name ) ;
return new TQFrame ( parent , name ) ;
TQFrame * f = new TQFrame ( parent , name ) ;
TQFrame * f = new TQFrame ( parent , name ) ;
@ -940,7 +940,7 @@ TQWidget *WidgetFactory::createWidget( const TQString &className, TQWidget *pare
else if ( r - > width ( ) < r - > height ( ) )
else if ( r - > width ( ) < r - > height ( ) )
l - > setOrientation ( Qt : : Vertical ) ;
l - > setOrientation ( Qt : : Vertical ) ;
return l ;
return l ;
} else if ( className = = " TQMainWindow " ) {
} else if ( className = = TQMAINWINDOW_OBJECT_NAME_STRING ) {
TQMainWindow * mw = new TQMainWindow ( parent , name , 0 ) ;
TQMainWindow * mw = new TQMainWindow ( parent , name , 0 ) ;
mw - > setDockEnabled ( Qt : : DockMinimized , FALSE ) ;
mw - > setDockEnabled ( Qt : : DockMinimized , FALSE ) ;
QDesignerWidget * dw = new QDesignerWidget ( ( FormWindow * ) parent , mw , " central widget " ) ;
QDesignerWidget * dw = new QDesignerWidget ( ( FormWindow * ) parent , mw , " central widget " ) ;
@ -950,7 +950,7 @@ TQWidget *WidgetFactory::createWidget( const TQString &className, TQWidget *pare
( void ) mw - > statusBar ( ) ;
( void ) mw - > statusBar ( ) ;
dw - > show ( ) ;
dw - > show ( ) ;
return mw ;
return mw ;
} else if ( className = = " TQToolBox " ) {
} else if ( className = = TQTOOLBOX_OBJECT_NAME_STRING ) {
if ( ! init )
if ( ! init )
return new QDesignerToolBox ( parent , name ) ;
return new QDesignerToolBox ( parent , name ) ;
TQToolBox * tb = new QDesignerToolBox ( parent , name ) ;
TQToolBox * tb = new QDesignerToolBox ( parent , name ) ;
@ -966,12 +966,12 @@ TQWidget *WidgetFactory::createWidget( const TQString &className, TQWidget *pare
return tb ;
return tb ;
}
}
# ifndef QT_NO_SQL
# ifndef QT_NO_SQL
else if ( className = = " TQDataBrowser " ) {
else if ( className = = TQDATABROWSER_OBJECT_NAME_STRING ) {
TQWidget * w = new QDesignerDataBrowser ( parent , name ) ;
TQWidget * w = new QDesignerDataBrowser ( parent , name ) ;
if ( parent )
if ( parent )
w - > reparent ( parent , TQPoint ( 0 , 0 ) , TRUE ) ;
w - > reparent ( parent , TQPoint ( 0 , 0 ) , TRUE ) ;
return w ;
return w ;
} else if ( className = = " TQDataView " ) {
} else if ( className = = TQDATAVIEW_OBJECT_NAME_STRING ) {
TQWidget * w = new QDesignerDataView ( parent , name ) ;
TQWidget * w = new QDesignerDataView ( parent , name ) ;
if ( parent )
if ( parent )
w - > reparent ( parent , TQPoint ( 0 , 0 ) , TRUE ) ;
w - > reparent ( parent , TQPoint ( 0 , 0 ) , TRUE ) ;
@ -1029,7 +1029,7 @@ WidgetFactory::LayoutType WidgetFactory::layoutType( TQWidget *w, TQLayout *&lay
TQLayout * lay = w - > layout ( ) ;
TQLayout * lay = w - > layout ( ) ;
if ( : : qt_cast < TQGroupBox * > ( w ) ) {
if ( : : qt_cast < TQGroupBox * > ( w ) ) {
TQObjectList * l = lay - > queryList ( " TQLayout " ) ;
TQObjectList * l = lay - > queryList ( TQLAYOUT_OBJECT_NAME_STRING ) ;
if ( l & & l - > first ( ) )
if ( l & & l - > first ( ) )
lay = ( TQLayout * ) l - > first ( ) ;
lay = ( TQLayout * ) l - > first ( ) ;
delete l ;
delete l ;
@ -1325,7 +1325,7 @@ void WidgetFactory::initChangedProperties( TQObject *o )
}
}
else if ( : : qt_cast < TQGroupBox * > ( o ) )
else if ( : : qt_cast < TQGroupBox * > ( o ) )
MetaDataBase : : setPropertyChanged ( o , " title " , TRUE ) ;
MetaDataBase : : setPropertyChanged ( o , " title " , TRUE ) ;
else if ( o - > isA ( " TQFrame " ) ) {
else if ( o - > isA ( TQFRAME_OBJECT_NAME_STRING ) ) {
MetaDataBase : : setPropertyChanged ( o , " frameShadow " , TRUE ) ;
MetaDataBase : : setPropertyChanged ( o , " frameShadow " , TRUE ) ;
MetaDataBase : : setPropertyChanged ( o , " frameShape " , TRUE ) ;
MetaDataBase : : setPropertyChanged ( o , " frameShape " , TRUE ) ;
} else if ( : : qt_cast < TQTabWidget * > ( o ) | | : : qt_cast < TQWizard * > ( o ) ) {
} else if ( : : qt_cast < TQTabWidget * > ( o ) | | : : qt_cast < TQWizard * > ( o ) ) {
@ -1380,7 +1380,7 @@ bool WidgetFactory::hasSpecialEditor( int id, TQObject *editorWidget )
return TRUE ;
return TRUE ;
if ( className . contains ( " IconView " ) )
if ( className . contains ( " IconView " ) )
return TRUE ;
return TRUE ;
if ( className = = " TQTextEdit " | | className = = " TQMultiLineEdit " )
if ( className = = TQTEXTEDIT_OBJECT_NAME_STRING | | className = = TQMULTILINEEDIT_OBJECT_NAME_STRING )
return TRUE ;
return TRUE ;
if ( : : qt_cast < TQTable * > ( editorWidget ) ! = 0 )
if ( : : qt_cast < TQTable * > ( editorWidget ) ! = 0 )
return TRUE ;
return TRUE ;
@ -1443,7 +1443,7 @@ void WidgetFactory::editWidget( int id, TQWidget *parent, TQWidget *editWidget,
return ;
return ;
}
}
if ( className = = " TQMultiLineEdit " | | className = = " TQTextEdit " ) {
if ( className = = TQMULTILINEEDIT_OBJECT_NAME_STRING | | className = = TQTEXTEDIT_OBJECT_NAME_STRING ) {
MultiLineEditor * e = new MultiLineEditor ( FALSE , TRUE , parent , editWidget , fw ) ;
MultiLineEditor * e = new MultiLineEditor ( FALSE , TRUE , parent , editWidget , fw ) ;
e - > exec ( ) ;
e - > exec ( ) ;
delete e ;
delete e ;
@ -1549,7 +1549,7 @@ void QDesignerLabel::updateBuddy()
if ( myBuddy . isEmpty ( ) )
if ( myBuddy . isEmpty ( ) )
return ;
return ;
TQObjectList * l = topLevelWidget ( ) - > queryList ( " TQWidget " , myBuddy , FALSE , TRUE ) ;
TQObjectList * l = topLevelWidget ( ) - > queryList ( TQWIDGET_OBJECT_NAME_STRING , myBuddy , FALSE , TRUE ) ;
if ( ! l | | ! l - > first ( ) ) {
if ( ! l | | ! l - > first ( ) ) {
delete l ;
delete l ;
return ;
return ;