Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Toggle main menu visibility
Loading...
Searching...
No Matches
qdesigneraxwidget.h
Go to the documentation of this file.
1
// Copyright (C) 2016 The Qt Company Ltd.
2
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
3
// Qt-Security score:significant reason:default
4
5
#
ifndef
QACTIVEXPLUGINOBJECT_H
6
#
define
QACTIVEXPLUGINOBJECT_H
7
8
#
include
<
QtCore
/
qpointer
.
h
>
9
#
include
<
QtCore
/
qmap
.
h
>
10
#
include
<
QtWidgets
/
qwidget
.
h
>
11
#
include
<
QtGui
/
qpixmap
.
h
>
12
13
QT_BEGIN_NAMESPACE
14
15
class
QAxWidget;
16
17
/* QDesignerAxWidget aggregates QAxWidget to keep it out of the event loop while applying
18
* properties directly.
19
* Thus, it is possible to set property values in designer that are out of range
20
* for the control, which might cause it to throw exceptions.
21
*
22
* QDesignerAxWidget is the base class following the internal naming
23
* conventions that makes the control property visible to the introspection interface.
24
*
25
* The trick to aggregate a QAxWidget is to overwrite the metaObject() function
26
* generated by moc to return the QMetaObject of QAxWidget. This is what QDesignerAxPluginWidget does. */
27
28
class
QDesignerAxWidget
:
public
QWidget
29
{
30
Q_OBJECT
31
Q_PROPERTY(QString control READ control WRITE setControl RESET resetControl DESIGNABLE
true
)
32
Q_DISABLE_COPY_MOVE
(
QDesignerAxWidget
)
33
34
protected
:
35
explicit
QDesignerAxWidget
(
QWidget
*
parent
);
36
37
public
:
38
virtual
~
QDesignerAxWidget
();
39
40
bool
loadControl
(
const
QString &clsid);
41
42
void
resetControl
();
43
void
setControl
(
const
QString &clsid);
44
QString
control
()
const
;
45
46
QSize
sizeHint
()
const
override
;
47
QSize
minimumSizeHint
()
const
override
;
48
49
bool
loaded
() {
return
(m_axobject != 0); }
50
51
static
QPixmap
widgetIcon
();
52
53
enum
{
DrawIndicator
= 0x1,
DrawFrame
= 0x2,
DrawControl
= 0x4 };
54
55
unsigned
drawFlags
()
const
{
return
m_drawFlags; }
56
void
setDrawFlags
(
unsigned
f) { m_drawFlags = f; }
57
58
protected
:
59
void
paintEvent
(QPaintEvent *event)
override
;
60
QAxWidget *
axobject
()
const
{
return
m_axobject; }
61
62
private
:
63
const
QSize m_defaultSize { 80, 70 };
64
unsigned
m_drawFlags =
DrawIndicator
|
DrawFrame
|
DrawControl
;
65
QAxWidget *m_axobject =
nullptr
;
66
QPixmap m_axImage;
67
};
68
69
class
QDesignerAxPluginWidget
:
public
QDesignerAxWidget
70
{
71
// No Q_OBJECT here! - meta functionality is overridden
72
public
:
73
explicit
QDesignerAxPluginWidget
(QWidget *parent);
74
virtual
~
QDesignerAxPluginWidget
();
75
76
const
QMetaObject
*
metaObject
()
const
override
;
77
int
qt_metacall
(
QMetaObject
::
Call
,
int
,
void
**)
override
;
78
79
private
:
80
QMap<
int
,
bool
> m_propValues;
81
};
82
83
template
<>
inline
QDesignerAxWidget
*qobject_cast<QDesignerAxWidget*>(QObject *o)
84
{
85
if
(!o)
86
return
0;
87
88
// Unloaded state
89
if
(strcmp(o->metaObject()->className(),
"QDesignerAxWidget"
) == 0)
90
return
static_cast
<
QDesignerAxPluginWidget
*>(o);
91
92
// Loaded state with fake meta object
93
if
(strcmp(o->metaObject()->className(),
"QAxWidget"
) == 0)
94
return
static_cast
<
QDesignerAxPluginWidget
*>(o);
95
96
return
0;
97
}
98
99
QT_END_NAMESPACE
100
101
#
endif
// ACTIVEQT_EXTRAINFO_H
QAxWidgetExtraInfoFactory
Definition
qaxwidgetextrainfo.h:40
QAxWidgetExtraInfoFactory::createExtension
QObject * createExtension(QObject *object, const QString &iid, QObject *parent) const override
Creates an extension specified by iid for the given object.
Definition
qaxwidgetextrainfo.cpp:68
QAxWidgetExtraInfo
Definition
qaxwidgetextrainfo.h:19
QAxWidgetExtraInfo::loadWidgetExtraInfo
bool loadWidgetExtraInfo(DomWidget *ui_widget) override
Loads extra information about the specified widget, and returns true if successful; otherwise returns...
Definition
qaxwidgetextrainfo.cpp:58
QAxWidgetExtraInfo::saveWidgetExtraInfo
bool saveWidgetExtraInfo(DomWidget *ui_widget) override
Saves the information about the specified widget, and returns true if successful; otherwise returns f...
Definition
qaxwidgetextrainfo.cpp:39
QAxWidgetExtraInfo::saveUiExtraInfo
bool saveUiExtraInfo(DomUI *ui) override
Saves the information about the user interface specified by ui, and returns true if successful; other...
Definition
qaxwidgetextrainfo.cpp:29
QAxWidgetExtraInfo::core
QDesignerFormEditorInterface * core() const override
\omit
Definition
qaxwidgetextrainfo.cpp:24
QAxWidgetExtraInfo::widget
QWidget * widget() const override
Returns the widget described by this extension.
Definition
qaxwidgetextrainfo.cpp:19
QAxWidgetExtraInfo::loadUiExtraInfo
bool loadUiExtraInfo(DomUI *ui) override
Loads extra information about the user interface specified by ui, and returns true if successful; oth...
Definition
qaxwidgetextrainfo.cpp:34
QAxWidgetPropertySheet
Definition
qaxwidgetpropertysheet.h:25
QAxWidgetPropertySheet::controlPropertyName
static const char * controlPropertyName
Definition
qaxwidgetpropertysheet.h:39
QDesignerAxPluginWidget
Definition
qdesigneraxwidget.h:70
QDesignerAxPluginWidget::QDesignerAxPluginWidget
QDesignerAxPluginWidget(QWidget *parent)
Definition
qdesigneraxwidget.cpp:160
QDesignerAxPluginWidget::metaObject
const QMetaObject * metaObject() const override
Definition
qdesigneraxwidget.cpp:167
QDesignerAxPluginWidget::qt_metacall
int qt_metacall(QMetaObject::Call, int, void **) override
Definition
qdesigneraxwidget.cpp:191
QDesignerAxPluginWidget::~QDesignerAxPluginWidget
virtual ~QDesignerAxPluginWidget()
QDesignerAxWidget
Definition
qdesigneraxwidget.h:29
QDesignerAxWidget::axobject
QAxWidget * axobject() const
Definition
qdesigneraxwidget.h:60
QDesignerAxWidget::resetControl
void resetControl()
Definition
qdesigneraxwidget.cpp:87
QDesignerAxWidget::paintEvent
void paintEvent(QPaintEvent *event) override
This event handler can be reimplemented in a subclass to receive paint events passed in event.
Definition
qdesigneraxwidget.cpp:127
QDesignerAxWidget::control
QString control() const
Definition
qdesigneraxwidget.cpp:70
QDesignerAxWidget::drawFlags
unsigned drawFlags() const
Definition
qdesigneraxwidget.h:55
QDesignerAxWidget::loaded
bool loaded()
Definition
qdesigneraxwidget.h:49
QDesignerAxWidget::minimumSizeHint
QSize minimumSizeHint() const override
Definition
qdesigneraxwidget.cpp:120
QDesignerAxWidget::~QDesignerAxWidget
virtual ~QDesignerAxWidget()
Definition
qdesigneraxwidget.cpp:60
QDesignerAxWidget::loadControl
bool loadControl(const QString &clsid)
Definition
qdesigneraxwidget.cpp:96
QDesignerAxWidget::sizeHint
QSize sizeHint() const override
Definition
qdesigneraxwidget.cpp:113
QDesignerAxWidget::DrawControl
@ DrawControl
Definition
qdesigneraxwidget.h:53
QDesignerAxWidget::DrawIndicator
@ DrawIndicator
Definition
qdesigneraxwidget.h:53
QDesignerAxWidget::DrawFrame
@ DrawFrame
Definition
qdesigneraxwidget.h:53
QDesignerAxWidget::setControl
void setControl(const QString &clsid)
Definition
qdesigneraxwidget.cpp:77
QDesignerAxWidget::setDrawFlags
void setDrawFlags(unsigned f)
Definition
qdesigneraxwidget.h:56
QDesignerAxWidget::widgetIcon
static QPixmap widgetIcon()
Definition
qdesigneraxwidget.cpp:65
QObjectData::parent
QObject * parent
Definition
qobject.h:74
QT_BEGIN_NAMESPACE
Combined button and popup list for selecting options.
Definition
qsequentialanimationgroup.cpp:47
qttools
src
designer
src
plugins
activeqt
qdesigneraxwidget.h
Generated on
for Qt by
1.18.0