forked from qt-creator/qt-creator
DesignMode: Apply 'static pattern'
Also: - and replace some occurrences of DesignMode::instance()->id() by Core::Constants::MODE_DESIGN for less dependence on the lifetime of the DesignMode object (and less indirection) - remove storage if DesignMode::instance() values when direct use of the static functions suffice - remove some unused items from the interface - use member-initialization in DesignMode::Private. Change-Id: Ie66c06da0fc0a3ccc588b8079e51db6b39284152 Reviewed-by: Eike Ziller <eike.ziller@qt.io>
This commit is contained in:
@@ -30,8 +30,6 @@
|
||||
namespace Core {
|
||||
class IEditor;
|
||||
|
||||
namespace Internal { class DesignModeCoreListener; }
|
||||
|
||||
/**
|
||||
* A global mode for Design pane - used by Bauhaus (QML Designer) and
|
||||
* Qt Designer. Other plugins can register themselves by registerDesignWidget()
|
||||
@@ -39,8 +37,6 @@ namespace Internal { class DesignModeCoreListener; }
|
||||
* to the main editor widget itself.
|
||||
*/
|
||||
|
||||
class DesignModePrivate;
|
||||
|
||||
class CORE_EXPORT DesignMode : public IMode
|
||||
{
|
||||
Q_OBJECT
|
||||
@@ -51,15 +47,13 @@ public:
|
||||
|
||||
static DesignMode *instance();
|
||||
|
||||
void setDesignModeIsRequired();
|
||||
bool designModeIsRequired() const;
|
||||
static void setDesignModeIsRequired();
|
||||
static bool designModeIsRequired();
|
||||
|
||||
void registerDesignWidget(QWidget *widget,
|
||||
const QStringList &mimeTypes,
|
||||
const Context &context);
|
||||
void unregisterDesignWidget(QWidget *widget);
|
||||
|
||||
QStringList registeredMimeTypes() const;
|
||||
static void registerDesignWidget(QWidget *widget,
|
||||
const QStringList &mimeTypes,
|
||||
const Context &context);
|
||||
static void unregisterDesignWidget(QWidget *widget);
|
||||
|
||||
signals:
|
||||
void actionsUpdated(Core::IEditor *editor);
|
||||
@@ -70,9 +64,6 @@ private:
|
||||
void currentEditorChanged(IEditor *editor);
|
||||
void updateContext(Id newMode, Id oldMode);
|
||||
void setActiveContext(const Context &context);
|
||||
|
||||
DesignModePrivate *d;
|
||||
friend class Internal::DesignModeCoreListener;
|
||||
};
|
||||
|
||||
} // namespace Core
|
||||
|
||||
Reference in New Issue
Block a user