diff options
Diffstat (limited to 'kdevdesigner/designer/command.cpp')
-rw-r--r-- | kdevdesigner/designer/command.cpp | 574 |
1 files changed, 287 insertions, 287 deletions
diff --git a/kdevdesigner/designer/command.cpp b/kdevdesigner/designer/command.cpp index 83ec9a77..8e46c2e1 100644 --- a/kdevdesigner/designer/command.cpp +++ b/kdevdesigner/designer/command.cpp @@ -39,22 +39,22 @@ #include "menubareditor.h" #include "popupmenueditor.h" -#include <qfeatures.h> -#include <qwidget.h> -#include <qmetaobject.h> -#include <qapplication.h> -#include <qlayout.h> -#include <qmessagebox.h> -#include <qlistbox.h> -#include <qiconview.h> -#include <qtextedit.h> -#include <qptrstack.h> -#include <qheader.h> -#include <qsplitter.h> +#include <tqfeatures.h> +#include <tqwidget.h> +#include <tqmetaobject.h> +#include <tqapplication.h> +#include <tqlayout.h> +#include <tqmessagebox.h> +#include <tqlistbox.h> +#include <tqiconview.h> +#include <tqtextedit.h> +#include <tqptrstack.h> +#include <tqheader.h> +#include <tqsplitter.h> #ifndef QT_NO_TABLE -#include <qtable.h> +#include <tqtable.h> #endif -#include <qaction.h> +#include <tqaction.h> #include "kdevdesigner_part.h" @@ -93,7 +93,7 @@ void CommandHistory::addCommand( Command *cmd, bool tryCompress ) if ( current < savedAt ) savedAt = -2; - QPtrList<Command> commands; + TQPtrList<Command> commands; commands.setAutoDelete( FALSE ); for( int i = 0; i <= current; ++i ) { @@ -165,11 +165,11 @@ void CommandHistory::emitUndoRedo() redoCmd = history.at( current + 1 ); bool ua = (undoCmd != 0); - QString uc; + TQString uc; if ( ua ) uc = undoCmd->name(); bool ra = (redoCmd != 0); - QString rc; + TQString rc; if ( ra ) rc = redoCmd->name(); emit undoRedoChanged( ua, ra, uc, rc ); @@ -203,7 +203,7 @@ void CommandHistory::checkCompressedCommand() // ------------------------------------------------------------ -Command::Command( const QString &n, FormWindow *fw ) +Command::Command( const TQString &n, FormWindow *fw ) : cmdName( n ), formWin( fw ) { } @@ -212,7 +212,7 @@ Command::~Command() { } -QString Command::name() const +TQString Command::name() const { return cmdName; } @@ -233,8 +233,8 @@ bool Command::canMerge( Command * ) // ------------------------------------------------------------ -ResizeCommand::ResizeCommand( const QString &n, FormWindow *fw, - QWidget *w, const QRect &oldr, const QRect &nr ) +ResizeCommand::ResizeCommand( const TQString &n, FormWindow *fw, + TQWidget *w, const TQRect &oldr, const TQRect &nr ) : Command( n, fw ), widget( w ), oldRect( oldr ), newRect( nr ) { } @@ -259,21 +259,21 @@ void ResizeCommand::unexecute() // ------------------------------------------------------------ -InsertCommand::InsertCommand( const QString &n, FormWindow *fw, - QWidget *w, const QRect &g ) +InsertCommand::InsertCommand( const TQString &n, FormWindow *fw, + TQWidget *w, const TQRect &g ) : Command( n, fw ), widget( w ), geometry( g ) { } void InsertCommand::execute() { - if ( geometry.size() == QSize( 0, 0 ) ) { + if ( geometry.size() == TQSize( 0, 0 ) ) { widget->move( geometry.topLeft() ); widget->adjustSize(); } else { - QSize s = geometry.size().expandedTo( widget->minimumSize() ); + TQSize s = geometry.size().expandedTo( widget->minimumSize() ); s = s.expandedTo( widget->minimumSizeHint() ); - QRect r( geometry.topLeft(), s ); + TQRect r( geometry.topLeft(), s ); widget->setGeometry( r ); } widget->show(); @@ -293,11 +293,11 @@ void InsertCommand::unexecute() // ------------------------------------------------------------ -MoveCommand::MoveCommand( const QString &n, FormWindow *fw, - const QWidgetList &w, - const QValueList<QPoint> op, - const QValueList<QPoint> np, - QWidget *opr, QWidget *npr ) +MoveCommand::MoveCommand( const TQString &n, FormWindow *fw, + const TQWidgetList &w, + const TQValueList<TQPoint> op, + const TQValueList<TQPoint> np, + TQWidget *opr, TQWidget *npr ) : Command( n, fw ), widgets( w ), oldPos( op ), newPos( np ), oldParent( opr ), newParent( npr ) { @@ -319,10 +319,10 @@ bool MoveCommand::canMerge( Command *c ) void MoveCommand::execute() { - for ( QWidget *w = widgets.first(); w; w = widgets.next() ) { + for ( TQWidget *w = widgets.first(); w; w = widgets.next() ) { if ( !w->parentWidget() || WidgetFactory::layoutType( w->parentWidget() ) == WidgetFactory::NoLayout ) { if ( newParent && oldParent && newParent != oldParent ) { - QPoint pos = newParent->mapFromGlobal( w->mapToGlobal( QPoint( 0,0 ) ) ); + TQPoint pos = newParent->mapFromGlobal( w->mapToGlobal( TQPoint( 0,0 ) ) ); w->reparent( newParent, pos, TRUE ); formWindow()->raiseSelection( w ); formWindow()->raiseChildSelections( w ); @@ -340,10 +340,10 @@ void MoveCommand::execute() void MoveCommand::unexecute() { - for ( QWidget *w = widgets.first(); w; w = widgets.next() ) { + for ( TQWidget *w = widgets.first(); w; w = widgets.next() ) { if ( !w->parentWidget() || WidgetFactory::layoutType( w->parentWidget() ) == WidgetFactory::NoLayout ) { if ( newParent && oldParent && newParent != oldParent ) { - QPoint pos = oldParent->mapFromGlobal( w->mapToGlobal( QPoint( 0,0 ) ) ); + TQPoint pos = oldParent->mapFromGlobal( w->mapToGlobal( TQPoint( 0,0 ) ) ); w->reparent( oldParent, pos, TRUE ); formWindow()->raiseSelection( w ); formWindow()->raiseChildSelections( w ); @@ -361,18 +361,18 @@ void MoveCommand::unexecute() // ------------------------------------------------------------ -DeleteCommand::DeleteCommand( const QString &n, FormWindow *fw, - const QWidgetList &wl ) +DeleteCommand::DeleteCommand( const TQString &n, FormWindow *fw, + const TQWidgetList &wl ) : Command( n, fw ), widgets( wl ) { widgets.setAutoDelete( FALSE ); - QWidgetList copyOfWidgets = widgets; + TQWidgetList copyOfWidgets = widgets; copyOfWidgets.setAutoDelete(FALSE); // Include the children of the selected items when deleting - for ( QWidget *w = widgets.first(); w; w = widgets.next() ) { - QObjectList *children = w->queryList( "QWidget" ); - for ( QWidget *c = (QWidget *)children->first(); c; c = (QWidget *)children->next() ) { + for ( TQWidget *w = widgets.first(); w; w = widgets.next() ) { + TQObjectList *children = w->queryList( "TQWidget" ); + for ( TQWidget *c = (TQWidget *)children->first(); c; c = (TQWidget *)children->next() ) { if ( copyOfWidgets.find( c ) == -1 && formWindow()->widgets()->find( c ) ) { widgets.insert(widgets.at() + 1, c); widgets.prev(); @@ -387,16 +387,16 @@ void DeleteCommand::execute() { formWindow()->setPropertyShowingBlocked( TRUE ); connections.clear(); - for ( QWidget *w = widgets.first(); w; w = widgets.next() ) { + for ( TQWidget *w = widgets.first(); w; w = widgets.next() ) { w->hide(); - QString s = w->name(); + TQString s = w->name(); s.prepend( "qt_dead_widget_" ); w->setName( s ); formWindow()->selectWidget( w, FALSE ); formWindow()->widgets()->remove( w ); - QValueList<MetaDataBase::Connection> conns = MetaDataBase::connections( formWindow(), w ); + TQValueList<MetaDataBase::Connection> conns = MetaDataBase::connections( formWindow(), w ); connections.insert( w, conns ); - QValueList<MetaDataBase::Connection>::Iterator it = conns.begin(); + TQValueList<MetaDataBase::Connection>::Iterator it = conns.begin(); for ( ; it != conns.end(); ++it ) { MetaDataBase::removeConnection( formWindow(), (*it).sender, (*it).signal, (*it).receiver, (*it).slot ); @@ -412,15 +412,15 @@ void DeleteCommand::unexecute() { formWindow()->setPropertyShowingBlocked( TRUE ); formWindow()->clearSelection( FALSE ); - for ( QWidget *w = widgets.first(); w; w = widgets.next() ) { + for ( TQWidget *w = widgets.first(); w; w = widgets.next() ) { w->show(); - QString s = w->name(); - s.remove( 0, QString( "qt_dead_widget_" ).length() ); + TQString s = w->name(); + s.remove( 0, TQString( "qt_dead_widget_" ).length() ); w->setName( s ); formWindow()->widgets()->insert( w, w ); formWindow()->selectWidget( w ); - QValueList<MetaDataBase::Connection> conns = *connections.find( w ); - QValueList<MetaDataBase::Connection>::Iterator it = conns.begin(); + TQValueList<MetaDataBase::Connection> conns = *connections.find( w ); + TQValueList<MetaDataBase::Connection>::Iterator it = conns.begin(); for ( ; it != conns.end(); ++it ) { MetaDataBase::addConnection( formWindow(), (*it).sender, (*it).signal, (*it).receiver, (*it).slot ); @@ -433,11 +433,11 @@ void DeleteCommand::unexecute() // ------------------------------------------------------------ -SetPropertyCommand::SetPropertyCommand( const QString &n, FormWindow *fw, - QObject *w, PropertyEditor *e, - const QString &pn, const QVariant &ov, - const QVariant &nv, const QString &ncut, - const QString &ocut, bool reset ) +SetPropertyCommand::SetPropertyCommand( const TQString &n, FormWindow *fw, + TQObject *w, PropertyEditor *e, + const TQString &pn, const TQVariant &ov, + const TQVariant &nv, const TQString &ncut, + const TQString &ocut, bool reset ) : Command( n, fw ), widget( w ), editor( e ), propName( pn ), oldValue( ov ), newValue( nv ), oldCurrentItemText( ocut ), newCurrentItemText( ncut ), wasChanged( TRUE ), isResetCommand( reset ) @@ -457,8 +457,8 @@ void SetPropertyCommand::execute() if ( isResetCommand ) { MetaDataBase::setPropertyChanged( widget, propName, FALSE ); if ( WidgetFactory::resetProperty( widget, propName ) ) { - if ( !formWindow()->isWidgetSelected( widget ) && formWindow() != (QObject *)widget ) - formWindow()->selectWidget( (QObject *)widget ); + if ( !formWindow()->isWidgetSelected( widget ) && formWindow() != (TQObject *)widget ) + formWindow()->selectWidget( (TQObject *)widget ); if ( editor->widget() != widget ) editor->setWidget( widget, formWindow() ); editor->propertyList()->setCurrentProperty( propName ); @@ -489,17 +489,17 @@ bool SetPropertyCommand::canMerge( Command *c ) SetPropertyCommand *cmd = (SetPropertyCommand*)c; if ( !widget ) return FALSE; - const QMetaProperty *p = + const TQMetaProperty *p = widget->metaObject()->property( widget->metaObject()->findProperty( propName, TRUE ), TRUE ); if ( !p ) { if ( propName == "toolTip" || propName == "whatsThis" ) return TRUE; - if ( ::qt_cast<CustomWidget*>((QObject *)widget) ) { - MetaDataBase::CustomWidget *cw = ((CustomWidget*)(QObject*)widget)->customWidget(); + if ( ::qt_cast<CustomWidget*>((TQObject *)widget) ) { + MetaDataBase::CustomWidget *cw = ((CustomWidget*)(TQObject*)widget)->customWidget(); if ( !cw ) return FALSE; - for ( QValueList<MetaDataBase::Property>::Iterator it = cw->lstProperties.begin(); it != cw->lstProperties.end(); ++it ) { - if ( QString( (*it ).property ) == propName ) { + for ( TQValueList<MetaDataBase::Property>::Iterator it = cw->lstProperties.begin(); it != cw->lstProperties.end(); ++it ) { + if ( TQString( (*it ).property ) == propName ) { if ( (*it).type == "String" || (*it).type == "CString" || (*it).type == "Int" || (*it).type == "UInt" ) return TRUE; } @@ -507,9 +507,9 @@ bool SetPropertyCommand::canMerge( Command *c ) } return FALSE; } - QVariant::Type t = QVariant::nameToType( p->type() ); + TQVariant::Type t = TQVariant::nameToType( p->type() ); return ( cmd->propName == propName && - t == QVariant::String || t == QVariant::CString || t == QVariant::Int || t == QVariant::UInt ); + t == TQVariant::String || t == TQVariant::CString || t == TQVariant::Int || t == TQVariant::UInt ); } void SetPropertyCommand::merge( Command *c ) @@ -522,9 +522,9 @@ void SetPropertyCommand::merge( Command *c ) bool SetPropertyCommand::checkProperty() { if ( propName == "name" /*|| propName == "itemName"*/ ) { // ### fix that - QString s = newValue.toString(); + TQString s = newValue.toString(); if ( !formWindow()->unify( widget, s, FALSE ) ) { - QMessageBox::information( formWindow()->mainWindow(), + TQMessageBox::information( formWindow()->mainWindow(), i18n( "Set 'name' Property" ), i18n( "The name of a widget must be unique.\n" "'%1' is already used in form '%2',\n" @@ -536,7 +536,7 @@ bool SetPropertyCommand::checkProperty() return FALSE; } if ( s.isEmpty() ) { - QMessageBox::information( formWindow()->mainWindow(), + TQMessageBox::information( formWindow()->mainWindow(), i18n( "Set 'name' Property" ), i18n( "The name of a widget must not be null.\n" "The name has been reverted to '%1'." ). @@ -546,12 +546,12 @@ bool SetPropertyCommand::checkProperty() } if ( ::qt_cast<FormWindow*>(widget->parent()) ) - formWindow()->mainWindow()->formNameChanged( (FormWindow*)((QWidget*)(QObject*)widget)->parentWidget() ); + formWindow()->mainWindow()->formNameChanged( (FormWindow*)((TQWidget*)(TQObject*)widget)->parentWidget() ); } return TRUE; } -void SetPropertyCommand::setProperty( const QVariant &v, const QString ¤tItemText, bool select ) +void SetPropertyCommand::setProperty( const TQVariant &v, const TQString ¤tItemText, bool select ) { if ( !widget ) return; @@ -562,7 +562,7 @@ void SetPropertyCommand::setProperty( const QVariant &v, const QString ¤tI editor->setWidget( widget, formWindow() ); if ( select ) editor->propertyList()->setCurrentProperty( propName ); - const QMetaProperty *p = + const TQMetaProperty *p = widget->metaObject()->property( widget->metaObject()->findProperty( propName, TRUE ), TRUE ); if ( !p ) { if ( propName == "hAlign" ) { @@ -570,35 +570,35 @@ void SetPropertyCommand::setProperty( const QVariant &v, const QString ¤tI int align = widget->property( "alignment" ).toInt(); align &= ~( AlignHorizontal_Mask ); align |= p->keyToValue( currentItemText ); - widget->setProperty( "alignment", QVariant( align ) ); + 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 ); - widget->setProperty( "alignment", QVariant( align ) ); + widget->setProperty( "alignment", TQVariant( align ) ); } else if ( propName == "wordwrap" ) { int align = widget->property( "alignment" ).toInt(); align &= ~WordBreak; if ( v.toBool() ) align |= WordBreak; - widget->setProperty( "alignment", QVariant( align ) ); + widget->setProperty( "alignment", TQVariant( align ) ); } else if ( propName == "layoutSpacing" ) { - QVariant val = v; + TQVariant val = v; if ( val.toString() == "default" ) val = -1; - MetaDataBase::setSpacing( WidgetFactory::containerOfWidget( (QWidget*)editor->widget() ), val.toInt() ); + MetaDataBase::setSpacing( WidgetFactory::containerOfWidget( (TQWidget*)editor->widget() ), val.toInt() ); } else if ( propName == "layoutMargin" ) { - QVariant val = v; + TQVariant val = v; if ( val.toString() == "default" ) val = -1; - MetaDataBase::setMargin( WidgetFactory::containerOfWidget( (QWidget*)editor->widget() ), val.toInt() ); + MetaDataBase::setMargin( WidgetFactory::containerOfWidget( (TQWidget*)editor->widget() ), val.toInt() ); } else if ( propName == "resizeMode" ) { - MetaDataBase::setResizeMode( WidgetFactory::containerOfWidget( (QWidget*)editor->widget() ), currentItemText ); + MetaDataBase::setResizeMode( WidgetFactory::containerOfWidget( (TQWidget*)editor->widget() ), currentItemText ); } else if ( propName == "toolTip" || propName == "whatsThis" || propName == "database" || propName == "frameworkCode" ) { MetaDataBase::setFakeProperty( editor->widget(), propName, v ); } else if ( ::qt_cast<CustomWidget*>(editor->widget()) ) { - MetaDataBase::CustomWidget *cw = ((CustomWidget *)(QObject *)widget)->customWidget(); + MetaDataBase::CustomWidget *cw = ((CustomWidget *)(TQObject *)widget)->customWidget(); if ( cw ) { MetaDataBase::setFakeProperty( editor->widget(), propName, v ); } @@ -608,16 +608,16 @@ void SetPropertyCommand::setProperty( const QVariant &v, const QString ¤tI ( ( PropertyItem* )editor->propertyList()->currentItem() )->setChanged( MetaDataBase::isPropertyChanged( widget, propName ) ); #ifndef QT_NO_SQL if ( propName == "database" ) { - formWindow()->mainWindow()->objectHierarchy()->databasePropertyChanged( (QWidget*)((QObject *)widget), MetaDataBase::fakeProperty( widget, "database" ).toStringList() ); + formWindow()->mainWindow()->objectHierarchy()->databasePropertyChanged( (TQWidget*)((TQObject *)widget), MetaDataBase::fakeProperty( widget, "database" ).toStringList() ); } #endif return; } if ( p->isSetType() ) { - QStrList strlst; - QStringList lst = QStringList::split( "|", currentItemText ); - QValueListConstIterator<QString> it = lst.begin(); + TQStrList strlst; + TQStringList lst = TQStringList::split( "|", currentItemText ); + TQValueListConstIterator<TQString> it = lst.begin(); for ( ; it != lst.end(); ++it ) strlst.append( (*it).latin1() ); widget->setProperty( propName, p->keysToValue( strlst ) ); @@ -626,11 +626,11 @@ void SetPropertyCommand::setProperty( const QVariant &v, const QString ¤tI } else if ( qstrcmp( p->name(), "buddy" ) == 0 ) { widget->setProperty( propName, currentItemText ); } else { - QVariant ov; + TQVariant ov; if ( propName == "name" || propName == "itemName" ) ov = widget->property( propName ); int oldSerNum = -1; - if ( v.type() == QVariant::Pixmap ) + if ( v.type() == TQVariant::Pixmap ) oldSerNum = v.toPixmap().serialNumber(); widget->setProperty( propName, v ); if ( oldSerNum != -1 && oldSerNum != widget->property( propName ).toPixmap().serialNumber() ) @@ -638,18 +638,18 @@ void SetPropertyCommand::setProperty( const QVariant &v, const QString ¤tI widget->property( propName ).toPixmap().serialNumber(), MetaDataBase::pixmapKey( formWindow(), oldSerNum ) ); if ( propName == "cursor" ) { - MetaDataBase::setCursor( (QWidget*)((QObject *)widget), v.toCursor() ); + MetaDataBase::setCursor( (TQWidget*)((TQObject *)widget), v.toCursor() ); } if ( propName == "name" && widget->isWidgetType() ) { - formWindow()->mainWindow()->objectHierarchy()->namePropertyChanged( ((QWidget*)(QObject *)widget), ov ); + formWindow()->mainWindow()->objectHierarchy()->namePropertyChanged( ((TQWidget*)(TQObject *)widget), ov ); if ( formWindow()->isMainContainer( widget ) ) formWindow()->setName( v.toCString() ); } - if ( propName == "name" && ::qt_cast<QAction*>((QObject *)widget) && ::qt_cast<QMainWindow*>(formWindow()->mainContainer()) ) { - formWindow()->mainWindow()->actioneditor()->updateActionName( (QAction*)(QObject *)widget ); + if ( propName == "name" && ::qt_cast<TQAction*>((TQObject *)widget) && ::qt_cast<TQMainWindow*>(formWindow()->mainContainer()) ) { + formWindow()->mainWindow()->actioneditor()->updateActionName( (TQAction*)(TQObject *)widget ); } - if ( propName == "iconSet" && ::qt_cast<QAction*>((QObject *)widget) && ::qt_cast<QMainWindow*>(formWindow()->mainContainer()) ) { - formWindow()->mainWindow()->actioneditor()->updateActionIcon( (QAction*)(QObject *)widget ); + if ( propName == "iconSet" && ::qt_cast<TQAction*>((TQObject *)widget) && ::qt_cast<TQMainWindow*>(formWindow()->mainContainer()) ) { + formWindow()->mainWindow()->actioneditor()->updateActionIcon( (TQAction*)(TQObject *)widget ); } if ( propName == "caption" ) { if ( formWindow()->isMainContainer( widget ) ) @@ -671,9 +671,9 @@ void SetPropertyCommand::setProperty( const QVariant &v, const QString ¤tI // ------------------------------------------------------------ -LayoutHorizontalCommand::LayoutHorizontalCommand( const QString &n, FormWindow *fw, - QWidget *parent, QWidget *layoutBase, - const QWidgetList &wl ) +LayoutHorizontalCommand::LayoutHorizontalCommand( const TQString &n, FormWindow *fw, + TQWidget *parent, TQWidget *layoutBase, + const TQWidgetList &wl ) : Command( n, fw ), layout( wl, parent, fw, layoutBase ) { } @@ -694,9 +694,9 @@ void LayoutHorizontalCommand::unexecute() // ------------------------------------------------------------ -LayoutHorizontalSplitCommand::LayoutHorizontalSplitCommand( const QString &n, FormWindow *fw, - QWidget *parent, QWidget *layoutBase, - const QWidgetList &wl ) +LayoutHorizontalSplitCommand::LayoutHorizontalSplitCommand( const TQString &n, FormWindow *fw, + TQWidget *parent, TQWidget *layoutBase, + const TQWidgetList &wl ) : Command( n, fw ), layout( wl, parent, fw, layoutBase, TRUE, TRUE ) { } @@ -717,9 +717,9 @@ void LayoutHorizontalSplitCommand::unexecute() // ------------------------------------------------------------ -LayoutVerticalCommand::LayoutVerticalCommand( const QString &n, FormWindow *fw, - QWidget *parent, QWidget *layoutBase, - const QWidgetList &wl ) +LayoutVerticalCommand::LayoutVerticalCommand( const TQString &n, FormWindow *fw, + TQWidget *parent, TQWidget *layoutBase, + const TQWidgetList &wl ) : Command( n, fw ), layout( wl, parent, fw, layoutBase ) { } @@ -740,9 +740,9 @@ void LayoutVerticalCommand::unexecute() // ------------------------------------------------------------ -LayoutVerticalSplitCommand::LayoutVerticalSplitCommand( const QString &n, FormWindow *fw, - QWidget *parent, QWidget *layoutBase, - const QWidgetList &wl ) +LayoutVerticalSplitCommand::LayoutVerticalSplitCommand( const TQString &n, FormWindow *fw, + TQWidget *parent, TQWidget *layoutBase, + const TQWidgetList &wl ) : Command( n, fw ), layout( wl, parent, fw, layoutBase, TRUE, TRUE ) { } @@ -763,10 +763,10 @@ void LayoutVerticalSplitCommand::unexecute() // ------------------------------------------------------------ -LayoutGridCommand::LayoutGridCommand( const QString &n, FormWindow *fw, - QWidget *parent, QWidget *layoutBase, - const QWidgetList &wl, int xres, int yres ) - : Command( n, fw ), layout( wl, parent, fw, layoutBase, QSize( QMAX(5,xres), QMAX(5,yres) ) ) +LayoutGridCommand::LayoutGridCommand( const TQString &n, FormWindow *fw, + TQWidget *parent, TQWidget *layoutBase, + const TQWidgetList &wl, int xres, int yres ) + : Command( n, fw ), layout( wl, parent, fw, layoutBase, TQSize( QMAX(5,xres), QMAX(5,yres) ) ) { } @@ -786,8 +786,8 @@ void LayoutGridCommand::unexecute() // ------------------------------------------------------------ -BreakLayoutCommand::BreakLayoutCommand( const QString &n, FormWindow *fw, - QWidget *layoutBase, const QWidgetList &wl ) +BreakLayoutCommand::BreakLayoutCommand( const TQString &n, FormWindow *fw, + TQWidget *layoutBase, const TQWidgetList &wl ) : Command( n, fw ), lb( layoutBase ), widgets( wl ) { WidgetFactory::LayoutType lay = WidgetFactory::layoutType( layoutBase ); @@ -795,11 +795,11 @@ BreakLayoutCommand::BreakLayoutCommand( const QString &n, FormWindow *fw, margin = MetaDataBase::margin( layoutBase ); layout = 0; if ( lay == WidgetFactory::HBox ) - layout = new HorizontalLayout( wl, layoutBase, fw, layoutBase, FALSE, ::qt_cast<QSplitter*>(layoutBase) != 0 ); + layout = new HorizontalLayout( wl, layoutBase, fw, layoutBase, FALSE, ::qt_cast<TQSplitter*>(layoutBase) != 0 ); else if ( lay == WidgetFactory::VBox ) - layout = new VerticalLayout( wl, layoutBase, fw, layoutBase, FALSE, ::qt_cast<QSplitter*>(layoutBase) != 0 ); + layout = new VerticalLayout( wl, layoutBase, fw, layoutBase, FALSE, ::qt_cast<TQSplitter*>(layoutBase) != 0 ); else if ( lay == WidgetFactory::Grid ) - layout = new GridLayout( wl, layoutBase, fw, layoutBase, QSize( QMAX( 5, fw->grid().x()), QMAX( 5, fw->grid().y()) ), FALSE ); + layout = new GridLayout( wl, layoutBase, fw, layoutBase, TQSize( QMAX( 5, fw->grid().x()), QMAX( 5, fw->grid().y()) ), FALSE ); } void BreakLayoutCommand::execute() @@ -809,7 +809,7 @@ void BreakLayoutCommand::execute() formWindow()->clearSelection( FALSE ); layout->breakLayout(); formWindow()->mainWindow()->objectHierarchy()->rebuild(); - for ( QWidget *w = widgets.first(); w; w = widgets.next() ) + for ( TQWidget *w = widgets.first(); w; w = widgets.next() ) w->resize( QMAX( 16, w->width() ), QMAX( 16, w->height() ) ); } @@ -826,8 +826,8 @@ void BreakLayoutCommand::unexecute() // ------------------------------------------------------------ -MacroCommand::MacroCommand( const QString &n, FormWindow *fw, - const QPtrList<Command> &cmds ) +MacroCommand::MacroCommand( const TQString &n, FormWindow *fw, + const TQPtrList<Command> &cmds ) : Command( n, fw ), commands( cmds ) { } @@ -846,8 +846,8 @@ void MacroCommand::unexecute() // ------------------------------------------------------------ -AddTabPageCommand::AddTabPageCommand( const QString &n, FormWindow *fw, - QTabWidget *tw, const QString &label ) +AddTabPageCommand::AddTabPageCommand( const TQString &n, FormWindow *fw, + TQTabWidget *tw, const TQString &label ) : Command( n, fw ), tabWidget( tw ), tabLabel( label ) { tabPage = new QDesignerWidget( formWindow(), tabWidget, "TabPage" ); @@ -876,8 +876,8 @@ void AddTabPageCommand::unexecute() // ------------------------------------------------------------ -MoveTabPageCommand::MoveTabPageCommand( const QString &n, FormWindow *fw, - QTabWidget *tw, QWidget* page, const QString& label, int nIndex, int oIndex ) +MoveTabPageCommand::MoveTabPageCommand( const TQString &n, FormWindow *fw, + TQTabWidget *tw, TQWidget* page, const TQString& label, int nIndex, int oIndex ) : Command( n, fw ), tabWidget( tw ), tabPage( page ), tabLabel( label ) { newIndex = nIndex; @@ -904,8 +904,8 @@ void MoveTabPageCommand::unexecute() // ------------------------------------------------------------ -DeleteTabPageCommand::DeleteTabPageCommand( const QString &n, FormWindow *fw, - QTabWidget *tw, QWidget *page ) +DeleteTabPageCommand::DeleteTabPageCommand( const TQString &n, FormWindow *fw, + TQTabWidget *tw, TQWidget *page ) : Command( n, fw ), tabWidget( tw ), tabPage( page ) { tabLabel = ( (QDesignerTabWidget*)tabWidget )->pageTitle(); @@ -930,7 +930,7 @@ void DeleteTabPageCommand::unexecute() // ------------------------------------------------------------ -AddWidgetStackPageCommand::AddWidgetStackPageCommand( const QString &n, FormWindow *fw, +AddWidgetStackPageCommand::AddWidgetStackPageCommand( const TQString &n, FormWindow *fw, QDesignerWidgetStack *ws ) : Command( n, fw ), widgetStack( ws ) { @@ -955,8 +955,8 @@ void AddWidgetStackPageCommand::unexecute() formWindow()->mainWindow()->objectHierarchy()->tabsChanged( 0 ); } -DeleteWidgetStackPageCommand::DeleteWidgetStackPageCommand( const QString &n, FormWindow *fw, - QDesignerWidgetStack *ws, QWidget *page ) +DeleteWidgetStackPageCommand::DeleteWidgetStackPageCommand( const TQString &n, FormWindow *fw, + QDesignerWidgetStack *ws, TQWidget *page ) : Command( n, fw), widgetStack( ws ), stackPage( page ) { index = -1; @@ -980,8 +980,8 @@ void DeleteWidgetStackPageCommand::unexecute() // ------------------------------------------------------------ -AddWizardPageCommand::AddWizardPageCommand( const QString &n, FormWindow *fw, - QWizard *w, const QString &label, int i, bool s ) +AddWizardPageCommand::AddWizardPageCommand( const TQString &n, FormWindow *fw, + TQWizard *w, const TQString &label, int i, bool s ) : Command( n, fw ), wizard( w ), pageLabel( label ) { page = new QDesignerWidget( formWindow(), wizard, "WizardPage" ); @@ -1012,8 +1012,8 @@ void AddWizardPageCommand::unexecute() // ------------------------------------------------------------ -DeleteWizardPageCommand::DeleteWizardPageCommand( const QString &n, FormWindow *fw, - QWizard *w, int i, bool s ) +DeleteWizardPageCommand::DeleteWizardPageCommand( const TQString &n, FormWindow *fw, + TQWizard *w, int i, bool s ) : Command( n, fw ), wizard( w ), index( i ) { show = s; @@ -1040,8 +1040,8 @@ void DeleteWizardPageCommand::unexecute() // ------------------------------------------------------------ -RenameWizardPageCommand::RenameWizardPageCommand( const QString &n, FormWindow *fw, - QWizard *w, int i, const QString& name ) +RenameWizardPageCommand::RenameWizardPageCommand( const TQString &n, FormWindow *fw, + TQWizard *w, int i, const TQString& name ) : Command( n, fw ), wizard( w ), index( i ), label( name ) { @@ -1050,7 +1050,7 @@ RenameWizardPageCommand::RenameWizardPageCommand( const QString &n, FormWindow * void RenameWizardPageCommand::execute() { page = wizard->page( index ); - QString oldLabel = wizard->title( page ); + TQString oldLabel = wizard->title( page ); wizard->setTitle( page, label ); label = oldLabel; @@ -1064,17 +1064,17 @@ void RenameWizardPageCommand::unexecute() // ------------------------------------------------------------ -SwapWizardPagesCommand::SwapWizardPagesCommand( const QString &n, FormWindow *fw, QWizard *w, int i1, int i2 ) +SwapWizardPagesCommand::SwapWizardPagesCommand( const TQString &n, FormWindow *fw, TQWizard *w, int i1, int i2 ) : Command( n, fw ), wizard( w ), index1( i1 ), index2( i2 ) { } void SwapWizardPagesCommand::execute() { - QWidget *page1 = wizard->page( index1 ); - QWidget *page2 = wizard->page( index2 ); - QString page1Label = wizard->title( page1 ); - QString page2Label = wizard->title( page2 ); + TQWidget *page1 = wizard->page( index1 ); + TQWidget *page2 = wizard->page( index2 ); + TQString page1Label = wizard->title( page1 ); + TQString page2Label = wizard->title( page2 ); wizard->removePage( page1 ); wizard->removePage( page2 ); wizard->insertPage( page1, page1Label, index2 ); @@ -1090,15 +1090,15 @@ void SwapWizardPagesCommand::unexecute() // ------------------------------------------------------------ -MoveWizardPageCommand::MoveWizardPageCommand( const QString &n, FormWindow *fw, QWizard *w, int i1, int i2 ) +MoveWizardPageCommand::MoveWizardPageCommand( const TQString &n, FormWindow *fw, TQWizard *w, int i1, int i2 ) : Command( n, fw ), wizard( w ), index1( i1 ), index2( i2 ) { } void MoveWizardPageCommand::execute() { - QWidget *page = wizard->page( index1 ); - QString pageLabel = wizard->title( page ); + TQWidget *page = wizard->page( index1 ); + TQString pageLabel = wizard->title( page ); wizard->removePage( page ); wizard->insertPage( page, pageLabel, index2 ); formWindow()->emitUpdateProperties( formWindow()->currentWidget() ); @@ -1108,8 +1108,8 @@ void MoveWizardPageCommand::execute() void MoveWizardPageCommand::unexecute() { // ###FIX: index1 may be the wrong place - QWidget *page = wizard->page( index2 ); - QString pageLabel = wizard->title( page ); + TQWidget *page = wizard->page( index2 ); + TQString pageLabel = wizard->title( page ); wizard->removePage( page ); wizard->insertPage( page, pageLabel, index1 ); formWindow()->emitUpdateProperties( formWindow()->currentWidget() ); @@ -1118,7 +1118,7 @@ void MoveWizardPageCommand::unexecute() // ------------------------------------------------------------ -AddConnectionCommand::AddConnectionCommand( const QString &name, FormWindow *fw, +AddConnectionCommand::AddConnectionCommand( const TQString &name, FormWindow *fw, MetaDataBase::Connection c ) : Command( name, fw ), connection( c ) { @@ -1142,7 +1142,7 @@ void AddConnectionCommand::unexecute() // ------------------------------------------------------------ -RemoveConnectionCommand::RemoveConnectionCommand( const QString &name, FormWindow *fw, +RemoveConnectionCommand::RemoveConnectionCommand( const TQString &name, FormWindow *fw, MetaDataBase::Connection c ) : Command( name, fw ), connection( c ) { @@ -1166,9 +1166,9 @@ void RemoveConnectionCommand::unexecute() // ------------------------------------------------------------ -AddFunctionCommand::AddFunctionCommand( const QString &name, FormWindow *fw, const QCString &f, - const QString& spec, const QString &a, const QString &t, - const QString &l, const QString &rt ) +AddFunctionCommand::AddFunctionCommand( const TQString &name, FormWindow *fw, const TQCString &f, + const TQString& spec, const TQString &a, const TQString &t, + const TQString &l, const TQString &rt ) : Command( name, fw ), function( f ), specifier( spec ), access( a ), functionType( t ), language( l ), returnType( rt ) { @@ -1213,10 +1213,10 @@ void AddFunctionCommand::unexecute() // ------------------------------------------------------------ -ChangeFunctionAttribCommand::ChangeFunctionAttribCommand( const QString &name, FormWindow *fw, MetaDataBase::Function f, - const QString &on, const QString &os, - const QString &oa, const QString &ot, const QString &ol, - const QString &ort ) +ChangeFunctionAttribCommand::ChangeFunctionAttribCommand( const TQString &name, FormWindow *fw, MetaDataBase::Function f, + const TQString &on, const TQString &os, + const TQString &oa, const TQString &ot, const TQString &ol, + const TQString &ort ) : Command( name, fw ), oldName( on ), oldSpec( os ), oldAccess( oa ), oldType( ot ), oldLang( ol ), oldReturnType( ort ) { @@ -1284,15 +1284,15 @@ void ChangeFunctionAttribCommand::unexecute() // ------------------------------------------------------------ -RemoveFunctionCommand::RemoveFunctionCommand( const QString &name, FormWindow *fw, const QCString &f, - const QString& spec, const QString &a, const QString &t, - const QString &l, const QString &rt ) +RemoveFunctionCommand::RemoveFunctionCommand( const TQString &name, FormWindow *fw, const TQCString &f, + const TQString& spec, const TQString &a, const TQString &t, + const TQString &l, const TQString &rt ) : Command( name, fw ), function( f ), specifier( spec ), access( a ), functionType( t ), language( l ), returnType( rt ) { if ( spec.isNull() ) { - QValueList<MetaDataBase::Function> lst = MetaDataBase::functionList( fw ); - for ( QValueList<MetaDataBase::Function>::Iterator it = lst.begin(); it != lst.end(); ++it ) { + TQValueList<MetaDataBase::Function> lst = MetaDataBase::functionList( fw ); + for ( TQValueList<MetaDataBase::Function>::Iterator it = lst.begin(); it != lst.end(); ++it ) { if ( MetaDataBase::normalizeFunction( (*it).function ) == MetaDataBase::normalizeFunction( function ) ) { specifier = (*it).specifier; @@ -1347,7 +1347,7 @@ void RemoveFunctionCommand::unexecute() // ------------------------------------------------------------ -AddVariableCommand::AddVariableCommand( const QString &name, FormWindow *fw, const QString &vn, const QString &a ) +AddVariableCommand::AddVariableCommand( const TQString &name, FormWindow *fw, const TQString &vn, const TQString &a ) : Command( name, fw ), varName( vn ), access( a ) { } @@ -1370,8 +1370,8 @@ void AddVariableCommand::unexecute() // ------------------------------------------------------------ -SetVariablesCommand::SetVariablesCommand( const QString &name, FormWindow *fw, - QValueList<MetaDataBase::Variable> lst ) +SetVariablesCommand::SetVariablesCommand( const TQString &name, FormWindow *fw, + TQValueList<MetaDataBase::Variable> lst ) : Command( name, fw ), newList( lst ) { oldList = MetaDataBase::variables( formWindow() ); @@ -1395,11 +1395,11 @@ void SetVariablesCommand::unexecute() // ------------------------------------------------------------ -RemoveVariableCommand::RemoveVariableCommand( const QString &name, FormWindow *fw, const QString &vn ) +RemoveVariableCommand::RemoveVariableCommand( const TQString &name, FormWindow *fw, const TQString &vn ) : Command( name, fw ), varName( vn ) { - QValueList<MetaDataBase::Variable> lst = MetaDataBase::variables( fw ); - for ( QValueList<MetaDataBase::Variable>::Iterator it = lst.begin(); it != lst.end(); ++it ) { + TQValueList<MetaDataBase::Variable> lst = MetaDataBase::variables( fw ); + for ( TQValueList<MetaDataBase::Variable>::Iterator it = lst.begin(); it != lst.end(); ++it ) { if ( (*it).varName == varName ) { access = (*it).varAccess; break; @@ -1425,8 +1425,8 @@ void RemoveVariableCommand::unexecute() // ------------------------------------------------------------ -EditDefinitionsCommand::EditDefinitionsCommand( const QString &name, FormWindow *fw, LanguageInterface *lf, - const QString &n, const QStringList &nl ) +EditDefinitionsCommand::EditDefinitionsCommand( const TQString &name, FormWindow *fw, LanguageInterface *lf, + const TQString &n, const TQStringList &nl ) : Command( name, fw ), lIface( lf ), defName( n ), newList( nl ) { oldList = lIface->definitionEntries( defName, formWindow()->mainWindow()->designerInterface() ); @@ -1452,14 +1452,14 @@ void EditDefinitionsCommand::unexecute() // ------------------------------------------------------------ -LowerCommand::LowerCommand( const QString &name, FormWindow *fw, const QWidgetList &w ) +LowerCommand::LowerCommand( const TQString &name, FormWindow *fw, const TQWidgetList &w ) : Command( name, fw ), widgets( w ) { } void LowerCommand::execute() { - for ( QWidget *w = widgets.first(); w; w = widgets.next() ) { + for ( TQWidget *w = widgets.first(); w; w = widgets.next() ) { w->lower(); formWindow()->raiseSelection( w ); } @@ -1468,7 +1468,7 @@ void LowerCommand::execute() void LowerCommand::unexecute() { - for ( QWidget *w = widgets.first(); w; w = widgets.next() ) { + for ( TQWidget *w = widgets.first(); w; w = widgets.next() ) { w->raise(); formWindow()->raiseSelection( w ); } @@ -1476,14 +1476,14 @@ void LowerCommand::unexecute() // ------------------------------------------------------------ -RaiseCommand::RaiseCommand( const QString &name, FormWindow *fw, const QWidgetList &w ) +RaiseCommand::RaiseCommand( const TQString &name, FormWindow *fw, const TQWidgetList &w ) : Command( name, fw ), widgets( w ) { } void RaiseCommand::execute() { - for ( QWidget *w = widgets.first(); w; w = widgets.next() ) { + for ( TQWidget *w = widgets.first(); w; w = widgets.next() ) { w->raise(); formWindow()->raiseSelection( w ); } @@ -1492,7 +1492,7 @@ void RaiseCommand::execute() void RaiseCommand::unexecute() { - for ( QWidget *w = widgets.first(); w; w = widgets.next() ) { + for ( TQWidget *w = widgets.first(); w; w = widgets.next() ) { w->lower(); formWindow()->raiseSelection( w ); } @@ -1500,15 +1500,15 @@ void RaiseCommand::unexecute() // ------------------------------------------------------------ -PasteCommand::PasteCommand( const QString &n, FormWindow *fw, - const QWidgetList &w ) +PasteCommand::PasteCommand( const TQString &n, FormWindow *fw, + const TQWidgetList &w ) : Command( n, fw ), widgets( w ) { } void PasteCommand::execute() { - for ( QWidget *w = widgets.first(); w; w = widgets.next() ) { + for ( TQWidget *w = widgets.first(); w; w = widgets.next() ) { w->show(); formWindow()->selectWidget( w ); formWindow()->widgets()->insert( w, w ); @@ -1518,7 +1518,7 @@ void PasteCommand::execute() void PasteCommand::unexecute() { - for ( QWidget *w = widgets.first(); w; w = widgets.next() ) { + for ( TQWidget *w = widgets.first(); w; w = widgets.next() ) { w->hide(); formWindow()->selectWidget( w, FALSE ); formWindow()->widgets()->remove( w ); @@ -1528,8 +1528,8 @@ void PasteCommand::unexecute() // ------------------------------------------------------------ -TabOrderCommand::TabOrderCommand( const QString &n, FormWindow *fw, - const QWidgetList &ol, const QWidgetList &nl ) +TabOrderCommand::TabOrderCommand( const TQString &n, FormWindow *fw, + const TQWidgetList &ol, const TQWidgetList &nl ) : Command( n, fw ), oldOrder( ol ), newOrder( nl ) { } @@ -1557,11 +1557,11 @@ void TabOrderCommand::unexecute() // ------------------------------------------------------------ -PopulateListBoxCommand::PopulateListBoxCommand( const QString &n, FormWindow *fw, - QListBox *lb, const QValueList<Item> &items ) +PopulateListBoxCommand::PopulateListBoxCommand( const TQString &n, FormWindow *fw, + TQListBox *lb, const TQValueList<Item> &items ) : Command( n, fw ), newItems( items ), listbox( lb ) { - QListBoxItem *i = 0; + TQListBoxItem *i = 0; for ( i = listbox->firstItem(); i; i = i->next() ) { Item item; if ( i->pixmap() ) @@ -1574,12 +1574,12 @@ PopulateListBoxCommand::PopulateListBoxCommand( const QString &n, FormWindow *fw void PopulateListBoxCommand::execute() { listbox->clear(); - for ( QValueList<Item>::Iterator it = newItems.begin(); it != newItems.end(); ++it ) { + for ( TQValueList<Item>::Iterator it = newItems.begin(); it != newItems.end(); ++it ) { Item i = *it; if ( !i.pix.isNull() ) - (void)new QListBoxPixmap( listbox, i.pix, i.text ); + (void)new TQListBoxPixmap( listbox, i.pix, i.text ); else - (void)new QListBoxText( listbox, i.text ); + (void)new TQListBoxText( listbox, i.text ); } formWindow()->mainWindow()->propertyeditor()->refetchData(); } @@ -1587,24 +1587,24 @@ void PopulateListBoxCommand::execute() void PopulateListBoxCommand::unexecute() { listbox->clear(); - for ( QValueList<Item>::Iterator it = oldItems.begin(); it != oldItems.end(); ++it ) { + for ( TQValueList<Item>::Iterator it = oldItems.begin(); it != oldItems.end(); ++it ) { Item i = *it; if ( !i.pix.isNull() ) - (void)new QListBoxPixmap( listbox, i.pix, i.text ); + (void)new TQListBoxPixmap( listbox, i.pix, i.text ); else - (void)new QListBoxText( listbox, i.text ); + (void)new TQListBoxText( listbox, i.text ); } formWindow()->mainWindow()->propertyeditor()->refetchData(); } // ------------------------------------------------------------ -PopulateIconViewCommand::PopulateIconViewCommand( const QString &n, FormWindow *fw, - QIconView *iv, const QValueList<Item> &items ) +PopulateIconViewCommand::PopulateIconViewCommand( const TQString &n, FormWindow *fw, + TQIconView *iv, const TQValueList<Item> &items ) : Command( n, fw ), newItems( items ), iconview( iv ) { #ifndef QT_NO_ICONVIEW - QIconViewItem *i = 0; + TQIconViewItem *i = 0; for ( i = iconview->firstItem(); i; i = i->nextItem() ) { Item item; if ( i->pixmap() ) @@ -1619,9 +1619,9 @@ void PopulateIconViewCommand::execute() { #ifndef QT_NO_ICONVIEW iconview->clear(); - for ( QValueList<Item>::Iterator it = newItems.begin(); it != newItems.end(); ++it ) { + for ( TQValueList<Item>::Iterator it = newItems.begin(); it != newItems.end(); ++it ) { Item i = *it; - (void)new QIconViewItem( iconview, i.text, i.pix ); + (void)new TQIconViewItem( iconview, i.text, i.pix ); } #endif } @@ -1630,23 +1630,23 @@ void PopulateIconViewCommand::unexecute() { #ifndef QT_NO_ICONVIEW iconview->clear(); - for ( QValueList<Item>::Iterator it = oldItems.begin(); it != oldItems.end(); ++it ) { + for ( TQValueList<Item>::Iterator it = oldItems.begin(); it != oldItems.end(); ++it ) { Item i = *it; - (void)new QIconViewItem( iconview, i.text, i.pix ); + (void)new TQIconViewItem( iconview, i.text, i.pix ); } #endif } // ------------------------------------------------------------ -PopulateListViewCommand::PopulateListViewCommand( const QString &n, FormWindow *fw, - QListView *lv, QListView *from ) +PopulateListViewCommand::PopulateListViewCommand( const TQString &n, FormWindow *fw, + TQListView *lv, TQListView *from ) : Command( n, fw ), listview( lv ) { - newItems = new QListView(); + newItems = new TQListView(); newItems->hide(); transferItems( from, newItems ); - oldItems = new QListView(); + oldItems = new TQListView(); oldItems->hide(); transferItems( listview, oldItems ); } @@ -1663,12 +1663,12 @@ void PopulateListViewCommand::unexecute() transferItems( oldItems, listview ); } -void PopulateListViewCommand::transferItems( QListView *from, QListView *to ) +void PopulateListViewCommand::transferItems( TQListView *from, TQListView *to ) { - QHeader *header = to->header(); + TQHeader *header = to->header(); while ( header->count() ) to->removeColumn( 0 ); - QHeader *h2 = from->header(); + TQHeader *h2 = from->header(); for ( int i = 0; i < h2->count(); ++i ) { to->addColumn( h2->label( i ) ); if ( h2->iconSet( i ) && !h2->iconSet( i )->pixmap().isNull() ) @@ -1677,25 +1677,25 @@ void PopulateListViewCommand::transferItems( QListView *from, QListView *to ) header->setClickEnabled( h2->isClickEnabled( i ), i ); } - QListViewItemIterator it( from ); - QPtrStack<QListViewItem> fromParents, toParents; + TQListViewItemIterator it( from ); + TQPtrStack<TQListViewItem> fromParents, toParents; fromParents.push( 0 ); toParents.push( 0 ); - QPtrStack<QListViewItem> toLasts; - QListViewItem *fromLast = 0; + TQPtrStack<TQListViewItem> toLasts; + TQListViewItem *fromLast = 0; toLasts.push( 0 ); int cols = from->columns(); to->setSorting( -1 ); from->setSorting( -1 ); for ( ; it.current(); ++it ) { - QListViewItem *i = it.current(); + TQListViewItem *i = it.current(); if ( i->parent() == fromParents.top() ) { - QListViewItem *pi = toParents.top(); - QListViewItem *ni = 0; + TQListViewItem *pi = toParents.top(); + TQListViewItem *ni = 0; if ( pi ) - ni = new QListViewItem( pi, toLasts.top() ); + ni = new TQListViewItem( pi, toLasts.top() ); else - ni = new QListViewItem( to, toLasts.top() ); + ni = new TQListViewItem( to, toLasts.top() ); for ( int c = 0; c < cols; ++c ) { ni->setText( c, i->text( c ) ); if ( i->pixmap( c ) ) @@ -1710,12 +1710,12 @@ void PopulateListViewCommand::transferItems( QListView *from, QListView *to ) fromParents.push( fromLast ); toParents.push( toLasts.top() ); toLasts.push( 0 ); - QListViewItem *pi = toParents.top(); - QListViewItem *ni = 0; + TQListViewItem *pi = toParents.top(); + TQListViewItem *ni = 0; if ( pi ) - ni = new QListViewItem( pi ); + ni = new TQListViewItem( pi ); else - ni = new QListViewItem( to ); + ni = new TQListViewItem( to ); for ( int c = 0; c < cols; ++c ) { ni->setText( c, i->text( c ) ); if ( i->pixmap( c ) ) @@ -1732,12 +1732,12 @@ void PopulateListViewCommand::transferItems( QListView *from, QListView *to ) toLasts.pop(); } - QListViewItem *pi = toParents.top(); - QListViewItem *ni = 0; + TQListViewItem *pi = toParents.top(); + TQListViewItem *ni = 0; if ( pi ) - ni = new QListViewItem( pi, toLasts.top() ); + ni = new TQListViewItem( pi, toLasts.top() ); else - ni = new QListViewItem( to, toLasts.top() ); + ni = new TQListViewItem( to, toLasts.top() ); for ( int c = 0; c < cols; ++c ) { ni->setText( c, i->text( c ) ); if ( i->pixmap( c ) ) @@ -1757,8 +1757,8 @@ void PopulateListViewCommand::transferItems( QListView *from, QListView *to ) // ------------------------------------------------------------ -PopulateMultiLineEditCommand::PopulateMultiLineEditCommand( const QString &n, FormWindow *fw, - QTextEdit *mle, const QString &txt ) +PopulateMultiLineEditCommand::PopulateMultiLineEditCommand( const TQString &n, FormWindow *fw, + TQTextEdit *mle, const TQString &txt ) : Command( n, fw ), newText( txt ), mlined( mle ) { oldText = mlined->text(); @@ -1781,14 +1781,14 @@ void PopulateMultiLineEditCommand::unexecute() // ------------------------------------------------------------ -PopulateTableCommand::PopulateTableCommand( const QString &n, FormWindow *fw, QTable *t, - const QValueList<Row> &rows, - const QValueList<Column> &columns ) +PopulateTableCommand::PopulateTableCommand( const TQString &n, FormWindow *fw, TQTable *t, + const TQValueList<Row> &rows, + const TQValueList<Column> &columns ) : Command( n, fw ), newRows( rows ), newColumns( columns ), table( t ) { #ifndef QT_NO_TABLE int i = 0; - QMap<QString, QString> columnFields = MetaDataBase::columnFields( 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 ); @@ -1810,10 +1810,10 @@ PopulateTableCommand::PopulateTableCommand( const QString &n, FormWindow *fw, QT void PopulateTableCommand::execute() { #ifndef QT_NO_TABLE - QMap<QString, QString> columnFields; + TQMap<TQString, TQString> columnFields; table->setNumCols( newColumns.count() ); int i = 0; - for ( QValueList<Column>::Iterator cit = newColumns.begin(); cit != newColumns.end(); ++cit, ++i ) { + for ( TQValueList<Column>::Iterator cit = newColumns.begin(); cit != newColumns.end(); ++cit, ++i ) { table->horizontalHeader()->setLabel( i, (*cit).pix, (*cit).text ); if ( !(*cit).field.isEmpty() ) columnFields.insert( (*cit).text, (*cit).field ); @@ -1821,7 +1821,7 @@ void PopulateTableCommand::execute() MetaDataBase::setColumnFields( table, columnFields ); table->setNumRows( newRows.count() ); i = 0; - for ( QValueList<Row>::Iterator rit = newRows.begin(); rit != newRows.end(); ++rit, ++i ) + for ( TQValueList<Row>::Iterator rit = newRows.begin(); rit != newRows.end(); ++rit, ++i ) table->verticalHeader()->setLabel( i, (*rit).pix, (*rit).text ); #endif } @@ -1829,10 +1829,10 @@ void PopulateTableCommand::execute() void PopulateTableCommand::unexecute() { #ifndef QT_NO_TABLE - QMap<QString, QString> columnFields; + TQMap<TQString, TQString> columnFields; table->setNumCols( oldColumns.count() ); int i = 0; - for ( QValueList<Column>::Iterator cit = oldColumns.begin(); cit != oldColumns.end(); ++cit, ++i ) { + for ( TQValueList<Column>::Iterator cit = oldColumns.begin(); cit != oldColumns.end(); ++cit, ++i ) { table->horizontalHeader()->setLabel( i, (*cit).pix, (*cit).text ); if ( !(*cit).field.isEmpty() ) columnFields.insert( (*cit).text, (*cit).field ); @@ -1840,15 +1840,15 @@ void PopulateTableCommand::unexecute() MetaDataBase::setColumnFields( table, columnFields ); table->setNumRows( oldRows.count() ); i = 0; - for ( QValueList<Row>::Iterator rit = oldRows.begin(); rit != oldRows.end(); ++rit, ++i ) + for ( TQValueList<Row>::Iterator rit = oldRows.begin(); rit != oldRows.end(); ++rit, ++i ) table->verticalHeader()->setLabel( i, (*rit).pix, (*rit).text ); #endif } // ------------------------------------------------------------ -AddActionToToolBarCommand::AddActionToToolBarCommand( const QString &n, FormWindow *fw, - QAction *a, QDesignerToolBar *tb, int idx ) +AddActionToToolBarCommand::AddActionToToolBarCommand( const TQString &n, FormWindow *fw, + TQAction *a, QDesignerToolBar *tb, int idx ) : Command( n, fw ), action( a ), toolBar( tb ), index( idx ) { } @@ -1858,9 +1858,9 @@ void AddActionToToolBarCommand::execute() action->addTo( toolBar ); if ( ::qt_cast<QDesignerAction*>(action) ) { - QString s = ( (QDesignerAction*)action )->widget()->name(); + TQString s = ( (QDesignerAction*)action )->widget()->name(); if ( s.startsWith( "qt_dead_widget_" ) ) { - s.remove( 0, QString( "qt_dead_widget_" ).length() ); + s.remove( 0, TQString( "qt_dead_widget_" ).length() ); ( (QDesignerAction*)action )->widget()->setName( s ); } toolBar->insertAction( ( (QDesignerAction*)action )->widget(), action ); @@ -1874,21 +1874,21 @@ void AddActionToToolBarCommand::execute() toolBar->insertAction( ( (QSeparatorAction*)action )->widget(), action ); ( (QSeparatorAction*)action )->widget()->installEventFilter( toolBar ); } - if ( !::qt_cast<QActionGroup*>(action) || ( (QActionGroup*)action )->usesDropDown()) { + if ( !::qt_cast<TQActionGroup*>(action) || ( (TQActionGroup*)action )->usesDropDown()) { if ( index == -1 ) toolBar->appendAction( action ); else toolBar->insertAction( index, action ); toolBar->reInsert(); - QObject::connect( action, SIGNAL( destroyed() ), toolBar, SLOT( actionRemoved() ) ); + TQObject::connect( action, TQT_SIGNAL( destroyed() ), toolBar, TQT_SLOT( actionRemoved() ) ); } else { if ( action->children() ) { - QObjectListIt it( *action->children() ); + TQObjectListIt it( *action->children() ); int i = 0; while ( it.current() ) { - QObject *o = it.current(); + TQObject *o = it.current(); ++it; - if ( !::qt_cast<QAction*>(o) ) + if ( !::qt_cast<TQAction*>(o) ) continue; // ### fix it for nested actiongroups if ( ::qt_cast<QDesignerAction*>(o) ) { @@ -1900,11 +1900,11 @@ void AddActionToToolBarCommand::execute() else toolBar->insertAction( index + (i++), ac ); } - QObject::connect( o, SIGNAL( destroyed() ), toolBar, SLOT( actionRemoved() ) ); + TQObject::connect( o, TQT_SIGNAL( destroyed() ), toolBar, TQT_SLOT( actionRemoved() ) ); } } toolBar->reInsert(); - QObject::connect( action, SIGNAL( destroyed() ), toolBar, SLOT( actionRemoved() ) ); + TQObject::connect( action, TQT_SIGNAL( destroyed() ), toolBar, TQT_SLOT( actionRemoved() ) ); } formWindow()->mainWindow()->objectHierarchy()->rebuild(); } @@ -1912,29 +1912,29 @@ void AddActionToToolBarCommand::execute() void AddActionToToolBarCommand::unexecute() { if ( ::qt_cast<QDesignerAction*>(action) ) { - QString s = ( (QDesignerAction*)action )->widget()->name(); + TQString s = ( (QDesignerAction*)action )->widget()->name(); s.prepend( "qt_dead_widget_" ); ( (QDesignerAction*)action )->widget()->setName( s ); } toolBar->removeAction( action ); action->removeFrom( toolBar ); - QObject::disconnect( action, SIGNAL( destroyed() ), toolBar, SLOT( actionRemoved() ) ); - if ( !::qt_cast<QActionGroup*>(action) || ( (QActionGroup*)action )->usesDropDown()) { + TQObject::disconnect( action, TQT_SIGNAL( destroyed() ), toolBar, TQT_SLOT( actionRemoved() ) ); + if ( !::qt_cast<TQActionGroup*>(action) || ( (TQActionGroup*)action )->usesDropDown()) { action->removeEventFilter( toolBar ); } else { if ( action->children() ) { - QObjectListIt it( *action->children() ); + TQObjectListIt it( *action->children() ); while ( it.current() ) { - QObject *o = it.current(); + TQObject *o = it.current(); ++it; - if ( !::qt_cast<QAction*>(o) ) + if ( !::qt_cast<TQAction*>(o) ) continue; if ( ::qt_cast<QDesignerAction*>(o) ) { o->removeEventFilter( toolBar ); - toolBar->removeAction( (QAction*)o ); + toolBar->removeAction( (TQAction*)o ); } - QObject::disconnect( o, SIGNAL( destroyed() ), toolBar, SLOT( actionRemoved() ) ); + TQObject::disconnect( o, TQT_SIGNAL( destroyed() ), toolBar, TQT_SLOT( actionRemoved() ) ); } } } @@ -1943,7 +1943,7 @@ void AddActionToToolBarCommand::unexecute() // ------------------------------------------------------------ -AddToolBarCommand::AddToolBarCommand( const QString &n, FormWindow *fw, QMainWindow *mw ) +AddToolBarCommand::AddToolBarCommand( const TQString &n, FormWindow *fw, TQMainWindow *mw ) : Command( n, fw ), toolBar( 0 ), mainWindow( mw ) { } @@ -1952,14 +1952,14 @@ void AddToolBarCommand::execute() { if ( !toolBar ) { toolBar = new QDesignerToolBar( mainWindow ); - QString n = "Toolbar"; + TQString n = "Toolbar"; formWindow()->unify( toolBar, n, TRUE ); toolBar->setName( n ); mainWindow->addToolBar( toolBar, n ); } else { toolBar->show(); - QString s = toolBar->name(); - s.remove( 0, QString( "qt_dead_widget_" ).length() ); + TQString s = toolBar->name(); + s.remove( 0, TQString( "qt_dead_widget_" ).length() ); toolBar->setName( s ); } formWindow()->mainWindow()->objectHierarchy()->rebuild(); @@ -1968,7 +1968,7 @@ void AddToolBarCommand::execute() void AddToolBarCommand::unexecute() { toolBar->hide(); - QString s = toolBar->name(); + TQString s = toolBar->name(); s.prepend( "qt_dead_widget_" ); toolBar->setName( s ); formWindow()->mainWindow()->objectHierarchy()->rebuild(); @@ -1977,8 +1977,8 @@ void AddToolBarCommand::unexecute() // ------------------------------------------------------------ #ifdef QT_CONTAINER_CUSTOM_WIDGETS -AddContainerPageCommand::AddContainerPageCommand( const QString &n, FormWindow *fw, - QWidget *c, const QString &label ) +AddContainerPageCommand::AddContainerPageCommand( const TQString &n, FormWindow *fw, + TQWidget *c, const TQString &label ) : Command( n, fw ), container( c ), index( -1 ), pageLabel( label ), page( 0 ) { WidgetInterface *iface = 0; @@ -2024,8 +2024,8 @@ void AddContainerPageCommand::unexecute() // ------------------------------------------------------------ -DeleteContainerPageCommand::DeleteContainerPageCommand( const QString &n, FormWindow *fw, - QWidget *c, int idx ) +DeleteContainerPageCommand::DeleteContainerPageCommand( const TQString &n, FormWindow *fw, + TQWidget *c, int idx ) : Command( n, fw ), container( c ), index( idx ) { WidgetInterface *iface = 0; @@ -2070,9 +2070,9 @@ void DeleteContainerPageCommand::unexecute() // ------------------------------------------------------------ -RenameContainerPageCommand::RenameContainerPageCommand( const QString &n, FormWindow *fw, - QWidget *c, int idx, - const QString &label ) +RenameContainerPageCommand::RenameContainerPageCommand( const TQString &n, FormWindow *fw, + TQWidget *c, int idx, + const TQString &label ) : Command( n, fw ), container( c ), index( idx ), newLabel( label ) { WidgetInterface *iface = 0; @@ -2112,7 +2112,7 @@ void RenameContainerPageCommand::unexecute() #endif // QT_CONTAINER_CUSTOM_WIDGETS // ------------------------------------------------------------ -AddActionToPopupCommand::AddActionToPopupCommand( const QString &n, +AddActionToPopupCommand::AddActionToPopupCommand( const TQString &n, FormWindow *fw, PopupMenuEditor *m, PopupMenuEditorItem *i, @@ -2136,7 +2136,7 @@ void AddActionToPopupCommand::unexecute() // ------------------------------------------------------------ -RemoveActionFromPopupCommand::RemoveActionFromPopupCommand( const QString &n, +RemoveActionFromPopupCommand::RemoveActionFromPopupCommand( const TQString &n, FormWindow *fw, PopupMenuEditor *m, int idx ) @@ -2157,7 +2157,7 @@ void RemoveActionFromPopupCommand::unexecute() // ------------------------------------------------------------ -ExchangeActionInPopupCommand::ExchangeActionInPopupCommand( const QString &n, +ExchangeActionInPopupCommand::ExchangeActionInPopupCommand( const TQString &n, FormWindow *fw, PopupMenuEditor *m, int a, @@ -2185,11 +2185,11 @@ ActionEditor *ActionCommand::actionEditor() // ------------------------------------------------------------ -RenameActionCommand::RenameActionCommand( const QString &n, +RenameActionCommand::RenameActionCommand( const TQString &n, FormWindow *fw, - QAction *a, + TQAction *a, PopupMenuEditor *m, - QString nm ) + TQString nm ) : ActionCommand( n, fw, a ), menu( m ), newName( nm ) { oldName = action->menuText(); @@ -2197,9 +2197,9 @@ RenameActionCommand::RenameActionCommand( const QString &n, void RenameActionCommand::execute() { - QString actionText = newName; + TQString actionText = newName; actionText.replace("&&", "&"); - QString menuText = newName; + TQString menuText = newName; action->setText( actionText ); action->setMenuText( menuText ); @@ -2215,11 +2215,11 @@ void RenameActionCommand::unexecute() // ------------------------------------------------------------ -SetActionIconsCommand::SetActionIconsCommand( const QString &n, +SetActionIconsCommand::SetActionIconsCommand( const TQString &n, FormWindow *fw, - QAction *a, + TQAction *a, PopupMenuEditor *m, - QIconSet &icons ) + TQIconSet &icons ) : ActionCommand( n, fw, a ), menu( m ), newIcons( icons ) { oldIcons = a->iconSet(); @@ -2245,7 +2245,7 @@ void SetActionIconsCommand::unexecute() // ------------------------------------------------------------ -AddMenuCommand::AddMenuCommand( const QString &n, +AddMenuCommand::AddMenuCommand( const TQString &n, FormWindow *fw, MenuBarEditor *b, MenuBarEditorItem *i, @@ -2253,10 +2253,10 @@ AddMenuCommand::AddMenuCommand( const QString &n, : Command( n, fw ), mb( b ), item( i ), name( 0 ), index( idx ) { } -AddMenuCommand::AddMenuCommand( const QString &n, +AddMenuCommand::AddMenuCommand( const TQString &n, FormWindow *fw, - QMainWindow *mw, - const QString &nm ) + TQMainWindow *mw, + const TQString &nm ) : Command( n, fw ), mb( 0 ), item( 0 ), name( nm ), index( -1 ) { if ( mw ) @@ -2265,8 +2265,8 @@ AddMenuCommand::AddMenuCommand( const QString &n, void AddMenuCommand::execute() { - QString n; - QMainWindow *mw = (QMainWindow*)formWindow()->mainContainer(); + TQString n; + TQMainWindow *mw = (TQMainWindow*)formWindow()->mainContainer(); if ( !mb ) { mb = new MenuBarEditor( formWindow(), mw ); mb->setName( "MenuBarEditor" ); @@ -2303,7 +2303,7 @@ void AddMenuCommand::unexecute() // ------------------------------------------------------------ -RemoveMenuCommand::RemoveMenuCommand( const QString &n, +RemoveMenuCommand::RemoveMenuCommand( const TQString &n, FormWindow *fw, MenuBarEditor *b, int idx ) @@ -2325,7 +2325,7 @@ void RemoveMenuCommand::unexecute() // ------------------------------------------------------------ -ExchangeMenuCommand::ExchangeMenuCommand( const QString &n, +ExchangeMenuCommand::ExchangeMenuCommand( const TQString &n, FormWindow *fw, MenuBarEditor *b, int i, @@ -2345,7 +2345,7 @@ void ExchangeMenuCommand::unexecute() // ------------------------------------------------------------ -MoveMenuCommand::MoveMenuCommand( const QString &n, +MoveMenuCommand::MoveMenuCommand( const TQString &n, FormWindow *fw, MenuBarEditor *b, int i, @@ -2373,20 +2373,20 @@ void MoveMenuCommand::unexecute() // ------------------------------------------------------------ -RenameMenuCommand::RenameMenuCommand( const QString &n, +RenameMenuCommand::RenameMenuCommand( const TQString &n, FormWindow *fw, MenuBarEditor *b, - QString nm, + TQString nm, MenuBarEditorItem *i ) : Command( n, fw ), bar( b ), item( i ), newName( nm ) { oldName = item->menu()->name(); } -QString RenameMenuCommand::makeLegal( const QString &str ) +TQString RenameMenuCommand::makeLegal( const TQString &str ) { // remove illegal characters - QString d; + TQString d; char c = 0, i = 0; while ( !str.at(i).isNull() ) { c = str.at(i).latin1(); @@ -2404,7 +2404,7 @@ void RenameMenuCommand::execute() { PopupMenuEditor *popup = item->menu(); item->setMenuText( newName ); - QString legal = makeLegal( newName ); + TQString legal = makeLegal( newName ); formWindow()->unify( popup, legal, TRUE ); popup->setName( legal ); formWindow()->mainWindow()->objectHierarchy()->rebuild(); @@ -2420,8 +2420,8 @@ void RenameMenuCommand::unexecute() // ------------------------------------------------------------ -AddToolBoxPageCommand::AddToolBoxPageCommand( const QString &n, FormWindow *fw, - QToolBox *tw, const QString &label ) +AddToolBoxPageCommand::AddToolBoxPageCommand( const TQString &n, FormWindow *fw, + TQToolBox *tw, const TQString &label ) : Command( n, fw ), toolBox( tw ), toolBoxLabel( label ) { toolBoxPage = new QDesignerWidget( formWindow(), toolBox, "page" ); @@ -2448,8 +2448,8 @@ void AddToolBoxPageCommand::unexecute() // ------------------------------------------------------------ -DeleteToolBoxPageCommand::DeleteToolBoxPageCommand( const QString &n, FormWindow *fw, - QToolBox *tw, QWidget *page ) +DeleteToolBoxPageCommand::DeleteToolBoxPageCommand( const TQString &n, FormWindow *fw, + TQToolBox *tw, TQWidget *page ) : Command( n, fw ), toolBox( tw ), toolBoxPage( page ) { toolBoxLabel = toolBox->itemLabel( toolBox->currentIndex() ); |