Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Loading...
Searching...
No Matches
abstractwidgetdatabase.h
Go to the documentation of this file.
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 ABSTRACTWIDGETDATABASE_H
5#define ABSTRACTWIDGETDATABASE_H
6
7#include <QtDesigner/sdk_global.h>
8
9#include <QtCore/qobject.h>
10#include <QtCore/qlist.h>
11
12QT_BEGIN_NAMESPACE
13
14class QIcon;
15class QString;
16class QDesignerFormEditorInterface;
17class QDebug;
18
20{
21public:
23
26
27 virtual QString name() const = 0;
28 virtual void setName(const QString &name) = 0;
29
30 virtual QString group() const = 0;
31 virtual void setGroup(const QString &group) = 0;
32
33 virtual QString toolTip() const = 0;
34 virtual void setToolTip(const QString &toolTip) = 0;
35
36 virtual QString whatsThis() const = 0;
37 virtual void setWhatsThis(const QString &whatsThis) = 0;
38
39 virtual QString includeFile() const = 0;
40 virtual void setIncludeFile(const QString &includeFile) = 0;
41
42 virtual QIcon icon() const = 0;
43 virtual void setIcon(const QIcon &icon) = 0;
44
45 virtual bool isCompat() const = 0;
46 virtual void setCompat(bool compat) = 0;
47
48 virtual bool isContainer() const = 0;
49 virtual void setContainer(bool container) = 0;
50
51 virtual bool isCustom() const = 0;
52 virtual void setCustom(bool custom) = 0;
53
54 virtual QString pluginPath() const = 0;
55 virtual void setPluginPath(const QString &path) = 0;
56
57 virtual bool isPromoted() const = 0;
58 virtual void setPromoted(bool b) = 0;
59
60 virtual QString extends() const = 0;
61 virtual void setExtends(const QString &s) = 0;
62
63 virtual void setDefaultPropertyValues(const QList<QVariant> &list) = 0;
64 virtual QList<QVariant> defaultPropertyValues() const = 0;
65};
66
67class QDESIGNER_SDK_EXPORT QDesignerWidgetDataBaseInterface: public QObject
68{
69 Q_OBJECT
70public:
71 explicit QDesignerWidgetDataBaseInterface(QObject *parent = nullptr);
72 virtual ~QDesignerWidgetDataBaseInterface();
73
74 virtual int count() const;
75 virtual QDesignerWidgetDataBaseItemInterface *item(int index) const;
76
77 virtual int indexOf(QDesignerWidgetDataBaseItemInterface *item) const;
78 virtual void insert(int index, QDesignerWidgetDataBaseItemInterface *item);
79 virtual void append(QDesignerWidgetDataBaseItemInterface *item);
80
81 virtual int indexOfObject(QObject *object, bool resolveName = true) const;
82 virtual int indexOfClassName(const QString &className, bool resolveName = true) const;
83
84 virtual QDesignerFormEditorInterface *core() const;
85
86 bool isContainer(QObject *object, bool resolveName = true) const;
87 bool isCustom(QObject *object, bool resolveName = true) const;
88
89Q_SIGNALS:
90 void changed();
91
92protected:
93 QList<QDesignerWidgetDataBaseItemInterface *> m_items;
94};
95
96QT_END_NAMESPACE
97
98#endif // ABSTRACTWIDGETDATABASE_H
@ debugAbstractWidgetDataBase
The QDesignerWidgetDataBaseInterface class provides an interface that is used to access and modify \Q...
The QDesignerWidgetDataBaseItemInterface class provides an interface that is used to access individua...
virtual void setContainer(bool container)=0
If container is true, the widget can be used to hold other widgets in \QD; otherwise \QD will refuse ...
virtual void setName(const QString &name)=0
virtual QString whatsThis() const =0
Returns the "What's This?" help for the widget.
virtual void setPromoted(bool b)=0
If promoted is true, the widget is handled as a promoted widget by \QD and will use a placeholder wid...
virtual QString toolTip() const =0
Returns the tool tip to be used by the widget.
virtual bool isCompat() const =0
Returns true if this type of widget is provided for compatibility purposes (e.g.
virtual QList< QVariant > defaultPropertyValues() const =0
Returns a list of default values to be used as properties for the item.
virtual QString pluginPath() const =0
Returns the path to use for the widget plugin.
virtual void setCompat(bool compat)=0
If compat is true, the widget is handled as a compatibility widget; otherwise it is handled normally ...
virtual QString group() const =0
Returns the name of the group that the widget belongs to.
virtual bool isCustom() const =0
Returns true if the widget is a custom widget; otherwise return false if it is a standard Qt widget.
virtual ~QDesignerWidgetDataBaseItemInterface()=default
Destroys the interface.
virtual void setDefaultPropertyValues(const QList< QVariant > &list)=0
Sets the default property values for the widget to the given list.
virtual void setIcon(const QIcon &icon)=0
virtual void setWhatsThis(const QString &whatsThis)=0
virtual QString includeFile() const =0
Returns the name of the include file that the widget needs when being built from source.
virtual QIcon icon() const =0
Returns the icon used to represent the item.
virtual bool isPromoted() const =0
Returns true if the widget is promoted; otherwise returns false.
virtual void setPluginPath(const QString &path)=0
virtual bool isContainer() const =0
Returns true if this widget is intended to be used to hold other widgets; otherwise returns false.
virtual void setIncludeFile(const QString &includeFile)=0
virtual void setGroup(const QString &group)=0
virtual void setExtends(const QString &s)=0
virtual void setCustom(bool custom)=0
If custom is true, the widget is handled specially by \QD; otherwise it is handled as a standard Qt w...
virtual QString extends() const =0
Returns the name of the widget that the item extends.
virtual void setToolTip(const QString &toolTip)=0
virtual QString name() const =0
Returns the name of the widget.
Combined button and popup list for selecting options.