Debugger: Use a QPointer for the thread switcher

... and (re)create it on demand. That covers the case of a restart
of the debugger engine in which case the original switcher was
destroyed together with the toolbar of the original perspective.

Change-Id: I6180411a37aea46438809a5ff65e5526f9db2a03
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
This commit is contained in:
hjk
2018-11-07 09:23:16 +01:00
parent 70b466b7d9
commit 790a86d508
2 changed files with 21 additions and 9 deletions

View File

@@ -77,6 +77,7 @@ class ThreadsHandler : public ThreadsHandlerModel
public:
explicit ThreadsHandler(DebuggerEngine *engine);
~ThreadsHandler();
Thread currentThread() const;
Thread threadForId(const QString &id) const;
@@ -95,7 +96,7 @@ public:
void notifyRunning(const QString &id);
void notifyStopped(const QString &id);
QComboBox *threadSwitcher() { return m_comboBox; }
QPointer<QComboBox> threadSwitcher();
private:
void sort(int column, Qt::SortOrder order) override;
@@ -105,7 +106,7 @@ private:
DebuggerEngine *m_engine;
Thread m_currentThread;
QHash<QString, QString> m_pidForGroupId;
QComboBox *m_comboBox;
QPointer<QComboBox> m_comboBox;
};
} // namespace Internal