1 | // Copyright (C) 2016 The Qt Company Ltd. |
---|---|
2 | // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 |
3 | |
4 | #ifndef NEWFORM_H |
5 | #define NEWFORM_H |
6 | |
7 | #include <QtWidgets/qdialog.h> |
8 | |
9 | QT_BEGIN_NAMESPACE |
10 | |
11 | namespace qdesigner_internal { |
12 | class DeviceProfile; |
13 | } |
14 | |
15 | class QDesignerFormEditorInterface; |
16 | class QDesignerNewFormWidgetInterface; |
17 | class QDesignerWorkbench; |
18 | |
19 | class QCheckBox; |
20 | class QAbstractButton; |
21 | class QPushButton; |
22 | class QDialogButtonBox; |
23 | class QImage; |
24 | class QIODevice; |
25 | |
26 | class NewForm: public QDialog |
27 | { |
28 | Q_OBJECT |
29 | Q_DISABLE_COPY_MOVE(NewForm) |
30 | |
31 | public: |
32 | NewForm(QDesignerWorkbench *workbench, |
33 | QWidget *parentWidget, |
34 | // Use that file name instead of a temporary one |
35 | const QString &fileName = QString()); |
36 | |
37 | ~NewForm() override; |
38 | |
39 | // Convenience for implementing file dialogs with preview |
40 | static QImage grabForm(QDesignerFormEditorInterface *core, |
41 | QIODevice &file, |
42 | const QString &workingDir, |
43 | const qdesigner_internal::DeviceProfile &dp); |
44 | |
45 | private slots: |
46 | void slotButtonBoxClicked(QAbstractButton *btn); |
47 | void recentFileChosen(); |
48 | void slotCurrentTemplateChanged(bool templateSelected); |
49 | void slotTemplateActivated(); |
50 | |
51 | private: |
52 | QDialogButtonBox *createButtonBox(); |
53 | bool openTemplate(QString *ptrToErrorMessage); |
54 | |
55 | QString m_fileName; |
56 | QDesignerNewFormWidgetInterface *m_newFormWidget; |
57 | QDesignerWorkbench *m_workbench; |
58 | QCheckBox *m_chkShowOnStartup; |
59 | QPushButton *m_createButton; |
60 | QPushButton *m_recentButton; |
61 | QDialogButtonBox *m_buttonBox; |
62 | }; |
63 | |
64 | QT_END_NAMESPACE |
65 | |
66 | #endif // NEWFORM_H |
67 |