diff options
Diffstat (limited to 'kpovmodeler/pmdockwidget.cpp')
-rw-r--r-- | kpovmodeler/pmdockwidget.cpp | 112 |
1 files changed, 56 insertions, 56 deletions
diff --git a/kpovmodeler/pmdockwidget.cpp b/kpovmodeler/pmdockwidget.cpp index 7c0775ef..2f93ffbe 100644 --- a/kpovmodeler/pmdockwidget.cpp +++ b/kpovmodeler/pmdockwidget.cpp @@ -142,7 +142,7 @@ PMDockMainWindow::PMDockMainWindow( TQWidget* parent, const char *name, WFlags f mainDockWidget = 0L; d = new PMDockMainWindowPrivate( ); - PartBase::setPartObject( TQT_TQOBJECT(this) ); + PartBase::setPartObject( this ); } PMDockMainWindow::~PMDockMainWindow() @@ -171,15 +171,15 @@ void PMDockMainWindow::createGUI( Part * part ) factory->removeClient( d->m_activePart ); - disconnect( d->m_activePart, TQT_SIGNAL( setWindowCaption( const TQString & ) ), - this, TQT_SLOT( setCaption( const TQString & ) ) ); - disconnect( d->m_activePart, TQT_SIGNAL( setStatusBarText( const TQString & ) ), - this, TQT_SLOT( slotSetStatusBarText( const TQString & ) ) ); + disconnect( d->m_activePart, TQ_SIGNAL( setWindowCaption( const TQString & ) ), + this, TQ_SLOT( setCaption( const TQString & ) ) ); + disconnect( d->m_activePart, TQ_SIGNAL( setStatusBarText( const TQString & ) ), + this, TQ_SLOT( slotSetStatusBarText( const TQString & ) ) ); } if( !d->m_bShellGUIActivated ) { - loadPlugins( TQT_TQOBJECT(this), this, TDEGlobal::instance() ); + loadPlugins( this, this, TDEGlobal::instance() ); createShellGUI(); d->m_bShellGUIActivated = true; } @@ -187,10 +187,10 @@ void PMDockMainWindow::createGUI( Part * part ) if ( part ) { // do this before sending the activate event - connect( part, TQT_SIGNAL( setWindowCaption( const TQString & ) ), - this, TQT_SLOT( setCaption( const TQString & ) ) ); - connect( part, TQT_SIGNAL( setStatusBarText( const TQString & ) ), - this, TQT_SLOT( slotSetStatusBarText( const TQString & ) ) ); + connect( part, TQ_SIGNAL( setWindowCaption( const TQString & ) ), + this, TQ_SLOT( setCaption( const TQString & ) ) ); + connect( part, TQ_SIGNAL( setStatusBarText( const TQString & ) ), + this, TQ_SLOT( slotSetStatusBarText( const TQString & ) ) ); factory->addClient( part ); @@ -256,7 +256,7 @@ void PMDockMainWindow::setMainDockWidget( PMDockWidget* mdw ) void PMDockMainWindow::setView( TQWidget *view ) { if ( view->isA("PMDockWidget") ){ - if ( TQT_BASE_OBJECT(view->parent()) != TQT_BASE_OBJECT(this) ) ((PMDockWidget*)view)->applyToWidget( this ); + if ( view->parent() != this ) ((PMDockWidget*)view)->applyToWidget( this ); } #ifndef NO_KDE2 @@ -337,7 +337,7 @@ void PMDockWidgetHeaderDrag::paintEvent( TQPaintEvent* ) paint.begin( this ); - style().tqdrawPrimitive (TQStyle::PE_DockWindowHandle, &paint, TQRect(0,0,width(), height()), colorGroup()); + style().drawPrimitive (TQStyle::PE_DockWindowHandle, &paint, TQRect(0,0,width(), height()), colorGroup()); paint.end(); } @@ -359,24 +359,24 @@ PMDockWidgetHeader::PMDockWidgetHeader( PMDockWidget* parent, const char* name ) closeButton->setPixmap( const_cast< const char** >(close_xpm) ); int buttonWidth = 9, buttonHeight = 9; closeButton->setFixedSize(buttonWidth,buttonHeight); - connect( closeButton, TQT_SIGNAL(clicked()), parent, TQT_SIGNAL(headerCloseButtonClicked())); + connect( closeButton, TQ_SIGNAL(clicked()), parent, TQ_SIGNAL(headerCloseButtonClicked())); // MODIFICATION (zehender) // The shell will delete the widget // undock is unnecessary - // connect( closeButton, TQT_SIGNAL(clicked()), parent, TQT_SLOT(undock())); + // connect( closeButton, TQ_SIGNAL(clicked()), parent, TQ_SLOT(undock())); stayButton = new PMDockButton_Private( this, "DockStayButton" ); stayButton->setToggleButton( true ); stayButton->setPixmap( const_cast< const char** >(not_close_xpm) ); stayButton->setFixedSize(buttonWidth,buttonHeight); - connect( stayButton, TQT_SIGNAL(clicked()), this, TQT_SLOT(slotStayClicked())); + connect( stayButton, TQ_SIGNAL(clicked()), this, TQ_SLOT(slotStayClicked())); stayButton->hide( ); dockbackButton = new PMDockButton_Private( this, "DockbackButton" ); dockbackButton->setPixmap( const_cast< const char** >(dockback_xpm)); dockbackButton->setFixedSize(buttonWidth,buttonHeight); - connect( dockbackButton, TQT_SIGNAL(clicked()), parent, TQT_SIGNAL(headerDockbackButtonClicked())); - connect( dockbackButton, TQT_SIGNAL(clicked()), parent, TQT_SLOT(dockBack())); + connect( dockbackButton, TQ_SIGNAL(clicked()), parent, TQ_SIGNAL(headerDockbackButtonClicked())); + connect( dockbackButton, TQ_SIGNAL(clicked()), parent, TQ_SLOT(dockBack())); // MODIFICATION (zehender) // Add a button to undock the widget and dock it as top level @@ -384,7 +384,7 @@ PMDockWidgetHeader::PMDockWidgetHeader( PMDockWidget* parent, const char* name ) toDesktopButton = new PMDockButton_Private( this, "ToDesktopButton" ); toDesktopButton->setPixmap( const_cast< const char** >(todesktop_xpm)); toDesktopButton->setFixedSize(buttonWidth,buttonHeight); - connect( toDesktopButton, TQT_SIGNAL(clicked()), parent, TQT_SLOT(toDesktop())); + connect( toDesktopButton, TQ_SIGNAL(clicked()), parent, TQ_SLOT(toDesktop())); layout->addWidget( drag ); layout->addWidget( dockbackButton ); @@ -485,7 +485,7 @@ PMDockWidget::PMDockWidget( PMDockManager* dockManager, const char* name, const layout->setResizeMode( TQLayout::Minimum ); manager = dockManager; - manager->childDock->append( TQT_TQOBJECT(this) ); + manager->childDock->append( this ); installEventFilter( manager ); header = 0L; @@ -509,7 +509,7 @@ PMDockWidget::PMDockWidget( PMDockManager* dockManager, const char* name, const setIcon( pixmap); widget = 0L; - TQObject::connect(this, TQT_SIGNAL(hasUndocked()), manager->main, TQT_SLOT(slotDockWidgetUndocked()) ); + TQObject::connect(this, TQ_SIGNAL(hasUndocked()), manager->main, TQ_SLOT(slotDockWidgetUndocked()) ); applyToWidget( parent, TQPoint(0,0) ); } @@ -527,7 +527,7 @@ PMDockWidget::~PMDockWidget() d->blockHasUndockedSignal = false; } emit iMBeingClosed(); - manager->childDock->remove( TQT_TQOBJECT(this) ); + manager->childDock->remove( this ); delete pix; delete d; // destroy private data } @@ -559,7 +559,7 @@ void PMDockWidget::setEnableDocking( int pos ) void PMDockWidget::updateHeader() { if ( parent() ){ - if ( (TQT_BASE_OBJECT(parent()) == TQT_BASE_OBJECT(manager->main)) || isGroup || (eDocking == PMDockWidget::DockNone) ){ + if ( (parent() == manager->main) || isGroup || (eDocking == PMDockWidget::DockNone) ){ header->hide(); } else { header->setTopLevel( false ); @@ -573,7 +573,7 @@ void PMDockWidget::updateHeader() void PMDockWidget::applyToWidget( TQWidget* s, const TQPoint& p ) { - if ( TQT_BASE_OBJECT(parent()) != TQT_BASE_OBJECT(s) ) + if ( parent() != s ) { hide(); reparent(s, 0, TQPoint(0,0), false); @@ -798,7 +798,7 @@ PMDockWidget* PMDockWidget::manualDock( PMDockWidget* target, DockPosition dockP if( pw->inherits( "PMDockSplitter" ) ) { PMDockSplitter* ds = ( PMDockSplitter* ) pw; - if( ds->splitterOrientation( ) ==Qt::Vertical ) + if( ds->splitterOrientation( ) ==TQt::Vertical ) found = true; } } @@ -837,8 +837,8 @@ PMDockWidget* PMDockWidget::manualDock( PMDockWidget* target, DockPosition dockP if( target->formerBrotherDockWidget != 0L) { newDock->formerBrotherDockWidget = target->formerBrotherDockWidget; if( formerBrotherDockWidget != 0L) - TQObject::connect( newDock->formerBrotherDockWidget, TQT_SIGNAL(iMBeingClosed()), - newDock, TQT_SLOT(loseFormerBrotherDockWidget()) ); + TQObject::connect( newDock->formerBrotherDockWidget, TQ_SIGNAL(iMBeingClosed()), + newDock, TQ_SLOT(loseFormerBrotherDockWidget()) ); target->loseFormerBrotherDockWidget(); } newDock->formerDockPos = target->formerDockPos; @@ -846,7 +846,7 @@ PMDockWidget* PMDockWidget::manualDock( PMDockWidget* target, DockPosition dockP if ( dockPos == PMDockWidget::DockCenter ) { PMDockTabGroup* tab = new PMDockTabGroup( newDock, "_dock_tab"); - TQObject::connect(tab, TQT_SIGNAL(currentChanged(TQWidget*)), d, TQT_SLOT(slotFocusEmbeddedWidget(TQWidget*))); + TQObject::connect(tab, TQ_SIGNAL(currentChanged(TQWidget*)), d, TQ_SLOT(slotFocusEmbeddedWidget(TQWidget*))); newDock->setWidget( tab ); target->applyToWidget( tab ); @@ -874,13 +874,13 @@ PMDockWidget* PMDockWidget::manualDock( PMDockWidget* target, DockPosition dockP // if to dock not to the center of the target dockwidget, // dock to newDock PMDockSplitter* panner = 0L; - if ( dockPos == PMDockWidget::DockTop || dockPos == PMDockWidget::DockBottom ) panner = new PMDockSplitter( newDock, "_dock_split_",Qt::Horizontal, spliPos, manager->splitterHighResolution() ); - if ( dockPos == PMDockWidget::DockLeft || dockPos == PMDockWidget::DockRight ) panner = new PMDockSplitter( newDock, "_dock_split_",Qt::Vertical , spliPos, manager->splitterHighResolution() ); + if ( dockPos == PMDockWidget::DockTop || dockPos == PMDockWidget::DockBottom ) panner = new PMDockSplitter( newDock, "_dock_split_",TQt::Horizontal, spliPos, manager->splitterHighResolution() ); + if ( dockPos == PMDockWidget::DockLeft || dockPos == PMDockWidget::DockRight ) panner = new PMDockSplitter( newDock, "_dock_split_",TQt::Vertical , spliPos, manager->splitterHighResolution() ); newDock->setWidget( panner ); panner->setOpaqueResize(manager->splitterOpaqueResize()); panner->setKeepSize(manager->splitterKeepSize()); - panner->setFocusPolicy( TQ_NoFocus ); + panner->setFocusPolicy( TQWidget::NoFocus ); target->applyToWidget( panner ); applyToWidget( panner ); target->formerDockPos = target->currentDockPos; @@ -969,8 +969,8 @@ void PMDockWidget::undock() d->index = parentTab->indexOf( this); // memorize the page position in the tab widget parentTab->removePage( this ); formerBrotherDockWidget = (PMDockWidget*)parentTab->page(0); - TQObject::connect( formerBrotherDockWidget, TQT_SIGNAL(iMBeingClosed()), - this, TQT_SLOT(loseFormerBrotherDockWidget()) ); + TQObject::connect( formerBrotherDockWidget, TQ_SIGNAL(iMBeingClosed()), + this, TQ_SLOT(loseFormerBrotherDockWidget()) ); applyToWidget( 0L ); if ( parentTab->count() == 1 ){ @@ -994,13 +994,13 @@ void PMDockWidget::undock() split->deactivate(); if ( split->getFirst() == parentOfTab ){ split->activate( lastTab ); - if ( ((PMDockWidget*)split->parent())->splitterOrientation ==Qt::Vertical ) + if ( ((PMDockWidget*)split->parent())->splitterOrientation ==TQt::Vertical ) emit ((PMDockWidget*)split->getAnother(parentOfTab))->docking( parentOfTab, PMDockWidget::DockLeft ); else emit ((PMDockWidget*)split->getAnother(parentOfTab))->docking( parentOfTab, PMDockWidget::DockTop ); } else { split->activate( 0L, lastTab ); - if ( ((PMDockWidget*)split->parent())->splitterOrientation ==Qt::Vertical ) + if ( ((PMDockWidget*)split->parent())->splitterOrientation ==TQt::Vertical ) emit ((PMDockWidget*)split->getAnother(parentOfTab))->docking( parentOfTab, PMDockWidget::DockRight ); else emit ((PMDockWidget*)split->getAnother(parentOfTab))->docking( parentOfTab, PMDockWidget::DockBottom ); @@ -1034,8 +1034,8 @@ void PMDockWidget::undock() group->hide(); if( formerBrotherDockWidget != 0L) - TQObject::connect( formerBrotherDockWidget, TQT_SIGNAL(iMBeingClosed()), - this, TQT_SLOT(loseFormerBrotherDockWidget()) ); + TQObject::connect( formerBrotherDockWidget, TQ_SIGNAL(iMBeingClosed()), + this, TQ_SLOT(loseFormerBrotherDockWidget()) ); if ( !group->parentWidget() ){ secondWidget->applyToWidget( 0L, group->frameGeometry().topLeft() ); @@ -1081,7 +1081,7 @@ void PMDockWidget::setWidget( TQWidget* mw ) { if ( !mw ) return; - if ( TQT_BASE_OBJECT(mw->parent()) != TQT_BASE_OBJECT(this) ){ + if ( mw->parent() != this ){ mw->reparent(this, 0, TQPoint(0,0), false); } @@ -1118,13 +1118,13 @@ void PMDockWidget::setDockTabName( PMDockTabGroup* tab ) bool PMDockWidget::mayBeHide() const { - bool f = (TQT_BASE_OBJECT(parent()) != TQT_BASE_OBJECT(manager->main)); + bool f = (parent() != manager->main); return ( !isGroup && !isTabGroup && f && isVisible() && ( eDocking != (int)PMDockWidget::DockNone ) ); } bool PMDockWidget::mayBeShow() const { - bool f = (TQT_BASE_OBJECT(parent()) != TQT_BASE_OBJECT(manager->main)); + bool f = (parent() != manager->main); return ( !isGroup && !isTabGroup && f && !isVisible() ); } @@ -1165,8 +1165,8 @@ void PMDockWidget::makeDockVisible() void PMDockWidget::loseFormerBrotherDockWidget() { if( formerBrotherDockWidget != 0L) - TQObject::disconnect( formerBrotherDockWidget, TQT_SIGNAL(iMBeingClosed()), - this, TQT_SLOT(loseFormerBrotherDockWidget()) ); + TQObject::disconnect( formerBrotherDockWidget, TQ_SIGNAL(iMBeingClosed()), + this, TQ_SLOT(loseFormerBrotherDockWidget()) ); formerBrotherDockWidget = 0L; repaint(); } @@ -1276,8 +1276,8 @@ PMDockManager::PMDockManager( TQWidget* mainWindow , const char* name ) menu = new TQPopupMenu(); #endif - connect( menu, TQT_SIGNAL(aboutToShow()), TQT_SLOT(slotMenuPopup()) ); - connect( menu, TQT_SIGNAL(activated(int)), TQT_SLOT(slotMenuActivated(int)) ); + connect( menu, TQ_SIGNAL(aboutToShow()), TQ_SLOT(slotMenuPopup()) ); + connect( menu, TQ_SIGNAL(activated(int)), TQ_SLOT(slotMenuActivated(int)) ); childDock = new TQObjectList(); childDock->setAutoDelete( false ); @@ -1310,7 +1310,7 @@ void PMDockManager::activate() obj->show(); } } - if ( !main->inherits(TQDIALOG_OBJECT_NAME_STRING) ) main->show(); + if ( !main->inherits("TQDialog") ) main->show(); } bool PMDockManager::eventFilter( TQObject *obj, TQEvent *event ) @@ -1343,7 +1343,7 @@ bool PMDockManager::eventFilter( TQObject *obj, TQEvent *event ) else curdw->toDesktop( ); break; case TQEvent::MouseButtonPress: - if ( ((TQMouseEvent*)event)->button() == Qt::LeftButton ){ + if ( ((TQMouseEvent*)event)->button() == TQt::LeftButton ){ if ( curdw->eDocking != (int)PMDockWidget::DockNone ){ dropCancel = true; curdw->setFocus(); @@ -1367,7 +1367,7 @@ bool PMDockManager::eventFilter( TQObject *obj, TQEvent *event ) } break; case TQEvent::MouseButtonRelease: - if ( ((TQMouseEvent*)event)->button() == Qt::LeftButton ){ + if ( ((TQMouseEvent*)event)->button() == TQt::LeftButton ){ if ( draging ){ if ( !dropCancel ) drop(); @@ -1426,7 +1426,7 @@ bool PMDockManager::eventFilter( TQObject *obj, TQEvent *event ) if (d->readyToDrag) { d->readyToDrag = false; } - if ( (((TQMouseEvent*)event)->state() == Qt::LeftButton) && + if ( (((TQMouseEvent*)event)->state() == TQt::LeftButton) && (curdw->eDocking != (int)PMDockWidget::DockNone) ) { startDrag( curdw); } @@ -1464,8 +1464,8 @@ PMDockWidget* PMDockManager::findDockWidgetAt( const TQPoint& pos ) } w = p; } - if ( tqt_find_obj_child( TQT_TQOBJECT(w), "PMDockSplitter", "_dock_split_" ) ) return 0L; - if ( tqt_find_obj_child( TQT_TQOBJECT(w), "PMDockTabGroup", "_dock_tab" ) ) return 0L; + if ( tqt_find_obj_child( w, "PMDockSplitter", "_dock_split_" ) ) return 0L; + if ( tqt_find_obj_child( w, "PMDockTabGroup", "_dock_tab" ) ) return 0L; if (!childDockWidgetList) return 0L; if ( childDockWidgetList->find(w) != -1 ) return 0L; if ( currentDragWidget->isGroup && ((PMDockWidget*)w)->parentDockTabGroup() ) return 0L; @@ -1800,7 +1800,7 @@ void PMDockManager::writeConfig(TQDomElement &base) TQObjectListIt it(*childDock); PMDockWidget *obj1; while ( (obj1=(PMDockWidget*)it.current()) ) { - if ( TQT_BASE_OBJECT(obj1->parent()) == TQT_BASE_OBJECT(main) ) + if ( obj1->parent() == main ) mainWidgetStr = TQString::fromLatin1(obj1->name()); nList.append(obj1->name()); ++it; @@ -1915,7 +1915,7 @@ void PMDockManager::readConfig(TQDomElement &base) PMDockWidget *second = getDockWidgetFromName(secondName); if (first && second) { obj = first->manualDock(second, - (orientation == (int)Qt::Vertical)? PMDockWidget::DockLeft : PMDockWidget::DockTop, + (orientation == (int)TQt::Vertical)? PMDockWidget::DockLeft : PMDockWidget::DockTop, separatorPos); if (obj) obj->setName(name.latin1()); @@ -2020,7 +2020,7 @@ void PMDockManager::writeConfig( TDEConfig* c, TQString group ) ++it; //debug(" +Add subdock %s", obj->name()); nList.append( obj->name() ); - if ( TQT_BASE_OBJECT(obj->parent()) == TQT_BASE_OBJECT(main) ) + if ( obj->parent() == main ) c->writeEntry( "Main:view", obj->name() ); } @@ -2165,9 +2165,9 @@ void PMDockManager::readConfig( TDEConfig* c, TQString group ) PMDockWidget* last = getDockWidgetFromName( c->readEntry( oname + ":last_name" ) ); int sepPos = c->readNumEntry( oname + ":sepPos" ); - Qt::Orientation p = (Qt::Orientation)c->readNumEntry( oname + ":orientation" ); + TQt::Orientation p = (TQt::Orientation)c->readNumEntry( oname + ":orientation" ); if ( first && last ){ - obj = first->manualDock( last, ( p ==Qt::Vertical ) ? PMDockWidget::DockLeft : PMDockWidget::DockTop, sepPos ); + obj = first->manualDock( last, ( p ==TQt::Vertical ) ? PMDockWidget::DockLeft : PMDockWidget::DockTop, sepPos ); if (obj){ obj->setName( oname.latin1() ); } @@ -2271,7 +2271,7 @@ PMDockWidget* PMDockManager::getDockWidgetFromName( const TQString& dockName ) PMDockWidget* autoCreate = 0L; if ( autoCreateDock ){ autoCreate = new PMDockWidget( this, dockName.latin1(), TQPixmap(TQString("")) ); - autoCreateDock->append( TQT_TQOBJECT(autoCreate) ); + autoCreateDock->append( autoCreate ); } return autoCreate; } @@ -2468,7 +2468,7 @@ void PMDockArea::resizeEvent(TQResizeEvent *rsize) #ifndef NO_KDE2 kdDebug()<<"PMDockArea::resize"<<endl; #endif - TQObjectList *list=queryList(TQWIDGET_OBJECT_NAME_STRING,0,false); + TQObjectList *list=queryList("TQWidget",0,false); TQObjectListIt it( *list ); // iterate over the buttons TQObject *obj; |