forked from qt-creator/qt-creator
ScxmlEditor: Pimpl plugin
No direct advantage locally, but gets rid of one QObject parent use of IEditorFactory. Change-Id: I15611e96d0e6a38ee2c301cb6ba7387ad207265d Reviewed-by: Christian Stenger <christian.stenger@qt.io>
This commit is contained in:
@@ -38,8 +38,7 @@
|
|||||||
using namespace ScxmlEditor::Constants;
|
using namespace ScxmlEditor::Constants;
|
||||||
using namespace ScxmlEditor::Internal;
|
using namespace ScxmlEditor::Internal;
|
||||||
|
|
||||||
ScxmlEditorFactory::ScxmlEditorFactory(QObject *parent)
|
ScxmlEditorFactory::ScxmlEditorFactory()
|
||||||
: IEditorFactory(parent)
|
|
||||||
{
|
{
|
||||||
setId(K_SCXML_EDITOR_ID);
|
setId(K_SCXML_EDITOR_ID);
|
||||||
setDisplayName(QCoreApplication::translate("ScxmlEditor", C_SCXMLEDITOR_DISPLAY_NAME));
|
setDisplayName(QCoreApplication::translate("ScxmlEditor", C_SCXMLEDITOR_DISPLAY_NAME));
|
||||||
|
@@ -35,7 +35,7 @@ class ScxmlEditorData;
|
|||||||
class ScxmlEditorFactory final : public Core::IEditorFactory
|
class ScxmlEditorFactory final : public Core::IEditorFactory
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
explicit ScxmlEditorFactory(QObject *parent);
|
ScxmlEditorFactory();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
ScxmlEditorData* m_editorData = nullptr;
|
ScxmlEditorData* m_editorData = nullptr;
|
||||||
|
@@ -24,6 +24,7 @@
|
|||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
#include "scxmleditorplugin.h"
|
#include "scxmleditorplugin.h"
|
||||||
|
|
||||||
#include "scxmleditorfactory.h"
|
#include "scxmleditorfactory.h"
|
||||||
|
|
||||||
#include <coreplugin/designmode.h>
|
#include <coreplugin/designmode.h>
|
||||||
@@ -33,12 +34,23 @@ using namespace Core;
|
|||||||
namespace ScxmlEditor {
|
namespace ScxmlEditor {
|
||||||
namespace Internal {
|
namespace Internal {
|
||||||
|
|
||||||
|
class ScxmlEditorPluginPrivate
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
ScxmlEditorFactory editorFactory;
|
||||||
|
};
|
||||||
|
|
||||||
|
ScxmlEditorPlugin::~ScxmlEditorPlugin()
|
||||||
|
{
|
||||||
|
delete d;
|
||||||
|
}
|
||||||
|
|
||||||
bool ScxmlEditorPlugin::initialize(const QStringList &arguments, QString *errorString)
|
bool ScxmlEditorPlugin::initialize(const QStringList &arguments, QString *errorString)
|
||||||
{
|
{
|
||||||
Q_UNUSED(arguments)
|
Q_UNUSED(arguments)
|
||||||
Q_UNUSED(errorString)
|
Q_UNUSED(errorString)
|
||||||
|
|
||||||
(void) new ScxmlEditorFactory(this);
|
d = new ScxmlEditorPluginPrivate;
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
@@ -35,10 +35,13 @@ class ScxmlEditorPlugin : public ExtensionSystem::IPlugin
|
|||||||
|
|
||||||
public:
|
public:
|
||||||
ScxmlEditorPlugin() = default;
|
ScxmlEditorPlugin() = default;
|
||||||
|
~ScxmlEditorPlugin();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
bool initialize(const QStringList &arguments, QString *errorString) final;
|
bool initialize(const QStringList &arguments, QString *errorString) final;
|
||||||
void extensionsInitialized() final;
|
void extensionsInitialized() final;
|
||||||
|
|
||||||
|
class ScxmlEditorPluginPrivate *d = nullptr;
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace Internal
|
} // namespace Internal
|
||||||
|
Reference in New Issue
Block a user