summaryrefslogtreecommitdiff
path: root/src/plugins/debugger/localsandexpressionswindow.cpp
diff options
context:
space:
mode:
authorhjk <hjk@theqtcompany.com>2015-02-26 17:43:41 +0100
committerhjk <hjk@theqtcompany.com>2015-02-27 12:19:25 +0000
commit6e7f07c37a19b189cefe5daf9a97a8a10aea1b54 (patch)
tree58e85ad4cd90bfc6d04824619163d67d8f8126a2 /src/plugins/debugger/localsandexpressionswindow.cpp
parent23ec7a1eeb1f486ce11acb0f9994635478fc20ce (diff)
downloadqt-creator-6e7f07c37a19b189cefe5daf9a97a8a10aea1b54.tar.gz
Debugger: More modernization
New connects, some auto. Change-Id: I768637aae9cbb0a62e9082e56141f212022d8220 Reviewed-by: Christian Stenger <christian.stenger@theqtcompany.com>
Diffstat (limited to 'src/plugins/debugger/localsandexpressionswindow.cpp')
-rw-r--r--src/plugins/debugger/localsandexpressionswindow.cpp30
1 files changed, 9 insertions, 21 deletions
diff --git a/src/plugins/debugger/localsandexpressionswindow.cpp b/src/plugins/debugger/localsandexpressionswindow.cpp
index c88e5d479d..d957e3f94b 100644
--- a/src/plugins/debugger/localsandexpressionswindow.cpp
+++ b/src/plugins/debugger/localsandexpressionswindow.cpp
@@ -35,19 +35,16 @@
#include <QVBoxLayout>
#include <QStackedWidget>
-const int LOCAL_WIDGET_INDEX = 0;
-const int INSPECTOR_WIDGET_INDEX = 1;
-
namespace Debugger {
namespace Internal {
-LocalsAndExpressionsWindow::LocalsAndExpressionsWindow(
- QWidget *locals, QWidget *inspector, QWidget *returnWidget,
- QWidget *watchers, QWidget *parent)
- : QWidget(parent),
- m_showLocals(false)
+enum { LocalsIndex = 0, InspectorIndex = 1 };
+
+LocalsAndExpressionsWindow::LocalsAndExpressionsWindow(QWidget *locals,
+ QWidget *inspector, QWidget *returnWidget, QWidget *watchers)
+ : m_showLocals(false)
{
- QVBoxLayout *layout = new QVBoxLayout(this);
+ auto layout = new QVBoxLayout(this);
layout->setMargin(0);
layout->setSpacing(0);
@@ -71,7 +68,9 @@ LocalsAndExpressionsWindow::LocalsAndExpressionsWindow(
// when debugger engine changes states.
m_timer.setSingleShot(true);
m_timer.setInterval(500); // TODO: remove the magic number!
- connect(&m_timer, SIGNAL(timeout()), SLOT(showLocals()));
+ connect(&m_timer, &QTimer::timeout, [this] {
+ m_localsAndInspector->setCurrentIndex(m_showLocals ? LocalsIndex : InspectorIndex);
+ });
}
void LocalsAndExpressionsWindow::setShowLocals(bool showLocals)
@@ -80,16 +79,5 @@ void LocalsAndExpressionsWindow::setShowLocals(bool showLocals)
m_timer.start();
}
-void LocalsAndExpressionsWindow::showLocals()
-{
- m_localsAndInspector->setCurrentIndex(m_showLocals ? LOCAL_WIDGET_INDEX
- : INSPECTOR_WIDGET_INDEX);
-}
-
-QWidget *LocalsAndExpressionsWindow::inspectorWidget() const
-{
- return m_localsAndInspector->widget(INSPECTOR_WIDGET_INDEX);
-}
-
} // namespace Internal
} // namespace Debugger