forked from qt-creator/qt-creator
Core: Make IEditorFactory::createEditor use a function object
Also, replace or remove unneeded Q_OBJECTs, and make base setters and adders protected. Change-Id: I212257ef53984d8852dc8c478537199fc9483486 Reviewed-by: Eike Ziller <eike.ziller@qt.io>
This commit is contained in:
@@ -46,15 +46,14 @@ ScxmlEditorFactory::ScxmlEditorFactory(QObject *parent)
|
||||
addMimeType(ProjectExplorer::Constants::SCXML_MIMETYPE);
|
||||
|
||||
Core::FileIconProvider::registerIconOverlayForSuffix(":/projectexplorer/images/fileoverlay_scxml.png", "scxml");
|
||||
}
|
||||
|
||||
Core::IEditor *ScxmlEditorFactory::createEditor()
|
||||
{
|
||||
if (!m_editorData) {
|
||||
m_editorData = new ScxmlEditorData(this);
|
||||
QGuiApplication::setOverrideCursor(Qt::WaitCursor);
|
||||
m_editorData->fullInit();
|
||||
QGuiApplication::restoreOverrideCursor();
|
||||
}
|
||||
return m_editorData->createEditor();
|
||||
setEditorCreator([this] {
|
||||
if (!m_editorData) {
|
||||
m_editorData = new ScxmlEditorData(this);
|
||||
QGuiApplication::setOverrideCursor(Qt::WaitCursor);
|
||||
m_editorData->fullInit();
|
||||
QGuiApplication::restoreOverrideCursor();
|
||||
}
|
||||
return m_editorData->createEditor();
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user