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 | #ifndef INPLACE_EDITOR_H |
30 | #define INPLACE_EDITOR_H |
31 | |
32 | #include <textpropertyeditor_p.h> |
33 | #include <shared_enums_p.h> |
34 | |
35 | #include "inplace_widget_helper.h" |
36 | #include <qdesigner_utils_p.h> |
37 | |
38 | #include <QtCore/qpointer.h> |
39 | |
40 | QT_BEGIN_NAMESPACE |
41 | |
42 | |
43 | class QDesignerFormWindowInterface; |
44 | |
45 | namespace qdesigner_internal { |
46 | |
47 | class InPlaceEditor: public TextPropertyEditor |
48 | { |
49 | Q_OBJECT |
50 | public: |
51 | InPlaceEditor(QWidget *widget, |
52 | TextPropertyValidationMode validationMode, |
53 | QDesignerFormWindowInterface *fw, |
54 | const QString& text, |
55 | const QRect& r); |
56 | private: |
57 | InPlaceWidgetHelper m_InPlaceWidgetHelper; |
58 | }; |
59 | |
60 | // Base class for inline editor helpers to be embedded into a task menu. |
61 | // Inline-edits a property on a multi-selection. |
62 | // To use it for a particular widget/property, overwrite the method |
63 | // returning the edit area. |
64 | |
65 | class : public QObject { |
66 | (const TaskMenuInlineEditor&); |
67 | TaskMenuInlineEditor &(const TaskMenuInlineEditor&); |
68 | Q_OBJECT |
69 | |
70 | public slots: |
71 | void (); |
72 | |
73 | private slots: |
74 | void (const QString &text); |
75 | void (); |
76 | |
77 | protected: |
78 | (QWidget *w, TextPropertyValidationMode vm, const QString &property, QObject *parent); |
79 | // Overwrite to return the area for the inline editor. |
80 | virtual QRect () const = 0; |
81 | QWidget *() const { return m_widget; } |
82 | |
83 | private: |
84 | const TextPropertyValidationMode ; |
85 | const QString ; |
86 | QWidget *; |
87 | QPointer<QDesignerFormWindowInterface> ; |
88 | QPointer<InPlaceEditor> ; |
89 | bool ; |
90 | qdesigner_internal::PropertySheetStringValue ; |
91 | }; |
92 | |
93 | } // namespace qdesigner_internal |
94 | |
95 | QT_END_NAMESPACE |
96 | |
97 | #endif // INPLACE_EDITOR_H |
98 | |