diff options
Diffstat (limited to 'lib/compatibility/kmdi/qextmdi/kdockwidget.cpp')
-rw-r--r-- | lib/compatibility/kmdi/qextmdi/kdockwidget.cpp | 784 |
1 files changed, 392 insertions, 392 deletions
diff --git a/lib/compatibility/kmdi/qextmdi/kdockwidget.cpp b/lib/compatibility/kmdi/qextmdi/kdockwidget.cpp index 1a1e56ae..89417231 100644 --- a/lib/compatibility/kmdi/qextmdi/kdockwidget.cpp +++ b/lib/compatibility/kmdi/qextmdi/kdockwidget.cpp @@ -21,16 +21,16 @@ #include "kdockwidget_private.h" #include "kdockwidget_p.h" -#include <qapplication.h> -#include <qlayout.h> -#include <qpainter.h> -#include <qobjectlist.h> -#include <qstrlist.h> -#include <qcursor.h> -#include <qwidgetlist.h> -#include <qtabwidget.h> -#include <qtooltip.h> -#include <qstyle.h> +#include <tqapplication.h> +#include <tqlayout.h> +#include <tqpainter.h> +#include <tqobjectlist.h> +#include <tqstrlist.h> +#include <tqcursor.h> +#include <tqwidgetlist.h> +#include <tqtabwidget.h> +#include <tqtooltip.h> +#include <tqstyle.h> #ifndef NO_KDE2 #include <kconfig.h> @@ -49,8 +49,8 @@ #endif #else -#include <qtoolbar.h> -#include <qpopupmenu.h> +#include <tqtoolbar.h> +#include <tqpopupmenu.h> #endif #include <stdlib.h> @@ -99,10 +99,10 @@ static const char* const not_close_xpm[]={ * * @author Max Judin. */ -KDockMainWindow::KDockMainWindow( QWidget* parent, const char *name, WFlags f) +KDockMainWindow::KDockMainWindow( TQWidget* parent, const char *name, WFlags f) :KMainWindow( parent, name, f ) { - QString new_name = QString(name) + QString("_DockManager"); + TQString new_name = TQString(name) + TQString("_DockManager"); dockManager = new KDockManager( this, new_name.latin1() ); mainDockWidget = 0L; } @@ -119,7 +119,7 @@ void KDockMainWindow::setMainDockWidget( KDockWidget* mdw ) dockManager->setMainDockWidget2(mdw); } -void KDockMainWindow::setView( QWidget *view ) +void KDockMainWindow::setView( TQWidget *view ) { if ( view->isA("KDockWidget") ){ if ( view->parent() != this ) ((KDockWidget*)view)->applyToWidget( this ); @@ -128,11 +128,11 @@ void KDockMainWindow::setView( QWidget *view ) #ifndef NO_KDE2 KMainWindow::setCentralWidget(view); #else - QMainWindow::setCentralWidget(view); + TQMainWindow::setCentralWidget(view); #endif } -KDockWidget* KDockMainWindow::createDockWidget( const QString& name, const QPixmap &pixmap, QWidget* parent, const QString& strCaption, const QString& strTabPageLabel) +KDockWidget* KDockMainWindow::createDockWidget( const TQString& name, const TQPixmap &pixmap, TQWidget* parent, const TQString& strCaption, const TQString& strTabPageLabel) { return new KDockWidget( dockManager, name.latin1(), pixmap, parent, strCaption, strTabPageLabel ); } @@ -149,28 +149,28 @@ void KDockMainWindow::makeDockInvisible( KDockWidget* dock ) dock->undock(); } -void KDockMainWindow::makeWidgetDockVisible( QWidget* widget ) +void KDockMainWindow::makeWidgetDockVisible( TQWidget* widget ) { makeDockVisible( dockManager->findWidgetParentDock(widget) ); } -void KDockMainWindow::writeDockConfig(QDomElement &base) +void KDockMainWindow::writeDockConfig(TQDomElement &base) { dockManager->writeConfig(base); } -void KDockMainWindow::readDockConfig(QDomElement &base) +void KDockMainWindow::readDockConfig(TQDomElement &base) { dockManager->readConfig(base); } #ifndef NO_KDE2 -void KDockMainWindow::writeDockConfig( KConfig* c, QString group ) +void KDockMainWindow::writeDockConfig( KConfig* c, TQString group ) { dockManager->writeConfig( c, group ); } -void KDockMainWindow::readDockConfig( KConfig* c, QString group ) +void KDockMainWindow::readDockConfig( KConfig* c, TQString group ) { dockManager->readConfig( c, group ); } @@ -178,7 +178,7 @@ void KDockMainWindow::readDockConfig( KConfig* c, QString group ) void KDockMainWindow::slotDockWidgetUndocked() { - QObject* pSender = (QObject*) sender(); + TQObject* pSender = (TQObject*) sender(); if (!pSender->inherits("KDockWidget")) return; KDockWidget* pDW = (KDockWidget*) pSender; emit dockWidgetHasUndocked( pDW); @@ -186,7 +186,7 @@ void KDockMainWindow::slotDockWidgetUndocked() /*************************************************************************/ KDockWidgetAbstractHeaderDrag::KDockWidgetAbstractHeaderDrag( KDockWidgetAbstractHeader* parent, KDockWidget* dock, const char* name ) -:QFrame( parent, name ) +:TQFrame( parent, name ) { dw = dock; installEventFilter( dock->dockManager() ); @@ -197,19 +197,19 @@ KDockWidgetHeaderDrag::KDockWidgetHeaderDrag( KDockWidgetAbstractHeader* parent, { } -void KDockWidgetHeaderDrag::paintEvent( QPaintEvent* ) +void KDockWidgetHeaderDrag::paintEvent( TQPaintEvent* ) { - QPainter paint; + TQPainter paint; paint.begin( this ); - style().drawPrimitive (QStyle::PE_DockWindowHandle, &paint, QRect(0,0,width(), height()), colorGroup()); + style().drawPrimitive (TQStyle::PE_DockWindowHandle, &paint, TQRect(0,0,width(), height()), colorGroup()); paint.end(); } /*************************************************************************/ KDockWidgetAbstractHeader::KDockWidgetAbstractHeader( KDockWidget* parent, const char* name ) -:QFrame( parent, name ) +:TQFrame( parent, name ) { } /*************************************************************************/ @@ -217,44 +217,44 @@ KDockWidgetHeader::KDockWidgetHeader( KDockWidget* parent, const char* name ) :KDockWidgetAbstractHeader( parent, name ) { #ifdef BORDERLESS_WINDOWS - setCursor(QCursor(ArrowCursor)); + setCursor(TQCursor(ArrowCursor)); #endif d = new KDockWidgetHeaderPrivate( this ); - layout = new QHBoxLayout( this ); - layout->setResizeMode( QLayout::Minimum ); + layout = new TQHBoxLayout( this ); + layout->setResizeMode( TQLayout::Minimum ); drag = new KDockWidgetHeaderDrag( this, parent ); closeButton = new KDockButton_Private( this, "DockCloseButton" ); - QToolTip::add( closeButton, i18n("Close") ); - closeButton->setPixmap( style().stylePixmap (QStyle::SP_TitleBarCloseButton , this)); + TQToolTip::add( closeButton, i18n("Close") ); + closeButton->setPixmap( style().stylePixmap (TQStyle::SP_TitleBarCloseButton , this)); closeButton->setFixedSize(closeButton->pixmap()->width(),closeButton->pixmap()->height()); - connect( closeButton, SIGNAL(clicked()), parent, SIGNAL(headerCloseButtonClicked())); - connect( closeButton, SIGNAL(clicked()), parent, SLOT(undock())); + connect( closeButton, TQT_SIGNAL(clicked()), parent, TQT_SIGNAL(headerCloseButtonClicked())); + connect( closeButton, TQT_SIGNAL(clicked()), parent, TQT_SLOT(undock())); stayButton = new KDockButton_Private( this, "DockStayButton" ); - QToolTip::add( stayButton, i18n("Freeze the window geometry", "Freeze") ); + TQToolTip::add( stayButton, i18n("Freeze the window geometry", "Freeze") ); stayButton->setToggleButton( true ); stayButton->setPixmap( const_cast< const char** >(not_close_xpm) ); stayButton->setFixedSize(closeButton->pixmap()->width(),closeButton->pixmap()->height()); - connect( stayButton, SIGNAL(clicked()), this, SLOT(slotStayClicked())); + connect( stayButton, TQT_SIGNAL(clicked()), this, TQT_SLOT(slotStayClicked())); dockbackButton = new KDockButton_Private( this, "DockbackButton" ); - QToolTip::add( dockbackButton, i18n("Dock this window", "Dock") ); + TQToolTip::add( dockbackButton, i18n("Dock this window", "Dock") ); dockbackButton->setPixmap( const_cast< const char** >(dockback_xpm)); dockbackButton->setFixedSize(closeButton->pixmap()->width(),closeButton->pixmap()->height()); - connect( dockbackButton, SIGNAL(clicked()), parent, SIGNAL(headerDockbackButtonClicked())); - connect( dockbackButton, SIGNAL(clicked()), parent, SLOT(dockBack())); + connect( dockbackButton, TQT_SIGNAL(clicked()), parent, TQT_SIGNAL(headerDockbackButtonClicked())); + connect( dockbackButton, TQT_SIGNAL(clicked()), parent, TQT_SLOT(dockBack())); d->toDesktopButton = new KDockButton_Private( this, "ToDesktopButton" ); - QToolTip::add( d->toDesktopButton, i18n("Detach") ); + TQToolTip::add( d->toDesktopButton, i18n("Detach") ); d->toDesktopButton->setPixmap( const_cast< const char** >(todesktop_xpm)); d->toDesktopButton->setFixedSize(closeButton->pixmap()->width(),closeButton->pixmap()->height()); - connect( d->toDesktopButton, SIGNAL(clicked()), parent, SLOT(toDesktop())); + connect( d->toDesktopButton, TQT_SIGNAL(clicked()), parent, TQT_SLOT(toDesktop())); stayButton->hide(); - d->dummy = new QWidget( this ); + d->dummy = new TQWidget( this ); d->dummy->setFixedSize( 1,closeButton->pixmap()->height() ); @@ -296,7 +296,7 @@ void KDockWidgetHeader::setTopLevel( bool isTopLevel ) bool dontShowDummy=drag->isVisibleTo(this) || dockbackButton->isVisibleTo(this) || d->toDesktopButton->isVisibleTo(this) || stayButton->isVisibleTo(this) || closeButton->isVisibleTo(this); - for (QPtrListIterator<KDockButton_Private> it( d->btns );it.current();++it) { + for (TQPtrListIterator<KDockButton_Private> it( d->btns );it.current();++it) { dontShowDummy=dontShowDummy || (it.current()->isVisibleTo(this)); } if (dontShowDummy) d->dummy->hide(); else d->dummy->show(); @@ -319,13 +319,13 @@ void KDockWidgetHeader::setDragPanel( KDockWidgetHeaderDrag* nd ) if ( !nd ) return; delete layout; - layout = new QHBoxLayout( this ); - layout->setResizeMode( QLayout::Minimum ); + layout = new TQHBoxLayout( this ); + layout->setResizeMode( TQLayout::Minimum ); delete drag; drag = nd; if (drag->parentWidget()!=this) { - drag->reparent(this,QPoint(0,0)); + drag->reparent(this,TQPoint(0,0)); } @@ -337,7 +337,7 @@ void KDockWidgetHeader::setDragPanel( KDockWidgetHeaderDrag* nd ) bool dontShowDummy=drag->isVisibleTo(this) || dockbackButton->isVisibleTo(this) || d->toDesktopButton->isVisibleTo(this) || stayButton->isVisibleTo(this) || closeButton->isVisibleTo(this); - for (QPtrListIterator<KDockButton_Private> it( d->btns );it.current();++it) { + for (TQPtrListIterator<KDockButton_Private> it( d->btns );it.current();++it) { layout->addWidget(it.current()); dontShowDummy=dontShowDummy || (it.current()->isVisibleTo(this)); } @@ -355,7 +355,7 @@ void KDockWidgetHeader::addButton(KDockButton_Private* btn) { if (!btn) return; if (btn->parentWidget()!=this) { - btn->reparent(this,QPoint(0,0)); + btn->reparent(this,TQPoint(0,0)); } btn->setFixedSize(closeButton->pixmap()->width(),closeButton->pixmap()->height()); if (!d->btns.containsRef(btn)) d->btns.append(btn); @@ -363,8 +363,8 @@ void KDockWidgetHeader::addButton(KDockButton_Private* btn) { btn->show(); delete layout; - layout = new QHBoxLayout( this ); - layout->setResizeMode( QLayout::Minimum ); + layout = new TQHBoxLayout( this ); + layout->setResizeMode( TQLayout::Minimum ); layout->addWidget( drag ); layout->addWidget( dockbackButton ); @@ -374,7 +374,7 @@ void KDockWidgetHeader::addButton(KDockButton_Private* btn) { bool dontShowDummy=drag->isVisibleTo(this) || dockbackButton->isVisibleTo(this) || d->toDesktopButton->isVisibleTo(this) || stayButton->isVisibleTo(this) || closeButton->isVisibleTo(this); - for (QPtrListIterator<KDockButton_Private> it( d->btns );it.current();++it) { + for (TQPtrListIterator<KDockButton_Private> it( d->btns );it.current();++it) { layout->addWidget(it.current()); dontShowDummy=dontShowDummy || (it.current()->isVisibleTo(this)); } @@ -425,12 +425,12 @@ void KDockWidgetHeader::setDragEnabled(bool b) #ifndef NO_KDE2 void KDockWidgetHeader::saveConfig( KConfig* c ) { - c->writeEntry( QString("%1%2").arg(parent()->name()).arg(":stayButton"), stayButton->isOn() ); + c->writeEntry( TQString("%1%2").arg(parent()->name()).arg(":stayButton"), stayButton->isOn() ); } void KDockWidgetHeader::loadConfig( KConfig* c ) { - setDragEnabled( !c->readBoolEntry( QString("%1%2").arg(parent()->name()).arg(":stayButton"), false ) ); + setDragEnabled( !c->readBoolEntry( TQString("%1%2").arg(parent()->name()).arg(":stayButton"), false ) ); } #endif @@ -442,12 +442,12 @@ public: /** * This rectangle is used to highlight the current dockposition. It stores global screen coordinates. */ - QRect dragRect; + TQRect dragRect; /** * This rectangle is used to erase the previously highlighted dockposition. It stores global screen coordinates. */ - QRect oldDragRect; + TQRect oldDragRect; /** * This flag stores the information if dragging is ready to start. Used between mousePress and mouseMove event. @@ -457,7 +457,7 @@ public: /** * This variable stores the offset of the mouse cursor to the upper left edge of the current drag widget. */ - QPoint dragOffset; + TQPoint dragOffset; /** * These flags store information about the splitter behavior @@ -466,30 +466,30 @@ public: bool splitterKeepSize; bool splitterHighResolution; - QGuardedPtr<KDockWidget> mainDockWidget; + TQGuardedPtr<KDockWidget> mainDockWidget; - QObjectList containerDocks; + TQObjectList containerDocks; - QGuardedPtr<KDockWidget> leftContainer; - QGuardedPtr<KDockWidget> topContainer; - QGuardedPtr<KDockWidget> rightContainer; - QGuardedPtr<KDockWidget> bottomContainer; + TQGuardedPtr<KDockWidget> leftContainer; + TQGuardedPtr<KDockWidget> topContainer; + TQGuardedPtr<KDockWidget> rightContainer; + TQGuardedPtr<KDockWidget> bottomContainer; int m_readDockConfigMode; }; /*************************************************************************/ -KDockWidget::KDockWidget( KDockManager* dockManager, const char* name, const QPixmap &pixmap, QWidget* parent, const QString& strCaption, const QString& strTabPageLabel, WFlags f) +KDockWidget::KDockWidget( KDockManager* dockManager, const char* name, const TQPixmap &pixmap, TQWidget* parent, const TQString& strCaption, const TQString& strTabPageLabel, WFlags f) #ifdef BORDERLESS_WINDOWS -: QWidget( parent, name, f )//| WType_Dialog | WStyle_Customize | WStyle_NoBorder ) +: TQWidget( parent, name, f )//| WType_Dialog | WStyle_Customize | WStyle_NoBorder ) #else -: QWidget( parent, name, f ) +: TQWidget( parent, name, f ) #endif ,formerBrotherDockWidget(0L) ,currentDockPos(DockNone) ,formerDockPos(DockNone) ,widget(0L) - ,pix(new QPixmap(pixmap)) + ,pix(new TQPixmap(pixmap)) ,prevSideDockPosBeforeDrag(DockNone) ,isGroup(false) { @@ -497,8 +497,8 @@ KDockWidget::KDockWidget( KDockManager* dockManager, const char* name, const QPi d->_parent = parent; - layout = new QVBoxLayout( this ); - layout->setResizeMode( QLayout::Minimum ); + layout = new TQVBoxLayout( this ); + layout->setResizeMode( TQLayout::Minimum ); manager = dockManager; manager->childDock->append( this ); @@ -525,18 +525,18 @@ KDockWidget::KDockWidget( KDockManager* dockManager, const char* name, const QPi setIcon( pixmap); widget = 0L; - QObject::connect(this, SIGNAL(hasUndocked()), manager->main, SLOT(slotDockWidgetUndocked()) ); - applyToWidget( parent, QPoint(0,0) ); + TQObject::connect(this, TQT_SIGNAL(hasUndocked()), manager->main, TQT_SLOT(slotDockWidgetUndocked()) ); + applyToWidget( parent, TQPoint(0,0) ); } -void KDockWidget::setPixmap(const QPixmap& pixmap) { +void KDockWidget::setPixmap(const TQPixmap& pixmap) { delete pix; - pix=new QPixmap(pixmap); + pix=new TQPixmap(pixmap); setIcon(*pix); KDockTabGroup *dtg=parentDockTabGroup(); if (dtg) dtg->changeTab(this,pixmap,dtg->tabLabel(this)); - QWidget *contWid=parentDockContainer(); + TQWidget *contWid=parentDockContainer(); if (contWid) { KDockContainer *x = dynamic_cast<KDockContainer*>(contWid); if (x) { @@ -545,7 +545,7 @@ void KDockWidget::setPixmap(const QPixmap& pixmap) { } } -const QPixmap& KDockWidget::pixmap() const { +const TQPixmap& KDockWidget::pixmap() const { return *pix; } @@ -572,25 +572,25 @@ KDockWidget::~KDockWidget() d=0; } -void KDockWidget::paintEvent(QPaintEvent* pe) +void KDockWidget::paintEvent(TQPaintEvent* pe) { - QWidget::paintEvent(pe); - QPainter paint; + TQWidget::paintEvent(pe); + TQPainter paint; paint.begin( this ); - style().drawPrimitive (QStyle::PE_Panel, &paint, QRect(0,0,width(), height()), colorGroup()); + style().drawPrimitive (TQStyle::PE_Panel, &paint, TQRect(0,0,width(), height()), colorGroup()); paint.end(); } -void KDockWidget::leaveEvent(QEvent *e) +void KDockWidget::leaveEvent(TQEvent *e) { - QWidget::leaveEvent(e); + TQWidget::leaveEvent(e); #ifdef BORDERLESS_WINDOWS if (parent()) return; -// setCursor(QCursor(ArrowCursor)); +// setCursor(TQCursor(ArrowCursor)); #endif } -void KDockWidget::mousePressEvent(QMouseEvent* mme) +void KDockWidget::mousePressEvent(TQMouseEvent* mme) { #ifdef BORDERLESS_WINDOWS if (!parent()) @@ -602,9 +602,9 @@ void KDockWidget::mousePressEvent(QMouseEvent* mme) bool bright; bool btop; int styleheight; - QPoint mp; + TQPoint mp; mp=mme->pos(); - styleheight=2*style().pixelMetric(QStyle::PM_DefaultFrameWidth,this); + styleheight=2*style().pixelMetric(TQStyle::PM_DefaultFrameWidth,this); bbottom=mp.y()>=height()-styleheight; btop=mp.y()<=styleheight; bleft=mp.x()<=styleheight; @@ -616,52 +616,52 @@ void KDockWidget::mousePressEvent(QMouseEvent* mme) if (btop) { d->resizeMode=KDockWidgetPrivate::ResizeTopRight; - d->resizePos=QPoint(width(),0)-mme->pos(); + d->resizePos=TQPoint(width(),0)-mme->pos(); } else { - d->resizePos=QPoint(width(),height())-mme->pos(); + d->resizePos=TQPoint(width(),height())-mme->pos(); if (bbottom) d->resizeMode=KDockWidgetPrivate::ResizeBottomRight; else d->resizeMode=KDockWidgetPrivate::ResizeRight; } } else if (bleft) { - if (btop) setCursor(QCursor(SizeFDiagCursor)); + if (btop) setCursor(TQCursor(SizeFDiagCursor)); else - if (bbottom) setCursor(QCursor(SizeBDiagCursor)); - else setCursor(QCursor(SizeHorCursor)); + if (bbottom) setCursor(TQCursor(SizeBDiagCursor)); + else setCursor(TQCursor(SizeHorCursor)); } else if (bbottom) { d->resizeMode=KDockWidgetPrivate::ResizeBottom; - d->resizePos=QPoint(0,height())-mme->pos(); + d->resizePos=TQPoint(0,height())-mme->pos(); } else - if (btop) setCursor(QCursor(SizeVerCursor)); + if (btop) setCursor(TQCursor(SizeVerCursor)); else d->resizing=false; if (d->resizing) grabMouse(cursor()); } #endif - QWidget::mousePressEvent(mme); + TQWidget::mousePressEvent(mme); } -void KDockWidget::mouseReleaseEvent(QMouseEvent* ev) +void KDockWidget::mouseReleaseEvent(TQMouseEvent* ev) { #ifdef BORDERLESS_WINDOWS d->resizing=false; releaseMouse(); #endif - QWidget::mouseReleaseEvent(ev); + TQWidget::mouseReleaseEvent(ev); } -void KDockWidget::mouseMoveEvent(QMouseEvent* mme) +void KDockWidget::mouseMoveEvent(TQMouseEvent* mme) { - QWidget::mouseMoveEvent(mme); + TQWidget::mouseMoveEvent(mme); #ifdef BORDERLESS_WINDOWS if (parent()) return; @@ -690,9 +690,9 @@ void KDockWidget::mouseMoveEvent(QMouseEvent* mme) bool bright; bool btop; int styleheight; - QPoint mp; + TQPoint mp; mp=mme->pos(); - styleheight=2*style().pixelMetric(QStyle::PM_DefaultFrameWidth,this); + styleheight=2*style().pixelMetric(TQStyle::PM_DefaultFrameWidth,this); bbottom=mp.y()>=height()-styleheight; btop=mp.y()<=styleheight; bleft=mp.x()<=styleheight; @@ -700,25 +700,25 @@ void KDockWidget::mouseMoveEvent(QMouseEvent* mme) kdDebug(282)<<"mousemovevent"<<endl; if (bright) { - if (btop) setCursor(QCursor(SizeBDiagCursor)); + if (btop) setCursor(TQCursor(SizeBDiagCursor)); else - if (bbottom) setCursor(QCursor(SizeFDiagCursor)); - else setCursor(QCursor(SizeHorCursor)); + if (bbottom) setCursor(TQCursor(SizeFDiagCursor)); + else setCursor(TQCursor(SizeHorCursor)); } else if (bleft) { - if (btop) setCursor(QCursor(SizeFDiagCursor)); + if (btop) setCursor(TQCursor(SizeFDiagCursor)); else - if (bbottom) setCursor(QCursor(SizeBDiagCursor)); - else setCursor(QCursor(SizeHorCursor)); + if (bbottom) setCursor(TQCursor(SizeBDiagCursor)); + else setCursor(TQCursor(SizeHorCursor)); } else - if (bbottom || btop) setCursor(QCursor(SizeVerCursor)); - else setCursor(QCursor(ArrowCursor)); + if (bbottom || btop) setCursor(TQCursor(SizeVerCursor)); + else setCursor(TQCursor(ArrowCursor)); #endif } -void KDockWidget::setLatestKDockContainer(QWidget* container) +void KDockWidget::setLatestKDockContainer(TQWidget* container) { if (container) { @@ -729,7 +729,7 @@ void KDockWidget::setLatestKDockContainer(QWidget* container) } } -QWidget* KDockWidget::latestKDockContainer() +TQWidget* KDockWidget::latestKDockContainer() { if (!(d->container)) return 0; if (dynamic_cast<KDockContainer*>(d->container.operator->())) return d->container; @@ -750,8 +750,8 @@ void KDockWidget::setHeader( KDockWidgetAbstractHeader* h ) delete header; delete layout; header = h; - layout = new QVBoxLayout( this ); - layout->setResizeMode( QLayout::Minimum ); + layout = new TQVBoxLayout( this ); + layout->setResizeMode( TQLayout::Minimum ); layout->addWidget( header ); setWidget( widget ); } else { @@ -776,7 +776,7 @@ void KDockWidget::updateHeader() #ifdef BORDERLESS_WINDOWS layout->setMargin(0); setMouseTracking(false); - setCursor(QCursor(ArrowCursor)); + setCursor(TQCursor(ArrowCursor)); #endif if ( (parent() == manager->main) || isGroup || (eDocking == KDockWidget::DockNone) ){ @@ -792,18 +792,18 @@ void KDockWidget::updateHeader() header->setTopLevel( true ); header->show(); #ifdef BORDERLESS_WINDOWS - layout->setMargin(2*style().pixelMetric(QStyle::PM_DefaultFrameWidth,this)); + layout->setMargin(2*style().pixelMetric(TQStyle::PM_DefaultFrameWidth,this)); setMouseTracking(true); #endif } } -void KDockWidget::applyToWidget( QWidget* s, const QPoint& p ) +void KDockWidget::applyToWidget( TQWidget* s, const TQPoint& p ) { if ( parent() != s ) { hide(); - reparent(s, 0, QPoint(0,0), false); + reparent(s, 0, TQPoint(0,0), false); } if ( s && s->inherits("KDockMainWindow") ){ @@ -811,7 +811,7 @@ void KDockWidget::applyToWidget( QWidget* s, const QPoint& p ) } if ( manager && s == manager->main ){ - setGeometry( QRect(QPoint(0,0), manager->main->geometry().size()) ); + setGeometry( TQRect(TQPoint(0,0), manager->main->geometry().size()) ); } if ( !s ) @@ -847,10 +847,10 @@ void KDockWidget::show() if ( parent() ){ makeDockVisible(); } else { - QWidget::show(); + TQWidget::show(); } } else { - QWidget::show(); + TQWidget::show(); } } @@ -859,46 +859,46 @@ void KDockWidget::show() void KDockWidget::setDockWindowType (NET::WindowType windowType) { d->windowType = windowType; - applyToWidget( parentWidget(), QPoint(0,0) ); + applyToWidget( parentWidget(), TQPoint(0,0) ); } #endif -void KDockWidget::setDockWindowTransient (QWidget *parent, bool transientEnabled) +void KDockWidget::setDockWindowTransient (TQWidget *parent, bool transientEnabled) { d->_parent = parent; d->transient = transientEnabled; - applyToWidget( parentWidget(), QPoint(0,0) ); + applyToWidget( parentWidget(), TQPoint(0,0) ); } -QWidget *KDockWidget::transientTo() { +TQWidget *KDockWidget::transientTo() { if (d->transient && d->_parent) return d->_parent; else return 0; } -bool KDockWidget::event( QEvent *event ) +bool KDockWidget::event( TQEvent *event ) { switch ( event->type() ) { #undef FocusIn - case QEvent::FocusIn: + case TQEvent::FocusIn: if (widget && !d->pendingFocusInEvent) { d->pendingFocusInEvent = true; widget->setFocus(); } d->pendingFocusInEvent = false; break; - case QEvent::ChildRemoved: - if ( widget == ((QChildEvent*)event)->child() ) widget = 0L; + case TQEvent::ChildRemoved: + if ( widget == ((TQChildEvent*)event)->child() ) widget = 0L; break; - case QEvent::Show: + case TQEvent::Show: if ( widget ) widget->show(); emit manager->change(); break; - case QEvent::Hide: + case TQEvent::Hide: if ( widget ) widget->hide(); emit manager->change(); break; - case QEvent::CaptionChange: + case TQEvent::CaptionChange: if ( parentWidget() ){ if ( parent()->inherits("KDockSplitter") ){ ((KDockSplitter*)(parent()))->updateName(); @@ -909,13 +909,13 @@ bool KDockWidget::event( QEvent *event ) } } break; - case QEvent::Close: + case TQEvent::Close: emit iMBeingClosed(); break; default: break; } - return QWidget::event( event ); + return TQWidget::event( event ); } KDockWidget *KDockWidget::findNearestDockWidget(DockPosition pos) @@ -945,7 +945,7 @@ KDockWidget *KDockWidget::findNearestDockWidget(DockPosition pos) } -KDockWidget* KDockWidget::manualDock( KDockWidget* target, DockPosition dockPos, int spliPos, QPoint pos, bool check, int tabIndex ) +KDockWidget* KDockWidget::manualDock( KDockWidget* target, DockPosition dockPos, int spliPos, TQPoint pos, bool check, int tabIndex ) { if (this == target) return 0L; // docking to itself not possible @@ -1025,10 +1025,10 @@ KDockWidget* KDockWidget::manualDock( KDockWidget* target, DockPosition dockPos, if ( parentTab ){ // add to existing TabGroup applyToWidget( parentTab ); - parentTab->insertTab( this, icon() ? *icon() : QPixmap(), + parentTab->insertTab( this, icon() ? *icon() : TQPixmap(), tabPageLabel(), tabIndex ); - QWidget *wantTransient=parentTab->transientTo(); + TQWidget *wantTransient=parentTab->transientTo(); target->setDockWindowTransient(wantTransient,wantTransient); setDockTabName( parentTab ); @@ -1042,7 +1042,7 @@ KDockWidget* KDockWidget::manualDock( KDockWidget* target, DockPosition dockPos, else { // kdDebug(282)<<"Looking for KDockContainer"<<endl; - QWidget *contWid=target->parentDockContainer(); + TQWidget *contWid=target->parentDockContainer(); if (!contWid) contWid=target->widget; if (contWid) { @@ -1057,7 +1057,7 @@ KDockWidget* KDockWidget::manualDock( KDockWidget* target, DockPosition dockPos, } // kdDebug(282)<<"KDockContainerFound"<<endl; applyToWidget( contWid ); - cont->insertWidget( this, icon() ? *icon() : QPixmap(), + cont->insertWidget( this, icon() ? *icon() : TQPixmap(), tabPageLabel(), tabIndex ); setLatestKDockContainer(contWid); // setDockTabName( parentTab ); @@ -1073,8 +1073,8 @@ KDockWidget* KDockWidget::manualDock( KDockWidget* target, DockPosition dockPos, } // create a new dockwidget that will contain the target and this - QWidget* parentDock = target->parentWidget(); - KDockWidget* newDock = new KDockWidget( manager, "tempName", QPixmap(""), parentDock ); + TQWidget* parentDock = target->parentWidget(); + KDockWidget* newDock = new KDockWidget( manager, "tempName", TQPixmap(""), parentDock ); newDock->currentDockPos = target->currentDockPos; if ( dockPos == KDockWidget::DockCenter ){ @@ -1106,14 +1106,14 @@ KDockWidget* KDockWidget::manualDock( KDockWidget* target, DockPosition dockPos, if ( dockPos == KDockWidget::DockCenter ) { KDockTabGroup* tab = new KDockTabGroup( newDock, "_dock_tab"); - QObject::connect(tab, SIGNAL(currentChanged(QWidget*)), d, SLOT(slotFocusEmbeddedWidget(QWidget*))); + TQObject::connect(tab, TQT_SIGNAL(currentChanged(TQWidget*)), d, TQT_SLOT(slotFocusEmbeddedWidget(TQWidget*))); newDock->setWidget( tab ); target->applyToWidget( tab ); applyToWidget( tab ); - tab->insertTab( target, target->icon() ? *(target->icon()) : QPixmap(), + tab->insertTab( target, target->icon() ? *(target->icon()) : TQPixmap(), target->tabPageLabel() ); @@ -1121,11 +1121,11 @@ KDockWidget* KDockWidget::manualDock( KDockWidget* target, DockPosition dockPos, if( !target->toolTipString().isEmpty()) tab->setTabToolTip( target, target->toolTipString()); - tab->insertTab( this, icon() ? *icon() : QPixmap(), + tab->insertTab( this, icon() ? *icon() : TQPixmap(), tabPageLabel(), tabIndex ); - QRect geom=newDock->geometry(); - QWidget *wantTransient=tab->transientTo(); + TQRect geom=newDock->geometry(); + TQWidget *wantTransient=tab->transientTo(); newDock->setDockWindowTransient(wantTransient,wantTransient); newDock->setGeometry(geom); @@ -1200,15 +1200,15 @@ KDockWidget* KDockWidget::manualDock( KDockWidget* target, DockPosition dockPos, KDockTabGroup* KDockWidget::parentDockTabGroup() const { if ( !parent() ) return 0L; - QWidget* candidate = parentWidget()->parentWidget(); + TQWidget* candidate = parentWidget()->parentWidget(); if ( candidate && candidate->inherits("KDockTabGroup") ) return (KDockTabGroup*)candidate; return 0L; } -QWidget *KDockWidget::parentDockContainer() const +TQWidget *KDockWidget::parentDockContainer() const { if (!parent()) return 0L; - QWidget* candidate = parentWidget()->parentWidget(); + TQWidget* candidate = parentWidget()->parentWidget(); if (candidate && dynamic_cast<KDockContainer*>(candidate)) return candidate; return 0L; } @@ -1256,7 +1256,7 @@ void KDockWidget::restoreFromForcedFixedSize() void KDockWidget::toDesktop() { - QPoint p = mapToGlobal( QPoint( -30, -30 ) ); + TQPoint p = mapToGlobal( TQPoint( -30, -30 ) ); if( p.x( ) < 0 ) p.setX( 0 ); if( p.y( ) < 0 ) @@ -1273,10 +1273,10 @@ void KDockWidget::undock() { // kdDebug(282)<<"KDockWidget::undock()"<<endl; - manager->d->dragRect = QRect (); + manager->d->dragRect = TQRect (); manager->drawDragRectangle (); - QWidget* parentW = parentWidget(); + TQWidget* parentW = parentWidget(); if ( !parentW ){ hide(); if (!d->blockHasUndockedSignal) @@ -1298,7 +1298,7 @@ void KDockWidget::undock() d->index = parentTab->indexOf( this); // memorize the page position in the tab widget parentTab->removePage( this ); /* - QWidget *wantTransient=parentTab->transientTo(); + TQWidget *wantTransient=parentTab->transientTo(); target->setDockWindowTransient(wantTransient,wantTransient); */ setFormerBrotherDockWidget((KDockWidget*)parentTab->page(0)); @@ -1308,7 +1308,7 @@ void KDockWidget::undock() // last subdock widget in the tab control KDockWidget* lastTab = (KDockWidget*)parentTab->page(0); parentTab->removePage( lastTab ); -/* QWidget *wantTransient=parentTab->transientTo(); +/* TQWidget *wantTransient=parentTab->transientTo(); target->setDockWindowTransient(wantTransient,wantTransient);*/ lastTab->applyToWidget( 0L ); @@ -1318,7 +1318,7 @@ void KDockWidget::undock() KDockWidget* parentOfTab = (KDockWidget*)parentTab->parent(); delete parentTab; // KDockTabGroup - QWidget* parentOfDockWidget = parentOfTab->parentWidget(); + TQWidget* parentOfDockWidget = parentOfTab->parentWidget(); if ( !parentOfDockWidget ){ if ( isV ) lastTab->show(); } else { @@ -1357,7 +1357,7 @@ void KDockWidget::undock() } } else { /*********************************************************************************************/ - //QWidget* containerWidget = (QWidget*)parent(); + //TQWidget* containerWidget = (TQWidget*)parent(); bool undockedFromContainer=false; if (d->container) { @@ -1386,7 +1386,7 @@ void KDockWidget::undock() secondWidget->applyToWidget( 0L, group->frameGeometry().topLeft() ); secondWidget->resize( group->width(), group->height() ); } else { - QWidget* obj = group->parentWidget(); + TQWidget* obj = group->parentWidget(); secondWidget->applyToWidget( obj ); if ( obj->inherits("KDockSplitter") ){ KDockSplitter* parentOfGroup = (KDockSplitter*)obj; @@ -1426,22 +1426,22 @@ void KDockWidget::undock() emit hasUndocked(); } -void KDockWidget::setWidget( QWidget* mw ) +void KDockWidget::setWidget( TQWidget* mw ) { if ( !mw ) return; if ( mw->parent() != this ){ - mw->reparent(this, 0, QPoint(0,0), false); + mw->reparent(this, 0, TQPoint(0,0), false); } #ifdef BORDERLESS_WINDOWS - if (!mw->ownCursor()) mw->setCursor(QCursor(ArrowCursor)); + if (!mw->ownCursor()) mw->setCursor(TQCursor(ArrowCursor)); #endif widget = mw; delete layout; - layout = new QVBoxLayout( this ); - layout->setResizeMode( QLayout::Minimum ); + layout = new TQVBoxLayout( this ); + layout->setResizeMode( TQLayout::Minimum ); KDockContainer* dc = dynamic_cast<KDockContainer*>(widget); if (dc) @@ -1465,10 +1465,10 @@ void KDockWidget::setWidget( QWidget* mw ) void KDockWidget::setDockTabName( KDockTabGroup* tab ) { - QString listOfName; - QString listOfCaption; + TQString listOfName; + TQString listOfCaption; for ( int i = 0; i < tab->count(); ++i ) { - QWidget *w = tab->page( i ); + TQWidget *w = tab->page( i ); listOfCaption.append( w->caption() ).append(","); listOfName.append( w->name() ).append(","); } @@ -1518,7 +1518,7 @@ void KDockWidget::makeDockVisible() parentDockTabGroup()->showPage( this ); } if (parentDockContainer()) { - QWidget *contWid=parentDockContainer(); + TQWidget *contWid=parentDockContainer(); KDockContainer *x = dynamic_cast<KDockContainer*>(contWid); if (x) { x->showWidget(this); @@ -1526,7 +1526,7 @@ void KDockWidget::makeDockVisible() } if ( isVisible() ) return; - QWidget* p = parentWidget(); + TQWidget* p = parentWidget(); while ( p ){ if ( !p->isVisible() ) p->show(); @@ -1541,15 +1541,15 @@ void KDockWidget::setFormerBrotherDockWidget(KDockWidget *dockWidget) { formerBrotherDockWidget = dockWidget; if( formerBrotherDockWidget ) - QObject::connect( formerBrotherDockWidget, SIGNAL(iMBeingClosed()), - this, SLOT(loseFormerBrotherDockWidget()) ); + TQObject::connect( formerBrotherDockWidget, TQT_SIGNAL(iMBeingClosed()), + this, TQT_SLOT(loseFormerBrotherDockWidget()) ); } void KDockWidget::loseFormerBrotherDockWidget() { if( formerBrotherDockWidget ) - QObject::disconnect( formerBrotherDockWidget, SIGNAL(iMBeingClosed()), - this, SLOT(loseFormerBrotherDockWidget()) ); + TQObject::disconnect( formerBrotherDockWidget, TQT_SIGNAL(iMBeingClosed()), + this, TQT_SLOT(loseFormerBrotherDockWidget()) ); formerBrotherDockWidget = 0L; repaint(); } @@ -1559,12 +1559,12 @@ void KDockWidget::dockBack() if( formerBrotherDockWidget) { // search all children if it tries to dock back to a child bool found = false; - QObjectList* cl = queryList("KDockWidget"); - QObjectListIt it( *cl ); - QObject * obj; + TQObjectList* cl = queryList("KDockWidget"); + TQObjectListIt it( *cl ); + TQObject * obj; while ( !found && (obj=it.current()) != 0 ) { ++it; - QWidget* widg = (QWidget*)obj; + TQWidget* widg = (TQWidget*)obj; if( widg == formerBrotherDockWidget) found = true; } @@ -1572,7 +1572,7 @@ void KDockWidget::dockBack() if( !found) { // can dock back to the former brother dockwidget - manualDock( formerBrotherDockWidget, formerDockPos, d->splitPosInPercent, QPoint(0,0), false, d->index); + manualDock( formerBrotherDockWidget, formerDockPos, d->splitPosInPercent, TQPoint(0,0), false, d->index); formerBrotherDockWidget = 0L; makeDockVisible(); return; @@ -1580,7 +1580,7 @@ void KDockWidget::dockBack() } // else dockback to the dockmainwindow (default behavior) - manualDock( ((KDockMainWindow*)manager->main)->getMainDockWidget(), formerDockPos, d->splitPosInPercent, QPoint(0,0), false, d->index); + manualDock( ((KDockMainWindow*)manager->main)->getMainDockWidget(), formerDockPos, d->splitPosInPercent, TQPoint(0,0), false, d->index); formerBrotherDockWidget = 0L; if (parent()) makeDockVisible(); @@ -1597,8 +1597,8 @@ bool KDockWidget::isDockBackPossible() const /**************************************************************************************/ -KDockManager::KDockManager( QWidget* mainWindow , const char* name ) -:QObject( mainWindow, name ) +KDockManager::KDockManager( TQWidget* mainWindow , const char* name ) +:TQObject( mainWindow, name ) ,main(mainWindow) ,currentDragWidget(0L) ,currentMoveWidget(0L) @@ -1629,20 +1629,20 @@ KDockManager::KDockManager( QWidget* mainWindow , const char* name ) undockProcess = false; - menuData = new QPtrList<MenuDockData>; + menuData = new TQPtrList<MenuDockData>; menuData->setAutoDelete( true ); menuData->setAutoDelete( true ); #ifndef NO_KDE2 menu = new KPopupMenu(); #else - menu = new QPopupMenu(); + menu = new TQPopupMenu(); #endif - connect( menu, SIGNAL(aboutToShow()), SLOT(slotMenuPopup()) ); - connect( menu, SIGNAL(activated(int)), SLOT(slotMenuActivated(int)) ); + connect( menu, TQT_SIGNAL(aboutToShow()), TQT_SLOT(slotMenuPopup()) ); + connect( menu, TQT_SIGNAL(activated(int)), TQT_SLOT(slotMenuActivated(int)) ); - childDock = new QObjectList(); + childDock = new TQObjectList(); childDock->setAutoDelete( false ); } @@ -1657,7 +1657,7 @@ KDockManager::~KDockManager() delete menuData; delete menu; - QObjectListIt it( *childDock ); + TQObjectListIt it( *childDock ); KDockWidget * obj; while ( (obj=(KDockWidget*)it.current()) ) { @@ -1670,7 +1670,7 @@ KDockManager::~KDockManager() void KDockManager::activate() { - QObjectListIt it( *childDock ); + TQObjectListIt it( *childDock ); KDockWidget * obj; while ( (obj=(KDockWidget*)it.current()) ) { @@ -1680,17 +1680,17 @@ void KDockManager::activate() obj->show(); } } - if ( !main->inherits("QDialog") ) main->show(); + if ( !main->inherits("TQDialog") ) main->show(); } -bool KDockManager::eventFilter( QObject *obj, QEvent *event ) +bool KDockManager::eventFilter( TQObject *obj, TQEvent *event ) { if ( obj->inherits("KDockWidgetAbstractHeaderDrag") ){ KDockWidget* pDockWdgAtCursor = 0L; KDockWidget* curdw = ((KDockWidgetAbstractHeaderDrag*)obj)->dockWidget(); switch ( event->type() ){ - case QEvent::MouseButtonDblClick: + case TQEvent::MouseButtonDblClick: if (curdw->currentDockPos == KDockWidget::DockDesktop) curdw->dockBack(); else { @@ -1699,8 +1699,8 @@ bool KDockManager::eventFilter( QObject *obj, QEvent *event ) } break; - case QEvent::MouseButtonPress: - if ( ((QMouseEvent*)event)->button() == LeftButton ){ + case TQEvent::MouseButtonPress: + if ( ((TQMouseEvent*)event)->button() == LeftButton ){ if ( curdw->eDocking != (int)KDockWidget::DockNone ){ dropCancel = true; curdw->setFocus(); @@ -1708,24 +1708,24 @@ bool KDockManager::eventFilter( QObject *obj, QEvent *event ) currentDragWidget = curdw; currentMoveWidget = 0L; - childDockWidgetList = new QWidgetList(); + childDockWidgetList = new TQWidgetList(); childDockWidgetList->append( curdw ); findChildDockWidget( curdw, childDockWidgetList ); - //d->oldDragRect = QRect(); should fix rectangle not erased problem - d->dragRect = QRect(curdw->geometry()); - QPoint p = curdw->mapToGlobal(QPoint(0,0)); + //d->oldDragRect = TQRect(); should fix rectangle not erased problem + d->dragRect = TQRect(curdw->geometry()); + TQPoint p = curdw->mapToGlobal(TQPoint(0,0)); d->dragRect.moveTopLeft(p); drawDragRectangle(); d->readyToDrag = true; - d->dragOffset = QCursor::pos()-currentDragWidget->mapToGlobal(QPoint(0,0)); + d->dragOffset = TQCursor::pos()-currentDragWidget->mapToGlobal(TQPoint(0,0)); } } break; - case QEvent::MouseButtonRelease: - if ( ((QMouseEvent*)event)->button() == LeftButton ){ + case TQEvent::MouseButtonRelease: + if ( ((TQMouseEvent*)event)->button() == LeftButton ){ if ( dragging ){ if ( !dropCancel ) drop(); @@ -1734,9 +1734,9 @@ bool KDockManager::eventFilter( QObject *obj, QEvent *event ) } if (d->readyToDrag) { d->readyToDrag = false; - //d->oldDragRect = QRect(); should fix rectangle not erased problem - d->dragRect = QRect(curdw->geometry()); - QPoint p = curdw->mapToGlobal(QPoint(0,0)); + //d->oldDragRect = TQRect(); should fix rectangle not erased problem + d->dragRect = TQRect(curdw->geometry()); + TQPoint p = curdw->mapToGlobal(TQPoint(0,0)); d->dragRect.moveTopLeft(p); drawDragRectangle(); currentDragWidget = 0L; @@ -1747,7 +1747,7 @@ bool KDockManager::eventFilter( QObject *obj, QEvent *event ) dropCancel = true; } break; - case QEvent::MouseMove: + case TQEvent::MouseMove: if ( dragging ) { #ifdef BORDERLESS_WINDOWS @@ -1755,31 +1755,31 @@ bool KDockManager::eventFilter( QObject *obj, QEvent *event ) KDockWidget *oldMoveWidget; if (!curdw->parent()) { - curdw->move(QCursor::pos()-d->dragOffset); - pDockWdgAtCursor = findDockWidgetAt( QCursor::pos()-QPoint(0,d->dragOffset.y()+3) ); + curdw->move(TQCursor::pos()-d->dragOffset); + pDockWdgAtCursor = findDockWidgetAt( TQCursor::pos()-TQPoint(0,d->dragOffset.y()+3) ); oldMoveWidget = currentMoveWidget; } else { - pDockWdgAtCursor = findDockWidgetAt( QCursor::pos() ); + pDockWdgAtCursor = findDockWidgetAt( TQCursor::pos() ); oldMoveWidget = currentMoveWidget; } //END TEST #else - pDockWdgAtCursor = findDockWidgetAt( QCursor::pos() ); + pDockWdgAtCursor = findDockWidgetAt( TQCursor::pos() ); KDockWidget* oldMoveWidget = currentMoveWidget; #endif if ( currentMoveWidget && pDockWdgAtCursor == currentMoveWidget ) { //move - dragMove( currentMoveWidget, currentMoveWidget->mapFromGlobal( QCursor::pos() ) ); + dragMove( currentMoveWidget, currentMoveWidget->mapFromGlobal( TQCursor::pos() ) ); break; } else { if (dropCancel && curdw) { - d->dragRect = QRect(curdw->geometry()); - QPoint p = curdw->mapToGlobal(QPoint(0,0)); + d->dragRect = TQRect(curdw->geometry()); + TQPoint p = curdw->mapToGlobal(TQPoint(0,0)); d->dragRect.moveTopLeft(p); }else - d->dragRect = QRect(); + d->dragRect = TQRect(); drawDragRectangle(); } @@ -1803,7 +1803,7 @@ bool KDockManager::eventFilter( QObject *obj, QEvent *event ) if (d->readyToDrag) { d->readyToDrag = false; } - if ( (((QMouseEvent*)event)->state() == LeftButton) && + if ( (((TQMouseEvent*)event)->state() == LeftButton) && (curdw->eDocking != (int)KDockWidget::DockNone) ) { startDrag( curdw); } @@ -1813,10 +1813,10 @@ bool KDockManager::eventFilter( QObject *obj, QEvent *event ) break; } } - return QObject::eventFilter( obj, event ); + return TQObject::eventFilter( obj, event ); } -KDockWidget* KDockManager::findDockWidgetAt( const QPoint& pos ) +KDockWidget* KDockManager::findDockWidgetAt( const TQPoint& pos ) { dropCancel = true; @@ -1825,7 +1825,7 @@ KDockWidget* KDockManager::findDockWidgetAt( const QPoint& pos ) if (currentDragWidget->eDocking == (int)KDockWidget::DockNone ) return 0L; - QWidget* p = QApplication::widgetAt( pos ); + TQWidget* p = TQApplication::widgetAt( pos ); if ( !p ) { dropCancel = false; return 0L; @@ -1833,7 +1833,7 @@ KDockWidget* KDockManager::findDockWidgetAt( const QPoint& pos ) #if defined(_OS_WIN32_) || defined(Q_OS_WIN32) p = p->topLevelWidget(); #endif - QWidget* w = 0L; + TQWidget* w = 0L; findChildDockWidget( w, p, p->mapFromGlobal(pos) ); if ( !w ){ if ( !p->inherits("KDockWidget") ) { @@ -1855,7 +1855,7 @@ KDockWidget* KDockManager::findDockWidgetAt( const QPoint& pos ) return 0L; KDockWidget::DockPosition curPos = KDockWidget::DockDesktop; - QPoint cpos = www->mapFromGlobal( pos ); + TQPoint cpos = www->mapFromGlobal( pos ); int ww = www->widget->width() / 3; int hh = www->widget->height() / 3; @@ -1882,15 +1882,15 @@ KDockWidget* KDockManager::findDockWidgetAt( const QPoint& pos ) return www; } -void KDockManager::findChildDockWidget( QWidget*& ww, const QWidget* p, const QPoint& pos ) +void KDockManager::findChildDockWidget( TQWidget*& ww, const TQWidget* p, const TQPoint& pos ) { if ( p->children() ) { - QWidget *w; - QObjectListIt it( *p->children() ); + TQWidget *w; + TQObjectListIt it( *p->children() ); it.toLast(); while ( it.current() ) { if ( it.current()->isWidgetType() ) { - w = (QWidget*)it.current(); + w = (TQWidget*)it.current(); if ( w->isVisible() && w->geometry().contains(pos) ) { if ( w->inherits("KDockWidget") ) ww = w; findChildDockWidget( ww, w, w->mapFromParent(pos) ); @@ -1903,15 +1903,15 @@ void KDockManager::findChildDockWidget( QWidget*& ww, const QWidget* p, const QP return; } -void KDockManager::findChildDockWidget( const QWidget* p, QWidgetList*& list ) +void KDockManager::findChildDockWidget( const TQWidget* p, TQWidgetList*& list ) { if ( p->children() ) { - QWidget *w; - QObjectListIt it( *p->children() ); + TQWidget *w; + TQObjectListIt it( *p->children() ); it.toLast(); while ( it.current() ) { if ( it.current()->isWidgetType() ) { - w = (QWidget*)it.current(); + w = (TQWidget*)it.current(); if ( w->isVisible() ) { if ( w->inherits("KDockWidget") ) list->append( w ); findChildDockWidget( w, list ); @@ -1938,15 +1938,15 @@ void KDockManager::startDrag( KDockWidget* w ) curPos = KDockWidget::DockDesktop; dragging = true; - QApplication::setOverrideCursor(QCursor(sizeAllCursor)); + TQApplication::setOverrideCursor(TQCursor(sizeAllCursor)); } -void KDockManager::dragMove( KDockWidget* dw, QPoint pos ) +void KDockManager::dragMove( KDockWidget* dw, TQPoint pos ) { - QPoint p = dw->mapToGlobal( dw->widget->pos() ); + TQPoint p = dw->mapToGlobal( dw->widget->pos() ); KDockWidget::DockPosition oldPos = curPos; - QSize r = dw->widget->size(); + TQSize r = dw->widget->size(); if ( dw->parentDockTabGroup() ){ curPos = KDockWidget::DockCenter; if ( oldPos != curPos ) { @@ -1991,34 +1991,34 @@ void KDockManager::dragMove( KDockWidget* dw, QPoint pos ) void KDockManager::cancelDrop() { - QApplication::restoreOverrideCursor(); + TQApplication::restoreOverrideCursor(); delete childDockWidgetList; childDockWidgetList = 0L; - d->dragRect = QRect(); // cancel drawing + d->dragRect = TQRect(); // cancel drawing drawDragRectangle(); // only the old rect will be deleted } void KDockManager::drop() { - d->dragRect = QRect(); // cancel drawing + d->dragRect = TQRect(); // cancel drawing drawDragRectangle(); // only the old rect will be deleted - QApplication::restoreOverrideCursor(); + TQApplication::restoreOverrideCursor(); delete childDockWidgetList; childDockWidgetList = 0L; if ( dropCancel ) return; if ( !currentMoveWidget && (!(currentDragWidget->eDocking & (int)KDockWidget::DockDesktop)) ) { - d->dragRect = QRect(); // cancel drawing + d->dragRect = TQRect(); // cancel drawing drawDragRectangle(); // only the old rect will be deleted return; } if ( !currentMoveWidget && !currentDragWidget->parent() ) { - currentDragWidget->move( QCursor::pos() - d->dragOffset ); + currentDragWidget->move( TQCursor::pos() - d->dragOffset ); } else { int splitPos = currentDragWidget->d->splitPosInPercent; @@ -2032,63 +2032,63 @@ void KDockManager::drop() default: break; } } - currentDragWidget->manualDock( currentMoveWidget, curPos , splitPos, QCursor::pos() - d->dragOffset ); + currentDragWidget->manualDock( currentMoveWidget, curPos , splitPos, TQCursor::pos() - d->dragOffset ); currentDragWidget->makeDockVisible(); } } -static QDomElement createStringEntry(QDomDocument &doc, const QString &tagName, const QString &str) +static TQDomElement createStringEntry(TQDomDocument &doc, const TQString &tagName, const TQString &str) { - QDomElement el = doc.createElement(tagName); + TQDomElement el = doc.createElement(tagName); el.appendChild(doc.createTextNode(str)); return el; } -static QDomElement createBoolEntry(QDomDocument &doc, const QString &tagName, bool b) +static TQDomElement createBoolEntry(TQDomDocument &doc, const TQString &tagName, bool b) { - return createStringEntry(doc, tagName, QString::fromLatin1(b? "true" : "false")); + return createStringEntry(doc, tagName, TQString::fromLatin1(b? "true" : "false")); } -static QDomElement createNumberEntry(QDomDocument &doc, const QString &tagName, int n) +static TQDomElement createNumberEntry(TQDomDocument &doc, const TQString &tagName, int n) { - return createStringEntry(doc, tagName, QString::number(n)); + return createStringEntry(doc, tagName, TQString::number(n)); } -static QDomElement createRectEntry(QDomDocument &doc, const QString &tagName, const QRect &rect) +static TQDomElement createRectEntry(TQDomDocument &doc, const TQString &tagName, const TQRect &rect) { - QDomElement el = doc.createElement(tagName); + TQDomElement el = doc.createElement(tagName); - QDomElement xel = doc.createElement("x"); - xel.appendChild(doc.createTextNode(QString::number(rect.x()))); + TQDomElement xel = doc.createElement("x"); + xel.appendChild(doc.createTextNode(TQString::number(rect.x()))); el.appendChild(xel); - QDomElement yel = doc.createElement("y"); - yel.appendChild(doc.createTextNode(QString::number(rect.y()))); + TQDomElement yel = doc.createElement("y"); + yel.appendChild(doc.createTextNode(TQString::number(rect.y()))); el.appendChild(yel); - QDomElement wel = doc.createElement("width"); - wel.appendChild(doc.createTextNode(QString::number(rect.width()))); + TQDomElement wel = doc.createElement("width"); + wel.appendChild(doc.createTextNode(TQString::number(rect.width()))); el.appendChild(wel); - QDomElement hel = doc.createElement("height"); - hel.appendChild(doc.createTextNode(QString::number(rect.height()))); + TQDomElement hel = doc.createElement("height"); + hel.appendChild(doc.createTextNode(TQString::number(rect.height()))); el.appendChild(hel); return el; } -static QDomElement createListEntry(QDomDocument &doc, const QString &tagName, - const QString &subTagName, const QStrList &list) +static TQDomElement createListEntry(TQDomDocument &doc, const TQString &tagName, + const TQString &subTagName, const TQStrList &list) { - QDomElement el = doc.createElement(tagName); + TQDomElement el = doc.createElement(tagName); - QStrListIterator it(list); + TQStrListIterator it(list); for (; it.current(); ++it) { - QDomElement subel = doc.createElement(subTagName); - subel.appendChild(doc.createTextNode(QString::fromLatin1(it.current()))); + TQDomElement subel = doc.createElement(subTagName); + subel.appendChild(doc.createTextNode(TQString::fromLatin1(it.current()))); el.appendChild(subel); } @@ -2096,44 +2096,44 @@ static QDomElement createListEntry(QDomDocument &doc, const QString &tagName, } -static QString stringEntry(QDomElement &base, const QString &tagName) +static TQString stringEntry(TQDomElement &base, const TQString &tagName) { return base.namedItem(tagName).firstChild().toText().data(); } -static bool boolEntry(QDomElement &base, const QString &tagName) +static bool boolEntry(TQDomElement &base, const TQString &tagName) { return base.namedItem(tagName).firstChild().toText().data() == "true"; } -static int numberEntry(QDomElement &base, const QString &tagName) +static int numberEntry(TQDomElement &base, const TQString &tagName) { return stringEntry(base, tagName).toInt(); } -static QRect rectEntry(QDomElement &base, const QString &tagName) +static TQRect rectEntry(TQDomElement &base, const TQString &tagName) { - QDomElement el = base.namedItem(tagName).toElement(); + TQDomElement el = base.namedItem(tagName).toElement(); int x = numberEntry(el, "x"); int y = numberEntry(el, "y"); int width = numberEntry(el, "width"); int height = numberEntry(el, "height"); - return QRect(x, y, width, height); + return TQRect(x, y, width, height); } -static QStrList listEntry(QDomElement &base, const QString &tagName, const QString &subTagName) +static TQStrList listEntry(TQDomElement &base, const TQString &tagName, const TQString &subTagName) { - QStrList list; + TQStrList list; - for( QDomNode n = base.namedItem(tagName).firstChild(); !n.isNull(); n = n.nextSibling() ) + for( TQDomNode n = base.namedItem(tagName).firstChild(); !n.isNull(); n = n.nextSibling() ) { - QDomElement subel = n.toElement(); + TQDomElement subel = n.toElement(); if (subel.tagName() == subTagName) list.append(subel.firstChild().toText().data().latin1()); } @@ -2142,28 +2142,28 @@ static QStrList listEntry(QDomElement &base, const QString &tagName, const QStri } -void KDockManager::writeConfig(QDomElement &base) +void KDockManager::writeConfig(TQDomElement &base) { // First of all, clear the tree under base while (!base.firstChild().isNull()) base.removeChild(base.firstChild()); - QDomDocument doc = base.ownerDocument(); + TQDomDocument doc = base.ownerDocument(); - QStrList nameList; - QString mainWidgetStr; + TQStrList nameList; + TQString mainWidgetStr; // collect widget names - QStringList nList; - QObjectListIt it(*childDock); + TQStringList nList; + TQObjectListIt it(*childDock); KDockWidget *obj1; while ( (obj1=(KDockWidget*)it.current()) ) { if ( obj1->parent() == main ) - mainWidgetStr = QString::fromLatin1(obj1->name()); + mainWidgetStr = TQString::fromLatin1(obj1->name()); nList.append(obj1->name()); ++it; } - for (QObjectListIt it(d->containerDocks);it.current();++it) + for (TQObjectListIt it(d->containerDocks);it.current();++it) { KDockContainer* dc = dynamic_cast<KDockContainer*>(((KDockWidget*)it.current())->widget); if (dc) { @@ -2171,7 +2171,7 @@ void KDockManager::writeConfig(QDomElement &base) } } - QStringList::Iterator nListIt=nList.begin(); + TQStringList::Iterator nListIt=nList.begin(); while ( nListIt!=nList.end() ) { KDockWidget *obj = getDockWidgetFromName( *nListIt); if ((obj->isGroup && (!obj->d->isContainer)) && (nameList.find( obj->firstName.latin1() ) == -1 @@ -2183,7 +2183,7 @@ void KDockManager::writeConfig(QDomElement &base) continue; } - QDomElement groupEl; + TQDomElement groupEl; if (obj->d->isContainer) { KDockContainer* x = dynamic_cast<KDockContainer*>(obj->widget); if (x) { @@ -2203,7 +2203,7 @@ void KDockManager::writeConfig(QDomElement &base) //// Save a tab group groupEl = doc.createElement("tabGroup"); - QStrList list; + TQStrList list; for ( int i = 0; i < ((KDockTabGroup*)obj->widget)->count(); ++i ) list.append( ((KDockTabGroup*)obj->widget)->page( i )->name() ); groupEl.appendChild(createListEntry(doc, "tabs", "tab", list)); @@ -2223,10 +2223,10 @@ void KDockManager::writeConfig(QDomElement &base) } } - groupEl.appendChild(createStringEntry(doc, "name", QString::fromLatin1(obj->name()))); + groupEl.appendChild(createStringEntry(doc, "name", TQString::fromLatin1(obj->name()))); groupEl.appendChild(createBoolEntry(doc, "hasParent", obj->parent())); if ( !obj->parent() ) { - groupEl.appendChild(createRectEntry(doc, "geometry", QRect(main->frameGeometry().topLeft(), main->size()))); + groupEl.appendChild(createRectEntry(doc, "geometry", TQRect(main->frameGeometry().topLeft(), main->size()))); groupEl.appendChild(createBoolEntry(doc, "visible", obj->isVisible())); } if (obj->header && obj->header->inherits("KDockWidgetHeader")) { @@ -2242,19 +2242,19 @@ void KDockManager::writeConfig(QDomElement &base) if (main->inherits("KDockMainWindow")) { KDockMainWindow *dmain = (KDockMainWindow*)main; - QString centralWidgetStr = QString(dmain->centralWidget()? dmain->centralWidget()->name() : ""); + TQString centralWidgetStr = TQString(dmain->centralWidget()? dmain->centralWidget()->name() : ""); base.appendChild(createStringEntry(doc, "centralWidget", centralWidgetStr)); - QString mainDockWidgetStr = QString(dmain->getMainDockWidget()? dmain->getMainDockWidget()->name() : ""); + TQString mainDockWidgetStr = TQString(dmain->getMainDockWidget()? dmain->getMainDockWidget()->name() : ""); base.appendChild(createStringEntry(doc, "mainDockWidget", mainDockWidgetStr)); } else { base.appendChild(createStringEntry(doc, "mainWidget", mainWidgetStr)); } - base.appendChild(createRectEntry(doc, "geometry", QRect(main->frameGeometry().topLeft(), main->size()))); + base.appendChild(createRectEntry(doc, "geometry", TQRect(main->frameGeometry().topLeft(), main->size()))); } -void KDockManager::readConfig(QDomElement &base) +void KDockManager::readConfig(TQDomElement &base) { if (base.namedItem("group").isNull() && base.namedItem("tabgroup").isNull() @@ -2264,13 +2264,13 @@ void KDockManager::readConfig(QDomElement &base) return; } - autoCreateDock = new QObjectList(); + autoCreateDock = new TQObjectList(); autoCreateDock->setAutoDelete( true ); bool isMainVisible = main->isVisible(); main->hide(); - QObjectListIt it(*childDock); + TQObjectListIt it(*childDock); KDockWidget *obj1; while ( (obj1=(KDockWidget*)it.current()) ) { if ( !obj1->isGroup && !obj1->isTabGroup ) { @@ -2283,9 +2283,9 @@ void KDockManager::readConfig(QDomElement &base) } // firstly, recreate all common dockwidgets - for( QDomNode n = base.firstChild(); !n.isNull(); n = n.nextSibling() ) + for( TQDomNode n = base.firstChild(); !n.isNull(); n = n.nextSibling() ) { - QDomElement childEl = n.toElement(); + TQDomElement childEl = n.toElement(); if (childEl.tagName() != "dock") continue; // Read an ordinary dock widget @@ -2294,12 +2294,12 @@ void KDockManager::readConfig(QDomElement &base) obj->setToolTipString(stringEntry(childEl, "tabToolTip")); if (!boolEntry(childEl, "hasParent")) { - QRect r = rectEntry(childEl, "geometry"); + TQRect r = rectEntry(childEl, "geometry"); obj = getDockWidgetFromName(stringEntry(childEl, "name")); obj->applyToWidget(0); obj->setGeometry(r); if (boolEntry(childEl, "visible")) - obj->QWidget::show(); + obj->TQWidget::show(); } if (obj && obj->header && obj->header->inherits("KDockWidgetHeader")) { @@ -2309,9 +2309,9 @@ void KDockManager::readConfig(QDomElement &base) } // secondly, now iterate again and create the groups and tabwidgets, apply the dockwidgets to them - for( QDomNode n = base.firstChild(); !n.isNull(); n = n.nextSibling() ) + for( TQDomNode n = base.firstChild(); !n.isNull(); n = n.nextSibling() ) { - QDomElement childEl = n.toElement(); + TQDomElement childEl = n.toElement(); if (childEl.isNull()) continue; KDockWidget *obj = 0; @@ -2335,9 +2335,9 @@ void KDockManager::readConfig(QDomElement &base) else if (childEl.tagName() == "splitGroup") { // Read a group - QString name = stringEntry(childEl, "name"); - QString firstName = stringEntry(childEl, "firstName"); - QString secondName = stringEntry(childEl, "secondName"); + TQString name = stringEntry(childEl, "name"); + TQString firstName = stringEntry(childEl, "firstName"); + TQString secondName = stringEntry(childEl, "secondName"); int orientation = numberEntry(childEl, "orientation"); int separatorPos = numberEntry(childEl, "separatorPos"); @@ -2352,8 +2352,8 @@ void KDockManager::readConfig(QDomElement &base) } } else if (childEl.tagName() == "tabGroup") { // Read a tab group - QString name = stringEntry(childEl, "name"); - QStrList list = listEntry(childEl, "tabs", "tab"); + TQString name = stringEntry(childEl, "name"); + TQStrList list = listEntry(childEl, "tabs", "tab"); KDockWidget *d1 = getDockWidgetFromName( list.first() ); list.next(); @@ -2378,12 +2378,12 @@ void KDockManager::readConfig(QDomElement &base) } if (!boolEntry(childEl, "hasParent")) { - QRect r = rectEntry(childEl, "geometry"); + TQRect r = rectEntry(childEl, "geometry"); obj = getDockWidgetFromName(stringEntry(childEl, "name")); obj->applyToWidget(0); obj->setGeometry(r); if (boolEntry(childEl, "visible")) - obj->QWidget::show(); + obj->TQWidget::show(); } if (obj && obj->header && obj->header->inherits("KDockWidgetHeader")) { @@ -2394,9 +2394,9 @@ void KDockManager::readConfig(QDomElement &base) // thirdly, now that all ordinary dockwidgets are created, // iterate them again and link them with their corresponding dockwidget for the dockback action - for( QDomNode n = base.firstChild(); !n.isNull(); n = n.nextSibling() ) + for( TQDomNode n = base.firstChild(); !n.isNull(); n = n.nextSibling() ) { - QDomElement childEl = n.toElement(); + TQDomElement childEl = n.toElement(); if (childEl.tagName() != "dock" && childEl.tagName() != "tabGroup") continue; @@ -2406,7 +2406,7 @@ void KDockManager::readConfig(QDomElement &base) if (!boolEntry(childEl, "hasParent")) { // Read a common toplevel dock widget obj = getDockWidgetFromName(stringEntry(childEl, "name")); - QString name = stringEntry(childEl, "dockBackTo"); + TQString name = stringEntry(childEl, "dockBackTo"); if (!name.isEmpty()) { obj->setFormerBrotherDockWidget(getDockWidgetFromName(name)); } @@ -2418,20 +2418,20 @@ void KDockManager::readConfig(QDomElement &base) if (main->inherits("KDockMainWindow")) { KDockMainWindow *dmain = (KDockMainWindow*)main; - QString mv = stringEntry(base, "centralWidget"); + TQString mv = stringEntry(base, "centralWidget"); if (!mv.isEmpty() && getDockWidgetFromName(mv) ) { KDockWidget *mvd = getDockWidgetFromName(mv); mvd->applyToWidget(dmain); mvd->show(); dmain->setCentralWidget(mvd); } - QString md = stringEntry(base, "mainDockWidget"); + TQString md = stringEntry(base, "mainDockWidget"); if (!md.isEmpty() && getDockWidgetFromName(md)) { KDockWidget *mvd = getDockWidgetFromName(md); dmain->setMainDockWidget(mvd); } } else { - QString mv = stringEntry(base, "mainWidget"); + TQString mv = stringEntry(base, "mainWidget"); if (!mv.isEmpty() && getDockWidgetFromName(mv)) { KDockWidget *mvd = getDockWidgetFromName(mv); mvd->applyToWidget(main); @@ -2439,7 +2439,7 @@ void KDockManager::readConfig(QDomElement &base) } // only resize + move non-mainwindows - QRect mr = rectEntry(base, "geometry"); + TQRect mr = rectEntry(base, "geometry"); main->move(mr.topLeft()); main->resize(mr.size()); } @@ -2472,7 +2472,7 @@ void KDockManager::setReadDockConfigMode(int mode) } #ifndef NO_KDE2 -void KDockManager::writeConfig( KConfig* c, QString group ) +void KDockManager::writeConfig( KConfig* c, TQString group ) { //debug("BEGIN Write Config"); if ( !c ) c = KGlobal::config(); @@ -2481,13 +2481,13 @@ void KDockManager::writeConfig( KConfig* c, QString group ) c->setGroup( group ); c->writeEntry( "Version", DOCK_CONFIG_VERSION ); - QStringList nameList; - QStringList findList; - QObjectListIt it( *childDock ); + TQStringList nameList; + TQStringList findList; + TQObjectListIt it( *childDock ); KDockWidget * obj; // collect KDockWidget's name - QStringList nList; + TQStringList nList; while ( (obj=(KDockWidget*)it.current()) ) { ++it; //debug(" +Add subdock %s", obj->name()); @@ -2496,21 +2496,21 @@ void KDockManager::writeConfig( KConfig* c, QString group ) c->writeEntry( "Main:view", obj->name() ); } -// kdDebug(282)<<QString("list size: %1").arg(nList.count())<<endl; - for (QObjectListIt it(d->containerDocks);it.current();++it) +// kdDebug(282)<<TQString("list size: %1").arg(nList.count())<<endl; + for (TQObjectListIt it(d->containerDocks);it.current();++it) { KDockContainer* dc = dynamic_cast<KDockContainer*>(((KDockWidget*)it.current())->widget); if (dc) { dc->prepareSave(nList); } } -// kdDebug(282)<<QString("new list size: %1").arg(nList.count())<<endl; +// kdDebug(282)<<TQString("new list size: %1").arg(nList.count())<<endl; - QStringList::Iterator nListIt=nList.begin(); + TQStringList::Iterator nListIt=nList.begin(); while ( nListIt!=nList.end() ){ //debug(" -Try to save %s", nList.current()); obj = getDockWidgetFromName( *nListIt ); - QString cname = obj->name(); + TQString cname = obj->name(); if ( obj->header ){ obj->header->saveConfig( c ); } @@ -2527,7 +2527,7 @@ void KDockManager::writeConfig( KConfig* c, QString group ) c->writeEntry( cname+":type", "GROUP"); if ( !obj->parent() ){ c->writeEntry( cname+":parent", "___null___"); - c->writeEntry( cname+":geometry", QRect(obj->frameGeometry().topLeft(), obj->size()) ); + c->writeEntry( cname+":geometry", TQRect(obj->frameGeometry().topLeft(), obj->size()) ); c->writeEntry( cname+":visible", obj->isVisible()); } else { c->writeEntry( cname+":parent", "yes"); @@ -2559,14 +2559,14 @@ void KDockManager::writeConfig( KConfig* c, QString group ) c->writeEntry( cname+":type", "TAB_GROUP"); if ( !obj->parent() ){ c->writeEntry( cname+":parent", "___null___"); - c->writeEntry( cname+":geometry", QRect(obj->frameGeometry().topLeft(), obj->size()) ); + c->writeEntry( cname+":geometry", TQRect(obj->frameGeometry().topLeft(), obj->size()) ); c->writeEntry( cname+":visible", obj->isVisible()); c->writeEntry( cname+":dockBackTo", obj->formerBrotherDockWidget ? obj->formerBrotherDockWidget->name() : ""); c->writeEntry( cname+":dockBackToPos", obj->formerDockPos); } else { c->writeEntry( cname+":parent", "yes"); } - QStrList list; + TQStrList list; for ( int i = 0; i < ((KDockTabGroup*)obj->widget)->count(); ++i ) list.append( ((KDockTabGroup*)obj->widget)->page( i )->name() ); c->writeEntry( cname+":tabNames", list ); @@ -2583,7 +2583,7 @@ void KDockManager::writeConfig( KConfig* c, QString group ) c->writeEntry( cname+":tabToolTip", obj->toolTipString()); if ( !obj->parent() ){ c->writeEntry( cname+":type", "NULL_DOCK"); - c->writeEntry( cname+":geometry", QRect(obj->frameGeometry().topLeft(), obj->size()) ); + c->writeEntry( cname+":geometry", TQRect(obj->frameGeometry().topLeft(), obj->size()) ); c->writeEntry( cname+":visible", obj->isVisible()); c->writeEntry( cname+":dockBackTo", obj->formerBrotherDockWidget ? obj->formerBrotherDockWidget->name() : ""); c->writeEntry( cname+":dockBackToPos", obj->formerDockPos); @@ -2600,7 +2600,7 @@ void KDockManager::writeConfig( KConfig* c, QString group ) } c->writeEntry( "NameList", nameList ); - c->writeEntry( "Main:Geometry", QRect(main->frameGeometry().topLeft(), main->size()) ); + c->writeEntry( "Main:Geometry", TQRect(main->frameGeometry().topLeft(), main->size()) ); c->writeEntry( "Main:visible", main->isVisible()); // curently nou use if ( main->inherits("KDockMainWindow") ){ @@ -2613,31 +2613,31 @@ void KDockManager::writeConfig( KConfig* c, QString group ) c->sync(); //debug("END Write Config"); } -#include <qmessagebox.h> -void KDockManager::readConfig( KConfig* c, QString group ) +#include <tqmessagebox.h> +void KDockManager::readConfig( KConfig* c, TQString group ) { if ( !c ) c = KGlobal::config(); if ( group.isEmpty() ) group = "dock_setting_default"; c->setGroup( group ); - QStrList nameList; + TQStrList nameList; c->readListEntry( "NameList", nameList ); - QString ver = c->readEntry( "Version", "0.0.1" ); + TQString ver = c->readEntry( "Version", "0.0.1" ); nameList.first(); if ( !nameList.current() || ver != DOCK_CONFIG_VERSION ){ activate(); return; } - autoCreateDock = new QObjectList(); + autoCreateDock = new TQObjectList(); autoCreateDock->setAutoDelete( true ); bool isMainVisible = main->isVisible(); // if (isMainVisible) // CCC - //QMessageBox::information(0,"","hallo"); + //TQMessageBox::information(0,"","hallo"); //COMMENTED4TESTING main->hide(); - QObjectListIt it( *childDock ); + TQObjectListIt it( *childDock ); KDockWidget * obj; while ( (obj=(KDockWidget*)it.current()) ){ @@ -2652,13 +2652,13 @@ void KDockManager::readConfig( KConfig* c, QString group ) // they must be restored before e.g. tabgroups are restored nameList.first(); while ( nameList.current() ){ - QString oname = nameList.current(); + TQString oname = nameList.current(); c->setGroup( group ); - QString type = c->readEntry( oname + ":type" ); + TQString type = c->readEntry( oname + ":type" ); obj = 0L; if ( type == "NULL_DOCK" || c->readEntry( oname + ":parent") == "___null___" ){ - QRect r = c->readRectEntry( oname + ":geometry" ); + TQRect r = c->readRectEntry( oname + ":geometry" ); obj = getDockWidgetFromName( oname ); obj->applyToWidget( 0L ); obj->setGeometry(r); @@ -2667,7 +2667,7 @@ void KDockManager::readConfig( KConfig* c, QString group ) obj->setTabPageLabel(c->readEntry( oname + ":tabCaption" )); obj->setToolTipString(c->readEntry( oname + ":tabToolTip" )); if ( c->readBoolEntry( oname + ":visible" ) ){ - obj->QWidget::show(); + obj->TQWidget::show(); } } @@ -2690,9 +2690,9 @@ void KDockManager::readConfig( KConfig* c, QString group ) // secondly, after the common dockwidgets, restore the groups and tabgroups nameList.first(); while ( nameList.current() ){ - QString oname = nameList.current(); + TQString oname = nameList.current(); c->setGroup( group ); - QString type = c->readEntry( oname + ":type" ); + TQString type = c->readEntry( oname + ":type" ); obj = 0L; if ( type == "GROUP" ){ @@ -2710,7 +2710,7 @@ void KDockManager::readConfig( KConfig* c, QString group ) } if ( type == "TAB_GROUP" ){ - QStrList list; + TQStrList list; KDockWidget* tabDockGroup = 0L; c->readListEntry( oname+":tabNames", list ); KDockWidget* d1 = getDockWidgetFromName( list.first() ); @@ -2746,15 +2746,15 @@ void KDockManager::readConfig( KConfig* c, QString group ) // iterate them again and link the toplevel ones of them with their corresponding dockwidget for the dockback action nameList.first(); while ( nameList.current() ){ - QString oname = nameList.current(); + TQString oname = nameList.current(); c->setGroup( group ); - QString type = c->readEntry( oname + ":type" ); + TQString type = c->readEntry( oname + ":type" ); obj = 0L; if ( type == "NULL_DOCK" || c->readEntry( oname + ":parent") == "___null___" ){ obj = getDockWidgetFromName( oname ); c->setGroup( group ); - QString name = c->readEntry( oname + ":dockBackTo" ); + TQString name = c->readEntry( oname + ":dockBackTo" ); if (!name.isEmpty()) { obj->setFormerBrotherDockWidget(getDockWidgetFromName( name )); } @@ -2768,7 +2768,7 @@ void KDockManager::readConfig( KConfig* c, QString group ) KDockMainWindow* dmain = (KDockMainWindow*)main; c->setGroup( group ); - QString mv = c->readEntry( "Main:view" ); + TQString mv = c->readEntry( "Main:view" ); if ( !mv.isEmpty() && getDockWidgetFromName( mv ) ){ KDockWidget* mvd = getDockWidgetFromName( mv ); mvd->applyToWidget( dmain ); @@ -2776,14 +2776,14 @@ void KDockManager::readConfig( KConfig* c, QString group ) dmain->setView( mvd ); } c->setGroup( group ); - QString md = c->readEntry( "Main:dock" ); + TQString md = c->readEntry( "Main:dock" ); if ( !md.isEmpty() && getDockWidgetFromName( md ) ){ KDockWidget* mvd = getDockWidgetFromName( md ); dmain->setMainDockWidget( mvd ); } } else { c->setGroup( group ); - QString mv = c->readEntry( "Main:view" ); + TQString mv = c->readEntry( "Main:view" ); if ( !mv.isEmpty() && getDockWidgetFromName( mv ) ){ KDockWidget* mvd = getDockWidgetFromName( mv ); mvd->applyToWidget( main ); @@ -2798,7 +2798,7 @@ void KDockManager::readConfig( KConfig* c, QString group ) } c->setGroup( group ); - QRect mr = c->readRectEntry("Main:Geometry"); + TQRect mr = c->readRectEntry("Main:Geometry"); main->move(mr.topLeft()); main->resize(mr.size()); if ( isMainVisible ) main->show(); @@ -2807,7 +2807,7 @@ void KDockManager::readConfig( KConfig* c, QString group ) void KDockManager::dumpDockWidgets() { - QObjectListIt it( *childDock ); + TQObjectListIt it( *childDock ); KDockWidget * obj; while ( (obj=(KDockWidget*)it.current()) ) { ++it; @@ -2816,19 +2816,19 @@ void KDockManager::dumpDockWidgets() { } -KDockWidget* KDockManager::getDockWidgetFromName( const QString& dockName ) +KDockWidget* KDockManager::getDockWidgetFromName( const TQString& dockName ) { - QObjectListIt it( *childDock ); + TQObjectListIt it( *childDock ); KDockWidget * obj; while ( (obj=(KDockWidget*)it.current()) ) { ++it; - if ( QString(obj->name()) == dockName ) return obj; + if ( TQString(obj->name()) == dockName ) return obj; } KDockWidget* autoCreate = 0L; if ( autoCreateDock ){ kdDebug(282)<<"Autocreating dock: "<<dockName<<endl; - autoCreate = new KDockWidget( this, dockName.latin1(), QPixmap("") ); + autoCreate = new KDockWidget( this, dockName.latin1(), TQPixmap("") ); autoCreateDock->append( autoCreate ); } return autoCreate; @@ -2868,20 +2868,20 @@ void KDockManager::slotMenuPopup() menu->clear(); menuData->clear(); - QObjectListIt it( *childDock ); + TQObjectListIt it( *childDock ); KDockWidget * obj; int numerator = 0; while ( (obj=(KDockWidget*)it.current()) ) { ++it; if ( obj->mayBeHide() ) { - menu->insertItem( obj->icon() ? *(obj->icon()) : QPixmap(), i18n("Hide %1").arg(obj->caption()), numerator++ ); + menu->insertItem( obj->icon() ? *(obj->icon()) : TQPixmap(), i18n("Hide %1").arg(obj->caption()), numerator++ ); menuData->append( new MenuDockData( obj, true ) ); } if ( obj->mayBeShow() ) { - menu->insertItem( obj->icon() ? *(obj->icon()) : QPixmap(), i18n("Show %1").arg(obj->caption()), numerator++ ); + menu->insertItem( obj->icon() ? *(obj->icon()) : TQPixmap(), i18n("Show %1").arg(obj->caption()), numerator++ ); menuData->append( new MenuDockData( obj, false ) ); } } @@ -2893,9 +2893,9 @@ void KDockManager::slotMenuActivated( int id ) data->dock->changeHideShowState(); } -KDockWidget* KDockManager::findWidgetParentDock( QWidget* w ) const +KDockWidget* KDockManager::findWidgetParentDock( TQWidget* w ) const { - QObjectListIt it( *childDock ); + TQObjectListIt it( *childDock ); KDockWidget * dock; KDockWidget * found = 0L; @@ -2915,7 +2915,7 @@ void KDockManager::drawDragRectangle() return; int i; - QRect oldAndNewDragRect[2]; + TQRect oldAndNewDragRect[2]; oldAndNewDragRect[0] = d->oldDragRect; oldAndNewDragRect[1] = d->dragRect; @@ -2924,7 +2924,7 @@ void KDockManager::drawDragRectangle() if (oldAndNewDragRect[i].isEmpty()) continue; - KDockWidget* pDockWdgAtRect = (KDockWidget*) QApplication::widgetAt( oldAndNewDragRect[i].topLeft(), true ); + KDockWidget* pDockWdgAtRect = (KDockWidget*) TQApplication::widgetAt( oldAndNewDragRect[i].topLeft(), true ); if (!pDockWdgAtRect) continue; @@ -2932,7 +2932,7 @@ void KDockManager::drawDragRectangle() bool unclipped; KDockMainWindow* pMain = 0L; KDockWidget* pTLDockWdg = 0L; - QWidget* topWdg; + TQWidget* topWdg; if (pDockWdgAtRect->topLevelWidget() == main) { isOverMainWdg = true; topWdg = pMain = (KDockMainWindow*) main; @@ -2946,7 +2946,7 @@ void KDockManager::drawDragRectangle() } // draw the rectangle unclipped over the main dock window - QPainter p; + TQPainter p; p.begin( topWdg ); if ( !unclipped ) { if (isOverMainWdg) @@ -2956,8 +2956,8 @@ void KDockManager::drawDragRectangle() } // draw the rectangle p.setRasterOp(Qt::NotXorROP); - QRect r = oldAndNewDragRect[i]; - r.moveTopLeft( r.topLeft() - topWdg->mapToGlobal(QPoint(0,0)) ); + TQRect r = oldAndNewDragRect[i]; + r.moveTopLeft( r.topLeft() - topWdg->mapToGlobal(TQPoint(0,0)) ); p.drawRect(r.x(), r.y(), r.width(), r.height()); p.end(); } @@ -2984,10 +2984,10 @@ void KDockManager::setSpecialBottomDockContainer(KDockWidget* container) { } -KDockArea::KDockArea( QWidget* parent, const char *name) -:QWidget( parent, name) +KDockArea::KDockArea( TQWidget* parent, const char *name) +:TQWidget( parent, name) { - QString new_name = QString(name) + QString("_DockManager"); + TQString new_name = TQString(name) + TQString("_DockManager"); dockManager = new KDockManager( this, new_name.latin1() ); mainDockWidget = 0L; } @@ -2997,7 +2997,7 @@ KDockArea::~KDockArea() delete dockManager; } -KDockWidget* KDockArea::createDockWidget( const QString& name, const QPixmap &pixmap, QWidget* parent, const QString& strCaption, const QString& strTabPageLabel) +KDockWidget* KDockArea::createDockWidget( const TQString& name, const TQPixmap &pixmap, TQWidget* parent, const TQString& strCaption, const TQString& strTabPageLabel) { return new KDockWidget( dockManager, name.latin1(), pixmap, parent, strCaption, strTabPageLabel ); } @@ -3014,44 +3014,44 @@ void KDockArea::makeDockInvisible( KDockWidget* dock ) dock->undock(); } -void KDockArea::makeWidgetDockVisible( QWidget* widget ) +void KDockArea::makeWidgetDockVisible( TQWidget* widget ) { makeDockVisible( dockManager->findWidgetParentDock(widget) ); } -void KDockArea::writeDockConfig(QDomElement &base) +void KDockArea::writeDockConfig(TQDomElement &base) { dockManager->writeConfig(base); } -void KDockArea::readDockConfig(QDomElement &base) +void KDockArea::readDockConfig(TQDomElement &base) { dockManager->readConfig(base); } void KDockArea::slotDockWidgetUndocked() { - QObject* pSender = (QObject*) sender(); + TQObject* pSender = (TQObject*) sender(); if (!pSender->inherits("KDockWidget")) return; KDockWidget* pDW = (KDockWidget*) pSender; emit dockWidgetHasUndocked( pDW); } -void KDockArea::resizeEvent(QResizeEvent *rsize) +void KDockArea::resizeEvent(TQResizeEvent *rsize) { - QWidget::resizeEvent(rsize); + TQWidget::resizeEvent(rsize); if (children()){ #ifndef NO_KDE2 // kdDebug(282)<<"KDockArea::resize"<<endl; #endif - QObjectList *list=queryList("QWidget",0,false); + TQObjectList *list=queryList("TQWidget",0,false); - QObjectListIt it( *list ); // iterate over the buttons - QObject *obj; + TQObjectListIt it( *list ); // iterate over the buttons + TQObject *obj; while ( (obj = it.current()) != 0 ) { // for each found object... - ((QWidget*)obj)->setGeometry(QRect(QPoint(0,0),size())); + ((TQWidget*)obj)->setGeometry(TQRect(TQPoint(0,0),size())); break; } delete list; @@ -3059,12 +3059,12 @@ void KDockArea::resizeEvent(QResizeEvent *rsize) KDockSplitter *split; // for (unsigned int i=0;i<children()->count();i++) { -// QPtrList<QObject> list(children()); -// QObject *obj=((QPtrList<QObject*>)children())->at(i); - QObject *obj=children()->getFirst(); +// TQPtrList<TQObject> list(children()); +// TQObject *obj=((TQPtrList<TQObject*>)children())->at(i); + TQObject *obj=children()->getFirst(); if (split = dynamic_cast<KDockSplitter*>(obj)) { - split->setGeometry( QRect(QPoint(0,0), size() )); + split->setGeometry( TQRect(TQPoint(0,0), size() )); // break; } } @@ -3073,12 +3073,12 @@ void KDockArea::resizeEvent(QResizeEvent *rsize) } #ifndef NO_KDE2 -void KDockArea::writeDockConfig( KConfig* c, QString group ) +void KDockArea::writeDockConfig( KConfig* c, TQString group ) { dockManager->writeConfig( c, group ); } -void KDockArea::readDockConfig( KConfig* c, QString group ) +void KDockArea::readDockConfig( KConfig* c, TQString group ) { dockManager->readConfig( c, group ); } @@ -3145,17 +3145,17 @@ bool KDockContainer::isOverlapMode() { } -bool KDockContainer::dockDragEnter(KDockWidget*, QMouseEvent *) { return false;} -bool KDockContainer::dockDragMove(KDockWidget*, QMouseEvent *) { return false;} -bool KDockContainer::dockDragLeave(KDockWidget*, QMouseEvent *) { return false;} +bool KDockContainer::dockDragEnter(KDockWidget*, TQMouseEvent *) { return false;} +bool KDockContainer::dockDragMove(KDockWidget*, TQMouseEvent *) { return false;} +bool KDockContainer::dockDragLeave(KDockWidget*, TQMouseEvent *) { return false;} KDockWidget *KDockContainer::parentDockWidget(){return 0;} -QStringList KDockContainer::containedWidgets() const { - QStringList tmp; +TQStringList KDockContainer::containedWidgets() const { + TQStringList tmp; for (struct ListItem *it=m_childrenListBegin;it;it=it->next) { - tmp<<QString(it->data); + tmp<<TQString(it->data); } return tmp; @@ -3164,7 +3164,7 @@ QStringList KDockContainer::containedWidgets() const { void KDockContainer::showWidget(KDockWidget *) { } -void KDockContainer::insertWidget (KDockWidget *dw, QPixmap, const QString &, int &) +void KDockContainer::insertWidget (KDockWidget *dw, TQPixmap, const TQString &, int &) { struct ListItem *it=new struct ListItem; it->data=strdup(dw->name()); @@ -3201,13 +3201,13 @@ void KDockContainer::removeWidget (KDockWidget *dw){ //m_children.remove(dw->name());} void KDockContainer::undockWidget (KDockWidget *){;} -void KDockContainer::setToolTip(KDockWidget *, QString &){;} -void KDockContainer::setPixmap(KDockWidget*,const QPixmap&){;} -void KDockContainer::load (KConfig*, const QString&){;} -void KDockContainer::save (KConfig*, const QString&){;} -void KDockContainer::load (QDomElement&){;} -void KDockContainer::save (QDomElement&){;} -void KDockContainer::prepareSave(QStringList &names) +void KDockContainer::setToolTip(KDockWidget *, TQString &){;} +void KDockContainer::setPixmap(KDockWidget*,const TQPixmap&){;} +void KDockContainer::load (KConfig*, const TQString&){;} +void KDockContainer::save (KConfig*, const TQString&){;} +void KDockContainer::load (TQDomElement&){;} +void KDockContainer::save (TQDomElement&){;} +void KDockContainer::prepareSave(TQStringList &names) { for (struct ListItem *tmp=m_childrenListBegin;tmp; tmp=tmp->next) @@ -3219,11 +3219,11 @@ void KDockContainer::prepareSave(QStringList &names) } -QWidget *KDockTabGroup::transientTo() { - QWidget *tT=0; +TQWidget *KDockTabGroup::transientTo() { + TQWidget *tT=0; for (int i=0;i<count();i++) { KDockWidget *dw=static_cast<KDockWidget*>(page(i)->qt_cast("KDockWidget")); - QWidget *tmp; + TQWidget *tmp; if ((tmp=dw->transientTo())) { if (!tT) tT=tmp; else { |