Debugger: Fix thread switcher combobox to show current thread

When a breakpoint was hit, the combo box "popup" correctly showed
which thread was interrupted (with the little left-arrow icon),
but the actual combo box always showed the first thread.

This change makes sure to update the combo box current index whenever
a breakpoint is hit.

Change-Id: I8339f4334df46830f5e8f82a2b4eafa9e6a388c4
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Reviewed-by: hjk <hjk@qt.io>
This commit is contained in:
Alexandru Croitor
2018-11-23 15:59:25 +01:00
parent 18c6048099
commit 9d8cd37e8c

View File

@@ -408,6 +408,11 @@ void ThreadsHandler::setThreads(const GdbMi &data)
if (!m_currentThread && threads.childCount() > 0)
m_currentThread = rootItem()->childAt(0);
if (!m_currentThread) {
const QModelIndex currentThreadIndex = m_currentThread->index();
threadSwitcher()->setCurrentIndex(currentThreadIndex.row());
}
}
QAbstractItemModel *ThreadsHandler::model()