DebuggerPlugin: Fix assert on Creator startup

Add toolbar action to the perspective before calling
setToolButtonStyle(), otherwise the m_toolButton isn't
created yet and the assert is triggered.

Amends d304e82e63

Change-Id: Idac207464d8844565c96718ac65a7b820f05d4b7
Reviewed-by: hjk <hjk@qt.io>
This commit is contained in:
Jarek Kobus
2023-08-29 09:36:24 +02:00
parent 47c2d78b6c
commit e4ab99990e

View File

@@ -1273,6 +1273,7 @@ void DebuggerPluginPrivate::createDapDebuggerPerspective(QWidget *globalLogWindo
}
});
m_perspectiveDap.addToolBarAction(&m_startDapAction);
m_startDapAction.setToolTip(Tr::tr("Start DAP Debugging"));
m_startDapAction.setText(Tr::tr("Start DAP Debugging"));
m_startDapAction.setEnabled(true);
@@ -1281,7 +1282,6 @@ void DebuggerPluginPrivate::createDapDebuggerPerspective(QWidget *globalLogWindo
m_startDapAction.setVisible(true);
m_perspectiveDap.useSubPerspectiveSwitcher(EngineManager::dapEngineChooser());
m_perspectiveDap.addToolBarAction(&m_startDapAction);
m_perspectiveDap.addWindow(engineManagerWindow, Perspective::SplitVertical, nullptr);
m_perspectiveDap.addWindow(breakpointManagerWindow,