diff options
Diffstat (limited to 'kdevdesigner/designer/hierarchyview.cpp')
-rw-r--r-- | kdevdesigner/designer/hierarchyview.cpp | 318 |
1 files changed, 159 insertions, 159 deletions
diff --git a/kdevdesigner/designer/hierarchyview.cpp b/kdevdesigner/designer/hierarchyview.cpp index bda24784..7428e883 100644 --- a/kdevdesigner/designer/hierarchyview.cpp +++ b/kdevdesigner/designer/hierarchyview.cpp @@ -1,15 +1,15 @@ /********************************************************************** ** Copyright (C) 2000-2001 Trolltech AS. All rights reserved. ** -** This file is part of Qt Designer. +** This file is part of TQt Designer. ** ** This file may be distributed and/or modified under the terms of the ** GNU General Public License version 2 as published by the Free Software ** Foundation and appearing in the file LICENSE.GPL included in the ** packaging of this file. ** -** Licensees holding valid Qt Enterprise Edition or Qt Professional Edition -** licenses may use this file in accordance with the Qt Commercial License +** Licensees holding valid TQt Enterprise Edition or TQt Professional Edition +** licenses may use this file in accordance with the TQt Commercial License ** Agreement provided with the Software. ** ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE @@ -17,7 +17,7 @@ ** ** See http://www.trolltech.com/gpl/ for GPL licensing information. ** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for -** information about Qt Commercial License Agreements. +** information about TQt Commercial License Agreements. ** ** Contact info@trolltech.com if any conditions of this licensing are ** not clear to you. @@ -66,17 +66,17 @@ TQListViewItem *newItem = 0; -static QPluginManager<ClassBrowserInterface> *classBrowserInterfaceManager = 0; +static TQPluginManager<ClassBrowserInterface> *classBrowserInterfaceManager = 0; -HierarchyItem::HierarchyItem( Type type, TQListViewItem *parent, TQListViewItem *after, +HierarchyItem::HierarchyItem( Type type, TQListViewItem *tqparent, TQListViewItem *after, const TQString &txt1, const TQString &txt2, const TQString &txt3 ) - : TQListViewItem( parent, after, txt1, txt2, txt3 ), typ( type ) + : TQListViewItem( tqparent, after, txt1, txt2, txt3 ), typ( type ) { } -HierarchyItem::HierarchyItem( Type type, TQListView *parent, TQListViewItem *after, +HierarchyItem::HierarchyItem( Type type, TQListView *tqparent, TQListViewItem *after, const TQString &txt1, const TQString &txt2, const TQString &txt3 ) - : TQListViewItem( parent, after, txt1, txt2, txt3 ), typ( type ) + : TQListViewItem( tqparent, after, txt1, txt2, txt3 ), typ( type ) { } @@ -84,8 +84,8 @@ void HierarchyItem::paintCell( TQPainter *p, const TQColorGroup &cg, int column, { TQColorGroup g( cg ); g.setColor( TQColorGroup::Base, backgroundColor() ); - g.setColor( TQColorGroup::Foreground, Qt::black ); - g.setColor( TQColorGroup::Text, Qt::black ); + g.setColor( TQColorGroup::Foreground, TQt::black ); + g.setColor( TQColorGroup::Text, TQt::black ); TQString txt = text( 0 ); if ( rtti() == Function && MainWindow::self->currProject()->isCpp() && @@ -172,8 +172,8 @@ void HierarchyItem::cancelRename( int col ) -HierarchyList::HierarchyList( TQWidget *parent, FormWindow *fw, bool doConnects ) - : TQListView( parent ), formWindow( fw ) +HierarchyList::HierarchyList( TQWidget *tqparent, FormWindow *fw, bool doConnects ) + : TQListView( tqparent ), formWindow( fw ) { DesignerFormPix = SmallIcon( "designer_form.png" , KDevDesignerPartFactory::instance()); DesignerLayoutPix = SmallIcon( "designer_layout.png" , KDevDesignerPartFactory::instance()); @@ -249,39 +249,39 @@ TQObject *HierarchyList::handleObjectClick( TQListViewItem *i ) TQObject *o = findObject( i ); if ( !o ) return 0; - if ( formWindow == o ) { + if ( TQT_BASE_OBJECT(formWindow) == TQT_BASE_OBJECT(o) ) { if ( deselect ) formWindow->clearSelection( FALSE ); - formWindow->emitShowProperties( formWindow ); + formWindow->emitShowProperties( TQT_TQOBJECT(formWindow) ); return 0; } if ( o->isWidgetType() ) { TQWidget *w = (TQWidget*)o; - if ( !formWindow->widgets()->find( w ) ) { - if ( ::qt_cast<TQWidgetStack*>(w->parent()) ) { - if (::qt_cast<TQTabWidget*>(w->parent()->parent()) ) { - ((TQTabWidget*)w->parent()->parent())->showPage( w ); - o = (TQWidget*)w->parent()->parent(); - formWindow->emitUpdateProperties( formWindow->currentWidget() ); - } else if ( ::qt_cast<TQWizard*>(w->parent()->parent()) ) { - ((QDesignerWizard*)w->parent()->parent())-> - setCurrentPage( ( (QDesignerWizard*)w->parent()->parent() )->pageNum( w ) ); - o = (TQWidget*)w->parent()->parent(); - formWindow->emitUpdateProperties( formWindow->currentWidget() ); + if ( !formWindow->widgets()->tqfind( w ) ) { + if ( ::tqqt_cast<TQWidgetStack*>(w->tqparent()) ) { + if (::tqqt_cast<TQTabWidget*>(w->tqparent()->tqparent()) ) { + ((TQTabWidget*)w->tqparent()->tqparent())->showPage( w ); + o = TQT_TQOBJECT((TQWidget*)w->tqparent()->tqparent()); + formWindow->emitUpdateProperties( TQT_TQOBJECT(formWindow->currentWidget()) ); + } else if ( ::tqqt_cast<TQWizard*>(w->tqparent()->tqparent()) ) { + ((TQDesignerWizard*)w->tqparent()->tqparent())-> + setCurrentPage( ( (TQDesignerWizard*)w->tqparent()->tqparent() )->pageNum( w ) ); + o = TQT_TQOBJECT((TQWidget*)w->tqparent()->tqparent()); + formWindow->emitUpdateProperties( TQT_TQOBJECT(formWindow->currentWidget()) ); } else { - ( (TQWidgetStack*)w->parent() )->raiseWidget( w ); - if ( (TQWidgetStack*)w->parent()->isA( "QDesignerWidgetStack" ) ) - ( (QDesignerWidgetStack*)w->parent() )->updateButtons(); + ( (TQWidgetStack*)w->tqparent() )->raiseWidget( w ); + if ( (TQWidgetStack*)w->tqparent()->isA( "TQDesignerWidgetStack" ) ) + ( (TQDesignerWidgetStack*)w->tqparent() )->updateButtons(); } - } else if ( ::qt_cast<TQMenuBar*>(w) || ::qt_cast<TQDockWindow*>(w) ) { - formWindow->setActiveObject( w ); - } else if ( ::qt_cast<TQPopupMenu*>(w) ) { + } else if ( ::tqqt_cast<TQMenuBar*>(w) || ::tqqt_cast<TQDockWindow*>(w) ) { + formWindow->setActiveObject( TQT_TQOBJECT(w) ); + } else if ( ::tqqt_cast<TQPopupMenu*>(w) ) { return 0; // ### we could try to find our menu bar and change the currentMenu to our index } else { return 0; } } - } else if ( ::qt_cast<TQAction*>(o) ) { + } else if ( ::tqqt_cast<TQAction*>(o) ) { MainWindow::self->actioneditor()->setCurrentAction( (TQAction*)o ); deselect = TRUE; } @@ -300,10 +300,10 @@ void HierarchyList::objectDoubleClicked( TQListViewItem *i ) return; if ( o->isWidgetType() && ( (TQWidget*)o )->isVisibleTo( formWindow ) ) { TQWidget *w = (TQWidget*)o; - if ( !w->parentWidget() || - WidgetFactory::layoutType( w->parentWidget() ) == WidgetFactory::NoLayout ) + if ( !w->tqparentWidget() || + WidgetFactory::tqlayoutType( w->tqparentWidget() ) == WidgetFactory::NoLayout ) w->raise(); - formWindow->selectWidget( w, TRUE ); + formWindow->selectWidget( TQT_TQOBJECT(w), TRUE ); } } @@ -314,7 +314,7 @@ void HierarchyList::objectClicked( TQListViewItem *i ) return; if ( o->isWidgetType() && ( (TQWidget*)o )->isVisibleTo( formWindow ) ) { TQWidget *w = (TQWidget*)o; - formWindow->selectWidget( w, TRUE ); + formWindow->selectWidget( TQT_TQOBJECT(w), TRUE ); } } @@ -352,7 +352,7 @@ void HierarchyList::changeNameOf( TQObject *o, const TQString &name ) void HierarchyList::changeDatabaseOf( TQObject *o, const TQString &info ) { -#ifndef QT_NO_SQL +#ifndef TQT_NO_SQL if ( !formWindow->isDatabaseAware() ) return; TQListViewItem *item = findItem( o ); @@ -370,7 +370,7 @@ void HierarchyList::setup() return; clear(); TQWidget *w = formWindow->mainContainer(); -#ifndef QT_NO_SQL +#ifndef TQT_NO_SQL if ( formWindow->isDatabaseAware() ) { if ( columns() == 2 ) { addColumn( i18n( "Database" ) ); @@ -388,7 +388,7 @@ void HierarchyList::setup() if ( !widgetStacks ) widgetStacks = new TQPtrList<TQWidgetStack>; if ( w ) - insertObject( w, 0 ); + insertObject( TQT_TQOBJECT(w), 0 ); widgetStacks->clear(); } @@ -397,13 +397,13 @@ void HierarchyList::setOpen( TQListViewItem *i, bool b ) TQListView::setOpen( i, b ); } -void HierarchyList::insertObject( TQObject *o, TQListViewItem *parent ) +void HierarchyList::insertObject( TQObject *o, TQListViewItem *tqparent ) { if ( TQString( o->name() ).startsWith( "qt_dead_widget_" ) ) return; bool fakeMainWindow = FALSE; - if ( ::qt_cast<TQMainWindow*>(o) ) { - TQObject *cw = ( (TQMainWindow*)o )->centralWidget(); + if ( ::tqqt_cast<TQMainWindow*>(o) ) { + TQObject *cw = TQT_TQOBJECT(( (TQMainWindow*)o )->centralWidget()); if ( cw ) { o = cw; fakeMainWindow = TRUE; @@ -411,8 +411,8 @@ void HierarchyList::insertObject( TQObject *o, TQListViewItem *parent ) } TQListViewItem *item = 0; TQString className = WidgetFactory::classNameOf( o ); - if ( ::qt_cast<QLayoutWidget*>(o) ) { - switch ( WidgetFactory::layoutType( (TQWidget*)o ) ) { + if ( ::tqqt_cast<TQLayoutWidget*>(o) ) { + switch ( WidgetFactory::tqlayoutType( (TQWidget*)o ) ) { case WidgetFactory::HBox: className = "HBox"; break; @@ -428,73 +428,73 @@ void HierarchyList::insertObject( TQObject *o, TQListViewItem *parent ) } TQString dbInfo; -#ifndef QT_NO_SQL +#ifndef TQT_NO_SQL dbInfo = MetaDataBase::fakeProperty( o, "database" ).toStringList().join("."); #endif TQString name = o->name(); - if ( ::qt_cast<TQWidgetStack*>(o->parent()) ) { - if ( ::qt_cast<TQTabWidget*>(o->parent()->parent()) ) - name = ( (TQTabWidget*)o->parent()->parent() )->tabLabel( (TQWidget*)o ); - else if ( ::qt_cast<TQWizard*>(o->parent()->parent()) ) - name = ( (TQWizard*)o->parent()->parent() )->title( (TQWidget*)o ); + if ( ::tqqt_cast<TQWidgetStack*>(o->tqparent()) ) { + if ( ::tqqt_cast<TQTabWidget*>(o->tqparent()->tqparent()) ) + name = ( (TQTabWidget*)o->tqparent()->tqparent() )->tabLabel( (TQWidget*)o ); + else if ( ::tqqt_cast<TQWizard*>(o->tqparent()->tqparent()) ) + name = ( (TQWizard*)o->tqparent()->tqparent() )->title( (TQWidget*)o ); } TQToolBox *tb; - if ( o->parent() && o->parent()->parent() && - (tb = ::qt_cast<TQToolBox*>(o->parent()->parent()->parent())) ) + if ( o->tqparent() && o->tqparent()->tqparent() && + (tb = ::tqqt_cast<TQToolBox*>(o->tqparent()->tqparent()->tqparent())) ) name = tb->itemLabel( tb->indexOf((TQWidget*)o) ); if ( fakeMainWindow ) { - name = o->parent()->name(); + name = o->tqparent()->name(); className = TQMAINWINDOW_OBJECT_NAME_STRING; } - if ( !parent ) + if ( !tqparent ) item = new HierarchyItem( HierarchyItem::Widget, this, 0, name, className, dbInfo ); else - item = new HierarchyItem( HierarchyItem::Widget, parent, 0, name, className, dbInfo ); + item = new HierarchyItem( HierarchyItem::Widget, tqparent, 0, name, className, dbInfo ); item->setOpen( TRUE ); - if ( !parent ) + if ( !tqparent ) item->setPixmap( 0, DesignerFormPix ); - else if ( ::qt_cast<QLayoutWidget*>(o) ) + else if ( ::tqqt_cast<TQLayoutWidget*>(o) ) item->setPixmap( 0, DesignerLayoutPix ); else item->setPixmap( 0, WidgetDatabase::iconSet( WidgetDatabase::idFromClassName( WidgetFactory::classNameOf( o ) ) ). pixmap( TQIconSet::Small, TQIconSet::Normal ) ); - if ( ::qt_cast<TQAction*>(o) ) + if ( ::tqqt_cast<TQAction*>(o) ) item->setPixmap( 0, ( (TQAction*)o )->iconSet().pixmap() ); ( (HierarchyItem*)item )->setObject( o ); - const TQObjectList *l = o->children(); - if ( ::qt_cast<QDesignerToolBar*>(o) ) - l = 0; - if ( l ) { - TQObjectListIt it( *l ); + TQObjectList l = o->childrenListObject(); + if ( ::tqqt_cast<TQDesignerToolBar*>(o) ) + l.clear(); + if ( !l.isEmpty() ) { + TQObjectListIt it( l ); it.toLast(); for ( ; it.current(); --it ) { if ( !it.current()->isWidgetType() || ( (TQWidget*)it.current() )->isHidden() ) continue; - if ( !formWindow->widgets()->find( (TQWidget*)it.current() ) ) { - if ( ::qt_cast<TQWidgetStack*>(it.current()->parent()) || - ::qt_cast<TQWidgetStack*>(it.current()) ) { + if ( !formWindow->widgets()->tqfind( (TQWidget*)it.current() ) ) { + if ( ::tqqt_cast<TQWidgetStack*>(it.current()->tqparent()) || + ::tqqt_cast<TQWidgetStack*>(it.current()) ) { TQObject *obj = it.current(); - QDesignerTabWidget *tw = ::qt_cast<QDesignerTabWidget*>(it.current()->parent()); - QDesignerWizard *dw = ::qt_cast<QDesignerWizard*>(it.current()->parent()); + TQDesignerTabWidget *tw = ::tqqt_cast<TQDesignerTabWidget*>(it.current()->tqparent()); + TQDesignerWizard *dw = ::tqqt_cast<TQDesignerWizard*>(it.current()->tqparent()); TQWidgetStack *stack = 0; - if ( dw || tw || ::qt_cast<TQWidgetStack*>(obj) ) + if ( dw || tw || ::tqqt_cast<TQWidgetStack*>(obj) ) stack = (TQWidgetStack*)obj; else - stack = (TQWidgetStack*)obj->parent(); - if ( widgetStacks->findRef( stack ) != -1 ) + stack = (TQWidgetStack*)obj->tqparent(); + if ( widgetStacks->tqfindRef( stack ) != -1 ) continue; widgetStacks->append( stack ); TQObjectList *l2 = stack->queryList( TQWIDGET_OBJECT_NAME_STRING, 0, TRUE, FALSE ); for ( obj = l2->last(); obj; obj = l2->prev() ) { if ( qstrcmp( obj->className(), - "QWidgetStackPrivate::Invisible" ) == 0 || + "TQWidgetStackPrivate::Invisible" ) == 0 || ( tw && !tw->tabBar()->tab( stack->id( (TQWidget*)obj ) ) ) || ( dw && dw->isPageRemoved( (TQWidget*)obj ) ) ) continue; @@ -505,12 +505,12 @@ void HierarchyList::insertObject( TQObject *o, TQListViewItem *parent ) insertObject( obj, item ); } delete l2; - } else if ( ::qt_cast<TQToolBox*>(it.current()->parent()) ) { - if ( !::qt_cast<TQScrollView*>(it.current()) ) + } else if ( ::tqqt_cast<TQToolBox*>(it.current()->tqparent()) ) { + if ( !::tqqt_cast<TQScrollView*>(it.current()) ) continue; - TQToolBox *tb = (TQToolBox*)it.current()->parent(); + TQToolBox *tb = (TQToolBox*)it.current()->tqparent(); for ( int i = tb->count() - 1; i >= 0; --i ) - insertObject( tb->item( i ), item ); + insertObject( TQT_TQOBJECT(tb->item( i )), item ); } continue; } @@ -519,19 +519,19 @@ void HierarchyList::insertObject( TQObject *o, TQListViewItem *parent ) } if ( fakeMainWindow ) { - TQObjectList *l = o->parent()->queryList( "QDesignerToolBar" ); + TQObjectList *l = o->tqparent()->queryList( "TQDesignerToolBar" ); TQObject *obj; for ( obj = l->first(); obj; obj = l->next() ) insertObject( obj, item ); delete l; - l = o->parent()->queryList( "MenuBarEditor" ); + l = o->tqparent()->queryList( "MenuBarEditor" ); for ( obj = l->first(); obj; obj = l->next() ) insertObject( obj, item ); delete l; - } else if ( ::qt_cast<QDesignerToolBar*>(o) || ::qt_cast<PopupMenuEditor*>(o) ) { + } else if ( ::tqqt_cast<TQDesignerToolBar*>(o) || ::tqqt_cast<PopupMenuEditor*>(o) ) { TQPtrList<TQAction> actions; - if ( ::qt_cast<QDesignerToolBar*>(o) ) - actions = ( (QDesignerToolBar*)o )->insertedActions(); + if ( ::tqqt_cast<TQDesignerToolBar*>(o) ) + actions = ( (TQDesignerToolBar*)o )->insertedActions(); else ( (PopupMenuEditor*)o )->insertedActions( actions ); @@ -539,37 +539,37 @@ void HierarchyList::insertObject( TQObject *o, TQListViewItem *parent ) it.toLast(); while ( it.current() ) { TQAction *a = it.current(); - if ( ::qt_cast<QDesignerAction*>(a) ) { - QDesignerAction *da = (QDesignerAction*)a; + if ( ::tqqt_cast<TQDesignerAction*>(a) ) { + TQDesignerAction *da = (TQDesignerAction*)a; if ( da->supportsMenu() ) insertObject( da, item ); else - insertObject( da->widget(), item ); - } else if ( ::qt_cast<QDesignerActionGroup*>(a) ) { + insertObject( TQT_TQOBJECT(da->widget()), item ); + } else if ( ::tqqt_cast<TQDesignerActionGroup*>(a) ) { insertObject( a, item ); } --it; } - } else if ( ::qt_cast<QDesignerActionGroup*>(o) && o->children() ) { - TQObjectList *l = (TQObjectList*)o->children(); - for ( TQObject *obj = l->last(); obj; obj = l->prev() ) { - if ( ::qt_cast<QDesignerAction*>(obj) ) { - QDesignerAction *da = (QDesignerAction*)obj; + } else if ( ::tqqt_cast<TQDesignerActionGroup*>(o) && !o->childrenListObject().isEmpty() ) { + TQObjectList l = o->childrenListObject(); + for ( TQObject *obj = l.last(); obj; obj = l.prev() ) { + if ( ::tqqt_cast<TQDesignerAction*>(obj) ) { + TQDesignerAction *da = (TQDesignerAction*)obj; if ( da->supportsMenu() ) insertObject( da, item ); else - insertObject( da->widget(), item ); - } else if ( ::qt_cast<QDesignerActionGroup*>(obj) ) { + insertObject( TQT_TQOBJECT(da->widget()), item ); + } else if ( ::tqqt_cast<TQDesignerActionGroup*>(obj) ) { insertObject( obj, item ); } } - } else if ( ::qt_cast<MenuBarEditor*>(o) ) { + } else if ( ::tqqt_cast<MenuBarEditor*>(o) ) { MenuBarEditor *mb = (MenuBarEditor*)o; for ( int i = mb->count() -1; i >= 0; --i ) { MenuBarEditorItem *md = mb->item( i ); if ( !md || !md->menu() ) continue; - insertObject( md->menu(), item ); + insertObject( TQT_TQOBJECT(md->menu()), item ); } } } @@ -599,12 +599,12 @@ void HierarchyList::showRMBMenu( TQListViewItem *i, const TQPoint & p ) return; if ( !o->isWidgetType() || - ( o != formWindow && !formWindow->widgets()->find( (TQWidget*)o ) ) ) + ( TQT_BASE_OBJECT(o) != TQT_BASE_OBJECT(formWindow) && !formWindow->widgets()->tqfind( (TQWidget*)o ) ) ) return; TQWidget *w = (TQWidget*)o; if ( w->isVisibleTo( formWindow ) ) { - if ( !::qt_cast<TQTabWidget*>(w) && !::qt_cast<TQWizard*>(w) ) { + if ( !::tqqt_cast<TQTabWidget*>(w) && !::tqqt_cast<TQWizard*>(w) ) { if ( !normalMenu ) normalMenu = formWindow->mainWindow()->setupNormalHierarchyMenu( this ); normalMenu->popup( p ); @@ -625,14 +625,14 @@ void HierarchyList::addTabPage() if ( !o || !o->isWidgetType() ) return; TQWidget *w = (TQWidget*)o; - if ( ::qt_cast<TQTabWidget*>(w) ) { + if ( ::tqqt_cast<TQTabWidget*>(w) ) { TQTabWidget *tw = (TQTabWidget*)w; AddTabPageCommand *cmd = new AddTabPageCommand( i18n( "Add Page to %1" ). arg( tw->name() ), formWindow, tw, "Tab" ); formWindow->commandHistory()->addCommand( cmd ); cmd->execute(); - } else if ( ::qt_cast<TQWizard*>(w) ) { + } else if ( ::tqqt_cast<TQWizard*>(w) ) { TQWizard *wiz = (TQWizard*)formWindow->mainContainer(); AddWizardPageCommand *cmd = new AddWizardPageCommand( i18n( "Add Page to %1" ). arg( wiz->name() ), formWindow, @@ -648,24 +648,24 @@ void HierarchyList::removeTabPage() if ( !o || !o->isWidgetType() ) return; TQWidget *w = (TQWidget*)o; - if ( ::qt_cast<TQTabWidget*>(w) ) { + if ( ::tqqt_cast<TQTabWidget*>(w) ) { TQTabWidget *tw = (TQTabWidget*)w; if ( tw->currentPage() ) { - QDesignerTabWidget *dtw = (QDesignerTabWidget*)tw; + TQDesignerTabWidget *dtw = (TQDesignerTabWidget*)tw; DeleteTabPageCommand *cmd = new DeleteTabPageCommand( i18n( "Delete Page %1 of %2" ). - arg( dtw->pageTitle() ).arg( tw->name() ), + tqarg( dtw->pageTitle() ).tqarg( tw->name() ), formWindow, tw, tw->currentPage() ); formWindow->commandHistory()->addCommand( cmd ); cmd->execute(); } - } else if ( ::qt_cast<TQWizard*>(w) ) { + } else if ( ::tqqt_cast<TQWizard*>(w) ) { TQWizard *wiz = (TQWizard*)formWindow->mainContainer(); if ( wiz->currentPage() ) { - QDesignerWizard *dw = (QDesignerWizard*)wiz; + TQDesignerWizard *dw = (TQDesignerWizard*)wiz; DeleteWizardPageCommand *cmd = new DeleteWizardPageCommand( i18n( "Delete Page %1 of %2" ). - arg( dw->pageTitle() ).arg( wiz->name() ), + tqarg( dw->pageTitle() ).tqarg( wiz->name() ), formWindow, wiz, wiz->indexOf( wiz->currentPage() ), TRUE ); formWindow->commandHistory()->addCommand( cmd ); @@ -676,8 +676,8 @@ void HierarchyList::removeTabPage() // ------------------------------------------------------------ -FormDefinitionView::FormDefinitionView( TQWidget *parent, FormWindow *fw ) - : HierarchyList( parent, fw, TRUE ) +FormDefinitionView::FormDefinitionView( TQWidget *tqparent, FormWindow *fw ) + : HierarchyList( tqparent, fw, TRUE ) { header()->hide(); removeColumn( 1 ); @@ -708,7 +708,7 @@ void FormDefinitionView::setup() TQStringList defs = lIface->definitions(); for ( TQStringList::Iterator dit = defs.begin(); dit != defs.end(); ++dit ) { HierarchyItem *itemDef = new HierarchyItem( HierarchyItem::DefinitionParent, this, 0, - i18n( *dit ), TQString::null, TQString::null ); + i18n( *dit ), TQString(), TQString() ); itemDef->setPixmap( 0, DesignerFolderPix ); itemDef->setOpen( TRUE ); TQStringList entries = @@ -716,7 +716,7 @@ void FormDefinitionView::setup() HierarchyItem *item = 0; for ( TQStringList::Iterator eit = entries.begin(); eit != entries.end(); ++eit ) { item = new HierarchyItem( HierarchyItem::Definition, - itemDef, item, *eit, TQString::null, TQString::null ); + itemDef, item, *eit, TQString(), TQString() ); item->setRenameEnabled( 0, TRUE ); } } @@ -751,31 +751,31 @@ void FormDefinitionView::setupVariables() } HierarchyItem *itemVar = new HierarchyItem( HierarchyItem::VarParent, this, 0, i18n( "Class Variables" ), - TQString::null, TQString::null ); + TQString(), TQString() ); itemVar->setPixmap( 0, DesignerFolderPix ); itemVar->setOpen( TRUE ); itemVarPriv = new HierarchyItem( HierarchyItem::VarPrivate, itemVar, 0, i18n( "private" ), - TQString::null, TQString::null ); + TQString(), TQString() ); itemVarProt = new HierarchyItem( HierarchyItem::VarProtected, itemVar, 0, i18n( "protected" ), - TQString::null, TQString::null ); + TQString(), TQString() ); itemVarPubl = new HierarchyItem( HierarchyItem::VarPublic, itemVar, 0, i18n( "public" ), - TQString::null, TQString::null ); + TQString(), TQString() ); - TQValueList<MetaDataBase::Variable> varList = MetaDataBase::variables( formWindow ); + TQValueList<MetaDataBase::Variable> varList = MetaDataBase::variables( TQT_TQOBJECT(formWindow) ); TQValueList<MetaDataBase::Variable>::Iterator it = --( varList.end() ); if ( !varList.isEmpty() && itemVar ) { for (;;) { TQListViewItem *item = 0; if ( (*it).varAccess == "public" ) item = new HierarchyItem( HierarchyItem::Variable, itemVarPubl, 0, (*it).varName, - TQString::null, TQString::null ); + TQString(), TQString() ); else if ( (*it).varAccess == "private" ) item = new HierarchyItem( HierarchyItem::Variable, itemVarPriv, 0, (*it).varName, - TQString::null, TQString::null ); + TQString(), TQString() ); else // default is protected item = new HierarchyItem( HierarchyItem::Variable, itemVarProt, 0, (*it).varName, - TQString::null, TQString::null ); + TQString(), TQString() ); item->setPixmap( 0, DesignerEditSlotsPix ); if ( it == varList.begin() ) break; @@ -832,27 +832,27 @@ void FormDefinitionView::refresh() itemFunct = new HierarchyItem( HierarchyItem::FunctParent, - this, 0, i18n( "Functions" ), TQString::null, TQString::null ); + this, 0, i18n( "Functions" ), TQString(), TQString() ); itemFunct->moveItem( i ); itemFunct->setPixmap( 0, DesignerFolderPix ); itemFunctPriv = new HierarchyItem( HierarchyItem::FunctPrivate, itemFunct, 0, - i18n( "private" ), TQString::null, TQString::null ); + i18n( "private" ), TQString(), TQString() ); itemFunctProt = new HierarchyItem( HierarchyItem::FunctProtected, itemFunct, 0, - i18n( "protected" ), TQString::null, TQString::null ); + i18n( "protected" ), TQString(), TQString() ); itemFunctPubl = new HierarchyItem( HierarchyItem::FunctPublic, itemFunct, 0, - i18n( "public" ), TQString::null, TQString::null ); + i18n( "public" ), TQString(), TQString() ); itemSlots = new HierarchyItem( HierarchyItem::SlotParent, - this, 0, i18n( "Slots" ), TQString::null, TQString::null ); + this, 0, i18n( "Slots" ), TQString(), TQString() ); itemSlots->setPixmap( 0, DesignerFolderPix ); itemPrivate = new HierarchyItem( HierarchyItem::SlotPrivate, itemSlots, 0, i18n( "private" ), - TQString::null, TQString::null ); + TQString(), TQString() ); itemProtected = new HierarchyItem( HierarchyItem::SlotProtected, itemSlots, 0, i18n( "protected" ), - TQString::null, TQString::null ); + TQString(), TQString() ); itemPublic = new HierarchyItem( HierarchyItem::SlotPublic, itemSlots, 0, i18n( "public" ), - TQString::null, TQString::null ); + TQString(), TQString() ); - TQValueList<MetaDataBase::Function> functionList = MetaDataBase::functionList( formWindow ); + TQValueList<MetaDataBase::Function> functionList = MetaDataBase::functionList( TQT_TQOBJECT(formWindow) ); TQValueList<MetaDataBase::Function>::Iterator it = --( functionList.end() ); if ( !functionList.isEmpty() && itemFunct ) { for (;;) { @@ -860,23 +860,23 @@ void FormDefinitionView::refresh() if ( (*it).type == "slot" ) { if ( (*it).access == "protected" ) item = new HierarchyItem( HierarchyItem::Slot, itemProtected, 0, (*it).function, - TQString::null, TQString::null ); + TQString(), TQString() ); else if ( (*it).access == "private" ) item = new HierarchyItem( HierarchyItem::Slot, itemPrivate, 0, (*it).function, - TQString::null, TQString::null ); + TQString(), TQString() ); else // default is public item = new HierarchyItem( HierarchyItem::Slot, itemPublic, 0, (*it).function, - TQString::null, TQString::null ); + TQString(), TQString() ); } else { if ( (*it).access == "protected" ) item = new HierarchyItem( HierarchyItem::Function, itemFunctProt, 0, (*it).function, - TQString::null, TQString::null ); + TQString(), TQString() ); else if ( (*it).access == "private" ) item = new HierarchyItem( HierarchyItem::Function, itemFunctPriv, 0, (*it).function, - TQString::null, TQString::null ); + TQString(), TQString() ); else // default is public item = new HierarchyItem( HierarchyItem::Function, itemFunctPubl, 0, (*it).function, - TQString::null, TQString::null ); + TQString(), TQString() ); } item->setPixmap( 0, DesignerEditSlotsPix ); if ( it == functionList.begin() ) @@ -953,13 +953,13 @@ void HierarchyList::insertEntry( TQListViewItem *i, const TQPixmap &pix, const T while ( after && after->nextSibling() ) after = after->nextSibling(); HierarchyItem *item = new HierarchyItem( getChildType( i->rtti() ), i, after, s, - TQString::null, TQString::null ); + TQString(), TQString() ); if ( !pix.isNull() ) item->setPixmap( 0, pix ); item->setRenameEnabled( 0, TRUE ); setCurrentItem( item ); ensureItemVisible( item ); - qApp->processEvents(); + tqApp->processEvents(); newItem = item; item->startRename( 0 ); } @@ -976,7 +976,7 @@ void FormDefinitionView::contentsMouseDoubleClickEvent( TQMouseEvent *e ) HierarchyItem::Type t = getChildType( i->rtti() ); if ( (int)t == i->rtti() ) - i = i->parent(); + i = i->tqparent(); if ( formWindow->project()->isCpp() ) switch( i->rtti() ) { @@ -1100,13 +1100,13 @@ void FormDefinitionView::showRMBMenu( TQListViewItem *i, const TQPoint &pos ) if ( !lIface ) return; if ( i->rtti() == HierarchyItem::Definition ) - i = i->parent(); + i = i->tqparent(); ListEditor dia( this, 0, TRUE ); - dia.setCaption( i18n( "Edit %1" ).arg( i->text( 0 ) ) ); + dia.setCaption( i18n( "Edit %1" ).tqarg( i->text( 0 ) ) ); TQStringList entries = lIface->definitionEntries( i->text( 0 ), MainWindow::self->designerInterface() ); dia.setList( entries ); dia.exec(); - Command *cmd = new EditDefinitionsCommand( i18n( "Edit %1" ).arg( i->text( 0 )), formWindow, + Command *cmd = new EditDefinitionsCommand( i18n( "Edit %1" ).tqarg( i->text( 0 )), formWindow, lIface, i->text( 0 ), dia.items() ); formWindow->commandHistory()->addCommand( cmd ); cmd->execute(); @@ -1114,7 +1114,7 @@ void FormDefinitionView::showRMBMenu( TQListViewItem *i, const TQPoint &pos ) } else if ( res == NEW ) { HierarchyItem::Type t = getChildType( i->rtti() ); if ( (int)t == i->rtti() ) - i = i->parent(); + i = i->tqparent(); switch( i->rtti() ) { case HierarchyItem::SlotPublic: execFunctionDialog( "public", "slot", TRUE ); @@ -1142,8 +1142,8 @@ void FormDefinitionView::showRMBMenu( TQListViewItem *i, const TQPoint &pos ) TQCString funct( MetaDataBase::normalizeFunction( i->text( 0 ) ).latin1() ); Command *cmd = new RemoveFunctionCommand( i18n( "Remove Function" ), formWindow, funct, - TQString::null, TQString::null, TQString::null, - TQString::null, formWindow->project()->language() ); + TQString(), TQString(), TQString(), + TQString(), formWindow->project()->language() ); formWindow->commandHistory()->addCommand( cmd ); cmd->execute(); formWindow->mainWindow()->objectHierarchy()->updateFormDefinitionView(); @@ -1153,7 +1153,7 @@ void FormDefinitionView::showRMBMenu( TQListViewItem *i, const TQPoint &pos ) formWindow->commandHistory()->addCommand( cmd ); cmd->execute(); } else { - TQListViewItem *p = i->parent(); + TQListViewItem *p = i->tqparent(); delete i; save( p, 0 ); } @@ -1178,9 +1178,9 @@ void FormDefinitionView::renamed( TQListViewItem *i ) { if ( newItem == i ) newItem = 0; - if ( !i->parent() ) + if ( !i->tqparent() ) return; - save( i->parent(), i ); + save( i->tqparent(), i ); } @@ -1197,7 +1197,7 @@ void FormDefinitionView::save( TQListViewItem *p, TQListViewItem *i ) varName = varName.simplifyWhiteSpace(); if ( varName[(int)varName.length() - 1] != ';' ) varName += ";"; - if ( MetaDataBase::hasVariable( formWindow, varName ) ) { + if ( MetaDataBase::hasVariable( TQT_TQOBJECT(formWindow), varName ) ) { TQMessageBox::information( this, i18n( "Edit Variables" ), i18n( "This variable has already been declared." ) ); } else { @@ -1218,7 +1218,7 @@ void FormDefinitionView::save( TQListViewItem *p, TQListViewItem *i ) lst << i->text( 0 ); i = i->nextSibling(); } - Command *cmd = new EditDefinitionsCommand( i18n( "Edit %1" ).arg( p->text( 0 ) ), formWindow, + Command *cmd = new EditDefinitionsCommand( i18n( "Edit %1" ).tqarg( p->text( 0 ) ), formWindow, lIface, p->text( 0 ), lst ); formWindow->commandHistory()->addCommand( cmd ); cmd->execute(); @@ -1235,8 +1235,8 @@ void FormDefinitionView::addVariable( const TQString &varName, const TQString &a // ------------------------------------------------------------ -HierarchyView::HierarchyView( TQWidget *parent ) - : TQTabWidget( parent, 0, WStyle_Customize | WStyle_NormalBorder | WStyle_Title | +HierarchyView::HierarchyView( TQWidget *tqparent ) + : TQTabWidget( tqparent, 0, WStyle_Customize | WStyle_NormalBorder | WStyle_Title | WStyle_Tool |WStyle_MinMax | WStyle_SysMenu ) { formwindow = 0; @@ -1255,20 +1255,20 @@ HierarchyView::HierarchyView( TQWidget *parent ) if ( !classBrowserInterfaceManager ) { classBrowserInterfaceManager = - new QPluginManager<ClassBrowserInterface>( IID_ClassBrowser, TQApplication::libraryPaths(), + new TQPluginManager<ClassBrowserInterface>( IID_ClassBrowser, TQApplication::libraryPaths(), MainWindow::self->pluginDirectory() ); } classBrowsers = new TQMap<TQString, ClassBrowser>(); TQStringList langs = MetaDataBase::languages(); for ( TQStringList::Iterator it = langs.begin(); it != langs.end(); ++it ) { - QInterfacePtr<ClassBrowserInterface> ciface = 0; + TQInterfacePtr<ClassBrowserInterface> ciface = 0; classBrowserInterfaceManager->queryInterface( *it, &ciface ); if ( ciface ) { ClassBrowser cb( ciface->createClassBrowser( this ), ciface ); addTab( cb.lv, i18n( "Class Declarations" ) ); setTabToolTip( cb.lv, i18n( "List of all classes and its declarations of the current source file" ) ); - ciface->onClick( this, TQT_SLOT( jumpTo( const TQString &, const TQString &, int ) ) ); + ciface->onClick( TQT_TQOBJECT(this), TQT_SLOT( jumpTo( const TQString &, const TQString &, int ) ) ); classBrowsers->insert( *it, cb ); setTabEnabled( cb.lv, FALSE ); } @@ -1307,7 +1307,7 @@ void HierarchyView::setFormWindow( FormWindow *fw, TQObject *o ) if ( fw == formwindow ) { if ( fw ) { if ( !fake ) - listview->setCurrent( (TQWidget*)o ); + listview->setCurrent( TQT_TQOBJECT(o) ); else listview->clear(); if ( MainWindow::self->qWorkspace()->activeWindow() == fw ) @@ -1330,7 +1330,7 @@ void HierarchyView::setFormWindow( FormWindow *fw, TQObject *o ) fView->setFormWindow( fw ); if ( !fake ) { listview->setup(); - listview->setCurrent( (TQWidget*)o ); + listview->setCurrent( TQT_TQOBJECT(o) ); } fView->setup(); @@ -1367,8 +1367,8 @@ void HierarchyView::showClassesTimeout() if ( !se->object() ) return; if ( se->formWindow() && se->formWindow()->project()->isCpp() ) { - setFormWindow( se->formWindow(), se->formWindow()->currentWidget() ); - MainWindow::self->propertyeditor()->setWidget( se->formWindow()->currentWidget(), + setFormWindow( se->formWindow(), TQT_TQOBJECT(se->formWindow()->currentWidget()) ); + MainWindow::self->propertyeditor()->setWidget( TQT_TQOBJECT(se->formWindow()->currentWidget()), se->formWindow() ); return; } @@ -1445,17 +1445,17 @@ void HierarchyView::widgetsRemoved( const TQWidgetList & ) void HierarchyView::namePropertyChanged( TQWidget *w, const TQVariant & ) { TQWidget *w2 = w; - if ( ::qt_cast<TQMainWindow*>(w) ) + if ( ::tqqt_cast<TQMainWindow*>(w) ) w2 = ( (TQMainWindow*)w )->centralWidget(); - listview->changeNameOf( w2, w->name() ); + listview->changeNameOf( TQT_TQOBJECT(w2), w->name() ); } void HierarchyView::databasePropertyChanged( TQWidget *w, const TQStringList& info ) { -#ifndef QT_NO_SQL +#ifndef TQT_NO_SQL TQString i = info.join( "." ); - listview->changeDatabaseOf( w, i ); + listview->changeDatabaseOf( TQT_TQOBJECT(w), i ); #endif } |