forked from qt-creator/qt-creator
Debugger: Add a way to notify perspective about their activation
Change-Id: I5a6189e835aa293341f357c08f1d4b8ca4dd8326 Reviewed-by: Filipe Azevedo <filipe.azevedo@kdab.com> Reviewed-by: hjk <hjk@qt.io>
This commit is contained in:
@@ -301,6 +301,7 @@ void DebuggerMainWindow::loadPerspectiveHelper(const QByteArray &perspectiveId,
|
||||
|
||||
QTC_ASSERT(m_perspectiveForPerspectiveId.contains(m_currentPerspectiveId), return);
|
||||
const Perspective *perspective = m_perspectiveForPerspectiveId.value(m_currentPerspectiveId);
|
||||
perspective->aboutToActivate();
|
||||
for (const Perspective::Operation &operation : perspective->operations()) {
|
||||
QDockWidget *dock = m_dockForDockId.value(operation.dockId);
|
||||
if (!dock) {
|
||||
@@ -405,6 +406,17 @@ void Perspective::setName(const QString &name)
|
||||
m_name = name;
|
||||
}
|
||||
|
||||
void Perspective::setAboutToActivateCallback(const Perspective::Callback &cb)
|
||||
{
|
||||
m_aboutToActivateCallback = cb;
|
||||
}
|
||||
|
||||
void Perspective::aboutToActivate()
|
||||
{
|
||||
if (m_aboutToActivateCallback)
|
||||
m_aboutToActivateCallback();
|
||||
}
|
||||
|
||||
QList<QWidget *> ToolbarDescription::widgets() const
|
||||
{
|
||||
return m_widgets;
|
||||
|
||||
Reference in New Issue
Block a user