forked from qt-creator/qt-creator
Core: Add a way to delay-construct mode widgets
... and use it for edit mode. There's currently no real effect as the mode bar population in ModeManagerPrivate::extensionsInitializedHelper() accesses all IMode::widget() and triggers the creation, but in principle we could pass the functor instead of the widget down to and store in FancyTabWidget and only use it when a mode gets activated. Change-Id: I4c4a276bc025abce1ff47c68b060c67b5c8e5170 Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
This commit is contained in:
@@ -500,13 +500,11 @@ public:
|
||||
setPriority(85);
|
||||
setId(MODE_DEBUG);
|
||||
|
||||
setWidget(new DebugModeWidget);
|
||||
setWidgetCreator([] { return new DebugModeWidget; });
|
||||
setMainWindow(DebuggerMainWindow::instance());
|
||||
|
||||
setMenu(&DebuggerMainWindow::addPerspectiveMenu);
|
||||
}
|
||||
|
||||
~DebugMode() { delete widget(); }
|
||||
};
|
||||
|
||||
///////////////////////////////////////////////////////////////////////
|
||||
|
||||
Reference in New Issue
Block a user