4#ifndef QDESIGNER_ACTIONS_H
5#define QDESIGNER_ACTIONS_H
10#include <QtCore/qobject.h>
11#include <QtCore/qpointer.h>
20class QDesignerFormEditorInterface;
21class QDesignerFormWindowInterface;
31 class PreviewConfiguration;
44 QDesignerFormEditorInterface *
core()
const;
46 bool saveForm(QDesignerFormWindowInterface *fw);
48 bool writeOutForm(QDesignerFormWindowInterface *formWindow,
const QString &fileName,
bool check =
true);
86 void helpRequested(
const QString &manual,
const QString &document);
95 void saveFormAsTemplate();
96 void notImplementedYet();
98 void editWidgetsSlot();
99 void openRecentForm();
100 void clearRecentFiles();
102 void showDesignerHelp();
103 void aboutDesigner();
104 void showWidgetSpecificHelp();
106 void showNewFormDialog(
const QString &fileName);
107 void showPreferencesDialog();
108 void showAppFontDialog();
109 void savePreviewImage();
110 void printPreviewImage();
111 void updateCloseAction();
112 void formWindowCountChanged();
113 void formWindowSettingsChanged(QDesignerFormWindowInterface *fw);
116 QAction *createRecentFilesMenu();
117 bool saveFormAs(QDesignerFormWindowInterface *fw);
118 void updateRecentFileActions();
119 void addRecentFile(
const QString &fileName);
120 void showHelp(
const QString &help);
122 QRect fixDialogRect(
const QRect &rect)
const;
123 void showStatusBarMessage(
const QString &message)
const;
124 QActionGroup *createHelpActions();
125 bool ensureBackupDirectories();
126 QPixmap createPreviewPixmap(QDesignerFormWindowInterface *fw);
130 enum { MaxRecentFiles = 10 };
132 QDesignerFormEditorInterface *m_core;
135 QString m_openDirectory;
136 QString m_saveDirectory;
139 QString m_backupPath;
140 QString m_backupTmpPath;
142 QTimer* m_backupTimer;
144 QActionGroup *m_fileActions;
145 QActionGroup *m_recentFilesActions;
146 QActionGroup *m_editActions;
147 QActionGroup *m_formActions;
148 QActionGroup *m_settingsActions;
149 QActionGroup *m_windowActions;
150 QActionGroup *m_toolActions;
151 QActionGroup *m_helpActions =
nullptr;
152 QActionGroup *m_styleActions =
nullptr;
154 QAction *m_editWidgetsAction;
156 QAction *m_newFormAction;
157 QAction *m_openFormAction;
158 QAction *m_saveFormAction;
159 QAction *m_saveFormAsAction;
160 QAction *m_saveAllFormsAction;
161 QAction *m_saveFormAsTemplateAction;
162 QAction *m_closeFormAction;
163 QAction *m_savePreviewImageAction;
164 QAction *m_printPreviewAction;
166 QAction *m_quitAction;
168 QAction *m_previewFormAction =
nullptr;
169 QAction *m_viewCppCodeAction;
170 QAction *m_viewPythonCodeAction;
172 QAction *m_minimizeAction;
173 QAction *m_bringAllToFrontSeparator;
174 QAction *m_bringAllToFrontAction;
175 QAction *m_windowListSeparatorAction;
177 QAction *m_preferencesAction;
178 QAction *m_appFontAction;
180 QPointer<AppFontDialog> m_appFontDialog;
182 QPrinter *m_printer =
nullptr;
186 std::unique_ptr<QMenu> m_recentMenu;
void restoreSettings(const QDesignerSettings &s, const DockWidgetList &dws, const QRect &desktopArea)
DockedMainWindow(QDesignerWorkbench *wb, QMenu *toolBarMenu, const DesignerToolWindowList &toolWindows)
DockWidgetList addToolWindows(const DesignerToolWindowList &toolWindows)
void saveSettings(QDesignerSettings &) const
QMdiSubWindow * createMdiSubWindow(QWidget *fw, Qt::WindowFlags f, const QKeySequence &designerCloseActionShortCut)
QMdiArea * mdiArea() const
void formWindowActivated(QDesignerFormWindow *)
bool event(QEvent *event) override
static QString mainWindowTitle()
CloseEventPolicy closeEventPolicy() const
void closeEvent(QCloseEvent *e) override
This event handler is called with the given event when Qt receives a window close request for a top-l...
static int settingsVersion()
static QList< QToolBar * > createToolBars(const QDesignerActions *actions, bool singleToolBar)
void setCloseEventPolicy(CloseEventPolicy pol)
QActionGroup * helpActions() const
QActionGroup * fileActions() const
QActionGroup * settingsActions() const
QAction * minimizeAction() const
QActionGroup * styleActions() const
~QDesignerActions() override
QActionGroup * editActions() const
QActionGroup * uiMode() const
bool writeOutForm(QDesignerFormWindowInterface *formWindow, const QString &fileName, bool check=true)
QString uiExtension() const
QActionGroup * formActions() const
bool openForm(QWidget *parent)
QDesignerFormEditorInterface * core() const
QActionGroup * toolActions() const
QAction * previewFormAction() const
QActionGroup * windowActions() const
bool readInForm(const QString &fileName)
QAction * closeFormAction() const
void setWindowListSeparatorVisible(bool visible)
bool saveForm(QDesignerFormWindowInterface *fw)
QAction * editWidgets() const
QAction * openFormAction() const
QAction * viewCodeAction() const
QDesignerWorkbench * workbench() const
void helpRequested(const QString &manual, const QString &document)
static const char * defaultToolbarPropertyName
void setBringAllToFrontVisible(bool visible)
QActionGroup * recentFilesActions() const
QByteArray toolBarsState(UIMode mode) const
void saveGeometryFor(const QWidget *w)
QDesignerActions * actionManager() const
Combined button and popup list for selecting options.
Auxiliary methods to store/retrieve settings.
static void addActionsToToolBar(const ActionList &actions, QToolBar *t)
static void addActionsToToolBarManager(const ActionList &al, const QString &title, QtToolBarManager *tbm)
static QToolBar * createToolBar(const QString &title, const QString &objectName, const ActionList &actions)
bool toolBarTitleLessThan(const QToolBar *t1, const QToolBar *t2)