forked from qt-creator/qt-creator
Debugger: Start introducing dynamic perspectives
Make perspectives and tool bars destroyable. This is a step forward to multiply debugger engines whose perspective's life time is connected to the engine, not the debug mode. In the present setup there are two kind of perspective: 1 - static: with a lifetime associated to the application (or, rather, plugin that defines them). These are listed in the perspective chooser, later e.g. Debugger for pre-set breakpoints 2 - dynamic: with a shorted lifetime, e.g. running GDB engine. Presently, and possibly also in future so, a dynamic perspective is related to exactly one of the static perspectives, i.e. are kind of "child". Change-Id: Ic11572e7121e14f8da2927a0c0ac3441c99073a3 Reviewed-by: Christian Stenger <christian.stenger@qt.io>
This commit is contained in:
@@ -92,11 +92,15 @@ public:
|
||||
void setAboutToActivateCallback(const Callback &cb);
|
||||
void aboutToActivate() const;
|
||||
|
||||
QByteArray parentPerspective() const;
|
||||
void setParentPerspective(const QByteArray &parentPerspective);
|
||||
|
||||
private:
|
||||
Perspective(const Perspective &) = delete;
|
||||
void operator=(const Perspective &) = delete;
|
||||
|
||||
QString m_name;
|
||||
QByteArray m_parentPerspective;
|
||||
QVector<QByteArray> m_docks;
|
||||
QVector<Operation> m_operations;
|
||||
QPointer<QWidget> m_centralWidget;
|
||||
@@ -127,7 +131,9 @@ public:
|
||||
~DebuggerMainWindow() override;
|
||||
|
||||
void registerPerspective(const QByteArray &perspectiveId, const Perspective *perspective);
|
||||
void destroyDynamicPerspective(const QByteArray &perspectiveId);
|
||||
void registerToolbar(const QByteArray &perspectiveId, QWidget *widget);
|
||||
void destroyDynamicToolbar(const QByteArray &perspectiveId);
|
||||
|
||||
void resetCurrentPerspective();
|
||||
void restorePerspective(const QByteArray &perspectiveId);
|
||||
@@ -150,6 +156,7 @@ private:
|
||||
QDockWidget *registerDockWidget(const QByteArray &dockId, QWidget *widget);
|
||||
void loadPerspectiveHelper(const QByteArray &perspectiveId, bool fromStoredSettings = true);
|
||||
void savePerspectiveHelper(const QByteArray &perspectiveId);
|
||||
void increaseChooserWidthIfNecessary(const QString &visibleName);
|
||||
|
||||
QByteArray m_currentPerspectiveId;
|
||||
QComboBox *m_perspectiveChooser;
|
||||
|
||||
Reference in New Issue
Block a user