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::Internal;
|
||||
|
||||
ScxmlEditorFactory::ScxmlEditorFactory(QObject *parent)
|
||||
: IEditorFactory(parent)
|
||||
ScxmlEditorFactory::ScxmlEditorFactory()
|
||||
{
|
||||
setId(K_SCXML_EDITOR_ID);
|
||||
setDisplayName(QCoreApplication::translate("ScxmlEditor", C_SCXMLEDITOR_DISPLAY_NAME));
|
||||
|
@@ -35,7 +35,7 @@ class ScxmlEditorData;
|
||||
class ScxmlEditorFactory final : public Core::IEditorFactory
|
||||
{
|
||||
public:
|
||||
explicit ScxmlEditorFactory(QObject *parent);
|
||||
ScxmlEditorFactory();
|
||||
|
||||
private:
|
||||
ScxmlEditorData* m_editorData = nullptr;
|
||||
|
@@ -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;
|
||||
}
|
||||
|
@@ -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
|
||||
|
Reference in New Issue
Block a user