summaryrefslogtreecommitdiffstats
path: root/languages/cpp/debugger/variablewidget.cpp
diff options
context:
space:
mode:
authortpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2010-07-31 19:56:07 +0000
committertpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2010-07-31 19:56:07 +0000
commitd6f8bbb45b267065a6907e71ff9c98bb6d161241 (patch)
treed109539636691d7b03036ca1c0ed29dbae6577cf /languages/cpp/debugger/variablewidget.cpp
parent3331a47a9cad24795c7440ee8107143ce444ef34 (diff)
downloadtdevelop-d6f8bbb45b267065a6907e71ff9c98bb6d161241.tar.gz
tdevelop-d6f8bbb45b267065a6907e71ff9c98bb6d161241.zip
Trinity Qt initial conversion
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdevelop@1157658 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'languages/cpp/debugger/variablewidget.cpp')
-rw-r--r--languages/cpp/debugger/variablewidget.cpp336
1 files changed, 168 insertions, 168 deletions
diff --git a/languages/cpp/debugger/variablewidget.cpp b/languages/cpp/debugger/variablewidget.cpp
index 263afdf9..163c2024 100644
--- a/languages/cpp/debugger/variablewidget.cpp
+++ b/languages/cpp/debugger/variablewidget.cpp
@@ -24,19 +24,19 @@
#include <kdeversion.h>
#include <kiconloader.h>
-#include <qheader.h>
-#include <qlabel.h>
-#include <qlayout.h>
-#include <qhbox.h>
-#include <qpainter.h>
-#include <qpushbutton.h>
-#include <qregexp.h>
-#include <qcursor.h>
-#include <qwhatsthis.h>
+#include <tqheader.h>
+#include <tqlabel.h>
+#include <tqlayout.h>
+#include <tqhbox.h>
+#include <tqpainter.h>
+#include <tqpushbutton.h>
+#include <tqregexp.h>
+#include <tqcursor.h>
+#include <tqwhatsthis.h>
#include <klocale.h>
-#include <qpoint.h>
-#include <qclipboard.h>
+#include <tqpoint.h>
+#include <tqclipboard.h>
#include <kapplication.h>
#include <kmessagebox.h>
@@ -77,8 +77,8 @@ namespace GDBDebugger
VariableWidget::VariableWidget(GDBController* controller,
GDBBreakpointWidget* breakpointWidget,
- QWidget *parent, const char *name)
-: QWidget(parent, name)
+ TQWidget *parent, const char *name)
+: TQWidget(parent, name)
{
setIcon(SmallIcon("math_brace"));
setCaption(i18n("Variable Tree"));
@@ -88,35 +88,35 @@ VariableWidget::VariableWidget(GDBController* controller,
watchVarEditor_ = new KHistoryCombo( this,
"var-to-watch editor");
- QHBoxLayout* buttons = new QHBoxLayout();
+ TQHBoxLayout* buttons = new TQHBoxLayout();
buttons->addStretch();
- QPushButton *evalButton = new QPushButton(i18n("&Evaluate"), this );
+ TQPushButton *evalButton = new TQPushButton(i18n("&Evaluate"), this );
buttons->addWidget(evalButton);
- QPushButton *addButton = new QPushButton(i18n("&Watch"), this );
+ TQPushButton *addButton = new TQPushButton(i18n("&Watch"), this );
buttons->addWidget(addButton);
- QVBoxLayout *topLayout = new QVBoxLayout(this, 2);
+ TQVBoxLayout *topLayout = new TQVBoxLayout(this, 2);
topLayout->addWidget(varTree_, 10);
topLayout->addWidget(watchVarEditor_);
topLayout->addItem(buttons);
- connect( addButton, SIGNAL(clicked()), SLOT(slotAddWatchVariable()) );
- connect( evalButton, SIGNAL(clicked()), SLOT(slotEvaluateExpression()) );
+ connect( addButton, TQT_SIGNAL(clicked()), TQT_SLOT(slotAddWatchVariable()) );
+ connect( evalButton, TQT_SIGNAL(clicked()), TQT_SLOT(slotEvaluateExpression()) );
- connect( watchVarEditor_, SIGNAL(returnPressed()),
- SLOT(slotEvaluateExpression()) );
+ connect( watchVarEditor_, TQT_SIGNAL(returnPressed()),
+ TQT_SLOT(slotEvaluateExpression()) );
- connect(controller, SIGNAL(event(GDBController::event_t)),
- varTree_, SLOT(slotEvent(GDBController::event_t)));
+ connect(controller, TQT_SIGNAL(event(GDBController::event_t)),
+ varTree_, TQT_SLOT(slotEvent(GDBController::event_t)));
// Setup help items.
- QWhatsThis::add(this, i18n(
+ TQWhatsThis::add(this, i18n(
"<b>Variable tree</b><p>"
"The variable tree allows you to see the values of local "
"variables and arbitrary expressions."
@@ -130,22 +130,22 @@ VariableWidget::VariableWidget(GDBController* controller,
"<p>To change the value of a variable or an expression, "
"click on the value."));
- QWhatsThis::add(watchVarEditor_,
+ TQWhatsThis::add(watchVarEditor_,
i18n("<b>Expression entry</b>"
"<p>Type in expression to evaluate."));
- QWhatsThis::add(evalButton,
+ TQWhatsThis::add(evalButton,
i18n("Evaluate the expression."));
- QWhatsThis::add(addButton,
+ TQWhatsThis::add(addButton,
i18n("Evaluate the expression and "
"auto-update the value when stepping."));
}
void VariableWidget::slotAddWatchVariable()
{
-// QString watchVar(watchVarEntry_->text());
- QString watchVar(watchVarEditor_->currentText());
+// TQString watchVar(watchVarEntry_->text());
+ TQString watchVar(watchVarEditor_->currentText());
if (!watchVar.isEmpty())
{
slotAddWatchVariable(watchVar);
@@ -154,7 +154,7 @@ void VariableWidget::slotAddWatchVariable()
// **************************************************************************
-void VariableWidget::slotAddWatchVariable(const QString &ident)
+void VariableWidget::slotAddWatchVariable(const TQString &ident)
{
if (!ident.isEmpty())
{
@@ -166,14 +166,14 @@ void VariableWidget::slotAddWatchVariable(const QString &ident)
void VariableWidget::slotEvaluateExpression()
{
- QString exp(watchVarEditor_->currentText());
+ TQString exp(watchVarEditor_->currentText());
if (!exp.isEmpty())
{
slotEvaluateExpression(exp);
}
}
-void VariableWidget::slotEvaluateExpression(const QString &ident)
+void VariableWidget::slotEvaluateExpression(const TQString &ident)
{
if (!ident.isEmpty())
{
@@ -185,7 +185,7 @@ void VariableWidget::slotEvaluateExpression(const QString &ident)
// **************************************************************************
-void VariableWidget::focusInEvent(QFocusEvent */*e*/)
+void VariableWidget::focusInEvent(TQFocusEvent */*e*/)
{
varTree_->setFocus();
}
@@ -202,7 +202,7 @@ VariableTree::VariableTree(VariableWidget *parent,
GDBBreakpointWidget* breakpointWidget,
const char *name)
: KListView(parent, name),
- QToolTip( viewport() ),
+ TQToolTip( viewport() ),
controller_(controller),
breakpointWidget_(breakpointWidget),
activeFlag_(0),
@@ -213,7 +213,7 @@ VariableTree::VariableTree(VariableWidget *parent,
setRootIsDecorated(true);
setAllColumnsShowFocus(true);
setSorting(-1);
- QListView::setSelectionMode(QListView::Single);
+ TQListView::setSelectionMode(TQListView::Single);
// Note: it might be reasonable to set width of value
// column to 10 characters ('0x12345678'), and rely on
@@ -223,10 +223,10 @@ VariableTree::VariableTree(VariableWidget *parent,
addColumn(i18n("Value"));
// setResizeMode(AllColumns);
- connect( this, SIGNAL(contextMenu(KListView*, QListViewItem*, const QPoint&)),
- SLOT(slotContextMenu(KListView*, QListViewItem*)) );
- connect( this, SIGNAL(itemRenamed( QListViewItem*, int, const QString&)),
- this, SLOT(slotItemRenamed( QListViewItem*, int, const QString&)));
+ connect( this, TQT_SIGNAL(contextMenu(KListView*, TQListViewItem*, const TQPoint&)),
+ TQT_SLOT(slotContextMenu(KListView*, TQListViewItem*)) );
+ connect( this, TQT_SIGNAL(itemRenamed( TQListViewItem*, int, const TQString&)),
+ this, TQT_SLOT(slotItemRenamed( TQListViewItem*, int, const TQString&)));
}
// **************************************************************************
@@ -237,7 +237,7 @@ VariableTree::~VariableTree()
// **************************************************************************
-void VariableTree::slotContextMenu(KListView *, QListViewItem *item)
+void VariableTree::slotContextMenu(KListView *, TQListViewItem *item)
{
if (!item)
return;
@@ -293,7 +293,7 @@ void VariableTree::slotContextMenu(KListView *, QListViewItem *item)
}
- QListViewItem* root = findRoot(item);
+ TQListViewItem* root = findRoot(item);
if (root != recentExpressions_)
{
@@ -337,14 +337,14 @@ void VariableTree::slotContextMenu(KListView *, QListViewItem *item)
if (var && var->isAlive() && !controller()->stateIsOn(s_dbgNotStarted))
controller_->addCommand(
new GDBCommand(
- QString("-data-evaluate-expression &%1")
+ TQString("-data-evaluate-expression &%1")
.arg(var->gdbExpression()),
this,
&VariableTree::handleAddressComputed,
true /*handles error*/));
- int res = popup.exec(QCursor::pos());
+ int res = popup.exec(TQCursor::pos());
activePopup_ = 0;
@@ -401,7 +401,7 @@ void VariableTree::slotContextMenu(KListView *, QListViewItem *item)
SmallIcon("reload"), i18n("Reevaluate All"));
if (controller()->stateIsOn(s_dbgNotStarted))
popup.setItemEnabled(idReevaluate, false);
- int res = popup.exec(QCursor::pos());
+ int res = popup.exec(TQCursor::pos());
if (res == idRemove)
{
@@ -410,7 +410,7 @@ void VariableTree::slotContextMenu(KListView *, QListViewItem *item)
}
else if (res == idReevaluate)
{
- for(QListViewItem* child = recentExpressions_->firstChild();
+ for(TQListViewItem* child = recentExpressions_->firstChild();
child; child = child->nextSibling())
{
static_cast<VarItem*>(child)->recreate();
@@ -427,10 +427,10 @@ void VariableTree::slotEvent(GDBController::event_t event)
case GDBController::debugger_exited:
{
// Remove all locals.
- QListViewItem *child = firstChild();
+ TQListViewItem *child = firstChild();
while (child) {
- QListViewItem *nextChild = child->nextSibling();
+ TQListViewItem *nextChild = child->nextSibling();
// don't remove the watch root, or 'recent expressions' root.
if (!(dynamic_cast<WatchRoot*> (child))
@@ -444,7 +444,7 @@ void VariableTree::slotEvent(GDBController::event_t event)
if (recentExpressions_)
{
- for(QListViewItem* child = recentExpressions_->firstChild();
+ for(TQListViewItem* child = recentExpressions_->firstChild();
child; child = child->nextSibling())
{
static_cast<VarItem*>(child)->unhookFromGdb();
@@ -453,7 +453,7 @@ void VariableTree::slotEvent(GDBController::event_t event)
if (WatchRoot* w = findWatch())
{
- for(QListViewItem* child = w->firstChild();
+ for(TQListViewItem* child = w->firstChild();
child; child = child->nextSibling())
{
static_cast<VarItem*>(child)->unhookFromGdb();
@@ -504,7 +504,7 @@ void VariableTree::updateCurrentFrame()
// We'll fetch values separately:
controller_->addCommand(
- new GDBCommand(QString("-stack-list-arguments 0 %1 %2")
+ new GDBCommand(TQString("-stack-list-arguments 0 %1 %2")
.arg(controller_->currentFrame())
.arg(controller_->currentFrame())
.ascii(),
@@ -522,13 +522,13 @@ void VariableTree::updateCurrentFrame()
// **************************************************************************
-void VariableTree::slotAddWatchVariable(const QString &watchVar)
+void VariableTree::slotAddWatchVariable(const TQString &watchVar)
{
VarItem *varItem = 0;
varItem = new VarItem(findWatch(), watchVar);
}
-void VariableTree::slotEvaluateExpression(const QString &expression)
+void VariableTree::slotEvaluateExpression(const TQString &expression)
{
if (recentExpressions_ == 0)
{
@@ -545,7 +545,7 @@ void VariableTree::slotEvaluateExpression(const QString &expression)
// **************************************************************************
-QListViewItem *VariableTree::findRoot(QListViewItem *item) const
+TQListViewItem *VariableTree::findRoot(TQListViewItem *item) const
{
while (item->parent())
item = item->parent();
@@ -557,7 +557,7 @@ QListViewItem *VariableTree::findRoot(QListViewItem *item) const
VarFrameRoot *VariableTree::findFrame(int frameNo, int threadNo) const
{
- QListViewItem *sibling = firstChild();
+ TQListViewItem *sibling = firstChild();
// frames only exist on th top level so we only need to
// check the siblings
@@ -576,7 +576,7 @@ VarFrameRoot *VariableTree::findFrame(int frameNo, int threadNo) const
WatchRoot *VariableTree::findWatch()
{
- QListViewItem *sibling = firstChild();
+ TQListViewItem *sibling = firstChild();
while (sibling) {
if (WatchRoot *watch = dynamic_cast<WatchRoot*> (sibling))
@@ -590,11 +590,11 @@ WatchRoot *VariableTree::findWatch()
// **************************************************************************
-QListViewItem *VariableTree::lastChild() const
+TQListViewItem *VariableTree::lastChild() const
{
- QListViewItem *child = firstChild();
+ TQListViewItem *child = firstChild();
if (child)
- while (QListViewItem *nextChild = child->nextSibling())
+ while (TQListViewItem *nextChild = child->nextSibling())
child = nextChild;
return child;
@@ -602,21 +602,21 @@ QListViewItem *VariableTree::lastChild() const
// **************************************************************************
-void VariableTree::maybeTip(const QPoint &p)
+void VariableTree::maybeTip(const TQPoint &p)
{
VarItem * item = dynamic_cast<VarItem*>( itemAt( p ) );
if ( item )
{
- QRect r = itemRect( item );
+ TQRect r = itemRect( item );
if ( r.isValid() )
tip( r, item->tipText() );
}
}
-class ValueSpecialRepresentationCommand : public QObject, public CliCommand
+class ValueSpecialRepresentationCommand : public TQObject, public CliCommand
{
public:
- ValueSpecialRepresentationCommand(VarItem* item, const QString& command)
+ ValueSpecialRepresentationCommand(VarItem* item, const TQString& command)
: CliCommand(command.ascii(),
this,
&ValueSpecialRepresentationCommand::handleReply,
@@ -628,9 +628,9 @@ private:
VarItem* item_;
- void handleReply(const QValueVector<QString>& lines)
+ void handleReply(const TQValueVector<TQString>& lines)
{
- QString s;
+ TQString s;
for(unsigned i = 1; i < lines.count(); ++i)
s += lines[i];
item_->updateSpecialRepresentation(s.local8Bit());
@@ -638,7 +638,7 @@ private:
};
void VariableTree::slotVarobjNameChanged(
- const QString& from, const QString& to)
+ const TQString& from, const TQString& to)
{
if (!from.isEmpty())
varobj2varitem.erase(from);
@@ -686,7 +686,7 @@ void VariableTree::localsReady(const GDBMI::ResultRecord& r)
for(unsigned i = 0; i < locals.size(); ++i)
{
- QString val = locals[i].literal();
+ TQString val = locals[i].literal();
// Check ada internal variables like <R45b>, <L23R> ...
bool is_ada_variable = (val[0] == '<' && val[val.length() - 1] == '>');
@@ -702,19 +702,19 @@ void VariableTree::localsReady(const GDBMI::ResultRecord& r)
&VariableTree::frameIdReady));
}
-void VariableTree::frameIdReady(const QValueVector<QString>& lines)
+void VariableTree::frameIdReady(const TQValueVector<TQString>& lines)
{
//kdDebug(9012) << "localAddresses: " << lines[1] << "\n";
- QString frame_info;
+ TQString frame_info;
for(unsigned i = 1; i < lines.size(); ++i)
frame_info += lines[i];
kdDebug(9012) << "frame info: " << frame_info << "\n";
frame_info.replace('\n', "");
- static QRegExp frame_base_rx("frame at 0x([0-9a-fA-F]*)");
- static QRegExp frame_code_rx("saved [a-zA-Z0-9]* 0x([0-9a-fA-F]*)");
+ static TQRegExp frame_base_rx("frame at 0x([0-9a-fA-F]*)");
+ static TQRegExp frame_code_rx("saved [a-zA-Z0-9]* 0x([0-9a-fA-F]*)");
int i = frame_base_rx.search(frame_info);
int i2 = frame_code_rx.search(frame_info);
@@ -741,12 +741,12 @@ void VariableTree::frameIdReady(const QValueVector<QString>& lines)
frame_base_rx.cap(1).toULongLong(0, 16);
unsigned long long new_code_address =
frame_code_rx.cap(1).toULongLong(0, 16);
- kdDebug(9012) << "Frame base = " << QString::number(new_frame_base, 16)
- << " code = " << QString::number(new_code_address, 16)
+ kdDebug(9012) << "Frame base = " << TQString::number(new_frame_base, 16)
+ << " code = " << TQString::number(new_code_address, 16)
<< "\n";
kdDebug(9012) << "Previous frame " <<
- QString::number(frame->currentFrameBase, 16)
- << " code = " << QString::number(
+ TQString::number(frame->currentFrameBase, 16)
+ << " code = " << TQString::number(
frame->currentFrameCodeAddress, 16)
<< "\n";
@@ -770,8 +770,8 @@ void VariableTree::frameIdReady(const QValueVector<QString>& lines)
{
// Remove all variables.
// FIXME: probably, need to do this in all frames.
- QListViewItem* child = frame->firstChild();
- QListViewItem* next;
+ TQListViewItem* child = frame->firstChild();
+ TQListViewItem* next;
for(; child; child = next)
{
next = child->nextSibling();
@@ -781,15 +781,15 @@ void VariableTree::frameIdReady(const QValueVector<QString>& lines)
setUpdatesEnabled(false);
- std::set<QListViewItem*> alive;
+ std::set<TQListViewItem*> alive;
for(unsigned i = 0; i < locals_and_arguments.size(); ++i)
{
- QString name = locals_and_arguments[i];
+ TQString name = locals_and_arguments[i];
// See if we've got VarItem for this one already.
VarItem* var = 0;
- for(QListViewItem *child = frame->firstChild();
+ for(TQListViewItem *child = frame->firstChild();
child;
child = child->nextSibling())
{
@@ -811,9 +811,9 @@ void VariableTree::frameIdReady(const QValueVector<QString>& lines)
// Remove VarItems that don't correspond to any local
// variables any longer. Perform type/address updates
// for others.
- for(QListViewItem* child = frame->firstChild(); child;)
+ for(TQListViewItem* child = frame->firstChild(); child;)
{
- QListViewItem* current = child;
+ TQListViewItem* current = child;
child = current->nextSibling();
if (!alive.count(current))
delete current;
@@ -821,7 +821,7 @@ void VariableTree::frameIdReady(const QValueVector<QString>& lines)
static_cast<VarItem*>(current)->recreateLocallyMaybe();
}
- for(QListViewItem* child = findWatch()->firstChild();
+ for(TQListViewItem* child = findWatch()->firstChild();
child; child = child->nextSibling())
{
VarItem* var = static_cast<VarItem*>(child);
@@ -848,20 +848,20 @@ void VariableTree::handleVarUpdate(const GDBMI::ResultRecord& r)
{
const GDBMI::Value& changed = r["changelist"];
- std::set<QString> names_to_update;
+ std::set<TQString> names_to_update;
for(unsigned i = 0; i < changed.size(); ++i)
{
const GDBMI::Value& c = changed[i];
- QString name = c["name"].literal();
+ TQString name = c["name"].literal();
if (c.hasField("in_scope") && c["in_scope"].literal() == "false")
continue;
names_to_update.insert(name);
}
- QMap<QString, VarItem*>::iterator i, e;
+ TQMap<TQString, VarItem*>::iterator i, e;
for (i = varobj2varitem.begin(), e = varobj2varitem.end(); i != e; ++i)
{
if (names_to_update.count(i.key())
@@ -872,16 +872,16 @@ void VariableTree::handleVarUpdate(const GDBMI::ResultRecord& r)
}
}
-void VarItem::handleCliPrint(const QValueVector<QString>& lines)
+void VarItem::handleCliPrint(const TQValueVector<TQString>& lines)
{
- static QRegExp r("(\\$[0-9]+)");
+ static TQRegExp r("(\\$[0-9]+)");
if (lines.size() >= 2)
{
int i = r.search(lines[1]);
if (i == 0)
{
controller_->addCommand(
- new GDBCommand(QString("-var-create %1 * \"%2\"")
+ new GDBCommand(TQString("-var-create %1 * \"%2\"")
.arg(varobjName_)
.arg(r.cap(1)),
this,
@@ -907,7 +907,7 @@ void VarItem::handleCliPrint(const QValueVector<QString>& lines)
void VariableTree::variablesFetchDone()
{
// During parsing of fetched variable values, we might have issued
- // extra command to handle 'special values', like QString.
+ // extra command to handle 'special values', like TQString.
// We don't want to enable updates just yet, because this will cause
// flicker, so add a sentinel command just to enable updates.
//
@@ -941,7 +941,7 @@ void VariableTree::fetchSpecialValuesDone()
}
void
-VariableTree::slotItemRenamed(QListViewItem* item, int col, const QString& text)
+VariableTree::slotItemRenamed(TQListViewItem* item, int col, const TQString& text)
{
if (col == ValueCol)
{
@@ -955,11 +955,11 @@ VariableTree::slotItemRenamed(QListViewItem* item, int col, const QString& text)
}
-void VariableTree::keyPressEvent(QKeyEvent* e)
+void VariableTree::keyPressEvent(TQKeyEvent* e)
{
if (VarItem* item = dynamic_cast<VarItem*>(currentItem()))
{
- QString text = e->text();
+ TQString text = e->text();
if (text == "n" || text == "x" || text == "d" || text == "c"
|| text == "t")
@@ -970,7 +970,7 @@ void VariableTree::keyPressEvent(QKeyEvent* e)
if (e->key() == Qt::Key_Delete)
{
- QListViewItem* root = findRoot(item);
+ TQListViewItem* root = findRoot(item);
if (dynamic_cast<WatchRoot*>(root) || root == recentExpressions_)
{
@@ -986,10 +986,10 @@ void VariableTree::keyPressEvent(QKeyEvent* e)
}
-void VariableTree::copyToClipboard(QListViewItem* item)
+void VariableTree::copyToClipboard(TQListViewItem* item)
{
QClipboard *qb = KApplication::clipboard();
- QString text = item->text( 1 );
+ TQString text = item->text( 1 );
qb->setText( text, QClipboard::Clipboard );
}
@@ -1038,7 +1038,7 @@ TrimmableItem::~TrimmableItem()
// **************************************************************************
-void TrimmableItem::paintCell(QPainter *p, const QColorGroup &cg,
+void TrimmableItem::paintCell(TQPainter *p, const TQColorGroup &cg,
int column, int width, int align)
{
if ( !p )
@@ -1046,18 +1046,18 @@ void TrimmableItem::paintCell(QPainter *p, const QColorGroup &cg,
// make toplevel item (watch and frame items) names bold
if (column == 0 && !parent())
{
- QFont f = p->font();
+ TQFont f = p->font();
f.setBold(true);
p->setFont(f);
}
- QListViewItem::paintCell( p, cg, column, width, align );
+ TQListViewItem::paintCell( p, cg, column, width, align );
}
-QListViewItem *TrimmableItem::lastChild() const
+TQListViewItem *TrimmableItem::lastChild() const
{
- QListViewItem *child = firstChild();
+ TQListViewItem *child = firstChild();
if (child)
- while (QListViewItem *nextChild = child->nextSibling())
+ while (TQListViewItem *nextChild = child->nextSibling())
child = nextChild;
return child;
@@ -1070,7 +1070,7 @@ QListViewItem *TrimmableItem::lastChild() const
int VarItem::varobjIndex = 0;
VarItem::VarItem(TrimmableItem *parent,
- const QString& expression,
+ const TQString& expression,
bool frozen)
: TrimmableItem (parent),
expression_(expression),
@@ -1085,9 +1085,9 @@ VarItem::VarItem(TrimmableItem *parent,
baseClassMember_(false),
alive_(true)
{
- connect(this, SIGNAL(varobjNameChange(const QString&, const QString&)),
+ connect(this, TQT_SIGNAL(varobjNameChange(const TQString&, const TQString&)),
varTree(),
- SLOT(slotVarobjNameChanged(const QString&, const QString&)));
+ TQT_SLOT(slotVarobjNameChanged(const TQString&, const TQString&)));
// User might have entered format together with expression: like
@@ -1098,7 +1098,7 @@ VarItem::VarItem(TrimmableItem *parent,
// - detect initial value of format_
// - remove the format specifier from the string.
- static QRegExp explicit_format("^\\s*/(.)\\s*(.*)");
+ static TQRegExp explicit_format("^\\s*/(.)\\s*(.*)");
if (explicit_format.search(expression_) == 0)
{
format_ = formatFromGdbModifier(explicit_format.cap(1)[0].latin1());
@@ -1130,9 +1130,9 @@ VarItem::VarItem(TrimmableItem *parent, const GDBMI::Value& varobj,
baseClassMember_(baseClassMember),
alive_(true)
{
- connect(this, SIGNAL(varobjNameChange(const QString&, const QString&)),
+ connect(this, TQT_SIGNAL(varobjNameChange(const TQString&, const TQString&)),
varTree(),
- SLOT(slotVarobjNameChanged(const QString&, const QString&)));
+ TQT_SLOT(slotVarobjNameChanged(const TQString&, const TQString&)));
expression_ = varobj["exp"].literal();
varobjName_ = varobj["name"].literal();
@@ -1158,8 +1158,8 @@ VarItem::VarItem(TrimmableItem *parent, const GDBMI::Value& varobj,
void VarItem::createVarobj()
{
- QString old = varobjName_;
- varobjName_ = QString("KDEV%1").arg(varobjIndex++);
+ TQString old = varobjName_;
+ varobjName_ = TQString("KDEV%1").arg(varobjIndex++);
emit varobjNameChange(old, varobjName_);
if (frozen_)
@@ -1169,7 +1169,7 @@ void VarItem::createVarobj()
// variable and we create variable object from that.
controller_->addCommand(
new CliCommand(
- QString("print %1").arg(expression_),
+ TQString("print %1").arg(expression_),
this,
&VarItem::handleCliPrint));
}
@@ -1177,7 +1177,7 @@ void VarItem::createVarobj()
{
controller_->addCommand(
new CliCommand(
- QString("print /x &%1").arg(expression_),
+ TQString("print /x &%1").arg(expression_),
this,
&VarItem::handleCurrentAddress,
true));
@@ -1185,7 +1185,7 @@ void VarItem::createVarobj()
controller_->addCommand(
// Need to quote expression, otherwise gdb won't like
// spaces inside it.
- new GDBCommand(QString("-var-create %1 * \"%2\"")
+ new GDBCommand(TQString("-var-create %1 * \"%2\"")
.arg(varobjName_)
.arg(expression_),
this,
@@ -1205,15 +1205,15 @@ void VarItem::varobjCreated(const GDBMI::ResultRecord& r)
}
setAliveRecursively(true);
- QString oldType = originalValueType_;
+ TQString oldType = originalValueType_;
originalValueType_ = r["type"].literal();
if (!oldType.isEmpty() && oldType != originalValueType_)
{
// Type changed, the children might be no longer valid,
// so delete them.
- for(QListViewItem* child = firstChild(); child; )
+ for(TQListViewItem* child = firstChild(); child; )
{
- QListViewItem* cur = child;
+ TQListViewItem* cur = child;
child = child->nextSibling();
delete cur;
}
@@ -1228,7 +1228,7 @@ void VarItem::varobjCreated(const GDBMI::ResultRecord& r)
setVarobjName(varobjName_);
}
-void VarItem::setVarobjName(const QString& name)
+void VarItem::setVarobjName(const TQString& name)
{
if (varobjName_ != name)
emit varobjNameChange(varobjName_, name);
@@ -1238,7 +1238,7 @@ void VarItem::setVarobjName(const QString& name)
if (format_ != natural)
{
controller_->addCommand(
- new GDBCommand(QString("-var-set-format \"%1\" %2")
+ new GDBCommand(TQString("-var-set-format \"%1\" %2")
.arg(varobjName_).arg(varobjFormatName())));
}
@@ -1256,12 +1256,12 @@ void VarItem::valueDone(const GDBMI::ResultRecord& r)
{
if (r.reason == "done")
{
- QString s = GDBParser::getGDBParser()->undecorateValue(
+ TQString s = GDBParser::getGDBParser()->undecorateValue(
r["value"].literal());
if (format_ == character)
{
- QString encoded = s;
+ TQString encoded = s;
bool ok;
int value = s.toInt(&ok);
if (ok)
@@ -1292,11 +1292,11 @@ void VarItem::valueDone(const GDBMI::ResultRecord& r)
if (format_ == binary)
{
// For binary format, split the value at 4-bit boundaries
- static QRegExp r("^[01]+$");
+ static TQRegExp r("^[01]+$");
int i = r.search(s);
if (i == 0)
{
- QString split;
+ TQString split;
for(unsigned i = 0; i < s.length(); ++i)
{
// For string 11111, we should split it as
@@ -1317,7 +1317,7 @@ void VarItem::valueDone(const GDBMI::ResultRecord& r)
}
else
{
- QString s = r["msg"].literal();
+ TQString s = r["msg"].literal();
// Error response.
if (s.startsWith("Cannot access memory"))
{
@@ -1344,7 +1344,7 @@ void VarItem::createChildren(const GDBMI::ResultRecord& r,
bool structureType = false;
if (!children_of_fake && children.size() > 0)
{
- QString exp = children[0]["exp"].literal();
+ TQString exp = children[0]["exp"].literal();
bool ok = false;
exp.toInt(&ok);
if (!ok || exp[0] != '*')
@@ -1355,12 +1355,12 @@ void VarItem::createChildren(const GDBMI::ResultRecord& r,
for (unsigned i = 0; i < children.size(); ++i)
{
- QString exp = children[i]["exp"].literal();
+ TQString exp = children[i]["exp"].literal();
// For artificial accessibility nodes,
// fetch their children.
if (exp == "public" || exp == "protected" || exp == "private")
{
- QString name = children[i]["name"].literal();
+ TQString name = children[i]["name"].literal();
controller_->addCommand(new GDBCommand(
"-var-list-children \"" +
name + "\"",
@@ -1374,7 +1374,7 @@ void VarItem::createChildren(const GDBMI::ResultRecord& r,
bool baseObject = structureType;
VarItem* existing = 0;
- for(QListViewItem* child = firstChild();
+ for(TQListViewItem* child = firstChild();
child; child = child->nextSibling())
{
VarItem* v = static_cast<VarItem*>(child);
@@ -1414,12 +1414,12 @@ void VarItem::childrenOfFakesDone(const GDBMI::ResultRecord& r)
createChildren(r, true);
}
-void VarItem::handleCurrentAddress(const QValueVector<QString>& lines)
+void VarItem::handleCurrentAddress(const TQValueVector<TQString>& lines)
{
lastObtainedAddress_ = "";
if (lines.count() > 1)
{
- static QRegExp r("\\$\\d+ = ([^\n]*)");
+ static TQRegExp r("\\$\\d+ = ([^\n]*)");
int i = r.search(lines[1]);
if (i == 0)
{
@@ -1429,7 +1429,7 @@ void VarItem::handleCurrentAddress(const QValueVector<QString>& lines)
}
}
-void VarItem::handleType(const QValueVector<QString>& lines)
+void VarItem::handleType(const TQValueVector<TQString>& lines)
{
bool recreate = false;
@@ -1444,7 +1444,7 @@ void VarItem::handleType(const QValueVector<QString>& lines)
// FIXME: add error diagnostic.
if (lines.count() > 1)
{
- static QRegExp r("type = ([^\n]*)");
+ static TQRegExp r("type = ([^\n]*)");
int i = r.search(lines[1]);
if (i == 0)
{
@@ -1464,7 +1464,7 @@ void VarItem::handleType(const QValueVector<QString>& lines)
}
}
-QString VarItem::displayName() const
+TQString VarItem::displayName() const
{
if (expression_[0] != '*')
return expression_;
@@ -1485,7 +1485,7 @@ void VarItem::setAliveRecursively(bool enable)
setEnabled(enable);
alive_ = true;
- for(QListViewItem* child = firstChild();
+ for(TQListViewItem* child = firstChild();
child; child = child->nextSibling())
{
static_cast<VarItem*>(child)->setAliveRecursively(enable);
@@ -1498,7 +1498,7 @@ VarItem::~VarItem()
unhookFromGdb();
}
-QString VarItem::gdbExpression() const
+TQString VarItem::gdbExpression() const
{
// The expression for this item can be either:
// - number, for array element
@@ -1550,26 +1550,26 @@ QString VarItem::gdbExpression() const
// FIXME: we have two method to set VarItem: this one
// and updateValue below. That's bad, must have just one.
-void VarItem::setText(int column, const QString &data)
+void VarItem::setText(int column, const TQString &data)
{
- QString strData=data;
+ TQString strData=data;
if (column == ValueCol) {
- QString oldValue(text(column));
+ TQString oldValue(text(column));
if (!oldValue.isEmpty()) // Don't highlight new items
{
- highlight_ = (oldValue != QString(data));
+ highlight_ = (oldValue != TQString(data));
}
}
- QListViewItem::setText(column, strData);
+ TQListViewItem::setText(column, strData);
}
void VarItem::clearHighlight()
{
highlight_ = false;
- for(QListViewItem* child = firstChild();
+ for(TQListViewItem* child = firstChild();
child; child = child->nextSibling())
{
static_cast<VarItem*>(child)->clearHighlight();
@@ -1600,10 +1600,10 @@ void VarItem::updateValue()
true /* handle error */));
}
-void VarItem::setValue(const QString& new_value)
+void VarItem::setValue(const TQString& new_value)
{
controller_->addCommand(
- new GDBCommand(QString("-var-assign \"%1\" %2").arg(varobjName_)
+ new GDBCommand(TQString("-var-assign \"%1\" %2").arg(varobjName_)
.arg(new_value)));
// And immediately reload it from gdb,
@@ -1614,9 +1614,9 @@ void VarItem::setValue(const QString& new_value)
updateValue();
}
-void VarItem::updateSpecialRepresentation(const QString& xs)
+void VarItem::updateSpecialRepresentation(const TQString& xs)
{
- QString s(xs);
+ TQString s(xs);
if (s[0] == '$')
{
int i = s.find('=');
@@ -1624,7 +1624,7 @@ void VarItem::updateSpecialRepresentation(const QString& xs)
s = s.mid(i+2);
}
- // A hack to nicely display QStrings. The content of QString is unicode
+ // A hack to nicely display QStrings. The content of TQString is unicode
// for for ASCII only strings we get ascii character mixed with \000.
// Remove those \000 now.
@@ -1634,11 +1634,11 @@ void VarItem::updateSpecialRepresentation(const QString& xs)
// the data sent by gdb might contain \000 that should not be translated.
//
// What's even worse, ideally we should convert the string data from
- // gdb into a QString again, handling all other escapes and composing
- // one QChar from two characters from gdb. But to do that, we *should*
+ // gdb into a TQString again, handling all other escapes and composing
+ // one TQChar from two characters from gdb. But to do that, we *should*
// now if the data if generic gdb value, and result of request for string
// data. Fixing is is for later.
- s.replace( QRegExp("\\\\000|\\\\0"), "" );
+ s.replace( TQRegExp("\\\\000|\\\\0"), "" );
// FIXME: for now, assume that all special representations are
// just strings.
@@ -1661,14 +1661,14 @@ void VarItem::recreateLocallyMaybe()
{
controller_->addCommand(
new CliCommand(
- QString("print /x &%1").arg(expression_),
+ TQString("print /x &%1").arg(expression_),
this,
&VarItem::handleCurrentAddress,
true));
controller_->addCommand(
new CliCommand(
- QString("whatis %1").arg(expression_),
+ TQString("whatis %1").arg(expression_),
this,
&VarItem::handleType));
}
@@ -1686,7 +1686,7 @@ void VarItem::recreate()
void VarItem::setOpen(bool open)
{
- QListViewItem::setOpen(open);
+ TQListViewItem::setOpen(open);
if (open && !childrenFetched_)
{
@@ -1703,7 +1703,7 @@ bool VarItem::handleSpecialTypes()
if (originalValueType_.isEmpty())
return false;
- static QRegExp qstring("^(const)?[ ]*QString[ ]*&?$");
+ static TQRegExp qstring("^(const)?[ ]*QString[ ]*&?$");
if (qstring.exactMatch(originalValueType_)) {
@@ -1711,22 +1711,22 @@ bool VarItem::handleSpecialTypes()
if( !varTree->controller() )
return false;
varTree->controller()->addCommand(
- new ResultlessCommand(QString("print $kdev_d=%1.d")
+ new ResultlessCommand(TQString("print $kdev_d=%1.d")
.arg(gdbExpression()),
true /* ignore error */));
if (varTree->controller()->qtVersion() >= 4)
varTree->controller()->addCommand(
- new ResultlessCommand(QString("print $kdev_s=$kdev_d.size"),
+ new ResultlessCommand(TQString("print $kdev_s=$kdev_d.size"),
true));
else
varTree->controller()->addCommand(
- new ResultlessCommand(QString("print $kdev_s=$kdev_d.len"),
+ new ResultlessCommand(TQString("print $kdev_s=$kdev_d.len"),
true));
varTree->controller()->addCommand(
new ResultlessCommand(
- QString("print $kdev_s= ($kdev_s > 0)? ($kdev_s > 100 ? 200 : 2*$kdev_s) : 0"),
+ TQString("print $kdev_s= ($kdev_s > 0)? ($kdev_s > 100 ? 200 : 2*$kdev_s) : 0"),
true));
if (varTree->controller()->qtVersion() >= 4)
@@ -1765,7 +1765,7 @@ void VarItem::setFormat(format_t f)
// - for arrays, that's clearly right
// - for pointers, this can be confusing, but nobody ever wants to
// see the pointer in decimal!
- for(QListViewItem* child = firstChild();
+ for(TQListViewItem* child = firstChild();
child; child = child->nextSibling())
{
static_cast<VarItem*>(child)->setFormat(f);
@@ -1774,7 +1774,7 @@ void VarItem::setFormat(format_t f)
else
{
controller_->addCommand(
- new GDBCommand(QString("-var-set-format \"%1\" %2")
+ new GDBCommand(TQString("-var-set-format \"%1\" %2")
.arg(varobjName_).arg(varobjFormatName())));
updateValue();
@@ -1802,7 +1802,7 @@ VarItem::format_t VarItem::formatFromGdbModifier(char c) const
return nf;
}
-QString VarItem::varobjFormatName() const
+TQString VarItem::varobjFormatName() const
{
switch(format_)
{
@@ -1836,7 +1836,7 @@ QString VarItem::varobjFormatName() const
// **************************************************************************
// Overridden to highlight the changed items
-void VarItem::paintCell(QPainter *p, const QColorGroup &cg,
+void VarItem::paintCell(TQPainter *p, const TQColorGroup &cg,
int column, int width, int align)
{
if ( !p )
@@ -1853,18 +1853,18 @@ void VarItem::paintCell(QPainter *p, const QColorGroup &cg,
if (!alive_)
{
/* Draw this as disabled. */
- QListViewItem::paintCell(p, varTree()->QWidget::palette().disabled(),
+ TQListViewItem::paintCell(p, varTree()->TQWidget::palette().disabled(),
column, width, align);
}
else
{
if (column == ValueCol && highlight_)
{
- QColorGroup hl_cg( cg.foreground(), cg.background(), cg.light(),
+ TQColorGroup hl_cg( cg.foreground(), cg.background(), cg.light(),
cg.dark(), cg.mid(), red, cg.base());
- QListViewItem::paintCell( p, hl_cg, column, width, align );
+ TQListViewItem::paintCell( p, hl_cg, column, width, align );
} else
- QListViewItem::paintCell( p, cg, column, width, align );
+ TQListViewItem::paintCell( p, cg, column, width, align );
}
}
@@ -1879,7 +1879,7 @@ void VarItem::unhookFromGdb()
// Unhook children first, so that child varitems are deleted
// before parent. Strictly speaking, we can avoid calling
// -var-delete on child varitems, but that's a bit cheesy,
- for(QListViewItem* child = firstChild();
+ for(TQListViewItem* child = firstChild();
child; child = child->nextSibling())
{
static_cast<VarItem*>(child)->unhookFromGdb();
@@ -1894,7 +1894,7 @@ void VarItem::unhookFromGdb()
{
controller_->addCommand(
new GDBCommand(
- QString("-var-delete \"%1\"").arg(varobjName_)));
+ TQString("-var-delete \"%1\"").arg(varobjName_)));
}
varobjName_ = "";
@@ -1902,10 +1902,10 @@ void VarItem::unhookFromGdb()
// **************************************************************************
-QString VarItem::tipText() const
+TQString VarItem::tipText() const
{
const unsigned int maxTooltipSize = 70;
- QString tip = text( ValueCol );
+ TQString tip = text( ValueCol );
if (tip.length() > maxTooltipSize)
tip = tip.mid(0, maxTooltipSize - 1 ) + " [...]";
@@ -1951,7 +1951,7 @@ VarFrameRoot::~VarFrameRoot()
void VarFrameRoot::setOpen(bool open)
{
bool frameOpened = ( isOpen()==false && open==true );
- QListViewItem::setOpen(open);
+ TQListViewItem::setOpen(open);
if (frameOpened && needLocals_)
{