forked from qt-creator/qt-creator
ScxmlEditor: Make ScxmlEditorFactory independent of QObject inheritance
Change-Id: I11412b850869c8295e9eed9ed74ff4f7dcbcf8b2 Reviewed-by: Christian Stenger <christian.stenger@qt.io>
This commit is contained in:
@@ -87,8 +87,7 @@ public:
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
ScxmlEditorData::ScxmlEditorData(QObject *parent)
|
ScxmlEditorData::ScxmlEditorData()
|
||||||
: QObject(parent)
|
|
||||||
{
|
{
|
||||||
m_contexts.add(ScxmlEditor::Constants::C_SCXMLEDITOR);
|
m_contexts.add(ScxmlEditor::Constants::C_SCXMLEDITOR);
|
||||||
|
|
||||||
|
@@ -46,7 +46,7 @@ class ScxmlEditorData : public QObject
|
|||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
public:
|
public:
|
||||||
ScxmlEditorData(QObject *parent = nullptr);
|
ScxmlEditorData();
|
||||||
~ScxmlEditorData() override;
|
~ScxmlEditorData() override;
|
||||||
|
|
||||||
void fullInit();
|
void fullInit();
|
||||||
|
@@ -48,7 +48,7 @@ ScxmlEditorFactory::ScxmlEditorFactory()
|
|||||||
|
|
||||||
setEditorCreator([this] {
|
setEditorCreator([this] {
|
||||||
if (!m_editorData) {
|
if (!m_editorData) {
|
||||||
m_editorData = new ScxmlEditorData(this);
|
m_editorData = new ScxmlEditorData;
|
||||||
QGuiApplication::setOverrideCursor(Qt::WaitCursor);
|
QGuiApplication::setOverrideCursor(Qt::WaitCursor);
|
||||||
m_editorData->fullInit();
|
m_editorData->fullInit();
|
||||||
QGuiApplication::restoreOverrideCursor();
|
QGuiApplication::restoreOverrideCursor();
|
||||||
@@ -56,3 +56,8 @@ ScxmlEditorFactory::ScxmlEditorFactory()
|
|||||||
return m_editorData->createEditor();
|
return m_editorData->createEditor();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ScxmlEditorFactory::~ScxmlEditorFactory()
|
||||||
|
{
|
||||||
|
delete m_editorData;
|
||||||
|
}
|
||||||
|
@@ -36,6 +36,7 @@ class ScxmlEditorFactory final : public Core::IEditorFactory
|
|||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
ScxmlEditorFactory();
|
ScxmlEditorFactory();
|
||||||
|
~ScxmlEditorFactory();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
ScxmlEditorData* m_editorData = nullptr;
|
ScxmlEditorData* m_editorData = nullptr;
|
||||||
|
Reference in New Issue
Block a user