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:
hjk
2020-02-06 08:38:54 +01:00
parent ca89d1b8a6
commit 90f2f4b1dc
4 changed files with 18 additions and 4 deletions

View File

@@ -38,8 +38,7 @@
using namespace ScxmlEditor::Constants;
using namespace ScxmlEditor::Internal;
ScxmlEditorFactory::ScxmlEditorFactory(QObject *parent)
: IEditorFactory(parent)
ScxmlEditorFactory::ScxmlEditorFactory()
{
setId(K_SCXML_EDITOR_ID);
setDisplayName(QCoreApplication::translate("ScxmlEditor", C_SCXMLEDITOR_DISPLAY_NAME));

View File

@@ -35,7 +35,7 @@ class ScxmlEditorData;
class ScxmlEditorFactory final : public Core::IEditorFactory
{
public:
explicit ScxmlEditorFactory(QObject *parent);
ScxmlEditorFactory();
private:
ScxmlEditorData* m_editorData = nullptr;

View File

@@ -24,6 +24,7 @@
****************************************************************************/
#include "scxmleditorplugin.h"
#include "scxmleditorfactory.h"
#include <coreplugin/designmode.h>
@@ -33,12 +34,23 @@ using namespace Core;
namespace ScxmlEditor {
namespace Internal {
class ScxmlEditorPluginPrivate
{
public:
ScxmlEditorFactory editorFactory;
};
ScxmlEditorPlugin::~ScxmlEditorPlugin()
{
delete d;
}
bool ScxmlEditorPlugin::initialize(const QStringList &arguments, QString *errorString)
{
Q_UNUSED(arguments)
Q_UNUSED(errorString)
(void) new ScxmlEditorFactory(this);
d = new ScxmlEditorPluginPrivate;
return true;
}

View File

@@ -35,10 +35,13 @@ class ScxmlEditorPlugin : public ExtensionSystem::IPlugin
public:
ScxmlEditorPlugin() = default;
~ScxmlEditorPlugin();
private:
bool initialize(const QStringList &arguments, QString *errorString) final;
void extensionsInitialized() final;
class ScxmlEditorPluginPrivate *d = nullptr;
};
} // namespace Internal