diff options
Diffstat (limited to 'kdevdesigner/designer/hierarchyview.cpp')
-rw-r--r-- | kdevdesigner/designer/hierarchyview.cpp | 158 |
1 files changed, 79 insertions, 79 deletions
diff --git a/kdevdesigner/designer/hierarchyview.cpp b/kdevdesigner/designer/hierarchyview.cpp index c6433cd0..138b9499 100644 --- a/kdevdesigner/designer/hierarchyview.cpp +++ b/kdevdesigner/designer/hierarchyview.cpp @@ -193,20 +193,20 @@ HierarchyList::HierarchyList( TQWidget *parent, FormWindow *fw, bool doConnects p.setColor( TQColorGroup::Base, TQColor( *backColor2 ) ); (void)*selectedBack; // hack setPalette( p ); - disconnect( header(), TQT_SIGNAL( sectionClicked( int ) ), - this, TQT_SLOT( changeSortColumn( int ) ) ); + disconnect( header(), TQ_SIGNAL( sectionClicked( int ) ), + this, TQ_SLOT( changeSortColumn( int ) ) ); setSorting( -1 ); setHScrollBarMode( AlwaysOff ); setVScrollBarMode( AlwaysOn ); if ( doConnects ) { - connect( this, TQT_SIGNAL( clicked( TQListViewItem * ) ), - this, TQT_SLOT( objectClicked( TQListViewItem * ) ) ); - connect( this, TQT_SIGNAL( doubleClicked( TQListViewItem * ) ), - this, TQT_SLOT( objectDoubleClicked( TQListViewItem * ) ) ); - connect( this, TQT_SIGNAL( returnPressed( TQListViewItem * ) ), - this, TQT_SLOT( objectClicked( TQListViewItem * ) ) ); - connect( this, TQT_SIGNAL( contextMenuRequested( TQListViewItem *, const TQPoint&, int ) ), - this, TQT_SLOT( showRMBMenu( TQListViewItem *, const TQPoint & ) ) ); + connect( this, TQ_SIGNAL( clicked( TQListViewItem * ) ), + this, TQ_SLOT( objectClicked( TQListViewItem * ) ) ); + connect( this, TQ_SIGNAL( doubleClicked( TQListViewItem * ) ), + this, TQ_SLOT( objectDoubleClicked( TQListViewItem * ) ) ); + connect( this, TQ_SIGNAL( returnPressed( TQListViewItem * ) ), + this, TQ_SLOT( objectClicked( TQListViewItem * ) ) ); + connect( this, TQ_SIGNAL( contextMenuRequested( TQListViewItem *, const TQPoint&, int ) ), + this, TQ_SLOT( showRMBMenu( TQListViewItem *, const TQPoint & ) ) ); } deselect = TRUE; setColumnWidthMode( 1, Manual ); @@ -249,39 +249,39 @@ TQObject *HierarchyList::handleObjectClick( TQListViewItem *i ) TQObject *o = findObject( i ); if ( !o ) return 0; - if ( TQT_BASE_OBJECT(formWindow) == TQT_BASE_OBJECT(o) ) { + if ( formWindow == o ) { if ( deselect ) formWindow->clearSelection( FALSE ); - formWindow->emitShowProperties( TQT_TQOBJECT(formWindow) ); + formWindow->emitShowProperties( formWindow ); return 0; } if ( o->isWidgetType() ) { TQWidget *w = (TQWidget*)o; if ( !formWindow->widgets()->find( w ) ) { - if ( ::tqqt_cast<TQWidgetStack*>(w->parent()) ) { - if (::tqqt_cast<TQTabWidget*>(w->parent()->parent()) ) { + if ( ::tqt_cast<TQWidgetStack*>(w->parent()) ) { + if (::tqt_cast<TQTabWidget*>(w->parent()->parent()) ) { ((TQTabWidget*)w->parent()->parent())->showPage( w ); - o = TQT_TQOBJECT((TQWidget*)w->parent()->parent()); - formWindow->emitUpdateProperties( TQT_TQOBJECT(formWindow->currentWidget()) ); - } else if ( ::tqqt_cast<TQWizard*>(w->parent()->parent()) ) { + o = (TQWidget*)w->parent()->parent(); + formWindow->emitUpdateProperties( formWindow->currentWidget() ); + } else if ( ::tqt_cast<TQWizard*>(w->parent()->parent()) ) { ((QDesignerWizard*)w->parent()->parent())-> setCurrentPage( ( (QDesignerWizard*)w->parent()->parent() )->pageNum( w ) ); - o = TQT_TQOBJECT((TQWidget*)w->parent()->parent()); - formWindow->emitUpdateProperties( TQT_TQOBJECT(formWindow->currentWidget()) ); + o = (TQWidget*)w->parent()->parent(); + formWindow->emitUpdateProperties( formWindow->currentWidget() ); } else { ( (TQWidgetStack*)w->parent() )->raiseWidget( w ); if ( (TQWidgetStack*)w->parent()->isA( "QDesignerWidgetStack" ) ) ( (QDesignerWidgetStack*)w->parent() )->updateButtons(); } - } else if ( ::tqqt_cast<TQMenuBar*>(w) || ::tqqt_cast<TQDockWindow*>(w) ) { - formWindow->setActiveObject( TQT_TQOBJECT(w) ); - } else if ( ::tqqt_cast<TQPopupMenu*>(w) ) { + } else if ( ::tqt_cast<TQMenuBar*>(w) || ::tqt_cast<TQDockWindow*>(w) ) { + formWindow->setActiveObject( w ); + } else if ( ::tqt_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 ( ::tqqt_cast<TQAction*>(o) ) { + } else if ( ::tqt_cast<TQAction*>(o) ) { MainWindow::self->actioneditor()->setCurrentAction( (TQAction*)o ); deselect = TRUE; } @@ -303,7 +303,7 @@ void HierarchyList::objectDoubleClicked( TQListViewItem *i ) if ( !w->parentWidget() || WidgetFactory::layoutType( w->parentWidget() ) == WidgetFactory::NoLayout ) w->raise(); - formWindow->selectWidget( TQT_TQOBJECT(w), TRUE ); + formWindow->selectWidget( 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( TQT_TQOBJECT(w), TRUE ); + formWindow->selectWidget( w, TRUE ); } } @@ -388,7 +388,7 @@ void HierarchyList::setup() if ( !widgetStacks ) widgetStacks = new TQPtrList<TQWidgetStack>; if ( w ) - insertObject( TQT_TQOBJECT(w), 0 ); + insertObject( w, 0 ); widgetStacks->clear(); } @@ -402,8 +402,8 @@ void HierarchyList::insertObject( TQObject *o, TQListViewItem *parent ) if ( TQString( o->name() ).startsWith( "qt_dead_widget_" ) ) return; bool fakeMainWindow = FALSE; - if ( ::tqqt_cast<TQMainWindow*>(o) ) { - TQObject *cw = TQT_TQOBJECT(( (TQMainWindow*)o )->centralWidget()); + if ( ::tqt_cast<TQMainWindow*>(o) ) { + TQObject *cw = ( (TQMainWindow*)o )->centralWidget(); if ( cw ) { o = cw; fakeMainWindow = TRUE; @@ -411,7 +411,7 @@ void HierarchyList::insertObject( TQObject *o, TQListViewItem *parent ) } TQListViewItem *item = 0; TQString className = WidgetFactory::classNameOf( o ); - if ( ::tqqt_cast<TQLayoutWidget*>(o) ) { + if ( ::tqt_cast<TQLayoutWidget*>(o) ) { switch ( WidgetFactory::layoutType( (TQWidget*)o ) ) { case WidgetFactory::HBox: className = "HBox"; @@ -433,21 +433,21 @@ void HierarchyList::insertObject( TQObject *o, TQListViewItem *parent ) #endif TQString name = o->name(); - if ( ::tqqt_cast<TQWidgetStack*>(o->parent()) ) { - if ( ::tqqt_cast<TQTabWidget*>(o->parent()->parent()) ) + if ( ::tqt_cast<TQWidgetStack*>(o->parent()) ) { + if ( ::tqt_cast<TQTabWidget*>(o->parent()->parent()) ) name = ( (TQTabWidget*)o->parent()->parent() )->tabLabel( (TQWidget*)o ); - else if ( ::tqqt_cast<TQWizard*>(o->parent()->parent()) ) + else if ( ::tqt_cast<TQWizard*>(o->parent()->parent()) ) name = ( (TQWizard*)o->parent()->parent() )->title( (TQWidget*)o ); } TQToolBox *tb; if ( o->parent() && o->parent()->parent() && - (tb = ::tqqt_cast<TQToolBox*>(o->parent()->parent()->parent())) ) + (tb = ::tqt_cast<TQToolBox*>(o->parent()->parent()->parent())) ) name = tb->itemLabel( tb->indexOf((TQWidget*)o) ); if ( fakeMainWindow ) { name = o->parent()->name(); - className = TQMAINWINDOW_OBJECT_NAME_STRING; + className = "TQMainWindow"; } if ( !parent ) @@ -457,18 +457,18 @@ void HierarchyList::insertObject( TQObject *o, TQListViewItem *parent ) item->setOpen( TRUE ); if ( !parent ) item->setPixmap( 0, DesignerFormPix ); - else if ( ::tqqt_cast<TQLayoutWidget*>(o) ) + else if ( ::tqt_cast<TQLayoutWidget*>(o) ) item->setPixmap( 0, DesignerLayoutPix ); else item->setPixmap( 0, WidgetDatabase::iconSet( WidgetDatabase::idFromClassName( WidgetFactory::classNameOf( o ) ) ). pixmap( TQIconSet::Small, TQIconSet::Normal ) ); - if ( ::tqqt_cast<TQAction*>(o) ) + if ( ::tqt_cast<TQAction*>(o) ) item->setPixmap( 0, ( (TQAction*)o )->iconSet().pixmap() ); ( (HierarchyItem*)item )->setObject( o ); TQObjectList l = o->childrenListObject(); - if ( ::tqqt_cast<QDesignerToolBar*>(o) ) + if ( ::tqt_cast<QDesignerToolBar*>(o) ) l.clear(); if ( !l.isEmpty() ) { TQObjectListIt it( l ); @@ -478,20 +478,20 @@ void HierarchyList::insertObject( TQObject *o, TQListViewItem *parent ) ( (TQWidget*)it.current() )->isHidden() ) continue; if ( !formWindow->widgets()->find( (TQWidget*)it.current() ) ) { - if ( ::tqqt_cast<TQWidgetStack*>(it.current()->parent()) || - ::tqqt_cast<TQWidgetStack*>(it.current()) ) { + if ( ::tqt_cast<TQWidgetStack*>(it.current()->parent()) || + ::tqt_cast<TQWidgetStack*>(it.current()) ) { TQObject *obj = it.current(); - QDesignerTabWidget *tw = ::tqqt_cast<QDesignerTabWidget*>(it.current()->parent()); - QDesignerWizard *dw = ::tqqt_cast<QDesignerWizard*>(it.current()->parent()); + QDesignerTabWidget *tw = ::tqt_cast<QDesignerTabWidget*>(it.current()->parent()); + QDesignerWizard *dw = ::tqt_cast<QDesignerWizard*>(it.current()->parent()); TQWidgetStack *stack = 0; - if ( dw || tw || ::tqqt_cast<TQWidgetStack*>(obj) ) + if ( dw || tw || ::tqt_cast<TQWidgetStack*>(obj) ) stack = (TQWidgetStack*)obj; else stack = (TQWidgetStack*)obj->parent(); if ( widgetStacks->findRef( stack ) != -1 ) continue; widgetStacks->append( stack ); - TQObjectList *l2 = stack->queryList( TQWIDGET_OBJECT_NAME_STRING, 0, TRUE, FALSE ); + TQObjectList *l2 = stack->queryList( "TQWidget", 0, TRUE, FALSE ); for ( obj = l2->last(); obj; obj = l2->prev() ) { if ( qstrcmp( obj->className(), "TQWidgetStackPrivate::Invisible" ) == 0 || @@ -505,12 +505,12 @@ void HierarchyList::insertObject( TQObject *o, TQListViewItem *parent ) insertObject( obj, item ); } delete l2; - } else if ( ::tqqt_cast<TQToolBox*>(it.current()->parent()) ) { - if ( !::tqqt_cast<TQScrollView*>(it.current()) ) + } else if ( ::tqt_cast<TQToolBox*>(it.current()->parent()) ) { + if ( !::tqt_cast<TQScrollView*>(it.current()) ) continue; TQToolBox *tb = (TQToolBox*)it.current()->parent(); for ( int i = tb->count() - 1; i >= 0; --i ) - insertObject( TQT_TQOBJECT(tb->item( i )), item ); + insertObject( tb->item( i ), item ); } continue; } @@ -528,9 +528,9 @@ void HierarchyList::insertObject( TQObject *o, TQListViewItem *parent ) for ( obj = l->first(); obj; obj = l->next() ) insertObject( obj, item ); delete l; - } else if ( ::tqqt_cast<QDesignerToolBar*>(o) || ::tqqt_cast<PopupMenuEditor*>(o) ) { + } else if ( ::tqt_cast<QDesignerToolBar*>(o) || ::tqt_cast<PopupMenuEditor*>(o) ) { TQPtrList<TQAction> actions; - if ( ::tqqt_cast<QDesignerToolBar*>(o) ) + if ( ::tqt_cast<QDesignerToolBar*>(o) ) actions = ( (QDesignerToolBar*)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 ( ::tqqt_cast<QDesignerAction*>(a) ) { + if ( ::tqt_cast<QDesignerAction*>(a) ) { QDesignerAction *da = (QDesignerAction*)a; if ( da->supportsMenu() ) insertObject( da, item ); else - insertObject( TQT_TQOBJECT(da->widget()), item ); - } else if ( ::tqqt_cast<QDesignerActionGroup*>(a) ) { + insertObject( da->widget(), item ); + } else if ( ::tqt_cast<QDesignerActionGroup*>(a) ) { insertObject( a, item ); } --it; } - } else if ( ::tqqt_cast<QDesignerActionGroup*>(o) && !o->childrenListObject().isEmpty() ) { + } else if ( ::tqt_cast<QDesignerActionGroup*>(o) && !o->childrenListObject().isEmpty() ) { TQObjectList l = o->childrenListObject(); for ( TQObject *obj = l.last(); obj; obj = l.prev() ) { - if ( ::tqqt_cast<QDesignerAction*>(obj) ) { + if ( ::tqt_cast<QDesignerAction*>(obj) ) { QDesignerAction *da = (QDesignerAction*)obj; if ( da->supportsMenu() ) insertObject( da, item ); else - insertObject( TQT_TQOBJECT(da->widget()), item ); - } else if ( ::tqqt_cast<QDesignerActionGroup*>(obj) ) { + insertObject( da->widget(), item ); + } else if ( ::tqt_cast<QDesignerActionGroup*>(obj) ) { insertObject( obj, item ); } } - } else if ( ::tqqt_cast<MenuBarEditor*>(o) ) { + } else if ( ::tqt_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( TQT_TQOBJECT(md->menu()), item ); + insertObject( md->menu(), item ); } } } @@ -599,12 +599,12 @@ void HierarchyList::showRMBMenu( TQListViewItem *i, const TQPoint & p ) return; if ( !o->isWidgetType() || - ( TQT_BASE_OBJECT(o) != TQT_BASE_OBJECT(formWindow) && !formWindow->widgets()->find( (TQWidget*)o ) ) ) + ( o != formWindow && !formWindow->widgets()->find( (TQWidget*)o ) ) ) return; TQWidget *w = (TQWidget*)o; if ( w->isVisibleTo( formWindow ) ) { - if ( !::tqqt_cast<TQTabWidget*>(w) && !::tqqt_cast<TQWizard*>(w) ) { + if ( !::tqt_cast<TQTabWidget*>(w) && !::tqt_cast<TQWizard*>(w) ) { if ( !normalMenu ) normalMenu = formWindow->mainWindow()->setupNormalHierarchyMenu( this ); normalMenu->popup( p ); @@ -612,8 +612,8 @@ void HierarchyList::showRMBMenu( TQListViewItem *i, const TQPoint & p ) if ( !tabWidgetMenu ) tabWidgetMenu = formWindow->mainWindow()->setupTabWidgetHierarchyMenu( - this, TQT_SLOT( addTabPage() ), - TQT_SLOT( removeTabPage() ) ); + this, TQ_SLOT( addTabPage() ), + TQ_SLOT( removeTabPage() ) ); tabWidgetMenu->popup( p ); } } @@ -625,14 +625,14 @@ void HierarchyList::addTabPage() if ( !o || !o->isWidgetType() ) return; TQWidget *w = (TQWidget*)o; - if ( ::tqqt_cast<TQTabWidget*>(w) ) { + if ( ::tqt_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 ( ::tqqt_cast<TQWizard*>(w) ) { + } else if ( ::tqt_cast<TQWizard*>(w) ) { TQWizard *wiz = (TQWizard*)formWindow->mainContainer(); AddWizardPageCommand *cmd = new AddWizardPageCommand( i18n( "Add Page to %1" ). arg( wiz->name() ), formWindow, @@ -648,7 +648,7 @@ void HierarchyList::removeTabPage() if ( !o || !o->isWidgetType() ) return; TQWidget *w = (TQWidget*)o; - if ( ::tqqt_cast<TQTabWidget*>(w) ) { + if ( ::tqt_cast<TQTabWidget*>(w) ) { TQTabWidget *tw = (TQTabWidget*)w; if ( tw->currentPage() ) { QDesignerTabWidget *dtw = (QDesignerTabWidget*)tw; @@ -659,7 +659,7 @@ void HierarchyList::removeTabPage() formWindow->commandHistory()->addCommand( cmd ); cmd->execute(); } - } else if ( ::tqqt_cast<TQWizard*>(w) ) { + } else if ( ::tqt_cast<TQWizard*>(w) ) { TQWizard *wiz = (TQWizard*)formWindow->mainContainer(); if ( wiz->currentPage() ) { QDesignerWizard *dw = (QDesignerWizard*)wiz; @@ -681,8 +681,8 @@ FormDefinitionView::FormDefinitionView( TQWidget *parent, FormWindow *fw ) { header()->hide(); removeColumn( 1 ); - connect( this, TQT_SIGNAL( itemRenamed( TQListViewItem *, int, const TQString & ) ), - this, TQT_SLOT( renamed( TQListViewItem * ) ) ); + connect( this, TQ_SIGNAL( itemRenamed( TQListViewItem *, int, const TQString & ) ), + this, TQ_SLOT( renamed( TQListViewItem * ) ) ); popupOpen = FALSE; } @@ -762,7 +762,7 @@ void FormDefinitionView::setupVariables() itemVarPubl = new HierarchyItem( HierarchyItem::VarPublic, itemVar, 0, i18n( "public" ), TQString(), TQString() ); - TQValueList<MetaDataBase::Variable> varList = MetaDataBase::variables( TQT_TQOBJECT(formWindow) ); + TQValueList<MetaDataBase::Variable> varList = MetaDataBase::variables( formWindow ); TQValueList<MetaDataBase::Variable>::Iterator it = --( varList.end() ); if ( !varList.isEmpty() && itemVar ) { for (;;) { @@ -852,7 +852,7 @@ void FormDefinitionView::refresh() itemPublic = new HierarchyItem( HierarchyItem::SlotPublic, itemSlots, 0, i18n( "public" ), TQString(), TQString() ); - TQValueList<MetaDataBase::Function> functionList = MetaDataBase::functionList( TQT_TQOBJECT(formWindow) ); + TQValueList<MetaDataBase::Function> functionList = MetaDataBase::functionList( formWindow ); TQValueList<MetaDataBase::Function>::Iterator it = --( functionList.end() ); if ( !functionList.isEmpty() && itemFunct ) { for (;;) { @@ -1197,7 +1197,7 @@ void FormDefinitionView::save( TQListViewItem *p, TQListViewItem *i ) varName = varName.simplifyWhiteSpace(); if ( varName[(int)varName.length() - 1] != ';' ) varName += ";"; - if ( MetaDataBase::hasVariable( TQT_TQOBJECT(formWindow), varName ) ) { + if ( MetaDataBase::hasVariable( formWindow, varName ) ) { TQMessageBox::information( this, i18n( "Edit Variables" ), i18n( "This variable has already been declared." ) ); } else { @@ -1268,7 +1268,7 @@ HierarchyView::HierarchyView( TQWidget *parent ) 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( TQT_TQOBJECT(this), TQT_SLOT( jumpTo( const TQString &, const TQString &, int ) ) ); + ciface->onClick( this, TQ_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( TQT_TQOBJECT(o) ); + listview->setCurrent( 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( TQT_TQOBJECT(o) ); + listview->setCurrent( o ); } fView->setup(); @@ -1356,7 +1356,7 @@ void HierarchyView::showClasses( SourceEditor *se ) return; lastSourceEditor = se; - TQTimer::singleShot( 100, this, TQT_SLOT( showClassesTimeout() ) ); + TQTimer::singleShot( 100, this, TQ_SLOT( showClassesTimeout() ) ); } void HierarchyView::showClassesTimeout() @@ -1367,8 +1367,8 @@ void HierarchyView::showClassesTimeout() if ( !se->object() ) return; if ( se->formWindow() && se->formWindow()->project()->isCpp() ) { - setFormWindow( se->formWindow(), TQT_TQOBJECT(se->formWindow()->currentWidget()) ); - MainWindow::self->propertyeditor()->setWidget( TQT_TQOBJECT(se->formWindow()->currentWidget()), + setFormWindow( se->formWindow(), se->formWindow()->currentWidget() ); + MainWindow::self->propertyeditor()->setWidget( se->formWindow()->currentWidget(), se->formWindow() ); return; } @@ -1445,9 +1445,9 @@ void HierarchyView::widgetsRemoved( const TQWidgetList & ) void HierarchyView::namePropertyChanged( TQWidget *w, const TQVariant & ) { TQWidget *w2 = w; - if ( ::tqqt_cast<TQMainWindow*>(w) ) + if ( ::tqt_cast<TQMainWindow*>(w) ) w2 = ( (TQMainWindow*)w )->centralWidget(); - listview->changeNameOf( TQT_TQOBJECT(w2), w->name() ); + listview->changeNameOf( w2, w->name() ); } @@ -1455,7 +1455,7 @@ void HierarchyView::databasePropertyChanged( TQWidget *w, const TQStringList& in { #ifndef TQT_NO_SQL TQString i = info.join( "." ); - listview->changeDatabaseOf( TQT_TQOBJECT(w), i ); + listview->changeDatabaseOf( w, i ); #endif } |