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 tools applications of the Qt Toolkit.
7**
8** $QT_BEGIN_LICENSE:LGPL$
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 Lesser General Public License Usage
18** Alternatively, this file may be used under the terms of the GNU Lesser
19** General Public License version 3 as published by the Free Software
20** Foundation and appearing in the file LICENSE.LGPL3 included in the
21** packaging of this file. Please review the following information to
22** ensure the GNU Lesser General Public License version 3 requirements
23** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
24**
25** GNU General Public License Usage
26** Alternatively, this file may be used under the terms of the GNU
27** General Public License version 2.0 or (at your option) the GNU General
28** Public license version 3 or any later version approved by the KDE Free
29** Qt Foundation. The licenses are as published by the Free Software
30** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
31** included in the packaging of this file. Please review the following
32** information to ensure the GNU General Public License requirements will
33** be met: https://www.gnu.org/licenses/gpl-2.0.html and
34** https://www.gnu.org/licenses/gpl-3.0.html.
35**
36** $QT_END_LICENSE$
37**
38****************************************************************************/
39
40#ifndef QTEDITORFACTORY_H
41#define QTEDITORFACTORY_H
42
43#include "qtpropertymanager.h"
44
45QT_BEGIN_NAMESPACE
46
47class QtSpinBoxFactoryPrivate;
48
49class QtSpinBoxFactory : public QtAbstractEditorFactory<QtIntPropertyManager>
50{
51 Q_OBJECT
52public:
53 QtSpinBoxFactory(QObject *parent = 0);
54 ~QtSpinBoxFactory();
55protected:
56 void connectPropertyManager(QtIntPropertyManager *manager);
57 QWidget *createEditor(QtIntPropertyManager *manager, QtProperty *property,
58 QWidget *parent);
59 void disconnectPropertyManager(QtIntPropertyManager *manager);
60private:
61 QScopedPointer<QtSpinBoxFactoryPrivate> d_ptr;
62 Q_DECLARE_PRIVATE(QtSpinBoxFactory)
63 Q_DISABLE_COPY_MOVE(QtSpinBoxFactory)
64 Q_PRIVATE_SLOT(d_func(), void slotPropertyChanged(QtProperty *, int))
65 Q_PRIVATE_SLOT(d_func(), void slotRangeChanged(QtProperty *, int, int))
66 Q_PRIVATE_SLOT(d_func(), void slotSingleStepChanged(QtProperty *, int))
67 Q_PRIVATE_SLOT(d_func(), void slotSetValue(int))
68 Q_PRIVATE_SLOT(d_func(), void slotEditorDestroyed(QObject *))
69};
70
71class QtSliderFactoryPrivate;
72
73class QtSliderFactory : public QtAbstractEditorFactory<QtIntPropertyManager>
74{
75 Q_OBJECT
76public:
77 QtSliderFactory(QObject *parent = 0);
78 ~QtSliderFactory();
79protected:
80 void connectPropertyManager(QtIntPropertyManager *manager);
81 QWidget *createEditor(QtIntPropertyManager *manager, QtProperty *property,
82 QWidget *parent);
83 void disconnectPropertyManager(QtIntPropertyManager *manager);
84private:
85 QScopedPointer<QtSliderFactoryPrivate> d_ptr;
86 Q_DECLARE_PRIVATE(QtSliderFactory)
87 Q_DISABLE_COPY_MOVE(QtSliderFactory)
88 Q_PRIVATE_SLOT(d_func(), void slotPropertyChanged(QtProperty *, int))
89 Q_PRIVATE_SLOT(d_func(), void slotRangeChanged(QtProperty *, int, int))
90 Q_PRIVATE_SLOT(d_func(), void slotSingleStepChanged(QtProperty *, int))
91 Q_PRIVATE_SLOT(d_func(), void slotSetValue(int))
92 Q_PRIVATE_SLOT(d_func(), void slotEditorDestroyed(QObject *))
93};
94
95class QtScrollBarFactoryPrivate;
96
97class QtScrollBarFactory : public QtAbstractEditorFactory<QtIntPropertyManager>
98{
99 Q_OBJECT
100public:
101 QtScrollBarFactory(QObject *parent = 0);
102 ~QtScrollBarFactory();
103protected:
104 void connectPropertyManager(QtIntPropertyManager *manager);
105 QWidget *createEditor(QtIntPropertyManager *manager, QtProperty *property,
106 QWidget *parent);
107 void disconnectPropertyManager(QtIntPropertyManager *manager);
108private:
109 QScopedPointer<QtScrollBarFactoryPrivate> d_ptr;
110 Q_DECLARE_PRIVATE(QtScrollBarFactory)
111 Q_DISABLE_COPY_MOVE(QtScrollBarFactory)
112 Q_PRIVATE_SLOT(d_func(), void slotPropertyChanged(QtProperty *, int))
113 Q_PRIVATE_SLOT(d_func(), void slotRangeChanged(QtProperty *, int, int))
114 Q_PRIVATE_SLOT(d_func(), void slotSingleStepChanged(QtProperty *, int))
115 Q_PRIVATE_SLOT(d_func(), void slotSetValue(int))
116 Q_PRIVATE_SLOT(d_func(), void slotEditorDestroyed(QObject *))
117};
118
119class QtCheckBoxFactoryPrivate;
120
121class QtCheckBoxFactory : public QtAbstractEditorFactory<QtBoolPropertyManager>
122{
123 Q_OBJECT
124public:
125 QtCheckBoxFactory(QObject *parent = 0);
126 ~QtCheckBoxFactory();
127protected:
128 void connectPropertyManager(QtBoolPropertyManager *manager);
129 QWidget *createEditor(QtBoolPropertyManager *manager, QtProperty *property,
130 QWidget *parent);
131 void disconnectPropertyManager(QtBoolPropertyManager *manager);
132private:
133 QScopedPointer<QtCheckBoxFactoryPrivate> d_ptr;
134 Q_DECLARE_PRIVATE(QtCheckBoxFactory)
135 Q_DISABLE_COPY_MOVE(QtCheckBoxFactory)
136 Q_PRIVATE_SLOT(d_func(), void slotPropertyChanged(QtProperty *, bool))
137 Q_PRIVATE_SLOT(d_func(), void slotSetValue(bool))
138 Q_PRIVATE_SLOT(d_func(), void slotEditorDestroyed(QObject *))
139};
140
141class QtDoubleSpinBoxFactoryPrivate;
142
143class QtDoubleSpinBoxFactory : public QtAbstractEditorFactory<QtDoublePropertyManager>
144{
145 Q_OBJECT
146public:
147 QtDoubleSpinBoxFactory(QObject *parent = 0);
148 ~QtDoubleSpinBoxFactory();
149protected:
150 void connectPropertyManager(QtDoublePropertyManager *manager);
151 QWidget *createEditor(QtDoublePropertyManager *manager, QtProperty *property,
152 QWidget *parent);
153 void disconnectPropertyManager(QtDoublePropertyManager *manager);
154private:
155 QScopedPointer<QtDoubleSpinBoxFactoryPrivate> d_ptr;
156 Q_DECLARE_PRIVATE(QtDoubleSpinBoxFactory)
157 Q_DISABLE_COPY_MOVE(QtDoubleSpinBoxFactory)
158 Q_PRIVATE_SLOT(d_func(), void slotPropertyChanged(QtProperty *, double))
159 Q_PRIVATE_SLOT(d_func(), void slotRangeChanged(QtProperty *, double, double))
160 Q_PRIVATE_SLOT(d_func(), void slotSingleStepChanged(QtProperty *, double))
161 Q_PRIVATE_SLOT(d_func(), void slotDecimalsChanged(QtProperty *, int))
162 Q_PRIVATE_SLOT(d_func(), void slotSetValue(double))
163 Q_PRIVATE_SLOT(d_func(), void slotEditorDestroyed(QObject *))
164};
165
166class QtLineEditFactoryPrivate;
167
168class QtLineEditFactory : public QtAbstractEditorFactory<QtStringPropertyManager>
169{
170 Q_OBJECT
171public:
172 QtLineEditFactory(QObject *parent = 0);
173 ~QtLineEditFactory();
174protected:
175 void connectPropertyManager(QtStringPropertyManager *manager);
176 QWidget *createEditor(QtStringPropertyManager *manager, QtProperty *property,
177 QWidget *parent);
178 void disconnectPropertyManager(QtStringPropertyManager *manager);
179private:
180 QScopedPointer<QtLineEditFactoryPrivate> d_ptr;
181 Q_DECLARE_PRIVATE(QtLineEditFactory)
182 Q_DISABLE_COPY_MOVE(QtLineEditFactory)
183 Q_PRIVATE_SLOT(d_func(), void slotPropertyChanged(QtProperty *, const QString &))
184 Q_PRIVATE_SLOT(d_func(), void slotRegExpChanged(QtProperty *, const QRegExp &))
185 Q_PRIVATE_SLOT(d_func(), void slotSetValue(const QString &))
186 Q_PRIVATE_SLOT(d_func(), void slotEditorDestroyed(QObject *))
187};
188
189class QtDateEditFactoryPrivate;
190
191class QtDateEditFactory : public QtAbstractEditorFactory<QtDatePropertyManager>
192{
193 Q_OBJECT
194public:
195 QtDateEditFactory(QObject *parent = 0);
196 ~QtDateEditFactory();
197protected:
198 void connectPropertyManager(QtDatePropertyManager *manager);
199 QWidget *createEditor(QtDatePropertyManager *manager, QtProperty *property,
200 QWidget *parent);
201 void disconnectPropertyManager(QtDatePropertyManager *manager);
202private:
203 QScopedPointer<QtDateEditFactoryPrivate> d_ptr;
204 Q_DECLARE_PRIVATE(QtDateEditFactory)
205 Q_DISABLE_COPY_MOVE(QtDateEditFactory)
206 Q_PRIVATE_SLOT(d_func(), void slotPropertyChanged(QtProperty *, const QDate &))
207 Q_PRIVATE_SLOT(d_func(), void slotRangeChanged(QtProperty *,
208 const QDate &, const QDate &))
209 Q_PRIVATE_SLOT(d_func(), void slotSetValue(const QDate &))
210 Q_PRIVATE_SLOT(d_func(), void slotEditorDestroyed(QObject *))
211};
212
213class QtTimeEditFactoryPrivate;
214
215class QtTimeEditFactory : public QtAbstractEditorFactory<QtTimePropertyManager>
216{
217 Q_OBJECT
218public:
219 QtTimeEditFactory(QObject *parent = 0);
220 ~QtTimeEditFactory();
221protected:
222 void connectPropertyManager(QtTimePropertyManager *manager);
223 QWidget *createEditor(QtTimePropertyManager *manager, QtProperty *property,
224 QWidget *parent);
225 void disconnectPropertyManager(QtTimePropertyManager *manager);
226private:
227 QScopedPointer<QtTimeEditFactoryPrivate> d_ptr;
228 Q_DECLARE_PRIVATE(QtTimeEditFactory)
229 Q_DISABLE_COPY_MOVE(QtTimeEditFactory)
230 Q_PRIVATE_SLOT(d_func(), void slotPropertyChanged(QtProperty *, const QTime &))
231 Q_PRIVATE_SLOT(d_func(), void slotSetValue(const QTime &))
232 Q_PRIVATE_SLOT(d_func(), void slotEditorDestroyed(QObject *))
233};
234
235class QtDateTimeEditFactoryPrivate;
236
237class QtDateTimeEditFactory : public QtAbstractEditorFactory<QtDateTimePropertyManager>
238{
239 Q_OBJECT
240public:
241 QtDateTimeEditFactory(QObject *parent = 0);
242 ~QtDateTimeEditFactory();
243protected:
244 void connectPropertyManager(QtDateTimePropertyManager *manager);
245 QWidget *createEditor(QtDateTimePropertyManager *manager, QtProperty *property,
246 QWidget *parent);
247 void disconnectPropertyManager(QtDateTimePropertyManager *manager);
248private:
249 QScopedPointer<QtDateTimeEditFactoryPrivate> d_ptr;
250 Q_DECLARE_PRIVATE(QtDateTimeEditFactory)
251 Q_DISABLE_COPY_MOVE(QtDateTimeEditFactory)
252 Q_PRIVATE_SLOT(d_func(), void slotPropertyChanged(QtProperty *, const QDateTime &))
253 Q_PRIVATE_SLOT(d_func(), void slotSetValue(const QDateTime &))
254 Q_PRIVATE_SLOT(d_func(), void slotEditorDestroyed(QObject *))
255};
256
257class QtKeySequenceEditorFactoryPrivate;
258
259class QtKeySequenceEditorFactory : public QtAbstractEditorFactory<QtKeySequencePropertyManager>
260{
261 Q_OBJECT
262public:
263 QtKeySequenceEditorFactory(QObject *parent = 0);
264 ~QtKeySequenceEditorFactory();
265protected:
266 void connectPropertyManager(QtKeySequencePropertyManager *manager);
267 QWidget *createEditor(QtKeySequencePropertyManager *manager, QtProperty *property,
268 QWidget *parent);
269 void disconnectPropertyManager(QtKeySequencePropertyManager *manager);
270private:
271 QScopedPointer<QtKeySequenceEditorFactoryPrivate> d_ptr;
272 Q_DECLARE_PRIVATE(QtKeySequenceEditorFactory)
273 Q_DISABLE_COPY_MOVE(QtKeySequenceEditorFactory)
274 Q_PRIVATE_SLOT(d_func(), void slotPropertyChanged(QtProperty *, const QKeySequence &))
275 Q_PRIVATE_SLOT(d_func(), void slotSetValue(const QKeySequence &))
276 Q_PRIVATE_SLOT(d_func(), void slotEditorDestroyed(QObject *))
277};
278
279class QtCharEditorFactoryPrivate;
280
281class QtCharEditorFactory : public QtAbstractEditorFactory<QtCharPropertyManager>
282{
283 Q_OBJECT
284public:
285 QtCharEditorFactory(QObject *parent = 0);
286 ~QtCharEditorFactory();
287protected:
288 void connectPropertyManager(QtCharPropertyManager *manager);
289 QWidget *createEditor(QtCharPropertyManager *manager, QtProperty *property,
290 QWidget *parent);
291 void disconnectPropertyManager(QtCharPropertyManager *manager);
292private:
293 QScopedPointer<QtCharEditorFactoryPrivate> d_ptr;
294 Q_DECLARE_PRIVATE(QtCharEditorFactory)
295 Q_DISABLE_COPY_MOVE(QtCharEditorFactory)
296 Q_PRIVATE_SLOT(d_func(), void slotPropertyChanged(QtProperty *, const QChar &))
297 Q_PRIVATE_SLOT(d_func(), void slotSetValue(const QChar &))
298 Q_PRIVATE_SLOT(d_func(), void slotEditorDestroyed(QObject *))
299};
300
301class QtEnumEditorFactoryPrivate;
302
303class QtEnumEditorFactory : public QtAbstractEditorFactory<QtEnumPropertyManager>
304{
305 Q_OBJECT
306public:
307 QtEnumEditorFactory(QObject *parent = 0);
308 ~QtEnumEditorFactory();
309protected:
310 void connectPropertyManager(QtEnumPropertyManager *manager);
311 QWidget *createEditor(QtEnumPropertyManager *manager, QtProperty *property,
312 QWidget *parent);
313 void disconnectPropertyManager(QtEnumPropertyManager *manager);
314private:
315 QScopedPointer<QtEnumEditorFactoryPrivate> d_ptr;
316 Q_DECLARE_PRIVATE(QtEnumEditorFactory)
317 Q_DISABLE_COPY_MOVE(QtEnumEditorFactory)
318 Q_PRIVATE_SLOT(d_func(), void slotPropertyChanged(QtProperty *, int))
319 Q_PRIVATE_SLOT(d_func(), void slotEnumNamesChanged(QtProperty *,
320 const QStringList &))
321 Q_PRIVATE_SLOT(d_func(), void slotEnumIconsChanged(QtProperty *,
322 const QMap<int, QIcon> &))
323 Q_PRIVATE_SLOT(d_func(), void slotSetValue(int))
324 Q_PRIVATE_SLOT(d_func(), void slotEditorDestroyed(QObject *))
325};
326
327class QtCursorEditorFactoryPrivate;
328
329class QtCursorEditorFactory : public QtAbstractEditorFactory<QtCursorPropertyManager>
330{
331 Q_OBJECT
332public:
333 QtCursorEditorFactory(QObject *parent = 0);
334 ~QtCursorEditorFactory();
335protected:
336 void connectPropertyManager(QtCursorPropertyManager *manager);
337 QWidget *createEditor(QtCursorPropertyManager *manager, QtProperty *property,
338 QWidget *parent);
339 void disconnectPropertyManager(QtCursorPropertyManager *manager);
340private:
341 QScopedPointer<QtCursorEditorFactoryPrivate> d_ptr;
342 Q_DECLARE_PRIVATE(QtCursorEditorFactory)
343 Q_DISABLE_COPY_MOVE(QtCursorEditorFactory)
344 Q_PRIVATE_SLOT(d_func(), void slotPropertyChanged(QtProperty *, const QCursor &))
345 Q_PRIVATE_SLOT(d_func(), void slotEnumChanged(QtProperty *, int))
346 Q_PRIVATE_SLOT(d_func(), void slotEditorDestroyed(QObject *))
347};
348
349class QtColorEditorFactoryPrivate;
350
351class QtColorEditorFactory : public QtAbstractEditorFactory<QtColorPropertyManager>
352{
353 Q_OBJECT
354public:
355 QtColorEditorFactory(QObject *parent = 0);
356 ~QtColorEditorFactory();
357protected:
358 void connectPropertyManager(QtColorPropertyManager *manager);
359 QWidget *createEditor(QtColorPropertyManager *manager, QtProperty *property,
360 QWidget *parent);
361 void disconnectPropertyManager(QtColorPropertyManager *manager);
362private:
363 QScopedPointer<QtColorEditorFactoryPrivate> d_ptr;
364 Q_DECLARE_PRIVATE(QtColorEditorFactory)
365 Q_DISABLE_COPY_MOVE(QtColorEditorFactory)
366 Q_PRIVATE_SLOT(d_func(), void slotPropertyChanged(QtProperty *, const QColor &))
367 Q_PRIVATE_SLOT(d_func(), void slotEditorDestroyed(QObject *))
368 Q_PRIVATE_SLOT(d_func(), void slotSetValue(const QColor &))
369};
370
371class QtFontEditorFactoryPrivate;
372
373class QtFontEditorFactory : public QtAbstractEditorFactory<QtFontPropertyManager>
374{
375 Q_OBJECT
376public:
377 QtFontEditorFactory(QObject *parent = 0);
378 ~QtFontEditorFactory();
379protected:
380 void connectPropertyManager(QtFontPropertyManager *manager);
381 QWidget *createEditor(QtFontPropertyManager *manager, QtProperty *property,
382 QWidget *parent);
383 void disconnectPropertyManager(QtFontPropertyManager *manager);
384private:
385 QScopedPointer<QtFontEditorFactoryPrivate> d_ptr;
386 Q_DECLARE_PRIVATE(QtFontEditorFactory)
387 Q_DISABLE_COPY_MOVE(QtFontEditorFactory)
388 Q_PRIVATE_SLOT(d_func(), void slotPropertyChanged(QtProperty *, const QFont &))
389 Q_PRIVATE_SLOT(d_func(), void slotEditorDestroyed(QObject *))
390 Q_PRIVATE_SLOT(d_func(), void slotSetValue(const QFont &))
391};
392
393QT_END_NAMESPACE
394
395#endif
396

source code of qttools/src/shared/qtpropertybrowser/qteditorfactory.h