summaryrefslogtreecommitdiffstats
path: root/kdbg/exprwnd.cpp
diff options
context:
space:
mode:
authorSlávek Banko <slavek.banko@axis.cz>2013-07-03 02:22:47 +0200
committerSlávek Banko <slavek.banko@axis.cz>2013-07-03 02:22:47 +0200
commit9dab0e253ecf583a2cc6ca22e068d4f4022ca4d3 (patch)
tree63c2afb5cbab9420e0d43683e09ddb0092663d49 /kdbg/exprwnd.cpp
parent1ace27a9852850ad348dd28679c2fe2b7d2ddc73 (diff)
downloadkdbg-9dab0e253ecf583a2cc6ca22e068d4f4022ca4d3.tar.gz
kdbg-9dab0e253ecf583a2cc6ca22e068d4f4022ca4d3.zip
Initial TQt conversion
Diffstat (limited to 'kdbg/exprwnd.cpp')
-rw-r--r--kdbg/exprwnd.cpp118
1 files changed, 59 insertions, 59 deletions
diff --git a/kdbg/exprwnd.cpp b/kdbg/exprwnd.cpp
index fc0fc8b..49cb11f 100644
--- a/kdbg/exprwnd.cpp
+++ b/kdbg/exprwnd.cpp
@@ -7,9 +7,9 @@
#include "exprwnd.h"
#include "exprwnd.moc"
#include "typetable.h"
-#include <qstringlist.h>
-#include <qpainter.h>
-#include <qscrollbar.h>
+#include <ntqstringlist.h>
+#include <ntqpainter.h>
+#include <ntqscrollbar.h>
#include <kapplication.h>
#include <kiconloader.h> /* icons */
#include <klocale.h> /* i18n */
@@ -18,8 +18,8 @@
#endif
#include "mydebug.h"
-VarTree::VarTree(VarTree* parent, QListViewItem* after, ExprValue* v) :
- QListViewItem(parent, after),
+VarTree::VarTree(VarTree* parent, TQListViewItem* after, ExprValue* v) :
+ TQListViewItem(parent, after),
m_varKind(v->m_varKind),
m_nameKind(v->m_nameKind),
m_type(0),
@@ -29,14 +29,14 @@ VarTree::VarTree(VarTree* parent, QListViewItem* after, ExprValue* v) :
m_baseChanged(false),
m_structChanged(false)
{
- QListViewItem::setText(0, v->m_name);
+ TQListViewItem::setText(0, v->m_name);
updateValueText();
setExpandable(m_varKind == VarTree::VKpointer);
setOpen(v->m_initiallyExpanded);
}
-VarTree::VarTree(ExprWnd* parent, QListViewItem* after, const QString& name) :
- QListViewItem(parent, after),
+VarTree::VarTree(ExprWnd* parent, TQListViewItem* after, const TQString& name) :
+ TQListViewItem(parent, after),
m_varKind(VKsimple),
m_nameKind(VarTree::NKplain),
m_type(0),
@@ -45,25 +45,25 @@ VarTree::VarTree(ExprWnd* parent, QListViewItem* after, const QString& name) :
m_baseChanged(false),
m_structChanged(false)
{
- QListViewItem::setText(0, name);
+ TQListViewItem::setText(0, name);
}
VarTree::~VarTree()
{
}
-void VarTree::paintCell(QPainter* p, const QColorGroup& cg, int column, int width, int align)
+void VarTree::paintCell(TQPainter* p, const TQColorGroup& cg, int column, int width, int align)
{
if (column == 1 && (m_baseChanged || m_structChanged)) {
- QColorGroup cgChg = cg;
- cgChg.setColor(QColorGroup::Text, Qt::red);
- QListViewItem::paintCell(p, cgChg, column, width, align);
+ TQColorGroup cgChg = cg;
+ cgChg.setColor(TQColorGroup::Text, TQt::red);
+ TQListViewItem::paintCell(p, cgChg, column, width, align);
} else {
- QListViewItem::paintCell(p, cg, column, width, align);
+ TQListViewItem::paintCell(p, cg, column, width, align);
}
}
-QString VarTree::computeExpr() const
+TQString VarTree::computeExpr() const
{
// top-level items are special
if (isToplevelExpr())
@@ -71,14 +71,14 @@ QString VarTree::computeExpr() const
// get parent expr
VarTree* par = static_cast<VarTree*>(parent());
- QString parentExpr = par->computeExpr();
+ TQString parentExpr = par->computeExpr();
// skip this item's name if it is a base class or anonymous struct or union
if (m_nameKind == NKtype || m_nameKind == NKanonymous) {
return parentExpr;
}
/* augment by this item's text */
- QString result;
+ TQString result;
/* if this is an address, dereference it */
if (m_nameKind == NKaddress) {
ASSERT(par->m_varKind == VKpointer);
@@ -88,7 +88,7 @@ QString VarTree::computeExpr() const
switch (par->m_varKind) {
case VKarray:
{
- QString index = getText();
+ TQString index = getText();
int i = 1;
// skip past the index
while (index[i].isDigit())
@@ -124,14 +124,14 @@ bool VarTree::isToplevelExpr() const
bool VarTree::isAncestorEq(const VarTree* child) const
{
- const QListViewItem* c = child;
+ const TQListViewItem* c = child;
while (c != 0 && c != this) {
c = c->parent();
}
return c != 0;
}
-bool VarTree::updateValue(const QString& newValue)
+bool VarTree::updateValue(const TQString& newValue)
{
// check whether the value changed
bool prevValueChanged = m_baseChanged;
@@ -148,7 +148,7 @@ bool VarTree::updateValue(const QString& newValue)
return m_baseChanged || prevValueChanged;
}
-bool VarTree::updateStructValue(const QString& newValue)
+bool VarTree::updateStructValue(const TQString& newValue)
{
// check whether the value changed
bool prevValueChanged = m_structChanged;
@@ -168,11 +168,11 @@ bool VarTree::updateStructValue(const QString& newValue)
void VarTree::updateValueText()
{
if (m_baseValue.isEmpty()) {
- QListViewItem::setText(1, m_structValue);
+ TQListViewItem::setText(1, m_structValue);
} else if (m_structValue.isEmpty()) {
- QListViewItem::setText(1, m_baseValue);
+ TQListViewItem::setText(1, m_baseValue);
} else {
- QListViewItem::setText(1, m_baseValue + " " + m_structValue);
+ TQListViewItem::setText(1, m_baseValue + " " + m_structValue);
}
}
@@ -197,7 +197,7 @@ void VarTree::inferTypesOfChildren(ProgramTypeTable& typeTable)
{
/*
* wchart_t pointers must be treated as struct, because the array
- * of characters is printed similar to how QStrings are decoded.
+ * of characters is printed similar to how TQStrings are decoded.
*/
m_varKind = VKstruct;
setExpandable(false);
@@ -206,7 +206,7 @@ void VarTree::inferTypesOfChildren(ProgramTypeTable& typeTable)
} else if (m_varKind == VKstruct) {
// check if this is a base class part
if (m_nameKind == NKtype) {
- const QString& typeName =
+ const TQString& typeName =
getText().mid(1, getText().length()-2); // strip < and >
m_type = typeTable.lookup(typeName);
@@ -263,7 +263,7 @@ TypeInfo* VarTree::inferTypeFromBaseClass()
return 0;
}
-ExprValue::ExprValue(const QString& name, VarTree::NameKind aKind) :
+ExprValue::ExprValue(const TQString& name, VarTree::NameKind aKind) :
m_name(name),
m_varKind(VarTree::VKsimple),
m_nameKind(aKind),
@@ -306,8 +306,8 @@ int ExprValue::childCount() const
-ExprWnd::ExprWnd(QWidget* parent, const QString& colHeader, const char* name) :
- QListView(parent, name),
+ExprWnd::ExprWnd(TQWidget* parent, const TQString& colHeader, const char* name) :
+ TQListView(parent, name),
m_edit(0)
{
addColumn(colHeader);
@@ -327,9 +327,9 @@ ExprWnd::~ExprWnd()
{
}
-QStringList ExprWnd::exprList() const
+TQStringList ExprWnd::exprList() const
{
- QStringList exprs;
+ TQStringList exprs;
VarTree* item;
for (item = firstChild(); item != 0; item = item->nextSibling()) {
exprs.append(item->getText());
@@ -542,7 +542,7 @@ void ExprWnd::replaceChildren(VarTree* display, ExprValue* newValues)
void ExprWnd::collectUnknownTypes(VarTree* var)
{
- QListViewItemIterator i(var);
+ TQListViewItemIterator i(var);
for (; i.current(); ++i)
{
checkUnknownType(static_cast<VarTree*>(i.current()));
@@ -575,7 +575,7 @@ void ExprWnd::checkUnknownType(VarTree* var)
}
}
-QString ExprWnd::formatWCharPointer(QString value)
+TQString ExprWnd::formatWCharPointer(TQString value)
{
int pos = value.find(") ");
if (pos > 0)
@@ -584,7 +584,7 @@ QString ExprWnd::formatWCharPointer(QString value)
}
-VarTree* ExprWnd::topLevelExprByName(const QString& name) const
+VarTree* ExprWnd::topLevelExprByName(const TQString& name) const
{
VarTree* item = firstChild();
while (item != 0 && item->getText() != name)
@@ -593,7 +593,7 @@ VarTree* ExprWnd::topLevelExprByName(const QString& name) const
return item;
}
-VarTree* ExprWnd::ptrMemberByName(VarTree* v, const QString& name)
+VarTree* ExprWnd::ptrMemberByName(VarTree* v, const TQString& name)
{
// v must be a pointer variable, must have children
if (v->m_varKind != VarTree::VKpointer || v->childCount() == 0)
@@ -604,7 +604,7 @@ VarTree* ExprWnd::ptrMemberByName(VarTree* v, const QString& name)
return memberByName(item, name);
}
-VarTree* ExprWnd::memberByName(VarTree* v, const QString& name)
+VarTree* ExprWnd::memberByName(VarTree* v, const TQString& name)
{
// search immediate children for name
VarTree* item = v->firstChild();
@@ -700,17 +700,17 @@ VarTree* ExprWnd::nextUpdateStruct()
}
-void ExprWnd::editValue(VarTree* item, const QString& text)
+void ExprWnd::editValue(VarTree* item, const TQString& text)
{
if (m_edit == 0)
m_edit = new ValueEdit(this);
- QRect r = itemRect(item);
+ TQRect r = itemRect(item);
int x = r.x()+columnWidth(0);
int y = r.y();
int w = columnWidth(1);
int h = r.height();
- QListView* lv = item->listView();
+ TQListView* lv = item->listView();
/*
* Make the edit widget at least 5 characters wide (but not wider than
@@ -718,7 +718,7 @@ void ExprWnd::editValue(VarTree* item, const QString& text)
* the text, scroll this widget so that half of it shows the text (or
* less than half of it if the text is shorter).
*/
- QFontMetrics metr = m_edit->font();
+ TQFontMetrics metr = m_edit->font();
int wMin = metr.width("88888");
if (w < wMin)
w = wMin;
@@ -727,7 +727,7 @@ void ExprWnd::editValue(VarTree* item, const QString& text)
x+w > wThis) // not all text is visible
{
// scroll so that more text is visible
- int wScroll = QMIN(x-wThis/2, x+w-wThis);
+ int wScroll = TQMIN(x-wThis/2, x+w-wThis);
lv->scrollBy(wScroll, 0);
x -= wScroll;
}
@@ -738,7 +738,7 @@ void ExprWnd::editValue(VarTree* item, const QString& text)
}
// make the edit box as wide as the visible column
- QRect rect(x,y, wThis-x,h);
+ TQRect rect(x,y, wThis-x,h);
m_edit->setText(text);
m_edit->selectAll();
@@ -756,17 +756,17 @@ bool ExprWnd::isEditing() const
ValueEdit::ValueEdit(ExprWnd* parent) :
- QLineEdit(parent->viewport(), "valueedit")
+ TQLineEdit(parent->viewport(), "valueedit")
{
setFrame(false);
hide();
lower(); // lower the window below scrollbars
connect(parent, SIGNAL(selectionChanged()), SLOT(slotSelectionChanged()));
- connect(parent, SIGNAL(currentChanged(QListViewItem*)), SLOT(slotSelectionChanged()));
- connect(parent, SIGNAL(expanded(QListViewItem*)), SLOT(slotSelectionChanged()));
- connect(parent, SIGNAL(collapsed(QListViewItem*)), SLOT(slotSelectionChanged()));
- connect(this, SIGNAL(done(VarTree*, const QString&)),
- parent, SIGNAL(editValueCommitted(VarTree*, const QString&)));
+ connect(parent, SIGNAL(currentChanged(TQListViewItem*)), SLOT(slotSelectionChanged()));
+ connect(parent, SIGNAL(expanded(TQListViewItem*)), SLOT(slotSelectionChanged()));
+ connect(parent, SIGNAL(collapsed(TQListViewItem*)), SLOT(slotSelectionChanged()));
+ connect(this, SIGNAL(done(VarTree*, const TQString&)),
+ parent, SIGNAL(editValueCommitted(VarTree*, const TQString&)));
}
ValueEdit::~ValueEdit()
@@ -786,29 +786,29 @@ void ValueEdit::terminate(bool commit)
}
}
-void ValueEdit::keyPressEvent(QKeyEvent *e)
+void ValueEdit::keyPressEvent(TQKeyEvent *e)
{
- if(e->key() == Qt::Key_Return || e->key() == Qt::Key_Enter)
+ if(e->key() == TQt::Key_Return || e->key() == TQt::Key_Enter)
terminate(true);
- else if(e->key() == Qt::Key_Escape)
+ else if(e->key() == TQt::Key_Escape)
terminate(false);
else
- QLineEdit::keyPressEvent(e);
+ TQLineEdit::keyPressEvent(e);
}
-void ValueEdit::paintEvent(QPaintEvent* e)
+void ValueEdit::paintEvent(TQPaintEvent* e)
{
- QLineEdit::paintEvent(e);
+ TQLineEdit::paintEvent(e);
- QPainter p(this);
+ TQPainter p(this);
p.drawRect(rect());
}
-void ValueEdit::focusOutEvent(QFocusEvent* ev)
+void ValueEdit::focusOutEvent(TQFocusEvent* ev)
{
TRACE("ValueEdit::focusOutEvent");
- QFocusEvent* focusEv = static_cast<QFocusEvent*>(ev);
- if (focusEv->reason() == QFocusEvent::ActiveWindow)
+ TQFocusEvent* focusEv = static_cast<TQFocusEvent*>(ev);
+ if (focusEv->reason() == TQFocusEvent::ActiveWindow)
{
// Switching to a different window should terminate the edit,
// because if the window with this variable display is floating
@@ -818,7 +818,7 @@ void ValueEdit::focusOutEvent(QFocusEvent* ev)
terminate(false);
}
// Don't let a RMB close the editor
- else if (focusEv->reason() != QFocusEvent::Popup)
+ else if (focusEv->reason() != TQFocusEvent::Popup)
{
terminate(true);
}