diff options
Diffstat (limited to 'languages/cpp/debugger/gdbbreakpointwidget.cpp')
-rw-r--r-- | languages/cpp/debugger/gdbbreakpointwidget.cpp | 212 |
1 files changed, 106 insertions, 106 deletions
diff --git a/languages/cpp/debugger/gdbbreakpointwidget.cpp b/languages/cpp/debugger/gdbbreakpointwidget.cpp index f9a83d6c..b092a015 100644 --- a/languages/cpp/debugger/gdbbreakpointwidget.cpp +++ b/languages/cpp/debugger/gdbbreakpointwidget.cpp @@ -29,18 +29,18 @@ #include <kurl.h> #include <kmessagebox.h> -#include <qvbuttongroup.h> -#include <qfileinfo.h> -#include <qheader.h> -#include <qtable.h> -#include <qtoolbutton.h> -#include <qtooltip.h> -#include <qwhatsthis.h> -#include <qvbox.h> -#include <qlayout.h> -#include <qlabel.h> -#include <qpushbutton.h> -#include <qcheckbox.h> +#include <tqvbuttongroup.h> +#include <tqfileinfo.h> +#include <tqheader.h> +#include <tqtable.h> +#include <tqtoolbutton.h> +#include <tqtooltip.h> +#include <tqwhatsthis.h> +#include <tqvbox.h> +#include <tqlayout.h> +#include <tqlabel.h> +#include <tqpushbutton.h> +#include <tqcheckbox.h> #include <stdlib.h> #include <ctype.h> @@ -80,7 +80,7 @@ class BreakpointTableRow : public QTableItem { public: - BreakpointTableRow(QTable* table, EditType editType, Breakpoint* bp); + BreakpointTableRow(TQTable* table, EditType editType, Breakpoint* bp); ~BreakpointTableRow(); bool match (Breakpoint* bp) const; @@ -100,9 +100,9 @@ private: /***************************************************************************/ /***************************************************************************/ -BreakpointTableRow::BreakpointTableRow(QTable* parent, EditType editType, +BreakpointTableRow::BreakpointTableRow(TQTable* parent, EditType editType, Breakpoint* bp) : - QTableItem(parent, editType, ""), + TQTableItem(parent, editType, ""), m_breakpoint(bp) { appendEmptyRow(); @@ -140,13 +140,13 @@ void BreakpointTableRow::appendEmptyRow() table()->setItem(row, Control, this); - QCheckTableItem* cti = new QCheckTableItem( table(), ""); + TQCheckTableItem* cti = new TQCheckTableItem( table(), ""); table()->setItem(row, Enable, cti); ComplexEditCell* act = new ComplexEditCell(table()); table()->setItem(row, Tracing, act); - QObject::connect(act, SIGNAL(edit(QTableItem*)), - table()->parent(), SLOT(editTracing(QTableItem*))); + TQObject::connect(act, TQT_SIGNAL(edit(TQTableItem*)), + table()->parent(), TQT_SLOT(editTracing(TQTableItem*))); } /***************************************************************************/ @@ -155,22 +155,22 @@ void BreakpointTableRow::setRow() { if ( m_breakpoint ) { - QTableItem *item = table()->item ( row(), Enable ); + TQTableItem *item = table()->item ( row(), Enable ); Q_ASSERT(item->rtti() == 2); - ((QCheckTableItem*)item)->setChecked(m_breakpoint->isEnabled()); + ((TQCheckTableItem*)item)->setChecked(m_breakpoint->isEnabled()); - QString status=m_breakpoint->statusDisplay(m_activeFlag); + TQString status=m_breakpoint->statusDisplay(m_activeFlag); table()->setText(row(), Status, status); table()->setText(row(), Condition, m_breakpoint->conditional()); - table()->setText(row(), IgnoreCount, QString::number(m_breakpoint->ignoreCount() )); - table()->setText(row(), Hits, QString::number(m_breakpoint->hits() )); + table()->setText(row(), IgnoreCount, TQString::number(m_breakpoint->ignoreCount() )); + table()->setText(row(), Hits, TQString::number(m_breakpoint->hits() )); - QString displayType = m_breakpoint->displayType(); + TQString displayType = m_breakpoint->displayType(); table()->setText(row(), Location, m_breakpoint->location()); - QTableItem* ce = table()->item( row(), Tracing ); + TQTableItem* ce = table()->item( row(), Tracing ); ce->setText(breakpoint()->tracingEnabled() ? "Enabled" : "Disabled"); // In case there's editor open in this cell, update it too. static_cast<ComplexEditCell*>(ce)->updateValue(); @@ -196,15 +196,15 @@ void BreakpointTableRow::setRow() /***************************************************************************/ GDBBreakpointWidget::GDBBreakpointWidget(GDBController* controller, - QWidget *parent, const char *name) : -QHBox(parent, name), + TQWidget *parent, const char *name) : +TQHBox(parent, name), controller_(controller) { m_table = new GDBTable(0, numCols, this, name); - m_table->setSelectionMode(QTable::SingleRow); + m_table->setSelectionMode(TQTable::SingleRow); m_table->setShowGrid (false); m_table->setLeftMargin(0); - m_table->setFocusStyle(QTable::FollowStyle); + m_table->setFocusStyle(TQTable::FollowStyle); m_table->hideColumn(Control); m_table->setColumnReadOnly(Type, true); @@ -212,7 +212,7 @@ controller_(controller) m_table->setColumnReadOnly(Hits, true); m_table->setColumnWidth( Enable, 20); - QHeader *header = m_table->horizontalHeader(); + TQHeader *header = m_table->horizontalHeader(); header->setLabel( Enable, "" ); header->setLabel( Type, i18n("Type") ); @@ -223,7 +223,7 @@ controller_(controller) header->setLabel( Hits, i18n("Hits") ); header->setLabel( Tracing, i18n("Tracing") ); - QPopupMenu* newBreakpoint = new QPopupMenu(this); + TQPopupMenu* newBreakpoint = new TQPopupMenu(this); newBreakpoint->insertItem(i18n("Code breakpoint", "Code"), BP_TYPE_FilePos); newBreakpoint->insertItem(i18n("Data breakpoint", "Data write"), @@ -232,7 +232,7 @@ controller_(controller) BP_TYPE_ReadWatchpoint); - m_ctxMenu = new QPopupMenu( this ); + m_ctxMenu = new TQPopupMenu( this ); m_ctxMenu->insertItem( i18n("New breakpoint", "New"), newBreakpoint); m_ctxMenu->insertItem( i18n( "Show text" ), BW_ITEM_Show ); @@ -251,39 +251,39 @@ controller_(controller) m_table->show(); - connect( newBreakpoint, SIGNAL(activated(int)), - this, SLOT(slotAddBlankBreakpoint(int)) ); + connect( newBreakpoint, TQT_SIGNAL(activated(int)), + this, TQT_SLOT(slotAddBlankBreakpoint(int)) ); - connect( m_table, SIGNAL(contextMenuRequested(int, int, const QPoint &)), - this, SLOT(slotContextMenuShow(int, int, const QPoint & )) ); - connect( m_ctxMenu, SIGNAL(activated(int)), - this, SLOT(slotContextMenuSelect(int)) ); + connect( m_table, TQT_SIGNAL(contextMenuRequested(int, int, const TQPoint &)), + this, TQT_SLOT(slotContextMenuShow(int, int, const TQPoint & )) ); + connect( m_ctxMenu, TQT_SIGNAL(activated(int)), + this, TQT_SLOT(slotContextMenuSelect(int)) ); - connect( m_table, SIGNAL(doubleClicked(int, int, int, const QPoint &)), - this, SLOT(slotRowDoubleClicked(int, int, int, const QPoint &))); + connect( m_table, TQT_SIGNAL(doubleClicked(int, int, int, const TQPoint &)), + this, TQT_SLOT(slotRowDoubleClicked(int, int, int, const TQPoint &))); - connect( m_table, SIGNAL(valueChanged(int, int)), - this, SLOT(slotNewValue(int, int))); + connect( m_table, TQT_SIGNAL(valueChanged(int, int)), + this, TQT_SLOT(slotNewValue(int, int))); - connect( m_table, SIGNAL(returnPressed()), - this, SLOT(slotEditBreakpoint())); -// connect( m_table, SIGNAL(f2Pressed()), -// this, SLOT(slotEditBreakpoint())); - connect( m_table, SIGNAL(deletePressed()), - this, SLOT(slotRemoveBreakpoint())); + connect( m_table, TQT_SIGNAL(returnPressed()), + this, TQT_SLOT(slotEditBreakpoint())); +// connect( m_table, TQT_SIGNAL(f2Pressed()), +// this, TQT_SLOT(slotEditBreakpoint())); + connect( m_table, TQT_SIGNAL(deletePressed()), + this, TQT_SLOT(slotRemoveBreakpoint())); // This slot doesn't exist anymore -// connect( m_table, SIGNAL(insertPressed()), -// this, SLOT(slotAddBlankBreakpoint())); +// connect( m_table, TQT_SIGNAL(insertPressed()), +// this, TQT_SLOT(slotAddBlankBreakpoint())); // FIXME: maybe, all debugger components should derive from // a base class that does this connect. - connect(controller, SIGNAL(event(GDBController::event_t)), - this, SLOT(slotEvent(GDBController::event_t))); + connect(controller, TQT_SIGNAL(event(GDBController::event_t)), + this, TQT_SLOT(slotEvent(GDBController::event_t))); connect(controller, - SIGNAL(watchpointHit(int, const QString&, const QString&)), + TQT_SIGNAL(watchpointHit(int, const TQString&, const TQString&)), this, - SLOT(slotWatchpointHit(int, const QString&, const QString&))); + TQT_SLOT(slotWatchpointHit(int, const TQString&, const TQString&))); } /***************************************************************************/ @@ -357,8 +357,8 @@ void GDBBreakpointWidget::slotBreakpointHit(int id) } void GDBBreakpointWidget::slotWatchpointHit(int id, - const QString& oldValue, - const QString& newValue) + const TQString& oldValue, + const TQString& newValue) { BreakpointTableRow* br = findId(id); @@ -451,10 +451,10 @@ bool GDBBreakpointWidget::hasWatchpointForAddress( BreakpointTableRow* GDBBreakpointWidget::addBreakpoint(Breakpoint *bp) { BreakpointTableRow* btr = - new BreakpointTableRow( m_table, QTableItem::WhenCurrent, bp ); + new BreakpointTableRow( m_table, TQTableItem::WhenCurrent, bp ); - connect(bp, SIGNAL(modified(Breakpoint*)), - this, SLOT(slotBreakpointModified(Breakpoint*))); + connect(bp, TQT_SIGNAL(modified(Breakpoint*)), + this, TQT_SLOT(slotBreakpointModified(Breakpoint*))); sendToGdb(*bp); @@ -489,7 +489,7 @@ void GDBBreakpointWidget::removeBreakpoint(BreakpointTableRow* btr) /***************************************************************************/ -void GDBBreakpointWidget::slotToggleBreakpoint(const QString &fileName, int lineNum) +void GDBBreakpointWidget::slotToggleBreakpoint(const TQString &fileName, int lineNum) { FilePosBreakpoint *fpBP = new FilePosBreakpoint(fileName, lineNum+1); @@ -504,7 +504,7 @@ void GDBBreakpointWidget::slotToggleBreakpoint(const QString &fileName, int line /***************************************************************************/ -void GDBBreakpointWidget::slotToggleBreakpointEnabled(const QString &fileName, int lineNum) +void GDBBreakpointWidget::slotToggleBreakpointEnabled(const TQString &fileName, int lineNum) { FilePosBreakpoint *fpBP = new FilePosBreakpoint(fileName, lineNum+1); @@ -520,7 +520,7 @@ void GDBBreakpointWidget::slotToggleBreakpointEnabled(const QString &fileName, i /***************************************************************************/ -void GDBBreakpointWidget::slotToggleWatchpoint(const QString &varName) +void GDBBreakpointWidget::slotToggleWatchpoint(const TQString &varName) { Watchpoint *watchpoint = new Watchpoint(varName, false, true); BreakpointTableRow* btr = find(watchpoint); @@ -557,7 +557,7 @@ void GDBBreakpointWidget::handleBreakpointList(const GDBMI::ResultRecord& r) if (b.hasField("cond")) bp->setConditional(b["cond"].literal()); else - bp->setConditional(QString::null); + bp->setConditional(TQString::null); btr->setRow(); emit publishBPState(*bp); } @@ -565,7 +565,7 @@ void GDBBreakpointWidget::handleBreakpointList(const GDBMI::ResultRecord& r) { // It's a breakpoint added outside, most probably // via gdb console. Add it now. - QString type = b["type"].literal(); + TQString type = b["type"].literal(); if (type == "breakpoint" || type == "hw breakpoint") { @@ -580,7 +580,7 @@ void GDBBreakpointWidget::handleBreakpointList(const GDBMI::ResultRecord& r) bp->setPending(false); new BreakpointTableRow(m_table, - QTableItem::WhenCurrent, + TQTableItem::WhenCurrent, bp); emit publishBPState(*bp); @@ -607,7 +607,7 @@ void GDBBreakpointWidget::handleBreakpointList(const GDBMI::ResultRecord& r) } } -void GDBBreakpointWidget::handleTracingPrintf(const QValueVector<QString>& s) +void GDBBreakpointWidget::handleTracingPrintf(const TQValueVector<TQString>& s) { // The first line of output is the command itself, which we don't need. for(unsigned i = 1; i < s.size(); ++i) @@ -684,7 +684,7 @@ void GDBBreakpointWidget::slotRemoveAllBreakpoints() /***************************************************************************/ -void GDBBreakpointWidget::slotRowDoubleClicked(int row, int col, int btn, const QPoint &) +void GDBBreakpointWidget::slotRowDoubleClicked(int row, int col, int btn, const TQPoint &) { if ( btn == Qt::LeftButton ) { @@ -703,7 +703,7 @@ void GDBBreakpointWidget::slotRowDoubleClicked(int row, int col, int btn, const } } -void GDBBreakpointWidget::slotContextMenuShow( int row, int /*col*/, const QPoint &mousePos ) +void GDBBreakpointWidget::slotContextMenuShow( int row, int /*col*/, const TQPoint &mousePos ) { BreakpointTableRow *btr = (BreakpointTableRow *)m_table->item(row, Control ); @@ -813,7 +813,7 @@ void GDBBreakpointWidget::slotContextMenuSelect( int item ) /***************************************************************************/ -void GDBBreakpointWidget::slotEditRow(int row, int col, const QPoint &) +void GDBBreakpointWidget::slotEditRow(int row, int col, const TQPoint &) { // kdDebug(9012) << "in slotEditRow row=" << row << endl; BreakpointTableRow* btr = (BreakpointTableRow *) m_table->item(row, Control); @@ -830,7 +830,7 @@ void GDBBreakpointWidget::slotNewValue(int row, int col) { BreakpointTableRow* btr = (BreakpointTableRow *) m_table->item(row, Control); - QString new_value = m_table->text(row, col); + TQString new_value = m_table->text(row, col); if (btr) { @@ -839,8 +839,8 @@ void GDBBreakpointWidget::slotNewValue(int row, int col) { case Enable: { - QCheckTableItem *item = - (QCheckTableItem*)m_table->item ( row, Enable ); + TQCheckTableItem *item = + (TQCheckTableItem*)m_table->item ( row, Enable ); bp->setEnabled(item->isChecked()); } break; @@ -913,7 +913,7 @@ void GDBBreakpointWidget::slotNewValue(int row, int col) /***************************************************************************/ -void GDBBreakpointWidget::slotEditBreakpoint(const QString &fileName, int lineNum) +void GDBBreakpointWidget::slotEditBreakpoint(const TQString &fileName, int lineNum) { FilePosBreakpoint *fpBP = new FilePosBreakpoint(fileName, lineNum+1); @@ -922,7 +922,7 @@ void GDBBreakpointWidget::slotEditBreakpoint(const QString &fileName, int lineNu if (btr) { - QTableSelection ts; + TQTableSelection ts; ts.init(btr->row(), 0); ts.expandTo(btr->row(), numCols); m_table->addSelection(ts); @@ -1019,7 +1019,7 @@ void GDBBreakpointWidget::slotEditBreakpoint() } -void GDBBreakpointWidget::editTracing(QTableItem* item) +void GDBBreakpointWidget::editTracing(TQTableItem* item) { BreakpointTableRow* btr = (BreakpointTableRow *) m_table->item(item->row(), Control); @@ -1032,7 +1032,7 @@ void GDBBreakpointWidget::editTracing(QTableItem* item) // Note: change cell text here and explicitly call slotNewValue here. // We want this signal to be emitted when we close the tracing dialog // and not when we select some other cell, as happens in Qt by default. - if (r == QDialog::Accepted) + if (r == TQDialog::Accepted) { // The dialog has modified "btr->breakpoint()" already. // Calling 'slotNewValue' will flush the changes back @@ -1046,42 +1046,42 @@ void GDBBreakpointWidget::editTracing(QTableItem* item) /***************************************************************************/ -void GDBBreakpointWidget::savePartialProjectSession(QDomElement* el) +void GDBBreakpointWidget::savePartialProjectSession(TQDomElement* el) { - QDomDocument domDoc = el->ownerDocument(); + TQDomDocument domDoc = el->ownerDocument(); if (domDoc.isNull()) return; - QDomElement breakpointListEl = domDoc.createElement("breakpointList"); + TQDomElement breakpointListEl = domDoc.createElement("breakpointList"); for ( int row = 0; row < m_table->numRows(); row++ ) { BreakpointTableRow* btr = (BreakpointTableRow *) m_table->item(row, Control); Breakpoint* bp = btr->breakpoint(); - QDomElement breakpointEl = - domDoc.createElement("breakpoint"+QString::number(row)); + TQDomElement breakpointEl = + domDoc.createElement("breakpoint"+TQString::number(row)); breakpointEl.setAttribute("type", bp->type()); breakpointEl.setAttribute("location", bp->location(false)); breakpointEl.setAttribute("enabled", bp->isEnabled()); breakpointEl.setAttribute("condition", bp->conditional()); breakpointEl.setAttribute("tracingEnabled", - QString::number(bp->tracingEnabled())); + TQString::number(bp->tracingEnabled())); breakpointEl.setAttribute("traceFormatStringEnabled", - QString::number(bp->traceFormatStringEnabled())); + TQString::number(bp->traceFormatStringEnabled())); breakpointEl.setAttribute("tracingFormatString", bp->traceFormatString()); - QDomElement tracedExpressions = + TQDomElement tracedExpressions = domDoc.createElement("tracedExpressions"); - QStringList::const_iterator i, e; + TQStringList::const_iterator i, e; for(i = bp->tracedExpressions().begin(), e = bp->tracedExpressions().end(); i != e; ++i) { - QDomElement expr = domDoc.createElement("expression"); + TQDomElement expr = domDoc.createElement("expression"); expr.setAttribute("value", *i); tracedExpressions.appendChild(expr); } @@ -1097,7 +1097,7 @@ void GDBBreakpointWidget::savePartialProjectSession(QDomElement* el) /***************************************************************************/ -void GDBBreakpointWidget::restorePartialProjectSession(const QDomElement* el) +void GDBBreakpointWidget::restorePartialProjectSession(const TQDomElement* el) { /** Eventually, would be best to make each breakpoint type handle loading/ saving it's data. The only problem is that on load, we need to allocate @@ -1106,10 +1106,10 @@ void GDBBreakpointWidget::restorePartialProjectSession(const QDomElement* el) KDE (Boost.Serialization is too much dependency, and rolling my own is boring). */ - QDomElement breakpointListEl = el->namedItem("breakpointList").toElement(); + TQDomElement breakpointListEl = el->namedItem("breakpointList").toElement(); if (!breakpointListEl.isNull()) { - QDomElement breakpointEl; + TQDomElement breakpointEl; for (breakpointEl = breakpointListEl.firstChild().toElement(); !breakpointEl.isNull(); breakpointEl = breakpointEl.nextSibling().toElement()) @@ -1155,17 +1155,17 @@ void GDBBreakpointWidget::restorePartialProjectSession(const QDomElement* el) breakpointEl.attribute("traceFormatStringEnabled", "0") .toInt()); - QDomNode tracedExpr = + TQDomNode tracedExpr = breakpointEl.namedItem("tracedExpressions"); if (!tracedExpr.isNull()) { - QStringList l; + TQStringList l; - for(QDomNode c = tracedExpr.firstChild(); !c.isNull(); + for(TQDomNode c = tracedExpr.firstChild(); !c.isNull(); c = c.nextSibling()) { - QDomElement el = c.toElement(); + TQDomElement el = c.toElement(); l.push_back(el.attribute("value", "")); } bp->setTracedExpressions(l); @@ -1186,11 +1186,11 @@ void GDBBreakpointWidget::restorePartialProjectSession(const QDomElement* el) /***************************************************************************/ -void GDBBreakpointWidget::focusInEvent( QFocusEvent */* e*/ ) +void GDBBreakpointWidget::focusInEvent( TQFocusEvent */* e*/ ) { // Without the following 'if', when we first open the breakpoints // widget, the background is all black. This happens only with - // m_table->setFocusStyle(QTable::FollowStyle); + // m_table->setFocusStyle(TQTable::FollowStyle); // in constructor, so I suspect Qt bug. But anyway, without // current cell keyboard actions like Enter for edit won't work, // so keyboard focus does not makes much sense. @@ -1203,42 +1203,42 @@ void GDBBreakpointWidget::focusInEvent( QFocusEvent */* e*/ ) } ComplexEditCell:: -ComplexEditCell(QTable* table) -: QTableItem(table, QTableItem::WhenCurrent) +ComplexEditCell(TQTable* table) +: TQTableItem(table, TQTableItem::WhenCurrent) { } -QWidget* ComplexEditCell::createEditor() const +TQWidget* ComplexEditCell::createEditor() const { - QHBox* box = new QHBox( table()->viewport() ); + TQHBox* box = new TQHBox( table()->viewport() ); box->setPaletteBackgroundColor( table()->palette().active().highlight()); - label_ = new QLabel(text(), box, "label"); + label_ = new TQLabel(text(), box, "label"); label_->setBackgroundMode(Qt::PaletteHighlight); // Sorry for hardcode, but '2' is already hardcoded in - // Qt source, in QTableItem::paint. Since I don't want the + // Qt source, in TQTableItem::paint. Since I don't want the // text to jump 2 pixels to the right when editor is activated, // need to set the same indent for label. label_->setIndent(2); - QPalette p = label_->palette(); + TQPalette p = label_->palette(); - p.setColor(QPalette::Active, QColorGroup::Foreground, + p.setColor(TQPalette::Active, TQColorGroup::Foreground, table()->palette().active().highlightedText()); - p.setColor(QPalette::Inactive, QColorGroup::Foreground, + p.setColor(TQPalette::Inactive, TQColorGroup::Foreground, table()->palette().active().highlightedText()); label_->setPalette(p); - QPushButton* b = new QPushButton("...", box); + TQPushButton* b = new TQPushButton("...", box); // This is exactly what is done in QDesigner source in the // similar context. Haven't had any success making the good look // with layout, I suppose that sizeHint for button is always larger // than 20. b->setFixedWidth( 20 ); - connect(b, SIGNAL(clicked()), this, SLOT(slotEdit())); + connect(b, TQT_SIGNAL(clicked()), this, TQT_SLOT(slotEdit())); return box; } |