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_widgetbox_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_WIDGETBOX_H
17
#
define
QDESIGNER_WIDGETBOX_H
18
19
#
include
"shared_global_p.h"
20
#
include
<
QtDesigner
/
abstractwidgetbox
.
h
>
21
22
QT_BEGIN_NAMESPACE
23
24
class
DomUI;
25
26
namespace
qdesigner_internal
{
27
28
// A widget box with a load mode that allows for updating custom widgets.
29
30
class
QDESIGNER_SHARED_EXPORT
QDesignerWidgetBox
:
public
QDesignerWidgetBoxInterface
31
{
32
Q_OBJECT
33
public
:
34
enum
LoadMode
{
LoadMerge
,
LoadReplace
,
LoadCustomWidgetsOnly
};
35
36
explicit
QDesignerWidgetBox
(
QWidget
*
parent
=
nullptr
,
Qt
::
WindowFlags
flags
= {});
37
38
LoadMode
loadMode
()
const
;
39
void
setLoadMode
(
LoadMode
lm
);
40
41
virtual
bool
loadContents
(
const
QString
&
contents
) = 0;
42
43
// Convenience to access the widget box icon of a widget. Empty category
44
// matches all
45
virtual
QIcon
iconForWidget
(
const
QString
&
className
,
46
const
QString
&
category
=
QString
())
const
= 0;
47
48
// Convenience to find a widget by class name. Empty category matches all
49
static
bool
findWidget
(
const
QDesignerWidgetBoxInterface
*
wbox
,
50
const
QString
&
className
,
51
const
QString
&
category
/* = QString() */
,
52
Widget
*
widgetData
);
53
// Convenience functions to create a DomWidget from widget box xml.
54
static
DomUI
*
xmlToUi
(
const
QString
&
name
,
const
QString
&
xml
,
bool
insertFakeTopLevel
,
QString
*
errorMessage
);
55
static
DomUI
*
xmlToUi
(
const
QString
&
name
,
const
QString
&
xml
,
bool
insertFakeTopLevel
);
56
57
private
:
58
LoadMode
m_loadMode
=
LoadMerge
;
59
};
60
}
// namespace qdesigner_internal
61
62
QT_END_NAMESPACE
63
64
#
endif
// QDESIGNER_WIDGETBOX_H
qdesigner_internal::QDesignerWidgetBox
Definition
qdesigner_widgetbox_p.h:31
qdesigner_internal::WidgetBoxTreeWidget
Definition
widgetboxtreewidget.h:30
qdesigner_internal::WidgetBox
Definition
widgetbox.h:21
qdesigner_internal::WidgetBox::loadContents
bool loadContents(const QString &contents) override
Definition
widgetbox.cpp:176
qdesigner_internal::WidgetBox::dropEvent
void dropEvent(QDropEvent *event) override
Definition
widgetbox.cpp:219
qdesigner_internal::WidgetBox::fileName
QString fileName() const override
Returns the name of the XML file \QD is currently using to populate its widget box.
Definition
widgetbox.cpp:166
qdesigner_internal::WidgetBox::widget
Widget widget(int cat_idx, int wgt_idx) const override
Definition
widgetbox.cpp:141
qdesigner_internal::WidgetBox::category
Category category(int cat_idx) const override
Definition
widgetbox.cpp:121
qdesigner_internal::WidgetBox::load
bool load() override
Populates \QD's widget box by loading (or reloading) the currently specified XML file.
Definition
widgetbox.cpp:171
qdesigner_internal::WidgetBox::dragEnterEvent
void dragEnterEvent(QDragEnterEvent *event) override
Definition
widgetbox.cpp:207
qdesigner_internal::WidgetBox::dropWidgets
void dropWidgets(const QList< QDesignerDnDItemInterface * > &item_list, const QPoint &global_mouse_pos) override
Definition
widgetbox.cpp:156
qdesigner_internal::WidgetBox::removeCategory
void removeCategory(int cat_idx) override
Definition
widgetbox.cpp:131
qdesigner_internal::WidgetBox::dragMoveEvent
void dragMoveEvent(QDragMoveEvent *event) override
Definition
widgetbox.cpp:214
qdesigner_internal::WidgetBox::addWidget
void addWidget(int cat_idx, const Widget &wgt) override
Definition
widgetbox.cpp:146
qdesigner_internal::WidgetBox::categoryCount
int categoryCount() const override
Definition
widgetbox.cpp:116
qdesigner_internal::WidgetBox::setFileName
void setFileName(const QString &file_name) override
Sets the XML file that \QD will use to populate its widget box, to fileName.
Definition
widgetbox.cpp:161
qdesigner_internal::WidgetBox::save
bool save() override
Saves the contents of \QD's widget box in the file specified by the fileName() function.
Definition
widgetbox.cpp:181
qdesigner_internal::WidgetBox::addCategory
void addCategory(const Category &cat) override
Definition
widgetbox.cpp:126
qdesigner_internal::WidgetBox::~WidgetBox
~WidgetBox() override
qdesigner_internal::WidgetBox::core
QDesignerFormEditorInterface * core() const
Definition
widgetbox.cpp:98
qdesigner_internal::WidgetBox::widgetCount
int widgetCount(int cat_idx) const override
Definition
widgetbox.cpp:136
qdesigner_internal::WidgetBox::removeWidget
void removeWidget(int cat_idx, int wgt_idx) override
Definition
widgetbox.cpp:151
qdesigner_internal::WidgetBox::iconForWidget
QIcon iconForWidget(const QString &className, const QString &category=QString()) const override
Definition
widgetbox.cpp:229
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
qtMajorVersion
static int qtMajorVersion(int qtVersion)
Definition
qdesigner_components.cpp:109
widgetBoxFileName
static QString widgetBoxFileName(int qtVersion, const QDesignerLanguageExtension *lang=nullptr)
Definition
qdesigner_components.cpp:118
setMinorVersion
static void setMinorVersion(int minorVersion, int *qtVersion)
Definition
qdesigner_components.cpp:111
qtMinorVersion
static int qtMinorVersion(int qtVersion)
Definition
qdesigner_components.cpp:110
QDESIGNER_SHARED_EXPORT
#define QDESIGNER_SHARED_EXPORT
Definition
shared_global_p.h:33
QT_WIDGETBOX_EXPORT
#define QT_WIDGETBOX_EXPORT
Definition
widgetbox_global.h:17
qttools
src
designer
src
lib
shared
qdesigner_widgetbox_p.h
Generated on
for Qt by
1.18.0