1 | /**************************************************************************** |
2 | ** |
3 | ** Copyright (C) 2016 The Qt Company Ltd. |
4 | ** Contact: https://www.qt.io/licensing/ |
5 | ** |
6 | ** This file is part of the Qt Designer of the Qt Toolkit. |
7 | ** |
8 | ** $QT_BEGIN_LICENSE:GPL-EXCEPT$ |
9 | ** Commercial License Usage |
10 | ** Licensees holding valid commercial Qt licenses may use this file in |
11 | ** accordance with the commercial license agreement provided with the |
12 | ** Software or, alternatively, in accordance with the terms contained in |
13 | ** a written agreement between you and The Qt Company. For licensing terms |
14 | ** and conditions see https://www.qt.io/terms-conditions. For further |
15 | ** information use the contact form at https://www.qt.io/contact-us. |
16 | ** |
17 | ** GNU General Public License Usage |
18 | ** Alternatively, this file may be used under the terms of the GNU |
19 | ** General Public License version 3 as published by the Free Software |
20 | ** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT |
21 | ** included in the packaging of this file. Please review the following |
22 | ** information to ensure the GNU General Public License requirements will |
23 | ** be met: https://www.gnu.org/licenses/gpl-3.0.html. |
24 | ** |
25 | ** $QT_END_LICENSE$ |
26 | ** |
27 | ****************************************************************************/ |
28 | |
29 | // |
30 | // W A R N I N G |
31 | // ------------- |
32 | // |
33 | // This file is not part of the Qt API. It exists for the convenience |
34 | // of Qt Designer. This header |
35 | // file may change from version to version without notice, or even be removed. |
36 | // |
37 | // We mean it. |
38 | // |
39 | |
40 | #ifndef PROMOTIONTASKMENU_H |
41 | #define |
42 | |
43 | #include "shared_global_p.h" |
44 | |
45 | #include <QtCore/qobject.h> |
46 | #include <QtCore/qpointer.h> |
47 | #include <QtCore/qlist.h> |
48 | #include <QtCore/qvector.h> |
49 | |
50 | QT_BEGIN_NAMESPACE |
51 | |
52 | class QDesignerFormWindowInterface; |
53 | class QDesignerFormEditorInterface; |
54 | |
55 | class QAction; |
56 | class ; |
57 | class QWidget; |
58 | |
59 | namespace qdesigner_internal { |
60 | |
61 | // A helper class for creating promotion context menus and handling promotion actions. |
62 | |
63 | class QDESIGNER_SHARED_EXPORT : public QObject |
64 | { |
65 | Q_OBJECT |
66 | public: |
67 | enum { |
68 | , |
69 | , |
70 | |
71 | }; |
72 | |
73 | explicit (QWidget *widget,Mode mode = ModeManagedMultiSelection, QObject *parent = nullptr); |
74 | |
75 | Mode () const; |
76 | void (Mode m); |
77 | |
78 | void (QWidget *widget); |
79 | |
80 | // Set menu labels |
81 | void (const QString &promoteLabel); |
82 | void (const QString &promoteEditLabel); |
83 | // Defaults to "Demote to %1".arg(class). |
84 | void (const QString &demoteLabel); |
85 | |
86 | using = QList<QAction *>; |
87 | |
88 | enum { = 1, = 2, = 4}; |
89 | |
90 | // Adds a list of promotion actions according to the current promotion state of the widget. |
91 | void (QDesignerFormWindowInterface *fw, unsigned flags, ActionList &actionList); |
92 | // Convenience that finds the form window. |
93 | void (unsigned flags, ActionList &actionList); |
94 | |
95 | void (QDesignerFormWindowInterface *fw, unsigned flags, QMenu *); |
96 | void (unsigned flags, QMenu *); |
97 | |
98 | // Pop up the editor in a global context. |
99 | static void (QDesignerFormEditorInterface *core, QWidget* parent); |
100 | |
101 | private slots: |
102 | void (const QString &customClassName); |
103 | void (); |
104 | void (); |
105 | void (); |
106 | void (); |
107 | |
108 | private: |
109 | void (QDesignerFormWindowInterface *fw, const QString &customClassName); |
110 | |
111 | enum { , , , CanDemote }; |
112 | PromotionState (QDesignerFormWindowInterface *formWindow); |
113 | QDesignerFormWindowInterface *() const; |
114 | |
115 | using = QVector<QPointer<QWidget> >; |
116 | PromotionSelectionList (QDesignerFormWindowInterface *formWindow) const; |
117 | |
118 | Mode ; |
119 | |
120 | QPointer<QWidget> ; |
121 | |
122 | // Per-Widget actions |
123 | QList<QAction *> ; |
124 | |
125 | QAction *; |
126 | QAction *; |
127 | QAction *; |
128 | |
129 | QString ; |
130 | QString ; |
131 | }; |
132 | |
133 | } // namespace qdesigner_internal |
134 | |
135 | QT_END_NAMESPACE |
136 | |
137 | #endif // PROMOTIONTASKMENU_H |
138 | |