28 TabOrderFeature = 0x04,
29 DefaultFeature = EditFeature | GridFeature
31 Q_DECLARE_FLAGS(Feature, FeatureFlag)
33 enum ResourceFileSaveMode
36 SaveOnlyUsedResourceFiles,
39 Q_ENUM(ResourceFileSaveMode)
41 explicit QDesignerFormWindowInterface(QWidget *parent =
nullptr, Qt::WindowFlags flags = {});
42 virtual ~QDesignerFormWindowInterface();
44 virtual QString fileName()
const = 0;
45 virtual QDir absoluteDir()
const = 0;
47 virtual QString contents()
const = 0;
48 virtual QStringList checkContents()
const = 0;
49 virtual bool setContents(QIODevice *dev, QString *errorMessage =
nullptr) = 0;
51 virtual Feature features()
const = 0;
52 virtual bool hasFeature(Feature f)
const = 0;
54 virtual QString author()
const = 0;
55 virtual void setAuthor(
const QString &author) = 0;
57 virtual QString comment()
const = 0;
58 virtual void setComment(
const QString &comment) = 0;
60 virtual void layoutDefault(
int *margin,
int *spacing) = 0;
61 virtual void setLayoutDefault(
int margin,
int spacing) = 0;
63 virtual void layoutFunction(QString *margin, QString *spacing) = 0;
64 virtual void setLayoutFunction(
const QString &margin,
const QString &spacing) = 0;
66 virtual QString pixmapFunction()
const = 0;
67 virtual void setPixmapFunction(
const QString &pixmapFunction) = 0;
69 virtual QString exportMacro()
const = 0;
70 virtual void setExportMacro(
const QString &exportMacro) = 0;
72 virtual QStringList includeHints()
const = 0;
73 virtual void setIncludeHints(
const QStringList &includeHints) = 0;
75 virtual ResourceFileSaveMode resourceFileSaveMode()
const = 0;
76 virtual void setResourceFileSaveMode(ResourceFileSaveMode behaviour) = 0;
78 virtual QtResourceSet *resourceSet()
const = 0;
79 virtual void setResourceSet(QtResourceSet *resourceSet) = 0;
81 QStringList activeResourceFilePaths()
const;
83 virtual QDesignerFormEditorInterface *core()
const;
84 virtual QDesignerFormWindowCursorInterface *cursor()
const = 0;
86 virtual int toolCount()
const = 0;
88 virtual int currentTool()
const = 0;
89 virtual void setCurrentTool(
int index) = 0;
91 virtual QDesignerFormWindowToolInterface *tool(
int index)
const = 0;
92 virtual void registerTool(QDesignerFormWindowToolInterface *tool) = 0;
94 virtual QPoint grid()
const = 0;
96 virtual QWidget *mainContainer()
const = 0;
97 virtual void setMainContainer(QWidget *mainContainer) = 0;
98 virtual QWidget *formContainer()
const = 0;
100 virtual bool isManaged(QWidget *widget)
const = 0;
102 virtual bool isDirty()
const = 0;
104 static QDesignerFormWindowInterface *findFormWindow(QWidget *w);
105 static QDesignerFormWindowInterface *findFormWindow(QObject *obj);
107 virtual QUndoStack *commandHistory()
const = 0;
108 virtual void beginCommand(
const QString &description) = 0;
109 virtual void endCommand() = 0;
111 virtual void simplifySelection(QList<QWidget*> *widgets)
const = 0;
114 virtual void emitSelectionChanged() = 0;
116 virtual QStringList resourceFiles()
const = 0;
117 virtual void addResourceFile(
const QString &path) = 0;
118 virtual void removeResourceFile(
const QString &path) = 0;
120 virtual void ensureUniqueObjectName(QObject *object) = 0;
123 virtual void manageWidget(QWidget *widget) = 0;
124 virtual void unmanageWidget(QWidget *widget) = 0;
126 virtual void setFeatures(Feature f) = 0;
127 virtual void setDirty(
bool dirty) = 0;
128 virtual void clearSelection(
bool changePropertyDisplay =
true) = 0;
129 virtual void selectWidget(QWidget *w,
bool select =
true) = 0;
130 virtual void setGrid(
const QPoint &grid) = 0;
131 virtual void setFileName(
const QString &fileName) = 0;
132 virtual bool setContents(
const QString &contents) = 0;
134 virtual void editWidgets() = 0;
135 void activateResourceFilePaths(
const QStringList &paths,
int *errorCount =
nullptr, QString *errorMessages =
nullptr);
138 void mainContainerChanged(QWidget *mainContainer);
139 void toolChanged(
int toolIndex);
140 void fileNameChanged(
const QString &fileName);
141 void featureChanged(Feature f);
142 void selectionChanged();
143 void geometryChanged();
145 void resourceFilesChanged();
147 void widgetManaged(QWidget *widget);
148 void widgetUnmanaged(QWidget *widget);
149 void aboutToUnmanageWidget(QWidget *widget);
150 void activated(QWidget *widget);
153 void widgetRemoved(QWidget *w);
154 void objectRemoved(QObject *o);