From 9d8cd37e8c93eefd660ef335ae04f66595cbf009 Mon Sep 17 00:00:00 2001 From: Alexandru Croitor Date: Fri, 23 Nov 2018 15:59:25 +0100 Subject: [PATCH] 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 Reviewed-by: hjk --- src/plugins/debugger/threadshandler.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/plugins/debugger/threadshandler.cpp b/src/plugins/debugger/threadshandler.cpp index 54b87599e3c..a37d6fbe1d9 100644 --- a/src/plugins/debugger/threadshandler.cpp +++ b/src/plugins/debugger/threadshandler.cpp @@ -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()