Runtime object naming repaired in kdewebdev

NOTE: runtime object naming still needs to be checked for stray "Q*" strings


git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdewebdev@1222551 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
v3.5.13-sru
tpearson 14 years ago
parent 9cbbf05386
commit f7670c1989

@ -47,7 +47,7 @@ bool QDesignerAction::addTo( TQWidget *w )
if ( !widgetToInsert ) if ( !widgetToInsert )
return TQAction::addTo( w ); return TQAction::addTo( w );
if ( w->inherits( "TQPopupMenu" ) ) if ( w->inherits( TQPOPUPMENU_OBJECT_NAME_STRING ) )
return false; return false;
widgetToInsert->reparent( w, TQPoint( 0, 0 ), false ); widgetToInsert->reparent( w, TQPoint( 0, 0 ), false );
@ -125,11 +125,11 @@ QSeparatorAction::QSeparatorAction( TQObject *parent )
bool QSeparatorAction::addTo( TQWidget *w ) bool QSeparatorAction::addTo( TQWidget *w )
{ {
if ( w->inherits( "TQToolBar" ) ) { if ( w->inherits( TQTOOLBAR_OBJECT_NAME_STRING ) ) {
TQToolBar *tb = (TQToolBar*)w; TQToolBar *tb = (TQToolBar*)w;
wid = new QDesignerToolBarSeparator( tb->orientation(), tb ); wid = new QDesignerToolBarSeparator( tb->orientation(), tb );
return true; return true;
} else if ( w->inherits( "TQPopupMenu" ) ) { } else if ( w->inherits( TQPOPUPMENU_OBJECT_NAME_STRING ) ) {
idx = ( (TQPopupMenu*)w )->count(); idx = ( (TQPopupMenu*)w )->count();
( (TQPopupMenu*)w )->insertSeparator( idx ); ( (TQPopupMenu*)w )->insertSeparator( idx );
return true; return true;
@ -139,10 +139,10 @@ bool QSeparatorAction::addTo( TQWidget *w )
bool QSeparatorAction::removeFrom( TQWidget *w ) bool QSeparatorAction::removeFrom( TQWidget *w )
{ {
if ( w->inherits( "TQToolBar" ) ) { if ( w->inherits( TQTOOLBAR_OBJECT_NAME_STRING ) ) {
delete wid; delete wid;
return true; return true;
} else if ( w->inherits( "TQPopupMenu" ) ) { } else if ( w->inherits( TQPOPUPMENU_OBJECT_NAME_STRING ) ) {
( (TQPopupMenu*)w )->removeItemAt( idx ); ( (TQPopupMenu*)w )->removeItemAt( idx );
return true; return true;
} }
@ -202,7 +202,7 @@ void QDesignerToolBar::addAction( TQAction *a )
{ {
actionList.append( a ); actionList.append( a );
connect( a, TQT_SIGNAL( destroyed() ), this, TQT_SLOT( actionRemoved() ) ); connect( a, TQT_SIGNAL( destroyed() ), this, TQT_SLOT( actionRemoved() ) );
if ( a->inherits( "TQActionGroup" ) ) { if ( a->inherits( TQACTIONGROUP_OBJECT_NAME_STRING ) ) {
( (QDesignerActionGroup*)a )->widget()->installEventFilter( this ); ( (QDesignerActionGroup*)a )->widget()->installEventFilter( this );
actionMap.insert( ( (QDesignerActionGroup*)a )->widget(), a ); actionMap.insert( ( (QDesignerActionGroup*)a )->widget(), a );
} else if ( a->inherits( "QSeparatorAction" ) ) { } else if ( a->inherits( "QSeparatorAction" ) ) {
@ -450,7 +450,7 @@ void QDesignerToolBar::buttonMouseMoveEvent( TQMouseEvent *e, TQObject *o )
TQApplication::sendPostedEvents(); TQApplication::sendPostedEvents();
adjustSize(); adjustSize();
TQString type = a->inherits( "TQActionGroup" ) ? TQString( "application/x-designer-actiongroup" ) : TQString type = a->inherits( TQACTIONGROUP_OBJECT_NAME_STRING ) ? TQString( "application/x-designer-actiongroup" ) :
a->inherits( "QSeparatorAction" ) ? TQString( "application/x-designer-separator" ) : TQString( "application/x-designer-actions" ); a->inherits( "QSeparatorAction" ) ? TQString( "application/x-designer-separator" ) : TQString( "application/x-designer-actions" );
TQStoredDrag *drag = new TQStoredDrag( type, this ); TQStoredDrag *drag = new TQStoredDrag( type, this );
TQString s = TQString::number( (long)a ); // #### huha, that is evil TQString s = TQString::number( (long)a ); // #### huha, that is evil
@ -560,7 +560,7 @@ void QDesignerToolBar::reInsert()
clear(); clear();
for ( a = actionList.first(); a; a = actionList.next() ) { for ( a = actionList.first(); a; a = actionList.next() ) {
a->addTo( this ); a->addTo( this );
if ( a->inherits( "TQActionGroup" ) ) { if ( a->inherits( TQACTIONGROUP_OBJECT_NAME_STRING ) ) {
actionMap.insert( ( (QDesignerActionGroup*)a )->widget(), a ); actionMap.insert( ( (QDesignerActionGroup*)a )->widget(), a );
if ( ( (QDesignerActionGroup*)a )->widget() ) if ( ( (QDesignerActionGroup*)a )->widget() )
( (QDesignerActionGroup*)a )->widget()->installEventFilter( this ); ( (QDesignerActionGroup*)a )->widget()->installEventFilter( this );
@ -689,7 +689,7 @@ void QDesignerToolBar::installEventFilters( TQWidget *w )
{ {
if ( !w ) if ( !w )
return; return;
TQObjectList *l = w->queryList( "TQWidget" ); TQObjectList *l = w->queryList( TQWIDGET_OBJECT_NAME_STRING );
for ( TQObject *o = l->first(); o; o = l->next() ) for ( TQObject *o = l->first(); o; o = l->next() )
o->installEventFilter( this ); o->installEventFilter( this );
delete l; delete l;
@ -1072,7 +1072,7 @@ void QDesignerPopupMenu::mouseMoveEvent( TQMouseEvent *e )
formWindow->commandHistory()->addCommand( cmd ); formWindow->commandHistory()->addCommand( cmd );
cmd->execute(); cmd->execute();
TQString type = a->inherits( "TQActionGroup" ) ? TQString( "application/x-designer-actiongroup" ) : TQString type = a->inherits( TQACTIONGROUP_OBJECT_NAME_STRING ) ? TQString( "application/x-designer-actiongroup" ) :
a->inherits( "QSeparatorAction" ) ? TQString( "application/x-designer-separator" ) : TQString( "application/x-designer-actions" ); a->inherits( "QSeparatorAction" ) ? TQString( "application/x-designer-separator" ) : TQString( "application/x-designer-actions" );
TQStoredDrag *drag = new TQStoredDrag( type, this ); TQStoredDrag *drag = new TQStoredDrag( type, this );
TQString s = TQString::number( (long)a ); // #### huha, that is evil TQString s = TQString::number( (long)a ); // #### huha, that is evil

@ -40,7 +40,7 @@ class QDesignerActionGroup : public QActionGroup
public: public:
QDesignerActionGroup( TQObject *parent ) QDesignerActionGroup( TQObject *parent )
: TQActionGroup( !parent || parent->inherits( "TQActionGroup" ) ? parent : 0 ), wid( 0 ), idx( -1 ) {} : TQActionGroup( !parent || parent->inherits( TQACTIONGROUP_OBJECT_NAME_STRING ) ? parent : 0 ), wid( 0 ), idx( -1 ) {}
TQWidget *widget() const { return wid; } TQWidget *widget() const { return wid; }
TQWidget *widget( TQAction *a ) const { return *widgets.find( a ); } TQWidget *widget( TQAction *a ) const { return *widgets.find( a ); }
@ -70,9 +70,9 @@ class QDesignerAction : public QAction
public: public:
QDesignerAction( TQObject *parent ) QDesignerAction( TQObject *parent )
: TQAction( !parent || parent->inherits( "TQActionGroup" ) ? parent : 0 ), wid( 0 ), idx( -1 ), widgetToInsert( 0 ) {} : TQAction( !parent || parent->inherits( TQACTIONGROUP_OBJECT_NAME_STRING ) ? parent : 0 ), wid( 0 ), idx( -1 ), widgetToInsert( 0 ) {}
QDesignerAction( TQWidget *w, TQObject *parent ) QDesignerAction( TQWidget *w, TQObject *parent )
: TQAction( !parent || parent->inherits( "TQActionGroup" ) ? parent : 0 ), wid( 0 ), idx( -1 ), widgetToInsert( w ) {} : TQAction( !parent || parent->inherits( TQACTIONGROUP_OBJECT_NAME_STRING ) ? parent : 0 ), wid( 0 ), idx( -1 ), widgetToInsert( w ) {}
TQWidget *widget() const { return wid; } TQWidget *widget() const { return wid; }
int index() const { return idx; } int index() const { return idx; }

@ -118,7 +118,7 @@ void ActionEditor::newAction()
ActionItem *actionParent = (ActionItem*)listActions->selectedItem(); ActionItem *actionParent = (ActionItem*)listActions->selectedItem();
if ( actionParent ) { if ( actionParent ) {
if ( !actionParent->actionGroup() || if ( !actionParent->actionGroup() ||
!actionParent->actionGroup()->inherits( "TQActionGroup" ) ) !actionParent->actionGroup()->inherits( TQACTIONGROUP_OBJECT_NAME_STRING ) )
actionParent = (ActionItem*)actionParent->parent(); actionParent = (ActionItem*)actionParent->parent();
} }
@ -150,7 +150,7 @@ void ActionEditor::newActionGroup()
ActionItem *actionParent = (ActionItem*)listActions->selectedItem(); ActionItem *actionParent = (ActionItem*)listActions->selectedItem();
if ( actionParent ) { if ( actionParent ) {
if ( !actionParent->actionGroup() || if ( !actionParent->actionGroup() ||
!actionParent->actionGroup()->inherits( "TQActionGroup" ) ) !actionParent->actionGroup()->inherits( TQACTIONGROUP_OBJECT_NAME_STRING ) )
actionParent = (ActionItem*)actionParent->parent(); actionParent = (ActionItem*)actionParent->parent();
} }
@ -187,18 +187,18 @@ void ActionEditor::setFormWindow( FormWindow *fw )
formWindow = fw; formWindow = fw;
if ( !formWindow || if ( !formWindow ||
!formWindow->mainContainer() || !formWindow->mainContainer() ||
!formWindow->mainContainer()->inherits( "TQMainWindow" ) ) { !formWindow->mainContainer()->inherits( TQMAINWINDOW_OBJECT_NAME_STRING ) ) {
setEnabled( false ); setEnabled( false );
} else { } else {
setEnabled( true ); setEnabled( true );
for ( TQAction *a = formWindow->actionList().first(); a; a = formWindow->actionList().next() ) { for ( TQAction *a = formWindow->actionList().first(); a; a = formWindow->actionList().next() ) {
ActionItem *i = 0; ActionItem *i = 0;
if ( a->parent() && a->parent()->inherits( "TQAction" ) ) if ( a->parent() && a->parent()->inherits( TQACTION_OBJECT_NAME_STRING ) )
continue; continue;
i = new ActionItem( listActions, a ); i = new ActionItem( listActions, a );
i->setText( 0, a->name() ); i->setText( 0, a->name() );
i->setPixmap( 0, a->iconSet().pixmap() ); i->setPixmap( 0, a->iconSet().pixmap() );
if ( a->inherits( "TQActionGroup" ) ) { if ( a->inherits( TQACTIONGROUP_OBJECT_NAME_STRING ) ) {
insertChildActions( i ); insertChildActions( i );
} }
} }
@ -217,14 +217,14 @@ void ActionEditor::insertChildActions( ActionItem *i )
while ( it.current() ) { while ( it.current() ) {
TQObject *o = it.current(); TQObject *o = it.current();
++it; ++it;
if ( !o->inherits( "TQAction" ) ) if ( !o->inherits( TQACTION_OBJECT_NAME_STRING ) )
continue; continue;
TQAction *a = (TQAction*)o; TQAction *a = (TQAction*)o;
ActionItem *i2 = new ActionItem( (TQListViewItem*)i, a ); ActionItem *i2 = new ActionItem( (TQListViewItem*)i, a );
i->setOpen( true ); i->setOpen( true );
i2->setText( 0, a->name() ); i2->setText( 0, a->name() );
i2->setPixmap( 0, a->iconSet().pixmap() ); i2->setPixmap( 0, a->iconSet().pixmap() );
if ( a->inherits( "TQActionGroup" ) ) if ( a->inherits( TQACTIONGROUP_OBJECT_NAME_STRING ) )
insertChildActions( i2 ); insertChildActions( i2 );
} }
} }

@ -37,7 +37,7 @@ ActionListView::ActionListView( TQWidget *parent, const char *name )
ActionItem::ActionItem( TQListView *lv, TQAction *ac ) ActionItem::ActionItem( TQListView *lv, TQAction *ac )
: TQListViewItem( lv ), a( 0 ), g( 0 ) : TQListViewItem( lv ), a( 0 ), g( 0 )
{ {
if ( ac->inherits( "TQActionGroup" ) ) if ( ac->inherits( TQACTIONGROUP_OBJECT_NAME_STRING ) )
g = (QDesignerActionGroup*)ac; g = (QDesignerActionGroup*)ac;
else else
a = (QDesignerAction*)ac; a = (QDesignerAction*)ac;
@ -47,7 +47,7 @@ ActionItem::ActionItem( TQListView *lv, TQAction *ac )
ActionItem::ActionItem( TQListViewItem *i, TQAction *ac ) ActionItem::ActionItem( TQListViewItem *i, TQAction *ac )
: TQListViewItem( i ), a( 0 ), g( 0 ) : TQListViewItem( i ), a( 0 ), g( 0 )
{ {
if ( ac->inherits( "TQActionGroup" ) ) if ( ac->inherits( TQACTIONGROUP_OBJECT_NAME_STRING ) )
g = (QDesignerActionGroup*)ac; g = (QDesignerActionGroup*)ac;
else else
a = (QDesignerAction*)ac; a = (QDesignerAction*)ac;

@ -597,14 +597,14 @@ void SetPropertyCommand::setProperty( const TQVariant &v, const TQString &curren
if ( formWindow()->isMainContainer( widget ) ) if ( formWindow()->isMainContainer( widget ) )
formWindow()->setName( v.toCString() ); formWindow()->setName( v.toCString() );
} }
if ( propName == "name" && widget->inherits( "TQAction" ) && if ( propName == "name" && widget->inherits( TQACTION_OBJECT_NAME_STRING ) &&
formWindow()->mainContainer() && formWindow()->mainContainer() &&
formWindow()->mainContainer()->inherits( "TQMainWindow" ) ) { formWindow()->mainContainer()->inherits( TQMAINWINDOW_OBJECT_NAME_STRING ) ) {
formWindow()->mainWindow()->actioneditor()->updateActionName( (TQAction*)widget ); formWindow()->mainWindow()->actioneditor()->updateActionName( (TQAction*)widget );
} }
if ( propName == "iconSet" && widget->inherits( "TQAction" ) && if ( propName == "iconSet" && widget->inherits( TQACTION_OBJECT_NAME_STRING ) &&
formWindow()->mainContainer() && formWindow()->mainContainer() &&
formWindow()->mainContainer()->inherits( "TQMainWindow" ) ) { formWindow()->mainContainer()->inherits( TQMAINWINDOW_OBJECT_NAME_STRING ) ) {
formWindow()->mainWindow()->actioneditor()->updateActionIcon( (TQAction*)widget ); formWindow()->mainWindow()->actioneditor()->updateActionIcon( (TQAction*)widget );
} }
if ( propName == "caption" ) { if ( propName == "caption" ) {
@ -751,9 +751,9 @@ BreakLayoutCommand::BreakLayoutCommand( const TQString &n, FormWindow *fw,
margin = MetaDataBase::margin( layoutBase ); margin = MetaDataBase::margin( layoutBase );
layout = 0; layout = 0;
if ( lay == WidgetFactory::HBox ) if ( lay == WidgetFactory::HBox )
layout = new HorizontalLayout( wl, layoutBase, fw, layoutBase, false, layoutBase->inherits( "TQSplitter" ) ); layout = new HorizontalLayout( wl, layoutBase, fw, layoutBase, false, layoutBase->inherits( TQSPLITTER_OBJECT_NAME_STRING ) );
else if ( lay == WidgetFactory::VBox ) else if ( lay == WidgetFactory::VBox )
layout = new VerticalLayout( wl, layoutBase, fw, layoutBase, false, layoutBase->inherits( "TQSplitter" ) ); layout = new VerticalLayout( wl, layoutBase, fw, layoutBase, false, layoutBase->inherits( TQSPLITTER_OBJECT_NAME_STRING ) );
else if ( lay == WidgetFactory::Grid ) else if ( lay == WidgetFactory::Grid )
layout = new GridLayout( wl, layoutBase, fw, layoutBase, TQSize( QMAX( 5, fw->grid().x()), QMAX( 5, fw->grid().y()) ), false ); layout = new GridLayout( wl, layoutBase, fw, layoutBase, TQSize( QMAX( 5, fw->grid().x()), QMAX( 5, fw->grid().y()) ), false );
} }
@ -1605,7 +1605,7 @@ void AddActionToToolBarCommand::execute()
toolBar->insertAction( ( (QSeparatorAction*)action )->widget(), action ); toolBar->insertAction( ( (QSeparatorAction*)action )->widget(), action );
( (QSeparatorAction*)action )->widget()->installEventFilter( toolBar ); ( (QSeparatorAction*)action )->widget()->installEventFilter( toolBar );
} }
if ( !action->inherits( "TQActionGroup" ) || ( (TQActionGroup*)action )->usesDropDown()) { if ( !action->inherits( TQACTIONGROUP_OBJECT_NAME_STRING ) || ( (TQActionGroup*)action )->usesDropDown()) {
if ( index == -1 ) if ( index == -1 )
toolBar->appendAction( action ); toolBar->appendAction( action );
else else
@ -1619,7 +1619,7 @@ void AddActionToToolBarCommand::execute()
while ( it.current() ) { while ( it.current() ) {
TQObject *o = it.current(); TQObject *o = it.current();
++it; ++it;
if ( !o->inherits( "TQAction" ) ) if ( !o->inherits( TQACTION_OBJECT_NAME_STRING ) )
continue; continue;
// ### fix it for nested actiongroups // ### fix it for nested actiongroups
if ( o->inherits( "QDesignerAction" ) ) { if ( o->inherits( "QDesignerAction" ) ) {
@ -1649,7 +1649,7 @@ void AddActionToToolBarCommand::unexecute()
toolBar->removeAction( action ); toolBar->removeAction( action );
action->removeFrom( toolBar ); action->removeFrom( toolBar );
TQObject::disconnect( action, TQT_SIGNAL( destroyed() ), toolBar, TQT_SLOT( actionRemoved() ) ); TQObject::disconnect( action, TQT_SIGNAL( destroyed() ), toolBar, TQT_SLOT( actionRemoved() ) );
if ( !action->inherits( "TQActionGroup" ) || ( (TQActionGroup*)action )->usesDropDown()) { if ( !action->inherits( TQACTIONGROUP_OBJECT_NAME_STRING ) || ( (TQActionGroup*)action )->usesDropDown()) {
action->removeEventFilter( toolBar ); action->removeEventFilter( toolBar );
} else { } else {
if ( action->children() ) { if ( action->children() ) {
@ -1657,7 +1657,7 @@ void AddActionToToolBarCommand::unexecute()
while ( it.current() ) { while ( it.current() ) {
TQObject *o = it.current(); TQObject *o = it.current();
++it; ++it;
if ( !o->inherits( "TQAction" ) ) if ( !o->inherits( TQACTION_OBJECT_NAME_STRING ) )
continue; continue;
if ( o->inherits( "QDesignerAction" ) ) { if ( o->inherits( "QDesignerAction" ) ) {
o->removeEventFilter( toolBar ); o->removeEventFilter( toolBar );
@ -1678,7 +1678,7 @@ AddActionToPopupCommand::AddActionToPopupCommand( const TQString &n, FormWindow
void AddActionToPopupCommand::execute() void AddActionToPopupCommand::execute()
{ {
if ( action->inherits( "TQActionGroup" ) ) { if ( action->inherits( TQACTIONGROUP_OBJECT_NAME_STRING ) ) {
if ( ( (TQActionGroup*)action )->usesDropDown() ) { if ( ( (TQActionGroup*)action )->usesDropDown() ) {
action->addTo( popup ); action->addTo( popup );
popup->insertAction( index, action ); popup->insertAction( index, action );
@ -1690,7 +1690,7 @@ void AddActionToPopupCommand::execute()
while ( it.current() ) { while ( it.current() ) {
TQObject *o = it.current(); TQObject *o = it.current();
++it; ++it;
if ( !o->inherits( "TQAction" ) ) if ( !o->inherits( TQACTION_OBJECT_NAME_STRING ) )
continue; continue;
QDesignerAction *ac = (QDesignerAction*)o; QDesignerAction *ac = (QDesignerAction*)o;
popup->insertAction( index + (i++), ac ); popup->insertAction( index + (i++), ac );
@ -1714,7 +1714,7 @@ void AddActionToPopupCommand::unexecute()
action->removeFrom( popup ); action->removeFrom( popup );
popup->removeAction( action ); popup->removeAction( action );
TQObject::disconnect( action, TQT_SIGNAL( destroyed() ), popup, TQT_SLOT( actionRemoved() ) ); TQObject::disconnect( action, TQT_SIGNAL( destroyed() ), popup, TQT_SLOT( actionRemoved() ) );
if ( !action->inherits( "TQActionGroup" ) || ( (TQActionGroup*)action )->usesDropDown()) { if ( !action->inherits( TQACTIONGROUP_OBJECT_NAME_STRING ) || ( (TQActionGroup*)action )->usesDropDown()) {
action->removeEventFilter( popup ); action->removeEventFilter( popup );
} else { } else {
if ( action->children() ) { if ( action->children() ) {
@ -1722,7 +1722,7 @@ void AddActionToPopupCommand::unexecute()
while ( it.current() ) { while ( it.current() ) {
TQObject *o = it.current(); TQObject *o = it.current();
++it; ++it;
if ( !o->inherits( "TQAction" ) ) if ( !o->inherits( TQACTION_OBJECT_NAME_STRING ) )
continue; continue;
if ( o->inherits( "QDesignerAction" ) ) { if ( o->inherits( "QDesignerAction" ) ) {
o->removeEventFilter( popup ); o->removeEventFilter( popup );
@ -1748,7 +1748,7 @@ void AddMenuCommand::execute()
formWindow()->unify( popup, n, true ); formWindow()->unify( popup, n, true );
popup->setName( n ); popup->setName( n );
} }
if ( !mainWindow->child( 0, "TQMenuBar" ) ) { if ( !mainWindow->child( 0, TQMENUBAR_OBJECT_NAME_STRING ) ) {
menuBar = new QDesignerMenuBar( (TQWidget*)mainWindow ); menuBar = new QDesignerMenuBar( (TQWidget*)mainWindow );
menuBar->setName( "menubar" ); menuBar->setName( "menubar" );
} else { } else {

@ -165,7 +165,7 @@ void FormWindow::init()
this, TQT_SLOT(modificationChanged(bool))); this, TQT_SLOT(modificationChanged(bool)));
buffer = 0; buffer = 0;
TQWidget *w = WidgetFactory::create(WidgetDatabase::idFromClassName("TQFrame"), this); TQWidget *w = WidgetFactory::create(WidgetDatabase::idFromClassName(TQFRAME_OBJECT_NAME_STRING), this);
setMainContainer(w); setMainContainer(w);
propertyWidget = w; propertyWidget = w;
targetContainer = 0; targetContainer = 0;
@ -297,7 +297,7 @@ void FormWindow::insertWidget()
bool useSizeHint = !oldRectValid || (currRect.width() < 2 && currRect.height() < 2); bool useSizeHint = !oldRectValid || (currRect.width() < 2 && currRect.height() < 2);
Orientation orient = Horizontal; Orientation orient = Horizontal;
TQString n = WidgetDatabase::className(currTool); TQString n = WidgetDatabase::className(currTool);
if (useSizeHint && (n == "Spacer" || n == "TQSlider" || n == "Line" || n == "TQScrollBar")) { if (useSizeHint && (n == "Spacer" || n == TQSLIDER_OBJECT_NAME_STRING || n == "Line" || n == TQSCROLLBAR_OBJECT_NAME_STRING)) {
TQPopupMenu m(mainWindow()); TQPopupMenu m(mainWindow());
m.insertItem(i18n("&Horizontal")); m.insertItem(i18n("&Horizontal"));
int ver = m.insertItem(i18n("&Vertical")); int ver = m.insertItem(i18n("&Vertical"));
@ -463,7 +463,7 @@ void FormWindow::handleContextMenu(TQContextMenuEvent *e, TQWidget *w)
while (w->parentWidget() && (WidgetFactory::layoutType(w->parentWidget()) != while (w->parentWidget() && (WidgetFactory::layoutType(w->parentWidget()) !=
WidgetFactory::NoLayout || !insertedWidgets.find(w))) WidgetFactory::NoLayout || !insertedWidgets.find(w)))
w = w->parentWidget(); w = w->parentWidget();
if (mainContainer()->inherits("TQMainWindow") && if (mainContainer()->inherits(TQMAINWINDOW_OBJECT_NAME_STRING) &&
((TQMainWindow*)mainContainer())->centralWidget() == realWidget) ((TQMainWindow*)mainContainer())->centralWidget() == realWidget)
{ {
e->accept(); e->accept();
@ -524,7 +524,7 @@ void FormWindow::handleMousePress(TQMouseEvent *e, TQWidget *w)
// unselect its childs // unselect its childs
if (WidgetFactory::layoutType(w) != WidgetFactory::NoLayout) if (WidgetFactory::layoutType(w) != WidgetFactory::NoLayout)
{ {
TQObjectList *l = w->queryList("TQWidget"); TQObjectList *l = w->queryList(TQWIDGET_OBJECT_NAME_STRING);
setPropertyShowingBlocked(true); setPropertyShowingBlocked(true);
for (TQObject *o = l->first(); o; o = l->next()) for (TQObject *o = l->first(); o; o = l->next())
{ {
@ -636,7 +636,7 @@ void FormWindow::handleMousePress(TQMouseEvent *e, TQWidget *w)
{ {
int id = WidgetDatabase::idFromClassName(WidgetFactory::classNameOf(wid)); int id = WidgetDatabase::idFromClassName(WidgetFactory::classNameOf(wid));
if ((WidgetDatabase::isContainer(id) || wid == mainContainer()) && if ((WidgetDatabase::isContainer(id) || wid == mainContainer()) &&
!wid->inherits("QLayoutWidget") && !wid->inherits("TQSplitter")) !wid->inherits(TQLAYOUTWIDGET_OBJECT_NAME_STRING) && !wid->inherits(TQSPLITTER_OBJECT_NAME_STRING))
{ {
insertParent = WidgetFactory::containerOfWidget(wid); // found another parent, store it insertParent = WidgetFactory::containerOfWidget(wid); // found another parent, store it
break; break;
@ -881,15 +881,15 @@ void FormWindow::handleMouseRelease(TQMouseEvent * e, TQWidget * w)
for (TQMap < ulong, TQPoint >::Iterator it = moving.begin(); it != moving.end(); ++it) for (TQMap < ulong, TQPoint >::Iterator it = moving.begin(); it != moving.end(); ++it)
{ {
TQWidget *i = (TQWidget *) it.key(); TQWidget *i = (TQWidget *) it.key();
if (!emitSelChanged && i->inherits("TQButton")) if (!emitSelChanged && i->inherits(TQBUTTON_OBJECT_NAME_STRING))
{ {
if (i->parentWidget() && i->parentWidget()->inherits("TQButtonGroup") || if (i->parentWidget() && i->parentWidget()->inherits(TQBUTTONGROUP_OBJECT_NAME_STRING) ||
wa->inherits("TQButtonGroup")) wa->inherits(TQBUTTONGROUP_OBJECT_NAME_STRING))
emitSelChanged = true; emitSelChanged = true;
if (!wa->inherits("TQButtonGroup")) if (!wa->inherits(TQBUTTONGROUP_OBJECT_NAME_STRING))
{ {
MetaDataBase::setPropertyChanged(i, "buttonGroupId", false); MetaDataBase::setPropertyChanged(i, "buttonGroupId", false);
if (i->parentWidget() && i->parentWidget()->inherits("TQButtonGroup")) if (i->parentWidget() && i->parentWidget()->inherits(TQBUTTONGROUP_OBJECT_NAME_STRING))
((TQButtonGroup *) i->parentWidget())->remove((TQButton *) i); ((TQButtonGroup *) i->parentWidget())->remove((TQButton *) i);
} }
} }
@ -1061,7 +1061,7 @@ void FormWindow::handleKeyPress(TQKeyEvent * e, TQWidget * w)
} }
if (!e->isAccepted()) if (!e->isAccepted())
{ {
TQObjectList *l = queryList("TQWidget"); TQObjectList *l = queryList(TQWIDGET_OBJECT_NAME_STRING);
if (!l) if (!l)
return; return;
if (l->find(w) != -1) if (l->find(w) != -1)
@ -1096,7 +1096,7 @@ void FormWindow::selectWidget(TQObject * o, bool select)
return; return;
} }
if (mainContainer()->inherits("TQMainWindow") && if (mainContainer()->inherits(TQMAINWINDOW_OBJECT_NAME_STRING) &&
w == ((TQMainWindow *) mainContainer())->centralWidget()) w == ((TQMainWindow *) mainContainer())->centralWidget())
{ {
TQObject *opw = propertyWidget; TQObject *opw = propertyWidget;
@ -1281,7 +1281,7 @@ void FormWindow::endRectDraw()
void FormWindow::selectWidgets() void FormWindow::selectWidgets()
{ {
TQObjectList *l = mainContainer()->queryList("TQWidget"); TQObjectList *l = mainContainer()->queryList(TQWIDGET_OBJECT_NAME_STRING);
if (l) if (l)
{ {
for (TQObject * o = l->first(); o; o = l->next()) for (TQObject * o = l->first(); o; o = l->next())
@ -1340,7 +1340,7 @@ void FormWindow::redo()
void FormWindow::raiseChildSelections(TQWidget * w) void FormWindow::raiseChildSelections(TQWidget * w)
{ {
TQObjectList *l = w->queryList("TQWidget"); TQObjectList *l = w->queryList(TQWIDGET_OBJECT_NAME_STRING);
if (!l || !l->first()) if (!l || !l->first())
{ {
delete l; delete l;
@ -1358,7 +1358,7 @@ void FormWindow::raiseChildSelections(TQWidget * w)
void FormWindow::updateChildSelections(TQWidget * w) void FormWindow::updateChildSelections(TQWidget * w)
{ {
TQObjectList *l = w->queryList("TQWidget"); TQObjectList *l = w->queryList(TQWIDGET_OBJECT_NAME_STRING);
if (l) if (l)
{ {
for (TQObject * o = l->first(); o; o = l->next()) for (TQObject * o = l->first(); o; o = l->next())
@ -1374,7 +1374,7 @@ void FormWindow::checkSelectionsForMove(TQWidget * w)
{ {
checkedSelectionsForMove = true; checkedSelectionsForMove = true;
TQObjectList *l = w->parentWidget()->queryList("TQWidget", 0, false, false); TQObjectList *l = w->parentWidget()->queryList(TQWIDGET_OBJECT_NAME_STRING, 0, false, false);
moving.clear(); moving.clear();
if (l) if (l)
{ {
@ -1686,7 +1686,7 @@ void FormWindow::showOrderIndicators()
{ {
hideOrderIndicators(); hideOrderIndicators();
orderIndicators.setAutoDelete(true); orderIndicators.setAutoDelete(true);
TQObjectList *l = mainContainer()->queryList("TQWidget"); TQObjectList *l = mainContainer()->queryList(TQWIDGET_OBJECT_NAME_STRING);
stackedWidgets = MetaDataBase::tabOrder(this); stackedWidgets = MetaDataBase::tabOrder(this);
if (l) if (l)
{ {
@ -1811,7 +1811,7 @@ static void find_accel(const TQString & txt, TQMap < TQChar, TQWidgetList > &acc
void FormWindow::checkAccels() void FormWindow::checkAccels()
{ {
TQMap < TQChar, TQWidgetList > accels; TQMap < TQChar, TQWidgetList > accels;
TQObjectList *l = mainContainer()->queryList("TQWidget"); TQObjectList *l = mainContainer()->queryList(TQWIDGET_OBJECT_NAME_STRING);
if (l) if (l)
{ {
for (TQObject * o = l->first(); o; o = l->next()) for (TQObject * o = l->first(); o; o = l->next())
@ -1883,7 +1883,7 @@ void FormWindow::selectAll()
{ {
checkedSelectionsForMove = false; checkedSelectionsForMove = false;
blockSignals(true); blockSignals(true);
TQObjectList *l = mainContainer()->queryList("TQWidget"); TQObjectList *l = mainContainer()->queryList(TQWIDGET_OBJECT_NAME_STRING);
if (l) if (l)
{ {
for (TQObject * o = l->first(); o; o = l->next()) for (TQObject * o = l->first(); o; o = l->next())
@ -2041,7 +2041,7 @@ void FormWindow::breakLayout(TQWidget * w)
Command *cmd = breakLayoutCommand(w); Command *cmd = breakLayoutCommand(w);
if (cmd) if (cmd)
commands.insert(0, cmd); commands.insert(0, cmd);
if (!w->inherits("QLayoutWidget") && !w->inherits("TQSplitter")) if (!w->inherits(TQLAYOUTWIDGET_OBJECT_NAME_STRING) && !w->inherits(TQSPLITTER_OBJECT_NAME_STRING))
break; break;
} }
w = w->parentWidget(); w = w->parentWidget();
@ -2093,7 +2093,7 @@ bool FormWindow::hasInsertedChildren(TQWidget *w) const
w = WidgetFactory::containerOfWidget(w); w = WidgetFactory::containerOfWidget(w);
if (!w) if (!w)
return false; return false;
TQObjectList *l = w->queryList("TQWidget"); TQObjectList *l = w->queryList(TQWIDGET_OBJECT_NAME_STRING);
if (!l || !l->first()) if (!l || !l->first())
{ {
delete l; delete l;
@ -2291,7 +2291,7 @@ bool FormWindow::unify(TQObject *w, TQString &s, bool changeIt)
TQAction *a = 0; TQAction *a = 0;
for (a = actions.first(); a; a = actions.next()) for (a = actions.first(); a; a = actions.next())
{ {
TQObjectList *l = a->queryList("TQAction"); TQObjectList *l = a->queryList(TQACTION_OBJECT_NAME_STRING);
al.append(a); al.append(a);
for (TQObject *ao = l->first(); ao; ao = l->next()) for (TQObject *ao = l->first(); ao; ao = l->next())
al.append((TQAction*)ao); al.append((TQAction*)ao);
@ -2310,11 +2310,11 @@ bool FormWindow::unify(TQObject *w, TQString &s, bool changeIt)
} }
} }
if (mainContainer()->inherits("TQMainWindow")) if (mainContainer()->inherits(TQMAINWINDOW_OBJECT_NAME_STRING))
{ {
if (!found) if (!found)
{ {
TQObjectList *l = mainContainer()->queryList("TQDockWindow", 0, true); TQObjectList *l = mainContainer()->queryList(TQDOCKWINDOW_OBJECT_NAME_STRING, 0, true);
for (TQObject *o = l->first(); o; o = l->next()) for (TQObject *o = l->first(); o; o = l->next())
if (o != w && !qstrcmp(o->name(), s.latin1())) if (o != w && !qstrcmp(o->name(), s.latin1()))
{ {
@ -2361,7 +2361,7 @@ bool FormWindow::isDatabaseWidgetUsed() const
{ {
#ifndef QT_NO_SQL #ifndef QT_NO_SQL
TQStringList dbClasses; TQStringList dbClasses;
dbClasses << "TQDataTable"; // add more here dbClasses << TQDATATABLE_OBJECT_NAME_STRING; // add more here
TQPtrDictIterator<TQWidget> it(insertedWidgets); TQPtrDictIterator<TQWidget> it(insertedWidgets);
for (; it.current(); ++it) for (; it.current(); ++it)
{ {
@ -2451,9 +2451,9 @@ TQWidget *FormWindow::containerAt(const TQPoint &pos, TQWidget *notParentOf)
} }
for (; it.current(); ++it) { for (; it.current(); ++it) {
if (it.current()->inherits("QLayoutWidget")) if (it.current()->inherits(TQLAYOUTWIDGET_OBJECT_NAME_STRING))
continue; continue;
if (it.current()->inherits("TQSplitter")) if (it.current()->inherits(TQSPLITTER_OBJECT_NAME_STRING))
continue; continue;
if (!it.current()->isVisibleTo(this)) if (!it.current()->isVisibleTo(this))
continue; continue;
@ -2546,7 +2546,7 @@ TQAction *FormWindow::findAction(const TQString &name)
{ {
if (TQString(a->name()) == name) if (TQString(a->name()) == name)
return a; return a;
TQAction *ac = (TQAction*)a->child(name.latin1(), "TQAction"); TQAction *ac = (TQAction*)a->child(name.latin1(), TQACTION_OBJECT_NAME_STRING);
if (ac) if (ac)
return ac; return ac;
} }
@ -2555,7 +2555,7 @@ TQAction *FormWindow::findAction(const TQString &name)
void FormWindow::killAccels(TQObject *top) void FormWindow::killAccels(TQObject *top)
{ {
TQObjectList *l = top->queryList("TQAccel"); TQObjectList *l = top->queryList(TQACCEL_OBJECT_NAME_STRING);
if (!l) if (!l)
return; return;
for (TQObject *o = l->first(); o; o = l->next()) for (TQObject *o = l->first(); o; o = l->next())
@ -2565,7 +2565,7 @@ void FormWindow::killAccels(TQObject *top)
bool FormWindow::isCentralWidget(TQObject *w) const bool FormWindow::isCentralWidget(TQObject *w) const
{ {
if (!mainContainer()->inherits("TQMainWindow")) if (!mainContainer()->inherits(TQMAINWINDOW_OBJECT_NAME_STRING))
return false; return false;
return w == ((TQMainWindow*)mainContainer())->centralWidget(); return w == ((TQMainWindow*)mainContainer())->centralWidget();
} }

@ -255,11 +255,11 @@ void HierarchyList::objectClicked( TQListViewItem *i )
} }
if ( !formWindow->widgets()->find( w ) ) { if ( !formWindow->widgets()->find( w ) ) {
if ( w->parent() && w->parent()->inherits( "TQWidgetStack" ) && if ( w->parent() && w->parent()->inherits( TQWIDGETSTACK_OBJECT_NAME_STRING ) &&
w->parent()->parent() && w->parent()->parent() &&
( w->parent()->parent()->inherits( "TQTabWidget" ) || ( w->parent()->parent()->inherits( TQTABWIDGET_OBJECT_NAME_STRING ) ||
w->parent()->parent()->inherits( "TQWizard" ) ) ) { w->parent()->parent()->inherits( TQWIZARD_OBJECT_NAME_STRING ) ) ) {
if ( w->parent()->parent()->inherits( "TQTabWidget" ) ) if ( w->parent()->parent()->inherits( TQTABWIDGET_OBJECT_NAME_STRING ) )
( (TQTabWidget*)w->parent()->parent() )->showPage( w ); ( (TQTabWidget*)w->parent()->parent() )->showPage( w );
else else
( (QDesignerWizard*)w->parent()->parent() )->setCurrentPage( ( (QDesignerWizard*)w->parent()->parent() )->pageNum( w ) ); ( (QDesignerWizard*)w->parent()->parent() )->setCurrentPage( ( (QDesignerWizard*)w->parent()->parent() )->pageNum( w ) );
@ -356,7 +356,7 @@ void HierarchyList::setOpen( TQListViewItem *i, bool b )
void HierarchyList::insertObject( TQObject *o, TQListViewItem *parent ) void HierarchyList::insertObject( TQObject *o, TQListViewItem *parent )
{ {
bool fakeMainWindow = false; bool fakeMainWindow = false;
if ( o && o->inherits( "TQMainWindow" ) ) { if ( o && o->inherits( TQMAINWINDOW_OBJECT_NAME_STRING ) ) {
TQObject *cw = ( (TQMainWindow*)o )->centralWidget(); TQObject *cw = ( (TQMainWindow*)o )->centralWidget();
if ( cw ) { if ( cw ) {
o = cw; o = cw;
@ -365,7 +365,7 @@ void HierarchyList::insertObject( TQObject *o, TQListViewItem *parent )
} }
TQListViewItem *item = 0; TQListViewItem *item = 0;
TQString className = WidgetFactory::classNameOf( o ); TQString className = WidgetFactory::classNameOf( o );
if ( o->inherits( "QLayoutWidget" ) ) { if ( o->inherits( TQLAYOUTWIDGET_OBJECT_NAME_STRING ) ) {
switch ( WidgetFactory::layoutType( (TQWidget*)o ) ) { switch ( WidgetFactory::layoutType( (TQWidget*)o ) ) {
case WidgetFactory::HBox: case WidgetFactory::HBox:
className = "HBox"; className = "HBox";
@ -387,11 +387,11 @@ void HierarchyList::insertObject( TQObject *o, TQListViewItem *parent )
#endif #endif
TQString name = o->name(); TQString name = o->name();
if ( o->parent() && o->parent()->inherits( "TQWidgetStack" ) && if ( o->parent() && o->parent()->inherits( TQWIDGETSTACK_OBJECT_NAME_STRING ) &&
o->parent()->parent() ) { o->parent()->parent() ) {
if ( o->parent()->parent()->inherits( "TQTabWidget" ) ) if ( o->parent()->parent()->inherits( TQTABWIDGET_OBJECT_NAME_STRING ) )
name = ( (TQTabWidget*)o->parent()->parent() )->tabLabel( (TQWidget*)o ); name = ( (TQTabWidget*)o->parent()->parent() )->tabLabel( (TQWidget*)o );
else if ( o->parent()->parent()->inherits( "TQWizard" ) ) else if ( o->parent()->parent()->inherits( TQWIZARD_OBJECT_NAME_STRING ) )
name = ( (TQWizard*)o->parent()->parent() )->title( (TQWidget*)o ); name = ( (TQWizard*)o->parent()->parent() )->title( (TQWidget*)o );
} }
@ -403,7 +403,7 @@ void HierarchyList::insertObject( TQObject *o, TQListViewItem *parent )
if ( fakeMainWindow ) { if ( fakeMainWindow ) {
name = o->parent()->name(); name = o->parent()->name();
className = "TQMainWindow"; className = TQMAINWINDOW_OBJECT_NAME_STRING;
} }
if ( !parent ) if ( !parent )
@ -429,16 +429,16 @@ void HierarchyList::insertObject( TQObject *o, TQListViewItem *parent )
continue; continue;
if ( !formWindow->widgets()->find( (TQWidget*)it.current() ) ) { if ( !formWindow->widgets()->find( (TQWidget*)it.current() ) ) {
if ( it.current()->parent() && if ( it.current()->parent() &&
( it.current()->parent()->inherits( "TQTabWidget" ) || ( it.current()->parent()->inherits( TQTABWIDGET_OBJECT_NAME_STRING ) ||
it.current()->parent()->inherits( "TQWizard" ) ) && it.current()->parent()->inherits( TQWIZARD_OBJECT_NAME_STRING ) ) &&
it.current()->inherits( "TQWidgetStack" ) ) { it.current()->inherits( TQWIDGETSTACK_OBJECT_NAME_STRING ) ) {
TQObject *obj = it.current(); TQObject *obj = it.current();
TQObjectList *l2 = obj->queryList( "TQWidget", 0, true, false ); TQObjectList *l2 = obj->queryList( TQWIDGET_OBJECT_NAME_STRING, 0, true, false );
QDesignerTabWidget *tw = 0; QDesignerTabWidget *tw = 0;
QDesignerWizard *dw = 0; QDesignerWizard *dw = 0;
if ( it.current()->parent()->inherits( "TQTabWidget" ) ) if ( it.current()->parent()->inherits( TQTABWIDGET_OBJECT_NAME_STRING ) )
tw = (QDesignerTabWidget*)it.current()->parent(); tw = (QDesignerTabWidget*)it.current()->parent();
if ( it.current()->parent()->inherits( "TQWizard" ) ) if ( it.current()->parent()->inherits( TQWIZARD_OBJECT_NAME_STRING ) )
dw = (QDesignerWizard*)it.current()->parent(); dw = (QDesignerWizard*)it.current()->parent();
TQWidgetStack *stack = (TQWidgetStack*)obj; TQWidgetStack *stack = (TQWidgetStack*)obj;
for ( obj = l2->last(); obj; obj = l2->prev() ) { for ( obj = l2->last(); obj; obj = l2->prev() ) {
@ -495,7 +495,7 @@ void HierarchyList::showRMBMenu( TQListViewItem *i, const TQPoint & p )
return; return;
if ( w->isVisibleTo( formWindow ) ) { if ( w->isVisibleTo( formWindow ) ) {
if ( !w->inherits( "TQTabWidget" ) && !w->inherits( "TQWizard" ) ) { if ( !w->inherits( TQTABWIDGET_OBJECT_NAME_STRING ) && !w->inherits( TQWIZARD_OBJECT_NAME_STRING ) ) {
if ( !normalMenu ) if ( !normalMenu )
normalMenu = formWindow->mainWindow()->setupNormalHierarchyMenu( this ); normalMenu = formWindow->mainWindow()->setupNormalHierarchyMenu( this );
normalMenu->popup( p ); normalMenu->popup( p );
@ -514,13 +514,13 @@ void HierarchyList::addTabPage()
TQWidget *w = current(); TQWidget *w = current();
if ( !w ) if ( !w )
return; return;
if ( w->inherits( "TQTabWidget" ) ) { if ( w->inherits( TQTABWIDGET_OBJECT_NAME_STRING ) ) {
TQTabWidget *tw = (TQTabWidget*)w; TQTabWidget *tw = (TQTabWidget*)w;
AddTabPageCommand *cmd = new AddTabPageCommand( i18n("Add Page to %1" ).arg( tw->name() ), formWindow, AddTabPageCommand *cmd = new AddTabPageCommand( i18n("Add Page to %1" ).arg( tw->name() ), formWindow,
tw, "Tab" ); tw, "Tab" );
formWindow->commandHistory()->addCommand( cmd ); formWindow->commandHistory()->addCommand( cmd );
cmd->execute(); cmd->execute();
} else if ( w->inherits( "TQWizard" ) ) { } else if ( w->inherits( TQWIZARD_OBJECT_NAME_STRING ) ) {
TQWizard *wiz = (TQWizard*)formWindow->mainContainer(); TQWizard *wiz = (TQWizard*)formWindow->mainContainer();
AddWizardPageCommand *cmd = new AddWizardPageCommand( i18n("Add Page to %1" ).arg( wiz->name() ), formWindow, AddWizardPageCommand *cmd = new AddWizardPageCommand( i18n("Add Page to %1" ).arg( wiz->name() ), formWindow,
wiz, "Page" ); wiz, "Page" );
@ -534,7 +534,7 @@ void HierarchyList::removeTabPage()
TQWidget *w = current(); TQWidget *w = current();
if ( !w ) if ( !w )
return; return;
if ( w->inherits( "TQTabWidget" ) ) { if ( w->inherits( TQTABWIDGET_OBJECT_NAME_STRING ) ) {
TQTabWidget *tw = (TQTabWidget*)w; TQTabWidget *tw = (TQTabWidget*)w;
if ( tw->currentPage() ) { if ( tw->currentPage() ) {
QDesignerTabWidget *dtw = (QDesignerTabWidget*)tw; QDesignerTabWidget *dtw = (QDesignerTabWidget*)tw;
@ -544,7 +544,7 @@ void HierarchyList::removeTabPage()
formWindow->commandHistory()->addCommand( cmd ); formWindow->commandHistory()->addCommand( cmd );
cmd->execute(); cmd->execute();
} }
} else if ( w->inherits( "TQWizard" ) ) { } else if ( w->inherits( TQWIZARD_OBJECT_NAME_STRING ) ) {
TQWizard *wiz = (TQWizard*)formWindow->mainContainer(); TQWizard *wiz = (TQWizard*)formWindow->mainContainer();
if ( wiz->currentPage() ) { if ( wiz->currentPage() ) {
QDesignerWizard *dw = (QDesignerWizard*)wiz; QDesignerWizard *dw = (QDesignerWizard*)wiz;
@ -677,7 +677,7 @@ void HierarchyView::widgetsRemoved( const TQWidgetList & )
void HierarchyView::namePropertyChanged( TQWidget *w, const TQVariant & ) void HierarchyView::namePropertyChanged( TQWidget *w, const TQVariant & )
{ {
TQWidget *w2 = w; TQWidget *w2 = w;
if ( w->inherits( "TQMainWindow" ) ) if ( w->inherits( TQMAINWINDOW_OBJECT_NAME_STRING ) )
w2 = ( (TQMainWindow*)w )->centralWidget(); w2 = ( (TQMainWindow*)w )->centralWidget();
listview->changeNameOf( w2, w->name() ); listview->changeNameOf( w2, w->name() );
} }

@ -159,13 +159,13 @@ bool Layout::prepareLayout( bool &needMove, bool &needReparent )
for ( TQWidget *w = widgets.first(); w; w = widgets.next() ) for ( TQWidget *w = widgets.first(); w; w = widgets.next() )
w->raise(); w->raise();
needMove = !layoutBase; needMove = !layoutBase;
needReparent = needMove || layoutBase->inherits( "QLayoutWidget" ) || layoutBase->inherits( "TQSplitter" ); needReparent = needMove || layoutBase->inherits( "QLayoutWidget" ) || layoutBase->inherits( TQSPLITTER_OBJECT_NAME_STRING );
if ( !layoutBase ) { if ( !layoutBase ) {
if ( !useSplitter ) if ( !useSplitter )
layoutBase = WidgetFactory::create( WidgetDatabase::idFromClassName( "QLayoutWidget" ), layoutBase = WidgetFactory::create( WidgetDatabase::idFromClassName( "QLayoutWidget" ),
WidgetFactory::containerOfWidget( parent ) ); WidgetFactory::containerOfWidget( parent ) );
else else
layoutBase = WidgetFactory::create( WidgetDatabase::idFromClassName( "TQSplitter" ), layoutBase = WidgetFactory::create( WidgetDatabase::idFromClassName( TQSPLITTER_OBJECT_NAME_STRING ),
WidgetFactory::containerOfWidget( parent ) ); WidgetFactory::containerOfWidget( parent ) );
} else { } else {
WidgetFactory::deleteLayout( layoutBase ); WidgetFactory::deleteLayout( layoutBase );
@ -208,7 +208,7 @@ void Layout::undoLayout()
} }
formWindow->selectWidget( layoutBase, false ); formWindow->selectWidget( layoutBase, false );
WidgetFactory::deleteLayout( layoutBase ); WidgetFactory::deleteLayout( layoutBase );
if ( parent != layoutBase && !layoutBase->inherits( "TQMainWindow" ) ) { if ( parent != layoutBase && !layoutBase->inherits( TQMAINWINDOW_OBJECT_NAME_STRING ) ) {
layoutBase->hide(); layoutBase->hide();
TQString n = layoutBase->name(); TQString n = layoutBase->name();
n.prepend( "qt_dead_widget_" ); n.prepend( "qt_dead_widget_" );
@ -232,10 +232,10 @@ void Layout::breakLayout()
} }
WidgetFactory::deleteLayout( layoutBase ); WidgetFactory::deleteLayout( layoutBase );
bool needReparent = qstrcmp( layoutBase->className(), "QLayoutWidget" ) == 0 || bool needReparent = qstrcmp( layoutBase->className(), "QLayoutWidget" ) == 0 ||
qstrcmp( layoutBase->className(), "TQSplitter" ) == 0 || qstrcmp( layoutBase->className(), TQSPLITTER_OBJECT_NAME_STRING ) == 0 ||
( !WidgetDatabase::isContainer( WidgetDatabase::idFromClassName( WidgetFactory::classNameOf( layoutBase ) ) ) && ( !WidgetDatabase::isContainer( WidgetDatabase::idFromClassName( WidgetFactory::classNameOf( layoutBase ) ) ) &&
layoutBase != formWindow->mainContainer() ); layoutBase != formWindow->mainContainer() );
bool needResize = qstrcmp( layoutBase->className(), "TQSplitter" ) == 0; bool needResize = qstrcmp( layoutBase->className(), TQSPLITTER_OBJECT_NAME_STRING ) == 0;
bool add = geometries.isEmpty(); bool add = geometries.isEmpty();
for ( TQWidget *w = widgets.first(); w; w = widgets.next() ) { for ( TQWidget *w = widgets.first(); w; w = widgets.next() ) {
if ( needReparent ) if ( needReparent )
@ -319,7 +319,7 @@ void HorizontalLayout::doLayout()
w->show(); w->show();
} }
if ( layoutBase->inherits( "TQSplitter" ) ) if ( layoutBase->inherits( TQSPLITTER_OBJECT_NAME_STRING ) )
( (TQSplitter*)layoutBase )->setOrientation( Qt::Horizontal ); ( (TQSplitter*)layoutBase )->setOrientation( Qt::Horizontal );
finishLayout( needMove, layout ); finishLayout( needMove, layout );
@ -383,7 +383,7 @@ void VerticalLayout::doLayout()
w->show(); w->show();
} }
if ( layoutBase->inherits( "TQSplitter" ) ) if ( layoutBase->inherits( TQSPLITTER_OBJECT_NAME_STRING ) )
( (TQSplitter*)layoutBase )->setOrientation( Qt::Vertical ); ( (TQSplitter*)layoutBase )->setOrientation( Qt::Vertical );
finishLayout( needMove, layout ); finishLayout( needMove, layout );

@ -179,16 +179,16 @@ MainWindow::MainWindow(bool asClient)
readConfig(); readConfig();
// hack to make WidgetFactory happy (so it knows TQWidget and TQDialog for resetting properties) // hack to make WidgetFactory happy (so it knows TQWidget and TQDialog for resetting properties)
TQWidget *w = WidgetFactory::create(WidgetDatabase::idFromClassName("TQWidget"), this, 0, false); TQWidget *w = WidgetFactory::create(WidgetDatabase::idFromClassName(TQWIDGET_OBJECT_NAME_STRING), this, 0, false);
delete w; delete w;
w = WidgetFactory::create(WidgetDatabase::idFromClassName("Dialog"), this, 0, false); w = WidgetFactory::create(WidgetDatabase::idFromClassName("Dialog"), this, 0, false);
delete w; delete w;
w = WidgetFactory::create(WidgetDatabase::idFromClassName("TQLabel"), this, 0, false); w = WidgetFactory::create(WidgetDatabase::idFromClassName(TQLABEL_OBJECT_NAME_STRING), this, 0, false);
delete w; delete w;
w = WidgetFactory::create(WidgetDatabase::idFromClassName("TQTabWidget"), this, 0, false); w = WidgetFactory::create(WidgetDatabase::idFromClassName(TQTABWIDGET_OBJECT_NAME_STRING), this, 0, false);
delete w; delete w;
w = WidgetFactory::create(WidgetDatabase::idFromClassName("TQFrame"), this, 0, false); w = WidgetFactory::create(WidgetDatabase::idFromClassName(TQFRAME_OBJECT_NAME_STRING), this, 0, false);
delete w; delete w;
assistant = new AssistProc(this, "Internal Assistant", assistantPath()); assistant = new AssistProc(this, "Internal Assistant", assistantPath());
@ -630,18 +630,18 @@ bool MainWindow::eventFilter(TQObject *o, TQEvent *e)
break; break;
if (o && currentTool() == POINTER_TOOL && (o->inherits("QDesignerMenuBar") || if (o && currentTool() == POINTER_TOOL && (o->inherits("QDesignerMenuBar") ||
o->inherits("QDesignerToolBar") || o->inherits("QDesignerToolBar") ||
(o->inherits("TQComboBox") || o->inherits("TQToolButton") || o->inherits("QDesignerToolBarSeparator")) && (o->inherits(TQCOMBOBOX_OBJECT_NAME_STRING) || o->inherits(TQTOOLBUTTON_OBJECT_NAME_STRING) || o->inherits("QDesignerToolBarSeparator")) &&
o->parent() && o->parent()->inherits("QDesignerToolBar"))) { o->parent() && o->parent()->inherits("QDesignerToolBar"))) {
TQWidget *w = (TQWidget*)o; TQWidget *w = (TQWidget*)o;
if (w->inherits("TQToolButton") || w->inherits("TQComboBox") || w->inherits("QDesignerToolBarSeparator")) if (w->inherits(TQTOOLBUTTON_OBJECT_NAME_STRING) || w->inherits(TQCOMBOBOX_OBJECT_NAME_STRING) || w->inherits("QDesignerToolBarSeparator"))
w = w->parentWidget(); w = w->parentWidget();
TQWidget *pw = w->parentWidget(); TQWidget *pw = w->parentWidget();
while (pw) { while (pw) {
if (pw->inherits("FormWindow")) { if (pw->inherits("FormWindow")) {
((FormWindow*)pw)->emitShowProperties(w); ((FormWindow*)pw)->emitShowProperties(w);
if (!o->inherits("QDesignerToolBar")) if (!o->inherits("QDesignerToolBar"))
return !o->inherits("TQToolButton") && !o->inherits("TQMenuBar") && return !o->inherits(TQTOOLBUTTON_OBJECT_NAME_STRING) && !o->inherits(TQMENUBAR_OBJECT_NAME_STRING) &&
!o->inherits("TQComboBox") && !o->inherits("QDesignerToolBarSeparator"); !o->inherits(TQCOMBOBOX_OBJECT_NAME_STRING) && !o->inherits("QDesignerToolBarSeparator");
} }
pw = pw->parentWidget(); pw = pw->parentWidget();
} }
@ -651,7 +651,7 @@ bool MainWindow::eventFilter(TQObject *o, TQEvent *e)
break; break;
if (isAToolBarChild(o) && currentTool() != CONNECT_TOOL) if (isAToolBarChild(o) && currentTool() != CONNECT_TOOL)
break; break;
if (o && o->inherits("TQSizeGrip")) if (o && o->inherits(TQSIZEGRIP_OBJECT_NAME_STRING))
break; break;
if (!(w = isAFormWindowChild(o)) || o->inherits("SizeHandle") || o->inherits("OrderIndicator")) if (!(w = isAFormWindowChild(o)) || o->inherits("SizeHandle") || o->inherits("OrderIndicator"))
break; break;
@ -677,7 +677,7 @@ bool MainWindow::eventFilter(TQObject *o, TQEvent *e)
lastPressWidget = 0; lastPressWidget = 0;
if (isAToolBarChild(o) && currentTool() != CONNECT_TOOL) if (isAToolBarChild(o) && currentTool() != CONNECT_TOOL)
break; break;
if (o && o->inherits("TQSizeGrip")) if (o && o->inherits(TQSIZEGRIP_OBJECT_NAME_STRING))
break; break;
if (!(w = isAFormWindowChild(o)) || o->inherits("SizeHandle") || o->inherits("OrderIndicator")) if (!(w = isAFormWindowChild(o)) || o->inherits("SizeHandle") || o->inherits("OrderIndicator"))
break; break;
@ -694,10 +694,10 @@ bool MainWindow::eventFilter(TQObject *o, TQEvent *e)
w = isAFormWindowChild(o); w = isAFormWindowChild(o);
if (lastPressWidget != (TQWidget*)o && w && if (lastPressWidget != (TQWidget*)o && w &&
!o->inherits("SizeHandle") && !o->inherits("OrderIndicator") && !o->inherits("SizeHandle") && !o->inherits("OrderIndicator") &&
!o->inherits("TQPopupMenu") && !o->inherits("TQMenuBar") && !o->inherits(TQPOPUPMENU_OBJECT_NAME_STRING) && !o->inherits(TQMENUBAR_OBJECT_NAME_STRING) &&
!o->inherits("TQSizeGrip")) !o->inherits(TQSIZEGRIP_OBJECT_NAME_STRING))
return true; return true;
if (o && o->inherits("TQSizeGrip")) if (o && o->inherits(TQSIZEGRIP_OBJECT_NAME_STRING))
break; break;
if (lastPressWidget != (TQWidget*)o || if (lastPressWidget != (TQWidget*)o ||
(!w || o->inherits("SizeHandle") || o->inherits("OrderIndicator"))) (!w || o->inherits("SizeHandle") || o->inherits("OrderIndicator")))
@ -718,8 +718,8 @@ bool MainWindow::eventFilter(TQObject *o, TQEvent *e)
break; break;
case TQEvent::MouseButtonDblClick: case TQEvent::MouseButtonDblClick:
if (!(w = isAFormWindowChild(o)) || o->inherits("SizeHandle") || o->inherits("OrderIndicator")) { if (!(w = isAFormWindowChild(o)) || o->inherits("SizeHandle") || o->inherits("OrderIndicator")) {
if (o && o->inherits("TQToolButton") && ((TQToolButton*)o)->isOn() && if (o && o->inherits(TQTOOLBUTTON_OBJECT_NAME_STRING) && ((TQToolButton*)o)->isOn() &&
o->parent() && o->parent()->inherits("TQToolBar") && formWindow()) o->parent() && o->parent()->inherits(TQTOOLBAR_OBJECT_NAME_STRING) && formWindow())
formWindow()->setToolFixed(); formWindow()->setToolFixed();
break; break;
} }
@ -808,7 +808,7 @@ bool MainWindow::eventFilter(TQObject *o, TQEvent *e)
TQWidget *MainWindow::isAFormWindowChild(TQObject *o) const TQWidget *MainWindow::isAFormWindowChild(TQObject *o) const
{ {
if (o->parent() && o->parent()->inherits("TQWizard") && !o->inherits("TQPushButton")) if (o->parent() && o->parent()->inherits(TQWIZARD_OBJECT_NAME_STRING) && !o->inherits(TQPUSHBUTTON_OBJECT_NAME_STRING))
return 0; return 0;
while (o) { while (o) {
if (o->inherits("FormWindow")) if (o->inherits("FormWindow"))
@ -1013,18 +1013,18 @@ void MainWindow::popupWidgetMenu(const TQPoint &gp, FormWindow * /*fw*/, TQWidge
void MainWindow::setupRMBProperties(TQValueList<int> &ids, TQMap<TQString, int> &props, TQWidget *w) void MainWindow::setupRMBProperties(TQValueList<int> &ids, TQMap<TQString, int> &props, TQWidget *w)
{ {
const TQMetaProperty* text = w->metaObject()->property(w->metaObject()->findProperty("text", true), true); const TQMetaProperty* text = w->metaObject()->property(w->metaObject()->findProperty("text", true), true);
if (text && qstrcmp(text->type(), "TQString") != 0) if (text && qstrcmp(text->type(), TQSTRING_OBJECT_NAME_STRING) != 0)
text = 0; text = 0;
const TQMetaProperty* title = w->metaObject()->property(w->metaObject()->findProperty("title", true), true); const TQMetaProperty* title = w->metaObject()->property(w->metaObject()->findProperty("title", true), true);
if (title && qstrcmp(title->type(), "TQString") != 0) if (title && qstrcmp(title->type(), TQSTRING_OBJECT_NAME_STRING) != 0)
title = 0; title = 0;
const TQMetaProperty* pagetitle = const TQMetaProperty* pagetitle =
w->metaObject()->property(w->metaObject()->findProperty("pageTitle", true), true); w->metaObject()->property(w->metaObject()->findProperty("pageTitle", true), true);
if (pagetitle && qstrcmp(pagetitle->type(), "TQString") != 0) if (pagetitle && qstrcmp(pagetitle->type(), TQSTRING_OBJECT_NAME_STRING) != 0)
pagetitle = 0; pagetitle = 0;
const TQMetaProperty* pixmap = const TQMetaProperty* pixmap =
w->metaObject()->property(w->metaObject()->findProperty("pixmap", true), true); w->metaObject()->property(w->metaObject()->findProperty("pixmap", true), true);
if (pixmap && qstrcmp(pixmap->type(), "TQPixmap") != 0) if (pixmap && qstrcmp(pixmap->type(), TQPIXMAP_OBJECT_NAME_STRING) != 0)
pixmap = 0; pixmap = 0;
if (text && text->designable(w) || if (text && text->designable(w) ||
@ -1038,7 +1038,7 @@ void MainWindow::setupRMBProperties(TQValueList<int> &ids, TQMap<TQString, int>
ids << (id = rmbWidgets->insertItem(i18n("Choose Pixmap..."), -1, 0)); ids << (id = rmbWidgets->insertItem(i18n("Choose Pixmap..."), -1, 0));
props.insert("pixmap", id); props.insert("pixmap", id);
} }
if (text && text->designable(w) && !w->inherits("TQTextEdit")) { if (text && text->designable(w) && !w->inherits(TQTEXTEDIT_OBJECT_NAME_STRING)) {
ids << (id = rmbWidgets->insertItem(i18n("Edit Text..."), -1, 0)); ids << (id = rmbWidgets->insertItem(i18n("Edit Text..."), -1, 0));
props.insert("text", id); props.insert("text", id);
} }
@ -1068,7 +1068,7 @@ void MainWindow::setupRMBSpecialCommands(TQValueList<int> &ids, TQMap<TQString,
commands.insert("assoc", id); commands.insert("assoc", id);
} }
if (w->inherits("TQTabWidget")) { if (w->inherits(TQTABWIDGET_OBJECT_NAME_STRING)) {
if (ids.isEmpty()) if (ids.isEmpty())
ids << rmbWidgets->insertSeparator(0); ids << rmbWidgets->insertSeparator(0);
if (((QDesignerTabWidget*)w)->count() > 1) { if (((QDesignerTabWidget*)w)->count() > 1) {
@ -1078,7 +1078,7 @@ void MainWindow::setupRMBSpecialCommands(TQValueList<int> &ids, TQMap<TQString,
ids << (id = rmbWidgets->insertItem(i18n("Add Page"), -1, 0)); ids << (id = rmbWidgets->insertItem(i18n("Add Page"), -1, 0));
commands.insert("add", id); commands.insert("add", id);
} }
if (w->inherits("TQToolBox")) { if (w->inherits(TQTOOLBOX_OBJECT_NAME_STRING)) {
if (ids.isEmpty()) if (ids.isEmpty())
ids << rmbWidgets->insertSeparator(0); ids << rmbWidgets->insertSeparator(0);
if (((TQToolBox*)w)->count() > 1) { if (((TQToolBox*)w)->count() > 1) {
@ -1113,7 +1113,7 @@ void MainWindow::setupRMBSpecialCommands(TQValueList<int> &ids, TQMap<TQString,
commands.insert("assoc", id); commands.insert("assoc", id);
} }
if (fw->mainContainer()->inherits("TQWizard")) { if (fw->mainContainer()->inherits(TQWIZARD_OBJECT_NAME_STRING)) {
if (ids.isEmpty()) if (ids.isEmpty())
ids << rmbFormWindow->insertSeparator(0); ids << rmbFormWindow->insertSeparator(0);
@ -1131,7 +1131,7 @@ void MainWindow::setupRMBSpecialCommands(TQValueList<int> &ids, TQMap<TQString,
ids << (id = rmbFormWindow->insertItem(i18n("Edit Pages..."), -1, 0)); ids << (id = rmbFormWindow->insertItem(i18n("Edit Pages..."), -1, 0));
commands.insert("edit", id); commands.insert("edit", id);
} else if (fw->mainContainer()->inherits("TQMainWindow")) { } else if (fw->mainContainer()->inherits(TQMAINWINDOW_OBJECT_NAME_STRING)) {
if (ids.isEmpty()) if (ids.isEmpty())
ids << rmbFormWindow->insertSeparator(0); ids << rmbFormWindow->insertSeparator(0);
ids << (id = rmbFormWindow->insertItem(i18n("Add Menu Item"), -1, 0)); ids << (id = rmbFormWindow->insertItem(i18n("Add Menu Item"), -1, 0));
@ -1146,7 +1146,7 @@ void MainWindow::handleRMBProperties(int id, TQMap<TQString, int> &props, TQWidg
if (id == props[ "text" ]) { if (id == props[ "text" ]) {
bool ok = false; bool ok = false;
TQString text; TQString text;
if (w->inherits("TQTextView") || w->inherits("TQLabel")) { if (w->inherits(TQTEXTVIEW_OBJECT_NAME_STRING) || w->inherits(TQLABEL_OBJECT_NAME_STRING)) {
text = TextEditor::getText(this, w->property("text").toString()); text = TextEditor::getText(this, w->property("text").toString());
ok = !text.isEmpty(); ok = !text.isEmpty();
} else { } else {
@ -1211,7 +1211,7 @@ void MainWindow::handleRMBSpecialCommands(int id, TQMap<TQString, int> &commands
editor->show(); editor->show();
} }
if (w->inherits("TQTabWidget")) { if (w->inherits(TQTABWIDGET_OBJECT_NAME_STRING)) {
TQTabWidget *tw = (TQTabWidget*)w; TQTabWidget *tw = (TQTabWidget*)w;
if (id == commands[ "add" ]) { if (id == commands[ "add" ]) {
AddTabPageCommand *cmd = new AddTabPageCommand(i18n("Add Page to %1").arg(tw->name()), formWindow(), AddTabPageCommand *cmd = new AddTabPageCommand(i18n("Add Page to %1").arg(tw->name()), formWindow(),
@ -1229,7 +1229,7 @@ void MainWindow::handleRMBSpecialCommands(int id, TQMap<TQString, int> &commands
} }
} }
} }
if (w->inherits("TQToolBox")) { if (w->inherits(TQTOOLBOX_OBJECT_NAME_STRING)) {
TQToolBox *tw = (TQToolBox*)w; TQToolBox *tw = (TQToolBox*)w;
if (id == commands[ "add" ]) { if (id == commands[ "add" ]) {
AddToolBoxPageCommand *cmd = new AddToolBoxPageCommand(i18n("Add Page to %1").arg(tw->name()), formWindow(), AddToolBoxPageCommand *cmd = new AddToolBoxPageCommand(i18n("Add Page to %1").arg(tw->name()), formWindow(),
@ -1264,7 +1264,7 @@ void MainWindow::handleRMBSpecialCommands(int id, TQMap<TQString, int> &commands
} }
if (fw->mainContainer()->inherits("TQWizard")) { if (fw->mainContainer()->inherits(TQWIZARD_OBJECT_NAME_STRING)) {
TQWizard *wiz = (TQWizard*)fw->mainContainer(); TQWizard *wiz = (TQWizard*)fw->mainContainer();
if (id == commands[ "add" ]) { if (id == commands[ "add" ]) {
AddWizardPageCommand *cmd = new AddWizardPageCommand(i18n("Add Page to %1").arg(wiz->name()), formWindow(), AddWizardPageCommand *cmd = new AddWizardPageCommand(i18n("Add Page to %1").arg(wiz->name()), formWindow(),
@ -1297,7 +1297,7 @@ void MainWindow::handleRMBSpecialCommands(int id, TQMap<TQString, int> &commands
cmd->execute(); cmd->execute();
} }
} }
} else if (fw->mainContainer()->inherits("TQMainWindow")) { } else if (fw->mainContainer()->inherits(TQMAINWINDOW_OBJECT_NAME_STRING)) {
TQMainWindow *mw = (TQMainWindow*)fw->mainContainer(); TQMainWindow *mw = (TQMainWindow*)fw->mainContainer();
if (id == commands[ "add_toolbar" ]) { if (id == commands[ "add_toolbar" ]) {
AddToolBarCommand *cmd = new AddToolBarCommand(i18n("Add Toolbar to '%1'").arg(formWindow()->name()), formWindow(), mw); AddToolBarCommand *cmd = new AddToolBarCommand(i18n("Add Toolbar to '%1'").arg(formWindow()->name()), formWindow(), mw);
@ -1632,7 +1632,7 @@ bool MainWindow::openEditor(TQWidget* w, FormWindow*)
if (text && text->designable(w)) { if (text && text->designable(w)) {
bool ok = false; bool ok = false;
TQString text; TQString text;
if (w->inherits("TQTextView") || w->inherits("TQLabel")) { if (w->inherits(TQTEXTVIEW_OBJECT_NAME_STRING) || w->inherits(TQLABEL_OBJECT_NAME_STRING)) {
text = TextEditor::getText(this, w->property("text").toString()); text = TextEditor::getText(this, w->property("text").toString());
ok = !text.isEmpty(); ok = !text.isEmpty();
} else { } else {

@ -280,7 +280,7 @@ int MetaDataBase::spacing( TQObject *o )
if ( !o ) if ( !o )
return -1; return -1;
setupDataBase(); setupDataBase();
if ( o->inherits( "TQMainWindow" ) ) if ( o->inherits( TQMAINWINDOW_OBJECT_NAME_STRING ) )
o = ( (TQMainWindow*)o )->centralWidget(); o = ( (TQMainWindow*)o )->centralWidget();
MetaDataBaseRecord *r = db->find( (void*)o ); MetaDataBaseRecord *r = db->find( (void*)o );
if ( !r || !o->isWidgetType() ) { if ( !r || !o->isWidgetType() ) {
@ -318,7 +318,7 @@ int MetaDataBase::margin( TQObject *o )
if ( !o ) if ( !o )
return -1; return -1;
setupDataBase(); setupDataBase();
if ( o->inherits( "TQMainWindow" ) ) if ( o->inherits( TQMAINWINDOW_OBJECT_NAME_STRING ) )
o = ( (TQMainWindow*)o )->centralWidget(); o = ( (TQMainWindow*)o )->centralWidget();
MetaDataBaseRecord *r = db->find( (void*)o ); MetaDataBaseRecord *r = db->find( (void*)o );
if ( !r || !o->isWidgetType() ) { if ( !r || !o->isWidgetType() ) {

@ -25,7 +25,7 @@ PreviewWidget::PreviewWidget( TQWidget *parent, const char *name )
: PreviewWidgetBase( parent, name ) : PreviewWidgetBase( parent, name )
{ {
// install event filter on child widgets // install event filter on child widgets
TQObjectList *l = queryList("TQWidget"); TQObjectList *l = queryList(TQWIDGET_OBJECT_NAME_STRING);
TQObjectListIt it(*l); TQObjectListIt it(*l);
TQObject * obj; TQObject * obj;
while ((obj = it.current()) != 0) { while ((obj = it.current()) != 0) {

@ -842,7 +842,7 @@ QDateEdit *PropertyDateItem::lined()
if ( lin ) if ( lin )
return lin; return lin;
lin = new QDateEdit( listview->viewport() ); lin = new QDateEdit( listview->viewport() );
TQObjectList *l = lin->queryList( "TQLineEdit" ); TQObjectList *l = lin->queryList( TQLINEEDIT_OBJECT_NAME_STRING );
for ( TQObject *o = l->first(); o; o = l->next() ) for ( TQObject *o = l->first(); o; o = l->next() )
o->installEventFilter( listview ); o->installEventFilter( listview );
delete l; delete l;
@ -919,7 +919,7 @@ QTimeEdit *PropertyTimeItem::lined()
lin = new QTimeEdit( listview->viewport() ); lin = new QTimeEdit( listview->viewport() );
connect( lin, TQT_SIGNAL( valueChanged( const TQTime & ) ), connect( lin, TQT_SIGNAL( valueChanged( const TQTime & ) ),
this, TQT_SLOT( setValue() ) ); this, TQT_SLOT( setValue() ) );
TQObjectList *l = lin->queryList( "TQLineEdit" ); TQObjectList *l = lin->queryList( TQLINEEDIT_OBJECT_NAME_STRING );
for ( TQObject *o = l->first(); o; o = l->next() ) for ( TQObject *o = l->first(); o; o = l->next() )
o->installEventFilter( listview ); o->installEventFilter( listview );
delete l; delete l;
@ -994,7 +994,7 @@ QDateTimeEdit *PropertyDateTimeItem::lined()
lin = new QDateTimeEdit( listview->viewport() ); lin = new QDateTimeEdit( listview->viewport() );
connect( lin, TQT_SIGNAL( valueChanged( const TQDateTime & ) ), connect( lin, TQT_SIGNAL( valueChanged( const TQDateTime & ) ),
this, TQT_SLOT( setValue() ) ); this, TQT_SLOT( setValue() ) );
TQObjectList *l = lin->queryList( "TQLineEdit" ); TQObjectList *l = lin->queryList( TQLINEEDIT_OBJECT_NAME_STRING );
for ( TQObject *o = l->first(); o; o = l->next() ) for ( TQObject *o = l->first(); o; o = l->next() )
o->installEventFilter( listview ); o->installEventFilter( listview );
delete l; delete l;
@ -1163,7 +1163,7 @@ TQSpinBox *PropertyIntItem::spinBox()
spinBx = new TQSpinBox( 0, INT_MAX, 1, listview->viewport() ); spinBx = new TQSpinBox( 0, INT_MAX, 1, listview->viewport() );
spinBx->hide(); spinBx->hide();
spinBx->installEventFilter( listview ); spinBx->installEventFilter( listview );
TQObjectList *ol = spinBx->queryList( "TQLineEdit" ); TQObjectList *ol = spinBx->queryList( TQLINEEDIT_OBJECT_NAME_STRING );
if ( ol && ol->first() ) if ( ol && ol->first() )
ol->first()->installEventFilter( listview ); ol->first()->installEventFilter( listview );
delete ol; delete ol;
@ -1256,7 +1256,7 @@ TQComboBox *PropertyListItem::combo()
this, TQT_SLOT( setValue() ) ); this, TQT_SLOT( setValue() ) );
comb->installEventFilter( listview ); comb->installEventFilter( listview );
if ( editable ) { if ( editable ) {
TQObjectList *ol = comb->queryList( "TQLineEdit" ); TQObjectList *ol = comb->queryList( TQLINEEDIT_OBJECT_NAME_STRING );
if ( ol && ol->first() ) if ( ol && ol->first() )
ol->first()->installEventFilter( listview ); ol->first()->installEventFilter( listview );
delete ol; delete ol;
@ -2194,7 +2194,7 @@ void PropertyPaletteItem::getPalette()
return; return;
bool ok = false; bool ok = false;
TQWidget *w = (TQWidget*)listview->propertyEditor()->widget(); TQWidget *w = (TQWidget*)listview->propertyEditor()->widget();
if ( w->inherits( "TQScrollView" ) ) if ( w->inherits( TQSCROLLVIEW_OBJECT_NAME_STRING ) )
w = ( (TQScrollView*)w )->viewport(); w = ( (TQScrollView*)w )->viewport();
TQPalette pal = PaletteEditor::getPalette( &ok, val.toPalette(), TQPalette pal = PaletteEditor::getPalette( &ok, val.toPalette(),
#if defined(QT_NON_COMMERCIAL) #if defined(QT_NON_COMMERCIAL)
@ -2500,7 +2500,7 @@ static TQVariant::Type type_to_variant( const TQString &s )
#ifndef QT_NO_SQL #ifndef QT_NO_SQL
static bool parent_is_data_aware( TQObject *o ) static bool parent_is_data_aware( TQObject *o )
{ {
if ( !o->inherits( "TQWidget" ) ) if ( !o->inherits( TQWIDGET_OBJECT_NAME_STRING ) )
return false; return false;
TQWidget *w = (TQWidget*)o; TQWidget *w = (TQWidget*)o;
TQWidget *p = w->parentWidget(); TQWidget *p = w->parentWidget();
@ -2618,7 +2618,7 @@ void PropertyList::setupProperties()
continue; continue;
} }
} }
if ( w->inherits( "TQActionGroup" ) ) { if ( w->inherits( TQACTIONGROUP_OBJECT_NAME_STRING ) ) {
if ( qstrcmp( p->name(), "usesDropDown" ) == 0 ) if ( qstrcmp( p->name(), "usesDropDown" ) == 0 )
continue; continue;
if ( qstrcmp( p->name(), "toggleAction" ) == 0 ) if ( qstrcmp( p->name(), "toggleAction" ) == 0 )
@ -2635,7 +2635,7 @@ void PropertyList::setupProperties()
if ( qstrcmp( p->name(), "buttonGroupId" ) == 0 ) { // #### remove this when designable in Q_PROPERTY can take a function (isInButtonGroup() in this case) if ( qstrcmp( p->name(), "buttonGroupId" ) == 0 ) { // #### remove this when designable in Q_PROPERTY can take a function (isInButtonGroup() in this case)
if ( !editor->widget()->isWidgetType() || if ( !editor->widget()->isWidgetType() ||
!editor->widget()->parent() || !editor->widget()->parent() ||
!editor->widget()->parent()->inherits( "TQButtonGroup" ) ) !editor->widget()->parent()->inherits( TQBUTTONGROUP_OBJECT_NAME_STRING ) )
continue; continue;
} }
@ -2654,7 +2654,7 @@ void PropertyList::setupProperties()
setPropertyValue( item ); setPropertyValue( item );
if ( MetaDataBase::isPropertyChanged( editor->widget(), "hAlign" ) ) if ( MetaDataBase::isPropertyChanged( editor->widget(), "hAlign" ) )
item->setChanged( true, false ); item->setChanged( true, false );
if ( !editor->widget()->inherits( "TQMultiLineEdit" ) ) { if ( !editor->widget()->inherits( TQMULTILINEEDIT_OBJECT_NAME_STRING ) ) {
lst.clear(); lst.clear();
lst << p->valueToKey( AlignTop ) lst << p->valueToKey( AlignTop )
<< p->valueToKey( AlignVCenter ) << p->valueToKey( AlignVCenter )
@ -2665,7 +2665,7 @@ void PropertyList::setupProperties()
if ( MetaDataBase::isPropertyChanged( editor->widget(), "vAlign" ) ) if ( MetaDataBase::isPropertyChanged( editor->widget(), "vAlign" ) )
item->setChanged( true, false ); item->setChanged( true, false );
item = new PropertyBoolItem( this, item, 0, "wordwrap" ); item = new PropertyBoolItem( this, item, 0, "wordwrap" );
if ( w->inherits( "TQGroupBox" ) ) if ( w->inherits( TQGROUPBOX_OBJECT_NAME_STRING ) )
item->setVisible( false ); item->setVisible( false );
setPropertyValue( item ); setPropertyValue( item );
if ( MetaDataBase::isPropertyChanged( editor->widget(), "wordwrap" ) ) if ( MetaDataBase::isPropertyChanged( editor->widget(), "wordwrap" ) )
@ -2702,7 +2702,7 @@ void PropertyList::setupProperties()
} }
} }
if ( !w->inherits( "TQSplitter" ) && !w->inherits( "QDesignerMenuBar" ) && !w->inherits( "QDesignerToolBar" ) && if ( !w->inherits( TQSPLITTER_OBJECT_NAME_STRING ) && !w->inherits( "QDesignerMenuBar" ) && !w->inherits( "QDesignerToolBar" ) &&
w->isWidgetType() && WidgetFactory::layoutType( (TQWidget*)w ) != WidgetFactory::NoLayout ) { w->isWidgetType() && WidgetFactory::layoutType( (TQWidget*)w ) != WidgetFactory::NoLayout ) {
item = new PropertyIntItem( this, item, 0, "layoutSpacing", true ); item = new PropertyIntItem( this, item, 0, "layoutSpacing", true );
setPropertyValue( item ); setPropertyValue( item );
@ -2713,7 +2713,7 @@ void PropertyList::setupProperties()
} }
if ( !w->inherits( "Spacer" ) && !w->inherits( "QLayoutWidget" ) && !w->inherits( "TQAction" ) && if ( !w->inherits( "Spacer" ) && !w->inherits( "QLayoutWidget" ) && !w->inherits( TQACTION_OBJECT_NAME_STRING ) &&
!w->inherits( "QDesignerMenuBar" ) && !w->inherits( "QDesignerToolBar" ) ) { !w->inherits( "QDesignerMenuBar" ) && !w->inherits( "QDesignerToolBar" ) ) {
item = new PropertyTextItem( this, item, 0, "toolTip", true, false ); item = new PropertyTextItem( this, item, 0, "toolTip", true, false );
setPropertyValue( item ); setPropertyValue( item );
@ -2726,15 +2726,15 @@ void PropertyList::setupProperties()
} }
#ifndef QT_NO_SQL #ifndef QT_NO_SQL
if ( !editor->widget()->inherits( "TQDataTable" ) && !editor->widget()->inherits( "TQDataBrowser" ) && if ( !editor->widget()->inherits( TQDATATABLE_OBJECT_NAME_STRING ) && !editor->widget()->inherits( TQDATABROWSER_OBJECT_NAME_STRING ) &&
!editor->widget()->inherits( "TQDataView" ) && parent_is_data_aware( editor->widget() ) ) { !editor->widget()->inherits( TQDATAVIEW_OBJECT_NAME_STRING ) && parent_is_data_aware( editor->widget() ) ) {
item = new PropertyDatabaseItem( this, item, 0, "database", editor->formWindow()->mainContainer() != w ); item = new PropertyDatabaseItem( this, item, 0, "database", editor->formWindow()->mainContainer() != w );
setPropertyValue( item ); setPropertyValue( item );
if ( MetaDataBase::isPropertyChanged( editor->widget(), "database" ) ) if ( MetaDataBase::isPropertyChanged( editor->widget(), "database" ) )
item->setChanged( true, false ); item->setChanged( true, false );
} }
if ( editor->widget()->inherits( "TQDataTable" ) || editor->widget()->inherits( "TQDataBrowser" ) || editor->widget()->inherits( "TQDataView" ) ) { if ( editor->widget()->inherits( TQDATATABLE_OBJECT_NAME_STRING ) || editor->widget()->inherits( TQDATABROWSER_OBJECT_NAME_STRING ) || editor->widget()->inherits( TQDATAVIEW_OBJECT_NAME_STRING ) ) {
item = new PropertyDatabaseItem( this, item, 0, "database", false ); item = new PropertyDatabaseItem( this, item, 0, "database", false );
setPropertyValue( item ); setPropertyValue( item );
if ( MetaDataBase::isPropertyChanged( editor->widget(), "database" ) ) if ( MetaDataBase::isPropertyChanged( editor->widget(), "database" ) )
@ -2780,7 +2780,7 @@ bool PropertyList::addPropertyItem( PropertyItem *&item, const TQCString &name,
switch ( t ) { switch ( t ) {
case TQVariant::String: case TQVariant::String:
item = new PropertyTextItem( this, item, 0, name, true, item = new PropertyTextItem( this, item, 0, name, true,
editor->widget()->inherits( "TQLabel" ) || editor->widget()->inherits( "TQTextView" ) ); editor->widget()->inherits( TQLABEL_OBJECT_NAME_STRING ) || editor->widget()->inherits( TQTEXTVIEW_OBJECT_NAME_STRING ) );
break; break;
case TQVariant::CString: case TQVariant::CString:
item = new PropertyTextItem( this, item, 0, item = new PropertyTextItem( this, item, 0,
@ -2928,8 +2928,8 @@ bool PropertyList::eventFilter( TQObject *o, TQEvent *e )
!( ke->state() & ControlButton ) ) { !( ke->state() & ControlButton ) ) {
TQApplication::sendEvent( this, (TQKeyEvent*)e ); TQApplication::sendEvent( this, (TQKeyEvent*)e );
return true; return true;
} else if ( ( !o->inherits( "TQLineEdit" ) || } else if ( ( !o->inherits( TQLINEEDIT_OBJECT_NAME_STRING ) ||
( o->inherits( "TQLineEdit" ) && ( (TQLineEdit*)o )->isReadOnly() ) ) && ( o->inherits( TQLINEEDIT_OBJECT_NAME_STRING ) && ( (TQLineEdit*)o )->isReadOnly() ) ) &&
i && i->hasSubItems() ) { i && i->hasSubItems() ) {
if ( !i->isOpen() && if ( !i->isOpen() &&
( ke->key() == Key_Plus || ( ke->key() == Key_Plus ||
@ -2939,12 +2939,12 @@ bool PropertyList::eventFilter( TQObject *o, TQEvent *e )
( ke->key() == Key_Minus || ( ke->key() == Key_Minus ||
ke->key() == Key_Left ) ) ke->key() == Key_Left ) )
i->setOpen( false ); i->setOpen( false );
} else if ( ( ke->key() == Key_Return || ke->key() == Key_Enter ) && o->inherits( "TQComboBox" ) ) { } else if ( ( ke->key() == Key_Return || ke->key() == Key_Enter ) && o->inherits( TQCOMBOBOX_OBJECT_NAME_STRING ) ) {
TQKeyEvent ke2( TQEvent::KeyPress, Key_Space, 0, 0 ); TQKeyEvent ke2( TQEvent::KeyPress, Key_Space, 0, 0 );
TQApplication::sendEvent( o, &ke2 ); TQApplication::sendEvent( o, &ke2 );
return true; return true;
} }
} else if ( e->type() == TQEvent::FocusOut && o->inherits( "TQLineEdit" ) && editor->formWindow() ) { } else if ( e->type() == TQEvent::FocusOut && o->inherits( TQLINEEDIT_OBJECT_NAME_STRING ) && editor->formWindow() ) {
TQTimer::singleShot( 100, editor->formWindow()->commandHistory(), TQT_SLOT( checkCompressedCommand() ) ); TQTimer::singleShot( 100, editor->formWindow()->commandHistory(), TQT_SLOT( checkCompressedCommand() ) );
} else if ( o == viewport() ) { } else if ( o == viewport() ) {
TQMouseEvent *me; TQMouseEvent *me;

@ -440,13 +440,13 @@ bool Resource::save( TQIODevice* dev )
ts << "<!DOCTYPE UI><UI version=\"3.0\" stdsetdef=\"1\">" << endl; ts << "<!DOCTYPE UI><UI version=\"3.0\" stdsetdef=\"1\">" << endl;
saveMetaInfoBefore( ts, 0 ); saveMetaInfoBefore( ts, 0 );
saveObject( formwindow->mainContainer(), 0, ts, 0 ); saveObject( formwindow->mainContainer(), 0, ts, 0 );
if ( formwindow->mainContainer()->inherits( "TQMainWindow" ) ) { if ( formwindow->mainContainer()->inherits( TQMAINWINDOW_OBJECT_NAME_STRING ) ) {
saveMenuBar( (TQMainWindow*)formwindow->mainContainer(), ts, 0 ); saveMenuBar( (TQMainWindow*)formwindow->mainContainer(), ts, 0 );
saveToolBars( (TQMainWindow*)formwindow->mainContainer(), ts, 0 ); saveToolBars( (TQMainWindow*)formwindow->mainContainer(), ts, 0 );
} }
if ( !MetaDataBase::customWidgets()->isEmpty() && !usedCustomWidgets.isEmpty() ) if ( !MetaDataBase::customWidgets()->isEmpty() && !usedCustomWidgets.isEmpty() )
saveCustomWidgets( ts, 0 ); saveCustomWidgets( ts, 0 );
if ( formwindow->mainContainer()->inherits( "TQMainWindow" ) ) if ( formwindow->mainContainer()->inherits( TQMAINWINDOW_OBJECT_NAME_STRING ) )
saveActions( formwindow->actionList(), ts, 0 ); saveActions( formwindow->actionList(), ts, 0 );
if ( !images.isEmpty() ) if ( !images.isEmpty() )
saveImageCollection( ts, 0 ); saveImageCollection( ts, 0 );
@ -615,9 +615,9 @@ void Resource::saveObject( TQObject *obj, QDesignerGridLayout* grid, TQTextStrea
return; return;
} }
if ( obj->inherits( "TQTabWidget" ) ) { if ( obj->inherits( TQTABWIDGET_OBJECT_NAME_STRING ) ) {
TQTabWidget* tw = (TQTabWidget*) obj; TQTabWidget* tw = (TQTabWidget*) obj;
TQObjectList* tmpl = tw->queryList( "TQWidgetStack" ); TQObjectList* tmpl = tw->queryList( TQWIDGETSTACK_OBJECT_NAME_STRING );
TQWidgetStack *ws = (TQWidgetStack*)tmpl->first(); TQWidgetStack *ws = (TQWidgetStack*)tmpl->first();
TQTabBar *tb = ( (QDesignerTabWidget*)obj )->tabBar(); TQTabBar *tb = ( (QDesignerTabWidget*)obj )->tabBar();
for ( int i = 0; i < tb->count(); ++i ) { for ( int i = 0; i < tb->count(); ++i ) {
@ -678,7 +678,7 @@ void Resource::saveObject( TQObject *obj, QDesignerGridLayout* grid, TQTextStrea
ts << makeIndent( indent ) << "</widget>" << endl; ts << makeIndent( indent ) << "</widget>" << endl;
} }
} }
else if ( obj->inherits( "TQWizard" ) ) { else if ( obj->inherits( TQWIZARD_OBJECT_NAME_STRING ) ) {
TQWizard* wiz = (TQWizard*)obj; for ( int i = 0; i < wiz->pageCount(); ++i ) { TQWizard* wiz = (TQWizard*)obj; for ( int i = 0; i < wiz->pageCount(); ++i ) {
TQWidget *w = wiz->page( i ); TQWidget *w = wiz->page( i );
if ( !w ) if ( !w )
@ -702,7 +702,7 @@ void Resource::saveObject( TQObject *obj, QDesignerGridLayout* grid, TQTextStrea
--indent; --indent;
ts << makeIndent( indent ) << "</widget>" << endl; ts << makeIndent( indent ) << "</widget>" << endl;
} }
} else if ( obj->inherits( "TQMainWindow" ) ) { } else if ( obj->inherits( TQMAINWINDOW_OBJECT_NAME_STRING ) ) {
saveChildrenOf( ( (TQMainWindow*)obj )->centralWidget(), ts, indent ); saveChildrenOf( ( (TQMainWindow*)obj )->centralWidget(), ts, indent );
} else { } else {
saveChildrenOf( obj, ts, indent ); saveChildrenOf( obj, ts, indent );
@ -714,9 +714,9 @@ void Resource::saveObject( TQObject *obj, QDesignerGridLayout* grid, TQTextStrea
void Resource::saveItems( TQObject *obj, TQTextStream &ts, int indent ) void Resource::saveItems( TQObject *obj, TQTextStream &ts, int indent )
{ {
if ( obj->inherits( "TQListBox" ) || obj->inherits( "TQComboBox" ) ) { if ( obj->inherits( TQLISTBOX_OBJECT_NAME_STRING ) || obj->inherits( TQCOMBOBOX_OBJECT_NAME_STRING ) ) {
TQListBox *lb = 0; TQListBox *lb = 0;
if ( obj->inherits( "TQListBox" ) ) if ( obj->inherits( TQLISTBOX_OBJECT_NAME_STRING ) )
lb = (TQListBox*)obj; lb = (TQListBox*)obj;
else else
lb = ( (TQComboBox*)obj )->listBox(); lb = ( (TQComboBox*)obj )->listBox();
@ -734,7 +734,7 @@ void Resource::saveItems( TQObject *obj, TQTextStream &ts, int indent )
indent--; indent--;
ts << makeIndent( indent ) << "</item>" << endl; ts << makeIndent( indent ) << "</item>" << endl;
} }
} else if ( obj->inherits( "TQIconView" ) ) { } else if ( obj->inherits( TQICONVIEW_OBJECT_NAME_STRING ) ) {
TQIconView *iv = (TQIconView*)obj; TQIconView *iv = (TQIconView*)obj;
TQIconViewItem *i = iv->firstItem(); TQIconViewItem *i = iv->firstItem();
@ -750,7 +750,7 @@ void Resource::saveItems( TQObject *obj, TQTextStream &ts, int indent )
indent--; indent--;
ts << makeIndent( indent ) << "</item>" << endl; ts << makeIndent( indent ) << "</item>" << endl;
} }
} else if ( obj->inherits( "TQListView" ) ) { } else if ( obj->inherits( TQLISTVIEW_OBJECT_NAME_STRING ) ) {
TQListView *lv = (TQListView*)obj; TQListView *lv = (TQListView*)obj;
int i; int i;
for ( i = 0; i < lv->header()->count(); ++i ) { for ( i = 0; i < lv->header()->count(); ++i ) {
@ -779,11 +779,11 @@ void Resource::saveItems( TQObject *obj, TQTextStream &ts, int indent )
saveItem( lv->firstChild(), ts, indent - 1 ); saveItem( lv->firstChild(), ts, indent - 1 );
} }
#ifndef QT_NO_TABLE #ifndef QT_NO_TABLE
else if ( obj->inherits( "TQTable" ) ) { else if ( obj->inherits( TQTABLE_OBJECT_NAME_STRING ) ) {
TQTable *table = (TQTable*)obj; TQTable *table = (TQTable*)obj;
int i; int i;
TQMap<TQString, TQString> columnFields = MetaDataBase::columnFields( table ); TQMap<TQString, TQString> columnFields = MetaDataBase::columnFields( table );
bool isDataTable = table->inherits( "TQDataTable" ); bool isDataTable = table->inherits( TQDATATABLE_OBJECT_NAME_STRING );
for ( i = 0; i < table->horizontalHeader()->count(); ++i ) { for ( i = 0; i < table->horizontalHeader()->count(); ++i ) {
if ( !table->horizontalHeader()->label( i ).isNull() && if ( !table->horizontalHeader()->label( i ).isNull() &&
table->horizontalHeader()->label( i ).toInt() != i + 1 || table->horizontalHeader()->label( i ).toInt() != i + 1 ||
@ -798,7 +798,7 @@ void Resource::saveItems( TQObject *obj, TQTextStream &ts, int indent )
if ( table->horizontalHeader()->iconSet( i ) ) if ( table->horizontalHeader()->iconSet( i ) )
pix.append( new TQPixmap( table->horizontalHeader()->iconSet( i )->pixmap() ) ); pix.append( new TQPixmap( table->horizontalHeader()->iconSet( i )->pixmap() ) );
saveItem( l, pix, ts, indent ); saveItem( l, pix, ts, indent );
if ( table->inherits( "TQDataTable" ) && !columnFields.isEmpty() ) { if ( table->inherits( TQDATATABLE_OBJECT_NAME_STRING ) && !columnFields.isEmpty() ) {
ts << makeIndent( indent ) << "<property name=\"field\">" << endl; ts << makeIndent( indent ) << "<property name=\"field\">" << endl;
indent++; indent++;
ts << makeIndent( indent ) << "<string>" << entitize( *columnFields.find( l[ 0 ] ) ) << "</string>" << endl; ts << makeIndent( indent ) << "<string>" << entitize( *columnFields.find( l[ 0 ] ) ) << "</string>" << endl;
@ -937,7 +937,7 @@ void Resource::saveChildrenOf( TQObject* obj, TQTextStream &ts, int indent )
// if the widget has a layout we pretend that all widget's childs are childs of the layout - makes the structure nicer // if the widget has a layout we pretend that all widget's childs are childs of the layout - makes the structure nicer
TQLayout *layout = 0; TQLayout *layout = 0;
QDesignerGridLayout* grid = 0; QDesignerGridLayout* grid = 0;
if ( !obj->inherits( "TQSplitter" ) && if ( !obj->inherits( TQSPLITTER_OBJECT_NAME_STRING ) &&
WidgetDatabase::isContainer( WidgetDatabase::idFromClassName( WidgetFactory::classNameOf( obj ) ) ) && WidgetDatabase::isContainer( WidgetDatabase::idFromClassName( WidgetFactory::classNameOf( obj ) ) ) &&
obj->isWidgetType() && obj->isWidgetType() &&
WidgetFactory::layoutType( (TQWidget*)obj, layout ) != WidgetFactory::NoLayout ) { WidgetFactory::layoutType( (TQWidget*)obj, layout ) != WidgetFactory::NoLayout ) {
@ -989,7 +989,7 @@ void Resource::saveObjectProperties( TQObject *w, TQTextStream &ts, int indent )
if ( !changed.contains( "geometry" ) ) if ( !changed.contains( "geometry" ) )
changed << "geometry"; changed << "geometry";
} }
} else if ( w->inherits( "TQLayout" ) ) { // #### should be cleaner (RS) } else if ( w->inherits( TQLAYOUT_OBJECT_NAME_STRING ) ) { // #### should be cleaner (RS)
changed << "margin" << "spacing"; changed << "margin" << "spacing";
} }
@ -1017,7 +1017,7 @@ void Resource::saveObjectProperties( TQObject *w, TQTextStream &ts, int indent )
property( w->metaObject()->findProperty( it.current(), true ), true ); property( w->metaObject()->findProperty( it.current(), true ), true );
if ( !p || !p->stored( w ) || ( inLayout && qstrcmp( p->name(), "geometry" ) == 0 ) ) if ( !p || !p->stored( w ) || ( inLayout && qstrcmp( p->name(), "geometry" ) == 0 ) )
continue; continue;
if ( w->inherits( "TQLabel" ) && qstrcmp( p->name(), "pixmap" ) == 0 && if ( w->inherits( TQLABEL_OBJECT_NAME_STRING ) && qstrcmp( p->name(), "pixmap" ) == 0 &&
( !( (TQLabel*)w )->pixmap() || ( (TQLabel*)w )->pixmap()->isNull() ) ) ( !( (TQLabel*)w )->pixmap() || ( (TQLabel*)w )->pixmap()->isNull() ) )
continue; continue;
if ( w->inherits( "QDesignerMenuBar" ) && if ( w->inherits( "QDesignerMenuBar" ) &&
@ -1106,7 +1106,7 @@ void Resource::saveProperty( TQObject *w, const TQString &name, const TQVariant
break; break;
case TQVariant::Int: case TQVariant::Int:
num = value.toInt(); num = value.toInt();
if ( w && w->inherits( "TQLayout" ) ) { if ( w && w->inherits( TQLAYOUT_OBJECT_NAME_STRING ) ) {
if ( name == "spacing" ) if ( name == "spacing" )
num = MetaDataBase::spacing( WidgetFactory::containerOfWidget( WidgetFactory::layoutParent( (TQLayout*)w ) ) ); num = MetaDataBase::spacing( WidgetFactory::containerOfWidget( WidgetFactory::layoutParent( (TQLayout*)w ) ) );
else if ( name == "margin" ) else if ( name == "margin" )
@ -1124,7 +1124,7 @@ void Resource::saveProperty( TQObject *w, const TQString &name, const TQVariant
break; break;
case TQVariant::UInt: case TQVariant::UInt:
unum = value.toUInt(); unum = value.toUInt();
if ( w && w->inherits( "TQLayout" ) ) { if ( w && w->inherits( TQLAYOUT_OBJECT_NAME_STRING ) ) {
if ( name == "spacing" ) if ( name == "spacing" )
num = MetaDataBase::spacing( WidgetFactory::layoutParent( (TQLayout*)w ) ); num = MetaDataBase::spacing( WidgetFactory::layoutParent( (TQLayout*)w ) );
else if ( name == "margin" ) else if ( name == "margin" )
@ -1332,7 +1332,7 @@ TQObject *Resource::createObject( const TQDomElement &e, TQWidget *parent, TQLay
if ( colspan < 1 ) if ( colspan < 1 )
colspan = 1; colspan = 1;
TQString className = e.attribute( "class", "TQWidget" ); TQString className = e.attribute( "class", TQWIDGET_OBJECT_NAME_STRING );
if ( !className.isNull() ) { if ( !className.isNull() ) {
obj = WidgetFactory::create( WidgetDatabase::idFromClassName( className ), parent, 0, false ); obj = WidgetFactory::create( WidgetDatabase::idFromClassName( className ), parent, 0, false );
@ -1344,7 +1344,7 @@ TQObject *Resource::createObject( const TQDomElement &e, TQWidget *parent, TQLay
mainContainerSet = true; mainContainerSet = true;
} }
w = (TQWidget*)obj; w = (TQWidget*)obj;
if ( w->inherits( "TQMainWindow" ) ) if ( w->inherits( TQMAINWINDOW_OBJECT_NAME_STRING ) )
w = ( (TQMainWindow*)w )->centralWidget(); w = ( (TQMainWindow*)w )->centralWidget();
if ( layout ) { if ( layout ) {
switch ( WidgetFactory::layoutType( layout ) ) { switch ( WidgetFactory::layoutType( layout ) ) {
@ -1368,9 +1368,9 @@ TQObject *Resource::createObject( const TQDomElement &e, TQWidget *parent, TQLay
layout = 0; layout = 0;
if ( w && formwindow ) { if ( w && formwindow ) {
if ( !parent || ( !parent->inherits( "TQToolBox" ) && !parent->inherits( "TQTabWidget" ) && !parent->inherits( "TQWizard" ) ) ) if ( !parent || ( !parent->inherits( TQTOOLBOX_OBJECT_NAME_STRING ) && !parent->inherits( TQTABWIDGET_OBJECT_NAME_STRING ) && !parent->inherits( TQWIZARD_OBJECT_NAME_STRING ) ) )
formwindow->insertWidget( w, pasting ); formwindow->insertWidget( w, pasting );
else if ( parent && ( parent->inherits( "TQToolBox" ) || parent->inherits( "TQTabWidget" ) || parent->inherits( "TQWizard" ) ) ) else if ( parent && ( parent->inherits( TQTOOLBOX_OBJECT_NAME_STRING ) || parent->inherits( TQTABWIDGET_OBJECT_NAME_STRING ) || parent->inherits( TQWIZARD_OBJECT_NAME_STRING ) ) )
MetaDataBase::addEntry( w ); MetaDataBase::addEntry( w );
if (w->inherits("Dialog")) if (w->inherits("Dialog"))
dynamic_cast<Dialog*>(w)->setUseInternalParser(false); dynamic_cast<Dialog*>(w)->setUseInternalParser(false);
@ -1402,14 +1402,14 @@ TQObject *Resource::createObject( const TQDomElement &e, TQWidget *parent, TQLay
} else if ( n.tagName() == "attribute" && w ) { } else if ( n.tagName() == "attribute" && w ) {
TQString attrib = n.attribute( "name" ); TQString attrib = n.attribute( "name" );
TQVariant v = DomTool::elementToVariant( n.firstChild().toElement(), TQVariant() ); TQVariant v = DomTool::elementToVariant( n.firstChild().toElement(), TQVariant() );
if ( parent->inherits( "TQTabWidget" ) ) { if ( parent->inherits( TQTABWIDGET_OBJECT_NAME_STRING ) ) {
if ( attrib == "title" ) if ( attrib == "title" )
( (TQTabWidget*)parent )->insertTab( w, v.toString() ); ( (TQTabWidget*)parent )->insertTab( w, v.toString() );
} else } else
if ( parent->inherits( "TQToolBox" ) ) { if ( parent->inherits( TQTOOLBOX_OBJECT_NAME_STRING ) ) {
if ( attrib == "label" ) if ( attrib == "label" )
( (TQToolBox*)parent )->addItem( w, v.toString() ); ( (TQToolBox*)parent )->addItem( w, v.toString() );
} else if ( parent->inherits( "TQWizard" ) ) { } else if ( parent->inherits( TQWIZARD_OBJECT_NAME_STRING ) ) {
if ( attrib == "title" ) if ( attrib == "title" )
( (TQWizard*)parent )->addPage( w, v.toString() ); ( (TQWizard*)parent )->addPage( w, v.toString() );
} }
@ -1436,7 +1436,7 @@ void Resource::createColumn( const TQDomElement &e, TQWidget *widget )
if ( !widget ) if ( !widget )
return; return;
if ( widget->inherits( "TQListView" ) && e.tagName() == "column" ) { if ( widget->inherits( TQLISTVIEW_OBJECT_NAME_STRING ) && e.tagName() == "column" ) {
TQListView *lv = (TQListView*)widget; TQListView *lv = (TQListView*)widget;
TQDomElement n = e.firstChild().toElement(); TQDomElement n = e.firstChild().toElement();
TQPixmap pix; TQPixmap pix;
@ -1470,7 +1470,7 @@ void Resource::createColumn( const TQDomElement &e, TQWidget *widget )
lv->header()->setResizeEnabled( resizeable, i ); lv->header()->setResizeEnabled( resizeable, i );
} }
#ifndef QT_NO_TABLE #ifndef QT_NO_TABLE
else if ( widget->inherits( "TQTable" ) ) { else if ( widget->inherits( TQTABLE_OBJECT_NAME_STRING ) ) {
TQTable *table = (TQTable*)widget; TQTable *table = (TQTable*)widget;
bool isRow; bool isRow;
if ( ( isRow = e.tagName() == "row" ) ) if ( ( isRow = e.tagName() == "row" ) )
@ -1537,14 +1537,14 @@ void Resource::createItem( const TQDomElement &e, TQWidget *widget, TQListViewIt
if ( !widget || !WidgetFactory::hasItems( WidgetDatabase::idFromClassName( WidgetFactory::classNameOf( widget ) ) ) ) if ( !widget || !WidgetFactory::hasItems( WidgetDatabase::idFromClassName( WidgetFactory::classNameOf( widget ) ) ) )
return; return;
if ( widget->inherits( "TQListBox" ) || widget->inherits( "TQComboBox" ) ) { if ( widget->inherits( TQLISTBOX_OBJECT_NAME_STRING ) || widget->inherits( TQCOMBOBOX_OBJECT_NAME_STRING ) ) {
TQDomElement n = e.firstChild().toElement(); TQDomElement n = e.firstChild().toElement();
TQPixmap pix; TQPixmap pix;
bool hasPixmap = false; bool hasPixmap = false;
TQString txt; TQString txt;
loadItem( n, pix, txt, hasPixmap ); loadItem( n, pix, txt, hasPixmap );
TQListBox *lb = 0; TQListBox *lb = 0;
if ( widget->inherits( "TQListBox" ) ) if ( widget->inherits( TQLISTBOX_OBJECT_NAME_STRING ) )
lb = (TQListBox*)widget; lb = (TQListBox*)widget;
else else
lb = ( (TQComboBox*)widget)->listBox(); lb = ( (TQComboBox*)widget)->listBox();
@ -1553,7 +1553,7 @@ void Resource::createItem( const TQDomElement &e, TQWidget *widget, TQListViewIt
} else { } else {
new TQListBoxText( lb, txt ); new TQListBoxText( lb, txt );
} }
} else if ( widget->inherits( "TQIconView" ) ) { } else if ( widget->inherits( TQICONVIEW_OBJECT_NAME_STRING ) ) {
TQDomElement n = e.firstChild().toElement(); TQDomElement n = e.firstChild().toElement();
TQPixmap pix; TQPixmap pix;
bool hasPixmap = false; bool hasPixmap = false;
@ -1562,7 +1562,7 @@ void Resource::createItem( const TQDomElement &e, TQWidget *widget, TQListViewIt
TQIconView *iv = (TQIconView*)widget; TQIconView *iv = (TQIconView*)widget;
new TQIconViewItem( iv, txt, pix ); new TQIconViewItem( iv, txt, pix );
} else if ( widget->inherits( "TQListView" ) ) { } else if ( widget->inherits( TQLISTVIEW_OBJECT_NAME_STRING ) ) {
TQDomElement n = e.firstChild().toElement(); TQDomElement n = e.firstChild().toElement();
TQPixmap pix; TQPixmap pix;
TQValueList<TQPixmap> pixmaps; TQValueList<TQPixmap> pixmaps;
@ -1630,7 +1630,7 @@ TQWidget *Resource::createSpacer( const TQDomElement &e, TQWidget *parent, TQLay
if ( formwindow ) if ( formwindow )
formwindow->insertWidget( spacer, pasting ); formwindow->insertWidget( spacer, pasting );
if ( layout ) { if ( layout ) {
if ( layout->inherits( "TQBoxLayout" ) ) if ( layout->inherits( TQBOXLAYOUT_OBJECT_NAME_STRING ) )
( (TQBoxLayout*)layout )->addWidget( spacer, 0, spacer->alignment() ); ( (TQBoxLayout*)layout )->addWidget( spacer, 0, spacer->alignment() );
else else
( (QDesignerGridLayout*)layout )->addMultiCellWidget( spacer, row, row + rowspan - 1, col, col + colspan - 1, ( (QDesignerGridLayout*)layout )->addMultiCellWidget( spacer, row, row + rowspan - 1, col, col + colspan - 1,
@ -1646,7 +1646,7 @@ void Resource::setObjectProperty( TQObject* obj, const TQString &prop, const TQD
{ {
const TQMetaProperty *p = obj->metaObject()->property( obj->metaObject()->findProperty( prop, true ), true ); const TQMetaProperty *p = obj->metaObject()->property( obj->metaObject()->findProperty( prop, true ), true );
if ( !obj->inherits( "TQLayout" ) ) {// no layouts in metadatabase... (RS) if ( !obj->inherits( TQLAYOUT_OBJECT_NAME_STRING ) ) {// no layouts in metadatabase... (RS)
if ( obj->inherits( "CustomWidget" ) ) { if ( obj->inherits( "CustomWidget" ) ) {
MetaDataBase::CustomWidget *cw = ( (CustomWidget*)obj )->customWidget(); MetaDataBase::CustomWidget *cw = ( (CustomWidget*)obj )->customWidget();
if ( cw && !cw->hasProperty( prop.latin1() ) && !p && prop != "toolTip" && prop != "whatsThis" ) if ( cw && !cw->hasProperty( prop.latin1() ) && !p && prop != "toolTip" && prop != "whatsThis" )
@ -1754,7 +1754,7 @@ void Resource::setObjectProperty( TQObject* obj, const TQString &prop, const TQD
} }
} }
if ( obj->inherits( "TQLayout" ) ) { if ( obj->inherits( TQLAYOUT_OBJECT_NAME_STRING ) ) {
if ( prop == "spacing" ) { if ( prop == "spacing" ) {
MetaDataBase::setSpacing( WidgetFactory::containerOfWidget( WidgetFactory::layoutParent( (TQLayout*)obj ) ), v.toInt() ); MetaDataBase::setSpacing( WidgetFactory::containerOfWidget( WidgetFactory::layoutParent( (TQLayout*)obj ) ), v.toInt() );
return; return;
@ -1955,7 +1955,7 @@ void Resource::saveConnections( TQTextStream &ts, int indent )
TQString lang = formwindow->project()->language(); TQString lang = formwindow->project()->language();
LanguageInterface *iface = langIface; LanguageInterface *iface = langIface;
if ( iface && MetaDataBase::hasEvents( lang ) ) { if ( iface && MetaDataBase::hasEvents( lang ) ) {
TQObjectList *l = formwindow->queryList( "TQWidget" ); TQObjectList *l = formwindow->queryList( TQWIDGET_OBJECT_NAME_STRING );
l->append( formwindow ); l->append( formwindow );
TQPtrList<TQAction> lst = formwindow->actionList(); TQPtrList<TQAction> lst = formwindow->actionList();
for ( TQAction *a = lst.first(); a; a = lst.next() ) for ( TQAction *a = lst.first(); a; a = lst.next() )
@ -2373,10 +2373,10 @@ void Resource::saveChildActions( TQAction *a, TQTextStream &ts, int indent )
while ( it.current() ) { while ( it.current() ) {
TQObject *o = it.current(); TQObject *o = it.current();
++it; ++it;
if ( !o->inherits( "TQAction" ) ) if ( !o->inherits( TQACTION_OBJECT_NAME_STRING ) )
continue; continue;
TQAction *ac = (TQAction*)o; TQAction *ac = (TQAction*)o;
bool isGroup = ac->inherits( "TQActionGroup" ); bool isGroup = ac->inherits( TQACTIONGROUP_OBJECT_NAME_STRING );
if ( isGroup ) if ( isGroup )
ts << makeIndent( indent ) << "<actiongroup>" << endl; ts << makeIndent( indent ) << "<actiongroup>" << endl;
else else
@ -2405,7 +2405,7 @@ void Resource::saveActions( const TQPtrList<TQAction> &actions, TQTextStream &ts
TQPtrListIterator<TQAction> it( actions ); TQPtrListIterator<TQAction> it( actions );
while ( it.current() ) { while ( it.current() ) {
TQAction *a = it.current(); TQAction *a = it.current();
bool isGroup = a->inherits( "TQActionGroup" ); bool isGroup = a->inherits( TQACTIONGROUP_OBJECT_NAME_STRING );
if ( isGroup ) if ( isGroup )
ts << makeIndent( indent ) << "<actiongroup>" << endl; ts << makeIndent( indent ) << "<actiongroup>" << endl;
else else
@ -2449,7 +2449,7 @@ void Resource::loadChildAction( TQObject *parent, const TQDomElement &e )
} }
n2 = n2.nextSibling().toElement(); n2 = n2.nextSibling().toElement();
} }
if ( !parent->inherits( "TQAction" ) ) if ( !parent->inherits( TQACTION_OBJECT_NAME_STRING ) )
formwindow->actionList().append( a ); formwindow->actionList().append( a );
} else if ( n.tagName() == "actiongroup" ) { } else if ( n.tagName() == "actiongroup" ) {
a = new QDesignerActionGroup( parent ); a = new QDesignerActionGroup( parent );
@ -2471,7 +2471,7 @@ void Resource::loadChildAction( TQObject *parent, const TQDomElement &e )
} }
n2 = n2.nextSibling().toElement(); n2 = n2.nextSibling().toElement();
} }
if ( !parent->inherits( "TQAction" ) ) if ( !parent->inherits( TQACTION_OBJECT_NAME_STRING ) )
formwindow->actionList().append( a ); formwindow->actionList().append( a );
} }
} }
@ -2538,7 +2538,7 @@ void Resource::saveToolBars( TQMainWindow *mw, TQTextStream &ts, int indent )
void Resource::saveMenuBar( TQMainWindow *mw, TQTextStream &ts, int indent ) void Resource::saveMenuBar( TQMainWindow *mw, TQTextStream &ts, int indent )
{ {
if ( !mw->child( 0, "TQMenuBar" ) ) if ( !mw->child( 0, TQMENUBAR_OBJECT_NAME_STRING ) )
return; return;
ts << makeIndent( indent ) << "<menubar>" << endl; ts << makeIndent( indent ) << "<menubar>" << endl;
indent++; indent++;

@ -33,14 +33,14 @@ TableEditor::TableEditor( TQWidget* parent, TQWidget *editWidget, FormWindow *f
labelColumnPixmap->setText( "" ); labelColumnPixmap->setText( "" );
labelRowPixmap->setText( "" ); labelRowPixmap->setText( "" );
if ( !editTable->inherits( "TQDataTable" ) ) { if ( !editTable->inherits( TQDATATABLE_OBJECT_NAME_STRING ) ) {
labelFields->hide(); labelFields->hide();
comboFields->hide(); comboFields->hide();
labelTable->hide(); labelTable->hide();
labelTableValue->hide(); labelTableValue->hide();
} }
#ifndef QT_NO_SQL #ifndef QT_NO_SQL
if ( editTable->inherits( "TQDataTable" ) ) { if ( editTable->inherits( TQDATATABLE_OBJECT_NAME_STRING ) ) {
// ## why does this behave weird? // ## why does this behave weird?
// TabWidget->removePage( rows_tab ); // TabWidget->removePage( rows_tab );
// rows_tab->hide(); // rows_tab->hide();
@ -48,7 +48,7 @@ TableEditor::TableEditor( TQWidget* parent, TQWidget *editWidget, FormWindow *f
TabWidget->setTabEnabled( rows_tab, false ); TabWidget->setTabEnabled( rows_tab, false );
} }
if ( formWindow->project() && editTable->inherits( "TQDataTable" ) ) { if ( formWindow->project() && editTable->inherits( TQDATATABLE_OBJECT_NAME_STRING ) ) {
TQStringList lst = MetaDataBase::fakeProperty( editTable, "database" ).toStringList(); TQStringList lst = MetaDataBase::fakeProperty( editTable, "database" ).toStringList();
if ( lst.count() == 2 && !lst[ 0 ].isEmpty() && !lst[ 1 ].isEmpty() ) { if ( lst.count() == 2 && !lst[ 0 ].isEmpty() && !lst[ 1 ].isEmpty() ) {
TQStringList fields; TQStringList fields;
@ -131,7 +131,7 @@ void TableEditor::currentColumnChanged( TQListBoxItem *i )
editColumnText->blockSignals( false ); editColumnText->blockSignals( false );
#ifndef QT_NO_TABLE #ifndef QT_NO_TABLE
if ( editTable->inherits( "TQDataTable" ) ) { if ( editTable->inherits( TQDATATABLE_OBJECT_NAME_STRING ) ) {
TQString s = *fieldMap.find( listColumns->index( i ) ); TQString s = *fieldMap.find( listColumns->index( i ) );
if ( s.isEmpty() ) if ( s.isEmpty() )
comboFields->setCurrentItem( 0 ); comboFields->setCurrentItem( 0 );
@ -215,7 +215,7 @@ void TableEditor::newColumnClicked()
TQListBoxItem *item = listColumns->item( listColumns->count() - 1 ); TQListBoxItem *item = listColumns->item( listColumns->count() - 1 );
listColumns->setCurrentItem( item ); listColumns->setCurrentItem( item );
listColumns->setSelected( item, true ); listColumns->setSelected( item, true );
if ( editTable->inherits( "TQDataTable" ) ) { if ( editTable->inherits( TQDATATABLE_OBJECT_NAME_STRING ) ) {
comboFields->setFocus(); comboFields->setFocus();
} else { } else {
editColumnText->setFocus(); editColumnText->setFocus();

@ -677,29 +677,29 @@ TQLayout *WidgetFactory::createLayout( TQWidget *widget, TQLayout *layout, Layou
int spacing = MainWindow::self->currentLayoutDefaultSpacing(); int spacing = MainWindow::self->currentLayoutDefaultSpacing();
int margin = 0; int margin = 0;
if ( widget && !widget->inherits( "QLayoutWidget" ) && if ( widget && !widget->inherits( TQLAYOUTWIDGET_OBJECT_NAME_STRING ) &&
( WidgetDatabase::isContainer( WidgetDatabase::idFromClassName( WidgetFactory::classNameOf( widget ) ) ) || ( WidgetDatabase::isContainer( WidgetDatabase::idFromClassName( WidgetFactory::classNameOf( widget ) ) ) ||
widget && widget->parentWidget() && widget->parentWidget()->inherits( "FormWindow" ) ) ) widget && widget->parentWidget() && widget->parentWidget()->inherits( "FormWindow" ) ) )
margin = MainWindow::self->currentLayoutDefaultMargin(); margin = MainWindow::self->currentLayoutDefaultMargin();
if ( !layout && widget && widget->inherits( "TQTabWidget" ) ) if ( !layout && widget && widget->inherits( TQTABWIDGET_OBJECT_NAME_STRING ) )
widget = ((TQTabWidget*)widget)->currentPage(); widget = ((TQTabWidget*)widget)->currentPage();
if ( !layout && widget && widget->inherits( "TQToolBox" ) ) if ( !layout && widget && widget->inherits( TQTOOLBOX_OBJECT_NAME_STRING ) )
widget = ((TQToolBox*)widget)->currentItem(); widget = ((TQToolBox*)widget)->currentItem();
if ( !layout && widget && widget->inherits( "TQWizard" ) ) if ( !layout && widget && widget->inherits( TQWIZARD_OBJECT_NAME_STRING ) )
widget = ((TQWizard*)widget)->currentPage(); widget = ((TQWizard*)widget)->currentPage();
if ( !layout && widget && widget->inherits( "TQMainWindow" ) ) if ( !layout && widget && widget->inherits( TQMAINWINDOW_OBJECT_NAME_STRING ) )
widget = ((TQMainWindow*)widget)->centralWidget(); widget = ((TQMainWindow*)widget)->centralWidget();
if ( !layout && widget && widget->inherits( "TQWidgetStack" ) ) if ( !layout && widget && widget->inherits( TQWIDGETSTACK_OBJECT_NAME_STRING ) )
widget = ((TQWidgetStack*)widget)->visibleWidget(); widget = ((TQWidgetStack*)widget)->visibleWidget();
MetaDataBase::addEntry( widget ); MetaDataBase::addEntry( widget );
if ( !layout && widget && widget->inherits( "TQGroupBox" ) ) { if ( !layout && widget && widget->inherits( TQGROUPBOX_OBJECT_NAME_STRING ) ) {
TQGroupBox *gb = (TQGroupBox*)widget; TQGroupBox *gb = (TQGroupBox*)widget;
gb->setColumnLayout( 0, Qt::Vertical ); gb->setColumnLayout( 0, Qt::Vertical );
gb->layout()->setMargin( 0 ); gb->layout()->setMargin( 0 );
@ -811,13 +811,13 @@ void WidgetFactory::deleteLayout( TQWidget *widget )
if ( !widget ) if ( !widget )
return; return;
if ( widget->inherits( "TQTabWidget" ) ) if ( widget->inherits( TQTABWIDGET_OBJECT_NAME_STRING ) )
widget = ((TQTabWidget*)widget)->currentPage(); widget = ((TQTabWidget*)widget)->currentPage();
if ( widget->inherits( "TQWizard" ) ) if ( widget->inherits( TQWIZARD_OBJECT_NAME_STRING ) )
widget = ((TQWizard*)widget)->currentPage(); widget = ((TQWizard*)widget)->currentPage();
if ( widget->inherits( "TQMainWindow" ) ) if ( widget->inherits( TQMAINWINDOW_OBJECT_NAME_STRING ) )
widget = ((TQMainWindow*)widget)->centralWidget(); widget = ((TQMainWindow*)widget)->centralWidget();
if ( widget->inherits( "TQWidgetStack" ) ) if ( widget->inherits( TQWIDGETSTACK_OBJECT_NAME_STRING ) )
widget = ((TQWidgetStack*)widget)->visibleWidget(); widget = ((TQWidgetStack*)widget)->visibleWidget();
delete widget->layout(); delete widget->layout();
} }
@ -832,7 +832,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)
@ -844,9 +844,9 @@ TQWidget *WidgetFactory::createWidget( const TQString &className, TQWidget *pare
b = new QDesignerPushButton(parent, name); b = new QDesignerPushButton(parent, name);
} }
TQWidget *w = find_formwindow(b); TQWidget *w = find_formwindow(b);
b->setAutoDefault(w && ((FormWindow *) w)->mainContainer()->inherits("TQDialog")); b->setAutoDefault(w && ((FormWindow *) w)->mainContainer()->inherits(TQDIALOG_OBJECT_NAME_STRING));
return b; return b;
} else if (className == "TQToolButton") } else if (className == TQTOOLBUTTON_OBJECT_NAME_STRING)
{ {
if (init) if (init)
{ {
@ -855,7 +855,7 @@ 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)
{ {
@ -864,7 +864,7 @@ TQWidget *WidgetFactory::createWidget( const TQString &className, TQWidget *pare
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)
{ {
@ -873,17 +873,17 @@ TQWidget *WidgetFactory::createWidget( const TQString &className, TQWidget *pare
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);
@ -893,7 +893,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)
@ -903,20 +903,20 @@ 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)
@ -925,7 +925,7 @@ TQWidget *WidgetFactory::createWidget( const TQString &className, TQWidget *pare
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);
@ -935,17 +935,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") else if (className == TQLABEL_OBJECT_NAME_STRING)
{ {
QDesignerLabel *l = new QDesignerLabel(parent, name); QDesignerLabel *l = new QDesignerLabel(parent, name);
if (init) if (init)
@ -955,9 +955,9 @@ TQWidget *WidgetFactory::createWidget( const TQString &className, TQWidget *pare
MetaDataBase::setPropertyChanged(l, "text", true); MetaDataBase::setPropertyChanged(l, "text", 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)
@ -972,14 +972,14 @@ TQWidget *WidgetFactory::createWidget( const TQString &className, TQWidget *pare
MetaDataBase::addEntry(w); MetaDataBase::addEntry(w);
} }
return tw; return tw;
} 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 &&
(parent->inherits("FormWindow") || parent->inherits("TQWizard") (parent->inherits("FormWindow") || parent->inherits(TQWIZARD_OBJECT_NAME_STRING)
|| parent->inherits("TQTabWidget") || parent->inherits("TQToolBox") || parent->inherits("TQMainWindow"))) || parent->inherits(TQTABWIDGET_OBJECT_NAME_STRING) || parent->inherits(TQTOOLBOX_OBJECT_NAME_STRING) || parent->inherits(TQMAINWINDOW_OBJECT_NAME_STRING)))
{ {
FormWindow *fw = find_formwindow(parent); FormWindow *fw = find_formwindow(parent);
if (fw) if (fw)
@ -990,7 +990,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 (parent && parent->inherits("FormWindow")) if (parent && parent->inherits("FormWindow"))
@ -1000,7 +1000,7 @@ TQWidget *WidgetFactory::createWidget( const TQString &className, TQWidget *pare
if (parent && !parent->inherits("MainWindow")) if (parent && !parent->inherits("MainWindow"))
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 (parent && !parent->inherits("MainWindow")) if (parent && !parent->inherits("MainWindow"))
@ -1030,17 +1030,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)
@ -1052,7 +1052,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)
@ -1064,7 +1064,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);
@ -1085,7 +1085,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 KmdrMainWindow(parent, name, 0); TQMainWindow *mw = new KmdrMainWindow(parent, name, 0);
mw->setDockEnabled(Qt::DockMinimized, false); mw->setDockEnabled(Qt::DockMinimized, false);
@ -1098,13 +1098,13 @@ TQWidget *WidgetFactory::createWidget( const TQString &className, TQWidget *pare
return mw; return mw;
} }
#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)
@ -1266,37 +1266,37 @@ WidgetFactory::LayoutType WidgetFactory::layoutType( TQWidget *w, TQLayout *&lay
{ {
layout = 0; layout = 0;
if ( w && w->inherits( "TQTabWidget" ) ) if ( w && w->inherits( TQTABWIDGET_OBJECT_NAME_STRING ) )
w = ((TQTabWidget*)w)->currentPage(); w = ((TQTabWidget*)w)->currentPage();
if ( w->inherits( "TQToolBox" ) ) if ( w->inherits( TQTOOLBOX_OBJECT_NAME_STRING ) )
w = ((TQToolBox*)w)->currentItem(); w = ((TQToolBox*)w)->currentItem();
if ( w && w->inherits( "TQWizard" ) ) if ( w && w->inherits( TQWIZARD_OBJECT_NAME_STRING ) )
w = ((TQWizard*)w)->currentPage(); w = ((TQWizard*)w)->currentPage();
if ( w && w->inherits( "TQMainWindow" ) ) if ( w && w->inherits( TQMAINWINDOW_OBJECT_NAME_STRING ) )
w = ((TQMainWindow*)w)->centralWidget(); w = ((TQMainWindow*)w)->centralWidget();
if ( w && w->inherits( "TQWidgetStack" ) ) if ( w && w->inherits( TQWIDGETSTACK_OBJECT_NAME_STRING ) )
w = ((TQWidgetStack*)w)->visibleWidget(); w = ((TQWidgetStack*)w)->visibleWidget();
if ( w && w->inherits( "TQSplitter" ) ) if ( w && w->inherits( TQSPLITTER_OBJECT_NAME_STRING ) )
return ( (TQSplitter*)w )->orientation() == Horizontal ? HBox : VBox; return ( (TQSplitter*)w )->orientation() == Horizontal ? HBox : VBox;
if ( !w || !w->layout() ) if ( !w || !w->layout() )
return NoLayout; return NoLayout;
TQLayout *lay = w->layout(); TQLayout *lay = w->layout();
if ( w->inherits( "TQGroupBox" ) ) { if ( w->inherits( TQGROUPBOX_OBJECT_NAME_STRING ) ) {
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;
} }
layout = lay; layout = lay;
if ( lay->inherits( "TQHBoxLayout" ) ) if ( lay->inherits( TQHBOXLAYOUT_OBJECT_NAME_STRING ) )
return HBox; return HBox;
else if ( lay->inherits( "TQVBoxLayout" ) ) else if ( lay->inherits( TQVBOXLAYOUT_OBJECT_NAME_STRING ) )
return VBox; return VBox;
else if ( lay->inherits( "TQGridLayout" ) ) else if ( lay->inherits( TQGRIDLAYOUT_OBJECT_NAME_STRING ) )
return Grid; return Grid;
return NoLayout; return NoLayout;
} }
@ -1306,11 +1306,11 @@ WidgetFactory::LayoutType WidgetFactory::layoutType( TQWidget *w, TQLayout *&lay
*/ */
WidgetFactory::LayoutType WidgetFactory::layoutType( TQLayout *layout ) WidgetFactory::LayoutType WidgetFactory::layoutType( TQLayout *layout )
{ {
if ( layout->inherits( "TQHBoxLayout" ) ) if ( layout->inherits( TQHBOXLAYOUT_OBJECT_NAME_STRING ) )
return HBox; return HBox;
else if ( layout->inherits( "TQVBoxLayout" ) ) else if ( layout->inherits( TQVBOXLAYOUT_OBJECT_NAME_STRING ) )
return VBox; return VBox;
else if ( layout->inherits( "TQGridLayout" ) ) else if ( layout->inherits( TQGRIDLAYOUT_OBJECT_NAME_STRING ) )
return Grid; return Grid;
return NoLayout; return NoLayout;
} }
@ -1349,15 +1349,15 @@ TQWidget* WidgetFactory::containerOfWidget( TQWidget *w )
{ {
if ( !w ) if ( !w )
return w; return w;
if ( w->inherits( "TQTabWidget" ) ) if ( w->inherits( TQTABWIDGET_OBJECT_NAME_STRING ) )
return ((TQTabWidget*)w)->currentPage(); return ((TQTabWidget*)w)->currentPage();
if ( w->inherits( "TQToolBox" ) ) if ( w->inherits( TQTOOLBOX_OBJECT_NAME_STRING ) )
return ((TQToolBox*)w)->currentItem(); return ((TQToolBox*)w)->currentItem();
if ( w->inherits( "TQWizard" ) ) if ( w->inherits( TQWIZARD_OBJECT_NAME_STRING ) )
return ((TQWizard*)w)->currentPage(); return ((TQWizard*)w)->currentPage();
if ( w->inherits( "TQWidgetStack" ) ) if ( w->inherits( TQWIDGETSTACK_OBJECT_NAME_STRING ) )
return ((TQWidgetStack*)w)->visibleWidget(); return ((TQWidgetStack*)w)->visibleWidget();
if ( w->inherits( "TQMainWindow" ) ) if ( w->inherits( TQMAINWINDOW_OBJECT_NAME_STRING ) )
return ((TQMainWindow*)w)->centralWidget(); return ((TQMainWindow*)w)->centralWidget();
return w; return w;
} }
@ -1372,7 +1372,7 @@ TQWidget* WidgetFactory::containerOfWidget( TQWidget *w )
TQWidget* WidgetFactory::widgetOfContainer( TQWidget *w ) TQWidget* WidgetFactory::widgetOfContainer( TQWidget *w )
{ {
if ( w->parentWidget() && w->parentWidget()->inherits( "TQWidgetStack" ) ) if ( w->parentWidget() && w->parentWidget()->inherits( TQWIDGETSTACK_OBJECT_NAME_STRING ) )
w = w->parentWidget(); w = w->parentWidget();
while ( w ) { while ( w ) {
if ( WidgetDatabase::isContainer( WidgetDatabase::idFromClassName( WidgetFactory::classNameOf( w ) ) ) || if ( WidgetDatabase::isContainer( WidgetDatabase::idFromClassName( WidgetFactory::classNameOf( w ) ) ) ||
@ -1391,19 +1391,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 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; return true;
if ( o->inherits( "TQTabBar" ) || ::qt_cast<TQToolBox*>(o->parent()) ) if ( o->inherits( TQTABBAR_OBJECT_NAME_STRING ) || ::qt_cast<TQToolBox*>(o->parent()) )
return true; return true;
else if ( o->inherits( "TQSizeGrip" ) ) else if ( o->inherits( TQSIZEGRIP_OBJECT_NAME_STRING ) )
return true; return true;
else if ( o->inherits( "TQToolButton" ) && o->parent() && o->parent()->inherits( "TQTabBar" ) ) else if ( o->inherits( TQTOOLBUTTON_OBJECT_NAME_STRING ) && o->parent() && o->parent()->inherits( TQTABBAR_OBJECT_NAME_STRING ) )
return true; return true;
else if ( o->parent() && o->parent()->inherits( "TQWizard" ) && o->inherits( "TQPushButton" ) ) else if ( o->parent() && o->parent()->inherits( TQWIZARD_OBJECT_NAME_STRING ) && o->inherits( TQPUSHBUTTON_OBJECT_NAME_STRING ) )
return true; return true;
else if ( o->parent() && o->parent()->inherits( "TQMainWindow" ) && o->inherits( "TQMenuBar" ) ) else if ( o->parent() && o->parent()->inherits( TQMAINWINDOW_OBJECT_NAME_STRING ) && o->inherits( TQMENUBAR_OBJECT_NAME_STRING ) )
return true; return true;
else if ( o->inherits( "QDockWindowHandle" ) ) else if ( o->inherits( TQDOCKWINDOWHANDLE_OBJECT_NAME_STRING ) )
return true; return true;
else if ( o->inherits( "QHideDock" ) ) else if ( o->inherits( TQHIDEDOCK_OBJECT_NAME_STRING ) )
return true; return true;
return false; return false;
@ -1469,23 +1469,23 @@ void WidgetFactory::initChangedProperties( TQObject *o )
if ( !o->inherits( "QDesignerToolBar" ) && !o->inherits( "QDesignerMenuBar" ) ) if ( !o->inherits( "QDesignerToolBar" ) && !o->inherits( "QDesignerMenuBar" ) )
MetaDataBase::setPropertyChanged( o, "geometry", true ); MetaDataBase::setPropertyChanged( o, "geometry", true );
if ( o->inherits( "TQPushButton" ) || o->inherits("TQRadioButton") || o->inherits( "TQCheckBox" ) || o->inherits( "TQToolButton" ) ) 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 ) )
MetaDataBase::setPropertyChanged( o, "text", true ); MetaDataBase::setPropertyChanged( o, "text", true );
else if (::qt_cast<TQToolButton*>(o) && ::qt_cast<TQToolBox*>(widgetOfContainer((TQWidget*)o->parent()))) { else if (::qt_cast<TQToolButton*>(o) && ::qt_cast<TQToolBox*>(widgetOfContainer((TQWidget*)o->parent()))) {
MetaDataBase::setPropertyChanged( o, "usesTextLabel", TRUE ); MetaDataBase::setPropertyChanged( o, "usesTextLabel", TRUE );
MetaDataBase::setPropertyChanged( o, "textLabel", TRUE ); MetaDataBase::setPropertyChanged( o, "textLabel", TRUE );
MetaDataBase::setPropertyChanged( o, "autoRaise", TRUE ); MetaDataBase::setPropertyChanged( o, "autoRaise", TRUE );
MetaDataBase::setPropertyChanged( o, "textPosition", TRUE ); MetaDataBase::setPropertyChanged( o, "textPosition", TRUE );
} else if ( o->inherits( "TQGroupBox" ) ) } else if ( o->inherits( TQGROUPBOX_OBJECT_NAME_STRING ) )
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 ( o->inherits( "TQTabWidget" ) || o->inherits( "TQWizard" ) ) { } else if ( o->inherits( TQTABWIDGET_OBJECT_NAME_STRING ) || o->inherits( TQWIZARD_OBJECT_NAME_STRING ) ) {
MetaDataBase::setPropertyChanged( o, "pageTitle", true ); MetaDataBase::setPropertyChanged( o, "pageTitle", true );
MetaDataBase::setPropertyChanged( o, "pageName", true ); MetaDataBase::setPropertyChanged( o, "pageName", true );
#ifndef QT_NO_TABLE #ifndef QT_NO_TABLE
} else if ( o->inherits( "TQTable" ) && !o->inherits( "TQDataTable" ) ) { } else if ( o->inherits( TQTABLE_OBJECT_NAME_STRING ) && !o->inherits( TQDATATABLE_OBJECT_NAME_STRING ) ) {
MetaDataBase::setPropertyChanged( o, "numRows", true ); MetaDataBase::setPropertyChanged( o, "numRows", true );
MetaDataBase::setPropertyChanged( o, "numCols", true ); MetaDataBase::setPropertyChanged( o, "numCols", true );
TQTable *t = (TQTable*)o; TQTable *t = (TQTable*)o;
@ -1501,7 +1501,7 @@ void WidgetFactory::initChangedProperties( TQObject *o )
MetaDataBase::setPropertyChanged( o, "itemIconSet", true ); MetaDataBase::setPropertyChanged( o, "itemIconSet", true );
MetaDataBase::setPropertyChanged( o, "itemToolTip", true ); MetaDataBase::setPropertyChanged( o, "itemToolTip", true );
MetaDataBase::setPropertyChanged( o, "itemBackgroundMode", true ); MetaDataBase::setPropertyChanged( o, "itemBackgroundMode", true );
} else if ( o->inherits( "TQSplitter" ) ) { } else if ( o->inherits( TQSPLITTER_OBJECT_NAME_STRING ) ) {
MetaDataBase::setPropertyChanged( o, "orientation", true ); MetaDataBase::setPropertyChanged( o, "orientation", true );
} else if ( o->inherits( "QDesignerToolBar" ) ) { } else if ( o->inherits( "QDesignerToolBar" ) ) {
MetaDataBase::setPropertyChanged( o, "label", true ); MetaDataBase::setPropertyChanged( o, "label", true );
@ -1528,7 +1528,7 @@ bool WidgetFactory::hasSpecialEditor( int id )
return true; return true;
if (className.mid(1) == "IconView") if (className.mid(1) == "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 (className.contains("Table")) if (className.contains("Table"))
return true; return true;
@ -1557,7 +1557,7 @@ void WidgetFactory::editWidget( int id, TQWidget *parent, TQWidget *editWidget,
#ifdef KOMMANDER #ifdef KOMMANDER
if (className == "ComboBox") if (className == "ComboBox")
{ {
if (!editWidget->inherits("TQComboBox")) if (!editWidget->inherits(TQCOMBOBOX_OBJECT_NAME_STRING))
return; return;
TQComboBox *cb = (TQComboBox *) editWidget; TQComboBox *cb = (TQComboBox *) editWidget;
@ -1579,7 +1579,7 @@ void WidgetFactory::editWidget( int id, TQWidget *parent, TQWidget *editWidget,
} }
if (className == "TreeWidget") if (className == "TreeWidget")
{ {
if (!editWidget->inherits("TQListView")) if (!editWidget->inherits(TQLISTVIEW_OBJECT_NAME_STRING))
return; return;
TQListView *lv = (TQListView *) editWidget; TQListView *lv = (TQListView *) editWidget;
ListViewEditor *e = new ListViewEditor(parent, lv, fw); ListViewEditor *e = new ListViewEditor(parent, lv, fw);
@ -1589,7 +1589,7 @@ void WidgetFactory::editWidget( int id, TQWidget *parent, TQWidget *editWidget,
} }
if (className == "ListBox") if (className == "ListBox")
{ {
if (!editWidget->inherits("TQListBox")) if (!editWidget->inherits(TQLISTBOX_OBJECT_NAME_STRING))
return; return;
ListBoxEditor *e = new ListBoxEditor(parent, editWidget, fw); ListBoxEditor *e = new ListBoxEditor(parent, editWidget, fw);
e->exec(); e->exec();
@ -1599,7 +1599,7 @@ void WidgetFactory::editWidget( int id, TQWidget *parent, TQWidget *editWidget,
#endif #endif
if (className.mid(1) == "ListBox") if (className.mid(1) == "ListBox")
{ {
if (!editWidget->inherits("TQListBox")) if (!editWidget->inherits(TQLISTBOX_OBJECT_NAME_STRING))
return; return;
ListBoxEditor *e = new ListBoxEditor(parent, editWidget, fw); ListBoxEditor *e = new ListBoxEditor(parent, editWidget, fw);
e->exec(); e->exec();
@ -1609,7 +1609,7 @@ void WidgetFactory::editWidget( int id, TQWidget *parent, TQWidget *editWidget,
if (className.mid(1) == "ComboBox") if (className.mid(1) == "ComboBox")
{ {
if (!editWidget->inherits("TQComboBox")) if (!editWidget->inherits(TQCOMBOBOX_OBJECT_NAME_STRING))
return; return;
TQComboBox *cb = (TQComboBox *) editWidget; TQComboBox *cb = (TQComboBox *) editWidget;
ListBoxEditor *e = new ListBoxEditor(parent, cb->listBox(), fw); ListBoxEditor *e = new ListBoxEditor(parent, cb->listBox(), fw);
@ -1621,7 +1621,7 @@ void WidgetFactory::editWidget( int id, TQWidget *parent, TQWidget *editWidget,
if (className.mid(1) == "ListView") if (className.mid(1) == "ListView")
{ {
if (!editWidget->inherits("TQListView")) if (!editWidget->inherits(TQLISTVIEW_OBJECT_NAME_STRING))
return; return;
TQListView *lv = (TQListView *) editWidget; TQListView *lv = (TQListView *) editWidget;
ListViewEditor *e = new ListViewEditor(parent, lv, fw); ListViewEditor *e = new ListViewEditor(parent, lv, fw);
@ -1632,7 +1632,7 @@ void WidgetFactory::editWidget( int id, TQWidget *parent, TQWidget *editWidget,
if (className.mid(1) == "IconView") if (className.mid(1) == "IconView")
{ {
if (!editWidget->inherits("TQIconView")) if (!editWidget->inherits(TQICONVIEW_OBJECT_NAME_STRING))
return; return;
IconViewEditor *e = new IconViewEditor(parent, editWidget, fw); IconViewEditor *e = new IconViewEditor(parent, editWidget, fw);
e->exec(); e->exec();
@ -1640,7 +1640,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(parent, editWidget, fw); MultiLineEditor *e = new MultiLineEditor(parent, editWidget, fw);
e->exec(); e->exec();
@ -1751,7 +1751,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;
@ -1831,8 +1831,8 @@ void QLayoutWidget::updateSizePolicy()
TQObjectListIt it( *children() ); TQObjectListIt it( *children() );
TQObject *o; TQObject *o;
if ( layout()->inherits("TQVBoxLayout") ) { if ( layout()->inherits(TQVBOXLAYOUT_OBJECT_NAME_STRING) ) {
if ( parentLayout && parentLayout->inherits("TQHBoxLayout") ) if ( parentLayout && parentLayout->inherits(TQHBOXLAYOUT_OBJECT_NAME_STRING) )
vt = TQSizePolicy::Minimum; vt = TQSizePolicy::Minimum;
else else
vt = TQSizePolicy::Fixed; vt = TQSizePolicy::Fixed;
@ -1852,8 +1852,8 @@ void QLayoutWidget::updateSizePolicy()
if ( w->sizePolicy().mayShrinkVertically() ) if ( w->sizePolicy().mayShrinkVertically() )
vt |= TQSizePolicy::Maximum; vt |= TQSizePolicy::Maximum;
} }
} else if ( layout()->inherits("TQHBoxLayout") ) { } else if ( layout()->inherits(TQHBOXLAYOUT_OBJECT_NAME_STRING) ) {
if ( parentLayout && parentLayout->inherits("TQVBoxLayout") ) if ( parentLayout && parentLayout->inherits(TQVBOXLAYOUT_OBJECT_NAME_STRING) )
ht = TQSizePolicy::Minimum; ht = TQSizePolicy::Minimum;
else else
ht = TQSizePolicy::Fixed; ht = TQSizePolicy::Fixed;
@ -1873,13 +1873,13 @@ void QLayoutWidget::updateSizePolicy()
if ( !w->sizePolicy().mayShrinkVertically() ) if ( !w->sizePolicy().mayShrinkVertically() )
vt &= ~TQSizePolicy::Maximum; vt &= ~TQSizePolicy::Maximum;
} }
} else if ( layout()->inherits("TQGridLayout") ) { } else if ( layout()->inherits(TQGRIDLAYOUT_OBJECT_NAME_STRING) ) {
ht = TQSizePolicy::Fixed; ht = TQSizePolicy::Fixed;
vt = TQSizePolicy::Fixed; vt = TQSizePolicy::Fixed;
if ( parentLayout ) { if ( parentLayout ) {
if ( parentLayout->inherits("TQVBoxLayout") ) if ( parentLayout->inherits(TQVBOXLAYOUT_OBJECT_NAME_STRING) )
ht = TQSizePolicy::Minimum; ht = TQSizePolicy::Minimum;
else if ( parentLayout->inherits("TQHBoxLayout") ) else if ( parentLayout->inherits(TQHBOXLAYOUT_OBJECT_NAME_STRING) )
vt = TQSizePolicy::Minimum; vt = TQSizePolicy::Minimum;
} }

@ -370,13 +370,13 @@ public:
: TQToolButton( parent, name ) {} : TQToolButton( parent, name ) {}
bool isInButtonGroup() const { bool isInButtonGroup() const {
return parentWidget() && parentWidget()->inherits( "TQButtonGroup" ); return parentWidget() && parentWidget()->inherits( TQBUTTONGROUP_OBJECT_NAME_STRING );
} }
int buttonGroupId() const { int buttonGroupId() const {
return parentWidget() && parentWidget()->inherits( "TQButtonGroup" ) ? ( (TQButtonGroup*)parentWidget() )->id( (TQButton*)this ) : -1; return parentWidget() && parentWidget()->inherits( TQBUTTONGROUP_OBJECT_NAME_STRING ) ? ( (TQButtonGroup*)parentWidget() )->id( (TQButton*)this ) : -1;
} }
void setButtonGroupId( int id ) { void setButtonGroupId( int id ) {
if ( parentWidget() && parentWidget()->inherits( "TQButtonGroup" ) ) { if ( parentWidget() && parentWidget()->inherits( TQBUTTONGROUP_OBJECT_NAME_STRING ) ) {
( (TQButtonGroup*)parentWidget() )->remove( this ); ( (TQButtonGroup*)parentWidget() )->remove( this );
( (TQButtonGroup*)parentWidget() )->insert( this, id ); ( (TQButtonGroup*)parentWidget() )->insert( this, id );
} }
@ -393,13 +393,13 @@ public:
: TQRadioButton( parent, name ) {} : TQRadioButton( parent, name ) {}
bool isInButtonGroup() const { bool isInButtonGroup() const {
return parentWidget() && parentWidget()->inherits( "TQButtonGroup" ); return parentWidget() && parentWidget()->inherits( TQBUTTONGROUP_OBJECT_NAME_STRING );
} }
int buttonGroupId() const { int buttonGroupId() const {
return parentWidget() && parentWidget()->inherits( "TQButtonGroup" ) ? ( (TQButtonGroup*)parentWidget() )->id( (TQButton*)this ) : -1; return parentWidget() && parentWidget()->inherits( TQBUTTONGROUP_OBJECT_NAME_STRING ) ? ( (TQButtonGroup*)parentWidget() )->id( (TQButton*)this ) : -1;
} }
void setButtonGroupId( int id ) { void setButtonGroupId( int id ) {
if ( parentWidget() && parentWidget()->inherits( "TQButtonGroup" ) ) { if ( parentWidget() && parentWidget()->inherits( TQBUTTONGROUP_OBJECT_NAME_STRING ) ) {
( (TQButtonGroup*)parentWidget() )->remove( this ); ( (TQButtonGroup*)parentWidget() )->remove( this );
( (TQButtonGroup*)parentWidget() )->insert( this, id ); ( (TQButtonGroup*)parentWidget() )->insert( this, id );
} }
@ -417,13 +417,13 @@ public:
: TQPushButton( parent, name ) {} : TQPushButton( parent, name ) {}
bool isInButtonGroup() const { bool isInButtonGroup() const {
return parentWidget() && parentWidget()->inherits( "TQButtonGroup" ); return parentWidget() && parentWidget()->inherits( TQBUTTONGROUP_OBJECT_NAME_STRING );
} }
int buttonGroupId() const { int buttonGroupId() const {
return parentWidget() && parentWidget()->inherits( "TQButtonGroup" ) ? ( (TQButtonGroup*)parentWidget() )->id( (TQButton*)this ) : -1; return parentWidget() && parentWidget()->inherits( TQBUTTONGROUP_OBJECT_NAME_STRING ) ? ( (TQButtonGroup*)parentWidget() )->id( (TQButton*)this ) : -1;
} }
void setButtonGroupId( int id ) { void setButtonGroupId( int id ) {
if ( parentWidget() && parentWidget()->inherits( "TQButtonGroup" ) ) { if ( parentWidget() && parentWidget()->inherits( TQBUTTONGROUP_OBJECT_NAME_STRING ) ) {
( (TQButtonGroup*)parentWidget() )->remove( this ); ( (TQButtonGroup*)parentWidget() )->remove( this );
( (TQButtonGroup*)parentWidget() )->insert( this, id ); ( (TQButtonGroup*)parentWidget() )->insert( this, id );
} }
@ -441,13 +441,13 @@ public:
: TQCheckBox( parent, name ) {} : TQCheckBox( parent, name ) {}
bool isInButtonGroup() const { bool isInButtonGroup() const {
return parentWidget() && parentWidget()->inherits( "TQButtonGroup" ); return parentWidget() && parentWidget()->inherits( TQBUTTONGROUP_OBJECT_NAME_STRING );
} }
int buttonGroupId() const { int buttonGroupId() const {
return parentWidget() && parentWidget()->inherits( "TQButtonGroup" ) ? ( (TQButtonGroup*)parentWidget() )->id( (TQButton*)this ) : -1; return parentWidget() && parentWidget()->inherits( TQBUTTONGROUP_OBJECT_NAME_STRING ) ? ( (TQButtonGroup*)parentWidget() )->id( (TQButton*)this ) : -1;
} }
void setButtonGroupId( int id ) { void setButtonGroupId( int id ) {
if ( parentWidget() && parentWidget()->inherits( "TQButtonGroup" ) ) { if ( parentWidget() && parentWidget()->inherits( TQBUTTONGROUP_OBJECT_NAME_STRING ) ) {
( (TQButtonGroup*)parentWidget() )->remove( this ); ( (TQButtonGroup*)parentWidget() )->remove( this );
( (TQButtonGroup*)parentWidget() )->insert( this, id ); ( (TQButtonGroup*)parentWidget() )->insert( this, id );
} }

@ -158,9 +158,9 @@ bool Instance::run()
return false; return false;
// Handle both dialogs and main windows // Handle both dialogs and main windows
if (m_instance->inherits("TQDialog")) if (m_instance->inherits(TQDIALOG_OBJECT_NAME_STRING))
dynamic_cast<TQDialog*>((TQWidget*)m_instance)->exec(); dynamic_cast<TQDialog*>((TQWidget*)m_instance)->exec();
else if (m_instance->inherits("TQMainWindow")) else if (m_instance->inherits(TQMAINWINDOW_OBJECT_NAME_STRING))
{ {
kapp->setMainWidget(m_instance); kapp->setMainWidget(m_instance);
dynamic_cast<TQMainWindow*>((TQWidget*)m_instance)->show(); dynamic_cast<TQMainWindow*>((TQWidget*)m_instance)->show();
@ -234,14 +234,14 @@ bool Instance::isFileValid(const KURL& fname) const
void Instance::setEnabled(const TQString& widgetName, bool enable) void Instance::setEnabled(const TQString& widgetName, bool enable)
{ {
TQObject* child = stringToWidget(widgetName); TQObject* child = stringToWidget(widgetName);
if (child && child->inherits("TQWidget")) if (child && child->inherits(TQWIDGET_OBJECT_NAME_STRING))
((TQWidget*)child)->setEnabled(enable); ((TQWidget*)child)->setEnabled(enable);
} }
void Instance::setVisible(const TQString& widgetName, bool visible) void Instance::setVisible(const TQString& widgetName, bool visible)
{ {
TQObject* child = stringToWidget(widgetName); TQObject* child = stringToWidget(widgetName);
if (child && child->inherits("TQWidget")) if (child && child->inherits(TQWIDGET_OBJECT_NAME_STRING))
((TQWidget*)child)->setShown(visible); ((TQWidget*)child)->setShown(visible);
} }
@ -250,7 +250,7 @@ void Instance::setText(const TQString& widgetName, const TQString& text)
TQObject* child = stringToWidget(widgetName); TQObject* child = stringToWidget(widgetName);
if (kommanderWidget(child)) if (kommanderWidget(child))
kommanderWidget(child)->handleDCOP(DCOP::setText, text); kommanderWidget(child)->handleDCOP(DCOP::setText, text);
else if (child && child->inherits("TQLabel")) else if (child && child->inherits(TQLABEL_OBJECT_NAME_STRING))
{ {
TQLabel* label = (TQLabel*)child; TQLabel* label = (TQLabel*)child;
if (label->pixmap()) if (label->pixmap())
@ -269,7 +269,7 @@ TQString Instance::text(const TQString& widgetName)
TQObject* child = stringToWidget(widgetName); TQObject* child = stringToWidget(widgetName);
if (kommanderWidget(child)) if (kommanderWidget(child))
return kommanderWidget(child)->handleDCOP(DCOP::text); return kommanderWidget(child)->handleDCOP(DCOP::text);
else if (child && child->inherits("TQLabel")) else if (child && child->inherits(TQLABEL_OBJECT_NAME_STRING))
return ((TQLabel*)child)->text(); return ((TQLabel*)child)->text();
return TQString(); return TQString();
} }
@ -279,7 +279,7 @@ void Instance::setSelection(const TQString& widgetName, const TQString& text)
TQObject* child = stringToWidget(widgetName); TQObject* child = stringToWidget(widgetName);
if (kommanderWidget(child)) if (kommanderWidget(child))
kommanderWidget(child)->handleDCOP(DCOP::setSelection, text); kommanderWidget(child)->handleDCOP(DCOP::setSelection, text);
else if (child && child->inherits("TQLabel")) else if (child && child->inherits(TQLABEL_OBJECT_NAME_STRING))
((TQLabel*)child)->setText(text); ((TQLabel*)child)->setText(text);
} }
@ -426,7 +426,7 @@ TQStringList Instance::associatedText(const TQString &widgetName)
TQString Instance::type(const TQString& widget) TQString Instance::type(const TQString& widget)
{ {
TQObject* child = stringToWidget(widget); TQObject* child = stringToWidget(widget);
if (child && child->inherits("TQWidget")) if (child && child->inherits(TQWIDGET_OBJECT_NAME_STRING))
return child->className(); return child->className();
return TQString(); return TQString();
} }
@ -438,9 +438,9 @@ TQStringList Instance::children(const TQString& parent, bool recursive)
TQObjectList* widgets; TQObjectList* widgets;
if (!child) if (!child)
child = m_instance; child = m_instance;
if (child->inherits("TQWidget")) if (child->inherits(TQWIDGET_OBJECT_NAME_STRING))
{ {
widgets = child->queryList("TQWidget", 0, false, recursive); widgets = child->queryList(TQWIDGET_OBJECT_NAME_STRING, 0, false, recursive);
for (TQObject* w = widgets->first(); w; w = widgets->next()) for (TQObject* w = widgets->first(); w; w = widgets->next())
if (w->name() && kommanderWidget(w)) if (w->name() && kommanderWidget(w))
matching.append(w->name()); matching.append(w->name());

@ -314,75 +314,75 @@ TQWidget *KommanderFactory::createWidget( const TQString &literalClassName, TQWi
// create widgets we know // create widgets we know
if (className == TQPUSHBUTTON_OBJECT_NAME_STRING) if (className == TQPUSHBUTTON_OBJECT_NAME_STRING)
return new TQPushButton(parent, name); return new TQPushButton(parent, name);
else if (className == "TQToolButton") else if (className == TQTOOLBUTTON_OBJECT_NAME_STRING)
return new TQToolButton(parent, name); return new TQToolButton(parent, name);
else if (className == "TQCheckBox") else if (className == TQCHECKBOX_OBJECT_NAME_STRING)
return new TQCheckBox(parent, name); return new TQCheckBox(parent, name);
else if (className == "TQRadioButton") else if (className == TQRADIOBUTTON_OBJECT_NAME_STRING)
return new TQRadioButton(parent, name); return new TQRadioButton(parent, name);
else if (className == "TQGroupBox") else if (className == TQGROUPBOX_OBJECT_NAME_STRING)
return new TQGroupBox(parent, name); return new TQGroupBox(parent, name);
else if (className == "TQButtonGroup") else if (className == TQBUTTONGROUP_OBJECT_NAME_STRING)
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)
return new TQIconView(parent, name); return new TQIconView(parent, name);
#endif #endif
} }
else if (className == "TQTable") else if (className == TQTABLE_OBJECT_NAME_STRING)
{ {
#if !defined(QT_NO_TABLE) #if !defined(QT_NO_TABLE)
return new TQTable(parent, name); return new TQTable(parent, name);
#endif #endif
} }
else if (className == "TQListBox") else if (className == TQLISTBOX_OBJECT_NAME_STRING)
return new TQListBox(parent, name); return new TQListBox(parent, name);
else if (className == "TQListView") else if (className == TQLISTVIEW_OBJECT_NAME_STRING)
return new TQListView(parent, name); return new TQListView(parent, name);
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 == "TQMultiLineEdit") else if (className == TQMULTILINEEDIT_OBJECT_NAME_STRING)
return new TQMultiLineEdit(parent, name); return new TQMultiLineEdit(parent, name);
else if (className == "TQLabel") else if (className == TQLABEL_OBJECT_NAME_STRING)
return new TQLabel(parent, name); return new TQLabel(parent, name);
else if (className == "QLayoutWidget") else if (className == TQLAYOUTWIDGET_OBJECT_NAME_STRING)
return new TQWidget(parent, name); return new TQWidget(parent, name);
else if (className == "TQTabWidget") else if (className == TQTABWIDGET_OBJECT_NAME_STRING)
return new TQTabWidget(parent, name); return new TQTabWidget(parent, name);
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 (!qwf_stays_on_top) if (!qwf_stays_on_top)
return new TQWidget(parent, name); return new TQWidget(parent, name);
return new TQWidget(parent, name, Qt::WStyle_StaysOnTop); return new TQWidget(parent, name, Qt::WStyle_StaysOnTop);
} }
else if (className == "TQDialog") else if (className == TQDIALOG_OBJECT_NAME_STRING)
{ {
if (!qwf_stays_on_top) if (!qwf_stays_on_top)
return new TQDialog(parent, name); return new TQDialog(parent, name);
return new TQDialog(parent, name, false, Qt::WStyle_StaysOnTop); return new TQDialog(parent, name, false, Qt::WStyle_StaysOnTop);
} }
else if (className == "TQWizard") else if (className == TQWIZARD_OBJECT_NAME_STRING)
return new TQWizard(parent, name); return new TQWizard(parent, name);
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)
return new TQSlider(parent, name); return new TQSlider(parent, name);
else if (className == "TQFrame") else if (className == TQFRAME_OBJECT_NAME_STRING)
return new TQFrame(parent, name); return new TQFrame(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 == "Line") else if (className == "Line")
{ {
@ -390,21 +390,21 @@ TQWidget *KommanderFactory::createWidget( const TQString &literalClassName, TQWi
f->setFrameStyle(TQFrame::HLine | TQFrame::Sunken); f->setFrameStyle(TQFrame::HLine | TQFrame::Sunken);
return f; return f;
} }
else if (className == "TQTextEdit") else if (className == TQTEXTEDIT_OBJECT_NAME_STRING)
return new TQTextEdit(parent, name); return new TQTextEdit(parent, name);
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 == "TQScrollBar") else if (className == TQSCROLLBAR_OBJECT_NAME_STRING)
return new TQScrollBar(parent, name); return new TQScrollBar(parent, name);
else if (className == "TQPopupMenu") else if (className == TQPOPUPMENU_OBJECT_NAME_STRING)
return new TQPopupMenu(parent, name); return new TQPopupMenu(parent, name);
else if (className == "TQWidgetStack") else if (className == TQWIDGETSTACK_OBJECT_NAME_STRING)
return new TQWidgetStack(parent, name); return new TQWidgetStack(parent, name);
else if (className == "TQMainWindow") else if (className == TQMAINWINDOW_OBJECT_NAME_STRING)
{ {
TQMainWindow *mw = 0; TQMainWindow *mw = 0;
if (!qwf_stays_on_top) if (!qwf_stays_on_top)
@ -417,11 +417,11 @@ TQWidget *KommanderFactory::createWidget( const TQString &literalClassName, TQWi
return mw; return mw;
} }
#if !defined(QT_NO_SQL) #if !defined(QT_NO_SQL)
else if (className == "TQDataTable") else if (className == TQDATATABLE_OBJECT_NAME_STRING)
return new TQDataTable(parent, name); return new TQDataTable(parent, name);
else if (className == "TQDataBrowser") else if (className == TQDATABROWSER_OBJECT_NAME_STRING)
return new QDesignerDataBrowser2(parent, name); return new QDesignerDataBrowser2(parent, name);
else if (className == "TQDataView") else if (className == TQDATAVIEW_OBJECT_NAME_STRING)
return new QDesignerDataView2(parent, name); return new QDesignerDataView2(parent, name);
#endif #endif
@ -512,9 +512,9 @@ TQWidget *KommanderFactory::createWidgetInternal( const TQDomElement &e, TQWidge
if ( colspan < 1 ) if ( colspan < 1 )
colspan = 1; colspan = 1;
if ( !className.isEmpty() ) { if ( !className.isEmpty() ) {
if ( !layout && className == "QLayoutWidget" ) if ( !layout && className == TQLAYOUTWIDGET_OBJECT_NAME_STRING )
className = "TQWidget"; className = TQWIDGET_OBJECT_NAME_STRING;
if ( layout && className == "QLayoutWidget" ) { if ( layout && className == TQLAYOUTWIDGET_OBJECT_NAME_STRING ) {
// hide layout widgets // hide layout widgets
w = parent; w = parent;
} else { } else {
@ -526,7 +526,7 @@ TQWidget *KommanderFactory::createWidgetInternal( const TQDomElement &e, TQWidge
w = (TQWidget*)obj; w = (TQWidget*)obj;
if ( !toplevel ) if ( !toplevel )
toplevel = w; toplevel = w;
if ( w->inherits( "TQMainWindow" ) ) if ( w->inherits( TQMAINWINDOW_OBJECT_NAME_STRING ) )
w = ( (TQMainWindow*)w )->centralWidget(); w = ( (TQMainWindow*)w )->centralWidget();
if ( layout ) { if ( layout ) {
switch( layoutType( layout ) ) { switch( layoutType( layout ) ) {
@ -556,39 +556,39 @@ TQWidget *KommanderFactory::createWidgetInternal( const TQDomElement &e, TQWidge
createSpacer( n, layout ); createSpacer( n, layout );
} else if ( n.tagName() == "widget" ) { } else if ( n.tagName() == "widget" ) {
TQMap< TQString, TQString> *oldDbControls = dbControls; TQMap< TQString, TQString> *oldDbControls = dbControls;
createWidgetInternal( n, w, layout, n.attribute( "class", "TQWidget" ) ); createWidgetInternal( n, w, layout, n.attribute( "class", TQWIDGET_OBJECT_NAME_STRING ) );
dbControls = oldDbControls; dbControls = oldDbControls;
} else if ( n.tagName() == "hbox" ) { } else if ( n.tagName() == "hbox" ) {
TQLayout *parentLayout = layout; TQLayout *parentLayout = layout;
if ( layout && layout->inherits( "TQGridLayout" ) ) if ( layout && layout->inherits( TQGRIDLAYOUT_OBJECT_NAME_STRING ) )
layout = createLayout( 0, 0, KommanderFactory::HBox ); layout = createLayout( 0, 0, KommanderFactory::HBox );
else else
layout = createLayout( w, layout, KommanderFactory::HBox ); layout = createLayout( w, layout, KommanderFactory::HBox );
obj = layout; obj = layout;
n = n.firstChild().toElement(); n = n.firstChild().toElement();
if ( parentLayout && parentLayout->inherits( "TQGridLayout" ) ) if ( parentLayout && parentLayout->inherits( TQGRIDLAYOUT_OBJECT_NAME_STRING ) )
( (TQGridLayout*)parentLayout )->addMultiCellLayout( layout, row, row + rowspan - 1, col, col + colspan - 1 ); ( (TQGridLayout*)parentLayout )->addMultiCellLayout( layout, row, row + rowspan - 1, col, col + colspan - 1 );
continue; continue;
} else if ( n.tagName() == "grid" ) { } else if ( n.tagName() == "grid" ) {
TQLayout *parentLayout = layout; TQLayout *parentLayout = layout;
if ( layout && layout->inherits( "TQGridLayout" ) ) if ( layout && layout->inherits( TQGRIDLAYOUT_OBJECT_NAME_STRING ) )
layout = createLayout( 0, 0, KommanderFactory::Grid ); layout = createLayout( 0, 0, KommanderFactory::Grid );
else else
layout = createLayout( w, layout, KommanderFactory::Grid ); layout = createLayout( w, layout, KommanderFactory::Grid );
obj = layout; obj = layout;
n = n.firstChild().toElement(); n = n.firstChild().toElement();
if ( parentLayout && parentLayout->inherits( "TQGridLayout" ) ) if ( parentLayout && parentLayout->inherits( TQGRIDLAYOUT_OBJECT_NAME_STRING ) )
( (TQGridLayout*)parentLayout )->addMultiCellLayout( layout, row, row + rowspan - 1, col, col + colspan - 1 ); ( (TQGridLayout*)parentLayout )->addMultiCellLayout( layout, row, row + rowspan - 1, col, col + colspan - 1 );
continue; continue;
} else if ( n.tagName() == "vbox" ) { } else if ( n.tagName() == "vbox" ) {
TQLayout *parentLayout = layout; TQLayout *parentLayout = layout;
if ( layout && layout->inherits( "TQGridLayout" ) ) if ( layout && layout->inherits( TQGRIDLAYOUT_OBJECT_NAME_STRING ) )
layout = createLayout( 0, 0, KommanderFactory::VBox ); layout = createLayout( 0, 0, KommanderFactory::VBox );
else else
layout = createLayout( w, layout, KommanderFactory::VBox ); layout = createLayout( w, layout, KommanderFactory::VBox );
obj = layout; obj = layout;
n = n.firstChild().toElement(); n = n.firstChild().toElement();
if ( parentLayout && parentLayout->inherits( "TQGridLayout" ) ) if ( parentLayout && parentLayout->inherits( TQGRIDLAYOUT_OBJECT_NAME_STRING ) )
( (TQGridLayout*)parentLayout )->addMultiCellLayout( layout, row, row + rowspan - 1, col, col + colspan - 1 ); ( (TQGridLayout*)parentLayout )->addMultiCellLayout( layout, row, row + rowspan - 1, col, col + colspan - 1 );
continue; continue;
} else if ( n.tagName() == "property" && obj ) { } else if ( n.tagName() == "property" && obj ) {
@ -596,14 +596,14 @@ TQWidget *KommanderFactory::createWidgetInternal( const TQDomElement &e, TQWidge
} else if ( n.tagName() == "attribute" && w ) { } else if ( n.tagName() == "attribute" && w ) {
TQString attrib = n.attribute( "name" ); TQString attrib = n.attribute( "name" );
TQVariant v = DomTool::elementToVariant( n.firstChild().toElement(), TQVariant() ); TQVariant v = DomTool::elementToVariant( n.firstChild().toElement(), TQVariant() );
if ( parent->inherits( "TQTabWidget" ) ) { if ( parent->inherits( TQTABWIDGET_OBJECT_NAME_STRING ) ) {
if ( attrib == "title" ) if ( attrib == "title" )
( (TQTabWidget*)parent )->insertTab( w, translate(v.toString()) ); ( (TQTabWidget*)parent )->insertTab( w, translate(v.toString()) );
} else } else
if ( parent->inherits( "TQToolBox" ) ) { if ( parent->inherits( TQTOOLBOX_OBJECT_NAME_STRING ) ) {
if ( attrib == "label" ) if ( attrib == "label" )
( (TQToolBox*)parent )->addItem( w, translate(v.toString()) ); ( (TQToolBox*)parent )->addItem( w, translate(v.toString()) );
}else if ( parent->inherits( "TQWizard" ) ) { }else if ( parent->inherits( TQWIZARD_OBJECT_NAME_STRING ) ) {
if ( attrib == "title" ) if ( attrib == "title" )
( (TQWizard*)parent )->addPage( w, translate(v.toString()) ); ( (TQWizard*)parent )->addPage( w, translate(v.toString()) );
} }
@ -624,18 +624,18 @@ TQLayout *KommanderFactory::createLayout( TQWidget *widget, TQLayout* layout, L
int spacing = defSpacing; int spacing = defSpacing;
int margin = defMargin; int margin = defMargin;
if ( !layout && widget && widget->inherits( "TQTabWidget" ) ) if ( !layout && widget && widget->inherits( TQTABWIDGET_OBJECT_NAME_STRING ) )
widget = ((TQTabWidget*)widget)->currentPage(); widget = ((TQTabWidget*)widget)->currentPage();
if ( !layout && widget && widget->inherits( "TQToolBox" ) ) if ( !layout && widget && widget->inherits( TQTOOLBOX_OBJECT_NAME_STRING ) )
widget = ((TQToolBox*)widget)->currentItem(); widget = ((TQToolBox*)widget)->currentItem();
if ( !layout && widget && widget->inherits( "TQWizard" ) ) if ( !layout && widget && widget->inherits( TQWIZARD_OBJECT_NAME_STRING ) )
widget = ((TQWizard*)widget)->currentPage(); widget = ((TQWizard*)widget)->currentPage();
if ( !layout && widget && widget->inherits( "TQWidgetStack" ) ) if ( !layout && widget && widget->inherits( TQWIDGETSTACK_OBJECT_NAME_STRING ) )
widget = ((TQWidgetStack*)widget)->visibleWidget(); widget = ((TQWidgetStack*)widget)->visibleWidget();
if ( !layout && widget && widget->inherits( "TQGroupBox" ) ) { if ( !layout && widget && widget->inherits( TQGROUPBOX_OBJECT_NAME_STRING ) ) {
TQGroupBox *gb = (TQGroupBox*)widget; TQGroupBox *gb = (TQGroupBox*)widget;
gb->setColumnLayout( 0, Qt::Vertical ); gb->setColumnLayout( 0, Qt::Vertical );
gb->layout()->setMargin( 0 ); gb->layout()->setMargin( 0 );
@ -714,11 +714,11 @@ TQLayout *KommanderFactory::createLayout( TQWidget *widget, TQLayout* layout, L
KommanderFactory::LayoutType KommanderFactory::layoutType( TQLayout *layout ) const KommanderFactory::LayoutType KommanderFactory::layoutType( TQLayout *layout ) const
{ {
if ( layout->inherits( "TQHBoxLayout" ) ) if ( layout->inherits( TQHBOXLAYOUT_OBJECT_NAME_STRING ) )
return HBox; return HBox;
else if ( layout->inherits( "TQVBoxLayout" ) ) else if ( layout->inherits( TQVBOXLAYOUT_OBJECT_NAME_STRING ) )
return VBox; return VBox;
else if ( layout->inherits( "TQGridLayout" ) ) else if ( layout->inherits( TQGRIDLAYOUT_OBJECT_NAME_STRING ) )
return Grid; return Grid;
return NoLayout; return NoLayout;
} }
@ -764,8 +764,8 @@ void KommanderFactory::setProperty( TQObject* obj, const TQString &prop, const T
TQWhatsThis::add( (TQWidget*)obj, translate(v.toString()) ); TQWhatsThis::add( (TQWidget*)obj, translate(v.toString()) );
} }
#ifndef QT_NO_SQL #ifndef QT_NO_SQL
if ( prop == "database" && !obj->inherits( "TQDataView" ) if ( prop == "database" && !obj->inherits( TQDATAVIEW_OBJECT_NAME_STRING )
&& !obj->inherits( "TQDataBrowser" ) ) { && !obj->inherits( TQDATABROWSER_OBJECT_NAME_STRING ) ) {
TQStringList lst = DomTool::elementToVariant( e, TQVariant( TQStringList() ) ).toStringList(); TQStringList lst = DomTool::elementToVariant( e, TQVariant( TQStringList() ) ).toStringList();
if ( lst.count() > 2 ) { if ( lst.count() > 2 ) {
if ( dbControls ) if ( dbControls )
@ -775,7 +775,7 @@ void KommanderFactory::setProperty( TQObject* obj, const TQString &prop, const T
} }
} else if ( prop == "database" ) { } else if ( prop == "database" ) {
TQStringList lst = DomTool::elementToVariant( e, TQVariant( TQStringList() ) ).toStringList(); TQStringList lst = DomTool::elementToVariant( e, TQVariant( TQStringList() ) ).toStringList();
if ( lst.count() == 2 && obj->inherits( "TQWidget" ) ) { if ( lst.count() == 2 && obj->inherits( TQWIDGET_OBJECT_NAME_STRING ) ) {
SqlWidgetConnection conn( lst[ 0 ], lst[ 1 ] ); SqlWidgetConnection conn( lst[ 0 ], lst[ 1 ] );
sqlWidgetConnections.insert( (TQWidget*)obj, conn ); sqlWidgetConnections.insert( (TQWidget*)obj, conn );
dbControls = conn.dbControls; dbControls = conn.dbControls;
@ -789,7 +789,7 @@ void KommanderFactory::setProperty( TQObject* obj, const TQString &prop, const T
noDatabaseWidgets << obj->name(); noDatabaseWidgets << obj->name();
} }
} else if ( prop == "buttonGroupId" ) { } else if ( prop == "buttonGroupId" ) {
if ( obj->inherits( "TQButton" ) && obj->parent()->inherits( "TQButtonGroup" ) ) if ( obj->inherits( TQBUTTON_OBJECT_NAME_STRING ) && obj->parent()->inherits( TQBUTTONGROUP_OBJECT_NAME_STRING ) )
( (TQButtonGroup*)obj->parent() )->insert( (TQButton*)obj, v.toInt() ); ( (TQButtonGroup*)obj->parent() )->insert( (TQButton*)obj, v.toInt() );
} }
@ -884,7 +884,7 @@ void KommanderFactory::createSpacer( const TQDomElement &e, TQLayout *layout )
TQSpacerItem *item = new TQSpacerItem( w, h, orient == Qt::Horizontal ? sizeType : TQSizePolicy::Minimum, TQSpacerItem *item = new TQSpacerItem( w, h, orient == Qt::Horizontal ? sizeType : TQSizePolicy::Minimum,
orient == Qt::Vertical ? sizeType : TQSizePolicy::Minimum ); orient == Qt::Vertical ? sizeType : TQSizePolicy::Minimum );
if ( layout ) { if ( layout ) {
if ( layout->inherits( "TQBoxLayout" ) ) if ( layout->inherits( TQBOXLAYOUT_OBJECT_NAME_STRING ) )
( (TQBoxLayout*)layout )->addItem( item ); ( (TQBoxLayout*)layout )->addItem( item );
else else
( (TQGridLayout*)layout )->addMultiCell( item, row, row + rowspan - 1, col, col + colspan - 1, ( (TQGridLayout*)layout )->addMultiCell( item, row, row + rowspan - 1, col, col + colspan - 1,
@ -1148,7 +1148,7 @@ void KommanderFactory::loadTabOrder( const TQDomElement &e )
void KommanderFactory::createColumn( const TQDomElement &e, TQWidget *widget ) void KommanderFactory::createColumn( const TQDomElement &e, TQWidget *widget )
{ {
if ( widget->inherits( "TQListView" ) && e.tagName() == "column" ) { if ( widget->inherits( TQLISTVIEW_OBJECT_NAME_STRING ) && e.tagName() == "column" ) {
TQListView *lv = (TQListView*)widget; TQListView *lv = (TQListView*)widget;
TQDomElement n = e.firstChild().toElement(); TQDomElement n = e.firstChild().toElement();
TQPixmap pix; TQPixmap pix;
@ -1182,10 +1182,10 @@ void KommanderFactory::createColumn( const TQDomElement &e, TQWidget *widget )
lv->header()->setResizeEnabled( resizeable, i ); lv->header()->setResizeEnabled( resizeable, i );
} }
#ifndef QT_NO_TABLE #ifndef QT_NO_TABLE
else if ( widget->inherits( "TQTable" ) ) { else if ( widget->inherits( TQTABLE_OBJECT_NAME_STRING ) ) {
TQTable *table = (TQTable*)widget; TQTable *table = (TQTable*)widget;
#ifndef QT_NO_SQL #ifndef QT_NO_SQL
bool isSql = (widget->inherits( "TQDataTable" )); bool isSql = (widget->inherits( TQDATATABLE_OBJECT_NAME_STRING ));
#endif #endif
bool isRow; bool isRow;
if ( ( isRow = e.tagName() == "row" ) ) if ( ( isRow = e.tagName() == "row" ) )
@ -1270,14 +1270,14 @@ void KommanderFactory::loadItem( const TQDomElement &e, TQPixmap &pix, TQString
void KommanderFactory::createItem( const TQDomElement &e, TQWidget *widget, TQListViewItem *i ) void KommanderFactory::createItem( const TQDomElement &e, TQWidget *widget, TQListViewItem *i )
{ {
if ( widget->inherits( "TQListBox" ) || widget->inherits( "TQComboBox" ) ) { if ( widget->inherits( TQLISTBOX_OBJECT_NAME_STRING ) || widget->inherits( TQCOMBOBOX_OBJECT_NAME_STRING ) ) {
TQDomElement n = e.firstChild().toElement(); TQDomElement n = e.firstChild().toElement();
TQPixmap pix; TQPixmap pix;
bool hasPixmap = false; bool hasPixmap = false;
TQString txt; TQString txt;
loadItem( n, pix, txt, hasPixmap ); loadItem( n, pix, txt, hasPixmap );
TQListBox *lb = 0; TQListBox *lb = 0;
if ( widget->inherits( "TQListBox" ) ) if ( widget->inherits( TQLISTBOX_OBJECT_NAME_STRING ) )
lb = (TQListBox*)widget; lb = (TQListBox*)widget;
else else
lb = ( (TQComboBox*)widget)->listBox(); lb = ( (TQComboBox*)widget)->listBox();
@ -1287,7 +1287,7 @@ void KommanderFactory::createItem( const TQDomElement &e, TQWidget *widget, TQLi
new TQListBoxText( lb, txt ); new TQListBoxText( lb, txt );
} }
#ifndef QT_NO_ICONVIEW #ifndef QT_NO_ICONVIEW
} else if ( widget->inherits( "TQIconView" ) ) { } else if ( widget->inherits( TQICONVIEW_OBJECT_NAME_STRING ) ) {
TQDomElement n = e.firstChild().toElement(); TQDomElement n = e.firstChild().toElement();
TQPixmap pix; TQPixmap pix;
bool hasPixmap = false; bool hasPixmap = false;
@ -1297,7 +1297,7 @@ void KommanderFactory::createItem( const TQDomElement &e, TQWidget *widget, TQLi
TQIconView *iv = (TQIconView*)widget; TQIconView *iv = (TQIconView*)widget;
new TQIconViewItem( iv, txt, pix ); new TQIconViewItem( iv, txt, pix );
#endif #endif
} else if ( widget->inherits( "TQListView" ) ) { } else if ( widget->inherits( TQLISTVIEW_OBJECT_NAME_STRING ) ) {
TQDomElement n = e.firstChild().toElement(); TQDomElement n = e.firstChild().toElement();
TQPixmap pix; TQPixmap pix;
TQValueList<TQPixmap> pixmaps; TQValueList<TQPixmap> pixmaps;
@ -1358,7 +1358,7 @@ void KommanderFactory::loadChildAction( TQObject *parent, const TQDomElement &e
} }
n2 = n2.nextSibling().toElement(); n2 = n2.nextSibling().toElement();
} }
if ( !parent->inherits( "TQAction" ) ) if ( !parent->inherits( TQACTION_OBJECT_NAME_STRING ) )
actionList.append( a ); actionList.append( a );
} else if ( n.tagName() == "actiongroup" ) { } else if ( n.tagName() == "actiongroup" ) {
a = new TQActionGroup( parent ); a = new TQActionGroup( parent );
@ -1375,7 +1375,7 @@ void KommanderFactory::loadChildAction( TQObject *parent, const TQDomElement &e
} }
n2 = n2.nextSibling().toElement(); n2 = n2.nextSibling().toElement();
} }
if ( !parent->inherits( "TQAction" ) ) if ( !parent->inherits( TQACTION_OBJECT_NAME_STRING ) )
actionList.append( a ); actionList.append( a );
} }
if ( a ) if ( a )
@ -1415,7 +1415,7 @@ void KommanderFactory::loadToolBars( const TQDomElement &e )
} else if ( n2.tagName() == "separator" ) { } else if ( n2.tagName() == "separator" ) {
tb->addSeparator(); tb->addSeparator();
} else if ( n2.tagName() == "widget" ) { } else if ( n2.tagName() == "widget" ) {
(void)createWidgetInternal( n2, tb, 0, n2.attribute( "class", "TQWidget" ) ); (void)createWidgetInternal( n2, tb, 0, n2.attribute( "class", TQWIDGET_OBJECT_NAME_STRING ) );
} else if ( n2.tagName() == "property" ) { } else if ( n2.tagName() == "property" ) {
setProperty( tb, n2.attribute( "name" ), n2.firstChild().toElement() ); setProperty( tb, n2.attribute( "name" ), n2.firstChild().toElement() );
} }
@ -1460,7 +1460,7 @@ TQAction *KommanderFactory::findAction( const TQString &name )
for ( TQAction *a = actionList.first(); a; a = actionList.next() ) { for ( TQAction *a = actionList.first(); a; a = actionList.next() ) {
if ( TQString( a->name() ) == name ) if ( TQString( a->name() ) == name )
return a; return a;
TQAction *ac = (TQAction*)a->child( name.latin1(), "TQAction" ); TQAction *ac = (TQAction*)a->child( name.latin1(), TQACTION_OBJECT_NAME_STRING );
if ( ac ) if ( ac )
return ac; return ac;
} }

@ -413,12 +413,12 @@ void KommanderWidget::printError(const TQString& a_error) const
case KDialogBase::Yes: case KDialogBase::Yes:
break; break;
case KDialogBase::Cancel: case KDialogBase::Cancel:
if (parentDialog()->inherits("TQDialog")) if (parentDialog()->inherits(TQDIALOG_OBJECT_NAME_STRING))
{ {
parentDialog()->close(); parentDialog()->close();
exit(-1); exit(-1);
} }
else if (parentDialog()->inherits("TQMainWindow")) else if (parentDialog()->inherits(TQMAINWINDOW_OBJECT_NAME_STRING))
kapp->quit(); kapp->quit();
} }
} }
@ -655,7 +655,7 @@ TQWidget* KommanderWidget::parentDialog() const
while (superParent->parent()) while (superParent->parent())
{ {
superParent = superParent->parent(); superParent = superParent->parent();
if (superParent->inherits("TQDialog") || superParent->inherits("TQMainWindow")) if (superParent->inherits(TQDIALOG_OBJECT_NAME_STRING) || superParent->inherits(TQMAINWINDOW_OBJECT_NAME_STRING))
break; break;
} }
return (TQWidget*)superParent; return (TQWidget*)superParent;
@ -695,7 +695,7 @@ TQString KommanderWidget::handleDCOP(const int function, const TQStringList& arg
case DCOP::children: case DCOP::children:
{ {
TQStringList matching; TQStringList matching;
TQObjectList* widgets = current->queryList("TQWidget", 0, false, args.count() == 0 || args[0] != "false"); TQObjectList* widgets = current->queryList(TQWIDGET_OBJECT_NAME_STRING, 0, false, args.count() == 0 || args[0] != "false");
for (TQObject* w = widgets->first(); w; w = widgets->next()) for (TQObject* w = widgets->first(); w; w = widgets->next())
if (w->name() && (dynamic_cast<KommanderWidget*>(w))) if (w->name() && (dynamic_cast<KommanderWidget*>(w)))
matching.append(w->name()); matching.append(w->name());

@ -45,7 +45,7 @@ CloseButton::CloseButton(TQWidget* a_parent, const char* a_name)
while (parent->parent() != 0) while (parent->parent() != 0)
{ {
parent = parent->parent(); parent = parent->parent();
if (parent->inherits("TQDialog")) if (parent->inherits(TQDIALOG_OBJECT_NAME_STRING))
break; break;
} }
connect(this, TQT_SIGNAL(clicked()), parent, TQT_SLOT(reject())); connect(this, TQT_SIGNAL(clicked()), parent, TQT_SLOT(reject()));

@ -1680,7 +1680,7 @@ void KDockManager::activate()
obj->show(); obj->show();
} }
} }
if ( !main->inherits("TQDialog") ) main->show(); if ( !main->inherits(TQDIALOG_OBJECT_NAME_STRING) ) main->show();
} }
bool KDockManager::eventFilter( TQObject *obj, TQEvent *event ) bool KDockManager::eventFilter( TQObject *obj, TQEvent *event )
@ -3044,7 +3044,7 @@ void KDockArea::resizeEvent(TQResizeEvent *rsize)
#ifndef NO_KDE2 #ifndef NO_KDE2
// kdDebug(282)<<"KDockArea::resize"<<endl; // kdDebug(282)<<"KDockArea::resize"<<endl;
#endif #endif
TQObjectList *list=queryList("TQWidget",0,false); TQObjectList *list=queryList(TQWIDGET_OBJECT_NAME_STRING,0,false);
TQObjectListIt it( *list ); // iterate over the buttons TQObjectListIt it( *list ); // iterate over the buttons
TQObject *obj; TQObject *obj;

@ -752,7 +752,7 @@ void KMdiChildFrm::setClient( KMdiChildView *w, bool bAutomaticResize )
// memorize the focuses in a dictionary because they will get lost during reparenting // memorize the focuses in a dictionary because they will get lost during reparenting
TQDict<FocusPolicy>* pFocPolDict = new TQDict<FocusPolicy>; TQDict<FocusPolicy>* pFocPolDict = new TQDict<FocusPolicy>;
pFocPolDict->setAutoDelete( true ); pFocPolDict->setAutoDelete( true );
TQObjectList *list = m_pClient->queryList( "TQWidget" ); TQObjectList *list = m_pClient->queryList( TQWIDGET_OBJECT_NAME_STRING );
TQObjectListIt it( *list ); // iterate over the buttons TQObjectListIt it( *list ); // iterate over the buttons
TQObject * obj; TQObject * obj;
int i = 1; int i = 1;
@ -833,7 +833,7 @@ void KMdiChildFrm::unsetClient( TQPoint positionOffset )
m_pClient->setMaximumSize( maxs.width(), maxs.height() ); m_pClient->setMaximumSize( maxs.width(), maxs.height() );
// remember the focus policies using the dictionary and reset them // remember the focus policies using the dictionary and reset them
TQObjectList *list = m_pClient->queryList( "TQWidget" ); TQObjectList *list = m_pClient->queryList( TQWIDGET_OBJECT_NAME_STRING );
TQObjectListIt it( *list ); // iterate over all child widgets of child frame TQObjectListIt it( *list ); // iterate over all child widgets of child frame
TQObject * obj; TQObject * obj;
TQWidget* firstFocusableChildWidget = 0; TQWidget* firstFocusableChildWidget = 0;
@ -887,7 +887,7 @@ void KMdiChildFrm::unsetClient( TQPoint positionOffset )
void KMdiChildFrm::linkChildren( TQDict<FocusPolicy>* pFocPolDict ) void KMdiChildFrm::linkChildren( TQDict<FocusPolicy>* pFocPolDict )
{ {
// reset the focus policies for all widgets in the view (take them from the dictionary) // reset the focus policies for all widgets in the view (take them from the dictionary)
TQObjectList* list = m_pClient->queryList( "TQWidget" ); TQObjectList* list = m_pClient->queryList( TQWIDGET_OBJECT_NAME_STRING );
TQObjectListIt it( *list ); // iterate over all child widgets of child frame TQObjectListIt it( *list ); // iterate over all child widgets of child frame
TQObject* obj; TQObject* obj;
while ( ( obj = it.current() ) != 0 ) while ( ( obj = it.current() ) != 0 )
@ -899,7 +899,7 @@ void KMdiChildFrm::linkChildren( TQDict<FocusPolicy>* pFocPolDict )
if ( pFocPol != 0 ) if ( pFocPol != 0 )
widg->setFocusPolicy( *pFocPol ); widg->setFocusPolicy( *pFocPol );
if ( !( widg->inherits( "TQPopupMenu" ) ) ) if ( !( widg->inherits( TQPOPUPMENU_OBJECT_NAME_STRING ) ) )
widg->installEventFilter( this ); widg->installEventFilter( this );
} }
@ -936,7 +936,7 @@ TQDict<TQWidget::FocusPolicy>* KMdiChildFrm::unlinkChildren()
TQDict<FocusPolicy>* pFocPolDict = new TQDict<FocusPolicy>; TQDict<FocusPolicy>* pFocPolDict = new TQDict<FocusPolicy>;
pFocPolDict->setAutoDelete( true ); pFocPolDict->setAutoDelete( true );
TQObjectList *list = m_pClient->queryList( "TQWidget" ); TQObjectList *list = m_pClient->queryList( TQWIDGET_OBJECT_NAME_STRING );
TQObjectListIt it( *list ); // iterate over all child widgets of child frame TQObjectListIt it( *list ); // iterate over all child widgets of child frame
TQObject * obj; TQObject * obj;
int i = 1; int i = 1;
@ -1155,7 +1155,7 @@ bool KMdiChildFrm::eventFilter( TQObject *obj, TQEvent *e )
// if we lost a child we uninstall ourself as event filter for the lost // if we lost a child we uninstall ourself as event filter for the lost
// child and its children // child and its children
TQObject* pLostChild = ( ( TQChildEvent* ) e )->child(); TQObject* pLostChild = ( ( TQChildEvent* ) e )->child();
if ( ( pLostChild != 0L ) /*&& (pLostChild->inherits("TQWidget"))*/ ) if ( ( pLostChild != 0L ) /*&& (pLostChild->inherits(TQWIDGET_OBJECT_NAME_STRING))*/ )
{ {
TQObjectList* list = pLostChild->queryList(); TQObjectList* list = pLostChild->queryList();
list->insert( 0, pLostChild ); // add the lost child to the list too, just to save code list->insert( 0, pLostChild ); // add the lost child to the list too, just to save code
@ -1180,7 +1180,7 @@ bool KMdiChildFrm::eventFilter( TQObject *obj, TQEvent *e )
if ( ( pNewChild != 0L ) && ::qt_cast<TQWidget*>( pNewChild ) ) if ( ( pNewChild != 0L ) && ::qt_cast<TQWidget*>( pNewChild ) )
{ {
TQWidget * pNewWidget = static_cast<TQWidget*>( pNewChild ); TQWidget * pNewWidget = static_cast<TQWidget*>( pNewChild );
TQObjectList *list = pNewWidget->queryList( "TQWidget" ); TQObjectList *list = pNewWidget->queryList( TQWIDGET_OBJECT_NAME_STRING );
list->insert( 0, pNewChild ); // add the new child to the list too, just to save code list->insert( 0, pNewChild ); // add the new child to the list too, just to save code
TQObjectListIt it( *list ); // iterate over all new child widgets TQObjectListIt it( *list ); // iterate over all new child widgets
TQObject * obj; TQObject * obj;

@ -495,7 +495,7 @@ void KMdiChildView::slot_childDestroyed()
const TQObject * pLostChild = TQObject::sender(); const TQObject * pLostChild = TQObject::sender();
if ( pLostChild && ( pLostChild->isWidgetType() ) ) if ( pLostChild && ( pLostChild->isWidgetType() ) )
{ {
TQObjectList* list = ( ( TQObject* ) ( pLostChild ) ) ->queryList( "TQWidget" ); TQObjectList* list = ( ( TQObject* ) ( pLostChild ) ) ->queryList( TQWIDGET_OBJECT_NAME_STRING );
list->insert( 0, pLostChild ); // add the lost child to the list too, just to save code list->insert( 0, pLostChild ); // add the lost child to the list too, just to save code
TQObjectListIt it( *list ); // iterate over all lost child widgets TQObjectListIt it( *list ); // iterate over all lost child widgets
TQObject* obj; TQObject* obj;
@ -544,7 +544,7 @@ bool KMdiChildView::eventFilter( TQObject *obj, TQEvent *e )
{ {
if ( obj->isWidgetType() ) if ( obj->isWidgetType() )
{ {
TQObjectList * list = queryList( "TQWidget" ); TQObjectList * list = queryList( TQWIDGET_OBJECT_NAME_STRING );
if ( list->find( obj ) != -1 ) if ( list->find( obj ) != -1 )
m_focusedChildWidget = ( TQWidget* ) obj; m_focusedChildWidget = ( TQWidget* ) obj;
@ -568,7 +568,7 @@ bool KMdiChildView::eventFilter( TQObject *obj, TQEvent *e )
TQObject * pLostChild = ( ( TQChildEvent* ) e ) ->child(); TQObject * pLostChild = ( ( TQChildEvent* ) e ) ->child();
if ( ( pLostChild != 0L ) && ( pLostChild->isWidgetType() ) ) if ( ( pLostChild != 0L ) && ( pLostChild->isWidgetType() ) )
{ {
TQObjectList * list = pLostChild->queryList( "TQWidget" ); TQObjectList * list = pLostChild->queryList( TQWIDGET_OBJECT_NAME_STRING );
list->insert( 0, pLostChild ); // add the lost child to the list too, just to save code list->insert( 0, pLostChild ); // add the lost child to the list too, just to save code
TQObjectListIt it( *list ); // iterate over all lost child widgets TQObjectListIt it( *list ); // iterate over all lost child widgets
TQObject * o; TQObject * o;
@ -601,7 +601,7 @@ bool KMdiChildView::eventFilter( TQObject *obj, TQEvent *e )
TQWidget * pNewWidget = ( TQWidget* ) pNewChild; TQWidget * pNewWidget = ( TQWidget* ) pNewChild;
if ( pNewWidget->testWFlags( Qt::WType_Dialog | Qt::WShowModal ) ) if ( pNewWidget->testWFlags( Qt::WType_Dialog | Qt::WShowModal ) )
return false; return false;
TQObjectList *list = pNewWidget->queryList( "TQWidget" ); TQObjectList *list = pNewWidget->queryList( TQWIDGET_OBJECT_NAME_STRING );
list->insert( 0, pNewChild ); // add the new child to the list too, just to save code list->insert( 0, pNewChild ); // add the new child to the list too, just to save code
TQObjectListIt it( *list ); // iterate over all new child widgets TQObjectListIt it( *list ); // iterate over all new child widgets
TQObject * o; TQObject * o;
@ -646,7 +646,7 @@ bool KMdiChildView::eventFilter( TQObject *obj, TQEvent *e )
/** Switches interposing in event loop of all current child widgets off. */ /** Switches interposing in event loop of all current child widgets off. */
void KMdiChildView::removeEventFilterForAllChildren() void KMdiChildView::removeEventFilterForAllChildren()
{ {
TQObjectList* list = queryList( "TQWidget" ); TQObjectList* list = queryList( TQWIDGET_OBJECT_NAME_STRING );
TQObjectListIt it( *list ); // iterate over all child widgets TQObjectListIt it( *list ); // iterate over all child widgets
TQObject* obj; TQObject* obj;
while ( ( obj = it.current() ) != 0 ) while ( ( obj = it.current() ) != 0 )

@ -34,7 +34,7 @@ void KMdiFocusList::addWidgetTree( TQWidget* w )
w->setFocusPolicy( TQWidget::ClickFocus ); w->setFocusPolicy( TQWidget::ClickFocus );
kdDebug( 760 ) << "KMdiFocusList::addWidgetTree: adding toplevel" << endl; kdDebug( 760 ) << "KMdiFocusList::addWidgetTree: adding toplevel" << endl;
connect( w, TQT_SIGNAL( destroyed( TQObject * ) ), this, TQT_SLOT( objectHasBeenDestroyed( TQObject* ) ) ); connect( w, TQT_SIGNAL( destroyed( TQObject * ) ), this, TQT_SLOT( objectHasBeenDestroyed( TQObject* ) ) );
TQObjectList *l = w->queryList( "TQWidget" ); TQObjectList *l = w->queryList( TQWIDGET_OBJECT_NAME_STRING );
TQObjectListIt it( *l ); TQObjectListIt it( *l );
TQObject *obj; TQObject *obj;
while ( ( obj = it.current() ) != 0 ) while ( ( obj = it.current() ) != 0 )

@ -209,7 +209,7 @@ void CSSSelector::openCSSEditor(TQListViewItem * i){
TQListView *lv = i->listView(); TQListView *lv = i->listView();
TQListViewItem *temp; TQListViewItem *temp;
TQString s; TQString s;
TQObjectList *l = queryList( "TQListView" ); TQObjectList *l = queryList( TQLISTVIEW_OBJECT_NAME_STRING );
TQObjectListIt it( *l ); // iterate over the listviews TQObjectListIt it( *l ); // iterate over the listviews
TQObject *obj; TQObject *obj;
@ -291,7 +291,7 @@ void CSSSelector::openCSSEditor(TQListViewItem * i){
} }
void CSSSelector::setCurrentListView(TQWidget* w){ void CSSSelector::setCurrentListView(TQWidget* w){
TQObjectList *l = w->queryList( "TQListView" ); TQObjectList *l = w->queryList( TQLISTVIEW_OBJECT_NAME_STRING );
m_currentListView = static_cast<TQListView*>(l->first()); m_currentListView = static_cast<TQListView*>(l->first());
} }

@ -231,7 +231,7 @@ void VisualFrameEditor::paintEvent ( TQPaintEvent * ){
delete m_firstInsertedSA; delete m_firstInsertedSA;
m_firstInsertedSA = 0L; m_firstInsertedSA = 0L;
TQObjectList* splitterList = queryList("TQSplitter"); TQObjectList* splitterList = queryList(TQSPLITTER_OBJECT_NAME_STRING);
for (uint i = 0; i < splitterList->count(); i++) { for (uint i = 0; i < splitterList->count(); i++) {
TQObject* o = splitterList->at(i); TQObject* o = splitterList->at(i);
removeChild(o); //this will delete all childr of "o" removeChild(o); //this will delete all childr of "o"
@ -301,7 +301,7 @@ void VisualFrameEditor::drawGUI(treeNode *n, TQWidget* parent){
} }
else { else {
SelectableArea *sa=new SelectableArea(parent,n->label().ascii()); SelectableArea *sa=new SelectableArea(parent,n->label().ascii());
if(parent->isA("TQSplitter")) dynamic_cast<TQSplitter *>(parent)->setResizeMode(sa->view(),TQSplitter::KeepSize ); if(parent->isA(TQSPLITTER_OBJECT_NAME_STRING)) dynamic_cast<TQSplitter *>(parent)->setResizeMode(sa->view(),TQSplitter::KeepSize );
else else
if(!m_firstInsertedSA) m_firstInsertedSA = sa; if(!m_firstInsertedSA) m_firstInsertedSA = sa;
sa->view()->setGeometry(n->atts()->geometry()); sa->view()->setGeometry(n->atts()->geometry());

@ -54,7 +54,7 @@ TQWidget* TableItem::createEditor() const
void TableItem::setContentFromEditor(TQWidget *w) void TableItem::setContentFromEditor(TQWidget *w)
{ {
if (w->inherits( "TQTextEdit" )) if (w->inherits( TQTEXTEDIT_OBJECT_NAME_STRING ))
setText(((TQTextEdit*)w)->text()); setText(((TQTextEdit*)w)->text());
else else
TQTableItem::setContentFromEditor(w); TQTableItem::setContentFromEditor(w);

Loading…
Cancel
Save