aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins/debugger/watchhandler.cpp
diff options
context:
space:
mode:
authorRyan May <[email protected]>2012-12-28 21:29:17 -0600
committerhjk <[email protected]>2012-12-29 13:09:03 +0100
commit45cd2d1e8fac9f88ba0bb597e7de52d580ed29f3 (patch)
tree66af633c4539d879b839f9a4928eae18aa4d6188 /src/plugins/debugger/watchhandler.cpp
parentf5b0fcfb5ddecf2eefd659b6f25e6c3152c5ec12 (diff)
Debugger: Set current tab in separate value display
As widgets are added and deleted from the tab widget, they can end up in almost any order. As a result, when the window is raised, the current tab does not necessarily reflect an item currently in the watch view. Instead, make a tab the current one as it is added, ensuring one of the currently relevant values is displayed by default. Change-Id: Ia2d2eb60c844a008f8086820564dd20389ce519b Reviewed-by: hjk <[email protected]>
Diffstat (limited to 'src/plugins/debugger/watchhandler.cpp')
-rw-r--r--src/plugins/debugger/watchhandler.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/plugins/debugger/watchhandler.cpp b/src/plugins/debugger/watchhandler.cpp
index be71dfc04fd..5f54e404190 100644
--- a/src/plugins/debugger/watchhandler.cpp
+++ b/src/plugins/debugger/watchhandler.cpp
@@ -1638,12 +1638,13 @@ void WatchHandler::showSeparateWidget(QWidget *w)
m_separateWindow->setWindowFlags(m_separateWindow->windowFlags() | Qt::Window);
m_separateWindow->setWindowTitle(WatchHandler::tr("Debugger - Qt Creator"));
}
- const int index = indexOf(m_separateWindow, w);
+ int index = indexOf(m_separateWindow, w);
if (index != -1) {
m_separateWindow->setTabText(index, w->windowTitle());
} else {
- m_separateWindow->addTab(w, w->windowTitle());
+ index = m_separateWindow->addTab(w, w->windowTitle());
}
+ m_separateWindow->setCurrentIndex(index);
m_separateWindow->show();
m_separateWindow->raise();
}