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:
hjk
2016-11-21 13:57:11 +01:00
parent a33b9317b8
commit 6de88f7fae
2 changed files with 17 additions and 0 deletions

View File

@@ -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;