Delay widget creation of options pages till their category is shown

Also add the alternative way: IOptionsPageProvider, which states
a category, and is asked for a list of options pages for that
category when it is shown.

Task-number: QTCREATORBUG-3131
This commit is contained in:
con
2010-12-02 18:28:16 +01:00
parent 5c99316624
commit 773343f396
32 changed files with 549 additions and 352 deletions

View File

@@ -186,7 +186,6 @@ FormEditorW::FormEditorW() :
foreach (QDesignerOptionsPageInterface *designerPage, m_formeditor->optionsPages()) {
SettingsPage *settingsPage = new SettingsPage(designerPage);
ExtensionSystem::PluginManager::instance()->addObject(settingsPage);
m_settingsPages.append(settingsPage);
}
@@ -213,10 +212,8 @@ FormEditorW::~FormEditorW()
}
delete m_formeditor;
foreach (SettingsPage *settingsPage, m_settingsPages) {
ExtensionSystem::PluginManager::instance()->removeObject(settingsPage);
delete settingsPage;
}
qDeleteAll(m_settingsPages);
m_settingsPages.clear();
delete m_integration;
m_self = 0;
@@ -389,6 +386,11 @@ void FormEditorW::initDesignerSubWindows()
m_designerSubWindows[ActionEditorSubWindow] = ae;
}
QList<Core::IOptionsPage *> FormEditorW::optionsPages() const
{
return m_settingsPages;
}
void FormEditorW::ensureInitStage(InitializationStage s)
{
if (Designer::Constants::Internal::debug)