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
qdesigner_formbuilder_p.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
// Qt-Security score:significant reason:default
4
5
//
6
// W A R N I N G
7
// -------------
8
//
9
// This file is not part of the Qt API. It exists for the convenience
10
// of Qt Designer. This header
11
// file may change from version to version without notice, or even be removed.
12
//
13
// We mean it.
14
//
15
16
#
ifndef
QDESIGNER_FORMBUILDER_H
17
#
define
QDESIGNER_FORMBUILDER_H
18
19
#
include
"shared_global_p.h"
20
#
include
"deviceprofile_p.h"
21
#
include
"qdesigner_utils_p.h"
22
23
#
include
<
QtDesigner
/
formbuilder
.
h
>
24
25
#
include
<
QtCore
/
qmap
.
h
>
26
#
include
<
QtCore
/
qset
.
h
>
27
28
QT_BEGIN_NAMESPACE
29
30
class
QDesignerFormEditorInterface;
31
class
QDesignerFormWindowInterface;
32
33
class
QPixmap;
34
class
QtResourceSet;
35
36
namespace
qdesigner_internal
{
37
38
/* Form builder used for previewing forms and widget box.
39
* It applies the system settings to its toplevel window. */
40
41
class
QDESIGNER_SHARED_EXPORT
QDesignerFormBuilder
:
public
QFormBuilder
42
{
43
public
:
44
QDesignerFormBuilder
(
QDesignerFormEditorInterface
*
core
,
45
const
DeviceProfile
&
deviceProfile
=
DeviceProfile
());
46
47
virtual
QWidget
*
createWidget
(
DomWidget
*
ui_widget
,
QWidget
*
parentWidget
=
nullptr
)
48
{
return
QFormBuilder
::
create
(
ui_widget
,
parentWidget
); }
49
50
QDesignerFormEditorInterface
*
core
()
const
{
return
m_core
; }
51
52
QString
systemStyle
()
const
;
53
54
// Create a preview widget (for integrations) or return 0. The widget has to be embedded into a main window.
55
// Experimental, depending on script support.
56
static
QWidget
*
createPreview
(
const
QDesignerFormWindowInterface
*
fw
,
const
QString
&
styleName
/* ="" */
,
57
const
QString
&
appStyleSheet
/* ="" */
,
58
const
DeviceProfile
&
deviceProfile
,
59
QString
*
errorMessage
);
60
// Convenience that pops up message boxes in case of failures.
61
static
QWidget
*
createPreview
(
const
QDesignerFormWindowInterface
*
fw
,
const
QString
&
styleName
=
QString
());
62
// Create a preview widget (for integrations) or return 0. The widget has to be embedded into a main window.
63
static
QWidget
*
createPreview
(
const
QDesignerFormWindowInterface
*
fw
,
const
QString
&
styleName
,
const
QString
&
appStyleSheet
,
QString
*
errorMessage
);
64
// Convenience that pops up message boxes in case of failures.
65
static
QWidget
*
createPreview
(
const
QDesignerFormWindowInterface
*
fw
,
const
QString
&
styleName
,
const
QString
&
appStyleSheet
);
66
67
// Create a preview image
68
static
QPixmap
createPreviewPixmap
(
const
QDesignerFormWindowInterface
*
fw
,
const
QString
&
styleName
=
QString
(),
const
QString
&
appStyleSheet
=
QString
());
69
70
protected
:
71
using
QFormBuilder
::
createDom
;
72
using
QFormBuilder
::
create
;
73
74
QWidget
*
create
(
DomUI
*
ui
,
QWidget
*
parentWidget
)
override
;
75
DomWidget
*
createDom
(
QWidget
*
widget
,
DomWidget
*
ui_parentWidget
,
bool
recursive
=
true
)
override
;
76
QWidget
*
create
(
DomWidget
*
ui_widget
,
QWidget
*
parentWidget
)
override
;
77
QLayout
*
create
(
DomLayout
*
ui_layout
,
QLayout
*
layout
,
QWidget
*
parentWidget
)
override
;
78
void
createResources
(
DomResources
*
resources
)
override
;
79
80
QWidget
*
createWidget
(
const
QString
&
widgetName
,
QWidget
*
parentWidget
,
const
QString
&
name
)
override
;
81
bool
addItem
(
DomWidget
*
ui_widget
,
QWidget
*
widget
,
QWidget
*
parentWidget
)
override
;
82
bool
addItem
(
DomLayoutItem
*
ui_item
,
QLayoutItem
*
item
,
QLayout
*
layout
)
override
;
83
84
virtual
QIcon
nameToIcon
(
const
QString
&
filePath
,
const
QString
&
qrcPath
);
85
virtual
QPixmap
nameToPixmap
(
const
QString
&
filePath
,
const
QString
&
qrcPath
);
86
87
void
applyProperties
(
QObject
*
o
,
const
QList
<
DomProperty
*> &
properties
)
override
;
88
89
void
loadExtraInfo
(
DomWidget
*
ui_widget
,
QWidget
*
widget
,
QWidget
*
parentWidget
)
override
;
90
91
QtResourceSet
*
internalResourceSet
()
const
{
return
m_tempResourceSet
; }
92
93
DeviceProfile
deviceProfile
()
const
{
return
m_deviceProfile
; }
94
95
private
:
96
QDesignerFormEditorInterface
*
m_core
;
97
98
using
WidgetSet
=
QSet
<
QWidget
*>;
99
WidgetSet
m_customWidgetsWithScript
;
100
101
const
DeviceProfile
m_deviceProfile
;
102
103
DesignerPixmapCache
m_pixmapCache
;
104
DesignerIconCache
m_iconCache
;
105
bool
m_ignoreCreateResources
;
106
QtResourceSet
*
m_tempResourceSet
;
107
bool
m_mainWidget
;
108
};
109
110
// Form builder for a new form widget (preview). To allow for promoted
111
// widgets in the template, it implements the handling of custom widgets
112
// (adding of them to the widget database).
113
114
class
QDESIGNER_SHARED_EXPORT
NewFormWidgetFormBuilder
:
public
QDesignerFormBuilder
{
115
public
:
116
NewFormWidgetFormBuilder
(
QDesignerFormEditorInterface
*
core
,
117
const
DeviceProfile
&
deviceProfile
=
DeviceProfile
());
118
119
protected
:
120
void
createCustomWidgets
(
DomCustomWidgets
*)
override
;
121
};
122
123
124
}
// namespace qdesigner_internal
125
126
QT_END_NAMESPACE
127
128
#
endif
// QDESIGNER_FORMBUILDER_H
QPainter::QWidget
friend class QWidget
Definition
qpainter.h:432
qdesigner_internal::NewFormWidgetFormBuilder
Definition
qdesigner_formbuilder_p.h:114
qdesigner_internal::QDesignerFormBuilder
Definition
qdesigner_formbuilder_p.h:42
qdesigner_internal::WidgetBoxDnDItem
Definition
widgetbox_dnditem.h:19
qdesigner_internal::WidgetBoxDnDItem::WidgetBoxDnDItem
WidgetBoxDnDItem(QDesignerFormEditorInterface *core, DomUI *dom_ui, const QPoint &global_mouse_pos)
Definition
widgetbox_dnditem.cpp:180
qdesigner_internal::WidgetBoxResource
Definition
widgetbox_dnditem.cpp:42
qdesigner_internal::WidgetBoxResource::createWidget
QWidget * createWidget(const QString &widgetName, QWidget *parentWidget, const QString &name) override
Definition
widgetbox_dnditem.cpp:62
qdesigner_internal::WidgetBoxResource::createCustomWidgets
void createCustomWidgets(DomCustomWidgets *) override
Definition
widgetbox_dnditem.cpp:90
qdesigner_internal::WidgetBoxResource::create
QWidget * create(DomWidget *ui_widget, QWidget *parents) override
Definition
widgetbox_dnditem.cpp:73
qdesigner_internal::WidgetBoxResource::createUI
QWidget * createUI(DomUI *ui, QWidget *parents)
Definition
widgetbox_dnditem.cpp:47
qdesigner_internal::WidgetBoxResource::WidgetBoxResource
WidgetBoxResource(QDesignerFormEditorInterface *core)
Definition
widgetbox_dnditem.cpp:56
QT_BEGIN_NAMESPACE
Combined button and popup list for selecting options.
Definition
qsequentialanimationgroup.cpp:47
qdesigner_internal
Auxiliary methods to store/retrieve settings.
Definition
buddyeditor.cpp:67
qdesigner_internal::currentDeviceProfile
static DeviceProfile currentDeviceProfile(const QDesignerFormEditorInterface *core)
Definition
widgetbox_dnditem.cpp:33
qdesigner_internal::geometryProp
static QSize geometryProp(const DomWidget *dw)
Definition
widgetbox_dnditem.cpp:102
qdesigner_internal::decorationFromDomWidget
static QWidget * decorationFromDomWidget(DomUI *dom_ui, QDesignerFormEditorInterface *core)
Definition
widgetbox_dnditem.cpp:145
qdesigner_internal::domWidgetSize
static QSize domWidgetSize(const DomWidget *dw)
Definition
widgetbox_dnditem.cpp:116
QDESIGNER_SHARED_EXPORT
#define QDESIGNER_SHARED_EXPORT
Definition
shared_global_p.h:33
qttools
src
designer
src
lib
shared
qdesigner_formbuilder_p.h
Generated on
for Qt by
1.18.0