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
widgetfactory_p.h
Go to the documentation of this file.
1
2
3
4
// Copyright (C) 2016 The Qt Company Ltd.
5
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
6
7
//
8
// W A R N I N G
9
// -------------
10
//
11
// This file is not part of the Qt API. It exists for the convenience
12
// of Qt Designer. This header
13
// file may change from version to version without notice, or even be removed.
14
//
15
// We mean it.
16
//
17
18
19
#
ifndef
WIDGETFACTORY_H
20
#
define
WIDGETFACTORY_H
21
22
#
include
"shared_global_p.h"
23
#
include
"pluginmanager_p.h"
24
25
#
include
<
QtDesigner
/
abstractwidgetfactory
.
h
>
26
27
#
include
<
QtCore
/
qmap
.
h
>
28
#
include
<
QtCore
/
qhash
.
h
>
29
#
include
<
QtCore
/
qvariant
.
h
>
30
31
QT_BEGIN_NAMESPACE
32
33
class
QObject;
34
class
QWidget
;
35
class
QLayout;
36
class
QDesignerFormEditorInterface;
37
class
QDesignerCustomWidgetInterface
;
38
class
QDesignerFormWindowInterface;
39
class
QStyle;
40
41
namespace
qdesigner_internal
{
42
43
class
QDESIGNER_SHARED_EXPORT
WidgetFactory
:
public
QDesignerWidgetFactoryInterface
44
{
45
Q_OBJECT
46
public
:
47
explicit
WidgetFactory
(
QDesignerFormEditorInterface
*
core
,
QObject
*
parent
=
nullptr
);
48
~
WidgetFactory
();
49
50
QWidget
*
containerOfWidget
(
QWidget
*
widget
)
const
override
;
51
QWidget
*
widgetOfContainer
(
QWidget
*
widget
)
const
override
;
52
53
QObject
*
createObject
(
const
QString
&
className
,
QObject
*
parent
)
const
;
54
55
QWidget
*
createWidget
(
const
QString
&
className
,
QWidget
*
parentWidget
)
const
override
;
56
QLayout
*
createLayout
(
QWidget
*
widget
,
QLayout
*
layout
,
int
type
)
const
override
;
57
58
bool
isPassiveInteractor
(
QWidget
*
widget
)
override
;
59
void
initialize
(
QObject
*
object
)
const
override
;
60
void
initializeCommon
(
QWidget
*
object
)
const
;
61
void
initializePreview
(
QWidget
*
object
)
const
;
62
63
64
QDesignerFormEditorInterface
*
core
()
const
override
;
65
66
static
QString
classNameOf
(
QDesignerFormEditorInterface
*
core
,
const
QObject
*
o
);
67
68
QDesignerFormWindowInterface
*
currentFormWindow
(
QDesignerFormWindowInterface
*
fw
);
69
70
static
QLayout
*
createUnmanagedLayout
(
QWidget
*
parentWidget
,
int
type
);
71
72
// The widget factory maintains a cache of styles which it owns.
73
QString
styleName
()
const
;
74
void
setStyleName
(
const
QString
&
styleName
);
75
76
/* Return a cached style matching the name or QApplication's style if
77
* it is the default. */
78
QStyle
*
getStyle
(
const
QString
&
styleName
);
79
// Return the current style used by the factory. This either a cached one
80
// or QApplication's style */
81
QStyle
*
style
()
const
;
82
83
// Apply one of the cached styles or QApplication's style to a toplevel widget.
84
void
applyStyleTopLevel
(
const
QString
&
styleName
,
QWidget
*
w
);
85
static
void
applyStyleToTopLevel
(
QStyle
*
style
,
QWidget
*
widget
);
86
87
// Return whether object was created by the factory for the form editor.
88
static
bool
isFormEditorObject
(
const
QObject
*
o
);
89
90
// Boolean dynamic property to set on widgets to prevent custom
91
// styles from interfering
92
static
const
char
*
disableStyleCustomPaintingPropertyC
;
93
94
public
slots
:
95
void
loadPlugins
();
96
void
activeFormWindowChanged
(
QDesignerFormWindowInterface
*
formWindow
);
97
void
formWindowAdded
(
QDesignerFormWindowInterface
*
formWindow
);
98
99
private
:
100
QWidget
*
createCustomWidget
(
const
QString
&
className
,
QWidget
*
parentWidget
,
bool
*
creationError
)
const
;
101
QDesignerFormWindowInterface
*
findFormWindow
(
QWidget
*
parentWidget
)
const
;
102
void
setFormWindowStyle
(
QDesignerFormWindowInterface
*
formWindow
);
103
104
QDesignerFormEditorInterface
*
m_core
;
105
QMap
<
QString
,
QDesignerCustomWidgetInterface
*>
m_customFactory
;
106
QDesignerFormWindowInterface
*
m_formWindow
;
107
108
// Points to the cached style or 0 if the default (qApp) is active
109
QStyle
*
m_currentStyle
;
110
QHash
<
QString
,
QStyle
*>
m_styleCache
;
111
};
112
113
}
// namespace qdesigner_internal
114
115
QT_END_NAMESPACE
116
117
#
endif
// WIDGETFACTORY_H
QDesignerCustomWidgetInterface
Definition
customwidget.h:23
QPainter::QWidget
friend class QWidget
Definition
qpainter.h:421
qdesigner_internal::EmbeddedOptionsControlPrivate
Definition
embeddedoptionspage.cpp:61
qdesigner_internal::EmbeddedOptionsControlPrivate::isDirty
bool isDirty() const
Definition
embeddedoptionspage.cpp:67
qdesigner_internal::EmbeddedOptionsControlPrivate::init
void init(EmbeddedOptionsControl *q)
Definition
embeddedoptionspage.cpp:116
qdesigner_internal::EmbeddedOptionsControlPrivate::slotProfileIndexChanged
void slotProfileIndexChanged(int)
Definition
embeddedoptionspage.cpp:314
qdesigner_internal::EmbeddedOptionsControlPrivate::slotEdit
void slotEdit()
Definition
embeddedoptionspage.cpp:190
qdesigner_internal::EmbeddedOptionsControlPrivate::saveSettings
void saveSettings()
Definition
embeddedoptionspage.cpp:264
qdesigner_internal::EmbeddedOptionsControlPrivate::slotAdd
void slotAdd()
Definition
embeddedoptionspage.cpp:160
qdesigner_internal::EmbeddedOptionsControlPrivate::loadSettings
void loadSettings()
Definition
embeddedoptionspage.cpp:251
qdesigner_internal::EmbeddedOptionsControlPrivate::slotDelete
void slotDelete()
Definition
embeddedoptionspage.cpp:224
qdesigner_internal::EmbeddedOptionsControl
Definition
embeddedoptionspage.h:21
qdesigner_internal::EmbeddedOptionsControl::saveSettings
void saveSettings()
Definition
embeddedoptionspage.cpp:353
qdesigner_internal::EmbeddedOptionsControl::~EmbeddedOptionsControl
~EmbeddedOptionsControl()
Definition
embeddedoptionspage.cpp:328
qdesigner_internal::EmbeddedOptionsControl::isDirty
bool isDirty() const
Definition
embeddedoptionspage.cpp:363
qdesigner_internal::EmbeddedOptionsPage
Definition
embeddedoptionspage.h:48
qdesigner_internal::EmbeddedOptionsPage::createPage
QWidget * createPage(QWidget *parent) override
Definition
embeddedoptionspage.cpp:380
qdesigner_internal::EmbeddedOptionsPage::finish
void finish() override
Definition
embeddedoptionspage.cpp:415
qdesigner_internal::EmbeddedOptionsPage::apply
void apply() override
Definition
embeddedoptionspage.cpp:405
qdesigner_internal::EmbeddedOptionsPage::name
QString name() const override
Definition
embeddedoptionspage.cpp:374
qdesigner_internal::WidgetFactory
Definition
widgetfactory_p.h:44
QT_BEGIN_NAMESPACE
Combined button and popup list for selecting options.
Definition
qstandardpaths_haiku.cpp:21
qdesigner_internal
Auxiliary methods to store/retrieve settings.
Definition
buddyeditor.cpp:66
qdesigner_internal::deviceProfileLessThan
bool deviceProfileLessThan(const DeviceProfile &d1, const DeviceProfile &d2)
Definition
embeddedoptionspage.cpp:45
qdesigner_internal::profileComboIndexOffset
@ profileComboIndexOffset
Definition
embeddedoptionspage.cpp:42
qdesigner_internal::ask
static bool ask(QWidget *parent, QDesignerDialogGuiInterface *dlgui, const QString &title, const QString &what)
Definition
embeddedoptionspage.cpp:50
QDESIGNER_SHARED_EXPORT
#define QDESIGNER_SHARED_EXPORT
Definition
shared_global_p.h:32
qttools
src
designer
src
lib
shared
widgetfactory_p.h
Generated on Sat Sep 21 2024 00:50:19 for Qt by
1.12.0