Replaced various '#define' with actual strings - part 4

Signed-off-by: Michele Calgaro <michele.calgaro@yahoo.it>
pull/32/head
Michele Calgaro 1 year ago
parent aefcba8280
commit 676a13490d
Signed by: MicheleC
GPG Key ID: 2A75B7CA8ADED5CF

@ -107,7 +107,7 @@ int AutoToolsAction::plug( TQWidget* w, int index )
if (kapp && !kapp->authorizeTDEAction(name())) if (kapp && !kapp->authorizeTDEAction(name()))
return -1; return -1;
if ( ::tqqt_cast<TQToolButton*>( w ) ) if ( ::tqt_cast<TQToolButton*>( w ) )
{ {
TQToolButton* tb = static_cast<TQToolButton*>( w ); TQToolButton* tb = static_cast<TQToolButton*>( w );
connect( tb, TQT_SIGNAL( clicked() ), this, TQT_SLOT( activate() ) ); connect( tb, TQT_SIGNAL( clicked() ), this, TQT_SLOT( activate() ) );
@ -145,7 +145,7 @@ void AutoToolsAction::updateEnabled( int i )
{ {
TQWidget* w = container( i ); TQWidget* w = container( i );
if ( ::tqqt_cast<TQToolButton*>( w ) ) if ( ::tqt_cast<TQToolButton*>( w ) )
static_cast<TQToolButton*>( w )->setEnabled( isEnabled() ); static_cast<TQToolButton*>( w )->setEnabled( isEnabled() );
else else
TDEAction::updateEnabled( i ) ; TDEAction::updateEnabled( i ) ;

@ -105,7 +105,7 @@ bool QDesignerAction::addTo( TQWidget *w )
if ( !widgetToInsert ) if ( !widgetToInsert )
return TQAction::addTo( w ); return TQAction::addTo( w );
if ( ::tqqt_cast<TQPopupMenu*>(w) ) if ( ::tqt_cast<TQPopupMenu*>(w) )
return FALSE; return FALSE;
widgetToInsert->reparent( w, TQPoint( 0, 0 ), FALSE ); widgetToInsert->reparent( w, TQPoint( 0, 0 ), FALSE );
@ -184,11 +184,11 @@ QSeparatorAction::QSeparatorAction( TQObject *parent )
bool QSeparatorAction::addTo( TQWidget *w ) bool QSeparatorAction::addTo( TQWidget *w )
{ {
if ( ::tqqt_cast<TQToolBar*>(w) ) { if ( ::tqt_cast<TQToolBar*>(w) ) {
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 ( ::tqqt_cast<TQPopupMenu*>(w) ) { } else if ( ::tqt_cast<TQPopupMenu*>(w) ) {
idx = ( (TQPopupMenu*)w )->count(); idx = ( (TQPopupMenu*)w )->count();
( (TQPopupMenu*)w )->insertSeparator( idx ); ( (TQPopupMenu*)w )->insertSeparator( idx );
return TRUE; return TRUE;
@ -198,10 +198,10 @@ bool QSeparatorAction::addTo( TQWidget *w )
bool QSeparatorAction::removeFrom( TQWidget *w ) bool QSeparatorAction::removeFrom( TQWidget *w )
{ {
if ( ::tqqt_cast<TQToolBar*>(w) ) { if ( ::tqt_cast<TQToolBar*>(w) ) {
delete wid; delete wid;
return TRUE; return TRUE;
} else if ( ::tqqt_cast<TQPopupMenu*>(w) ) { } else if ( ::tqt_cast<TQPopupMenu*>(w) ) {
( (TQPopupMenu*)w )->removeItemAt( idx ); ( (TQPopupMenu*)w )->removeItemAt( idx );
return TRUE; return TRUE;
} }
@ -250,7 +250,7 @@ void QDesignerToolBar::findFormWindow()
{ {
TQWidget *w = this; TQWidget *w = this;
while ( w ) { while ( w ) {
formWindow = ::tqqt_cast<FormWindow*>(w); formWindow = ::tqt_cast<FormWindow*>(w);
if ( formWindow ) if ( formWindow )
break; break;
w = w->parentWidget(); w = w->parentWidget();
@ -261,10 +261,10 @@ 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 ( ::tqqt_cast<TQActionGroup*>(a) ) { if ( ::tqt_cast<TQActionGroup*>(a) ) {
( (QDesignerActionGroup*)a )->widget()->installEventFilter( this ); ( (QDesignerActionGroup*)a )->widget()->installEventFilter( this );
actionMap.insert( ( (QDesignerActionGroup*)a )->widget(), a ); actionMap.insert( ( (QDesignerActionGroup*)a )->widget(), a );
} else if ( ::tqqt_cast<QSeparatorAction*>(a) ) { } else if ( ::tqt_cast<QSeparatorAction*>(a) ) {
( (QSeparatorAction*)a )->widget()->installEventFilter( this ); ( (QSeparatorAction*)a )->widget()->installEventFilter( this );
actionMap.insert( ( (QSeparatorAction*)a )->widget(), a ); actionMap.insert( ( (QSeparatorAction*)a )->widget(), a );
} else { } else {
@ -275,7 +275,7 @@ void QDesignerToolBar::addAction( TQAction *a )
static void fixObject( TQObject *&o ) static void fixObject( TQObject *&o )
{ {
while ( o && o->parent() && !::tqqt_cast<QDesignerToolBar*>(o->parent()) ) while ( o && o->parent() && !::tqt_cast<QDesignerToolBar*>(o->parent()) )
o = o->parent(); o = o->parent();
} }
@ -393,7 +393,7 @@ void QDesignerToolBar::buttonContextMenuEvent( TQContextMenuEvent *e, TQObject *
const int ID_SEP = 2; const int ID_SEP = 2;
const int ID_DELTOOLBAR = 3; const int ID_DELTOOLBAR = 3;
TQMap<TQWidget*, TQAction*>::Iterator it = actionMap.find( (TQWidget*)o ); TQMap<TQWidget*, TQAction*>::Iterator it = actionMap.find( (TQWidget*)o );
if ( it != actionMap.end() && ::tqqt_cast<QSeparatorAction*>(*it) ) if ( it != actionMap.end() && ::tqt_cast<QSeparatorAction*>(*it) )
menu.insertItem( i18n( "Delete Separator" ), ID_DELETE ); menu.insertItem( i18n( "Delete Separator" ), ID_DELETE );
else else
menu.insertItem( i18n( "Delete Item" ), ID_DELETE ); menu.insertItem( i18n( "Delete Item" ), ID_DELETE );
@ -494,11 +494,11 @@ void QDesignerToolBar::buttonMouseMoveEvent( TQMouseEvent *e, TQObject *o )
TQApplication::sendPostedEvents(); TQApplication::sendPostedEvents();
adjustSize(); adjustSize();
TQString type = ::tqqt_cast<TQActionGroup*>(a) ? TQString( "application/x-designer-actiongroup" ) : TQString type = ::tqt_cast<TQActionGroup*>(a) ? TQString( "application/x-designer-actiongroup" ) :
::tqqt_cast<QSeparatorAction*>(a) ? TQString( "application/x-designer-separator" ) : TQString( "application/x-designer-actions" ); ::tqt_cast<QSeparatorAction*>(a) ? TQString( "application/x-designer-separator" ) : TQString( "application/x-designer-actions" );
TQStoredDrag *drag = new ActionDrag( type, a, this ); TQStoredDrag *drag = new ActionDrag( type, a, this );
drag->setPixmap( a->iconSet().pixmap() ); drag->setPixmap( a->iconSet().pixmap() );
if ( ::tqqt_cast<QDesignerAction*>(a) ) { if ( ::tqt_cast<QDesignerAction*>(a) ) {
if ( formWindow->widgets()->find( ( (QDesignerAction*)a )->widget() ) ) if ( formWindow->widgets()->find( ( (QDesignerAction*)a )->widget() ) )
formWindow->selectWidget( ( TQT_TQOBJECT(( (QDesignerAction*)a )->widget())), FALSE ); formWindow->selectWidget( ( TQT_TQOBJECT(( (QDesignerAction*)a )->widget())), FALSE );
} }
@ -555,11 +555,11 @@ void QDesignerToolBar::dropEvent( TQDropEvent *e )
if ( e->provides( "application/x-designer-actions" ) || if ( e->provides( "application/x-designer-actions" ) ||
e->provides( "application/x-designer-separator" ) ) { e->provides( "application/x-designer-separator" ) ) {
if ( e->provides( "application/x-designer-actions" ) ) if ( e->provides( "application/x-designer-actions" ) )
a = ::tqqt_cast<QDesignerAction*>(ActionDrag::action()); a = ::tqt_cast<QDesignerAction*>(ActionDrag::action());
else else
a = ::tqqt_cast<QSeparatorAction*>(ActionDrag::action()); a = ::tqt_cast<QSeparatorAction*>(ActionDrag::action());
} else { } else {
a = ::tqqt_cast<QDesignerActionGroup*>(ActionDrag::action()); a = ::tqt_cast<QDesignerActionGroup*>(ActionDrag::action());
} }
if ( actionList.findRef( a ) != -1 ) { if ( actionList.findRef( a ) != -1 ) {
@ -588,14 +588,14 @@ 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 ( ::tqqt_cast<TQActionGroup*>(a) ) { if ( ::tqt_cast<TQActionGroup*>(a) ) {
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 );
} else if ( ::tqqt_cast<QDesignerAction*>(a) ) { } else if ( ::tqt_cast<QDesignerAction*>(a) ) {
actionMap.insert( ( (QDesignerAction*)a )->widget(), a ); actionMap.insert( ( (QDesignerAction*)a )->widget(), a );
( (QDesignerAction*)a )->widget()->installEventFilter( this ); ( (QDesignerAction*)a )->widget()->installEventFilter( this );
} else if ( ::tqqt_cast<QSeparatorAction*>(a) ) { } else if ( ::tqt_cast<QSeparatorAction*>(a) ) {
actionMap.insert( ( (QSeparatorAction*)a )->widget(), a ); actionMap.insert( ( (QSeparatorAction*)a )->widget(), a );
( (QSeparatorAction*)a )->widget()->installEventFilter( this ); ( (QSeparatorAction*)a )->widget()->installEventFilter( this );
} }
@ -709,7 +709,7 @@ void QDesignerToolBar::doInsertWidget( const TQPoint &p )
void QDesignerToolBar::clear() void QDesignerToolBar::clear()
{ {
for ( TQAction *a = actionList.first(); a; a = actionList.next() ) { for ( TQAction *a = actionList.first(); a; a = actionList.next() ) {
if ( ::tqqt_cast<QDesignerAction*>(a) ) if ( ::tqt_cast<QDesignerAction*>(a) )
( (QDesignerAction*)a )->remove(); ( (QDesignerAction*)a )->remove();
} }
TQToolBar::clear(); TQToolBar::clear();

@ -86,7 +86,7 @@ class QDesignerActionGroup : public TQActionGroup
public: public:
QDesignerActionGroup( TQObject *parent ) QDesignerActionGroup( TQObject *parent )
: TQActionGroup( ::tqqt_cast<TQActionGroup*>(parent) ? parent : 0 ), wid( 0 ), idx( -1 ) { init(); } : TQActionGroup( ::tqt_cast<TQActionGroup*>(parent) ? parent : 0 ), wid( 0 ), idx( -1 ) { init(); }
void init(); void init();
@ -122,9 +122,9 @@ class QDesignerAction : public TQAction
public: public:
QDesignerAction( TQObject *parent ) QDesignerAction( TQObject *parent )
: TQAction( ::tqqt_cast<TQActionGroup*>(parent) ? parent : 0 ), wid( 0 ), idx( -1 ), widgetToInsert( 0 ) { init(); } : TQAction( ::tqt_cast<TQActionGroup*>(parent) ? parent : 0 ), wid( 0 ), idx( -1 ), widgetToInsert( 0 ) { init(); }
QDesignerAction( TQWidget *w, TQObject *parent ) QDesignerAction( TQWidget *w, TQObject *parent )
: TQAction( ::tqqt_cast<TQActionGroup*>(parent) ? parent : 0 ), wid( 0 ), idx( -1 ), widgetToInsert( w ) { init(); } : TQAction( ::tqt_cast<TQActionGroup*>(parent) ? parent : 0 ), wid( 0 ), idx( -1 ), widgetToInsert( w ) { init(); }
void init(); void init();

@ -149,7 +149,7 @@ void ActionEditor::newAction()
{ {
ActionItem *actionParent = (ActionItem*)listActions->selectedItem(); ActionItem *actionParent = (ActionItem*)listActions->selectedItem();
if ( actionParent ) { if ( actionParent ) {
if ( !::tqqt_cast<TQActionGroup*>(actionParent->actionGroup()) ) if ( !::tqt_cast<TQActionGroup*>(actionParent->actionGroup()) )
actionParent = (ActionItem*)actionParent->parent(); actionParent = (ActionItem*)actionParent->parent();
} }
@ -185,7 +185,7 @@ void ActionEditor::newActionGroup()
{ {
ActionItem *actionParent = (ActionItem*)listActions->selectedItem(); ActionItem *actionParent = (ActionItem*)listActions->selectedItem();
if ( actionParent ) { if ( actionParent ) {
if ( !::tqqt_cast<TQActionGroup*>(actionParent->actionGroup()) ) if ( !::tqt_cast<TQActionGroup*>(actionParent->actionGroup()) )
actionParent = (ActionItem*)actionParent->parent(); actionParent = (ActionItem*)actionParent->parent();
} }
@ -225,13 +225,13 @@ void ActionEditor::setFormWindow( FormWindow *fw )
listActions->clear(); listActions->clear();
formWindow = fw; formWindow = fw;
if ( !formWindow || if ( !formWindow ||
!::tqqt_cast<TQMainWindow*>(formWindow->mainContainer()) ) { !::tqt_cast<TQMainWindow*>(formWindow->mainContainer()) ) {
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 ( ::tqqt_cast<TQAction*>(a->parent()) ) if ( ::tqt_cast<TQAction*>(a->parent()) )
continue; continue;
i = new ActionItem( listActions, a ); i = new ActionItem( listActions, a );
i->setText( 0, a->name() ); i->setText( 0, a->name() );
@ -241,7 +241,7 @@ void ActionEditor::setFormWindow( FormWindow *fw )
this, TQT_SLOT( removeConnections( TQObject * ) ) ); this, TQT_SLOT( removeConnections( TQObject * ) ) );
TQObject::connect( a, TQT_SIGNAL( destroyed( TQObject * ) ), TQObject::connect( a, TQT_SIGNAL( destroyed( TQObject * ) ),
this, TQT_SLOT( removeConnections( TQObject* ) ) ); this, TQT_SLOT( removeConnections( TQObject* ) ) );
if ( ::tqqt_cast<TQActionGroup*>(a) ) { if ( ::tqt_cast<TQActionGroup*>(a) ) {
insertChildActions( i ); insertChildActions( i );
} }
} }
@ -261,7 +261,7 @@ void ActionEditor::insertChildActions( ActionItem *i )
while ( it.current() ) { while ( it.current() ) {
TQObject *o = it.current(); TQObject *o = it.current();
++it; ++it;
if ( !::tqqt_cast<TQAction*>(o) ) if ( !::tqt_cast<TQAction*>(o) )
continue; continue;
TQAction *a = (TQAction*)o; TQAction *a = (TQAction*)o;
ActionItem *i2 = new ActionItem( (TQListViewItem*)i, a ); ActionItem *i2 = new ActionItem( (TQListViewItem*)i, a );
@ -273,7 +273,7 @@ void ActionEditor::insertChildActions( ActionItem *i )
this, TQT_SLOT( removeConnections( TQObject * ) ) ); this, TQT_SLOT( removeConnections( TQObject * ) ) );
TQObject::connect( o, TQT_SIGNAL( destroyed( TQObject * ) ), TQObject::connect( o, TQT_SIGNAL( destroyed( TQObject * ) ),
this, TQT_SLOT( removeConnections( TQObject * ) ) ); this, TQT_SLOT( removeConnections( TQObject * ) ) );
if ( ::tqqt_cast<TQActionGroup*>(a) ) if ( ::tqt_cast<TQActionGroup*>(a) )
insertChildActions( i2 ); insertChildActions( i2 );
} }
} }

@ -43,18 +43,18 @@ 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 )
{ {
g = ::tqqt_cast<QDesignerActionGroup*>(ac); g = ::tqt_cast<QDesignerActionGroup*>(ac);
if ( !g ) if ( !g )
a = ::tqqt_cast<QDesignerAction*>(ac); a = ::tqt_cast<QDesignerAction*>(ac);
setDragEnabled( TRUE ); setDragEnabled( TRUE );
} }
ActionItem::ActionItem( TQListViewItem *i, TQAction *ac ) ActionItem::ActionItem( TQListViewItem *i, TQAction *ac )
: TQListViewItem( i ), a( 0 ), g( 0 ) : TQListViewItem( i ), a( 0 ), g( 0 )
{ {
g = ::tqqt_cast<QDesignerActionGroup*>(ac); g = ::tqt_cast<QDesignerActionGroup*>(ac);
if ( !g ) if ( !g )
a = ::tqqt_cast<QDesignerAction*>(ac); a = ::tqt_cast<QDesignerAction*>(ac);
setDragEnabled( TRUE ); setDragEnabled( TRUE );
moveToEnd(); moveToEnd();
} }

@ -494,7 +494,7 @@ bool SetPropertyCommand::canMerge( Command *c )
if ( !p ) { if ( !p ) {
if ( propName == "toolTip" || propName == "whatsThis" ) if ( propName == "toolTip" || propName == "whatsThis" )
return TRUE; return TRUE;
if ( ::tqqt_cast<CustomWidget*>((TQObject *)widget) ) { if ( ::tqt_cast<CustomWidget*>((TQObject *)widget) ) {
MetaDataBase::CustomWidget *cw = ((CustomWidget*)(TQObject*)widget)->customWidget(); MetaDataBase::CustomWidget *cw = ((CustomWidget*)(TQObject*)widget)->customWidget();
if ( !cw ) if ( !cw )
return FALSE; return FALSE;
@ -545,7 +545,7 @@ bool SetPropertyCommand::checkProperty()
return FALSE; return FALSE;
} }
if ( ::tqqt_cast<FormWindow*>(widget->parent()) ) if ( ::tqt_cast<FormWindow*>(widget->parent()) )
formWindow()->mainWindow()->formNameChanged( (FormWindow*)((TQWidget*)(TQObject*)widget)->parentWidget() ); formWindow()->mainWindow()->formNameChanged( (FormWindow*)((TQWidget*)(TQObject*)widget)->parentWidget() );
} }
return TRUE; return TRUE;
@ -597,7 +597,7 @@ void SetPropertyCommand::setProperty( const TQVariant &v, const TQString &curren
MetaDataBase::setResizeMode( TQT_TQOBJECT(WidgetFactory::containerOfWidget( TQT_TQWIDGET(editor->widget()) )), currentItemText ); MetaDataBase::setResizeMode( TQT_TQOBJECT(WidgetFactory::containerOfWidget( TQT_TQWIDGET(editor->widget()) )), currentItemText );
} else if ( propName == "toolTip" || propName == "whatsThis" || propName == "database" || propName == "frameworkCode" ) { } else if ( propName == "toolTip" || propName == "whatsThis" || propName == "database" || propName == "frameworkCode" ) {
MetaDataBase::setFakeProperty( editor->widget(), propName, v ); MetaDataBase::setFakeProperty( editor->widget(), propName, v );
} else if ( ::tqqt_cast<CustomWidget*>(editor->widget()) ) { } else if ( ::tqt_cast<CustomWidget*>(editor->widget()) ) {
MetaDataBase::CustomWidget *cw = ((CustomWidget *)(TQObject *)widget)->customWidget(); MetaDataBase::CustomWidget *cw = ((CustomWidget *)(TQObject *)widget)->customWidget();
if ( cw ) { if ( cw ) {
MetaDataBase::setFakeProperty( editor->widget(), propName, v ); MetaDataBase::setFakeProperty( editor->widget(), propName, v );
@ -645,10 +645,10 @@ 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" && ::tqqt_cast<TQAction*>((TQObject *)widget) && ::tqqt_cast<TQMainWindow*>(formWindow()->mainContainer()) ) { if ( propName == "name" && ::tqt_cast<TQAction*>((TQObject *)widget) && ::tqt_cast<TQMainWindow*>(formWindow()->mainContainer()) ) {
formWindow()->mainWindow()->actioneditor()->updateActionName( (TQAction*)(TQObject *)widget ); formWindow()->mainWindow()->actioneditor()->updateActionName( (TQAction*)(TQObject *)widget );
} }
if ( propName == "iconSet" && ::tqqt_cast<TQAction*>((TQObject *)widget) && ::tqqt_cast<TQMainWindow*>(formWindow()->mainContainer()) ) { if ( propName == "iconSet" && ::tqt_cast<TQAction*>((TQObject *)widget) && ::tqt_cast<TQMainWindow*>(formWindow()->mainContainer()) ) {
formWindow()->mainWindow()->actioneditor()->updateActionIcon( (TQAction*)(TQObject *)widget ); formWindow()->mainWindow()->actioneditor()->updateActionIcon( (TQAction*)(TQObject *)widget );
} }
if ( propName == "caption" ) { if ( propName == "caption" ) {
@ -795,9 +795,9 @@ BreakLayoutCommand::BreakLayoutCommand( const TQString &n, FormWindow *fw,
margin = MetaDataBase::margin( TQT_TQOBJECT(layoutBase) ); margin = MetaDataBase::margin( TQT_TQOBJECT(layoutBase) );
layout = 0; layout = 0;
if ( lay == WidgetFactory::HBox ) if ( lay == WidgetFactory::HBox )
layout = new HorizontalLayout( wl, layoutBase, fw, layoutBase, FALSE, ::tqqt_cast<TQSplitter*>(layoutBase) != 0 ); layout = new HorizontalLayout( wl, layoutBase, fw, layoutBase, FALSE, ::tqt_cast<TQSplitter*>(layoutBase) != 0 );
else if ( lay == WidgetFactory::VBox ) else if ( lay == WidgetFactory::VBox )
layout = new VerticalLayout( wl, layoutBase, fw, layoutBase, FALSE, ::tqqt_cast<TQSplitter*>(layoutBase) != 0 ); layout = new VerticalLayout( wl, layoutBase, fw, layoutBase, FALSE, ::tqt_cast<TQSplitter*>(layoutBase) != 0 );
else if ( lay == WidgetFactory::Grid ) else if ( lay == WidgetFactory::Grid )
layout = new GridLayout( wl, layoutBase, fw, layoutBase, TQSize( TQMAX( 5, fw->grid().x()), TQMAX( 5, fw->grid().y()) ), FALSE ); layout = new GridLayout( wl, layoutBase, fw, layoutBase, TQSize( TQMAX( 5, fw->grid().x()), TQMAX( 5, fw->grid().y()) ), FALSE );
} }
@ -1857,7 +1857,7 @@ void AddActionToToolBarCommand::execute()
{ {
action->addTo( toolBar ); action->addTo( toolBar );
if ( ::tqqt_cast<QDesignerAction*>(action) ) { if ( ::tqt_cast<QDesignerAction*>(action) ) {
TQString s = ( (QDesignerAction*)action )->widget()->name(); TQString s = ( (QDesignerAction*)action )->widget()->name();
if ( s.startsWith( "qt_dead_widget_" ) ) { if ( s.startsWith( "qt_dead_widget_" ) ) {
s.remove( 0, TQString( "qt_dead_widget_" ).length() ); s.remove( 0, TQString( "qt_dead_widget_" ).length() );
@ -1865,16 +1865,16 @@ void AddActionToToolBarCommand::execute()
} }
toolBar->insertAction( ( (QDesignerAction*)action )->widget(), action ); toolBar->insertAction( ( (QDesignerAction*)action )->widget(), action );
( (QDesignerAction*)action )->widget()->installEventFilter( toolBar ); ( (QDesignerAction*)action )->widget()->installEventFilter( toolBar );
} else if ( ::tqqt_cast<QDesignerActionGroup*>(action) ) { } else if ( ::tqt_cast<QDesignerActionGroup*>(action) ) {
if ( ( (QDesignerActionGroup*)action )->usesDropDown() ) { if ( ( (QDesignerActionGroup*)action )->usesDropDown() ) {
toolBar->insertAction( ( (QDesignerActionGroup*)action )->widget(), action ); toolBar->insertAction( ( (QDesignerActionGroup*)action )->widget(), action );
( (QDesignerActionGroup*)action )->widget()->installEventFilter( toolBar ); ( (QDesignerActionGroup*)action )->widget()->installEventFilter( toolBar );
} }
} else if ( ::tqqt_cast<QSeparatorAction*>(action) ) { } else if ( ::tqt_cast<QSeparatorAction*>(action) ) {
toolBar->insertAction( ( (QSeparatorAction*)action )->widget(), action ); toolBar->insertAction( ( (QSeparatorAction*)action )->widget(), action );
( (QSeparatorAction*)action )->widget()->installEventFilter( toolBar ); ( (QSeparatorAction*)action )->widget()->installEventFilter( toolBar );
} }
if ( !::tqqt_cast<TQActionGroup*>(action) || ( (TQActionGroup*)action )->usesDropDown()) { if ( !::tqt_cast<TQActionGroup*>(action) || ( (TQActionGroup*)action )->usesDropDown()) {
if ( index == -1 ) if ( index == -1 )
toolBar->appendAction( action ); toolBar->appendAction( action );
else else
@ -1889,10 +1889,10 @@ void AddActionToToolBarCommand::execute()
while ( it.current() ) { while ( it.current() ) {
TQObject *o = it.current(); TQObject *o = it.current();
++it; ++it;
if ( !::tqqt_cast<TQAction*>(o) ) if ( !::tqt_cast<TQAction*>(o) )
continue; continue;
// ### fix it for nested actiongroups // ### fix it for nested actiongroups
if ( ::tqqt_cast<QDesignerAction*>(o) ) { if ( ::tqt_cast<QDesignerAction*>(o) ) {
QDesignerAction *ac = (QDesignerAction*)o; QDesignerAction *ac = (QDesignerAction*)o;
toolBar->insertAction( ac->widget(), ac ); toolBar->insertAction( ac->widget(), ac );
ac->widget()->installEventFilter( toolBar ); ac->widget()->installEventFilter( toolBar );
@ -1912,7 +1912,7 @@ void AddActionToToolBarCommand::execute()
void AddActionToToolBarCommand::unexecute() void AddActionToToolBarCommand::unexecute()
{ {
if ( ::tqqt_cast<QDesignerAction*>(action) ) { if ( ::tqt_cast<QDesignerAction*>(action) ) {
TQString s = ( (QDesignerAction*)action )->widget()->name(); TQString s = ( (QDesignerAction*)action )->widget()->name();
s.prepend( "qt_dead_widget_" ); s.prepend( "qt_dead_widget_" );
( (QDesignerAction*)action )->widget()->setName( s ); ( (QDesignerAction*)action )->widget()->setName( s );
@ -1921,7 +1921,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 ( !::tqqt_cast<TQActionGroup*>(action) || ( (TQActionGroup*)action )->usesDropDown()) { if ( !::tqt_cast<TQActionGroup*>(action) || ( (TQActionGroup*)action )->usesDropDown()) {
action->removeEventFilter( toolBar ); action->removeEventFilter( toolBar );
} else { } else {
TQObjectList clo = action->childrenListObject(); TQObjectList clo = action->childrenListObject();
@ -1930,9 +1930,9 @@ void AddActionToToolBarCommand::unexecute()
while ( it.current() ) { while ( it.current() ) {
TQObject *o = it.current(); TQObject *o = it.current();
++it; ++it;
if ( !::tqqt_cast<TQAction*>(o) ) if ( !::tqt_cast<TQAction*>(o) )
continue; continue;
if ( ::tqqt_cast<QDesignerAction*>(o) ) { if ( ::tqt_cast<QDesignerAction*>(o) ) {
o->removeEventFilter( toolBar ); o->removeEventFilter( toolBar );
toolBar->removeAction( (TQAction*)o ); toolBar->removeAction( (TQAction*)o );
} }

@ -187,10 +187,10 @@ static void appendChildActions( TQAction *action, TQStringList &lst )
while ( it.current() ) { while ( it.current() ) {
TQObject *o = it.current(); TQObject *o = it.current();
++it; ++it;
if ( !::tqqt_cast<TQAction*>(o) ) if ( !::tqt_cast<TQAction*>(o) )
continue; continue;
lst << o->name(); lst << o->name();
if ( !o->childrenListObject().isEmpty() && ::tqqt_cast<TQActionGroup*>(o) ) if ( !o->childrenListObject().isEmpty() && ::tqt_cast<TQActionGroup*>(o) )
appendChildActions( (TQAction*)o, lst ); appendChildActions( (TQAction*)o, lst );
} }
} }
@ -203,7 +203,7 @@ static TQStringList flatActions( const TQPtrList<TQAction> &l )
while ( it.current() ) { while ( it.current() ) {
TQAction *action = it.current(); TQAction *action = it.current();
lst << action->name(); lst << action->name();
if ( !action->childrenListObject().isEmpty() && ::tqqt_cast<TQActionGroup*>(action) ) if ( !action->childrenListObject().isEmpty() && ::tqt_cast<TQActionGroup*>(action) )
appendChildActions( action, lst ); appendChildActions( action, lst );
++it; ++it;
} }
@ -225,9 +225,9 @@ SenderItem::SenderItem( TQTable *table, FormWindow *fw )
continue; continue;
} }
if ( !TQString( it.current()->name() ).startsWith( "qt_dead_widget_" ) && if ( !TQString( it.current()->name() ).startsWith( "qt_dead_widget_" ) &&
!::tqqt_cast<TQLayoutWidget*>(it.current()) && !::tqt_cast<TQLayoutWidget*>(it.current()) &&
!::tqqt_cast<Spacer*>(it.current()) && !::tqt_cast<Spacer*>(it.current()) &&
!::tqqt_cast<SizeHandle*>(it.current()) && !::tqt_cast<SizeHandle*>(it.current()) &&
qstrcmp( it.current()->name(), "central widget" ) != 0 ) { qstrcmp( it.current()->name(), "central widget" ) != 0 ) {
lst << it.current()->name(); lst << it.current()->name();
} }
@ -282,9 +282,9 @@ ReceiverItem::ReceiverItem( TQTable *table, FormWindow *fw )
continue; continue;
} }
if ( !TQString( it.current()->name() ).startsWith( "qt_dead_widget_" ) && if ( !TQString( it.current()->name() ).startsWith( "qt_dead_widget_" ) &&
!::tqqt_cast<TQLayoutWidget*>(it.current()) && !::tqt_cast<TQLayoutWidget*>(it.current()) &&
!::tqqt_cast<Spacer*>(it.current()) && !::tqt_cast<Spacer*>(it.current()) &&
!::tqqt_cast<SizeHandle*>(it.current()) && !::tqt_cast<SizeHandle*>(it.current()) &&
qstrcmp( it.current()->name(), "central widget" ) != 0 ) { qstrcmp( it.current()->name(), "central widget" ) != 0 ) {
lst << it.current()->name(); lst << it.current()->name();
} }
@ -346,7 +346,7 @@ void SignalItem::senderChanged( TQObject *sender )
TQStringList lst = TQStringList::fromStrList( sigs ); TQStringList lst = TQStringList::fromStrList( sigs );
if ( ::tqqt_cast<CustomWidget*>(sender) ) { if ( ::tqt_cast<CustomWidget*>(sender) ) {
MetaDataBase::CustomWidget *w = ( (CustomWidget*)sender )->customWidget(); MetaDataBase::CustomWidget *w = ( (CustomWidget*)sender )->customWidget();
for ( TQValueList<TQCString>::Iterator it = w->lstSignals.begin(); for ( TQValueList<TQCString>::Iterator it = w->lstSignals.begin();
it != w->lstSignals.end(); ++it ) it != w->lstSignals.end(); ++it )
@ -408,7 +408,7 @@ bool SlotItem::ignoreSlot( const char* slot ) const
{ {
#ifndef TQT_NO_SQL #ifndef TQT_NO_SQL
if ( qstrcmp( slot, "update()" ) == 0 && if ( qstrcmp( slot, "update()" ) == 0 &&
::tqqt_cast<TQDataBrowser*>(lastReceiver) ) ::tqt_cast<TQDataBrowser*>(lastReceiver) )
return FALSE; return FALSE;
#endif #endif
@ -478,7 +478,7 @@ void SlotItem::updateSlotList()
} }
} }
if ( ::tqqt_cast<CustomWidget*>(lastReceiver) ) { if ( ::tqt_cast<CustomWidget*>(lastReceiver) ) {
MetaDataBase::CustomWidget *w = ( (CustomWidget*)lastReceiver )->customWidget(); MetaDataBase::CustomWidget *w = ( (CustomWidget*)lastReceiver )->customWidget();
for ( TQValueList<MetaDataBase::Function>::Iterator it = w->lstSlots.begin(); for ( TQValueList<MetaDataBase::Function>::Iterator it = w->lstSlots.begin();
it != w->lstSlots.end(); ++it ) { it != w->lstSlots.end(); ++it ) {

@ -55,9 +55,9 @@ TQRESULT DesignerInterfaceImpl::queryInterface( const TQUuid &uuid, TQUnknownInt
{ {
*iface = 0; *iface = 0;
if ( uuid == IID_TQUnknown ) if ( uuid == IID_QUnknown )
*iface = (TQUnknownInterface*)this; *iface = (TQUnknownInterface*)this;
else if ( uuid == IID_TQComponentInformation ) else if ( uuid == IID_QComponentInformation )
*iface = (TQComponentInformationInterface*)this; *iface = (TQComponentInformationInterface*)this;
else if ( uuid == IID_Designer ) else if ( uuid == IID_Designer )
*iface = (DesignerInterface*)this; *iface = (DesignerInterface*)this;
@ -190,7 +190,7 @@ TQPtrList<DesignerFormWindow> DesignerProjectImpl::formList() const
while ( it.current() ) { while ( it.current() ) {
TQObject *obj = it.current(); TQObject *obj = it.current();
++it; ++it;
TQWidget *par = ::tqqt_cast<FormWindow*>(obj->parent()); TQWidget *par = ::tqt_cast<FormWindow*>(obj->parent());
if ( !obj->isWidgetType() || !par ) if ( !obj->isWidgetType() || !par )
continue; continue;
@ -957,7 +957,7 @@ void DesignerFormWindowImpl::onModificationChange( TQObject *receiver, const cha
void DesignerFormWindowImpl::addMenu( const TQString &text, const TQString &name ) void DesignerFormWindowImpl::addMenu( const TQString &text, const TQString &name )
{ {
if ( !::tqqt_cast<TQMainWindow*>(formWindow->mainContainer()) ) if ( !::tqt_cast<TQMainWindow*>(formWindow->mainContainer()) )
return; return;
TQMainWindow *mw = (TQMainWindow*)formWindow->mainContainer(); TQMainWindow *mw = (TQMainWindow*)formWindow->mainContainer();
@ -977,7 +977,7 @@ void DesignerFormWindowImpl::addMenu( const TQString &text, const TQString &name
void DesignerFormWindowImpl::addMenuAction( const TQString &menu, TQAction *a ) void DesignerFormWindowImpl::addMenuAction( const TQString &menu, TQAction *a )
{ {
if ( !::tqqt_cast<TQMainWindow*>(formWindow->mainContainer()) ) if ( !::tqt_cast<TQMainWindow*>(formWindow->mainContainer()) )
return; return;
TQMainWindow *mw = (TQMainWindow*)formWindow->mainContainer(); TQMainWindow *mw = (TQMainWindow*)formWindow->mainContainer();
if ( !mw->child( 0, "MenuBarEditor" ) ) if ( !mw->child( 0, "MenuBarEditor" ) )
@ -990,7 +990,7 @@ void DesignerFormWindowImpl::addMenuAction( const TQString &menu, TQAction *a )
void DesignerFormWindowImpl::addMenuSeparator( const TQString &menu ) void DesignerFormWindowImpl::addMenuSeparator( const TQString &menu )
{ {
if ( !::tqqt_cast<TQMainWindow*>(formWindow->mainContainer()) ) if ( !::tqt_cast<TQMainWindow*>(formWindow->mainContainer()) )
return; return;
TQMainWindow *mw = (TQMainWindow*)formWindow->mainContainer(); TQMainWindow *mw = (TQMainWindow*)formWindow->mainContainer();
if ( !mw->child( 0, "MenuBarEditor" ) ) if ( !mw->child( 0, "MenuBarEditor" ) )
@ -1004,7 +1004,7 @@ void DesignerFormWindowImpl::addMenuSeparator( const TQString &menu )
void DesignerFormWindowImpl::addToolBar( const TQString &text, const TQString &name ) void DesignerFormWindowImpl::addToolBar( const TQString &text, const TQString &name )
{ {
if ( !::tqqt_cast<TQMainWindow*>(formWindow->mainContainer()) ) if ( !::tqt_cast<TQMainWindow*>(formWindow->mainContainer()) )
return; return;
TQMainWindow *mw = (TQMainWindow*)formWindow->mainContainer(); TQMainWindow *mw = (TQMainWindow*)formWindow->mainContainer();
TQToolBar *tb = new QDesignerToolBar( mw ); TQToolBar *tb = new QDesignerToolBar( mw );
@ -1016,7 +1016,7 @@ void DesignerFormWindowImpl::addToolBar( const TQString &text, const TQString &n
void DesignerFormWindowImpl::addToolBarAction( const TQString &tbn, TQAction *a ) void DesignerFormWindowImpl::addToolBarAction( const TQString &tbn, TQAction *a )
{ {
if ( !::tqqt_cast<TQMainWindow*>(formWindow->mainContainer()) ) if ( !::tqt_cast<TQMainWindow*>(formWindow->mainContainer()) )
return; return;
TQMainWindow *mw = (TQMainWindow*)formWindow->mainContainer(); TQMainWindow *mw = (TQMainWindow*)formWindow->mainContainer();
QDesignerToolBar *tb = (QDesignerToolBar*)mw->child( tbn, "QDesignerToolBar" ); QDesignerToolBar *tb = (QDesignerToolBar*)mw->child( tbn, "QDesignerToolBar" );
@ -1028,7 +1028,7 @@ void DesignerFormWindowImpl::addToolBarAction( const TQString &tbn, TQAction *a
void DesignerFormWindowImpl::addToolBarSeparator( const TQString &tbn ) void DesignerFormWindowImpl::addToolBarSeparator( const TQString &tbn )
{ {
if ( !::tqqt_cast<TQMainWindow*>(formWindow->mainContainer()) ) if ( !::tqt_cast<TQMainWindow*>(formWindow->mainContainer()) )
return; return;
TQMainWindow *mw = (TQMainWindow*)formWindow->mainContainer(); TQMainWindow *mw = (TQMainWindow*)formWindow->mainContainer();
QDesignerToolBar *tb = (QDesignerToolBar*)mw->child( tbn, "QDesignerToolBar" ); QDesignerToolBar *tb = (QDesignerToolBar*)mw->child( tbn, "QDesignerToolBar" );

@ -87,7 +87,7 @@ static void setCursorToAll( const TQCursor &c, TQWidget *start )
TQObjectList l = start->childrenListObject(); TQObjectList l = start->childrenListObject();
if ( !l.isEmpty() ) { if ( !l.isEmpty() ) {
for ( TQObject *o = l.first(); o; o = l.next() ) { for ( TQObject *o = l.first(); o; o = l.next() ) {
if ( o->isWidgetType() && !::tqqt_cast<SizeHandle*>(o) ) if ( o->isWidgetType() && !::tqt_cast<SizeHandle*>(o) )
setCursorToAll( c, ( (TQWidget*)o ) ); setCursorToAll( c, ( (TQWidget*)o ) );
} }
} }
@ -102,7 +102,7 @@ static void restoreCursors( TQWidget *start, FormWindow *fw )
TQObjectList l = start->childrenListObject(); TQObjectList l = start->childrenListObject();
if ( !l.isEmpty() ) { if ( !l.isEmpty() ) {
for ( TQObject *o = l.first(); o; o = l.next() ) { for ( TQObject *o = l.first(); o; o = l.next() ) {
if ( o->isWidgetType() && !::tqqt_cast<SizeHandle*>(o) ) if ( o->isWidgetType() && !::tqt_cast<SizeHandle*>(o) )
restoreCursors( ( (TQWidget*)o ), fw ); restoreCursors( ( (TQWidget*)o ), fw );
} }
} }
@ -544,7 +544,7 @@ void FormWindow::handleContextMenu( TQContextMenuEvent *e, TQWidget *w )
( WidgetFactory::layoutType( w->parentWidget()) != WidgetFactory::NoLayout || ( WidgetFactory::layoutType( w->parentWidget()) != WidgetFactory::NoLayout ||
!insertedWidgets.find(w) ) ) !insertedWidgets.find(w) ) )
w = w->parentWidget(); w = w->parentWidget();
if ( ::tqqt_cast<TQMainWindow*>(mainContainer()) && ((TQMainWindow*)mainContainer())->centralWidget() == realWidget ) { if ( ::tqt_cast<TQMainWindow*>(mainContainer()) && ((TQMainWindow*)mainContainer())->centralWidget() == realWidget ) {
e->accept(); e->accept();
mainwindow->popupFormWindowMenu( e->globalPos(), this ); mainwindow->popupFormWindowMenu( e->globalPos(), this );
} else { } else {
@ -656,7 +656,7 @@ void FormWindow::handleMousePress( TQMouseEvent *e, TQWidget *w )
break; break;
validForBuddy = FALSE; validForBuddy = FALSE;
if ( currTool == BUDDY_TOOL ) { if ( currTool == BUDDY_TOOL ) {
if ( !::tqqt_cast<TQLabel*>(w) ) if ( !::tqt_cast<TQLabel*>(w) )
break; break;
clearSelection( FALSE ); clearSelection( FALSE );
validForBuddy = TRUE; validForBuddy = TRUE;
@ -698,7 +698,7 @@ void FormWindow::handleMousePress( TQMouseEvent *e, TQWidget *w )
for (;;) { for (;;) {
int id = WidgetDatabase::idFromClassName( WidgetFactory::classNameOf( TQT_TQOBJECT(wid) ) ); int id = WidgetDatabase::idFromClassName( WidgetFactory::classNameOf( TQT_TQOBJECT(wid) ) );
if ( ( WidgetDatabase::isContainer( id ) || wid == mainContainer() ) && if ( ( WidgetDatabase::isContainer( id ) || wid == mainContainer() ) &&
!::tqqt_cast<TQLayoutWidget*>(wid) && !::tqqt_cast<TQSplitter*>(wid) ) { !::tqt_cast<TQLayoutWidget*>(wid) && !::tqt_cast<TQSplitter*>(wid) ) {
insertParent = WidgetFactory::containerOfWidget( wid ); // found another parent, store it insertParent = WidgetFactory::containerOfWidget( wid ); // found another parent, store it
break; break;
} else { } else {
@ -865,7 +865,7 @@ void FormWindow::handleMouseMove( TQMouseEvent *e, TQWidget *w )
wid = designerWidget( TQT_TQOBJECT(wid) ); wid = designerWidget( TQT_TQOBJECT(wid) );
if ( wid && ( isMainContainer( TQT_TQOBJECT(wid) ) || insertedWidgets.find( wid ) ) && wid->isVisibleTo( this ) ) if ( wid && ( isMainContainer( TQT_TQOBJECT(wid) ) || insertedWidgets.find( wid ) ) && wid->isVisibleTo( this ) )
newendWidget = wid; newendWidget = wid;
if ( ::tqqt_cast<TQLayoutWidget*>(newendWidget) || ::tqqt_cast<Spacer*>(newendWidget) ) if ( ::tqt_cast<TQLayoutWidget*>(newendWidget) || ::tqt_cast<Spacer*>(newendWidget) )
newendWidget = (TQWidget*)endWidget; newendWidget = (TQWidget*)endWidget;
drawRecRect = newendWidget != endWidget; drawRecRect = newendWidget != endWidget;
if ( newendWidget && if ( newendWidget &&
@ -891,7 +891,7 @@ void FormWindow::handleMouseMove( TQMouseEvent *e, TQWidget *w )
newendWidget = wid; newendWidget = wid;
else else
newendWidget = 0; newendWidget = 0;
if ( ::tqqt_cast<TQLayoutWidget*>(newendWidget) || ::tqqt_cast<Spacer*>(newendWidget) ) if ( ::tqt_cast<TQLayoutWidget*>(newendWidget) || ::tqt_cast<Spacer*>(newendWidget) )
newendWidget = (TQWidget*)endWidget; newendWidget = (TQWidget*)endWidget;
drawRecRect = newendWidget != endWidget; drawRecRect = newendWidget != endWidget;
if ( !newendWidget ) if ( !newendWidget )
@ -977,12 +977,12 @@ void FormWindow::handleMouseRelease( TQMouseEvent *e, TQWidget *w )
bool emitSelChanged = FALSE; bool emitSelChanged = FALSE;
for ( TQMap<TQWidget*, TQPoint>::Iterator it = moving.begin(); it != moving.end(); ++it ) { for ( TQMap<TQWidget*, TQPoint>::Iterator it = moving.begin(); it != moving.end(); ++it ) {
TQWidget *i = it.key(); TQWidget *i = it.key();
if ( !emitSelChanged && ::tqqt_cast<TQButton*>(i) ) { if ( !emitSelChanged && ::tqt_cast<TQButton*>(i) ) {
if ( ::tqqt_cast<TQButtonGroup*>(i->parentWidget()) || ::tqqt_cast<TQButtonGroup*>(wa) ) if ( ::tqt_cast<TQButtonGroup*>(i->parentWidget()) || ::tqt_cast<TQButtonGroup*>(wa) )
emitSelChanged = TRUE; emitSelChanged = TRUE;
if ( !::tqqt_cast<TQButtonGroup*>(wa) ) { if ( !::tqt_cast<TQButtonGroup*>(wa) ) {
MetaDataBase::setPropertyChanged( TQT_TQOBJECT(i), "buttonGroupId", FALSE ); MetaDataBase::setPropertyChanged( TQT_TQOBJECT(i), "buttonGroupId", FALSE );
if ( ::tqqt_cast<TQButtonGroup*>(i->parentWidget()) ) if ( ::tqt_cast<TQButtonGroup*>(i->parentWidget()) )
( (TQButtonGroup*)i->parentWidget() )->remove( (TQButton*)i ); ( (TQButtonGroup*)i->parentWidget() )->remove( (TQButton*)i );
} }
} }
@ -1194,7 +1194,7 @@ void FormWindow::selectWidget( TQObject *o, bool select )
return; return;
} }
if ( ::tqqt_cast<TQMainWindow*>(mainContainer()) && w == ( (TQMainWindow*)mainContainer() )->centralWidget() ) { if ( ::tqt_cast<TQMainWindow*>(mainContainer()) && w == ( (TQMainWindow*)mainContainer() )->centralWidget() ) {
TQObject *opw = propertyWidget; TQObject *opw = propertyWidget;
propertyWidget = TQT_TQOBJECT(mainContainer()); propertyWidget = TQT_TQOBJECT(mainContainer());
if ( opw->isWidgetType() ) if ( opw->isWidgetType() )
@ -1203,7 +1203,7 @@ void FormWindow::selectWidget( TQObject *o, bool select )
return; return;
} }
if ( ::tqqt_cast<QDesignerToolBar*>(o) ) if ( ::tqt_cast<QDesignerToolBar*>(o) )
return; return;
if ( select ) { if ( select ) {
@ -1921,7 +1921,7 @@ void FormWindow::checkAccels()
find_accel( w->property( "title" ).toString(), accels, w ); find_accel( w->property( "title" ).toString(), accels, w );
if ( pageTitle ) if ( pageTitle )
find_accel( w->property( "pageTitle" ).toString(), accels, w ); find_accel( w->property( "pageTitle" ).toString(), accels, w );
} else if ( ::tqqt_cast<MenuBarEditor*>(o) ) { } else if ( ::tqt_cast<MenuBarEditor*>(o) ) {
((MenuBarEditor *)o)->checkAccels( accels ); ((MenuBarEditor *)o)->checkAccels( accels );
} }
} }
@ -2130,7 +2130,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 ( !::tqqt_cast<TQLayoutWidget*>(w) && !::tqqt_cast<TQSplitter*>(w) ) if ( !::tqt_cast<TQLayoutWidget*>(w) && !::tqt_cast<TQSplitter*>(w) )
break; break;
} }
w = w->parentWidget(); w = w->parentWidget();
@ -2393,7 +2393,7 @@ bool FormWindow::unify( TQObject *w, TQString &s, bool changeIt )
} }
} }
} }
if ( ::tqqt_cast<TQMainWindow*>(mainContainer()) && !found ) { if ( ::tqt_cast<TQMainWindow*>(mainContainer()) && !found ) {
TQObjectList *l = mainContainer()->queryList( "PopupMenuEditor" ); TQObjectList *l = mainContainer()->queryList( "PopupMenuEditor" );
for ( TQObject *o = l->first(); o; o = l->next() ) { for ( TQObject *o = l->first(); o; o = l->next() ) {
if ( o != w && if ( o != w &&
@ -2407,7 +2407,7 @@ bool FormWindow::unify( TQObject *w, TQString &s, bool changeIt )
} }
delete l; delete l;
} }
if ( ::tqqt_cast<TQMainWindow*>(mainContainer()) ) { if ( ::tqt_cast<TQMainWindow*>(mainContainer()) ) {
if ( !found ) { if ( !found ) {
TQObjectList *l = mainContainer()->queryList( "TQDockWindow", 0, TRUE ); TQObjectList *l = mainContainer()->queryList( "TQDockWindow", 0, TRUE );
for ( TQObject *o = l->first(); o; o = l->next() ) { for ( TQObject *o = l->first(); o; o = l->next() ) {
@ -2531,8 +2531,8 @@ TQWidget *FormWindow::containerAt( const TQPoint &pos, TQWidget *notParentOf )
} }
for ( ; it.current(); ++it ) { for ( ; it.current(); ++it ) {
if ( ::tqqt_cast<TQLayoutWidget*>(it.current()) if ( ::tqt_cast<TQLayoutWidget*>(it.current())
|| ::tqqt_cast<TQSplitter*>(it.current()) ) || ::tqt_cast<TQSplitter*>(it.current()) )
continue; continue;
if ( !it.current()->isVisibleTo( this ) ) if ( !it.current()->isVisibleTo( this ) )
continue; continue;
@ -2689,7 +2689,7 @@ DesignerFormWindow *FormWindow::iFace()
bool FormWindow::isCentralWidget( TQObject *w ) const bool FormWindow::isCentralWidget( TQObject *w ) const
{ {
if ( !::tqqt_cast<TQMainWindow*>(mainContainer()) ) if ( !::tqt_cast<TQMainWindow*>(mainContainer()) )
return FALSE; return FALSE;
return w == ((TQMainWindow*)mainContainer())->centralWidget(); return w == ((TQMainWindow*)mainContainer())->centralWidget();
} }

@ -258,12 +258,12 @@ TQObject *HierarchyList::handleObjectClick( TQListViewItem *i )
if ( o->isWidgetType() ) { if ( o->isWidgetType() ) {
TQWidget *w = (TQWidget*)o; TQWidget *w = (TQWidget*)o;
if ( !formWindow->widgets()->find( w ) ) { if ( !formWindow->widgets()->find( w ) ) {
if ( ::tqqt_cast<TQWidgetStack*>(w->parent()) ) { if ( ::tqt_cast<TQWidgetStack*>(w->parent()) ) {
if (::tqqt_cast<TQTabWidget*>(w->parent()->parent()) ) { if (::tqt_cast<TQTabWidget*>(w->parent()->parent()) ) {
((TQTabWidget*)w->parent()->parent())->showPage( w ); ((TQTabWidget*)w->parent()->parent())->showPage( w );
o = TQT_TQOBJECT((TQWidget*)w->parent()->parent()); o = TQT_TQOBJECT((TQWidget*)w->parent()->parent());
formWindow->emitUpdateProperties( TQT_TQOBJECT(formWindow->currentWidget()) ); formWindow->emitUpdateProperties( TQT_TQOBJECT(formWindow->currentWidget()) );
} else if ( ::tqqt_cast<TQWizard*>(w->parent()->parent()) ) { } else if ( ::tqt_cast<TQWizard*>(w->parent()->parent()) ) {
((QDesignerWizard*)w->parent()->parent())-> ((QDesignerWizard*)w->parent()->parent())->
setCurrentPage( ( (QDesignerWizard*)w->parent()->parent() )->pageNum( w ) ); setCurrentPage( ( (QDesignerWizard*)w->parent()->parent() )->pageNum( w ) );
o = TQT_TQOBJECT((TQWidget*)w->parent()->parent()); o = TQT_TQOBJECT((TQWidget*)w->parent()->parent());
@ -273,15 +273,15 @@ TQObject *HierarchyList::handleObjectClick( TQListViewItem *i )
if ( (TQWidgetStack*)w->parent()->isA( "QDesignerWidgetStack" ) ) if ( (TQWidgetStack*)w->parent()->isA( "QDesignerWidgetStack" ) )
( (QDesignerWidgetStack*)w->parent() )->updateButtons(); ( (QDesignerWidgetStack*)w->parent() )->updateButtons();
} }
} else if ( ::tqqt_cast<TQMenuBar*>(w) || ::tqqt_cast<TQDockWindow*>(w) ) { } else if ( ::tqt_cast<TQMenuBar*>(w) || ::tqt_cast<TQDockWindow*>(w) ) {
formWindow->setActiveObject( TQT_TQOBJECT(w) ); formWindow->setActiveObject( TQT_TQOBJECT(w) );
} else if ( ::tqqt_cast<TQPopupMenu*>(w) ) { } else if ( ::tqt_cast<TQPopupMenu*>(w) ) {
return 0; // ### we could try to find our menu bar and change the currentMenu to our index return 0; // ### we could try to find our menu bar and change the currentMenu to our index
} else { } else {
return 0; return 0;
} }
} }
} else if ( ::tqqt_cast<TQAction*>(o) ) { } else if ( ::tqt_cast<TQAction*>(o) ) {
MainWindow::self->actioneditor()->setCurrentAction( (TQAction*)o ); MainWindow::self->actioneditor()->setCurrentAction( (TQAction*)o );
deselect = TRUE; deselect = TRUE;
} }
@ -402,7 +402,7 @@ void HierarchyList::insertObject( TQObject *o, TQListViewItem *parent )
if ( TQString( o->name() ).startsWith( "qt_dead_widget_" ) ) if ( TQString( o->name() ).startsWith( "qt_dead_widget_" ) )
return; return;
bool fakeMainWindow = FALSE; bool fakeMainWindow = FALSE;
if ( ::tqqt_cast<TQMainWindow*>(o) ) { if ( ::tqt_cast<TQMainWindow*>(o) ) {
TQObject *cw = TQT_TQOBJECT(( (TQMainWindow*)o )->centralWidget()); TQObject *cw = TQT_TQOBJECT(( (TQMainWindow*)o )->centralWidget());
if ( cw ) { if ( cw ) {
o = cw; o = cw;
@ -411,7 +411,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 ( ::tqqt_cast<TQLayoutWidget*>(o) ) { if ( ::tqt_cast<TQLayoutWidget*>(o) ) {
switch ( WidgetFactory::layoutType( (TQWidget*)o ) ) { switch ( WidgetFactory::layoutType( (TQWidget*)o ) ) {
case WidgetFactory::HBox: case WidgetFactory::HBox:
className = "HBox"; className = "HBox";
@ -433,16 +433,16 @@ void HierarchyList::insertObject( TQObject *o, TQListViewItem *parent )
#endif #endif
TQString name = o->name(); TQString name = o->name();
if ( ::tqqt_cast<TQWidgetStack*>(o->parent()) ) { if ( ::tqt_cast<TQWidgetStack*>(o->parent()) ) {
if ( ::tqqt_cast<TQTabWidget*>(o->parent()->parent()) ) if ( ::tqt_cast<TQTabWidget*>(o->parent()->parent()) )
name = ( (TQTabWidget*)o->parent()->parent() )->tabLabel( (TQWidget*)o ); name = ( (TQTabWidget*)o->parent()->parent() )->tabLabel( (TQWidget*)o );
else if ( ::tqqt_cast<TQWizard*>(o->parent()->parent()) ) else if ( ::tqt_cast<TQWizard*>(o->parent()->parent()) )
name = ( (TQWizard*)o->parent()->parent() )->title( (TQWidget*)o ); name = ( (TQWizard*)o->parent()->parent() )->title( (TQWidget*)o );
} }
TQToolBox *tb; TQToolBox *tb;
if ( o->parent() && o->parent()->parent() && if ( o->parent() && o->parent()->parent() &&
(tb = ::tqqt_cast<TQToolBox*>(o->parent()->parent()->parent())) ) (tb = ::tqt_cast<TQToolBox*>(o->parent()->parent()->parent())) )
name = tb->itemLabel( tb->indexOf((TQWidget*)o) ); name = tb->itemLabel( tb->indexOf((TQWidget*)o) );
if ( fakeMainWindow ) { if ( fakeMainWindow ) {
@ -457,18 +457,18 @@ void HierarchyList::insertObject( TQObject *o, TQListViewItem *parent )
item->setOpen( TRUE ); item->setOpen( TRUE );
if ( !parent ) if ( !parent )
item->setPixmap( 0, DesignerFormPix ); item->setPixmap( 0, DesignerFormPix );
else if ( ::tqqt_cast<TQLayoutWidget*>(o) ) else if ( ::tqt_cast<TQLayoutWidget*>(o) )
item->setPixmap( 0, DesignerLayoutPix ); item->setPixmap( 0, DesignerLayoutPix );
else else
item->setPixmap( 0, WidgetDatabase::iconSet( item->setPixmap( 0, WidgetDatabase::iconSet(
WidgetDatabase::idFromClassName( WidgetFactory::classNameOf( o ) ) ). WidgetDatabase::idFromClassName( WidgetFactory::classNameOf( o ) ) ).
pixmap( TQIconSet::Small, TQIconSet::Normal ) ); pixmap( TQIconSet::Small, TQIconSet::Normal ) );
if ( ::tqqt_cast<TQAction*>(o) ) if ( ::tqt_cast<TQAction*>(o) )
item->setPixmap( 0, ( (TQAction*)o )->iconSet().pixmap() ); item->setPixmap( 0, ( (TQAction*)o )->iconSet().pixmap() );
( (HierarchyItem*)item )->setObject( o ); ( (HierarchyItem*)item )->setObject( o );
TQObjectList l = o->childrenListObject(); TQObjectList l = o->childrenListObject();
if ( ::tqqt_cast<QDesignerToolBar*>(o) ) if ( ::tqt_cast<QDesignerToolBar*>(o) )
l.clear(); l.clear();
if ( !l.isEmpty() ) { if ( !l.isEmpty() ) {
TQObjectListIt it( l ); TQObjectListIt it( l );
@ -478,13 +478,13 @@ void HierarchyList::insertObject( TQObject *o, TQListViewItem *parent )
( (TQWidget*)it.current() )->isHidden() ) ( (TQWidget*)it.current() )->isHidden() )
continue; continue;
if ( !formWindow->widgets()->find( (TQWidget*)it.current() ) ) { if ( !formWindow->widgets()->find( (TQWidget*)it.current() ) ) {
if ( ::tqqt_cast<TQWidgetStack*>(it.current()->parent()) || if ( ::tqt_cast<TQWidgetStack*>(it.current()->parent()) ||
::tqqt_cast<TQWidgetStack*>(it.current()) ) { ::tqt_cast<TQWidgetStack*>(it.current()) ) {
TQObject *obj = it.current(); TQObject *obj = it.current();
QDesignerTabWidget *tw = ::tqqt_cast<QDesignerTabWidget*>(it.current()->parent()); QDesignerTabWidget *tw = ::tqt_cast<QDesignerTabWidget*>(it.current()->parent());
QDesignerWizard *dw = ::tqqt_cast<QDesignerWizard*>(it.current()->parent()); QDesignerWizard *dw = ::tqt_cast<QDesignerWizard*>(it.current()->parent());
TQWidgetStack *stack = 0; TQWidgetStack *stack = 0;
if ( dw || tw || ::tqqt_cast<TQWidgetStack*>(obj) ) if ( dw || tw || ::tqt_cast<TQWidgetStack*>(obj) )
stack = (TQWidgetStack*)obj; stack = (TQWidgetStack*)obj;
else else
stack = (TQWidgetStack*)obj->parent(); stack = (TQWidgetStack*)obj->parent();
@ -505,8 +505,8 @@ void HierarchyList::insertObject( TQObject *o, TQListViewItem *parent )
insertObject( obj, item ); insertObject( obj, item );
} }
delete l2; delete l2;
} else if ( ::tqqt_cast<TQToolBox*>(it.current()->parent()) ) { } else if ( ::tqt_cast<TQToolBox*>(it.current()->parent()) ) {
if ( !::tqqt_cast<TQScrollView*>(it.current()) ) if ( !::tqt_cast<TQScrollView*>(it.current()) )
continue; continue;
TQToolBox *tb = (TQToolBox*)it.current()->parent(); TQToolBox *tb = (TQToolBox*)it.current()->parent();
for ( int i = tb->count() - 1; i >= 0; --i ) for ( int i = tb->count() - 1; i >= 0; --i )
@ -528,9 +528,9 @@ void HierarchyList::insertObject( TQObject *o, TQListViewItem *parent )
for ( obj = l->first(); obj; obj = l->next() ) for ( obj = l->first(); obj; obj = l->next() )
insertObject( obj, item ); insertObject( obj, item );
delete l; delete l;
} else if ( ::tqqt_cast<QDesignerToolBar*>(o) || ::tqqt_cast<PopupMenuEditor*>(o) ) { } else if ( ::tqt_cast<QDesignerToolBar*>(o) || ::tqt_cast<PopupMenuEditor*>(o) ) {
TQPtrList<TQAction> actions; TQPtrList<TQAction> actions;
if ( ::tqqt_cast<QDesignerToolBar*>(o) ) if ( ::tqt_cast<QDesignerToolBar*>(o) )
actions = ( (QDesignerToolBar*)o )->insertedActions(); actions = ( (QDesignerToolBar*)o )->insertedActions();
else else
( (PopupMenuEditor*)o )->insertedActions( actions ); ( (PopupMenuEditor*)o )->insertedActions( actions );
@ -539,31 +539,31 @@ void HierarchyList::insertObject( TQObject *o, TQListViewItem *parent )
it.toLast(); it.toLast();
while ( it.current() ) { while ( it.current() ) {
TQAction *a = it.current(); TQAction *a = it.current();
if ( ::tqqt_cast<QDesignerAction*>(a) ) { if ( ::tqt_cast<QDesignerAction*>(a) ) {
QDesignerAction *da = (QDesignerAction*)a; QDesignerAction *da = (QDesignerAction*)a;
if ( da->supportsMenu() ) if ( da->supportsMenu() )
insertObject( da, item ); insertObject( da, item );
else else
insertObject( TQT_TQOBJECT(da->widget()), item ); insertObject( TQT_TQOBJECT(da->widget()), item );
} else if ( ::tqqt_cast<QDesignerActionGroup*>(a) ) { } else if ( ::tqt_cast<QDesignerActionGroup*>(a) ) {
insertObject( a, item ); insertObject( a, item );
} }
--it; --it;
} }
} else if ( ::tqqt_cast<QDesignerActionGroup*>(o) && !o->childrenListObject().isEmpty() ) { } else if ( ::tqt_cast<QDesignerActionGroup*>(o) && !o->childrenListObject().isEmpty() ) {
TQObjectList l = o->childrenListObject(); TQObjectList l = o->childrenListObject();
for ( TQObject *obj = l.last(); obj; obj = l.prev() ) { for ( TQObject *obj = l.last(); obj; obj = l.prev() ) {
if ( ::tqqt_cast<QDesignerAction*>(obj) ) { if ( ::tqt_cast<QDesignerAction*>(obj) ) {
QDesignerAction *da = (QDesignerAction*)obj; QDesignerAction *da = (QDesignerAction*)obj;
if ( da->supportsMenu() ) if ( da->supportsMenu() )
insertObject( da, item ); insertObject( da, item );
else else
insertObject( TQT_TQOBJECT(da->widget()), item ); insertObject( TQT_TQOBJECT(da->widget()), item );
} else if ( ::tqqt_cast<QDesignerActionGroup*>(obj) ) { } else if ( ::tqt_cast<QDesignerActionGroup*>(obj) ) {
insertObject( obj, item ); insertObject( obj, item );
} }
} }
} else if ( ::tqqt_cast<MenuBarEditor*>(o) ) { } else if ( ::tqt_cast<MenuBarEditor*>(o) ) {
MenuBarEditor *mb = (MenuBarEditor*)o; MenuBarEditor *mb = (MenuBarEditor*)o;
for ( int i = mb->count() -1; i >= 0; --i ) { for ( int i = mb->count() -1; i >= 0; --i ) {
MenuBarEditorItem *md = mb->item( i ); MenuBarEditorItem *md = mb->item( i );
@ -604,7 +604,7 @@ void HierarchyList::showRMBMenu( TQListViewItem *i, const TQPoint & p )
TQWidget *w = (TQWidget*)o; TQWidget *w = (TQWidget*)o;
if ( w->isVisibleTo( formWindow ) ) { if ( w->isVisibleTo( formWindow ) ) {
if ( !::tqqt_cast<TQTabWidget*>(w) && !::tqqt_cast<TQWizard*>(w) ) { if ( !::tqt_cast<TQTabWidget*>(w) && !::tqt_cast<TQWizard*>(w) ) {
if ( !normalMenu ) if ( !normalMenu )
normalMenu = formWindow->mainWindow()->setupNormalHierarchyMenu( this ); normalMenu = formWindow->mainWindow()->setupNormalHierarchyMenu( this );
normalMenu->popup( p ); normalMenu->popup( p );
@ -625,14 +625,14 @@ void HierarchyList::addTabPage()
if ( !o || !o->isWidgetType() ) if ( !o || !o->isWidgetType() )
return; return;
TQWidget *w = (TQWidget*)o; TQWidget *w = (TQWidget*)o;
if ( ::tqqt_cast<TQTabWidget*>(w) ) { if ( ::tqt_cast<TQTabWidget*>(w) ) {
TQTabWidget *tw = (TQTabWidget*)w; TQTabWidget *tw = (TQTabWidget*)w;
AddTabPageCommand *cmd = new AddTabPageCommand( i18n( "Add Page to %1" ). AddTabPageCommand *cmd = new AddTabPageCommand( i18n( "Add Page to %1" ).
arg( tw->name() ), formWindow, arg( tw->name() ), formWindow,
tw, "Tab" ); tw, "Tab" );
formWindow->commandHistory()->addCommand( cmd ); formWindow->commandHistory()->addCommand( cmd );
cmd->execute(); cmd->execute();
} else if ( ::tqqt_cast<TQWizard*>(w) ) { } else if ( ::tqt_cast<TQWizard*>(w) ) {
TQWizard *wiz = (TQWizard*)formWindow->mainContainer(); TQWizard *wiz = (TQWizard*)formWindow->mainContainer();
AddWizardPageCommand *cmd = new AddWizardPageCommand( i18n( "Add Page to %1" ). AddWizardPageCommand *cmd = new AddWizardPageCommand( i18n( "Add Page to %1" ).
arg( wiz->name() ), formWindow, arg( wiz->name() ), formWindow,
@ -648,7 +648,7 @@ void HierarchyList::removeTabPage()
if ( !o || !o->isWidgetType() ) if ( !o || !o->isWidgetType() )
return; return;
TQWidget *w = (TQWidget*)o; TQWidget *w = (TQWidget*)o;
if ( ::tqqt_cast<TQTabWidget*>(w) ) { if ( ::tqt_cast<TQTabWidget*>(w) ) {
TQTabWidget *tw = (TQTabWidget*)w; TQTabWidget *tw = (TQTabWidget*)w;
if ( tw->currentPage() ) { if ( tw->currentPage() ) {
QDesignerTabWidget *dtw = (QDesignerTabWidget*)tw; QDesignerTabWidget *dtw = (QDesignerTabWidget*)tw;
@ -659,7 +659,7 @@ void HierarchyList::removeTabPage()
formWindow->commandHistory()->addCommand( cmd ); formWindow->commandHistory()->addCommand( cmd );
cmd->execute(); cmd->execute();
} }
} else if ( ::tqqt_cast<TQWizard*>(w) ) { } else if ( ::tqt_cast<TQWizard*>(w) ) {
TQWizard *wiz = (TQWizard*)formWindow->mainContainer(); TQWizard *wiz = (TQWizard*)formWindow->mainContainer();
if ( wiz->currentPage() ) { if ( wiz->currentPage() ) {
QDesignerWizard *dw = (QDesignerWizard*)wiz; QDesignerWizard *dw = (QDesignerWizard*)wiz;
@ -1445,7 +1445,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 ( ::tqqt_cast<TQMainWindow*>(w) ) if ( ::tqt_cast<TQMainWindow*>(w) )
w2 = ( (TQMainWindow*)w )->centralWidget(); w2 = ( (TQMainWindow*)w )->centralWidget();
listview->changeNameOf( TQT_TQOBJECT(w2), w->name() ); listview->changeNameOf( TQT_TQOBJECT(w2), w->name() );
} }

@ -167,7 +167,7 @@ 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 || ::tqqt_cast<TQLayoutWidget*>(layoutBase) || ::tqqt_cast<TQSplitter*>(layoutBase); needReparent = needMove || ::tqt_cast<TQLayoutWidget*>(layoutBase) || ::tqt_cast<TQSplitter*>(layoutBase);
if ( !layoutBase ) { if ( !layoutBase ) {
if ( !useSplitter ) if ( !useSplitter )
layoutBase = WidgetFactory::create( WidgetDatabase::idFromClassName( "TQLayoutWidget" ), layoutBase = WidgetFactory::create( WidgetDatabase::idFromClassName( "TQLayoutWidget" ),
@ -216,7 +216,7 @@ void Layout::undoLayout()
} }
formWindow->selectWidget( TQT_TQOBJECT(layoutBase), FALSE ); formWindow->selectWidget( TQT_TQOBJECT(layoutBase), FALSE );
WidgetFactory::deleteLayout( layoutBase ); WidgetFactory::deleteLayout( layoutBase );
if ( parent != layoutBase && !::tqqt_cast<TQMainWindow*>(layoutBase) ) { if ( parent != layoutBase && !::tqt_cast<TQMainWindow*>(layoutBase) ) {
layoutBase->hide(); layoutBase->hide();
TQString n = layoutBase->name(); TQString n = layoutBase->name();
n.prepend( "qt_dead_widget_" ); n.prepend( "qt_dead_widget_" );
@ -321,13 +321,13 @@ void HorizontalLayout::doLayout()
layout->addWidget( w, 0, ( (Spacer*)w )->alignment() ); layout->addWidget( w, 0, ( (Spacer*)w )->alignment() );
else else
layout->addWidget( w ); layout->addWidget( w );
if ( ::tqqt_cast<TQLayoutWidget*>(w) ) if ( ::tqt_cast<TQLayoutWidget*>(w) )
( (TQLayoutWidget*)w )->updateSizePolicy(); ( (TQLayoutWidget*)w )->updateSizePolicy();
} }
w->show(); w->show();
} }
if ( ::tqqt_cast<TQSplitter*>(layoutBase) ) if ( ::tqt_cast<TQSplitter*>(layoutBase) )
( (TQSplitter*)layoutBase )->setOrientation( TQt::Horizontal ); ( (TQSplitter*)layoutBase )->setOrientation( TQt::Horizontal );
finishLayout( needMove, layout ); finishLayout( needMove, layout );
@ -385,13 +385,13 @@ void VerticalLayout::doLayout()
layout->addWidget( w, 0, ( (Spacer*)w )->alignment() ); layout->addWidget( w, 0, ( (Spacer*)w )->alignment() );
else else
layout->addWidget( w ); layout->addWidget( w );
if ( ::tqqt_cast<TQLayoutWidget*>(w) ) if ( ::tqt_cast<TQLayoutWidget*>(w) )
( (TQLayoutWidget*)w )->updateSizePolicy(); ( (TQLayoutWidget*)w )->updateSizePolicy();
} }
w->show(); w->show();
} }
if ( ::tqqt_cast<TQSplitter*>(layoutBase) ) if ( ::tqt_cast<TQSplitter*>(layoutBase) )
( (TQSplitter*)layoutBase )->setOrientation( TQt::Vertical ); ( (TQSplitter*)layoutBase )->setOrientation( TQt::Vertical );
finishLayout( needMove, layout ); finishLayout( needMove, layout );
@ -759,11 +759,11 @@ void GridLayout::doLayout()
if ( needReparent && w->parent() != layoutBase ) if ( needReparent && w->parent() != layoutBase )
w->reparent( layoutBase, 0, TQPoint( 0, 0 ), FALSE ); w->reparent( layoutBase, 0, TQPoint( 0, 0 ), FALSE );
if ( rs * cs == 1 ) { if ( rs * cs == 1 ) {
layout->addWidget( w, r, c, ::tqqt_cast<Spacer*>(w) ? ( (Spacer*)w )->alignment() : 0 ); layout->addWidget( w, r, c, ::tqt_cast<Spacer*>(w) ? ( (Spacer*)w )->alignment() : 0 );
} else { } else {
layout->addMultiCellWidget( w, r, r+rs-1, c, c+cs-1, ::tqqt_cast<Spacer*>(w) ? ( (Spacer*)w )->alignment() : 0 ); layout->addMultiCellWidget( w, r, r+rs-1, c, c+cs-1, ::tqt_cast<Spacer*>(w) ? ( (Spacer*)w )->alignment() : 0 );
} }
if ( ::tqqt_cast<TQLayoutWidget*>(w) ) if ( ::tqt_cast<TQLayoutWidget*>(w) )
( (TQLayoutWidget*)w )->updateSizePolicy(); ( (TQLayoutWidget*)w )->updateSizePolicy();
w->show(); w->show();
} else { } else {

@ -907,7 +907,7 @@ void MainWindow::showProperties( TQObject *o )
} }
if ( currentTool() == POINTER_TOOL && fw && if ( currentTool() == POINTER_TOOL && fw &&
( !qworkspace->activeWindow() || !::tqqt_cast<SourceEditor*>(qworkspace->activeWindow()) ) ) ( !qworkspace->activeWindow() || !::tqt_cast<SourceEditor*>(qworkspace->activeWindow()) ) )
fw->setFocus(); fw->setFocus();
} }
@ -924,21 +924,21 @@ void MainWindow::updateProperties( TQObject * )
bool MainWindow::eventFilter( TQObject *o, TQEvent *e ) bool MainWindow::eventFilter( TQObject *o, TQEvent *e )
{ {
if ( ::tqqt_cast<MenuBarEditor*>(o) || ::tqqt_cast<PopupMenuEditor*>(o) || if ( ::tqt_cast<MenuBarEditor*>(o) || ::tqt_cast<PopupMenuEditor*>(o) ||
( o && ( o &&
( ::tqqt_cast<MenuBarEditor*>(o->parent()) || ( ::tqt_cast<MenuBarEditor*>(o->parent()) ||
::tqqt_cast<PopupMenuEditor*>(o->parent()) ) ) ) { ::tqt_cast<PopupMenuEditor*>(o->parent()) ) ) ) {
if ( e->type() == TQEvent::Accel && ::tqqt_cast<PopupMenuEditor*>(o) ) { if ( e->type() == TQEvent::Accel && ::tqt_cast<PopupMenuEditor*>(o) ) {
return TRUE; // consume accel events return TRUE; // consume accel events
} else if ( e->type() == TQEvent::MouseButtonPress && ::tqqt_cast<MenuBarEditor*>(o) ) { } else if ( e->type() == TQEvent::MouseButtonPress && ::tqt_cast<MenuBarEditor*>(o) ) {
TQPoint pos = ((TQMouseEvent*)e)->pos(); TQPoint pos = ((TQMouseEvent*)e)->pos();
MenuBarEditor *m = ::tqqt_cast<MenuBarEditor*>(o); MenuBarEditor *m = ::tqt_cast<MenuBarEditor*>(o);
showProperties( o ); showProperties( o );
if ( m->findItem( pos ) >= m->count() ) if ( m->findItem( pos ) >= m->count() )
m->setFocus(); m->setFocus();
} else if ( e->type() == TQEvent::MouseButtonPress && ::tqqt_cast<PopupMenuEditor*>(o) ) { } else if ( e->type() == TQEvent::MouseButtonPress && ::tqt_cast<PopupMenuEditor*>(o) ) {
PopupMenuEditor *m = ::tqqt_cast<PopupMenuEditor*>(o); PopupMenuEditor *m = ::tqt_cast<PopupMenuEditor*>(o);
PopupMenuEditorItem *i = m->at( ((TQMouseEvent*)e)->pos() ); PopupMenuEditorItem *i = m->at( ((TQMouseEvent*)e)->pos() );
if ( m->find( i->action() ) != -1 && !i->isSeparator() ) if ( m->find( i->action() ) != -1 && !i->isSeparator() )
showProperties( i->action() ); showProperties( i->action() );
@ -957,7 +957,7 @@ bool MainWindow::eventFilter( TQObject *o, TQEvent *e )
( ( (TQKeyEvent*)e )->state() & ShiftButton ) != ShiftButton ) { ( ( (TQKeyEvent*)e )->state() & ShiftButton ) != ShiftButton ) {
w = (TQWidget*)o; w = (TQWidget*)o;
while ( w ) { while ( w ) {
if ( ::tqqt_cast<PropertyList*>(w) ) if ( ::tqt_cast<PropertyList*>(w) )
break; break;
w = w->parentWidget( TRUE ); w = w->parentWidget( TRUE );
} }
@ -973,7 +973,7 @@ bool MainWindow::eventFilter( TQObject *o, TQEvent *e )
( (TQKeyEvent*)e )->key() == Key_E ) && ( (TQKeyEvent*)e )->key() == Key_E ) &&
( (TQKeyEvent*)e )->state() & ControlButton ) { ( (TQKeyEvent*)e )->state() & ControlButton ) {
if ( qWorkspace()->activeWindow() && if ( qWorkspace()->activeWindow() &&
::tqqt_cast<SourceEditor*>(qWorkspace()->activeWindow()) ) { ::tqt_cast<SourceEditor*>(qWorkspace()->activeWindow()) ) {
( (TQKeyEvent*)e )->ignore(); ( (TQKeyEvent*)e )->ignore();
return TRUE; return TRUE;
} }
@ -982,44 +982,44 @@ bool MainWindow::eventFilter( TQObject *o, TQEvent *e )
case TQEvent::ContextMenu: case TQEvent::ContextMenu:
case TQEvent::MouseButtonPress: case TQEvent::MouseButtonPress:
if ( o && currentTool() == POINTER_TOOL && if ( o && currentTool() == POINTER_TOOL &&
( ::tqqt_cast<MenuBarEditor*>(o) || ( ::tqt_cast<MenuBarEditor*>(o) ||
::tqqt_cast<PopupMenuEditor*>(o) || ::tqt_cast<PopupMenuEditor*>(o) ||
::tqqt_cast<QDesignerToolBar*>(o) || ::tqt_cast<QDesignerToolBar*>(o) ||
( ::tqqt_cast<TQComboBox*>(o) || ( ::tqt_cast<TQComboBox*>(o) ||
::tqqt_cast<TQToolButton*>(o) || ::tqt_cast<TQToolButton*>(o) ||
::tqqt_cast<QDesignerToolBarSeparator*>(o) ) && ::tqt_cast<QDesignerToolBarSeparator*>(o) ) &&
o->parent() o->parent()
&& ( ::tqqt_cast<QDesignerToolBar*>(o->parent()) && ( ::tqt_cast<QDesignerToolBar*>(o->parent())
|| ::tqqt_cast<QDesignerWidgetStack*>(o->parent())) ) ) { || ::tqt_cast<QDesignerWidgetStack*>(o->parent())) ) ) {
TQWidget *w = (TQWidget*)o; TQWidget *w = (TQWidget*)o;
if ( ::tqqt_cast<TQToolButton*>(w) || if ( ::tqt_cast<TQToolButton*>(w) ||
::tqqt_cast<TQComboBox*>(w) || ::tqt_cast<TQComboBox*>(w) ||
::tqqt_cast<PopupMenuEditor*>(w) || ::tqt_cast<PopupMenuEditor*>(w) ||
::tqqt_cast<QDesignerToolBarSeparator*>(w) ) ::tqt_cast<QDesignerToolBarSeparator*>(w) )
w = w->parentWidget(); w = w->parentWidget();
TQWidget *pw = w->parentWidget(); TQWidget *pw = w->parentWidget();
while ( pw ) { while ( pw ) {
if ( ::tqqt_cast<FormWindow*>(pw) ) { if ( ::tqt_cast<FormWindow*>(pw) ) {
( (FormWindow*)pw )->emitShowProperties( TQT_TQOBJECT(w) ); ( (FormWindow*)pw )->emitShowProperties( TQT_TQOBJECT(w) );
if ( !::tqqt_cast<QDesignerToolBar*>(o) ) if ( !::tqt_cast<QDesignerToolBar*>(o) )
return ( !::tqqt_cast<TQToolButton*>(o) && return ( !::tqt_cast<TQToolButton*>(o) &&
!::tqqt_cast<MenuBarEditor*>(o) && !::tqt_cast<MenuBarEditor*>(o) &&
!::tqqt_cast<TQComboBox*>(o) && !::tqt_cast<TQComboBox*>(o) &&
!::tqqt_cast<QDesignerToolBarSeparator*>(o) ); !::tqt_cast<QDesignerToolBarSeparator*>(o) );
} }
pw = pw->parentWidget(); pw = pw->parentWidget();
} }
} }
if ( o && ( ::tqqt_cast<QDesignerToolBar*>(o) || o->inherits("TQDockWindowHandle") ) if ( o && ( ::tqt_cast<QDesignerToolBar*>(o) || o->inherits("TQDockWindowHandle") )
&& e->type() == TQEvent::ContextMenu ) && e->type() == TQEvent::ContextMenu )
break; break;
if ( isAToolBarChild( o ) && currentTool() != CONNECT_TOOL && currentTool() != BUDDY_TOOL ) if ( isAToolBarChild( o ) && currentTool() != CONNECT_TOOL && currentTool() != BUDDY_TOOL )
break; break;
if ( ::tqqt_cast<TQSizeGrip*>(o) ) if ( ::tqt_cast<TQSizeGrip*>(o) )
break; break;
if ( !( w = isAFormWindowChild( o ) ) || if ( !( w = isAFormWindowChild( o ) ) ||
::tqqt_cast<SizeHandle*>(o) || ::tqt_cast<SizeHandle*>(o) ||
::tqqt_cast<OrderIndicator*>(o) ) ::tqt_cast<OrderIndicator*>(o) )
break; break;
if ( !w->hasFocus() ) if ( !w->hasFocus() )
w->setFocus(); w->setFocus();
@ -1044,11 +1044,11 @@ bool MainWindow::eventFilter( TQObject *o, TQEvent *e )
lastPressWidget = 0; lastPressWidget = 0;
if ( isAToolBarChild( o ) && currentTool() != CONNECT_TOOL && currentTool() != BUDDY_TOOL ) if ( isAToolBarChild( o ) && currentTool() != CONNECT_TOOL && currentTool() != BUDDY_TOOL )
break; break;
if ( ::tqqt_cast<TQSizeGrip*>(o) ) if ( ::tqt_cast<TQSizeGrip*>(o) )
break; break;
if ( !( w = isAFormWindowChild( o ) ) || if ( !( w = isAFormWindowChild( o ) ) ||
::tqqt_cast<SizeHandle*>(o) || ::tqt_cast<SizeHandle*>(o) ||
::tqqt_cast<OrderIndicator*>(o) ) ::tqt_cast<OrderIndicator*>(o) )
break; break;
passiveInteractor = WidgetFactory::isPassiveInteractor( o ); passiveInteractor = WidgetFactory::isPassiveInteractor( o );
if ( !passiveInteractor ) if ( !passiveInteractor )
@ -1064,15 +1064,15 @@ bool MainWindow::eventFilter( TQObject *o, TQEvent *e )
break; break;
w = isAFormWindowChild( o ); w = isAFormWindowChild( o );
if ( lastPressWidget != (TQWidget*)o && w && if ( lastPressWidget != (TQWidget*)o && w &&
!::tqqt_cast<SizeHandle*>(o) && !::tqqt_cast<OrderIndicator*>(o) && !::tqt_cast<SizeHandle*>(o) && !::tqt_cast<OrderIndicator*>(o) &&
!::tqqt_cast<PopupMenuEditor*>(o) && !::tqqt_cast<TQMenuBar*>(o) && !::tqt_cast<PopupMenuEditor*>(o) && !::tqt_cast<TQMenuBar*>(o) &&
!::tqqt_cast<TQSizeGrip*>(o) ) !::tqt_cast<TQSizeGrip*>(o) )
return TRUE; return TRUE;
if ( o && ::tqqt_cast<TQSizeGrip*>(o) ) if ( o && ::tqt_cast<TQSizeGrip*>(o) )
break; break;
if ( lastPressWidget != (TQWidget*)o || if ( lastPressWidget != (TQWidget*)o ||
( !w || ::tqqt_cast<SizeHandle*>(o) ) || ( !w || ::tqt_cast<SizeHandle*>(o) ) ||
::tqqt_cast<OrderIndicator*>(o) ) ::tqt_cast<OrderIndicator*>(o) )
break; break;
passiveInteractor = WidgetFactory::isPassiveInteractor( o ); passiveInteractor = WidgetFactory::isPassiveInteractor( o );
if ( !passiveInteractor ) if ( !passiveInteractor )
@ -1085,14 +1085,14 @@ bool MainWindow::eventFilter( TQObject *o, TQEvent *e )
return FALSE; return FALSE;
} }
if ( ( (TQKeyEvent*)e )->key() == Key_Escape && incrementalSearch->hasFocus() ) { if ( ( (TQKeyEvent*)e )->key() == Key_Escape && incrementalSearch->hasFocus() ) {
if ( ::tqqt_cast<SourceEditor*>(qWorkspace()->activeWindow()) ) { if ( ::tqt_cast<SourceEditor*>(qWorkspace()->activeWindow()) ) {
qWorkspace()->activeWindow()->setFocus(); qWorkspace()->activeWindow()->setFocus();
return TRUE; return TRUE;
} }
} }
if ( !( w = isAFormWindowChild( o ) ) || if ( !( w = isAFormWindowChild( o ) ) ||
::tqqt_cast<SizeHandle*>(o) || ::tqt_cast<SizeHandle*>(o) ||
::tqqt_cast<OrderIndicator*>(o) ) ::tqt_cast<OrderIndicator*>(o) )
break; break;
( (FormWindow*)w )->handleKeyPress( (TQKeyEvent*)e, ( (FormWindow*)w )->designerWidget( o ) ); ( (FormWindow*)w )->handleKeyPress( (TQKeyEvent*)e, ( (FormWindow*)w )->designerWidget( o ) );
if ( ((TQKeyEvent*)e)->isAccepted() ) if ( ((TQKeyEvent*)e)->isAccepted() )
@ -1100,10 +1100,10 @@ bool MainWindow::eventFilter( TQObject *o, TQEvent *e )
break; break;
case TQEvent::MouseButtonDblClick: case TQEvent::MouseButtonDblClick:
if ( !( w = isAFormWindowChild( o ) ) || if ( !( w = isAFormWindowChild( o ) ) ||
::tqqt_cast<SizeHandle*>(o) || ::tqt_cast<SizeHandle*>(o) ||
::tqqt_cast<OrderIndicator*>(o) ) { ::tqt_cast<OrderIndicator*>(o) ) {
if ( ::tqqt_cast<TQToolButton*>(o) && ((TQToolButton*)o)->isOn() && if ( ::tqt_cast<TQToolButton*>(o) && ((TQToolButton*)o)->isOn() &&
o->parent() && ::tqqt_cast<TQToolBar*>(o->parent()) && formWindow() ) o->parent() && ::tqt_cast<TQToolBar*>(o->parent()) && formWindow() )
formWindow()->setToolFixed(); formWindow()->setToolFixed();
break; break;
} }
@ -1117,8 +1117,8 @@ bool MainWindow::eventFilter( TQObject *o, TQEvent *e )
return TRUE; return TRUE;
case TQEvent::KeyRelease: case TQEvent::KeyRelease:
if ( !( w = isAFormWindowChild( o ) ) || if ( !( w = isAFormWindowChild( o ) ) ||
::tqqt_cast<SizeHandle*>(o) || ::tqt_cast<SizeHandle*>(o) ||
::tqqt_cast<OrderIndicator*>(o) ) ::tqt_cast<OrderIndicator*>(o) )
break; break;
( (FormWindow*)w )->handleKeyRelease( (TQKeyEvent*)e, ( (FormWindow*)w )->designerWidget( o ) ); ( (FormWindow*)w )->handleKeyRelease( (TQKeyEvent*)e, ( (FormWindow*)w )->designerWidget( o ) );
if ( ((TQKeyEvent*)e)->isAccepted() ) if ( ((TQKeyEvent*)e)->isAccepted() )
@ -1126,8 +1126,8 @@ bool MainWindow::eventFilter( TQObject *o, TQEvent *e )
break; break;
case TQEvent::Hide: case TQEvent::Hide:
if ( !( w = isAFormWindowChild( o ) ) || if ( !( w = isAFormWindowChild( o ) ) ||
::tqqt_cast<SizeHandle*>(o) || ::tqt_cast<SizeHandle*>(o) ||
::tqqt_cast<OrderIndicator*>(o) ) ::tqt_cast<OrderIndicator*>(o) )
break; break;
if ( ( (FormWindow*)w )->isWidgetSelected( TQT_TQOBJECT(o) ) ) if ( ( (FormWindow*)w )->isWidgetSelected( TQT_TQOBJECT(o) ) )
( (FormWindow*)w )->selectWidget( TQT_TQOBJECT(o), FALSE ); ( (FormWindow*)w )->selectWidget( TQT_TQOBJECT(o), FALSE );
@ -1135,16 +1135,16 @@ bool MainWindow::eventFilter( TQObject *o, TQEvent *e )
case TQEvent::Enter: case TQEvent::Enter:
case TQEvent::Leave: case TQEvent::Leave:
if ( !( w = isAFormWindowChild( o ) ) || if ( !( w = isAFormWindowChild( o ) ) ||
::tqqt_cast<SizeHandle*>(o) || ::tqt_cast<SizeHandle*>(o) ||
::tqqt_cast<OrderIndicator*>(o) || ::tqt_cast<OrderIndicator*>(o) ||
::tqqt_cast<MenuBarEditor*>(o) ) ::tqt_cast<MenuBarEditor*>(o) )
break; break;
return TRUE; return TRUE;
case TQEvent::Resize: case TQEvent::Resize:
case TQEvent::Move: case TQEvent::Move:
if ( !( w = isAFormWindowChild( o ) ) || if ( !( w = isAFormWindowChild( o ) ) ||
::tqqt_cast<SizeHandle*>(o) || ::tqt_cast<SizeHandle*>(o) ||
::tqqt_cast<OrderIndicator*>(o) ) ::tqt_cast<OrderIndicator*>(o) )
break; break;
if ( WidgetFactory::layoutType( (TQWidget*)o->parent() ) != WidgetFactory::NoLayout ) { if ( WidgetFactory::layoutType( (TQWidget*)o->parent() ) != WidgetFactory::NoLayout ) {
( (FormWindow*)w )->updateSelection( (TQWidget*)o ); ( (FormWindow*)w )->updateSelection( (TQWidget*)o );
@ -1190,33 +1190,33 @@ bool MainWindow::eventFilter( TQObject *o, TQEvent *e )
return TRUE; return TRUE;
case TQEvent::Wheel: case TQEvent::Wheel:
if ( !( w = isAFormWindowChild( o ) ) || if ( !( w = isAFormWindowChild( o ) ) ||
::tqqt_cast<SizeHandle*>(o) || ::tqt_cast<SizeHandle*>(o) ||
::tqqt_cast<OrderIndicator*>(o) ) ::tqt_cast<OrderIndicator*>(o) )
break; break;
return TRUE; return TRUE;
case TQEvent::FocusIn: case TQEvent::FocusIn:
if ( !::tqqt_cast<FormWindow*>(o) && isAFormWindowChild( o ) ) if ( !::tqt_cast<FormWindow*>(o) && isAFormWindowChild( o ) )
return TRUE; //FIXME return TRUE; //FIXME
if ( hierarchyView->formDefinitionView()->isRenaming() if ( hierarchyView->formDefinitionView()->isRenaming()
&& ( o->inherits( "Editor" ) || ::tqqt_cast<FormWindow*>(o) ) ) && ( o->inherits( "Editor" ) || ::tqt_cast<FormWindow*>(o) ) )
TQApplication::sendPostedEvents(); TQApplication::sendPostedEvents();
if ( o->inherits( "Editor" ) ) { if ( o->inherits( "Editor" ) ) {
TQWidget *w = (TQWidget*)o; TQWidget *w = (TQWidget*)o;
while ( w ) { while ( w ) {
if ( ::tqqt_cast<SourceEditor*>(w) ) if ( ::tqt_cast<SourceEditor*>(w) )
break; break;
w = w->parentWidget( TRUE ); w = w->parentWidget( TRUE );
} }
if ( ::tqqt_cast<SourceEditor*>(w) ) if ( ::tqt_cast<SourceEditor*>(w) )
( (SourceEditor*)w )->checkTimeStamp(); ( (SourceEditor*)w )->checkTimeStamp();
} else if ( ::tqqt_cast<FormWindow*>(o) ) { } else if ( ::tqt_cast<FormWindow*>(o) ) {
FormWindow *fw = (FormWindow*)o; FormWindow *fw = (FormWindow*)o;
if ( fw->formFile() && fw->formFile()->editor() ) if ( fw->formFile() && fw->formFile()->editor() )
fw->formFile()->editor()->checkTimeStamp(); fw->formFile()->editor()->checkTimeStamp();
} }
break; break;
case TQEvent::FocusOut: case TQEvent::FocusOut:
if ( !::tqqt_cast<FormWindow*>(o) && isAFormWindowChild( o ) ) if ( !::tqt_cast<FormWindow*>(o) && isAFormWindowChild( o ) )
return TRUE; return TRUE;
break; break;
default: default:
@ -1228,10 +1228,10 @@ bool MainWindow::eventFilter( TQObject *o, TQEvent *e )
TQWidget *MainWindow::isAFormWindowChild( TQObject *o ) const TQWidget *MainWindow::isAFormWindowChild( TQObject *o ) const
{ {
if ( ::tqqt_cast<TQWizard*>(o->parent()) && !::tqqt_cast<TQPushButton*>(o) ) if ( ::tqt_cast<TQWizard*>(o->parent()) && !::tqt_cast<TQPushButton*>(o) )
return 0; return 0;
while ( o ) { while ( o ) {
if ( ::tqqt_cast<FormWindow*>(o) ) if ( ::tqt_cast<FormWindow*>(o) )
return (TQWidget*)o; return (TQWidget*)o;
o = o->parent(); o = o->parent();
} }
@ -1241,9 +1241,9 @@ TQWidget *MainWindow::isAFormWindowChild( TQObject *o ) const
TQWidget *MainWindow::isAToolBarChild( TQObject *o ) const TQWidget *MainWindow::isAToolBarChild( TQObject *o ) const
{ {
while ( o ) { while ( o ) {
if ( ::tqqt_cast<QDesignerToolBar*>(o) ) if ( ::tqt_cast<QDesignerToolBar*>(o) )
return (TQWidget*)o; return (TQWidget*)o;
if ( ::tqqt_cast<FormWindow*>(o) ) if ( ::tqt_cast<FormWindow*>(o) )
return 0; return 0;
o = o->parent(); o = o->parent();
} }
@ -1254,7 +1254,7 @@ FormWindow *MainWindow::formWindow()
{ {
if ( qworkspace->activeWindow() ) { if ( qworkspace->activeWindow() ) {
FormWindow *fw = 0; FormWindow *fw = 0;
if ( ::tqqt_cast<FormWindow*>(qworkspace->activeWindow()) ) if ( ::tqt_cast<FormWindow*>(qworkspace->activeWindow()) )
fw = (FormWindow*)qworkspace->activeWindow(); fw = (FormWindow*)qworkspace->activeWindow();
else if ( lastActiveFormWindow && else if ( lastActiveFormWindow &&
qworkspace->windowList().find( lastActiveFormWindow ) != -1) qworkspace->windowList().find( lastActiveFormWindow ) != -1)
@ -1366,7 +1366,7 @@ bool MainWindow::unregisterClient( FormWindow *w )
void MainWindow::activeWindowChanged( TQWidget *w ) void MainWindow::activeWindowChanged( TQWidget *w )
{ {
TQWidget *old = formWindow(); TQWidget *old = formWindow();
if ( ::tqqt_cast<FormWindow*>(w) ) { if ( ::tqt_cast<FormWindow*>(w) ) {
FormWindow *fw = (FormWindow*)w; FormWindow *fw = (FormWindow*)w;
FormWindow *ofw = lastActiveFormWindow; FormWindow *ofw = lastActiveFormWindow;
lastActiveFormWindow = fw; lastActiveFormWindow = fw;
@ -1380,13 +1380,13 @@ void MainWindow::activeWindowChanged( TQWidget *w )
} }
workspace()->activeFormChanged( fw ); workspace()->activeFormChanged( fw );
setAppropriate( (TQDockWindow*)actionEditor->parentWidget(), setAppropriate( (TQDockWindow*)actionEditor->parentWidget(),
::tqqt_cast<TQMainWindow*>(lastActiveFormWindow->mainContainer()) ); ::tqt_cast<TQMainWindow*>(lastActiveFormWindow->mainContainer()) );
if ( appropriate( (TQDockWindow*)actionEditor->parentWidget() ) ) { if ( appropriate( (TQDockWindow*)actionEditor->parentWidget() ) ) {
if ( actionEditor->wantToBeShown() ) if ( actionEditor->wantToBeShown() )
actionEditor->parentWidget()->show(); actionEditor->parentWidget()->show();
} else { } else {
TQWidget *mc = 0; TQWidget *mc = 0;
if ( ofw && (mc = ofw->mainContainer()) && ::tqqt_cast<TQMainWindow*>(mc) ) if ( ofw && (mc = ofw->mainContainer()) && ::tqt_cast<TQMainWindow*>(mc) )
actionEditor->setWantToBeShown( !actionEditor->parentWidget()->isHidden() ); actionEditor->setWantToBeShown( !actionEditor->parentWidget()->isHidden() );
actionEditor->parentWidget()->hide(); actionEditor->parentWidget()->hide();
} }
@ -1421,7 +1421,7 @@ void MainWindow::activeWindowChanged( TQWidget *w )
selectionChanged(); selectionChanged();
if ( ::tqqt_cast<SourceEditor*>(w) ) { if ( ::tqt_cast<SourceEditor*>(w) ) {
SourceEditor *se = (SourceEditor*)w; SourceEditor *se = (SourceEditor*)w;
TQGuardedPtr<FormWindow> fw = se->formWindow(); TQGuardedPtr<FormWindow> fw = se->formWindow();
if ( se->formWindow() && if ( se->formWindow() &&
@ -1474,7 +1474,7 @@ void MainWindow::updateUndoRedo( bool undoAvailable, bool redoAvailable,
const TQString &undoCmd, const TQString &redoCmd ) const TQString &undoCmd, const TQString &redoCmd )
{ {
if ( qWorkspace()->activeWindow() && if ( qWorkspace()->activeWindow() &&
::tqqt_cast<SourceEditor*>(qWorkspace()->activeWindow()) ) ::tqt_cast<SourceEditor*>(qWorkspace()->activeWindow()) )
return; // do not set a formWindow related command return; // do not set a formWindow related command
actionEditUndo->setEnabled( undoAvailable ); actionEditUndo->setEnabled( undoAvailable );
actionEditRedo->setEnabled( redoAvailable ); actionEditRedo->setEnabled( redoAvailable );
@ -1499,7 +1499,7 @@ void MainWindow::updateUndoRedo( bool undoAvailable, bool redoAvailable,
void MainWindow::updateEditorUndoRedo() void MainWindow::updateEditorUndoRedo()
{ {
if ( !qWorkspace()->activeWindow() || if ( !qWorkspace()->activeWindow() ||
!::tqqt_cast<SourceEditor*>(qWorkspace()->activeWindow()) ) !::tqt_cast<SourceEditor*>(qWorkspace()->activeWindow()) )
return; return;
SourceEditor *editor = (SourceEditor*)qWorkspace()->activeWindow(); SourceEditor *editor = (SourceEditor*)qWorkspace()->activeWindow();
actionEditUndo->setEnabled( editor->editIsUndoAvailable() ); actionEditUndo->setEnabled( editor->editIsUndoAvailable() );
@ -1575,7 +1575,7 @@ void MainWindow::setupRMBProperties( TQValueList<uint> &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) && !::tqqt_cast<TQTextEdit*>(w) ) { if ( text && text->designable(w) && !::tqt_cast<TQTextEdit*>(w) ) {
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 );
} }
@ -1611,7 +1611,7 @@ void MainWindow::setupRMBSpecialCommands( TQValueList<uint> &ids,
{ {
int id; int id;
if ( ::tqqt_cast<TQTabWidget*>(w) ) { if ( ::tqt_cast<TQTabWidget*>(w) ) {
if ( ids.isEmpty() ) if ( ids.isEmpty() )
ids << rmbWidgets->insertSeparator( 0 ); ids << rmbWidgets->insertSeparator( 0 );
if ( ( (QDesignerTabWidget*)w )->count() > 1) { if ( ( (QDesignerTabWidget*)w )->count() > 1) {
@ -1620,7 +1620,7 @@ void MainWindow::setupRMBSpecialCommands( TQValueList<uint> &ids,
} }
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 );
} else if ( ::tqqt_cast<QDesignerWidgetStack*>(w) ) { } else if ( ::tqt_cast<QDesignerWidgetStack*>(w) ) {
if ( ids.isEmpty() ) if ( ids.isEmpty() )
ids << rmbWidgets->insertSeparator( 0 ); ids << rmbWidgets->insertSeparator( 0 );
if ( ( (QDesignerWidgetStack*)w )->count() > 1) { if ( ( (QDesignerWidgetStack*)w )->count() > 1) {
@ -1634,7 +1634,7 @@ void MainWindow::setupRMBSpecialCommands( TQValueList<uint> &ids,
} }
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 );
} else if ( ::tqqt_cast<TQToolBox*>(w) ) { } else if ( ::tqt_cast<TQToolBox*>(w) ) {
if ( ids.isEmpty() ) if ( ids.isEmpty() )
ids << rmbWidgets->insertSeparator( 0 ); ids << rmbWidgets->insertSeparator( 0 );
if ( ( (TQToolBox*)w )->count() > 1 ) { if ( ( (TQToolBox*)w )->count() > 1 ) {
@ -1682,7 +1682,7 @@ void MainWindow::setupRMBSpecialCommands( TQValueList<uint> &ids,
{ {
int id; int id;
if ( ::tqqt_cast<TQWizard*>(fw->mainContainer()) ) { if ( ::tqt_cast<TQWizard*>(fw->mainContainer()) ) {
if ( ids.isEmpty() ) if ( ids.isEmpty() )
ids << rmbFormWindow->insertSeparator( 0 ); ids << rmbFormWindow->insertSeparator( 0 );
@ -1700,7 +1700,7 @@ void MainWindow::setupRMBSpecialCommands( TQValueList<uint> &ids,
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 ( ::tqqt_cast<TQMainWindow*>(fw->mainContainer()) ) { } else if ( ::tqt_cast<TQMainWindow*>(fw->mainContainer()) ) {
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 ) );
@ -1715,7 +1715,7 @@ void MainWindow::handleRMBProperties( int id, TQMap<TQString, int> &props, TQWid
if ( id == props[ "text" ] ) { if ( id == props[ "text" ] ) {
bool ok = FALSE; bool ok = FALSE;
bool oldDoWrap = FALSE; bool oldDoWrap = FALSE;
if ( ::tqqt_cast<TQLabel*>(w) ) { if ( ::tqt_cast<TQLabel*>(w) ) {
int align = w->property( "alignment" ).toInt(); int align = w->property( "alignment" ).toInt();
if ( align & WordBreak ) if ( align & WordBreak )
oldDoWrap = TRUE; oldDoWrap = TRUE;
@ -1723,8 +1723,8 @@ void MainWindow::handleRMBProperties( int id, TQMap<TQString, int> &props, TQWid
bool doWrap = oldDoWrap; bool doWrap = oldDoWrap;
TQString text; TQString text;
if ( ::tqqt_cast<TQTextView*>(w) || ::tqqt_cast<TQLabel*>(w) || ::tqqt_cast<TQButton*>(w) ) { if ( ::tqt_cast<TQTextView*>(w) || ::tqt_cast<TQLabel*>(w) || ::tqt_cast<TQButton*>(w) ) {
text = MultiLineEditor::getText( this, w->property( "text" ).toString(), !::tqqt_cast<TQButton*>(w), &doWrap ); text = MultiLineEditor::getText( this, w->property( "text" ).toString(), !::tqt_cast<TQButton*>(w), &doWrap );
ok = !text.isNull(); ok = !text.isNull();
} else { } else {
text = TQInputDialog::getText( i18n("Text"), i18n( "New text" ), text = TQInputDialog::getText( i18n("Text"), i18n( "New text" ),
@ -1793,7 +1793,7 @@ void MainWindow::handleRMBProperties( int id, TQMap<TQString, int> &props, TQWid
void MainWindow::handleRMBSpecialCommands( int id, TQMap<TQString, int> &commands, TQWidget *w ) void MainWindow::handleRMBSpecialCommands( int id, TQMap<TQString, int> &commands, TQWidget *w )
{ {
if ( ::tqqt_cast<TQTabWidget*>(w) ) { if ( ::tqt_cast<TQTabWidget*>(w) ) {
TQTabWidget *tw = (TQTabWidget*)w; TQTabWidget *tw = (TQTabWidget*)w;
if ( id == commands[ "add" ] ) { if ( id == commands[ "add" ] ) {
AddTabPageCommand *cmd = AddTabPageCommand *cmd =
@ -1812,7 +1812,7 @@ void MainWindow::handleRMBSpecialCommands( int id, TQMap<TQString, int> &command
cmd->execute(); cmd->execute();
} }
} }
} else if ( ::tqqt_cast<TQToolBox*>(w) ) { } else if ( ::tqt_cast<TQToolBox*>(w) ) {
TQToolBox *tb = (TQToolBox*)w; TQToolBox *tb = (TQToolBox*)w;
if ( id == commands[ "add" ] ) { if ( id == commands[ "add" ] ) {
AddToolBoxPageCommand *cmd = AddToolBoxPageCommand *cmd =
@ -1832,7 +1832,7 @@ void MainWindow::handleRMBSpecialCommands( int id, TQMap<TQString, int> &command
cmd->execute(); cmd->execute();
} }
} }
} else if ( ::tqqt_cast<TQWidgetStack*>(w) ) { } else if ( ::tqt_cast<TQWidgetStack*>(w) ) {
QDesignerWidgetStack *ws = (QDesignerWidgetStack*)w; QDesignerWidgetStack *ws = (QDesignerWidgetStack*)w;
if ( id == commands[ "add" ] ) { if ( id == commands[ "add" ] ) {
AddWidgetStackPageCommand *cmd = AddWidgetStackPageCommand *cmd =
@ -1933,7 +1933,7 @@ void MainWindow::handleRMBSpecialCommands( int id, TQMap<TQString, int> &command
void MainWindow::handleRMBSpecialCommands( int id, TQMap<TQString, int> &commands, FormWindow *fw ) void MainWindow::handleRMBSpecialCommands( int id, TQMap<TQString, int> &commands, FormWindow *fw )
{ {
if ( ::tqqt_cast<TQWizard*>(fw->mainContainer()) ) { if ( ::tqt_cast<TQWizard*>(fw->mainContainer()) ) {
TQWizard *wiz = (TQWizard*)fw->mainContainer(); TQWizard *wiz = (TQWizard*)fw->mainContainer();
if ( id == commands[ "add" ] ) { if ( id == commands[ "add" ] ) {
AddWizardPageCommand *cmd = AddWizardPageCommand *cmd =
@ -1971,7 +1971,7 @@ void MainWindow::handleRMBSpecialCommands( int id, TQMap<TQString, int> &command
cmd->execute(); cmd->execute();
} }
} }
} else if ( ::tqqt_cast<TQMainWindow*>(fw->mainContainer()) ) { } else if ( ::tqt_cast<TQMainWindow*>(fw->mainContainer()) ) {
TQMainWindow *mw = (TQMainWindow*)fw->mainContainer(); TQMainWindow *mw = (TQMainWindow*)fw->mainContainer();
if ( id == commands[ "add_toolbar" ] ) { if ( id == commands[ "add_toolbar" ] ) {
AddToolBarCommand *cmd = AddToolBarCommand *cmd =
@ -2484,7 +2484,7 @@ void MainWindow::closeEvent( TQCloseEvent *e )
while ( wit.current() ) { while ( wit.current() ) {
TQWidget *w = wit.current(); TQWidget *w = wit.current();
++wit; ++wit;
if ( ::tqqt_cast<FormWindow*>(w) ) { if ( ::tqt_cast<FormWindow*>(w) ) {
if ( ( (FormWindow*)w )->formFile()->editor() ) if ( ( (FormWindow*)w )->formFile()->editor() )
windows.removeRef( ( (FormWindow*)w )->formFile()->editor() ); windows.removeRef( ( (FormWindow*)w )->formFile()->editor() );
if ( ( (FormWindow*)w )->formFile()->formWindow() ) if ( ( (FormWindow*)w )->formFile()->formWindow() )
@ -2493,7 +2493,7 @@ void MainWindow::closeEvent( TQCloseEvent *e )
e->ignore(); e->ignore();
return; return;
} }
} else if ( ::tqqt_cast<SourceEditor*>(w) ) { } else if ( ::tqt_cast<SourceEditor*>(w) ) {
if ( !( (SourceEditor*)w )->close() ) { if ( !( (SourceEditor*)w )->close() ) {
e->ignore(); e->ignore();
return; return;
@ -2617,7 +2617,7 @@ bool MainWindow::openEditor( TQWidget *w, FormWindow *f )
if ( text && text->designable(w) ) { if ( text && text->designable(w) ) {
bool ok = FALSE; bool ok = FALSE;
bool oldDoWrap = FALSE; bool oldDoWrap = FALSE;
if ( ::tqqt_cast<TQLabel*>(w) ) { if ( ::tqt_cast<TQLabel*>(w) ) {
int align = w->property( "alignment" ).toInt(); int align = w->property( "alignment" ).toInt();
if ( align & WordBreak ) if ( align & WordBreak )
oldDoWrap = TRUE; oldDoWrap = TRUE;
@ -2625,9 +2625,9 @@ bool MainWindow::openEditor( TQWidget *w, FormWindow *f )
bool doWrap = oldDoWrap; bool doWrap = oldDoWrap;
TQString text; TQString text;
if ( ::tqqt_cast<TQTextEdit*>(w) || ::tqqt_cast<TQLabel*>(w) || ::tqqt_cast<TQButton*>(w) ) { if ( ::tqt_cast<TQTextEdit*>(w) || ::tqt_cast<TQLabel*>(w) || ::tqt_cast<TQButton*>(w) ) {
text = MultiLineEditor::getText( this, w->property( "text" ).toString(), text = MultiLineEditor::getText( this, w->property( "text" ).toString(),
!::tqqt_cast<TQButton*>(w), &doWrap ); !::tqt_cast<TQButton*>(w), &doWrap );
ok = !text.isNull(); ok = !text.isNull();
} else { } else {
text = TQInputDialog::getText( i18n("Text"), i18n( "New text" ), text = TQInputDialog::getText( i18n("Text"), i18n( "New text" ),
@ -2741,7 +2741,7 @@ bool MainWindow::isCustomWidgetUsed( MetaDataBase::CustomWidget *wid )
{ {
TQWidgetList windows = qWorkspace()->windowList(); TQWidgetList windows = qWorkspace()->windowList();
for ( TQWidget *w = windows.first(); w; w = windows.next() ) { for ( TQWidget *w = windows.first(); w; w = windows.next() ) {
if ( ::tqqt_cast<FormWindow*>(w) ) { if ( ::tqt_cast<FormWindow*>(w) ) {
if ( ( (FormWindow*)w )->isCustomWidgetUsed( wid ) ) if ( ( (FormWindow*)w )->isCustomWidgetUsed( wid ) )
return TRUE; return TRUE;
} }
@ -2756,7 +2756,7 @@ void MainWindow::setGrid( const TQPoint &p )
grd = p; grd = p;
TQWidgetList windows = qWorkspace()->windowList(); TQWidgetList windows = qWorkspace()->windowList();
for ( TQWidget *w = windows.first(); w; w = windows.next() ) { for ( TQWidget *w = windows.first(); w; w = windows.next() ) {
if ( !::tqqt_cast<FormWindow*>(w) ) if ( !::tqt_cast<FormWindow*>(w) )
continue; continue;
( (FormWindow*)w )->mainContainer()->update(); ( (FormWindow*)w )->mainContainer()->update();
} }
@ -2769,7 +2769,7 @@ void MainWindow::setShowGrid( bool b )
sGrid = b; sGrid = b;
TQWidgetList windows = qWorkspace()->windowList(); TQWidgetList windows = qWorkspace()->windowList();
for ( TQWidget *w = windows.first(); w; w = windows.next() ) { for ( TQWidget *w = windows.first(); w; w = windows.next() ) {
if ( !::tqqt_cast<FormWindow*>(w) ) if ( !::tqt_cast<FormWindow*>(w) )
continue; continue;
( (FormWindow*)w )->mainContainer()->update(); ( (FormWindow*)w )->mainContainer()->update();
} }
@ -2855,48 +2855,48 @@ void MainWindow::showDialogHelp()
TQString link = documentationPath() + "/designer-manual-13.html#"; TQString link = documentationPath() + "/designer-manual-13.html#";
if ( ::tqqt_cast<NewFormBase*>(w) || ::tqqt_cast<StartDialogBase*>(w) ) // own doc for startdialog? if ( ::tqt_cast<NewFormBase*>(w) || ::tqt_cast<StartDialogBase*>(w) ) // own doc for startdialog?
link += "dialog-file-new"; link += "dialog-file-new";
else if ( ::tqqt_cast<CreateTemplate*>(w) ) else if ( ::tqt_cast<CreateTemplate*>(w) )
link += "dialog-file-create-template"; link += "dialog-file-create-template";
else if ( ::tqqt_cast<EditFunctionsBase*>(w) ) else if ( ::tqt_cast<EditFunctionsBase*>(w) )
link += "dialog-edit-functions"; link += "dialog-edit-functions";
// else if ( ::tqqt_cast<ConnectionViewerBase*>(w) ) // else if ( ::tqt_cast<ConnectionViewerBase*>(w) )
else if ( w->inherits("ConnectionViewerBase") ) else if ( w->inherits("ConnectionViewerBase") )
link += "dialog-view-connections"; link += "dialog-view-connections";
else if ( ::tqqt_cast<FormSettingsBase*>(w) ) else if ( ::tqt_cast<FormSettingsBase*>(w) )
link += "dialog-edit-form-settings"; link += "dialog-edit-form-settings";
else if ( ::tqqt_cast<Preferences*>(w) ) else if ( ::tqt_cast<Preferences*>(w) )
link += "dialog-edit-preferences"; link += "dialog-edit-preferences";
else if ( ::tqqt_cast<PixmapCollectionEditor*>(w) ) else if ( ::tqt_cast<PixmapCollectionEditor*>(w) )
link += "dialog-image-collection"; link += "dialog-image-collection";
// else if ( ::tqqt_cast<DatabaseConnectionBase*>(w) ) // else if ( ::tqt_cast<DatabaseConnectionBase*>(w) )
else if ( w->inherits( "DatabaseConnectionBase" ) ) else if ( w->inherits( "DatabaseConnectionBase" ) )
link += "dialog-edit-database-connections"; link += "dialog-edit-database-connections";
else if ( ::tqqt_cast<ProjectSettingsBase*>(w) ) else if ( ::tqt_cast<ProjectSettingsBase*>(w) )
link += "dialog-project-settings"; link += "dialog-project-settings";
else if ( ::tqqt_cast<FindDialog*>(w) ) else if ( ::tqt_cast<FindDialog*>(w) )
link += "dialog-find-text"; link += "dialog-find-text";
else if ( ::tqqt_cast<ReplaceDialog*>(w) ) else if ( ::tqt_cast<ReplaceDialog*>(w) )
link += "dialog-replace-text"; link += "dialog-replace-text";
else if ( ::tqqt_cast<GotoLineDialog*>(w) ) else if ( ::tqt_cast<GotoLineDialog*>(w) )
link += "dialog-go-to-line"; link += "dialog-go-to-line";
// else if ( ::tqqt_cast<ConnectionEditorBase*>(w) ) // else if ( ::tqt_cast<ConnectionEditorBase*>(w) )
else if ( w->inherits("ConnectionEditorBase") ) else if ( w->inherits("ConnectionEditorBase") )
link += "dialog-edit-connections"; link += "dialog-edit-connections";
else if ( ::tqqt_cast<CustomWidgetEditorBase*>(w) ) else if ( ::tqt_cast<CustomWidgetEditorBase*>(w) )
link += "dialog-edit-custom-widgets"; link += "dialog-edit-custom-widgets";
else if ( ::tqqt_cast<PaletteEditorBase*>(w) ) else if ( ::tqt_cast<PaletteEditorBase*>(w) )
link += "dialog-edit-palette"; link += "dialog-edit-palette";
else if ( ::tqqt_cast<ListBoxEditorBase*>(w) ) else if ( ::tqt_cast<ListBoxEditorBase*>(w) )
link += "dialog-edit-listbox"; link += "dialog-edit-listbox";
else if ( ::tqqt_cast<ListViewEditorBase*>(w) ) else if ( ::tqt_cast<ListViewEditorBase*>(w) )
link += "dialog-edit-listview"; link += "dialog-edit-listview";
else if ( ::tqqt_cast<IconViewEditorBase*>(w) ) else if ( ::tqt_cast<IconViewEditorBase*>(w) )
link += "dialog-edit-iconview"; link += "dialog-edit-iconview";
else if ( ::tqqt_cast<TableEditorBase*>(w) ) else if ( ::tqt_cast<TableEditorBase*>(w) )
link += "dialog-edit-table"; link += "dialog-edit-table";
else if ( ::tqqt_cast<MultiLineEditor*>(w) ) else if ( ::tqt_cast<MultiLineEditor*>(w) )
link += "dialog-text"; link += "dialog-text";
else { else {
@ -3184,10 +3184,10 @@ void MainWindow::setModified( bool b, TQWidget *window )
{ {
TQWidget *w = window; TQWidget *w = window;
while ( w ) { while ( w ) {
if ( ::tqqt_cast<FormWindow*>(w) ) { if ( ::tqt_cast<FormWindow*>(w) ) {
( (FormWindow*)w )->modificationChanged( b ); ( (FormWindow*)w )->modificationChanged( b );
return; return;
} else if ( ::tqqt_cast<SourceEditor*>(w) ) { } else if ( ::tqt_cast<SourceEditor*>(w) ) {
FormWindow *fw = ( (SourceEditor*)w )->formWindow(); FormWindow *fw = ( (SourceEditor*)w )->formWindow();
if ( fw && !fw->isFake() ) { if ( fw && !fw->isFake() ) {
//fw->commandHistory()->setModified( b ); //fw->commandHistory()->setModified( b );
@ -3222,7 +3222,7 @@ void MainWindow::doFunctionsChanged()
void MainWindow::updateFunctionList() void MainWindow::updateFunctionList()
{ {
if ( !qWorkspace()->activeWindow() || !::tqqt_cast<SourceEditor*>(qWorkspace()->activeWindow()) ) if ( !qWorkspace()->activeWindow() || !::tqt_cast<SourceEditor*>(qWorkspace()->activeWindow()) )
return; return;
SourceEditor *se = (SourceEditor*)qWorkspace()->activeWindow(); SourceEditor *se = (SourceEditor*)qWorkspace()->activeWindow();
se->save(); se->save();
@ -3311,9 +3311,9 @@ void MainWindow::showSourceLine( TQObject *o, int line, LineMode lm )
FormWindow *fw = 0; FormWindow *fw = 0;
SourceEditor *se = 0; SourceEditor *se = 0;
SourceFile *sf = 0; SourceFile *sf = 0;
if ( ::tqqt_cast<FormWindow*>(w) ) { if ( ::tqt_cast<FormWindow*>(w) ) {
fw = (FormWindow*)w; fw = (FormWindow*)w;
} else if ( ::tqqt_cast<SourceEditor*>(w) ) { } else if ( ::tqt_cast<SourceEditor*>(w) ) {
se = (SourceEditor*)w; se = (SourceEditor*)w;
if ( !se->object() ) if ( !se->object() )
continue; continue;
@ -3381,7 +3381,7 @@ void MainWindow::showSourceLine( TQObject *o, int line, LineMode lm )
} }
} }
if ( ::tqqt_cast<SourceFile*>(o) ) { if ( ::tqt_cast<SourceFile*>(o) ) {
for ( TQPtrListIterator<SourceFile> sources = currentProject->sourceFiles(); for ( TQPtrListIterator<SourceFile> sources = currentProject->sourceFiles();
sources.current(); ++sources ) { sources.current(); ++sources ) {
SourceFile* f = sources.current(); SourceFile* f = sources.current();
@ -3443,12 +3443,12 @@ TQObject *MainWindow::findRealObject( TQObject *o )
{ {
TQWidgetList windows = qWorkspace()->windowList(); TQWidgetList windows = qWorkspace()->windowList();
for ( TQWidget *w = windows.first(); w; w = windows.next() ) { for ( TQWidget *w = windows.first(); w; w = windows.next() ) {
if ( ::tqqt_cast<FormWindow*>(w) && TQString( w->name() ) == TQString( o->name() ) ) if ( ::tqt_cast<FormWindow*>(w) && TQString( w->name() ) == TQString( o->name() ) )
return TQT_TQOBJECT(w); return TQT_TQOBJECT(w);
else if ( ::tqqt_cast<SourceEditor*>(w) && ( (SourceEditor*)w )->formWindow() && else if ( ::tqt_cast<SourceEditor*>(w) && ( (SourceEditor*)w )->formWindow() &&
TQString( ( (SourceEditor*)w )->formWindow()->name() ) == TQString( o->name() ) ) TQString( ( (SourceEditor*)w )->formWindow()->name() ) == TQString( o->name() ) )
return TQT_TQOBJECT(w); return TQT_TQOBJECT(w);
else if ( ::tqqt_cast<SourceFile*>(w) && ( (SourceEditor*)w )->sourceFile() && else if ( ::tqt_cast<SourceFile*>(w) && ( (SourceEditor*)w )->sourceFile() &&
( (SourceEditor*)w )->sourceFile() == o ) ( (SourceEditor*)w )->sourceFile() == o )
return o; return o;
} }
@ -3469,7 +3469,7 @@ void MainWindow::breakPointsChanged()
{ {
if ( !inDebugMode ) if ( !inDebugMode )
return; return;
if ( !qWorkspace()->activeWindow() || !::tqqt_cast<SourceEditor*>(qWorkspace()->activeWindow()) ) if ( !qWorkspace()->activeWindow() || !::tqt_cast<SourceEditor*>(qWorkspace()->activeWindow()) )
return; return;
SourceEditor *e = (SourceEditor*)qWorkspace()->activeWindow(); SourceEditor *e = (SourceEditor*)qWorkspace()->activeWindow();
if ( !e->object() || !e->project() ) if ( !e->object() || !e->project() )
@ -3636,13 +3636,13 @@ void MainWindow::setSingleProject( Project *pro )
while ( wit.current() ) { while ( wit.current() ) {
TQWidget *w = wit.current(); TQWidget *w = wit.current();
++wit; ++wit;
if ( ::tqqt_cast<FormWindow*>(w) ) { if ( ::tqt_cast<FormWindow*>(w) ) {
if ( ( (FormWindow*)w )->project() == pro ) { if ( ( (FormWindow*)w )->project() == pro ) {
if ( ( (FormWindow*)w )->formFile()->editor() ) if ( ( (FormWindow*)w )->formFile()->editor() )
windows.removeRef( ( (FormWindow*)w )->formFile()->editor() ); windows.removeRef( ( (FormWindow*)w )->formFile()->editor() );
( (FormWindow*)w )->formFile()->close(); ( (FormWindow*)w )->formFile()->close();
} }
} else if ( ::tqqt_cast<SourceEditor*>(w) ) { } else if ( ::tqt_cast<SourceEditor*>(w) ) {
( (SourceEditor*)w )->close(); ( (SourceEditor*)w )->close();
} }
} }

@ -958,15 +958,15 @@ void MainWindow::setupWindowActions()
int j = 0; int j = 0;
for ( int i = 0; i < int( windows.count() ); ++i ) { for ( int i = 0; i < int( windows.count() ); ++i ) {
TQWidget *w = windows.at( i ); TQWidget *w = windows.at( i );
if ( !::tqqt_cast<FormWindow*>(w) && !::tqqt_cast<SourceEditor*>(w) ) if ( !::tqt_cast<FormWindow*>(w) && !::tqt_cast<SourceEditor*>(w) )
continue; continue;
if ( ::tqqt_cast<FormWindow*>(w) && ( ( (FormWindow*)w )->isFake() ) ) if ( ::tqt_cast<FormWindow*>(w) && ( ( (FormWindow*)w )->isFake() ) )
continue; continue;
j++; j++;
TQString itemText; TQString itemText;
if ( j < 10 ) if ( j < 10 )
itemText = TQString("&%1 ").arg( j ); itemText = TQString("&%1 ").arg( j );
if ( ::tqqt_cast<FormWindow*>(w) ) if ( ::tqt_cast<FormWindow*>(w) )
itemText += w->name(); itemText += w->name();
else else
itemText += w->caption(); itemText += w->caption();
@ -1085,9 +1085,9 @@ void MainWindow::fileClose()
} else { } else {
TQWidget *w = qworkspace->activeWindow(); TQWidget *w = qworkspace->activeWindow();
if ( w ) { if ( w ) {
if ( ::tqqt_cast<FormWindow*>(w) ) if ( ::tqt_cast<FormWindow*>(w) )
( (FormWindow*)w )->formFile()->close(); ( (FormWindow*)w )->formFile()->close();
else if ( ::tqqt_cast<SourceEditor*>(w) ) else if ( ::tqt_cast<SourceEditor*>(w) )
( (SourceEditor*)w )->close(); ( (SourceEditor*)w )->close();
} }
} }
@ -1132,14 +1132,14 @@ void MainWindow::fileCloseProject()
while ( wit.current() ) { while ( wit.current() ) {
TQWidget *w = wit.current(); TQWidget *w = wit.current();
++wit; ++wit;
if ( ::tqqt_cast<FormWindow*>(w) ) { if ( ::tqt_cast<FormWindow*>(w) ) {
if ( ( (FormWindow*)w )->project() == pro ) { if ( ( (FormWindow*)w )->project() == pro ) {
if ( ( (FormWindow*)w )->formFile()->editor() ) if ( ( (FormWindow*)w )->formFile()->editor() )
windows.removeRef( ( (FormWindow*)w )->formFile()->editor() ); windows.removeRef( ( (FormWindow*)w )->formFile()->editor() );
if ( !( (FormWindow*)w )->formFile()->close() ) if ( !( (FormWindow*)w )->formFile()->close() )
return; return;
} }
} else if ( ::tqqt_cast<SourceEditor*>(w) ) { } else if ( ::tqt_cast<SourceEditor*>(w) ) {
if ( !( (SourceEditor*)w )->close() ) if ( !( (SourceEditor*)w )->close() )
return; return;
} }
@ -1157,7 +1157,7 @@ void MainWindow::fileCloseProject()
} }
if ( !windows.isEmpty() ) { if ( !windows.isEmpty() ) {
for ( TQWidget *w = windows.first(); w; w = windows.next() ) { for ( TQWidget *w = windows.first(); w; w = windows.next() ) {
if ( !::tqqt_cast<FormWindow*>(w) ) if ( !::tqt_cast<FormWindow*>(w) )
continue; continue;
w->setFocus(); w->setFocus();
activeWindowChanged( w ); activeWindowChanged( w );
@ -1354,7 +1354,7 @@ bool MainWindow::fileSaveForm()
TQWidget *w = qWorkspace()->activeWindow(); TQWidget *w = qWorkspace()->activeWindow();
if ( w ) { if ( w ) {
if ( ::tqqt_cast<SourceEditor*>(w) ) { if ( ::tqt_cast<SourceEditor*>(w) ) {
SourceEditor *se = (SourceEditor*)w; SourceEditor *se = (SourceEditor*)w;
if ( se->formWindow() ) if ( se->formWindow() )
fw = se->formWindow(); fw = se->formWindow();
@ -1387,9 +1387,9 @@ bool MainWindow::fileSaveAs()
TQWidget *w = qworkspace->activeWindow(); TQWidget *w = qworkspace->activeWindow();
if ( !w ) if ( !w )
return TRUE; return TRUE;
if ( ::tqqt_cast<FormWindow*>(w) ) if ( ::tqt_cast<FormWindow*>(w) )
return ( (FormWindow*)w )->formFile()->saveAs(); return ( (FormWindow*)w )->formFile()->saveAs();
else if ( ::tqqt_cast<SourceEditor*>(w) ) else if ( ::tqt_cast<SourceEditor*>(w) )
return ( (SourceEditor*)w )->saveAs(); return ( (SourceEditor*)w )->saveAs();
return FALSE; return FALSE;
} }
@ -1486,7 +1486,7 @@ void MainWindow::createNewTemplate()
void MainWindow::editUndo() void MainWindow::editUndo()
{ {
if ( qWorkspace()->activeWindow() && if ( qWorkspace()->activeWindow() &&
::tqqt_cast<SourceEditor*>(qWorkspace()->activeWindow()) ) { ::tqt_cast<SourceEditor*>(qWorkspace()->activeWindow()) ) {
( (SourceEditor*)qWorkspace()->activeWindow() )->editUndo(); ( (SourceEditor*)qWorkspace()->activeWindow() )->editUndo();
return; return;
} }
@ -1497,7 +1497,7 @@ void MainWindow::editUndo()
void MainWindow::editRedo() void MainWindow::editRedo()
{ {
if ( qWorkspace()->activeWindow() && if ( qWorkspace()->activeWindow() &&
::tqqt_cast<SourceEditor*>(qWorkspace()->activeWindow()) ) { ::tqt_cast<SourceEditor*>(qWorkspace()->activeWindow()) ) {
( (SourceEditor*)qWorkspace()->activeWindow() )->editRedo(); ( (SourceEditor*)qWorkspace()->activeWindow() )->editRedo();
return; return;
} }
@ -1508,7 +1508,7 @@ void MainWindow::editRedo()
void MainWindow::editCut() void MainWindow::editCut()
{ {
if ( qWorkspace()->activeWindow() && if ( qWorkspace()->activeWindow() &&
::tqqt_cast<SourceEditor*>(qWorkspace()->activeWindow()) ) { ::tqt_cast<SourceEditor*>(qWorkspace()->activeWindow()) ) {
( (SourceEditor*)qWorkspace()->activeWindow() )->editCut(); ( (SourceEditor*)qWorkspace()->activeWindow() )->editCut();
return; return;
} }
@ -1519,7 +1519,7 @@ void MainWindow::editCut()
void MainWindow::editCopy() void MainWindow::editCopy()
{ {
if ( qWorkspace()->activeWindow() && if ( qWorkspace()->activeWindow() &&
::tqqt_cast<SourceEditor*>(qWorkspace()->activeWindow()) ) { ::tqt_cast<SourceEditor*>(qWorkspace()->activeWindow()) ) {
( (SourceEditor*)qWorkspace()->activeWindow() )->editCopy(); ( (SourceEditor*)qWorkspace()->activeWindow() )->editCopy();
return; return;
} }
@ -1530,7 +1530,7 @@ void MainWindow::editCopy()
void MainWindow::editPaste() void MainWindow::editPaste()
{ {
if ( qWorkspace()->activeWindow() && if ( qWorkspace()->activeWindow() &&
::tqqt_cast<SourceEditor*>(qWorkspace()->activeWindow()) ) { ::tqt_cast<SourceEditor*>(qWorkspace()->activeWindow()) ) {
( (SourceEditor*)qWorkspace()->activeWindow() )->editPaste(); ( (SourceEditor*)qWorkspace()->activeWindow() )->editPaste();
return; return;
} }
@ -1569,7 +1569,7 @@ void MainWindow::editDelete()
void MainWindow::editSelectAll() void MainWindow::editSelectAll()
{ {
if ( qWorkspace()->activeWindow() && if ( qWorkspace()->activeWindow() &&
::tqqt_cast<SourceEditor*>(qWorkspace()->activeWindow()) ) { ::tqt_cast<SourceEditor*>(qWorkspace()->activeWindow()) ) {
( (SourceEditor*)qWorkspace()->activeWindow() )->editSelectAll(); ( (SourceEditor*)qWorkspace()->activeWindow() )->editSelectAll();
return; return;
} }
@ -1948,7 +1948,7 @@ void MainWindow::editPreferences()
void MainWindow::searchFind() void MainWindow::searchFind()
{ {
if ( !qWorkspace()->activeWindow() || if ( !qWorkspace()->activeWindow() ||
!::tqqt_cast<SourceEditor*>(qWorkspace()->activeWindow()) ) !::tqt_cast<SourceEditor*>(qWorkspace()->activeWindow()) )
return; return;
if ( !findDialog ) if ( !findDialog )
@ -1970,7 +1970,7 @@ void MainWindow::searchIncremetalFindMenu()
void MainWindow::searchIncremetalFind() void MainWindow::searchIncremetalFind()
{ {
if ( !qWorkspace()->activeWindow() || if ( !qWorkspace()->activeWindow() ||
!::tqqt_cast<SourceEditor*>(qWorkspace()->activeWindow()) ) !::tqt_cast<SourceEditor*>(qWorkspace()->activeWindow()) )
return; return;
( (SourceEditor*)qWorkspace()->activeWindow() )->editorInterface()->find( incrementalSearch->text(), ( (SourceEditor*)qWorkspace()->activeWindow() )->editorInterface()->find( incrementalSearch->text(),
@ -1980,7 +1980,7 @@ void MainWindow::searchIncremetalFind()
void MainWindow::searchIncremetalFindNext() void MainWindow::searchIncremetalFindNext()
{ {
if ( !qWorkspace()->activeWindow() || if ( !qWorkspace()->activeWindow() ||
!::tqqt_cast<SourceEditor*>(qWorkspace()->activeWindow()) ) !::tqt_cast<SourceEditor*>(qWorkspace()->activeWindow()) )
return; return;
( (SourceEditor*)qWorkspace()->activeWindow() )->editorInterface()->find( incrementalSearch->text(), ( (SourceEditor*)qWorkspace()->activeWindow() )->editorInterface()->find( incrementalSearch->text(),
@ -1990,7 +1990,7 @@ void MainWindow::searchIncremetalFindNext()
void MainWindow::searchReplace() void MainWindow::searchReplace()
{ {
if ( !qWorkspace()->activeWindow() || if ( !qWorkspace()->activeWindow() ||
!::tqqt_cast<SourceEditor*>(qWorkspace()->activeWindow()) ) !::tqt_cast<SourceEditor*>(qWorkspace()->activeWindow()) )
return; return;
if ( !replaceDialog ) if ( !replaceDialog )
@ -2006,7 +2006,7 @@ void MainWindow::searchReplace()
void MainWindow::searchGotoLine() void MainWindow::searchGotoLine()
{ {
if ( !qWorkspace()->activeWindow() || if ( !qWorkspace()->activeWindow() ||
!::tqqt_cast<SourceEditor*>(qWorkspace()->activeWindow()) ) !::tqt_cast<SourceEditor*>(qWorkspace()->activeWindow()) )
return; return;
if ( !gotoLineDialog ) if ( !gotoLineDialog )

@ -818,7 +818,7 @@ void MenuBarEditor::keyPressEvent( TQKeyEvent * e )
void MenuBarEditor::focusOutEvent( TQFocusEvent * e ) void MenuBarEditor::focusOutEvent( TQFocusEvent * e )
{ {
TQWidget * fw = tqApp->focusWidget(); TQWidget * fw = tqApp->focusWidget();
if ( e->lostFocus() && !::tqqt_cast<PopupMenuEditor*>(fw) ) if ( e->lostFocus() && !::tqt_cast<PopupMenuEditor*>(fw) )
hideItem(); hideItem();
update(); update();
} }

@ -321,7 +321,7 @@ int MetaDataBase::spacing( TQObject *o )
if ( !o ) if ( !o )
return -1; return -1;
setupDataBase(); setupDataBase();
if ( ::tqqt_cast<TQMainWindow*>(o) ) if ( ::tqt_cast<TQMainWindow*>(o) )
o = TQT_TQOBJECT(( (TQMainWindow*)o )->centralWidget()); o = TQT_TQOBJECT(( (TQMainWindow*)o )->centralWidget());
MetaDataBaseRecord *r = db->find( (void*)o ); MetaDataBaseRecord *r = db->find( (void*)o );
if ( !r || !o->isWidgetType() ) { if ( !r || !o->isWidgetType() ) {
@ -352,9 +352,9 @@ void MetaDataBase::setMargin( TQObject *o, int margin )
bool isInnerLayout = TRUE; bool isInnerLayout = TRUE;
TQWidget *widget = (TQWidget*)o; TQWidget *widget = (TQWidget*)o;
if ( widget && !::tqqt_cast<TQLayoutWidget*>(widget) && if ( widget && !::tqt_cast<TQLayoutWidget*>(widget) &&
( WidgetDatabase::isContainer( WidgetDatabase::idFromClassName( WidgetFactory::classNameOf( TQT_TQOBJECT(widget) ) ) ) || ( WidgetDatabase::isContainer( WidgetDatabase::idFromClassName( WidgetFactory::classNameOf( TQT_TQOBJECT(widget) ) ) ) ||
widget && widget->parentWidget() && ::tqqt_cast<FormWindow*>(widget->parentWidget()) ) ) widget && widget->parentWidget() && ::tqt_cast<FormWindow*>(widget->parentWidget()) ) )
isInnerLayout = FALSE; isInnerLayout = FALSE;
@ -378,7 +378,7 @@ int MetaDataBase::margin( TQObject *o )
if ( !o ) if ( !o )
return -1; return -1;
setupDataBase(); setupDataBase();
if ( ::tqqt_cast<TQMainWindow*>(o) ) if ( ::tqt_cast<TQMainWindow*>(o) )
o = TQT_TQOBJECT(( (TQMainWindow*)o )->centralWidget()); o = TQT_TQOBJECT(( (TQMainWindow*)o )->centralWidget());
MetaDataBaseRecord *r = db->find( (void*)o ); MetaDataBaseRecord *r = db->find( (void*)o );
if ( !r || !o->isWidgetType() ) { if ( !r || !o->isWidgetType() ) {
@ -409,7 +409,7 @@ TQString MetaDataBase::resizeMode( TQObject *o )
if ( !o ) if ( !o )
return TQString(); return TQString();
setupDataBase(); setupDataBase();
if ( ::tqqt_cast<TQMainWindow*>(o) ) if ( ::tqt_cast<TQMainWindow*>(o) )
o = TQT_TQOBJECT(( (TQMainWindow*)o )->centralWidget()); o = TQT_TQOBJECT(( (TQMainWindow*)o )->centralWidget());
MetaDataBaseRecord *r = db->find( (void*)o ); MetaDataBaseRecord *r = db->find( (void*)o );
if ( !r || !o->isWidgetType() ) { if ( !r || !o->isWidgetType() ) {
@ -440,15 +440,15 @@ void MetaDataBase::addConnection( TQObject *o, TQObject *sender, const TQCString
r->connections.append( conn ); r->connections.append( conn );
if ( addCode ) { if ( addCode ) {
TQString rec = receiver->name(); TQString rec = receiver->name();
if ( ::tqqt_cast<FormWindow*>(o) && receiver ==( (FormWindow*)o )->mainContainer() ) if ( ::tqt_cast<FormWindow*>(o) && receiver ==( (FormWindow*)o )->mainContainer() )
rec = "this"; rec = "this";
TQString sen = sender->name(); TQString sen = sender->name();
if ( ::tqqt_cast<FormWindow*>(o) && sender ==( (FormWindow*)o )->mainContainer() ) if ( ::tqt_cast<FormWindow*>(o) && sender ==( (FormWindow*)o )->mainContainer() )
sen = "this"; sen = "this";
FormFile *ff = 0; FormFile *ff = 0;
if ( ::tqqt_cast<FormFile*>(o) ) if ( ::tqt_cast<FormFile*>(o) )
ff = (FormFile*)o; ff = (FormFile*)o;
else if ( ::tqqt_cast<FormWindow*>(o) ) else if ( ::tqt_cast<FormWindow*>(o) )
ff = ( (FormWindow*)o )->formFile(); ff = ( (FormWindow*)o )->formFile();
ff->addConnection( sen, signal, rec, slot ); ff->addConnection( sen, signal, rec, slot );
} }
@ -476,7 +476,7 @@ void MetaDataBase::removeConnection( TQObject *o, TQObject *sender, const TQCStr
break; break;
} }
} }
if ( ::tqqt_cast<FormWindow*>(o) ) { if ( ::tqt_cast<FormWindow*>(o) ) {
TQString rec = receiver->name(); TQString rec = receiver->name();
if ( receiver ==( (FormWindow*)o )->mainContainer() ) if ( receiver ==( (FormWindow*)o )->mainContainer() )
rec = "this"; rec = "this";
@ -494,7 +494,7 @@ void MetaDataBase::setupConnections( TQObject *o, const TQValueList<LanguageInte
return; return;
} }
if ( !::tqqt_cast<FormFile*>(o) ) if ( !::tqt_cast<FormFile*>(o) )
return; return;
FormFile *formfile = (FormFile*)o; FormFile *formfile = (FormFile*)o;
@ -679,14 +679,14 @@ bool MetaDataBase::hasSlot( TQObject *o, const TQCString &slot, bool onlyCustom
if ( slotList.find( slot ) != -1 ) if ( slotList.find( slot ) != -1 )
return TRUE; return TRUE;
if ( ::tqqt_cast<FormWindow*>(o) ) { if ( ::tqt_cast<FormWindow*>(o) ) {
o = TQT_TQOBJECT(( (FormWindow*)o )->mainContainer()); o = TQT_TQOBJECT(( (FormWindow*)o )->mainContainer());
slotList = o->metaObject()->slotNames( TRUE ); slotList = o->metaObject()->slotNames( TRUE );
if ( slotList.find( slot ) != -1 ) if ( slotList.find( slot ) != -1 )
return TRUE; return TRUE;
} }
//if ( ::tqqt_cast<CustomWidget*>(o) ) { //if ( ::tqt_cast<CustomWidget*>(o) ) {
if ( o->inherits( "CustomWidget" ) ) { if ( o->inherits( "CustomWidget" ) ) {
MetaDataBase::CustomWidget *w = ( (::CustomWidget*)o )->customWidget(); MetaDataBase::CustomWidget *w = ( (::CustomWidget*)o )->customWidget();
for ( TQValueList<Function>::Iterator it = w->lstSlots.begin(); it != w->lstSlots.end(); ++it ) { for ( TQValueList<Function>::Iterator it = w->lstSlots.begin(); it != w->lstSlots.end(); ++it ) {
@ -909,14 +909,14 @@ bool MetaDataBase::hasFunction( TQObject *o, const TQCString &function, bool onl
if ( functionList.find( function ) != -1 ) if ( functionList.find( function ) != -1 )
return TRUE; return TRUE;
if ( ::tqqt_cast<FormWindow*>(o) ) { if ( ::tqt_cast<FormWindow*>(o) ) {
o = TQT_TQOBJECT(( (FormWindow*)o )->mainContainer()); o = TQT_TQOBJECT(( (FormWindow*)o )->mainContainer());
functionList = o->metaObject()->slotNames( TRUE ); functionList = o->metaObject()->slotNames( TRUE );
if ( functionList.find( function ) != -1 ) if ( functionList.find( function ) != -1 )
return TRUE; return TRUE;
} }
//if ( ::tqqt_cast<CustomWidget*>(o) ) { //if ( ::tqt_cast<CustomWidget*>(o) ) {
if ( o->inherits( "CustomWidget" ) ) { if ( o->inherits( "CustomWidget" ) ) {
MetaDataBase::CustomWidget *w = ( (::CustomWidget*)o )->customWidget(); MetaDataBase::CustomWidget *w = ( (::CustomWidget*)o )->customWidget();
for ( TQValueList<Function>::Iterator it = w->lstSlots.begin(); it != w->lstSlots.end(); ++it ) { for ( TQValueList<Function>::Iterator it = w->lstSlots.begin(); it != w->lstSlots.end(); ++it ) {

@ -227,7 +227,7 @@ MultiLineEditor::MultiLineEditor( bool call_static, bool richtextMode, TQWidget
textEdit->document()->setUseFormatCollection( FALSE ); textEdit->document()->setUseFormatCollection( FALSE );
textEdit->document()->setPreProcessor( new SyntaxHighlighter_HTML ); textEdit->document()->setPreProcessor( new SyntaxHighlighter_HTML );
if ( !callStatic && ::tqqt_cast<TQTextEdit*>(editWidget) ) { if ( !callStatic && ::tqt_cast<TQTextEdit*>(editWidget) ) {
mlined = (TQTextEdit*)editWidget; mlined = (TQTextEdit*)editWidget;
mlined->setReadOnly( TRUE ); mlined->setReadOnly( TRUE );

@ -119,7 +119,7 @@ PopupMenuEditorItem::PopupMenuEditorItem( TQAction * action, PopupMenuEditor * m
removable( TRUE ) removable( TRUE )
{ {
init(); init();
if ( /*a->name() == "qt_separator_action" ||*/ ::tqqt_cast<QSeparatorAction*>(a) ) if ( /*a->name() == "qt_separator_action" ||*/ ::tqt_cast<QSeparatorAction*>(a) )
separator = TRUE; separator = TRUE;
if ( a && !a->childrenListObject().isEmpty() ) if ( a && !a->childrenListObject().isEmpty() )
a->installEventFilter( this ); a->installEventFilter( this );
@ -135,7 +135,7 @@ PopupMenuEditorItem::PopupMenuEditorItem( PopupMenuEditorItem * item, PopupMenuE
removable( item->removable ) removable( item->removable )
{ {
init(); init();
if ( ::tqqt_cast<TQActionGroup*>(a) ) if ( ::tqt_cast<TQActionGroup*>(a) )
a->installEventFilter( this ); a->installEventFilter( this );
} }
@ -175,7 +175,7 @@ void PopupMenuEditorItem::setVisible( bool enable )
bool PopupMenuEditorItem::isVisible() const bool PopupMenuEditorItem::isVisible() const
{ {
TQActionGroup *g = ::tqqt_cast<TQActionGroup*>(a); TQActionGroup *g = ::tqt_cast<TQActionGroup*>(a);
if ( g ) if ( g )
return ( g->isVisible() && g->usesDropDown() ); return ( g->isVisible() && g->usesDropDown() );
else if ( a ) else if ( a )
@ -212,7 +212,7 @@ int PopupMenuEditorItem::count() const
{ {
if ( s ) { if ( s ) {
return s->count(); return s->count();
} else if ( ::tqqt_cast<TQActionGroup*>(a) ) { } else if ( ::tqt_cast<TQActionGroup*>(a) ) {
const TQObjectList l = a->childrenListObject(); const TQObjectList l = a->childrenListObject();
if ( !l.isEmpty() ) if ( !l.isEmpty() )
return l.count(); return l.count();
@ -222,15 +222,15 @@ int PopupMenuEditorItem::count() const
bool PopupMenuEditorItem::eventFilter( TQObject * o, TQEvent * event ) bool PopupMenuEditorItem::eventFilter( TQObject * o, TQEvent * event )
{ {
if ( ! ::tqqt_cast<TQActionGroup*>( o ) ) if ( ! ::tqt_cast<TQActionGroup*>( o ) )
return FALSE; return FALSE;
if ( event->type() == TQEvent::ChildInserted ) { if ( event->type() == TQEvent::ChildInserted ) {
TQChildEvent * ce = ( TQChildEvent * ) event; TQChildEvent * ce = ( TQChildEvent * ) event;
TQObject * c = TQT_TQOBJECT(ce->child()); TQObject * c = TQT_TQOBJECT(ce->child());
TQAction * action = ::tqqt_cast<TQAction*>( c ); TQAction * action = ::tqt_cast<TQAction*>( c );
if ( s->find( action ) != -1 ) // avoid duplicates if ( s->find( action ) != -1 ) // avoid duplicates
return FALSE; return FALSE;
TQActionGroup * actionGroup = ::tqqt_cast<TQActionGroup*>( c ); TQActionGroup * actionGroup = ::tqt_cast<TQActionGroup*>( c );
if ( actionGroup ) if ( actionGroup )
s->insert( actionGroup ); s->insert( actionGroup );
else if ( action ) else if ( action )
@ -361,7 +361,7 @@ void PopupMenuEditor::insert( TQActionGroup * actionGroup, int index )
TQObjectListIterator it( *l ); TQObjectListIterator it( *l );
insert( i, index ); insert( i, index );
for ( ; it.current(); ++it ) { for ( ; it.current(); ++it ) {
g = ::tqqt_cast<TQActionGroup*>(it.current()); g = ::tqt_cast<TQActionGroup*>(it.current());
if ( g ) { if ( g ) {
if ( dropdown ) if ( dropdown )
i->s->insert( g ); i->s->insert( g );
@ -857,7 +857,7 @@ void PopupMenuEditor::dropEvent( TQDropEvent * e )
PopupMenuEditorItemPtrDrag::decode( e, &i ); PopupMenuEditorItemPtrDrag::decode( e, &i );
} else { } else {
if ( e->provides( "application/x-designer-actiongroup" ) ) { if ( e->provides( "application/x-designer-actiongroup" ) ) {
TQActionGroup * g = ::tqqt_cast<QDesignerActionGroup*>(ActionDrag::action()); TQActionGroup * g = ::tqt_cast<QDesignerActionGroup*>(ActionDrag::action());
if ( g->usesDropDown() ) { if ( g->usesDropDown() ) {
i = new PopupMenuEditorItem( g, this ); i = new PopupMenuEditorItem( g, this );
TQString n = TQString( g->name() ) + "Item"; TQString n = TQString( g->name() ) + "Item";
@ -866,7 +866,7 @@ void PopupMenuEditor::dropEvent( TQDropEvent * e )
TQObjectList *l = g->queryList( "TQAction", 0, FALSE, FALSE ); TQObjectList *l = g->queryList( "TQAction", 0, FALSE, FALSE );
TQObjectListIterator it( *l ); TQObjectListIterator it( *l );
for ( ; it.current(); ++it ) { for ( ; it.current(); ++it ) {
g = ::tqqt_cast<TQActionGroup*>(it.current()); g = ::tqt_cast<TQActionGroup*>(it.current());
if ( g ) if ( g )
i->s->insert( g ); i->s->insert( g );
else else
@ -877,7 +877,7 @@ void PopupMenuEditor::dropEvent( TQDropEvent * e )
dropInPlace( g, e->pos().y() ); dropInPlace( g, e->pos().y() );
} }
} else if ( e->provides( "application/x-designer-actions" ) ) { } else if ( e->provides( "application/x-designer-actions" ) ) {
TQAction *a = ::tqqt_cast<QDesignerAction*>(ActionDrag::action()); TQAction *a = ::tqt_cast<QDesignerAction*>(ActionDrag::action());
i = new PopupMenuEditorItem( a, this ); i = new PopupMenuEditorItem( a, this );
} }
} }
@ -1012,12 +1012,12 @@ void PopupMenuEditor::focusInEvent( TQFocusEvent * )
void PopupMenuEditor::focusOutEvent( TQFocusEvent * ) void PopupMenuEditor::focusOutEvent( TQFocusEvent * )
{ {
TQWidget * fw = tqApp->focusWidget(); TQWidget * fw = tqApp->focusWidget();
if ( !fw || ( !::tqqt_cast<PopupMenuEditor*>(fw) && fw != lineEdit ) ) { if ( !fw || ( !::tqt_cast<PopupMenuEditor*>(fw) && fw != lineEdit ) ) {
hideSubMenu(); hideSubMenu();
if ( fw && ::tqqt_cast<MenuBarEditor*>(fw) ) if ( fw && ::tqt_cast<MenuBarEditor*>(fw) )
return; return;
TQWidget * w = this; TQWidget * w = this;
while ( w && w != fw && ::tqqt_cast<PopupMenuEditor*>(w) ) { // hide all popups while ( w && w != fw && ::tqt_cast<PopupMenuEditor*>(w) ) { // hide all popups
w->hide(); w->hide();
w = ((PopupMenuEditor *)w)->parentEditor(); w = ((PopupMenuEditor *)w)->parentEditor();
} }
@ -1243,8 +1243,8 @@ void PopupMenuEditor::dropInPlace( TQActionGroup * g, int y )
if (l.isEmpty()) if (l.isEmpty())
return; return;
for ( int i = 0; i < (int)l.count(); ++i ) { for ( int i = 0; i < (int)l.count(); ++i ) {
TQAction *a = ::tqqt_cast<TQAction*>(l.at(i)); TQAction *a = ::tqt_cast<TQAction*>(l.at(i));
TQActionGroup *g = ::tqqt_cast<TQActionGroup*>(l.at(i)); TQActionGroup *g = ::tqt_cast<TQActionGroup*>(l.at(i));
if ( g ) if ( g )
dropInPlace( g, y ); dropInPlace( g, y );
else if ( a ) else if ( a )
@ -1449,13 +1449,13 @@ TQString PopupMenuEditor::constructName( PopupMenuEditorItem *item )
TQString s; TQString s;
TQString name = item->action()->menuText(); TQString name = item->action()->menuText();
TQWidget *e = parentEditor(); TQWidget *e = parentEditor();
PopupMenuEditor *p = ::tqqt_cast<PopupMenuEditor*>(e); PopupMenuEditor *p = ::tqt_cast<PopupMenuEditor*>(e);
if ( p ) { if ( p ) {
int idx = p->find( item->m ); int idx = p->find( item->m );
PopupMenuEditorItem * i = ( idx > -1 ? p->at( idx ) : 0 ); PopupMenuEditorItem * i = ( idx > -1 ? p->at( idx ) : 0 );
s = ( i ? TQString( i->action()->name() ).remove( "Action" ) : TQString( "" ) ); s = ( i ? TQString( i->action()->name() ).remove( "Action" ) : TQString( "" ) );
} else { } else {
MenuBarEditor *b = ::tqqt_cast<MenuBarEditor*>(e); MenuBarEditor *b = ::tqt_cast<MenuBarEditor*>(e);
if ( b ) { if ( b ) {
int idx = b->findItem( item->m ); int idx = b->findItem( item->m );
MenuBarEditorItem * i = ( idx > -1 ? b->item( idx ) : 0 ); MenuBarEditorItem * i = ( idx > -1 ? b->item( idx ) : 0 );

@ -1514,8 +1514,8 @@ TQString Project::locationOfObject( TQObject *o )
if ( MainWindow::self ) { if ( MainWindow::self ) {
TQWidgetList windows = MainWindow::self->qWorkspace()->windowList(); TQWidgetList windows = MainWindow::self->qWorkspace()->windowList();
for ( TQWidget *w = windows.first(); w; w = windows.next() ) { for ( TQWidget *w = windows.first(); w; w = windows.next() ) {
FormWindow *fw = ::tqqt_cast<FormWindow*>(w); FormWindow *fw = ::tqt_cast<FormWindow*>(w);
SourceEditor *se = ::tqqt_cast<SourceEditor*>(w); SourceEditor *se = ::tqt_cast<SourceEditor*>(w);
if ( fw ) { if ( fw ) {
if ( fw->isFake() ) if ( fw->isFake() )
return objectForFakeForm( fw )->name() + TQString( " [Source]" ); return objectForFakeForm( fw )->name() + TQString( " [Source]" );
@ -1532,7 +1532,7 @@ TQString Project::locationOfObject( TQObject *o )
} }
} }
if ( ::tqqt_cast<SourceFile*>(o) ) { if ( ::tqt_cast<SourceFile*>(o) ) {
for ( TQPtrListIterator<SourceFile> sources = sourceFiles(); for ( TQPtrListIterator<SourceFile> sources = sourceFiles();
sources.current(); ++sources ) { sources.current(); ++sources ) {
SourceFile* f = sources.current(); SourceFile* f = sources.current();

@ -753,7 +753,7 @@ void PropertyTextItem::setValue()
void PropertyTextItem::getText() void PropertyTextItem::getText()
{ {
bool richText = !::tqqt_cast<TQButton*>(listview->propertyEditor()->widget()) || bool richText = !::tqt_cast<TQButton*>(listview->propertyEditor()->widget()) ||
( text( 0 ) == "whatsThis" ); ( text( 0 ) == "whatsThis" );
bool doWrap = FALSE; bool doWrap = FALSE;
TQString txt = MultiLineEditor::getText( listview, value().toString(), richText, &doWrap ); TQString txt = MultiLineEditor::getText( listview, value().toString(), richText, &doWrap );
@ -2307,7 +2307,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 ( ::tqqt_cast<TQScrollView*>(w) ) if ( ::tqt_cast<TQScrollView*>(w) )
w = ( (TQScrollView*)w )->viewport(); w = ( (TQScrollView*)w )->viewport();
TQPalette pal = PaletteEditor::getPalette( &ok, val.toPalette(), TQPalette pal = PaletteEditor::getPalette( &ok, val.toPalette(),
w->backgroundMode(), listview, w->backgroundMode(), listview,
@ -3019,7 +3019,7 @@ static bool parent_is_data_aware( TQWidget *w )
{ {
TQWidget *p = w ? w->parentWidget() : 0; TQWidget *p = w ? w->parentWidget() : 0;
while ( p && !p->isTopLevel() ) { while ( p && !p->isTopLevel() ) {
if ( ::tqqt_cast<QDesignerDataBrowser*>(p) || ::tqqt_cast<QDesignerDataView*>(p) ) if ( ::tqt_cast<QDesignerDataBrowser*>(p) || ::tqt_cast<QDesignerDataView*>(p) )
return TRUE; return TRUE;
p = p->parentWidget(); p = p->parentWidget();
} }
@ -3035,7 +3035,7 @@ void PropertyList::setupProperties()
{ {
if ( !editor->widget() ) if ( !editor->widget() )
return; return;
bool allProperties = !::tqqt_cast<Spacer*>(editor->widget()); bool allProperties = !::tqt_cast<Spacer*>(editor->widget());
TQStrList lst = editor->widget()->metaObject()->propertyNames( allProperties ); TQStrList lst = editor->widget()->metaObject()->propertyNames( allProperties );
PropertyItem *item = 0; PropertyItem *item = 0;
TQMap<TQString, bool> unique; TQMap<TQString, bool> unique;
@ -3053,8 +3053,8 @@ void PropertyList::setupProperties()
continue; continue;
if ( unique.contains( TQString::fromLatin1( it.current() ) ) ) if ( unique.contains( TQString::fromLatin1( it.current() ) ) )
continue; continue;
if ( ::tqqt_cast<QDesignerToolBar*>(editor->widget()) || if ( ::tqt_cast<QDesignerToolBar*>(editor->widget()) ||
::tqqt_cast<MenuBarEditor*>(editor->widget()) ) { ::tqt_cast<MenuBarEditor*>(editor->widget()) ) {
if ( qstrcmp( p->name(), "minimumHeight" ) == 0 ) if ( qstrcmp( p->name(), "minimumHeight" ) == 0 )
continue; continue;
if ( qstrcmp( p->name(), "minimumWidth" ) == 0 ) if ( qstrcmp( p->name(), "minimumWidth" ) == 0 )
@ -3090,7 +3090,7 @@ void PropertyList::setupProperties()
continue; continue;
if ( parentHasLayout && qstrcmp( p->name(), "geometry" ) == 0 ) if ( parentHasLayout && qstrcmp( p->name(), "geometry" ) == 0 )
continue; continue;
if ( ::tqqt_cast<TQLayoutWidget*>(w) || ::tqqt_cast<Spacer*>(w) ) { if ( ::tqt_cast<TQLayoutWidget*>(w) || ::tqt_cast<Spacer*>(w) ) {
if ( qstrcmp( p->name(), "sizePolicy" ) == 0 ) if ( qstrcmp( p->name(), "sizePolicy" ) == 0 )
continue; continue;
if ( qstrcmp( p->name(), "minimumHeight" ) == 0 ) if ( qstrcmp( p->name(), "minimumHeight" ) == 0 )
@ -3133,7 +3133,7 @@ void PropertyList::setupProperties()
continue; continue;
} }
} }
if ( ::tqqt_cast<TQActionGroup*>(w) ) { if ( ::tqt_cast<TQActionGroup*>(w) ) {
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 )
@ -3150,7 +3150,7 @@ void PropertyList::setupProperties()
if ( qstrcmp( p->name(), "buttonGroupId" ) == 0 ) { // #### remove this when designable in TQ_PROPERTY can take a function (isInButtonGroup() in this case) if ( qstrcmp( p->name(), "buttonGroupId" ) == 0 ) { // #### remove this when designable in TQ_PROPERTY can take a function (isInButtonGroup() in this case)
if ( !editor->widget()->isWidgetType() || if ( !editor->widget()->isWidgetType() ||
!editor->widget()->parent() || !editor->widget()->parent() ||
!::tqqt_cast<TQButtonGroup*>(editor->widget()->parent()) ) !::tqt_cast<TQButtonGroup*>(editor->widget()->parent()) )
continue; continue;
} }
@ -3172,7 +3172,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 ( !::tqqt_cast<TQMultiLineEdit*>(editor->widget()) ) { if ( !::tqt_cast<TQMultiLineEdit*>(editor->widget()) ) {
lst.clear(); lst.clear();
lst << p->valueToKey( AlignTop ) lst << p->valueToKey( AlignTop )
<< p->valueToKey( AlignVCenter ) << p->valueToKey( AlignVCenter )
@ -3183,7 +3183,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 ( ::tqqt_cast<TQGroupBox*>(w) ) if ( ::tqt_cast<TQGroupBox*>(w) )
item->setVisible( FALSE ); item->setVisible( FALSE );
setPropertyValue( item ); setPropertyValue( item );
if ( MetaDataBase::isPropertyChanged( editor->widget(), "wordwrap" ) ) if ( MetaDataBase::isPropertyChanged( editor->widget(), "wordwrap" ) )
@ -3231,7 +3231,7 @@ void PropertyList::setupProperties()
} }
} }
if ( !::tqqt_cast<TQSplitter*>(w) && !::tqqt_cast<MenuBarEditor*>(w) && !::tqqt_cast<QDesignerToolBar*>(w) && if ( !::tqt_cast<TQSplitter*>(w) && !::tqt_cast<MenuBarEditor*>(w) && !::tqt_cast<QDesignerToolBar*>(w) &&
w->isWidgetType() && WidgetFactory::layoutType( (TQWidget*)w ) != WidgetFactory::NoLayout ) { w->isWidgetType() && WidgetFactory::layoutType( (TQWidget*)w ) != WidgetFactory::NoLayout ) {
item = new PropertyLayoutItem( this, item, 0, "layoutSpacing" ); item = new PropertyLayoutItem( this, item, 0, "layoutSpacing" );
setPropertyValue( item ); setPropertyValue( item );
@ -3248,8 +3248,8 @@ void PropertyList::setupProperties()
else else
layoutInitValue( item ); layoutInitValue( item );
TQWidget *widget = (TQWidget*)w; TQWidget *widget = (TQWidget*)w;
if ( ( !::tqqt_cast<TQLayoutWidget*>(widget) && if ( ( !::tqt_cast<TQLayoutWidget*>(widget) &&
widget->parentWidget() && ::tqqt_cast<FormWindow*>(widget->parentWidget()) ) ) { widget->parentWidget() && ::tqt_cast<FormWindow*>(widget->parentWidget()) ) ) {
item = new PropertyListItem( this, item, 0, "resizeMode", FALSE ); item = new PropertyListItem( this, item, 0, "resizeMode", FALSE );
TQStringList lst; TQStringList lst;
lst << "Auto" << "FreeResize" << "Minimum" << "Fixed"; lst << "Auto" << "FreeResize" << "Minimum" << "Fixed";
@ -3264,8 +3264,8 @@ void PropertyList::setupProperties()
} }
} }
if ( !::tqqt_cast<Spacer*>(w) && !::tqqt_cast<TQLayoutWidget*>(w) && if ( !::tqt_cast<Spacer*>(w) && !::tqt_cast<TQLayoutWidget*>(w) &&
!::tqqt_cast<MenuBarEditor*>(w) && !::tqqt_cast<QDesignerToolBar*>(w) ) { !::tqt_cast<MenuBarEditor*>(w) && !::tqt_cast<QDesignerToolBar*>(w) ) {
item = new PropertyTextItem( this, item, 0, "toolTip", TRUE, FALSE ); item = new PropertyTextItem( this, item, 0, "toolTip", TRUE, FALSE );
setPropertyValue( item ); setPropertyValue( item );
if ( MetaDataBase::isPropertyChanged( editor->widget(), "toolTip" ) ) if ( MetaDataBase::isPropertyChanged( editor->widget(), "toolTip" ) )
@ -3277,16 +3277,16 @@ void PropertyList::setupProperties()
} }
#ifndef TQT_NO_SQL #ifndef TQT_NO_SQL
if ( !::tqqt_cast<TQDataTable*>(editor->widget()) && !::tqqt_cast<TQDataBrowser*>(editor->widget()) && if ( !::tqt_cast<TQDataTable*>(editor->widget()) && !::tqt_cast<TQDataBrowser*>(editor->widget()) &&
!::tqqt_cast<TQDataView*>(editor->widget()) && parent_is_data_aware( ::tqqt_cast<TQWidget*>(editor->widget()) ) ) { !::tqt_cast<TQDataView*>(editor->widget()) && parent_is_data_aware( ::tqt_cast<TQWidget*>(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 ( ::tqqt_cast<TQDataTable*>(editor->widget()) || ::tqqt_cast<TQDataBrowser*>(editor->widget()) || if ( ::tqt_cast<TQDataTable*>(editor->widget()) || ::tqt_cast<TQDataBrowser*>(editor->widget()) ||
::tqqt_cast<TQDataView*>(editor->widget()) ) { ::tqt_cast<TQDataView*>(editor->widget()) ) {
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" ) )
@ -3369,9 +3369,9 @@ 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,
::tqqt_cast<TQLabel*>(editor->widget()) || ::tqt_cast<TQLabel*>(editor->widget()) ||
::tqqt_cast<TQTextView*>(editor->widget()) || ::tqt_cast<TQTextView*>(editor->widget()) ||
::tqqt_cast<TQButton*>(editor->widget()) ); ::tqt_cast<TQButton*>(editor->widget()) );
break; break;
case TQVariant::CString: case TQVariant::CString:
item = new PropertyTextItem( this, item, 0, item = new PropertyTextItem( this, item, 0,
@ -3549,8 +3549,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 ( ( !::tqqt_cast<TQLineEdit*>(o) || } else if ( ( !::tqt_cast<TQLineEdit*>(o) ||
( ::tqqt_cast<TQLineEdit*>(o) && ( (TQLineEdit*)o )->isReadOnly() ) ) && ( ::tqt_cast<TQLineEdit*>(o) && ( (TQLineEdit*)o )->isReadOnly() ) ) &&
i && i->hasSubItems() ) { i && i->hasSubItems() ) {
if ( !i->isOpen() && if ( !i->isOpen() &&
( ke->key() == Key_Plus || ( ke->key() == Key_Plus ||
@ -3560,12 +3560,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 ) && ::tqqt_cast<TQComboBox*>(o) ) { } else if ( ( ke->key() == Key_Return || ke->key() == Key_Enter ) && ::tqt_cast<TQComboBox*>(o) ) {
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 && ::tqqt_cast<TQLineEdit*>(o) && editor->formWindow() ) { } else if ( e->type() == TQEvent::FocusOut && ::tqt_cast<TQLineEdit*>(o) && 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;
@ -3574,7 +3574,7 @@ bool PropertyList::eventFilter( TQObject *o, TQEvent *e )
case TQEvent::MouseButtonPress: case TQEvent::MouseButtonPress:
me = (TQMouseEvent*)e; me = (TQMouseEvent*)e;
i = (PropertyListItem*) itemAt( me->pos() ); i = (PropertyListItem*) itemAt( me->pos() );
if ( i && ( ::tqqt_cast<PropertyColorItem*>(i) || ::tqqt_cast<PropertyPixmapItem*>(i) ) ) { if ( i && ( ::tqt_cast<PropertyColorItem*>(i) || ::tqt_cast<PropertyPixmapItem*>(i) ) ) {
pressItem = i; pressItem = i;
pressPos = me->pos(); pressPos = me->pos();
mousePressed = TRUE; mousePressed = TRUE;
@ -3588,7 +3588,7 @@ bool PropertyList::eventFilter( TQObject *o, TQEvent *e )
if ( i && i == pressItem ) { if ( i && i == pressItem ) {
if (( pressPos - me->pos() ).manhattanLength() > TQApplication::startDragDistance() ){ if (( pressPos - me->pos() ).manhattanLength() > TQApplication::startDragDistance() ){
if ( ::tqqt_cast<PropertyColorItem*>(i) ) { if ( ::tqt_cast<PropertyColorItem*>(i) ) {
TQColor col = i->value().asColor(); TQColor col = i->value().asColor();
TQColorDrag *drg = new TQColorDrag( col, this ); TQColorDrag *drg = new TQColorDrag( col, this );
TQPixmap pix( 25, 25 ); TQPixmap pix( 25, 25 );
@ -3600,7 +3600,7 @@ bool PropertyList::eventFilter( TQObject *o, TQEvent *e )
mousePressed = FALSE; mousePressed = FALSE;
drg->dragCopy(); drg->dragCopy();
} }
else if ( ::tqqt_cast<PropertyPixmapItem*>(i) ) { else if ( ::tqt_cast<PropertyPixmapItem*>(i) ) {
TQPixmap pix = i->value().asPixmap(); TQPixmap pix = i->value().asPixmap();
if( !pix.isNull() ) { if( !pix.isNull() ) {
TQImage img = pix.convertToImage(); TQImage img = pix.convertToImage();
@ -3786,9 +3786,9 @@ void PropertyList::viewportDragEnterEvent( TQDragEnterEvent *e )
return; return;
} }
if ( ::tqqt_cast<PropertyColorItem*>(i) && TQColorDrag::canDecode( e ) ) if ( ::tqt_cast<PropertyColorItem*>(i) && TQColorDrag::canDecode( e ) )
e->accept(); e->accept();
else if ( ::tqqt_cast<PropertyPixmapItem*>(i) && TQImageDrag::canDecode( e ) ) else if ( ::tqt_cast<PropertyPixmapItem*>(i) && TQImageDrag::canDecode( e ) )
e->accept(); e->accept();
else else
e->ignore(); e->ignore();
@ -3802,9 +3802,9 @@ void PropertyList::viewportDragMoveEvent ( TQDragMoveEvent *e )
return; return;
} }
if ( ::tqqt_cast<PropertyColorItem*>(i) && TQColorDrag::canDecode( e ) ) if ( ::tqt_cast<PropertyColorItem*>(i) && TQColorDrag::canDecode( e ) )
e->accept(); e->accept();
else if ( ::tqqt_cast<PropertyPixmapItem*>(i) && TQImageDrag::canDecode( e ) ) else if ( ::tqt_cast<PropertyPixmapItem*>(i) && TQImageDrag::canDecode( e ) )
e->accept(); e->accept();
else else
e->ignore(); e->ignore();
@ -3818,14 +3818,14 @@ void PropertyList::viewportDropEvent ( TQDropEvent *e )
return; return;
} }
if ( ::tqqt_cast<PropertyColorItem*>(i) && TQColorDrag::canDecode( e ) ) { if ( ::tqt_cast<PropertyColorItem*>(i) && TQColorDrag::canDecode( e ) ) {
TQColor color; TQColor color;
TQColorDrag::decode( e, color ); TQColorDrag::decode( e, color );
i->setValue( TQVariant( color ) ); i->setValue( TQVariant( color ) );
valueChanged( i ); valueChanged( i );
e->accept(); e->accept();
} }
else if ( ::tqqt_cast<PropertyPixmapItem*>(i) && TQImageDrag::canDecode( e ) ) { else if ( ::tqt_cast<PropertyPixmapItem*>(i) && TQImageDrag::canDecode( e ) ) {
TQImage img; TQImage img;
TQImageDrag::decode( e, img ); TQImageDrag::decode( e, img );
TQPixmap pm; TQPixmap pm;

@ -720,13 +720,13 @@ bool Resource::save( TQIODevice* dev )
ts << "<!DOCTYPE UI><UI version=\"3.3\" stdsetdef=\"1\">" << endl; ts << "<!DOCTYPE UI><UI version=\"3.3\" stdsetdef=\"1\">" << endl;
saveMetaInfoBefore( ts, 0 ); saveMetaInfoBefore( ts, 0 );
saveObject( TQT_TQOBJECT(formwindow->mainContainer()), 0, ts, 0 ); saveObject( TQT_TQOBJECT(formwindow->mainContainer()), 0, ts, 0 );
if ( ::tqqt_cast<TQMainWindow*>(formwindow->mainContainer()) ) { if ( ::tqt_cast<TQMainWindow*>(formwindow->mainContainer()) ) {
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 ( ::tqqt_cast<TQMainWindow*>(formwindow->mainContainer()) ) if ( ::tqt_cast<TQMainWindow*>(formwindow->mainContainer()) )
saveActions( formwindow->actionList(), ts, 0 ); saveActions( formwindow->actionList(), ts, 0 );
if ( !images.isEmpty() ) if ( !images.isEmpty() )
saveImageCollection( ts, 0 ); saveImageCollection( ts, 0 );
@ -914,7 +914,7 @@ void Resource::saveObject( TQObject *obj, QDesignerGridLayout* grid, TQTextStrea
QDesignerWidgetStack* ws = 0; QDesignerWidgetStack* ws = 0;
if ( ::tqqt_cast<TQTabWidget*>(obj) ) { if ( ::tqt_cast<TQTabWidget*>(obj) ) {
TQTabWidget* tw = (TQTabWidget*) obj; TQTabWidget* tw = (TQTabWidget*) obj;
TQObjectList* tmpl = tw->queryList( "TQWidgetStack" ); TQObjectList* tmpl = tw->queryList( "TQWidgetStack" );
TQWidgetStack *ws = (TQWidgetStack*)tmpl->first(); TQWidgetStack *ws = (TQWidgetStack*)tmpl->first();
@ -946,7 +946,7 @@ void Resource::saveObject( TQObject *obj, QDesignerGridLayout* grid, TQTextStrea
ts << makeIndent( indent ) << "</widget>" << endl; ts << makeIndent( indent ) << "</widget>" << endl;
} }
delete tmpl; delete tmpl;
} else if ( (ws = ::tqqt_cast<QDesignerWidgetStack*>(obj)) != 0 ) { } else if ( (ws = ::tqt_cast<QDesignerWidgetStack*>(obj)) != 0 ) {
for ( int i = 0; i < ws->count(); ++i ) { for ( int i = 0; i < ws->count(); ++i ) {
TQWidget *w = ws->page( i ); TQWidget *w = ws->page( i );
if ( !w ) if ( !w )
@ -969,7 +969,7 @@ void Resource::saveObject( TQObject *obj, QDesignerGridLayout* grid, TQTextStrea
--indent; --indent;
ts << makeIndent( indent ) << "</widget>" << endl; ts << makeIndent( indent ) << "</widget>" << endl;
} }
} else if ( ::tqqt_cast<TQToolBox*>(obj) ) { } else if ( ::tqt_cast<TQToolBox*>(obj) ) {
TQToolBox* tb = (TQToolBox*)obj; TQToolBox* tb = (TQToolBox*)obj;
for ( int i = 0; i < tb->count(); ++i ) { for ( int i = 0; i < tb->count(); ++i ) {
TQWidget *w = tb->item( i ); TQWidget *w = tb->item( i );
@ -998,7 +998,7 @@ void Resource::saveObject( TQObject *obj, QDesignerGridLayout* grid, TQTextStrea
--indent; --indent;
ts << makeIndent( indent ) << "</widget>" << endl; ts << makeIndent( indent ) << "</widget>" << endl;
} }
} else if ( ::tqqt_cast<TQWizard*>(obj) ) { } else if ( ::tqt_cast<TQWizard*>(obj) ) {
TQWizard* wiz = (TQWizard*)obj; TQWizard* wiz = (TQWizard*)obj;
for ( int i = 0; i < wiz->pageCount(); ++i ) { for ( int i = 0; i < wiz->pageCount(); ++i ) {
TQWidget *w = wiz->page( i ); TQWidget *w = wiz->page( i );
@ -1023,7 +1023,7 @@ void Resource::saveObject( TQObject *obj, QDesignerGridLayout* grid, TQTextStrea
--indent; --indent;
ts << makeIndent( indent ) << "</widget>" << endl; ts << makeIndent( indent ) << "</widget>" << endl;
} }
} else if ( ::tqqt_cast<TQMainWindow*>(obj) ) { } else if ( ::tqt_cast<TQMainWindow*>(obj) ) {
saveChildrenOf( TQT_TQOBJECT(( (TQMainWindow*)obj )->centralWidget()), ts, indent ); saveChildrenOf( TQT_TQOBJECT(( (TQMainWindow*)obj )->centralWidget()), ts, indent );
} else { } else {
bool saved = FALSE; bool saved = FALSE;
@ -1158,9 +1158,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 ( ::tqqt_cast<TQListBox*>(obj) || ::tqqt_cast<TQComboBox*>(obj) ) { if ( ::tqt_cast<TQListBox*>(obj) || ::tqt_cast<TQComboBox*>(obj) ) {
TQListBox *lb = 0; TQListBox *lb = 0;
if ( ::tqqt_cast<TQListBox*>(obj) ) if ( ::tqt_cast<TQListBox*>(obj) )
lb = (TQListBox*)obj; lb = (TQListBox*)obj;
else else
lb = ( (TQComboBox*)obj )->listBox(); lb = ( (TQComboBox*)obj )->listBox();
@ -1178,7 +1178,7 @@ void Resource::saveItems( TQObject *obj, TQTextStream &ts, int indent )
indent--; indent--;
ts << makeIndent( indent ) << "</item>" << endl; ts << makeIndent( indent ) << "</item>" << endl;
} }
} else if ( ::tqqt_cast<TQIconView*>(obj) ) { } else if ( ::tqt_cast<TQIconView*>(obj) ) {
TQIconView *iv = (TQIconView*)obj; TQIconView *iv = (TQIconView*)obj;
TQIconViewItem *i = iv->firstItem(); TQIconViewItem *i = iv->firstItem();
@ -1194,7 +1194,7 @@ void Resource::saveItems( TQObject *obj, TQTextStream &ts, int indent )
indent--; indent--;
ts << makeIndent( indent ) << "</item>" << endl; ts << makeIndent( indent ) << "</item>" << endl;
} }
} else if ( ::tqqt_cast<TQListView*>(obj) ) { } else if ( ::tqt_cast<TQListView*>(obj) ) {
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 ) {
@ -1223,12 +1223,12 @@ void Resource::saveItems( TQObject *obj, TQTextStream &ts, int indent )
saveItem( lv->firstChild(), ts, indent - 1 ); saveItem( lv->firstChild(), ts, indent - 1 );
} }
#if !defined (TQT_NO_TABLE) #if !defined (TQT_NO_TABLE)
else if ( ::tqqt_cast<TQTable*>(obj) ) { else if ( ::tqt_cast<TQTable*>(obj) ) {
TQTable *table = (TQTable*)obj; TQTable *table = (TQTable*)obj;
int i; int i;
TQMap<TQString, TQString> columnFields = MetaDataBase::columnFields( TQT_TQOBJECT(table) ); TQMap<TQString, TQString> columnFields = MetaDataBase::columnFields( TQT_TQOBJECT(table) );
# ifndef TQT_NO_SQL # ifndef TQT_NO_SQL
bool isDataTable = ::tqqt_cast<TQDataTable*>(table); bool isDataTable = ::tqt_cast<TQDataTable*>(table);
# else # else
bool isDataTable = false; bool isDataTable = false;
# endif # endif
@ -1385,7 +1385,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 ( !::tqqt_cast<TQSplitter*>(obj) && if ( !::tqt_cast<TQSplitter*>(obj) &&
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 ) {
@ -1433,18 +1433,18 @@ void Resource::saveObjectProperties( TQObject *w, TQTextStream &ts, int indent )
TQStringList changed; TQStringList changed;
changed = MetaDataBase::changedProperties( w ); changed = MetaDataBase::changedProperties( w );
if ( w->isWidgetType() ) { if ( w->isWidgetType() ) {
if ( ::tqqt_cast<Spacer*>(w) ) { if ( ::tqt_cast<Spacer*>(w) ) {
if ( !changed.contains( "sizeHint" ) ) if ( !changed.contains( "sizeHint" ) )
changed << "sizeHint"; changed << "sizeHint";
if ( !changed.contains( "geometry" ) ) if ( !changed.contains( "geometry" ) )
changed << "geometry"; changed << "geometry";
} else { } else {
TQToolButton *tb = ::tqqt_cast<TQToolButton*>(w); TQToolButton *tb = ::tqt_cast<TQToolButton*>(w);
if ( tb && !tb->iconSet().isNull() ) { if ( tb && !tb->iconSet().isNull() ) {
changed << "iconSet"; changed << "iconSet";
} }
} }
} else if ( ::tqqt_cast<TQLayout*>(w) ) { } else if ( ::tqt_cast<TQLayout*>(w) ) {
if ( MetaDataBase::spacing( TQT_TQOBJECT( WidgetFactory::containerOfWidget( WidgetFactory::layoutParent( (TQLayout*)(w) ) ) ) ) > -1 ) if ( MetaDataBase::spacing( TQT_TQOBJECT( WidgetFactory::containerOfWidget( WidgetFactory::layoutParent( (TQLayout*)(w) ) ) ) ) > -1 )
changed << "spacing"; changed << "spacing";
if ( MetaDataBase::margin( TQT_TQOBJECT( WidgetFactory::containerOfWidget( WidgetFactory::layoutParent( (TQLayout*)(w) ) ) ) ) > -1 ) if ( MetaDataBase::margin( TQT_TQOBJECT( WidgetFactory::containerOfWidget( WidgetFactory::layoutParent( (TQLayout*)(w) ) ) ) ) > -1 )
@ -1467,7 +1467,7 @@ void Resource::saveObjectProperties( TQObject *w, TQTextStream &ts, int indent )
bool inLayout = w != formwindow->mainContainer() && !copying && w->isWidgetType() && ( (TQWidget*)w )->parentWidget() && bool inLayout = w != formwindow->mainContainer() && !copying && w->isWidgetType() && ( (TQWidget*)w )->parentWidget() &&
WidgetFactory::layoutType( ( (TQWidget*)w )->parentWidget() ) != WidgetFactory::NoLayout; WidgetFactory::layoutType( ( (TQWidget*)w )->parentWidget() ) != WidgetFactory::NoLayout;
TQStrList lst = w->metaObject()->propertyNames( !::tqqt_cast<Spacer*>(w) ); TQStrList lst = w->metaObject()->propertyNames( !::tqt_cast<Spacer*>(w) );
for ( TQPtrListIterator<char> it( lst ); it.current(); ++it ) { for ( TQPtrListIterator<char> it( lst ); it.current(); ++it ) {
if ( changed.find( TQString::fromLatin1( it.current() ) ) == changed.end() ) if ( changed.find( TQString::fromLatin1( it.current() ) ) == changed.end() )
continue; continue;
@ -1478,10 +1478,10 @@ 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 ( ::tqqt_cast<TQLabel*>(w) && qstrcmp( p->name(), "pixmap" ) == 0 && if ( ::tqt_cast<TQLabel*>(w) && qstrcmp( p->name(), "pixmap" ) == 0 &&
( !( (TQLabel*)w )->pixmap() || ( (TQLabel*)w )->pixmap()->isNull() ) ) ( !( (TQLabel*)w )->pixmap() || ( (TQLabel*)w )->pixmap()->isNull() ) )
continue; continue;
if ( ::tqqt_cast<MenuBarEditor*>(w) && if ( ::tqt_cast<MenuBarEditor*>(w) &&
( qstrcmp( p->name(), "itemName" ) == 0 || qstrcmp( p->name(), "itemNumber" ) == 0 || ( qstrcmp( p->name(), "itemName" ) == 0 || qstrcmp( p->name(), "itemNumber" ) == 0 ||
qstrcmp( p->name(), "itemText" ) == 0 ) ) qstrcmp( p->name(), "itemText" ) == 0 ) )
continue; continue;
@ -1495,7 +1495,7 @@ void Resource::saveObjectProperties( TQObject *w, TQTextStream &ts, int indent )
ts << " stdset=\"0\""; ts << " stdset=\"0\"";
ts << ">" << endl; ts << ">" << endl;
indent++; indent++;
if ( strcmp( it.current(), "resizeMode" ) == 0 && ::tqqt_cast<TQLayout*>(w) ) { if ( strcmp( it.current(), "resizeMode" ) == 0 && ::tqt_cast<TQLayout*>(w) ) {
saveProperty( w, it.current(), "", TQVariant::String, ts, indent ); saveProperty( w, it.current(), "", TQVariant::String, ts, indent );
} else if ( p->isSetType() ) { } else if ( p->isSetType() ) {
saveSetProperty( w, it.current(), TQVariant::nameToType( p->type() ), ts, indent ); saveSetProperty( w, it.current(), TQVariant::nameToType( p->type() ), ts, indent );
@ -1582,7 +1582,7 @@ void Resource::saveProperty( TQObject *w, const TQString &name, const TQVariant
ts << makeIndent( indent ) << "<bool>" << mkBool( value.toBool() ) << "</bool>" << endl; ts << makeIndent( indent ) << "<bool>" << mkBool( value.toBool() ) << "</bool>" << endl;
break; break;
case TQVariant::Int: case TQVariant::Int:
if ( ::tqqt_cast<TQLayout*>(w) ) { if ( ::tqt_cast<TQLayout*>(w) ) {
num = -1; num = -1;
if ( name == "spacing" ) if ( name == "spacing" )
num = MetaDataBase::spacing( TQT_TQOBJECT( WidgetFactory::containerOfWidget( WidgetFactory::layoutParent( (TQLayout*)(w) ) ) ) ); num = MetaDataBase::spacing( TQT_TQOBJECT( WidgetFactory::containerOfWidget( WidgetFactory::layoutParent( (TQLayout*)(w) ) ) ) );
@ -1831,7 +1831,7 @@ TQObject *Resource::createObject( const TQDomElement &e, TQWidget *parent, TQLay
mainContainerSet = TRUE; mainContainerSet = TRUE;
} }
w = (TQWidget*)obj; w = (TQWidget*)obj;
if ( ::tqqt_cast<TQMainWindow*>(w) ) if ( ::tqt_cast<TQMainWindow*>(w) )
w = ( (TQMainWindow*)w )->centralWidget(); w = ( (TQMainWindow*)w )->centralWidget();
if ( layout ) { if ( layout ) {
switch ( WidgetFactory::layoutType( layout ) ) { switch ( WidgetFactory::layoutType( layout ) ) {
@ -1856,20 +1856,20 @@ TQObject *Resource::createObject( const TQDomElement &e, TQWidget *parent, TQLay
if ( w && formwindow ) { if ( w && formwindow ) {
if ( !parent || if ( !parent ||
( !::tqqt_cast<TQTabWidget*>(parent) && ( !::tqt_cast<TQTabWidget*>(parent) &&
!::tqqt_cast<TQWidgetStack*>(parent) && !::tqt_cast<TQWidgetStack*>(parent) &&
!::tqqt_cast<TQToolBox*>(parent) && !::tqt_cast<TQToolBox*>(parent) &&
!::tqqt_cast<TQWizard*>(parent) !::tqt_cast<TQWizard*>(parent)
#ifdef TQT_CONTAINER_CUSTOM_WIDGETS #ifdef TQT_CONTAINER_CUSTOM_WIDGETS
&& !isPlugin && !isPlugin
#endif #endif
) ) ) )
formwindow->insertWidget( w, pasting ); formwindow->insertWidget( w, pasting );
else if ( parent && else if ( parent &&
( ::tqqt_cast<TQTabWidget*>(parent) || ( ::tqt_cast<TQTabWidget*>(parent) ||
::tqqt_cast<TQWidgetStack*>(parent) || ::tqt_cast<TQWidgetStack*>(parent) ||
::tqqt_cast<TQToolBox*>(parent) || ::tqt_cast<TQToolBox*>(parent) ||
::tqqt_cast<TQWizard*>(parent) ::tqt_cast<TQWizard*>(parent)
#ifdef TQT_CONTAINER_CUSTOM_WIDGETS #ifdef TQT_CONTAINER_CUSTOM_WIDGETS
|| isPlugin || isPlugin
#endif #endif
@ -1912,16 +1912,16 @@ 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 ( ::tqqt_cast<TQTabWidget*>(parent) ) { if ( ::tqt_cast<TQTabWidget*>(parent) ) {
if ( attrib == "title" ) if ( attrib == "title" )
( (TQTabWidget*)parent )->insertTab( w, v.toString() ); ( (TQTabWidget*)parent )->insertTab( w, v.toString() );
} else if ( ::tqqt_cast<TQWidgetStack*>(parent) ) { } else if ( ::tqt_cast<TQWidgetStack*>(parent) ) {
if ( attrib == "id" ) if ( attrib == "id" )
( (QDesignerWidgetStack*)parent )->insertPage( w, v.toInt() ); ( (QDesignerWidgetStack*)parent )->insertPage( w, v.toInt() );
} else if ( ::tqqt_cast<TQToolBox*>(parent) ) { } else if ( ::tqt_cast<TQToolBox*>(parent) ) {
if ( attrib == "label" ) if ( attrib == "label" )
( (TQToolBox*)parent )->addItem( w, v.toString() ); ( (TQToolBox*)parent )->addItem( w, v.toString() );
} else if ( ::tqqt_cast<TQWizard*>(parent) ) { } else if ( ::tqt_cast<TQWizard*>(parent) ) {
if ( attrib == "title" ) if ( attrib == "title" )
( (TQWizard*)parent )->addPage( w, v.toString() ); ( (TQWizard*)parent )->addPage( w, v.toString() );
#ifdef TQT_CONTAINER_CUSTOM_WIDGETS #ifdef TQT_CONTAINER_CUSTOM_WIDGETS
@ -1969,7 +1969,7 @@ void Resource::createColumn( const TQDomElement &e, TQWidget *widget )
if ( !widget ) if ( !widget )
return; return;
if ( ::tqqt_cast<TQListView*>(widget) && e.tagName() == "column" ) { if ( ::tqt_cast<TQListView*>(widget) && 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;
@ -2003,7 +2003,7 @@ void Resource::createColumn( const TQDomElement &e, TQWidget *widget )
lv->header()->setResizeEnabled( resizable, i ); lv->header()->setResizeEnabled( resizable, i );
} }
#ifndef TQT_NO_TABLE #ifndef TQT_NO_TABLE
else if ( ::tqqt_cast<TQTable*>(widget) ) { else if ( ::tqt_cast<TQTable*>(widget) ) {
TQTable *table = (TQTable*)widget; TQTable *table = (TQTable*)widget;
bool isRow; bool isRow;
if ( ( isRow = e.tagName() == "row" ) ) if ( ( isRow = e.tagName() == "row" ) )
@ -2070,14 +2070,14 @@ void Resource::createItem( const TQDomElement &e, TQWidget *widget, TQListViewIt
if ( !widget || !WidgetFactory::hasItems( WidgetDatabase::idFromClassName( WidgetFactory::classNameOf( TQT_TQOBJECT(widget) ) ), TQT_TQOBJECT(widget) ) ) if ( !widget || !WidgetFactory::hasItems( WidgetDatabase::idFromClassName( WidgetFactory::classNameOf( TQT_TQOBJECT(widget) ) ), TQT_TQOBJECT(widget) ) )
return; return;
if ( ::tqqt_cast<TQListBox*>(widget) || ::tqqt_cast<TQComboBox*>(widget) ) { if ( ::tqt_cast<TQListBox*>(widget) || ::tqt_cast<TQComboBox*>(widget) ) {
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 ( ::tqqt_cast<TQListBox*>(widget) ) if ( ::tqt_cast<TQListBox*>(widget) )
lb = (TQListBox*)widget; lb = (TQListBox*)widget;
else else
lb = ( (TQComboBox*)widget)->listBox(); lb = ( (TQComboBox*)widget)->listBox();
@ -2086,7 +2086,7 @@ void Resource::createItem( const TQDomElement &e, TQWidget *widget, TQListViewIt
} else { } else {
new TQListBoxText( lb, txt ); new TQListBoxText( lb, txt );
} }
} else if ( ::tqqt_cast<TQIconView*>(widget) ) { } else if ( ::tqt_cast<TQIconView*>(widget) ) {
TQDomElement n = e.firstChild().toElement(); TQDomElement n = e.firstChild().toElement();
TQPixmap pix; TQPixmap pix;
bool hasPixmap = FALSE; bool hasPixmap = FALSE;
@ -2097,7 +2097,7 @@ void Resource::createItem( const TQDomElement &e, TQWidget *widget, TQListViewIt
new TQIconViewItem( iv, txt, pix ); new TQIconViewItem( iv, txt, pix );
else else
new TQIconViewItem( iv, txt ); new TQIconViewItem( iv, txt );
} else if ( ::tqqt_cast<TQListView*>(widget) ) { } else if ( ::tqt_cast<TQListView*>(widget) ) {
TQDomElement n = e.firstChild().toElement(); TQDomElement n = e.firstChild().toElement();
TQPixmap pix; TQPixmap pix;
TQValueList<TQPixmap> pixmaps; TQValueList<TQPixmap> pixmaps;
@ -2164,7 +2164,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 ( ::tqqt_cast<TQBoxLayout*>(layout) ) if ( ::tqt_cast<TQBoxLayout*>(layout) )
( (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,
@ -2180,7 +2180,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 ( !::tqqt_cast<TQLayout*>(obj) ) {// no layouts in metadatabase... (RS) if ( !::tqt_cast<TQLayout*>(obj) ) {// 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" )
@ -2293,7 +2293,7 @@ void Resource::setObjectProperty( TQObject* obj, const TQString &prop, const TQD
} }
} }
if ( ::tqqt_cast<TQLayout*>(obj) ) { if ( ::tqt_cast<TQLayout*>(obj) ) {
if ( prop == "spacing" ) { if ( prop == "spacing" ) {
MetaDataBase::setSpacing( TQT_TQOBJECT( WidgetFactory::containerOfWidget( WidgetFactory::layoutParent( (TQLayout*)(obj) ) ) ), v.toInt() ); MetaDataBase::setSpacing( TQT_TQOBJECT( WidgetFactory::containerOfWidget( WidgetFactory::layoutParent( (TQLayout*)(obj) ) ) ), v.toInt() );
return; return;
@ -2968,10 +2968,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 ( !::tqqt_cast<TQAction*>(o) ) if ( !::tqt_cast<TQAction*>(o) )
continue; continue;
TQAction *ac = (TQAction*)o; TQAction *ac = (TQAction*)o;
bool isGroup = ::tqqt_cast<TQActionGroup*>(ac); bool isGroup = ::tqt_cast<TQActionGroup*>(ac);
if ( isGroup ) if ( isGroup )
ts << makeIndent( indent ) << "<actiongroup>" << endl; ts << makeIndent( indent ) << "<actiongroup>" << endl;
else else
@ -3000,7 +3000,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 = ::tqqt_cast<TQActionGroup*>(a); bool isGroup = ::tqt_cast<TQActionGroup*>(a);
if ( isGroup ) if ( isGroup )
ts << makeIndent( indent ) << "<actiongroup>" << endl; ts << makeIndent( indent ) << "<actiongroup>" << endl;
else else
@ -3045,7 +3045,7 @@ void Resource::loadChildAction( TQObject *parent, const TQDomElement &e )
} }
n2 = n2.nextSibling().toElement(); n2 = n2.nextSibling().toElement();
} }
if ( !::tqqt_cast<TQAction*>(parent) ) if ( !::tqt_cast<TQAction*>(parent) )
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 );
@ -3068,7 +3068,7 @@ void Resource::loadChildAction( TQObject *parent, const TQDomElement &e )
} }
n2 = n2.nextSibling().toElement(); n2 = n2.nextSibling().toElement();
} }
if ( !::tqqt_cast<TQAction*>(parent) ) if ( !::tqt_cast<TQAction*>(parent) )
formwindow->actionList().append( a ); formwindow->actionList().append( a );
} }
} }
@ -3104,10 +3104,10 @@ void Resource::saveToolBars( TQMainWindow *mw, TQTextStream &ts, int indent )
saveObjectProperties( TQT_TQOBJECT(tb), ts, indent ); saveObjectProperties( TQT_TQOBJECT(tb), ts, indent );
TQPtrList<TQAction> actionList = ( (QDesignerToolBar*)tb )->insertedActions(); TQPtrList<TQAction> actionList = ( (QDesignerToolBar*)tb )->insertedActions();
for ( TQAction *a = actionList.first(); a; a = actionList.next() ) { for ( TQAction *a = actionList.first(); a; a = actionList.next() ) {
if ( ::tqqt_cast<QSeparatorAction*>(a) ) { if ( ::tqt_cast<QSeparatorAction*>(a) ) {
ts << makeIndent( indent ) << "<separator/>" << endl; ts << makeIndent( indent ) << "<separator/>" << endl;
} else { } else {
if ( ::tqqt_cast<QDesignerAction*>(a) && !( (QDesignerAction*)a )->supportsMenu() ) { if ( ::tqt_cast<QDesignerAction*>(a) && !( (QDesignerAction*)a )->supportsMenu() ) {
TQWidget *w = ( (QDesignerAction*)a )->widget(); TQWidget *w = ( (QDesignerAction*)a )->widget();
ts << makeIndent( indent ) << "<widget class=\"" ts << makeIndent( indent ) << "<widget class=\""
<< WidgetFactory::classNameOf( TQT_TQOBJECT(w) ) << "\">" << endl; << WidgetFactory::classNameOf( TQT_TQOBJECT(w) ) << "\">" << endl;
@ -3166,11 +3166,11 @@ void Resource::savePopupMenu( PopupMenuEditor *pm, TQMainWindow *mw, TQTextStrea
{ {
for ( PopupMenuEditorItem *i = pm->items()->first(); i; i = pm->items()->next() ) { for ( PopupMenuEditorItem *i = pm->items()->first(); i; i = pm->items()->next() ) {
TQAction *a = i->action(); TQAction *a = i->action();
if ( ::tqqt_cast<QSeparatorAction*>(a) ) if ( ::tqt_cast<QSeparatorAction*>(a) )
ts << makeIndent( indent ) << "<separator/>" << endl; ts << makeIndent( indent ) << "<separator/>" << endl;
else if ( ::tqqt_cast<QDesignerAction*>(a) ) else if ( ::tqt_cast<QDesignerAction*>(a) )
ts << makeIndent( indent ) << "<action name=\"" << a->name() << "\"/>" << endl; ts << makeIndent( indent ) << "<action name=\"" << a->name() << "\"/>" << endl;
else if ( ::tqqt_cast<QDesignerActionGroup*>(a) ) else if ( ::tqt_cast<QDesignerActionGroup*>(a) )
ts << makeIndent( indent ) << "<actiongroup name=\"" << a->name() << "\"/>" << endl; ts << makeIndent( indent ) << "<actiongroup name=\"" << a->name() << "\"/>" << endl;
PopupMenuEditor *s = i->subMenu(); PopupMenuEditor *s = i->subMenu();
if ( s && s->count() ) { if ( s && s->count() ) {

@ -77,7 +77,7 @@ void SourceEditor::setObject( TQObject *o, Project *p )
formWindow()->formFile()->setCodeEdited( FALSE ); formWindow()->formFile()->setCodeEdited( FALSE );
formWindow()->formFile()->setEditor( 0 ); formWindow()->formFile()->setEditor( 0 );
} }
if ( ::tqqt_cast<FormWindow*>(o) ) if ( ::tqt_cast<FormWindow*>(o) )
( (FormWindow*)o )->formFile()->setCodeEdited( TRUE ); ( (FormWindow*)o )->formFile()->setCodeEdited( TRUE );
save(); save();
bool changed = FALSE; bool changed = FALSE;
@ -119,9 +119,9 @@ TQString SourceEditor::sourceOfObject( TQObject *o, const TQString &,
TQString txt; TQString txt;
if ( !o ) if ( !o )
return txt; return txt;
if ( ::tqqt_cast<FormWindow*>(o) ) if ( ::tqt_cast<FormWindow*>(o) )
txt = ( (FormWindow*)o )->formFile()->code(); txt = ( (FormWindow*)o )->formFile()->code();
else if ( ::tqqt_cast<SourceFile*>(o) ) else if ( ::tqt_cast<SourceFile*>(o) )
txt = ( (SourceFile*)o )->text(); txt = ( (SourceFile*)o )->text();
return txt; return txt;
} }
@ -307,14 +307,14 @@ bool SourceEditor::saveAs()
SourceFile *SourceEditor::sourceFile() const SourceFile *SourceEditor::sourceFile() const
{ {
if ( !::tqqt_cast<SourceFile*>((TQObject *)obj) ) if ( !::tqt_cast<SourceFile*>((TQObject *)obj) )
return 0; return 0;
return (SourceFile*)(TQObject*)obj; return (SourceFile*)(TQObject*)obj;
} }
FormWindow *SourceEditor::formWindow() const FormWindow *SourceEditor::formWindow() const
{ {
if ( !::tqqt_cast<FormWindow*>((TQObject *)obj) ) if ( !::tqt_cast<FormWindow*>((TQObject *)obj) )
return 0; return 0;
return (FormWindow*)(TQObject*)obj; return (FormWindow*)(TQObject*)obj;
} }

@ -59,7 +59,7 @@ TableEditor::TableEditor( TQWidget* parent, TQWidget *editWidget, FormWindow *f
labelRowPixmap->setText( "" ); labelRowPixmap->setText( "" );
#ifndef TQT_NO_SQL #ifndef TQT_NO_SQL
if ( !::tqqt_cast<TQDataTable*>(editTable) ) if ( !::tqt_cast<TQDataTable*>(editTable) )
#endif #endif
{ {
labelFields->hide(); labelFields->hide();
@ -68,7 +68,7 @@ TableEditor::TableEditor( TQWidget* parent, TQWidget *editWidget, FormWindow *f
labelTableValue->hide(); labelTableValue->hide();
} }
#ifndef TQT_NO_SQL #ifndef TQT_NO_SQL
if ( ::tqqt_cast<TQDataTable*>(editTable) ) { if ( ::tqt_cast<TQDataTable*>(editTable) ) {
// ## why does this behave weird? // ## why does this behave weird?
// TabWidget->removePage( rows_tab ); // TabWidget->removePage( rows_tab );
// rows_tab->hide(); // rows_tab->hide();
@ -76,7 +76,7 @@ TableEditor::TableEditor( TQWidget* parent, TQWidget *editWidget, FormWindow *f
TabWidget->setTabEnabled( rows_tab, FALSE ); TabWidget->setTabEnabled( rows_tab, FALSE );
} }
if ( formWindow->project() && ::tqqt_cast<TQDataTable*>(editTable) ) { if ( formWindow->project() && ::tqt_cast<TQDataTable*>(editTable) ) {
TQStringList lst = MetaDataBase::fakeProperty( TQT_TQOBJECT(editTable), "database" ).toStringList(); TQStringList lst = MetaDataBase::fakeProperty( TQT_TQOBJECT(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;
@ -159,7 +159,7 @@ void TableEditor::currentColumnChanged( TQListBoxItem *i )
editColumnText->blockSignals( FALSE ); editColumnText->blockSignals( FALSE );
#ifndef TQT_NO_SQL #ifndef TQT_NO_SQL
if ( ::tqqt_cast<TQDataTable*>(editTable) ) { if ( ::tqt_cast<TQDataTable*>(editTable) ) {
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 );
@ -244,7 +244,7 @@ void TableEditor::newColumnClicked()
listColumns->setCurrentItem( item ); listColumns->setCurrentItem( item );
listColumns->setSelected( item, TRUE ); listColumns->setSelected( item, TRUE );
#ifndef TQT_NO_SQL #ifndef TQT_NO_SQL
if ( ::tqqt_cast<TQDataTable*>(editTable) ) { if ( ::tqt_cast<TQDataTable*>(editTable) ) {
comboFields->setFocus(); comboFields->setFocus();
} else } else
#endif #endif

@ -35,7 +35,7 @@ static TQStyle *windowsStyle = 0;
void WidgetAction::addedTo( TQWidget *w, TQWidget *container ) void WidgetAction::addedTo( TQWidget *w, TQWidget *container )
{ {
if ( ::tqqt_cast<TQToolButton*>(w) && ::tqqt_cast<TQScrollView*>(container->parent()->parent()) ) { if ( ::tqt_cast<TQToolButton*>(w) && ::tqt_cast<TQScrollView*>(container->parent()->parent()) ) {
if ( !windowsStyle ) if ( !windowsStyle )
windowsStyle = TQStyleFactory::create( "windows" ); windowsStyle = TQStyleFactory::create( "windows" );
w->setStyle( windowsStyle ); w->setStyle( windowsStyle );

@ -107,7 +107,7 @@ FormWindow *find_formwindow( TQWidget *w )
if ( !w ) if ( !w )
return 0; return 0;
for (;;) { for (;;) {
if ( ::tqqt_cast<FormWindow*>(w) ) if ( ::tqt_cast<FormWindow*>(w) )
return (FormWindow*)w; return (FormWindow*)w;
if ( !w->parentWidget() ) if ( !w->parentWidget() )
return 0; return 0;
@ -537,7 +537,7 @@ TQWidget *WidgetFactory::create( int id, TQWidget *parent, const char *name, boo
TQString str = WidgetDatabase::createWidgetName( id ); TQString str = WidgetDatabase::createWidgetName( id );
const char *s = str.latin1(); const char *s = str.latin1();
w = createWidget( n, parent, name ? name : s, init, r, orient ); w = createWidget( n, parent, name ? name : s, init, r, orient );
if ( ::tqqt_cast<TQScrollView*>(w) ) if ( ::tqt_cast<TQScrollView*>(w) )
( (TQScrollView*)w )->disableSizeHintCaching(); ( (TQScrollView*)w )->disableSizeHintCaching();
if ( !w && WidgetDatabase::isCustomWidget( id ) ) if ( !w && WidgetDatabase::isCustomWidget( id ) )
w = createCustomWidget( parent, name ? name : s, MetaDataBase::customWidget( id ) ); w = createCustomWidget( parent, name ? name : s, MetaDataBase::customWidget( id ) );
@ -565,31 +565,31 @@ TQLayout *WidgetFactory::createLayout( TQWidget *widget, TQLayout *layout, Layou
int metaspacing = MetaDataBase::spacing( TQT_TQOBJECT(widget) ); int metaspacing = MetaDataBase::spacing( TQT_TQOBJECT(widget) );
int metamargin = MetaDataBase::margin( TQT_TQOBJECT(widget) ); int metamargin = MetaDataBase::margin( TQT_TQOBJECT(widget) );
if ( ::tqqt_cast<TQLayoutWidget*>(widget) && if ( ::tqt_cast<TQLayoutWidget*>(widget) &&
( WidgetDatabase::isContainer( WidgetDatabase::idFromClassName( WidgetFactory::classNameOf( TQT_TQOBJECT(widget) ) ) ) || ( WidgetDatabase::isContainer( WidgetDatabase::idFromClassName( WidgetFactory::classNameOf( TQT_TQOBJECT(widget) ) ) ) ||
widget && ::tqqt_cast<FormWindow*>(widget->parentWidget()) ) ) widget && ::tqt_cast<FormWindow*>(widget->parentWidget()) ) )
margin = MainWindow::self->currentLayoutDefaultMargin(); margin = MainWindow::self->currentLayoutDefaultMargin();
if ( !layout && ::tqqt_cast<TQTabWidget*>(widget) ) if ( !layout && ::tqt_cast<TQTabWidget*>(widget) )
widget = ((TQTabWidget*)widget)->currentPage(); widget = ((TQTabWidget*)widget)->currentPage();
if ( !layout && ::tqqt_cast<TQWizard*>(widget) ) if ( !layout && ::tqt_cast<TQWizard*>(widget) )
widget = ((TQWizard*)widget)->currentPage(); widget = ((TQWizard*)widget)->currentPage();
if ( !layout && ::tqqt_cast<TQMainWindow*>(widget) ) if ( !layout && ::tqt_cast<TQMainWindow*>(widget) )
widget = ((TQMainWindow*)widget)->centralWidget(); widget = ((TQMainWindow*)widget)->centralWidget();
if ( !layout && ::tqqt_cast<TQWidgetStack*>(widget) ) if ( !layout && ::tqt_cast<TQWidgetStack*>(widget) )
widget = ((TQWidgetStack*)widget)->visibleWidget(); widget = ((TQWidgetStack*)widget)->visibleWidget();
if ( !layout && ::tqqt_cast<TQToolBox*>(widget) ) if ( !layout && ::tqt_cast<TQToolBox*>(widget) )
widget = ((TQToolBox*)widget)->currentItem(); widget = ((TQToolBox*)widget)->currentItem();
MetaDataBase::addEntry( TQT_TQOBJECT(widget) ); MetaDataBase::addEntry( TQT_TQOBJECT(widget) );
TQLayout *l = 0; TQLayout *l = 0;
int align = 0; int align = 0;
if ( !layout && ::tqqt_cast<TQGroupBox*>(widget) ) { if ( !layout && ::tqt_cast<TQGroupBox*>(widget) ) {
TQGroupBox *gb = (TQGroupBox*)widget; TQGroupBox *gb = (TQGroupBox*)widget;
gb->setColumnLayout( 0, TQt::Vertical ); gb->setColumnLayout( 0, TQt::Vertical );
layout = gb->layout(); layout = gb->layout();
@ -663,15 +663,15 @@ void WidgetFactory::deleteLayout( TQWidget *widget )
if ( !widget ) if ( !widget )
return; return;
if ( ::tqqt_cast<TQTabWidget*>(widget) ) if ( ::tqt_cast<TQTabWidget*>(widget) )
widget = ((TQTabWidget*)widget)->currentPage(); widget = ((TQTabWidget*)widget)->currentPage();
if ( ::tqqt_cast<TQWizard*>(widget) ) if ( ::tqt_cast<TQWizard*>(widget) )
widget = ((TQWizard*)widget)->currentPage(); widget = ((TQWizard*)widget)->currentPage();
if ( ::tqqt_cast<TQMainWindow*>(widget) ) if ( ::tqt_cast<TQMainWindow*>(widget) )
widget = ((TQMainWindow*)widget)->centralWidget(); widget = ((TQMainWindow*)widget)->centralWidget();
if ( ::tqqt_cast<TQWidgetStack*>(widget) ) if ( ::tqt_cast<TQWidgetStack*>(widget) )
widget = ((TQWidgetStack*)widget)->visibleWidget(); widget = ((TQWidgetStack*)widget)->visibleWidget();
if ( ::tqqt_cast<TQToolBox*>(widget) ) if ( ::tqt_cast<TQToolBox*>(widget) )
widget = ((TQToolBox*)widget)->currentItem(); widget = ((TQToolBox*)widget)->currentItem();
delete widget->layout(); delete widget->layout();
} }
@ -695,12 +695,12 @@ 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 && ::tqqt_cast<TQDialog*>(((FormWindow*)w)->mainContainer()) ); b->setAutoDefault( w && ::tqt_cast<TQDialog*>(((FormWindow*)w)->mainContainer()) );
return b; return b;
} else if ( className == "TQToolButton" ) { } else if ( className == "TQToolButton" ) {
if ( init ) { if ( init ) {
QDesignerToolButton *tb = new QDesignerToolButton( parent, name ); QDesignerToolButton *tb = new QDesignerToolButton( parent, name );
if ( ::tqqt_cast<TQToolBox*>(widgetOfContainer(parent))) { if ( ::tqt_cast<TQToolBox*>(widgetOfContainer(parent))) {
tb->setUsesTextLabel(TRUE); tb->setUsesTextLabel(TRUE);
tb->setTextLabel("..."); tb->setTextLabel("...");
tb->setAutoRaise(TRUE); tb->setAutoRaise(TRUE);
@ -833,12 +833,12 @@ TQWidget *WidgetFactory::createWidget( const TQString &className, TQWidget *pare
return new TQComboBox( FALSE, parent, name ); return new TQComboBox( FALSE, parent, name );
} else if ( className == "TQWidget" ) { } else if ( className == "TQWidget" ) {
if ( parent && if ( parent &&
( ::tqqt_cast<FormWindow*>(parent) || ( ::tqt_cast<FormWindow*>(parent) ||
::tqqt_cast<TQWizard*>(parent) || ::tqt_cast<TQWizard*>(parent) ||
::tqqt_cast<TQTabWidget*>(parent) || ::tqt_cast<TQTabWidget*>(parent) ||
::tqqt_cast<TQWidgetStack*>(parent) || ::tqt_cast<TQWidgetStack*>(parent) ||
::tqqt_cast<TQToolBox*>(parent) || ::tqt_cast<TQToolBox*>(parent) ||
::tqqt_cast<TQMainWindow*>(parent) ) ) { ::tqt_cast<TQMainWindow*>(parent) ) ) {
FormWindow *fw = find_formwindow( parent ); FormWindow *fw = find_formwindow( parent );
if ( fw ) { if ( fw ) {
QDesignerWidget *dw = new QDesignerWidget( fw, parent, name ); QDesignerWidget *dw = new QDesignerWidget( fw, parent, name );
@ -849,7 +849,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" ) {
TQDialog *dia = 0; TQDialog *dia = 0;
if ( ::tqqt_cast<FormWindow*>(parent) ) if ( ::tqt_cast<FormWindow*>(parent) )
dia = new QDesignerDialog( (FormWindow*)parent, parent, name ); dia = new QDesignerDialog( (FormWindow*)parent, parent, name );
else else
dia = new TQDialog( parent, name ); dia = new TQDialog( parent, name );
@ -860,7 +860,7 @@ TQWidget *WidgetFactory::createWidget( const TQString &className, TQWidget *pare
TQWizard *wiz = new QDesignerWizard( parent, name ); TQWizard *wiz = new QDesignerWizard( parent, name );
if ( parent ) if ( parent )
wiz->reparent( parent, TQPoint( 0, 0 ), TRUE ); wiz->reparent( parent, TQPoint( 0, 0 ), TRUE );
if ( init && ::tqqt_cast<FormWindow*>(parent) ) { if ( init && ::tqt_cast<FormWindow*>(parent) ) {
QDesignerWidget *dw = new QDesignerWidget( (FormWindow*)parent, wiz, "WizardPage" ); QDesignerWidget *dw = new QDesignerWidget( (FormWindow*)parent, wiz, "WizardPage" );
MetaDataBase::addEntry( TQT_TQOBJECT(dw) ); MetaDataBase::addEntry( TQT_TQOBJECT(dw) );
wiz->addPage( dw, i18n( "Page" ) ); wiz->addPage( dw, i18n( "Page" ) );
@ -1002,25 +1002,25 @@ WidgetFactory::LayoutType WidgetFactory::layoutType( TQWidget *w, TQLayout *&lay
{ {
layout = 0; layout = 0;
if ( ::tqqt_cast<TQTabWidget*>(w) ) if ( ::tqt_cast<TQTabWidget*>(w) )
w = ((TQTabWidget*)w)->currentPage(); w = ((TQTabWidget*)w)->currentPage();
if ( ::tqqt_cast<TQWizard*>(w) ) if ( ::tqt_cast<TQWizard*>(w) )
w = ((TQWizard*)w)->currentPage(); w = ((TQWizard*)w)->currentPage();
if ( ::tqqt_cast<TQMainWindow*>(w) ) if ( ::tqt_cast<TQMainWindow*>(w) )
w = ((TQMainWindow*)w)->centralWidget(); w = ((TQMainWindow*)w)->centralWidget();
if ( ::tqqt_cast<TQWidgetStack*>(w) ) if ( ::tqt_cast<TQWidgetStack*>(w) )
w = ((TQWidgetStack*)w)->visibleWidget(); w = ((TQWidgetStack*)w)->visibleWidget();
if ( ::tqqt_cast<TQToolBox*>(w) ) if ( ::tqt_cast<TQToolBox*>(w) )
w = ((TQToolBox*)w)->currentItem(); w = ((TQToolBox*)w)->currentItem();
if ( ::tqqt_cast<TQSplitter*>(w) ) if ( ::tqt_cast<TQSplitter*>(w) )
return ( (TQSplitter*)w )->orientation() ==TQt::Horizontal ? HBox : VBox; return ( (TQSplitter*)w )->orientation() ==TQt::Horizontal ? HBox : VBox;
if ( !w || !w->layout() ) if ( !w || !w->layout() )
return NoLayout; return NoLayout;
TQLayout *lay = w->layout(); TQLayout *lay = w->layout();
if ( ::tqqt_cast<TQGroupBox*>(w) ) { if ( ::tqt_cast<TQGroupBox*>(w) ) {
TQObjectList *l = TQT_TQOBJECT(lay)->queryList( "TQLayout" ); TQObjectList *l = TQT_TQOBJECT(lay)->queryList( "TQLayout" );
if ( l && l->first() ) if ( l && l->first() )
lay = (TQLayout*)l->first(); lay = (TQLayout*)l->first();
@ -1028,11 +1028,11 @@ WidgetFactory::LayoutType WidgetFactory::layoutType( TQWidget *w, TQLayout *&lay
} }
layout = lay; layout = lay;
if ( ::tqqt_cast<TQHBoxLayout*>(lay) ) if ( ::tqt_cast<TQHBoxLayout*>(lay) )
return HBox; return HBox;
else if ( ::tqqt_cast<TQVBoxLayout*>(lay) ) else if ( ::tqt_cast<TQVBoxLayout*>(lay) )
return VBox; return VBox;
else if ( ::tqqt_cast<TQGridLayout*>(lay) ) else if ( ::tqt_cast<TQGridLayout*>(lay) )
return Grid; return Grid;
return NoLayout; return NoLayout;
} }
@ -1042,11 +1042,11 @@ WidgetFactory::LayoutType WidgetFactory::layoutType( TQWidget *w, TQLayout *&lay
*/ */
WidgetFactory::LayoutType WidgetFactory::layoutType( TQLayout *layout ) WidgetFactory::LayoutType WidgetFactory::layoutType( TQLayout *layout )
{ {
if ( ::tqqt_cast<TQHBoxLayout*>(layout) ) if ( ::tqt_cast<TQHBoxLayout*>(layout) )
return HBox; return HBox;
else if ( ::tqqt_cast<TQVBoxLayout*>(layout) ) else if ( ::tqt_cast<TQVBoxLayout*>(layout) )
return VBox; return VBox;
else if ( ::tqqt_cast<TQGridLayout*>(layout) ) else if ( ::tqt_cast<TQGridLayout*>(layout) )
return Grid; return Grid;
return NoLayout; return NoLayout;
} }
@ -1085,15 +1085,15 @@ TQWidget* WidgetFactory::containerOfWidget( TQWidget *w )
{ {
if ( !w ) if ( !w )
return w; return w;
if ( ::tqqt_cast<TQTabWidget*>(w) ) if ( ::tqt_cast<TQTabWidget*>(w) )
return ((TQTabWidget*)w)->currentPage(); return ((TQTabWidget*)w)->currentPage();
if ( ::tqqt_cast<TQWizard*>(w) ) if ( ::tqt_cast<TQWizard*>(w) )
return ((TQWizard*)w)->currentPage(); return ((TQWizard*)w)->currentPage();
if ( ::tqqt_cast<TQWidgetStack*>(w) ) if ( ::tqt_cast<TQWidgetStack*>(w) )
return ((TQWidgetStack*)w)->visibleWidget(); return ((TQWidgetStack*)w)->visibleWidget();
if ( ::tqqt_cast<TQToolBox*>(w) ) if ( ::tqt_cast<TQToolBox*>(w) )
return ((TQToolBox*)w)->currentItem(); return ((TQToolBox*)w)->currentItem();
if ( ::tqqt_cast<TQMainWindow*>(w) ) if ( ::tqt_cast<TQMainWindow*>(w) )
return ((TQMainWindow*)w)->centralWidget(); return ((TQMainWindow*)w)->centralWidget();
#ifdef TQT_CONTAINER_CUSTOM_WIDGETS #ifdef TQT_CONTAINER_CUSTOM_WIDGETS
if ( !WidgetDatabase::isCustomPluginWidget( WidgetDatabase::idFromClassName( classNameOf( w ) ) ) ) if ( !WidgetDatabase::isCustomPluginWidget( WidgetDatabase::idFromClassName( classNameOf( w ) ) ) )
@ -1125,16 +1125,16 @@ TQWidget* WidgetFactory::containerOfWidget( TQWidget *w )
TQWidget* WidgetFactory::widgetOfContainer( TQWidget *w ) TQWidget* WidgetFactory::widgetOfContainer( TQWidget *w )
{ {
if ( w && ::tqqt_cast<TQWidgetStack*>(w->parentWidget()) ) if ( w && ::tqt_cast<TQWidgetStack*>(w->parentWidget()) )
w = w->parentWidget(); w = w->parentWidget();
if ( w->parentWidget() && w->parentWidget()->parentWidget() && if ( w->parentWidget() && w->parentWidget()->parentWidget() &&
w->parentWidget()->parentWidget()->parentWidget() && w->parentWidget()->parentWidget()->parentWidget() &&
::tqqt_cast<TQToolBox*>(w->parentWidget()->parentWidget()->parentWidget()) ) ::tqt_cast<TQToolBox*>(w->parentWidget()->parentWidget()->parentWidget()) )
return w->parentWidget()->parentWidget()->parentWidget(); return w->parentWidget()->parentWidget()->parentWidget();
while ( w ) { while ( w ) {
int id = WidgetDatabase::idFromClassName( WidgetFactory::classNameOf( TQT_TQOBJECT(w) ) ); int id = WidgetDatabase::idFromClassName( WidgetFactory::classNameOf( TQT_TQOBJECT(w) ) );
if ( WidgetDatabase::isContainer( id ) || if ( WidgetDatabase::isContainer( id ) ||
w && ::tqqt_cast<FormWindow*>(w->parentWidget()) ) w && ::tqt_cast<FormWindow*>(w->parentWidget()) )
return w; return w;
w = w->parentWidget(); w = w->parentWidget();
} }
@ -1157,21 +1157,21 @@ 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 ( lastWasAPassiveInteractor = TRUE ); return ( lastWasAPassiveInteractor = TRUE );
if ( ::tqqt_cast<TQTabBar*>(o) ) if ( ::tqt_cast<TQTabBar*>(o) )
return ( lastWasAPassiveInteractor = TRUE ); return ( lastWasAPassiveInteractor = TRUE );
else if ( ::tqqt_cast<TQSizeGrip*>(o) ) else if ( ::tqt_cast<TQSizeGrip*>(o) )
return ( lastWasAPassiveInteractor = TRUE ); return ( lastWasAPassiveInteractor = TRUE );
else if ( ::tqqt_cast<TQButton*>(o) && else if ( ::tqt_cast<TQButton*>(o) &&
( ::tqqt_cast<TQTabBar*>(o->parent()) || ::tqqt_cast<TQToolBox*>(o->parent()) ) ) ( ::tqt_cast<TQTabBar*>(o->parent()) || ::tqt_cast<TQToolBox*>(o->parent()) ) )
return ( lastWasAPassiveInteractor = TRUE ); return ( lastWasAPassiveInteractor = TRUE );
else if ( ::tqqt_cast<TQPushButton*>(o) && ::tqqt_cast<TQWizard*>(o->parent()) ) else if ( ::tqt_cast<TQPushButton*>(o) && ::tqt_cast<TQWizard*>(o->parent()) )
return ( lastWasAPassiveInteractor = TRUE ); return ( lastWasAPassiveInteractor = TRUE );
else if ( ::tqqt_cast<TQMenuBar*>(o) && ::tqqt_cast<TQMainWindow*>(o->parent()) ) else if ( ::tqt_cast<TQMenuBar*>(o) && ::tqt_cast<TQMainWindow*>(o->parent()) )
return ( lastWasAPassiveInteractor = TRUE ); return ( lastWasAPassiveInteractor = TRUE );
// else if ( ::tqqt_cast<TQDockWindowHandle*>(o) ) // else if ( ::tqt_cast<TQDockWindowHandle*>(o) )
else if ( o->inherits( "TQDockWindowHandle" ) ) else if ( o->inherits( "TQDockWindowHandle" ) )
return ( lastWasAPassiveInteractor = TRUE ); return ( lastWasAPassiveInteractor = TRUE );
// else if ( ::tqqt_cast<TQHideDock*>(o) ) // else if ( ::tqt_cast<TQHideDock*>(o) )
else if ( o->inherits( "TQHideDock" ) ) else if ( o->inherits( "TQHideDock" ) )
return ( lastWasAPassiveInteractor = TRUE ); return ( lastWasAPassiveInteractor = TRUE );
else if ( qstrcmp( o->name(), "designer_wizardstack_button" ) == 0 ) else if ( qstrcmp( o->name(), "designer_wizardstack_button" ) == 0 )
@ -1181,7 +1181,7 @@ bool WidgetFactory::isPassiveInteractor( TQObject* o )
return ( lastWasAPassiveInteractor = FALSE ); return ( lastWasAPassiveInteractor = FALSE );
WidgetInterface *iface = 0; WidgetInterface *iface = 0;
TQWidget *w = (TQWidget*)o; TQWidget *w = (TQWidget*)o;
while ( !iface && w && !::tqqt_cast<FormWindow*>(w) ) { while ( !iface && w && !::tqt_cast<FormWindow*>(w) ) {
widgetManager()->queryInterface( classNameOf( w ), &iface ); widgetManager()->queryInterface( classNameOf( w ), &iface );
w = w->parentWidget(); w = w->parentWidget();
} }
@ -1214,46 +1214,46 @@ const char* WidgetFactory::classNameOf( TQObject* o )
return o->className(); return o->className();
if (WidgetDatabase::isCustomPluginWidget(WidgetDatabase::idFromClassName(o->className()))) if (WidgetDatabase::isCustomPluginWidget(WidgetDatabase::idFromClassName(o->className())))
return o->className(); return o->className();
else if ( ::tqqt_cast<QDesignerTabWidget*>(o) ) else if ( ::tqt_cast<QDesignerTabWidget*>(o) )
return "TQTabWidget"; return "TQTabWidget";
else if ( ::tqqt_cast<QDesignerWidgetStack*>(o) ) else if ( ::tqt_cast<QDesignerWidgetStack*>(o) )
return "TQWidgetStack"; return "TQWidgetStack";
else if ( ::tqqt_cast<TQWidgetStack*>(o) ) else if ( ::tqt_cast<TQWidgetStack*>(o) )
return "TQWeDoNotWantToBreakTabWidget"; return "TQWeDoNotWantToBreakTabWidget";
else if ( ::tqqt_cast<QDesignerDialog*>(o) ) else if ( ::tqt_cast<QDesignerDialog*>(o) )
return "TQDialog"; return "TQDialog";
else if ( ::tqqt_cast<QDesignerWidget*>(o) ) else if ( ::tqt_cast<QDesignerWidget*>(o) )
return "TQWidget"; return "TQWidget";
else if ( o->inherits( "CustomWidget" ) ) else if ( o->inherits( "CustomWidget" ) )
return ( (CustomWidget*)o )->realClassName().latin1(); return ( (CustomWidget*)o )->realClassName().latin1();
else if ( ::tqqt_cast<QDesignerLabel*>(o) ) else if ( ::tqt_cast<QDesignerLabel*>(o) )
return "TQLabel"; return "TQLabel";
else if ( ::tqqt_cast<QDesignerWizard*>(o) ) else if ( ::tqt_cast<QDesignerWizard*>(o) )
return "TQWizard"; return "TQWizard";
else if ( ::tqqt_cast<QDesignerPushButton*>(o) ) else if ( ::tqt_cast<QDesignerPushButton*>(o) )
return "TQPushButton"; return "TQPushButton";
else if ( ::tqqt_cast<QDesignerToolButton*>(o) ) else if ( ::tqt_cast<QDesignerToolButton*>(o) )
return "TQToolButton"; return "TQToolButton";
else if ( ::tqqt_cast<QDesignerRadioButton*>(o) ) else if ( ::tqt_cast<QDesignerRadioButton*>(o) )
return "TQRadioButton"; return "TQRadioButton";
else if ( ::tqqt_cast<QDesignerCheckBox*>(o) ) else if ( ::tqt_cast<QDesignerCheckBox*>(o) )
return "TQCheckBox"; return "TQCheckBox";
else if ( ::tqqt_cast<MenuBarEditor*>(o) ) else if ( ::tqt_cast<MenuBarEditor*>(o) )
return "TQMenuBar"; return "TQMenuBar";
else if ( ::tqqt_cast<QDesignerToolBar*>(o) ) else if ( ::tqt_cast<QDesignerToolBar*>(o) )
return "TQToolBar"; return "TQToolBar";
else if ( ::tqqt_cast<QDesignerAction*>(o) ) else if ( ::tqt_cast<QDesignerAction*>(o) )
return "TQAction"; return "TQAction";
else if ( ::tqqt_cast<QDesignerActionGroup*>(o) ) else if ( ::tqt_cast<QDesignerActionGroup*>(o) )
return "TQActionGroup"; return "TQActionGroup";
else if ( ::tqqt_cast<PopupMenuEditor*>(o) ) else if ( ::tqt_cast<PopupMenuEditor*>(o) )
return "TQPopupMenu"; return "TQPopupMenu";
else if ( ::tqqt_cast<QDesignerToolBox*>(o) ) else if ( ::tqt_cast<QDesignerToolBox*>(o) )
return "TQToolBox"; return "TQToolBox";
#ifndef TQT_NO_SQL #ifndef TQT_NO_SQL
else if ( ::tqqt_cast<QDesignerDataBrowser*>(o) ) else if ( ::tqt_cast<QDesignerDataBrowser*>(o) )
return "TQDataBrowser"; return "TQDataBrowser";
else if ( ::tqqt_cast<QDesignerDataView*>(o) ) else if ( ::tqt_cast<QDesignerDataView*>(o) )
return "TQDataView"; return "TQDataView";
#endif #endif
return o->className(); return o->className();
@ -1261,29 +1261,29 @@ const char* WidgetFactory::classNameOf( TQObject* o )
TQString WidgetFactory::defaultSignal( TQObject *w ) TQString WidgetFactory::defaultSignal( TQObject *w )
{ {
if ( ::tqqt_cast<TQRadioButton*>(w) || ::tqqt_cast<TQCheckBox*>(w) ) if ( ::tqt_cast<TQRadioButton*>(w) || ::tqt_cast<TQCheckBox*>(w) )
return "toggled"; return "toggled";
else if ( ::tqqt_cast<TQButton*>(w) || ::tqqt_cast<TQButtonGroup*>(w) ) else if ( ::tqt_cast<TQButton*>(w) || ::tqt_cast<TQButtonGroup*>(w) )
return "clicked"; return "clicked";
else if ( ::tqqt_cast<TQTextBrowser*>(w) ) else if ( ::tqt_cast<TQTextBrowser*>(w) )
return "linkClicked"; return "linkClicked";
else if ( ::tqqt_cast<TQLineEdit*>(w) || ::tqqt_cast<TQTextEdit*>(w) ) else if ( ::tqt_cast<TQLineEdit*>(w) || ::tqt_cast<TQTextEdit*>(w) )
return "textChanged"; return "textChanged";
else if ( ::tqqt_cast<TQListView*>(w) || ::tqqt_cast<TQIconView*>(w) || else if ( ::tqt_cast<TQListView*>(w) || ::tqt_cast<TQIconView*>(w) ||
::tqqt_cast<TQListBox*>(w) || ::tqqt_cast<TQTable*>(w) ) ::tqt_cast<TQListBox*>(w) || ::tqt_cast<TQTable*>(w) )
return "selectionChanged"; return "selectionChanged";
else if ( ::tqqt_cast<TQTabWidget*>(w) ) else if ( ::tqt_cast<TQTabWidget*>(w) )
return "selected"; return "selected";
else if ( ::tqqt_cast<TQToolBox*>(w) ) else if ( ::tqt_cast<TQToolBox*>(w) )
return "currentChanged"; return "currentChanged";
else if ( ::tqqt_cast<TQWidgetStack*>(w) ) else if ( ::tqt_cast<TQWidgetStack*>(w) )
return "aboutToShow"; return "aboutToShow";
else if ( ::tqqt_cast<TQSpinBox*>(w) || ::tqqt_cast<TQSlider*>(w) || else if ( ::tqt_cast<TQSpinBox*>(w) || ::tqt_cast<TQSlider*>(w) ||
::tqqt_cast<TQScrollBar*>(w) || ::tqqt_cast<TQDateEdit*>(w) || ::tqt_cast<TQScrollBar*>(w) || ::tqt_cast<TQDateEdit*>(w) ||
::tqqt_cast<TQTimeEdit*>(w) || ::tqqt_cast<TQDateTimeEdit*>(w) || ::tqt_cast<TQTimeEdit*>(w) || ::tqt_cast<TQDateTimeEdit*>(w) ||
::tqqt_cast<TQDial*>(w) ) ::tqt_cast<TQDial*>(w) )
return "valueChanged"; return "valueChanged";
else if ( ::tqqt_cast<TQComboBox*>(w) ) else if ( ::tqt_cast<TQComboBox*>(w) )
return "activated"; return "activated";
return TQString(); return TQString();
} }
@ -1299,14 +1299,14 @@ void WidgetFactory::initChangedProperties( TQObject *o )
MainWindow::self->currProject()->fakeFormFileFor( o ) ) MainWindow::self->currProject()->fakeFormFileFor( o ) )
return; return;
MetaDataBase::setPropertyChanged( o, "name", TRUE ); MetaDataBase::setPropertyChanged( o, "name", TRUE );
if ( !::tqqt_cast<QDesignerToolBar*>(o) && !::tqqt_cast<MenuBarEditor*>(o) ) if ( !::tqt_cast<QDesignerToolBar*>(o) && !::tqt_cast<MenuBarEditor*>(o) )
MetaDataBase::setPropertyChanged( o, "geometry", TRUE ); MetaDataBase::setPropertyChanged( o, "geometry", TRUE );
if ( ::tqqt_cast<TQPushButton*>(o) || if ( ::tqt_cast<TQPushButton*>(o) ||
::tqqt_cast<TQRadioButton*>(o) || ::tqt_cast<TQRadioButton*>(o) ||
::tqqt_cast<TQCheckBox*>(o) || ::tqt_cast<TQCheckBox*>(o) ||
::tqqt_cast<TQToolButton*>(o) ) { ::tqt_cast<TQToolButton*>(o) ) {
if (::tqqt_cast<TQToolButton*>(o) && ::tqqt_cast<TQToolBox*>(widgetOfContainer((TQWidget*)o->parent()))) { if (::tqt_cast<TQToolButton*>(o) && ::tqt_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 );
@ -1315,19 +1315,19 @@ void WidgetFactory::initChangedProperties( TQObject *o )
MetaDataBase::setPropertyChanged( o, "text", TRUE ); MetaDataBase::setPropertyChanged( o, "text", TRUE );
} }
} }
else if ( ::tqqt_cast<TQGroupBox*>(o) ) else if ( ::tqt_cast<TQGroupBox*>(o) )
MetaDataBase::setPropertyChanged( o, "title", TRUE ); MetaDataBase::setPropertyChanged( o, "title", TRUE );
else if ( o->isA( "TQFrame" ) ) { else if ( o->isA( "TQFrame" ) ) {
MetaDataBase::setPropertyChanged( o, "frameShadow", TRUE ); MetaDataBase::setPropertyChanged( o, "frameShadow", TRUE );
MetaDataBase::setPropertyChanged( o, "frameShape", TRUE ); MetaDataBase::setPropertyChanged( o, "frameShape", TRUE );
} else if ( ::tqqt_cast<TQTabWidget*>(o) || ::tqqt_cast<TQWizard*>(o) ) { } else if ( ::tqt_cast<TQTabWidget*>(o) || ::tqt_cast<TQWizard*>(o) ) {
MetaDataBase::setPropertyChanged( o, "pageTitle", TRUE ); MetaDataBase::setPropertyChanged( o, "pageTitle", TRUE );
MetaDataBase::setPropertyChanged( o, "pageName", TRUE ); MetaDataBase::setPropertyChanged( o, "pageName", TRUE );
MetaDataBase::setPropertyChanged( o, "currentPage", TRUE ); MetaDataBase::setPropertyChanged( o, "currentPage", TRUE );
} else if ( ::tqqt_cast<TQWidgetStack*>(o) ) { } else if ( ::tqt_cast<TQWidgetStack*>(o) ) {
MetaDataBase::setPropertyChanged( o, "currentPage", TRUE ); MetaDataBase::setPropertyChanged( o, "currentPage", TRUE );
MetaDataBase::setPropertyChanged( o, "pageName", TRUE ); MetaDataBase::setPropertyChanged( o, "pageName", TRUE );
} else if ( ::tqqt_cast<TQToolBox*>(o) ) { } else if ( ::tqt_cast<TQToolBox*>(o) ) {
MetaDataBase::setPropertyChanged( o, "currentIndex", TRUE ); MetaDataBase::setPropertyChanged( o, "currentIndex", TRUE );
MetaDataBase::setPropertyChanged( o, "itemName", TRUE ); MetaDataBase::setPropertyChanged( o, "itemName", TRUE );
MetaDataBase::setPropertyChanged( o, "itemLabel", TRUE ); MetaDataBase::setPropertyChanged( o, "itemLabel", TRUE );
@ -1335,9 +1335,9 @@ void WidgetFactory::initChangedProperties( TQObject *o )
MetaDataBase::setPropertyChanged( o, "itemToolTip", TRUE ); MetaDataBase::setPropertyChanged( o, "itemToolTip", TRUE );
MetaDataBase::setPropertyChanged( o, "itemBackgroundMode", TRUE ); MetaDataBase::setPropertyChanged( o, "itemBackgroundMode", TRUE );
#ifndef TQT_NO_TABLE #ifndef TQT_NO_TABLE
} else if ( ::tqqt_cast<TQTable*>(o) ) { } else if ( ::tqt_cast<TQTable*>(o) ) {
# ifndef TQT_NO_SQL # ifndef TQT_NO_SQL
if (!::tqqt_cast<TQDataTable*>(o) ) if (!::tqt_cast<TQDataTable*>(o) )
# endif # endif
{ {
MetaDataBase::setPropertyChanged( o, "numRows", TRUE ); MetaDataBase::setPropertyChanged( o, "numRows", TRUE );
@ -1349,11 +1349,11 @@ void WidgetFactory::initChangedProperties( TQObject *o )
} }
} }
#endif #endif
} else if ( ::tqqt_cast<TQSplitter*>(o) ) { } else if ( ::tqt_cast<TQSplitter*>(o) ) {
MetaDataBase::setPropertyChanged( o, "orientation", TRUE ); MetaDataBase::setPropertyChanged( o, "orientation", TRUE );
} else if ( ::tqqt_cast<QDesignerToolBar*>(o) ) { } else if ( ::tqt_cast<QDesignerToolBar*>(o) ) {
MetaDataBase::setPropertyChanged( o, "label", TRUE ); MetaDataBase::setPropertyChanged( o, "label", TRUE );
} else if ( ::tqqt_cast<MenuBarEditor*>(o) ) { } else if ( ::tqt_cast<MenuBarEditor*>(o) ) {
MetaDataBase::setPropertyChanged( o, "itemName", TRUE ); MetaDataBase::setPropertyChanged( o, "itemName", TRUE );
MetaDataBase::setPropertyChanged( o, "itemNumber", TRUE ); MetaDataBase::setPropertyChanged( o, "itemNumber", TRUE );
MetaDataBase::setPropertyChanged( o, "itemText", TRUE ); MetaDataBase::setPropertyChanged( o, "itemText", TRUE );
@ -1374,7 +1374,7 @@ bool WidgetFactory::hasSpecialEditor( int id, TQObject *editorWidget )
return TRUE; return TRUE;
if ( className == "TQTextEdit" || className == "TQMultiLineEdit" ) if ( className == "TQTextEdit" || className == "TQMultiLineEdit" )
return TRUE; return TRUE;
if ( ::tqqt_cast<TQTable*>(editorWidget) != 0 ) if ( ::tqt_cast<TQTable*>(editorWidget) != 0 )
return TRUE; return TRUE;
return FALSE; return FALSE;
@ -1386,7 +1386,7 @@ bool WidgetFactory::hasItems( int id, TQObject *editorWidget )
if ( className.contains( "ListBox" ) || className.contains( "ListView" ) || if ( className.contains( "ListBox" ) || className.contains( "ListView" ) ||
className.contains( "IconView" ) || className.contains( "ComboBox" ) || className.contains( "IconView" ) || className.contains( "ComboBox" ) ||
::tqqt_cast<TQTable*>(editorWidget) != 0 ) ::tqt_cast<TQTable*>(editorWidget) != 0 )
return TRUE; return TRUE;
return FALSE; return FALSE;
@ -1397,7 +1397,7 @@ void WidgetFactory::editWidget( int id, TQWidget *parent, TQWidget *editWidget,
TQString className = WidgetDatabase::className( id ); TQString className = WidgetDatabase::className( id );
if ( className.contains( "ListBox" ) ) { if ( className.contains( "ListBox" ) ) {
if ( !::tqqt_cast<TQListBox*>(editWidget) ) if ( !::tqt_cast<TQListBox*>(editWidget) )
return; return;
ListBoxEditor *e = new ListBoxEditor( parent, editWidget, fw ); ListBoxEditor *e = new ListBoxEditor( parent, editWidget, fw );
e->exec(); e->exec();
@ -1406,7 +1406,7 @@ void WidgetFactory::editWidget( int id, TQWidget *parent, TQWidget *editWidget,
} }
if ( className.contains( "ComboBox" ) ) { if ( className.contains( "ComboBox" ) ) {
if ( !::tqqt_cast<TQComboBox*>(editWidget) ) if ( !::tqt_cast<TQComboBox*>(editWidget) )
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 );
@ -1417,7 +1417,7 @@ void WidgetFactory::editWidget( int id, TQWidget *parent, TQWidget *editWidget,
} }
if ( className.contains( "ListView" ) ) { if ( className.contains( "ListView" ) ) {
if ( !::tqqt_cast<TQListView*>(editWidget) ) if ( !::tqt_cast<TQListView*>(editWidget) )
return; return;
TQListView *lv = (TQListView*)editWidget; TQListView *lv = (TQListView*)editWidget;
ListViewEditor *e = new ListViewEditor( parent, lv, fw ); ListViewEditor *e = new ListViewEditor( parent, lv, fw );
@ -1427,7 +1427,7 @@ void WidgetFactory::editWidget( int id, TQWidget *parent, TQWidget *editWidget,
} }
if ( className.contains( "IconView" ) ) { if ( className.contains( "IconView" ) ) {
if ( !::tqqt_cast<TQIconView*>(editWidget) ) if ( !::tqt_cast<TQIconView*>(editWidget) )
return; return;
IconViewEditor *e = new IconViewEditor( parent, editWidget, fw ); IconViewEditor *e = new IconViewEditor( parent, editWidget, fw );
e->exec(); e->exec();
@ -1442,7 +1442,7 @@ void WidgetFactory::editWidget( int id, TQWidget *parent, TQWidget *editWidget,
return; return;
} }
#ifndef TQT_NO_TABLE #ifndef TQT_NO_TABLE
if (::tqqt_cast<TQTable*>(editWidget) != 0) { if (::tqt_cast<TQTable*>(editWidget) != 0) {
TableEditor *e = new TableEditor( parent, editWidget, fw ); TableEditor *e = new TableEditor( parent, editWidget, fw );
e->exec(); e->exec();
delete e; delete e;
@ -1625,15 +1625,15 @@ void TQLayoutWidget::updateSizePolicy()
if ( parent() && parent()->isWidgetType() ) { if ( parent() && parent()->isWidgetType() ) {
parentLayout = ((TQWidget *)parent())->layout(); parentLayout = ((TQWidget *)parent())->layout();
if ( parentLayout && if ( parentLayout &&
::tqqt_cast<TQLayoutWidget*>(parentLayout->mainWidget()) ) ::tqt_cast<TQLayoutWidget*>(parentLayout->mainWidget()) )
parentLayout = 0; parentLayout = 0;
} }
TQObjectListIt it( childrenListObject() ); TQObjectListIt it( childrenListObject() );
TQObject *o; TQObject *o;
if ( ::tqqt_cast<TQVBoxLayout*>(layout()) ) { if ( ::tqt_cast<TQVBoxLayout*>(layout()) ) {
if ( ::tqqt_cast<TQHBoxLayout*>(parentLayout) ) if ( ::tqt_cast<TQHBoxLayout*>(parentLayout) )
vt = TQSizePolicy::Minimum; vt = TQSizePolicy::Minimum;
else else
vt = TQSizePolicy::Fixed; vt = TQSizePolicy::Fixed;
@ -1653,8 +1653,8 @@ void TQLayoutWidget::updateSizePolicy()
if ( w->sizePolicy().mayShrinkVertically() ) if ( w->sizePolicy().mayShrinkVertically() )
vt |= TQSizePolicy::Maximum; vt |= TQSizePolicy::Maximum;
} }
} else if ( ::tqqt_cast<TQHBoxLayout*>(layout()) ) { } else if ( ::tqt_cast<TQHBoxLayout*>(layout()) ) {
if ( ::tqqt_cast<TQVBoxLayout*>(parentLayout) ) if ( ::tqt_cast<TQVBoxLayout*>(parentLayout) )
ht = TQSizePolicy::Minimum; ht = TQSizePolicy::Minimum;
else else
ht = TQSizePolicy::Fixed; ht = TQSizePolicy::Fixed;
@ -1674,13 +1674,13 @@ void TQLayoutWidget::updateSizePolicy()
if ( !w->sizePolicy().mayShrinkVertically() ) if ( !w->sizePolicy().mayShrinkVertically() )
vt &= ~TQSizePolicy::Maximum; vt &= ~TQSizePolicy::Maximum;
} }
} else if ( ::tqqt_cast<TQGridLayout*>(layout()) ) { } else if ( ::tqt_cast<TQGridLayout*>(layout()) ) {
ht = TQSizePolicy::Fixed; ht = TQSizePolicy::Fixed;
vt = TQSizePolicy::Fixed; vt = TQSizePolicy::Fixed;
if ( parentLayout ) { if ( parentLayout ) {
if ( ::tqqt_cast<TQVBoxLayout*>(parentLayout) ) if ( ::tqt_cast<TQVBoxLayout*>(parentLayout) )
ht = TQSizePolicy::Minimum; ht = TQSizePolicy::Minimum;
else if ( ::tqqt_cast<TQHBoxLayout*>(parentLayout) ) else if ( ::tqt_cast<TQHBoxLayout*>(parentLayout) )
vt = TQSizePolicy::Minimum; vt = TQSizePolicy::Minimum;
} }
@ -1714,7 +1714,7 @@ void TQLayoutWidget::updateSizePolicy()
void CustomWidget::paintEvent( TQPaintEvent *e ) void CustomWidget::paintEvent( TQPaintEvent *e )
{ {
if ( ::tqqt_cast<FormWindow*>(parentWidget()) ) { if ( ::tqt_cast<FormWindow*>(parentWidget()) ) {
( (FormWindow*)parentWidget() )->paintGrid( this, e ); ( (FormWindow*)parentWidget() )->paintGrid( this, e );
} else { } else {
TQPainter p( this ); TQPainter p( this );

@ -30,6 +30,6 @@
#include <tqwidgetinterface_p.h> #include <tqwidgetinterface_p.h>
#define WidgetInterface TQWidgetFactoryInterface #define WidgetInterface TQWidgetFactoryInterface
#define IID_Widget IID_TQWidgetFactory #define IID_Widget IID_QWidgetFactory
#endif #endif

@ -59,7 +59,7 @@ TQRESULT LanguageInterfaceImpl::queryInterface( const TQUuid &uuid, TQUnknownInt
return parent->queryInterface( uuid, iface ); return parent->queryInterface( uuid, iface );
*iface = 0; *iface = 0;
if ( uuid == IID_TQUnknown ) if ( uuid == IID_QUnknown )
*iface = (TQUnknownInterface*)this; *iface = (TQUnknownInterface*)this;
else if ( uuid == IID_Language ) else if ( uuid == IID_Language )
*iface = (LanguageInterface*)this; *iface = (LanguageInterface*)this;

@ -128,7 +128,7 @@ TQRESULT %{APPNAME}Impl::queryInterface( const TQUuid& uuid, TQUnknownInterface*
* Now the caller knows that the Interface Pointer * Now the caller knows that the Interface Pointer
* is valid and the interface supported * is valid and the interface supported
*/ */
if ( uuid == IID_TQUnknown ) if ( uuid == IID_QUnknown )
*iface = this; *iface = this;
else if ( uuid == IID_TaskbarApplet ) else if ( uuid == IID_TaskbarApplet )
*iface = this; *iface = this;

@ -137,7 +137,7 @@ void %{APPNAME}Impl::onKeyPress( TQObject *receiver, const char *slot )
TQRESULT %{APPNAME}Impl::queryInterface( const TQUuid &uuid, TQUnknownInterface **iface ) TQRESULT %{APPNAME}Impl::queryInterface( const TQUuid &uuid, TQUnknownInterface **iface )
{ {
*iface = 0; *iface = 0;
if ( uuid == IID_TQUnknown ) if ( uuid == IID_QUnknown )
*iface = this; *iface = this;
else if ( uuid == IID_InputMethod ) else if ( uuid == IID_InputMethod )
*iface = this; *iface = this;

@ -60,7 +60,7 @@ void %{APPNAME}::activated()
TQRESULT %{APPNAME}::queryInterface( const TQUuid &uuid, TQUnknownInterface **iface ) TQRESULT %{APPNAME}::queryInterface( const TQUuid &uuid, TQUnknownInterface **iface )
{ {
*iface = 0; *iface = 0;
if ( uuid == IID_TQUnknown ) if ( uuid == IID_QUnknown )
*iface = this; *iface = this;
else if ( uuid == IID_MenuApplet ) else if ( uuid == IID_MenuApplet )
*iface = this; *iface = this;

@ -16,7 +16,7 @@ TodayPluginObject* %{APPNAME}Impl::guiPart() {
TQRESULT %{APPNAME}Impl::queryInterface( const TQUuid & uuid, TQUnknownInterface **iface ) { TQRESULT %{APPNAME}Impl::queryInterface( const TQUuid & uuid, TQUnknownInterface **iface ) {
*iface = 0; *iface = 0;
if ( ( uuid == IID_TQUnknown ) || ( uuid == IID_TodayPluginInterface ) ) { if ( ( uuid == IID_QUnknown ) || ( uuid == IID_TodayPluginInterface ) ) {
*iface = this, (*iface)->addRef(); *iface = this, (*iface)->addRef();
}else }else
return TQS_FALSE; return TQS_FALSE;

Loading…
Cancel
Save