summaryrefslogtreecommitdiffstats
path: root/languages/cpp/debugger/dbgtoolbar.cpp
diff options
context:
space:
mode:
authortpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2011-06-14 16:45:05 +0000
committertpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2011-06-14 16:45:05 +0000
commit48d4a26399959121f33d2bc3bfe51c7827b654fc (patch)
tree5ae5e6e00d3ba330b7b8be9bc097154b6bc739e8 /languages/cpp/debugger/dbgtoolbar.cpp
parent7e701ace6592d09e1f2c0cf28c7d6d872d78f4f5 (diff)
downloadtdevelop-48d4a26399959121f33d2bc3bfe51c7827b654fc.tar.gz
tdevelop-48d4a26399959121f33d2bc3bfe51c7827b654fc.zip
TQt4 port kdevelop
This enables compilation under both Qt3 and Qt4 git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdevelop@1236710 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'languages/cpp/debugger/dbgtoolbar.cpp')
-rw-r--r--languages/cpp/debugger/dbgtoolbar.cpp102
1 files changed, 51 insertions, 51 deletions
diff --git a/languages/cpp/debugger/dbgtoolbar.cpp b/languages/cpp/debugger/dbgtoolbar.cpp
index 3fbef3c4..aaf4476b 100644
--- a/languages/cpp/debugger/dbgtoolbar.cpp
+++ b/languages/cpp/debugger/dbgtoolbar.cpp
@@ -12,7 +12,7 @@
* (at your option) any later version. *
* *
***************************************************************************/
-#ifndef QT_MAC
+#ifndef TQT_MAC
#include "dbgtoolbar.h"
#include "debuggerpart.h"
#include "dbgcontroller.h"
@@ -65,10 +65,10 @@ namespace GDBDebugger
// the iconify, close, etc buttons from the window title but again I kept running
// into problems. Instead, I used no decoration and this class. Also this looks
// similar to the KToolBar floating style.
-class DbgMoveHandle : public QFrame
+class DbgMoveHandle : public TQFrame
{
public:
- DbgMoveHandle(DbgToolBar *parent=0, const char * name=0, WFlags f=0);
+ DbgMoveHandle(DbgToolBar *tqparent=0, const char * name=0, WFlags f=0);
virtual ~DbgMoveHandle();
virtual void mousePressEvent(TQMouseEvent *e);
@@ -83,9 +83,9 @@ private:
// **************************************************************************
-DbgMoveHandle::DbgMoveHandle(DbgToolBar *parent, const char * name, WFlags f)
- : TQFrame(parent, name, f),
- toolBar_(parent),
+DbgMoveHandle::DbgMoveHandle(DbgToolBar *tqparent, const char * name, WFlags f)
+ : TQFrame(tqparent, name, f),
+ toolBar_(tqparent),
offset_(TQPoint(0,0)),
moving_(false)
{
@@ -107,21 +107,21 @@ void DbgMoveHandle::mousePressEvent(TQMouseEvent *e)
if (moving_)
return;
- if (e->button() == RightButton) {
+ if (e->button() == Qt::RightButton) {
KPopupMenu *menu = new KPopupMenu(this);
menu->insertTitle(i18n("Debug Toolbar"));
menu->insertItem(i18n("Dock to Panel"),
- parent(), TQT_SLOT(slotDock()));
+ tqparent(), TQT_SLOT(slotDock()));
menu->insertItem(i18n("Dock to Panel && Iconify KDevelop"),
- parent(), TQT_SLOT(slotIconifyAndDock()));
+ tqparent(), TQT_SLOT(slotIconifyAndDock()));
menu->popup(e->globalPos());
} else {
moving_ = true;
- offset_ = parentWidget()->pos() - e->globalPos();
+ offset_ = tqparentWidget()->pos() - e->globalPos();
setFrameStyle(TQFrame::Panel|TQFrame::Sunken);
TQApplication::setOverrideCursor(TQCursor(sizeAllCursor));
- setPalette(TQPalette(colorGroup().background()));
- repaint();
+ setPalette(TQPalette(tqcolorGroup().background()));
+ tqrepaint();
}
}
@@ -134,8 +134,8 @@ void DbgMoveHandle::mouseReleaseEvent(TQMouseEvent *e)
offset_ = TQPoint(0,0);
setFrameStyle(TQFrame::Panel|TQFrame::Raised);
TQApplication::restoreOverrideCursor();
- setPalette(TQPalette(colorGroup().background()));
- repaint();
+ setPalette(TQPalette(tqcolorGroup().background()));
+ tqrepaint();
}
// **************************************************************************
@@ -153,16 +153,16 @@ void DbgMoveHandle::mouseMoveEvent(TQMouseEvent *e)
// **************************************************************************
// **************************************************************************
-// This class adds text _and_ a pixmap to a button. Why doesn't QPushButton
+// This class adds text _and_ a pixmap to a button. Why doesn't TQPushButton
// support that? It only allowed text _or_ pixmap.
-class DbgButton : public QPushButton
+class DbgButton : public TQPushButton
{
public:
DbgButton(const TQPixmap &pixmap, const TQString &text,
- DbgToolBar *parent, const char *name=0);
+ DbgToolBar *tqparent, const char *name=0);
virtual ~DbgButton() {};
void drawButtonLabel(TQPainter *painter);
- TQSize sizeHint() const;
+ TQSize tqsizeHint() const;
private:
TQPixmap pixmap_;
@@ -171,8 +171,8 @@ private:
// **************************************************************************
DbgButton::DbgButton(const TQPixmap& pixmap, const TQString& text,
- DbgToolBar* parent, const char* name)
- : TQPushButton(parent, name),
+ DbgToolBar* tqparent, const char* name)
+ : TQPushButton(tqparent, name),
pixmap_(pixmap)
{
setText(text);
@@ -191,21 +191,21 @@ void DbgButton::drawButtonLabel(TQPainter *painter)
painter->drawPixmap(x, y, pixmap_);
if (hasText) {
- painter->setPen(colorGroup().text());
+ painter->setPen(tqcolorGroup().text());
painter->drawText(height()+2, 0, width()-(height()+2), height(), AlignLeft|AlignVCenter, text());
}
}
// **************************************************************************
-TQSize DbgButton::sizeHint() const
+TQSize DbgButton::tqsizeHint() const
{
if (text().isEmpty())
return pixmap_.size();
else
{
TQSize ps = pixmap_.size();
- TQSize bs = TQPushButton::sizeHint();
+ TQSize bs = TQPushButton::tqsizeHint();
TQSize result;
result.setWidth( ps.width() + bs.width()+10 );
result.setHeight( ps.height() > bs.height() ? ps.height() : bs.height() );
@@ -217,8 +217,8 @@ TQSize DbgButton::sizeHint() const
// **************************************************************************
// **************************************************************************
-DbgDocker::DbgDocker(TQWidget* parent, DbgToolBar* toolBar, const TQPixmap& pixmap) :
- KSystemTray(parent, "DbgDocker"),
+DbgDocker::DbgDocker(TQWidget* tqparent, DbgToolBar* toolBar, const TQPixmap& pixmap) :
+ KSystemTray(tqparent, "DbgDocker"),
toolBar_(toolBar)
{
setPixmap(pixmap);
@@ -229,17 +229,17 @@ DbgDocker::DbgDocker(TQWidget* parent, DbgToolBar* toolBar, const TQPixmap& pixm
void DbgDocker::mousePressEvent(TQMouseEvent *e)
{
- if (!rect().contains( e->pos()))
+ if (!TQT_TQRECT_OBJECT(rect()).tqcontains( e->pos()))
return;
switch (e->button()) {
- case LeftButton:
+ case Qt::LeftButton:
{
// Not really a click, but it'll hold for the time being !!!
emit clicked();
break;
}
- case RightButton:
+ case Qt::RightButton:
{
KPopupMenu* menu = new KPopupMenu(this);
menu->insertTitle(i18n("Debug Toolbar"));
@@ -258,7 +258,7 @@ void DbgDocker::mousePressEvent(TQMouseEvent *e)
// **************************************************************************
DbgToolBar::DbgToolBar(DebuggerPart* part,
- TQWidget* parent, const char* name)
+ TQWidget* tqparent, const char* name)
: TQFrame(0, name),
part_(part),
activeWindow_(0),
@@ -268,10 +268,10 @@ DbgToolBar::DbgToolBar(DebuggerPart* part,
appIsActive_(false),
docked_(false),
docker_(0),
- dockWindow_(new KSystemTray(parent))
+ dockWindow_(new KSystemTray(tqparent))
{
- winModule_ = new KWinModule(this);
- docker_ = new DbgDocker(parent, this, BarIcon("dbgnext"));
+ winModule_ = new KWinModule(TQT_TQOBJECT(this));
+ docker_ = new DbgDocker(tqparent, this, BarIcon("dbgnext"));
connect(docker_, TQT_SIGNAL(clicked()), part_, TQT_SLOT(slotStepOver()));
// Must have noFocus set so that we can see what window was active.
@@ -285,7 +285,7 @@ DbgToolBar::DbgToolBar(DebuggerPart* part,
// KWin::setType(winId(), NET::Override); // So it has no decoration
KWin::setType(winId(), NET::Dock);
- setFocusPolicy(NoFocus);
+ setFocusPolicy(TQ_NoFocus);
setFrameStyle( TQFrame::Box | TQFrame::Plain );
setLineWidth(4);
setMidLineWidth(0);
@@ -300,15 +300,15 @@ DbgToolBar::DbgToolBar(DebuggerPart* part,
TQPushButton* bRun = new DbgButton(BarIcon("dbgrun"), i18n("Run"), this);
TQPushButton* bInterrupt = new DbgButton(BarIcon("player_pause"), i18n("Interrupt"), this);
- TQPushButton* bNext = new DbgButton(BarIcon("dbgnext"), TQString::null, this);
- TQPushButton* bNexti = new DbgButton(BarIcon("dbgnextinst"), TQString::null, this);
- TQPushButton* bStep = new DbgButton(BarIcon("dbgstep"), TQString::null, this);
- TQPushButton* bStepi = new DbgButton(BarIcon("dbgstepinst"), TQString::null, this);
+ TQPushButton* bNext = new DbgButton(BarIcon("dbgnext"), TQString(), this);
+ TQPushButton* bNexti = new DbgButton(BarIcon("dbgnextinst"), TQString(), this);
+ TQPushButton* bStep = new DbgButton(BarIcon("dbgstep"), TQString(), this);
+ TQPushButton* bStepi = new DbgButton(BarIcon("dbgstepinst"), TQString(), this);
TQPushButton* bFinish = new DbgButton(BarIcon("dbgstepout"), i18n("Step Out"), this);
TQPushButton* bRunTo = new DbgButton(BarIcon("dbgrunto"), i18n("Run to Cursor"), this);
TQPushButton* bView = new DbgButton(BarIcon("dbgmemview"), i18n("Viewers"), this);
- bKDevFocus_ = new DbgButton(BarIcon("kdevelop"), TQString::null, this);
- bPrevFocus_ = new DbgButton(BarIcon("dbgmemview"), TQString::null, this);
+ bKDevFocus_ = new DbgButton(BarIcon("kdevelop"), TQString(), this);
+ bPrevFocus_ = new DbgButton(BarIcon("dbgmemview"), TQString(), this);
connect(bRun, TQT_SIGNAL(clicked()), part_, TQT_SLOT(slotRun()));
connect(bInterrupt, TQT_SIGNAL(clicked()), part_, TQT_SLOT(slotPause()));
@@ -365,12 +365,12 @@ DbgToolBar::DbgToolBar(DebuggerPart* part,
nextLayout->addWidget(bNext);
nextLayout->addWidget(bNexti);
-// int w = QMAX(bRun->sizeHint().width(), bFinish->sizeHint().width());
-// w = QMAX(w, bInterrupt->sizeHint().width());
-// w = QMAX(w, bView->sizeHint().width());
+// int w = TQMAX(bRun->tqsizeHint().width(), bFinish->tqsizeHint().width());
+// w = TQMAX(w, bInterrupt->tqsizeHint().width());
+// w = TQMAX(w, bView->tqsizeHint().width());
// they should have the same height, so don't be too fussy
-// int h = bFinish->sizeHint().height();
+// int h = bFinish->tqsizeHint().height();
//
// bNext->setMinimumHeight(h);
// bNexti->setMinimumHeight(h);
@@ -404,10 +404,10 @@ void DbgToolBar::slotKdevFocus()
// If anyone has a way of determining what window the app is _actually_ running on
// then please fix and send a patch.
- if (winModule_->activeWindow() != topLevelWidget()->winId())
+ if (winModule_->activeWindow() != tqtopLevelWidget()->winId())
activeWindow_ = winModule_->activeWindow();
- KWin::activateWindow(topLevelWidget()->winId());
+ KWin::activateWindow(tqtopLevelWidget()->winId());
}
// **************************************************************************
@@ -421,7 +421,7 @@ void DbgToolBar::slotPrevFocus()
// If the app is active then the app button is highlighted, otherwise
// kdev button is highlighted.
-void DbgToolBar::slotDbgStatus(const TQString&, int state)
+void DbgToolBar::slotDbgtqStatus(const TQString&, int state)
{
bool appIndicator = state & s_dbgBusy;
if (appIndicator != appIsActive_) {
@@ -435,11 +435,11 @@ void DbgToolBar::slotDbgStatus(const TQString&, int state)
void DbgToolBar::setAppIndicator(bool appIndicator)
{
if (appIndicator) {
- bPrevFocus_->setPalette(TQPalette(colorGroup().mid()));
- bKDevFocus_->setPalette(TQPalette(colorGroup().background()));
+ bPrevFocus_->setPalette(TQPalette(tqcolorGroup().mid()));
+ bKDevFocus_->setPalette(TQPalette(tqcolorGroup().background()));
} else {
- bPrevFocus_->setPalette(TQPalette(colorGroup().background()));
- bKDevFocus_->setPalette(TQPalette(colorGroup().mid()));
+ bPrevFocus_->setPalette(TQPalette(tqcolorGroup().background()));
+ bKDevFocus_->setPalette(TQPalette(tqcolorGroup().mid()));
}
}
@@ -487,7 +487,7 @@ void DbgToolBar::slotActivateAndUndock()
if (!docked_)
return;
- KWin::activateWindow(topLevelWidget()->winId());
+ KWin::activateWindow(tqtopLevelWidget()->winId());
slotUndock();
}