diff options
Diffstat (limited to 'kommander/editor/command.cpp')
-rw-r--r-- | kommander/editor/command.cpp | 208 |
1 files changed, 104 insertions, 104 deletions
diff --git a/kommander/editor/command.cpp b/kommander/editor/command.cpp index 63343b35..8d15c885 100644 --- a/kommander/editor/command.cpp +++ b/kommander/editor/command.cpp @@ -235,7 +235,7 @@ void ResizeCommand::execute() { widget->setGeometry( newRect ); formWindow()->updateSelection( widget ); - formWindow()->emitUpdateProperties( TQT_TQOBJECT(widget) ); + formWindow()->emitUpdateProperties( widget ); if ( WidgetFactory::layoutType( widget ) != WidgetFactory::NoLayout ) formWindow()->updateChildSelections( widget ); } @@ -244,7 +244,7 @@ void ResizeCommand::unexecute() { widget->setGeometry( oldRect ); formWindow()->updateSelection( widget ); - formWindow()->emitUpdateProperties( TQT_TQOBJECT(widget) ); + formWindow()->emitUpdateProperties( widget ); if ( WidgetFactory::layoutType( widget ) != WidgetFactory::NoLayout ) formWindow()->updateChildSelections( widget ); } @@ -271,14 +271,14 @@ void InsertCommand::execute() widget->show(); formWindow()->widgets()->insert( widget, widget ); formWindow()->clearSelection( false ); - formWindow()->selectWidget( TQT_TQOBJECT(widget) ); + formWindow()->selectWidget( widget ); formWindow()->mainWindow()->objectHierarchy()->widgetInserted( widget ); } void InsertCommand::unexecute() { widget->hide(); - formWindow()->selectWidget( TQT_TQOBJECT(widget), false ); + formWindow()->selectWidget( widget, false ); formWindow()->widgets()->remove( widget ); formWindow()->mainWindow()->objectHierarchy()->widgetRemoved( widget ); } @@ -318,7 +318,7 @@ void MoveCommand::execute() w->reparent( newParent, pos, true ); formWindow()->raiseSelection( w ); formWindow()->raiseChildSelections( w ); - formWindow()->widgetChanged( TQT_TQOBJECT(w) ); + formWindow()->widgetChanged( w ); formWindow()->mainWindow()->objectHierarchy()->widgetRemoved( w ); formWindow()->mainWindow()->objectHierarchy()->widgetInserted( w ); } @@ -326,7 +326,7 @@ void MoveCommand::execute() } formWindow()->updateSelection( w ); formWindow()->updateChildSelections( w ); - formWindow()->emitUpdateProperties( TQT_TQOBJECT(w) ); + formWindow()->emitUpdateProperties( w ); } } @@ -339,7 +339,7 @@ void MoveCommand::unexecute() w->reparent( oldParent, pos, true ); formWindow()->raiseSelection( w ); formWindow()->raiseChildSelections( w ); - formWindow()->widgetChanged( TQT_TQOBJECT(w) ); + formWindow()->widgetChanged( w ); formWindow()->mainWindow()->objectHierarchy()->widgetRemoved( w ); formWindow()->mainWindow()->objectHierarchy()->widgetInserted( w ); } @@ -347,7 +347,7 @@ void MoveCommand::unexecute() } formWindow()->updateSelection( w ); formWindow()->updateChildSelections( w ); - formWindow()->emitUpdateProperties( TQT_TQOBJECT(w) ); + formWindow()->emitUpdateProperties( w ); } } @@ -368,14 +368,14 @@ void DeleteCommand::execute() w->hide(); TQString s = w->name(); s.prepend( "qt_dead_widget_" ); - w->setName( s ); - formWindow()->selectWidget( TQT_TQOBJECT(w), false ); + w->setName( s.utf8() ); + formWindow()->selectWidget( w, false ); formWindow()->widgets()->remove( w ); - TQValueList<MetaDataBase::Connection> conns = MetaDataBase::connections( TQT_TQOBJECT(formWindow()), TQT_TQOBJECT(w) ); + TQValueList<MetaDataBase::Connection> conns = MetaDataBase::connections( formWindow(), w ); connections.insert( w, conns ); TQValueList<MetaDataBase::Connection>::Iterator it = conns.begin(); for ( ; it != conns.end(); ++it ) { - MetaDataBase::removeConnection( TQT_TQOBJECT(formWindow()), (*it).sender, + MetaDataBase::removeConnection( formWindow(), (*it).sender, (*it).signal, (*it).receiver, (*it).slot ); } } @@ -393,13 +393,13 @@ void DeleteCommand::unexecute() w->show(); TQString s = w->name(); s.remove( 0, TQString( "qt_dead_widget_" ).length() ); - w->setName( s ); + w->setName( s.utf8() ); formWindow()->widgets()->insert( w, w ); - formWindow()->selectWidget( TQT_TQOBJECT(w) ); + formWindow()->selectWidget( w ); TQValueList<MetaDataBase::Connection> conns = *connections.find( w ); TQValueList<MetaDataBase::Connection>::Iterator it = conns.begin(); for ( ; it != conns.end(); ++it ) { - MetaDataBase::addConnection( TQT_TQOBJECT(formWindow()), (*it).sender, + MetaDataBase::addConnection( formWindow(), (*it).sender, (*it).signal, (*it).receiver, (*it).slot ); } } @@ -430,7 +430,7 @@ void SetPropertyCommand::execute() if ( isResetCommand ) { MetaDataBase::setPropertyChanged( widget, propName, false ); if ( WidgetFactory::resetProperty( widget, propName ) ) { - if ( !formWindow()->isWidgetSelected( widget ) && TQT_BASE_OBJECT(widget) != TQT_BASE_OBJECT(formWindow()) ) + if ( !formWindow()->isWidgetSelected( widget ) && widget != formWindow() ) formWindow()->selectWidget( widget ); if ( editor->widget() != widget ) editor->setWidget( widget, formWindow() ); @@ -438,7 +438,7 @@ void SetPropertyCommand::execute() PropertyItem *i = (PropertyItem*)editor->propertyList()->currentItem(); if ( !i ) return; - i->setValue( widget->property( propName ) ); + i->setValue( widget->property( propName.latin1() ) ); i->setChanged( false ); editor->refetchData(); editor->emitWidgetChanged(); @@ -461,7 +461,7 @@ bool SetPropertyCommand::canMerge( Command *c ) { SetPropertyCommand *cmd = (SetPropertyCommand*)c; const TQMetaProperty *p = - widget->metaObject()->property( widget->metaObject()->findProperty( propName, true ), true ); + widget->metaObject()->property( widget->metaObject()->findProperty( propName.latin1(), true ), true ); if ( !p ) { if ( propName == "toolTip" || propName == "whatsThis" ) return true; @@ -532,19 +532,19 @@ void SetPropertyCommand::setProperty( const TQVariant &v, const TQString ¤ editor->propertyList()->setCurrentProperty( propName ); const TQMetaProperty *p = - widget->metaObject()->property( widget->metaObject()->findProperty( propName, true ), true ); + widget->metaObject()->property( widget->metaObject()->findProperty( propName.latin1(), true ), true ); if ( !p ) { if ( propName == "hAlign" ) { p = widget->metaObject()->property( widget->metaObject()->findProperty( "alignment", true ), true ); int align = widget->property( "alignment" ).toInt(); align &= ~( AlignHorizontal_Mask ); - align |= p->keyToValue( currentItemText ); + align |= p->keyToValue( currentItemText.utf8() ); widget->setProperty( "alignment", TQVariant( align ) ); } else if ( propName == "vAlign" ) { p = widget->metaObject()->property( widget->metaObject()->findProperty( "alignment", true ), true ); int align = widget->property( "alignment" ).toInt(); align &= ~( AlignVertical_Mask ); - align |= p->keyToValue( currentItemText ); + align |= p->keyToValue( currentItemText.utf8() ); widget->setProperty( "alignment", TQVariant( align ) ); } else if ( propName == "wordwrap" ) { int align = widget->property( "alignment" ).toInt(); @@ -553,9 +553,9 @@ void SetPropertyCommand::setProperty( const TQVariant &v, const TQString ¤ align |= WordBreak; widget->setProperty( "alignment", TQVariant( align ) ); } else if ( propName == "layoutSpacing" ) { - MetaDataBase::setSpacing( TQT_TQOBJECT(WidgetFactory::containerOfWidget( TQT_TQWIDGET(editor->widget()) )), v.toInt() ); + MetaDataBase::setSpacing( WidgetFactory::containerOfWidget( static_cast<TQWidget*>( editor->widget() ) ), v.toInt() ); } else if ( propName == "layoutMargin" ) { - MetaDataBase::setMargin( TQT_TQOBJECT(WidgetFactory::containerOfWidget( TQT_TQWIDGET(editor->widget()) )), v.toInt() ); + MetaDataBase::setMargin( WidgetFactory::containerOfWidget( static_cast<TQWidget*>( editor->widget() ) ), v.toInt() ); } else if ( propName == "toolTip" || propName == "whatsThis" || propName == "database" || propName == "frameworkCode" ) { MetaDataBase::setFakeProperty( editor->widget(), propName, v ); } else if ( editor->widget()->inherits( "CustomWidget" ) ) { @@ -577,19 +577,19 @@ void SetPropertyCommand::setProperty( const TQVariant &v, const TQString ¤ if ( p->isSetType() ) { ; } else if ( p->isEnumType() ) { - widget->setProperty( propName, p->keyToValue( currentItemText ) ); + widget->setProperty( propName.latin1(), p->keyToValue( currentItemText.utf8() ) ); } else { TQVariant ov; if ( propName == "name" || propName == "itemName" ) - ov = widget->property( propName ); + ov = widget->property( propName.latin1() ); int oldSerNum = -1; if ( v.type() == TQVariant::Pixmap ) oldSerNum = v.toPixmap().serialNumber(); - widget->setProperty( propName, v ); - if ( oldSerNum != -1 && oldSerNum != widget->property( propName ).toPixmap().serialNumber() ) - MetaDataBase::setPixmapKey( TQT_TQOBJECT(formWindow()), - widget->property( propName ).toPixmap().serialNumber(), - MetaDataBase::pixmapKey( TQT_TQOBJECT(formWindow()), oldSerNum ) ); + widget->setProperty( propName.latin1(), v ); + if ( oldSerNum != -1 && oldSerNum != widget->property( propName.latin1() ).toPixmap().serialNumber() ) + MetaDataBase::setPixmapKey( formWindow(), + widget->property( propName.latin1() ).toPixmap().serialNumber(), + MetaDataBase::pixmapKey( formWindow(), oldSerNum ) ); if ( propName == "cursor" ) MetaDataBase::setCursor( (TQWidget*)widget, v.toCursor() ); if ( propName == "name" && widget->isWidgetType() ) { @@ -597,14 +597,14 @@ void SetPropertyCommand::setProperty( const TQVariant &v, const TQString ¤ if ( formWindow()->isMainContainer( widget ) ) formWindow()->setName( v.toCString() ); } - if ( propName == "name" && widget->inherits( TQACTION_OBJECT_NAME_STRING ) && + if ( propName == "name" && widget->inherits( "TQAction" ) && formWindow()->mainContainer() && - formWindow()->mainContainer()->inherits( TQMAINWINDOW_OBJECT_NAME_STRING ) ) { + formWindow()->mainContainer()->inherits( "TQMainWindow" ) ) { formWindow()->mainWindow()->actioneditor()->updateActionName( (TQAction*)widget ); } - if ( propName == "iconSet" && widget->inherits( TQACTION_OBJECT_NAME_STRING ) && + if ( propName == "iconSet" && widget->inherits( "TQAction" ) && formWindow()->mainContainer() && - formWindow()->mainContainer()->inherits( TQMAINWINDOW_OBJECT_NAME_STRING ) ) { + formWindow()->mainContainer()->inherits( "TQMainWindow" ) ) { formWindow()->mainWindow()->actioneditor()->updateActionIcon( (TQAction*)widget ); } if ( propName == "caption" ) { @@ -747,13 +747,13 @@ BreakLayoutCommand::BreakLayoutCommand( const TQString &n, FormWindow *fw, : Command( n, fw ), lb( layoutBase ), widgets( wl ) { WidgetFactory::LayoutType lay = WidgetFactory::layoutType( layoutBase ); - spacing = MetaDataBase::spacing( TQT_TQOBJECT(layoutBase) ); - margin = MetaDataBase::margin( TQT_TQOBJECT(layoutBase) ); + spacing = MetaDataBase::spacing( layoutBase ); + margin = MetaDataBase::margin( layoutBase ); layout = 0; if ( lay == WidgetFactory::HBox ) - layout = new HorizontalLayout( wl, layoutBase, fw, layoutBase, false, layoutBase->inherits( TQSPLITTER_OBJECT_NAME_STRING ) ); + layout = new HorizontalLayout( wl, layoutBase, fw, layoutBase, false, layoutBase->inherits( "TQSplitter" ) ); else if ( lay == WidgetFactory::VBox ) - layout = new VerticalLayout( wl, layoutBase, fw, layoutBase, false, layoutBase->inherits( TQSPLITTER_OBJECT_NAME_STRING ) ); + layout = new VerticalLayout( wl, layoutBase, fw, layoutBase, false, layoutBase->inherits( "TQSplitter" ) ); else if ( lay == WidgetFactory::Grid ) layout = new GridLayout( wl, layoutBase, fw, layoutBase, TQSize( TQMAX( 5, fw->grid().x()), TQMAX( 5, fw->grid().y()) ), false ); } @@ -776,8 +776,8 @@ void BreakLayoutCommand::unexecute() formWindow()->clearSelection( false ); layout->doLayout(); formWindow()->mainWindow()->objectHierarchy()->rebuild(); - MetaDataBase::setSpacing( TQT_TQOBJECT(WidgetFactory::containerOfWidget( lb )), spacing ); - MetaDataBase::setMargin( TQT_TQOBJECT(WidgetFactory::containerOfWidget( lb )), margin ); + MetaDataBase::setSpacing( WidgetFactory::containerOfWidget( lb ), spacing ); + MetaDataBase::setMargin( WidgetFactory::containerOfWidget( lb ), margin ); } // ------------------------------------------------------------ @@ -809,7 +809,7 @@ AddTabPageCommand::AddTabPageCommand( const TQString &n, FormWindow *fw, tabPage = new QDesignerWidget( formWindow(), tabWidget, "tab" ); tabPage->hide(); index = -1; - MetaDataBase::addEntry( TQT_TQOBJECT(tabPage) ); + MetaDataBase::addEntry( tabPage ); } void AddTabPageCommand::execute() @@ -818,7 +818,7 @@ void AddTabPageCommand::execute() index = ( (QDesignerTabWidget*)tabWidget )->count(); tabWidget->insertTab( tabPage, tabLabel, index ); tabWidget->showPage( tabPage ); - formWindow()->emitUpdateProperties( TQT_TQOBJECT(formWindow()->currentWidget()) ); + formWindow()->emitUpdateProperties( formWindow()->currentWidget() ); formWindow()->mainWindow()->objectHierarchy()->tabsChanged( tabWidget ); } @@ -826,7 +826,7 @@ void AddTabPageCommand::unexecute() { tabWidget->removePage( tabPage ); tabPage->hide(); - formWindow()->emitUpdateProperties( TQT_TQOBJECT(formWindow()->currentWidget()) ); + formWindow()->emitUpdateProperties( formWindow()->currentWidget() ); formWindow()->mainWindow()->objectHierarchy()->tabsChanged( tabWidget ); } @@ -840,7 +840,7 @@ AddToolBoxPageCommand::AddToolBoxPageCommand( const TQString &n, FormWindow *fw, page = new QDesignerWidget( formWindow(), toolBox, "tab" ); page->hide(); index = -1; - MetaDataBase::addEntry( TQT_TQOBJECT(page) ); + MetaDataBase::addEntry( page ); } void AddToolBoxPageCommand::execute() @@ -849,7 +849,7 @@ void AddToolBoxPageCommand::execute() index = ( (EditorToolBox*)toolBox)->count(); toolBox->insertItem(index, page, label); toolBox->setCurrentItem( page ); - formWindow()->emitUpdateProperties( TQT_TQOBJECT(formWindow()->currentWidget()) ); + formWindow()->emitUpdateProperties( formWindow()->currentWidget() ); formWindow()->mainWindow()->objectHierarchy()->tabsChanged( toolBox ); } @@ -857,7 +857,7 @@ void AddToolBoxPageCommand::unexecute() { toolBox->removeItem( page ); page->hide(); - formWindow()->emitUpdateProperties( TQT_TQOBJECT(formWindow()->currentWidget()) ); + formWindow()->emitUpdateProperties( formWindow()->currentWidget() ); formWindow()->mainWindow()->objectHierarchy()->tabsChanged( toolBox ); } @@ -876,7 +876,7 @@ void MoveTabPageCommand::execute() ((QDesignerTabWidget*)tabWidget )->removePage( tabPage ); ((QDesignerTabWidget*)tabWidget )->insertTab( tabPage, tabLabel, newIndex ); ((QDesignerTabWidget*)tabWidget )->showPage( tabPage ); - formWindow()->emitUpdateProperties( TQT_TQOBJECT(formWindow()->currentWidget()) ); + formWindow()->emitUpdateProperties( formWindow()->currentWidget() ); formWindow()->mainWindow()->objectHierarchy()->tabsChanged( tabWidget ); } @@ -885,7 +885,7 @@ void MoveTabPageCommand::unexecute() ((QDesignerTabWidget*)tabWidget )->removePage( tabPage ); ((QDesignerTabWidget*)tabWidget )->insertTab( tabPage, tabLabel, oldIndex ); ((QDesignerTabWidget*)tabWidget )->showPage( tabPage ); - formWindow()->emitUpdateProperties( TQT_TQOBJECT(formWindow()->currentWidget()) ); + formWindow()->emitUpdateProperties( formWindow()->currentWidget() ); formWindow()->mainWindow()->objectHierarchy()->tabsChanged( tabWidget ); } @@ -903,7 +903,7 @@ void DeleteTabPageCommand::execute() { tabWidget->removePage( tabPage ); tabPage->hide(); - formWindow()->emitUpdateProperties( TQT_TQOBJECT(formWindow()->currentWidget()) ); + formWindow()->emitUpdateProperties( formWindow()->currentWidget() ); formWindow()->mainWindow()->objectHierarchy()->tabsChanged( tabWidget ); } @@ -911,7 +911,7 @@ void DeleteTabPageCommand::unexecute() { tabWidget->insertTab( tabPage, tabLabel, index ); tabWidget->showPage( tabPage ); - formWindow()->emitUpdateProperties( TQT_TQOBJECT(formWindow()->currentWidget()) ); + formWindow()->emitUpdateProperties( formWindow()->currentWidget() ); formWindow()->mainWindow()->objectHierarchy()->tabsChanged( tabWidget ); } @@ -929,7 +929,7 @@ void DeleteToolBoxPageCommand::execute() { toolBox->removeItem( page ); page->hide(); - formWindow()->emitUpdateProperties( TQT_TQOBJECT(formWindow()->currentWidget()) ); + formWindow()->emitUpdateProperties( formWindow()->currentWidget() ); formWindow()->mainWindow()->objectHierarchy()->tabsChanged( toolBox ); } @@ -937,7 +937,7 @@ void DeleteToolBoxPageCommand::unexecute() { toolBox->insertItem(index, page, label); toolBox->setCurrentItem( page ); - formWindow()->emitUpdateProperties( TQT_TQOBJECT(formWindow()->currentWidget()) ); + formWindow()->emitUpdateProperties( formWindow()->currentWidget() ); formWindow()->mainWindow()->objectHierarchy()->tabsChanged( toolBox ); } @@ -951,7 +951,7 @@ AddWizardPageCommand::AddWizardPageCommand( const TQString &n, FormWindow *fw, page->hide(); index = i; show = s; - MetaDataBase::addEntry( TQT_TQOBJECT(page) ); + MetaDataBase::addEntry( page ); } void AddWizardPageCommand::execute() @@ -961,7 +961,7 @@ void AddWizardPageCommand::execute() wizard->insertPage( page, pageLabel, index ); if ( show ) ( (QDesignerWizard*)wizard )->setCurrentPage( ( (QDesignerWizard*)wizard )->pageNum( page ) ); - formWindow()->emitUpdateProperties( TQT_TQOBJECT(formWindow()->currentWidget()) ); + formWindow()->emitUpdateProperties( formWindow()->currentWidget() ); formWindow()->mainWindow()->objectHierarchy()->pagesChanged( wizard ); } @@ -969,7 +969,7 @@ void AddWizardPageCommand::unexecute() { wizard->removePage( page ); page->hide(); - formWindow()->emitUpdateProperties( TQT_TQOBJECT(formWindow()->currentWidget()) ); + formWindow()->emitUpdateProperties( formWindow()->currentWidget() ); formWindow()->mainWindow()->objectHierarchy()->pagesChanged( wizard ); } @@ -988,7 +988,7 @@ void DeleteWizardPageCommand::execute() pageLabel = wizard->title( page ); wizard->removePage( page ); page->hide(); - formWindow()->emitUpdateProperties( TQT_TQOBJECT(formWindow()->currentWidget()) ); + formWindow()->emitUpdateProperties( formWindow()->currentWidget() ); formWindow()->mainWindow()->objectHierarchy()->pagesChanged( wizard ); } @@ -997,7 +997,7 @@ void DeleteWizardPageCommand::unexecute() wizard->insertPage( page, pageLabel, index ); if ( show ) ( (QDesignerWizard*)wizard )->setCurrentPage( ( (QDesignerWizard*)wizard )->pageNum( page ) ); - formWindow()->emitUpdateProperties( TQT_TQOBJECT(formWindow()->currentWidget()) ); + formWindow()->emitUpdateProperties( formWindow()->currentWidget() ); formWindow()->mainWindow()->objectHierarchy()->pagesChanged( wizard ); } @@ -1017,7 +1017,7 @@ void RenameWizardPageCommand::execute() wizard->setTitle( page, label ); label = oldLabel; - formWindow()->emitUpdateProperties( TQT_TQOBJECT(formWindow()->currentWidget()) ); + formWindow()->emitUpdateProperties( formWindow()->currentWidget() ); } void RenameWizardPageCommand::unexecute() @@ -1042,7 +1042,7 @@ void SwapWizardPagesCommand::execute() wizard->removePage( page2 ); wizard->insertPage( page1, page1Label, index2 ); wizard->insertPage( page2, page2Label, index1 ); - formWindow()->emitUpdateProperties( TQT_TQOBJECT(formWindow()->currentWidget()) ); + formWindow()->emitUpdateProperties( formWindow()->currentWidget() ); formWindow()->mainWindow()->objectHierarchy()->pagesChanged( wizard ); } @@ -1061,7 +1061,7 @@ AddConnectionCommand::AddConnectionCommand( const TQString &name, FormWindow *fw void AddConnectionCommand::execute() { - MetaDataBase::addConnection( TQT_TQOBJECT(formWindow()), connection.sender, + MetaDataBase::addConnection( formWindow(), connection.sender, connection.signal, connection.receiver, connection.slot ); #ifndef KOMMANDER if ( connection.receiver == formWindow()->mainContainer() ) @@ -1074,7 +1074,7 @@ void AddConnectionCommand::execute() void AddConnectionCommand::unexecute() { - MetaDataBase::removeConnection( TQT_TQOBJECT(formWindow()), connection.sender, + MetaDataBase::removeConnection( formWindow(), connection.sender, connection.signal, connection.receiver, connection.slot ); #ifndef KOMMANDER if ( connection.receiver == formWindow()->mainContainer() ) @@ -1095,7 +1095,7 @@ RemoveConnectionCommand::RemoveConnectionCommand( const TQString &name, FormWind void RemoveConnectionCommand::execute() { - MetaDataBase::removeConnection( TQT_TQOBJECT(formWindow()), connection.sender, + MetaDataBase::removeConnection( formWindow(), connection.sender, connection.signal, connection.receiver, connection.slot ); #ifndef KOMMANDER if ( connection.receiver == formWindow()->mainContainer() ) @@ -1108,7 +1108,7 @@ void RemoveConnectionCommand::execute() void RemoveConnectionCommand::unexecute() { - MetaDataBase::addConnection( TQT_TQOBJECT(formWindow()), connection.sender, + MetaDataBase::addConnection( formWindow(), connection.sender, connection.signal, connection.receiver, connection.slot ); #ifndef KOMMANDER if ( connection.receiver == formWindow()->mainContainer() ) @@ -1131,7 +1131,7 @@ AddSlotCommand::AddSlotCommand( const TQString &name, FormWindow *fw, const TQCS void AddSlotCommand::execute() { - MetaDataBase::addSlot( TQT_TQOBJECT(formWindow()), slot, specifier, access, language, returnType ); + MetaDataBase::addSlot( formWindow(), slot, specifier, access, language, returnType ); #ifndef KOMMANDER formWindow()->mainWindow()->slotsChanged(); #endif @@ -1141,7 +1141,7 @@ void AddSlotCommand::execute() void AddSlotCommand::unexecute() { - MetaDataBase::removeSlot( TQT_TQOBJECT(formWindow()), slot, specifier, access, language, returnType ); + MetaDataBase::removeSlot( formWindow(), slot, specifier, access, language, returnType ); #ifndef KOMMANDER formWindow()->mainWindow()->slotsChanged(); #endif @@ -1160,7 +1160,7 @@ RemoveSlotCommand::RemoveSlotCommand( const TQString &name, FormWindow *fw, cons void RemoveSlotCommand::execute() { - MetaDataBase::removeSlot( TQT_TQOBJECT(formWindow()), slot, specifier, access, language, returnType ); + MetaDataBase::removeSlot( formWindow(), slot, specifier, access, language, returnType ); #ifndef KOMMANDER formWindow()->mainWindow()->slotsChanged(); #endif @@ -1170,7 +1170,7 @@ void RemoveSlotCommand::execute() void RemoveSlotCommand::unexecute() { - MetaDataBase::addSlot( TQT_TQOBJECT(formWindow()), slot, specifier, access, language, returnType ); + MetaDataBase::addSlot( formWindow(), slot, specifier, access, language, returnType ); #ifndef KOMMANDER formWindow()->mainWindow()->slotsChanged(); #endif @@ -1238,7 +1238,7 @@ void PasteCommand::execute() { for ( TQWidget *w = widgets.first(); w; w = widgets.next() ) { w->show(); - formWindow()->selectWidget( TQT_TQOBJECT(w) ); + formWindow()->selectWidget( w ); formWindow()->widgets()->insert( w, w ); formWindow()->mainWindow()->objectHierarchy()->widgetInserted( w ); } @@ -1248,7 +1248,7 @@ void PasteCommand::unexecute() { for ( TQWidget *w = widgets.first(); w; w = widgets.next() ) { w->hide(); - formWindow()->selectWidget( TQT_TQOBJECT(w), false ); + formWindow()->selectWidget( w, false ); formWindow()->widgets()->remove( w ); formWindow()->mainWindow()->objectHierarchy()->widgetRemoved( w ); } @@ -1490,21 +1490,21 @@ PopulateMultiLineEditCommand::PopulateMultiLineEditCommand( const TQString &n, F : Command( n, fw ), newText( txt ), mlined( mle ) { oldText = mlined->text(); - wasChanged = MetaDataBase::isPropertyChanged( TQT_TQOBJECT(mlined), "text" ); + wasChanged = MetaDataBase::isPropertyChanged( mlined, "text" ); } void PopulateMultiLineEditCommand::execute() { mlined->setText( newText ); - MetaDataBase::setPropertyChanged( TQT_TQOBJECT(mlined), "text", true ); - formWindow()->emitUpdateProperties( TQT_TQOBJECT(mlined) ); + MetaDataBase::setPropertyChanged( mlined, "text", true ); + formWindow()->emitUpdateProperties( mlined ); } void PopulateMultiLineEditCommand::unexecute() { mlined->setText( oldText ); - MetaDataBase::setPropertyChanged( TQT_TQOBJECT(mlined), "text", wasChanged ); - formWindow()->emitUpdateProperties( TQT_TQOBJECT(mlined) ); + MetaDataBase::setPropertyChanged( mlined, "text", wasChanged ); + formWindow()->emitUpdateProperties( mlined ); } // ------------------------------------------------------------ @@ -1516,7 +1516,7 @@ PopulateTableCommand::PopulateTableCommand( const TQString &n, FormWindow *fw, T { #ifndef TQT_NO_TABLE int i = 0; - TQMap<TQString, TQString> columnFields = MetaDataBase::columnFields( TQT_TQOBJECT(table)); + TQMap<TQString, TQString> columnFields = MetaDataBase::columnFields( table); for ( i = 0; i < table->horizontalHeader()->count(); ++i ) { PopulateTableCommand::Column col; col.text = table->horizontalHeader()->label( i ); @@ -1546,7 +1546,7 @@ void PopulateTableCommand::execute() if ( !(*cit).field.isEmpty() ) columnFields.insert( (*cit).text, (*cit).field ); } - MetaDataBase::setColumnFields( TQT_TQOBJECT(table), columnFields ); + MetaDataBase::setColumnFields( table, columnFields ); table->setNumRows( newRows.count() ); i = 0; for ( TQValueList<Row>::Iterator rit = newRows.begin(); rit != newRows.end(); ++rit, ++i ) @@ -1565,7 +1565,7 @@ void PopulateTableCommand::unexecute() if ( !(*cit).field.isEmpty() ) columnFields.insert( (*cit).text, (*cit).field ); } - MetaDataBase::setColumnFields( TQT_TQOBJECT(table), columnFields ); + MetaDataBase::setColumnFields( table, columnFields ); table->setNumRows( oldRows.count() ); i = 0; for ( TQValueList<Row>::Iterator rit = oldRows.begin(); rit != oldRows.end(); ++rit, ++i ) @@ -1589,7 +1589,7 @@ void AddActionToToolBarCommand::execute() TQString s = ( (QDesignerAction*)action )->widget()->name(); if ( s.startsWith( "qt_dead_widget_" ) ) { s.remove( 0, TQString( "qt_dead_widget_" ).length() ); - ( (QDesignerAction*)action )->widget()->setName( s ); + ( (QDesignerAction*)action )->widget()->setName( s.utf8() ); } } @@ -1605,13 +1605,13 @@ void AddActionToToolBarCommand::execute() toolBar->insertAction( ( (QSeparatorAction*)action )->widget(), action ); ( (QSeparatorAction*)action )->widget()->installEventFilter( toolBar ); } - if ( !action->inherits( TQACTIONGROUP_OBJECT_NAME_STRING ) || ( (TQActionGroup*)action )->usesDropDown()) { + if ( !action->inherits( "TQActionGroup" ) || ( (TQActionGroup*)action )->usesDropDown()) { if ( index == -1 ) toolBar->appendAction( action ); else toolBar->insertAction( index, action ); toolBar->reInsert(); - TQObject::connect( action, TQT_SIGNAL( destroyed() ), toolBar, TQT_SLOT( actionRemoved() ) ); + TQObject::connect( action, TQ_SIGNAL( destroyed() ), toolBar, TQ_SLOT( actionRemoved() ) ); } else { TQObjectList clo = action->childrenListObject(); if (!clo.isEmpty()) { @@ -1620,7 +1620,7 @@ void AddActionToToolBarCommand::execute() while ( it.current() ) { TQObject *o = it.current(); ++it; - if ( !o->inherits( TQACTION_OBJECT_NAME_STRING ) ) + if ( !o->inherits( "TQAction" ) ) continue; // ### fix it for nested actiongroups if ( o->inherits( "QDesignerAction" ) ) { @@ -1635,7 +1635,7 @@ void AddActionToToolBarCommand::execute() } } toolBar->reInsert(); - TQObject::connect( action, TQT_SIGNAL( destroyed() ), toolBar, TQT_SLOT( actionRemoved() ) ); + TQObject::connect( action, TQ_SIGNAL( destroyed() ), toolBar, TQ_SLOT( actionRemoved() ) ); } } @@ -1644,13 +1644,13 @@ void AddActionToToolBarCommand::unexecute() if ( action->inherits( "QDesignerAction" ) ) { TQString s = ( (QDesignerAction*)action )->widget()->name(); s.prepend( "qt_dead_widget_" ); - ( (QDesignerAction*)action )->widget()->setName( s ); + ( (QDesignerAction*)action )->widget()->setName( s.utf8() ); } toolBar->removeAction( action ); action->removeFrom( toolBar ); - TQObject::disconnect( action, TQT_SIGNAL( destroyed() ), toolBar, TQT_SLOT( actionRemoved() ) ); - if ( !action->inherits( TQACTIONGROUP_OBJECT_NAME_STRING ) || ( (TQActionGroup*)action )->usesDropDown()) { + TQObject::disconnect( action, TQ_SIGNAL( destroyed() ), toolBar, TQ_SLOT( actionRemoved() ) ); + if ( !action->inherits( "TQActionGroup" ) || ( (TQActionGroup*)action )->usesDropDown()) { action->removeEventFilter( toolBar ); } else { TQObjectList clo = action->childrenListObject(); @@ -1659,7 +1659,7 @@ void AddActionToToolBarCommand::unexecute() while ( it.current() ) { TQObject *o = it.current(); ++it; - if ( !o->inherits( TQACTION_OBJECT_NAME_STRING ) ) + if ( !o->inherits( "TQAction" ) ) continue; if ( o->inherits( "QDesignerAction" ) ) { o->removeEventFilter( toolBar ); @@ -1680,7 +1680,7 @@ AddActionToPopupCommand::AddActionToPopupCommand( const TQString &n, FormWindow void AddActionToPopupCommand::execute() { - if ( action->inherits( TQACTIONGROUP_OBJECT_NAME_STRING ) ) { + if ( action->inherits( "TQActionGroup" ) ) { if ( ( (TQActionGroup*)action )->usesDropDown() ) { action->addTo( popup ); popup->insertAction( index, action ); @@ -1693,7 +1693,7 @@ void AddActionToPopupCommand::execute() while ( it.current() ) { TQObject *o = it.current(); ++it; - if ( !o->inherits( TQACTION_OBJECT_NAME_STRING ) ) + if ( !o->inherits( "TQAction" ) ) continue; QDesignerAction *ac = (QDesignerAction*)o; popup->insertAction( index + (i++), ac ); @@ -1701,13 +1701,13 @@ void AddActionToPopupCommand::execute() } } popup->reInsert(); - TQObject::connect( action, TQT_SIGNAL( destroyed() ), popup, TQT_SLOT( actionRemoved() ) ); + TQObject::connect( action, TQ_SIGNAL( destroyed() ), popup, TQ_SLOT( actionRemoved() ) ); } else { if ( !action->inherits( "QDesignerAction" ) || ( (QDesignerAction*)action )->supportsMenu() ) { action->addTo( popup ); popup->insertAction( index, action ); popup->reInsert(); - TQObject::connect( action, TQT_SIGNAL( destroyed() ), popup, TQT_SLOT( actionRemoved() ) ); + TQObject::connect( action, TQ_SIGNAL( destroyed() ), popup, TQ_SLOT( actionRemoved() ) ); } } } @@ -1716,8 +1716,8 @@ void AddActionToPopupCommand::unexecute() { action->removeFrom( popup ); popup->removeAction( action ); - TQObject::disconnect( action, TQT_SIGNAL( destroyed() ), popup, TQT_SLOT( actionRemoved() ) ); - if ( !action->inherits( TQACTIONGROUP_OBJECT_NAME_STRING ) || ( (TQActionGroup*)action )->usesDropDown()) { + TQObject::disconnect( action, TQ_SIGNAL( destroyed() ), popup, TQ_SLOT( actionRemoved() ) ); + if ( !action->inherits( "TQActionGroup" ) || ( (TQActionGroup*)action )->usesDropDown()) { action->removeEventFilter( popup ); } else { TQObjectList clo = action->childrenListObject(); @@ -1726,7 +1726,7 @@ void AddActionToPopupCommand::unexecute() while ( it.current() ) { TQObject *o = it.current(); ++it; - if ( !o->inherits( TQACTION_OBJECT_NAME_STRING ) ) + if ( !o->inherits( "TQAction" ) ) continue; if ( o->inherits( "QDesignerAction" ) ) { o->removeEventFilter( popup ); @@ -1749,10 +1749,10 @@ void AddMenuCommand::execute() if ( !popup ) { TQString n = "PopupMenu"; popup = new QDesignerPopupMenu( mainWindow ); - formWindow()->unify( TQT_TQOBJECT(popup), n, true ); - popup->setName( n ); + formWindow()->unify( popup, n, true ); + popup->setName( n.utf8() ); } - if ( !mainWindow->child( 0, TQMENUBAR_OBJECT_NAME_STRING ) ) { + if ( !mainWindow->child( 0, "TQMenuBar" ) ) { menuBar = new QDesignerMenuBar( (TQWidget*)mainWindow ); menuBar->setName( "menubar" ); } else { @@ -1762,7 +1762,7 @@ void AddMenuCommand::execute() id = mainWindow->menuBar()->insertItem( name, popup ); else id = mainWindow->menuBar()->insertItem( name, popup, id, index ); - formWindow()->killAccels( TQT_TQOBJECT(formWindow()) ); + formWindow()->killAccels( formWindow() ); } void AddMenuCommand::unexecute() @@ -1770,7 +1770,7 @@ void AddMenuCommand::unexecute() if ( !popup || !menuBar ) return; menuBar->removeItem( id ); - formWindow()->killAccels( TQT_TQOBJECT(formWindow()) ); + formWindow()->killAccels( formWindow() ); } // ------------------------------------------------------------ @@ -1784,13 +1784,13 @@ RenameMenuCommand::RenameMenuCommand( const TQString &n, FormWindow *fw, QDesign void RenameMenuCommand::execute() { menuBar->changeItem( id, newName ); - formWindow()->killAccels( TQT_TQOBJECT(formWindow()) ); + formWindow()->killAccels( formWindow() ); } void RenameMenuCommand::unexecute() { menuBar->changeItem( id, oldName ); - formWindow()->killAccels( TQT_TQOBJECT(formWindow()) ); + formWindow()->killAccels( formWindow() ); } // ------------------------------------------------------------ @@ -1805,14 +1805,14 @@ void MoveMenuCommand::execute() { menuBar->removeItem( menuBar->idAt( fromIdx ) ); menuBar->insertItem( text, popup, -1, toIdx ); - formWindow()->killAccels( TQT_TQOBJECT(formWindow()) ); + formWindow()->killAccels( formWindow() ); } void MoveMenuCommand::unexecute() { menuBar->removeItem( menuBar->idAt( toIdx ) ); menuBar->insertItem( text, popup, -1, fromIdx ); - formWindow()->killAccels( TQT_TQOBJECT(formWindow()) ); + formWindow()->killAccels( formWindow() ); } // ------------------------------------------------------------ @@ -1827,8 +1827,8 @@ void AddToolBarCommand::execute() if ( !toolBar ) { toolBar = new QDesignerToolBar( mainWindow ); TQString n = "Toolbar"; - formWindow()->unify( TQT_TQOBJECT(toolBar), n, true ); - toolBar->setName( n ); + formWindow()->unify( toolBar, n, true ); + toolBar->setName( n.utf8() ); mainWindow->addToolBar( toolBar, n ); } else { toolBar->show(); |