From afdcda5e48807af193177da0b02c0705080b71ff Mon Sep 17 00:00:00 2001 From: David Edmundson Date: Mon, 5 Jul 2010 10:41:07 +0100 Subject: [PATCH] Update backtrace window from deprecated Q3ListBox widget to QListWidget. --- kdbg/dbgmainwnd.cpp | 4 ++-- kdbg/dbgmainwnd.h | 4 ++-- kdbg/debugger.cpp | 14 +++++--------- kdbg/debugger.h | 6 +++--- 4 files changed, 12 insertions(+), 16 deletions(-) diff --git a/kdbg/dbgmainwnd.cpp b/kdbg/dbgmainwnd.cpp index 7396491..a67fb43 100644 --- a/kdbg/dbgmainwnd.cpp +++ b/kdbg/dbgmainwnd.cpp @@ -25,7 +25,7 @@ #include #include #include -#include +#include #include #include #include @@ -76,7 +76,7 @@ DebuggerMainWnd::DebuggerMainWnd() : setCentralWidget(m_filesWindow); QDockWidget* dw1 = createDockWidget("Stack", i18n("Stack")); - m_btWindow = new Q3ListBox(dw1); + m_btWindow = new QListWidget(dw1); dw1->setWidget(m_btWindow); QDockWidget* dw2 = createDockWidget("Locals", i18n("Locals")); m_localVariables = new ExprWnd(dw2, i18n("Variable")); diff --git a/kdbg/dbgmainwnd.h b/kdbg/dbgmainwnd.h index 0dc1629..2af39a0 100644 --- a/kdbg/dbgmainwnd.h +++ b/kdbg/dbgmainwnd.h @@ -17,7 +17,7 @@ class KAnimatedButton; class KRecentFilesAction; class KUrl; class WinStack; -class Q3ListBox; +class QListWidget; class Q3ListViewItem; class ExprWnd; class BreakpointTable; @@ -65,7 +65,7 @@ protected: // view windows WinStack* m_filesWindow; - Q3ListBox* m_btWindow; + QListWidget* m_btWindow; ExprWnd* m_localVariables; WatchWindow* m_watches; RegisterView* m_registers; diff --git a/kdbg/debugger.cpp b/kdbg/debugger.cpp index 0a9da7b..7b29bf9 100644 --- a/kdbg/debugger.cpp +++ b/kdbg/debugger.cpp @@ -11,7 +11,7 @@ #include "exprwnd.h" #include "pgmsettings.h" #include -#include +#include #include #include // KMD5 #include @@ -27,7 +27,7 @@ KDebugger::KDebugger(QWidget* parent, ExprWnd* localVars, ExprWnd* watchVars, - Q3ListBox* backtrace) : + QListWidget* backtrace) : QObject(parent, "debugger"), m_ttyLevel(ttyFull), m_memoryFormat(MDTword | MDThex), @@ -53,7 +53,7 @@ KDebugger::KDebugger(QWidget* parent, connect(&m_watchVariables, SIGNAL(editValueCommitted(VarTree*, const QString&)), SLOT(slotValueEdited(VarTree*, const QString&))); - connect(&m_btWindow, SIGNAL(highlighted(int)), SLOT(gotoFrame(int))); + connect(&m_btWindow, SIGNAL(currentRowChanged(int)), this, SLOT(gotoFrame(int))); emit updateUI(); } @@ -1467,9 +1467,6 @@ bool KDebugger::handlePrintDeref(CmdQueueItem* cmd, const char* output) // parse the output of bt void KDebugger::handleBacktrace(const char* output) { - // reduce flicker - m_btWindow.setAutoUpdate(false); - m_btWindow.clear(); std::list stack; @@ -1487,14 +1484,13 @@ void KDebugger::handleBacktrace(const char* output) func = frm->var->m_name; else func = frm->fileName + ":" + QString().setNum(frm->lineNo+1); - m_btWindow.insertItem(func); + + m_btWindow.addItem(func); TRACE("frame " + func + " (" + frm->fileName + ":" + QString().setNum(frm->lineNo+1) + ")"); } } - m_btWindow.setAutoUpdate(true); - m_btWindow.repaint(); } void KDebugger::gotoFrame(int frame) diff --git a/kdbg/debugger.h b/kdbg/debugger.h index c998830..9bf4b5a 100644 --- a/kdbg/debugger.h +++ b/kdbg/debugger.h @@ -20,7 +20,7 @@ class KTreeViewItem; class KConfig; class KConfigBase; class KConfigGroup; -class Q3ListBox; +class QListWidget; class RegisterInfo; class ThreadInfo; class DebuggerDriver; @@ -39,7 +39,7 @@ public: KDebugger(QWidget* parent, /* will be used as the parent for dialogs */ ExprWnd* localVars, ExprWnd* watchVars, - Q3ListBox* backtrace); + QListWidget* backtrace); ~KDebugger(); /** @@ -554,7 +554,7 @@ signals: protected: ExprWnd& m_localVariables; ExprWnd& m_watchVariables; - Q3ListBox& m_btWindow; + QListWidget& m_btWindow; // implementation helpers protected: -- 2.11.4.GIT