forked from qt-creator/qt-creator
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 <qthjk@ovi.com>
This commit is contained in:
@@ -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();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user