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
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
20#include <QtDesigner/abstractwidgetbox.h>
21
23
24class DomUI;
25
26namespace qdesigner_internal {
27
28// A widget box with a load mode that allows for updating custom widgets.
29
31{
33public:
35
36 explicit QDesignerWidgetBox(QWidget *parent = nullptr, Qt::WindowFlags flags = {});
37
38 LoadMode loadMode() const;
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
46 const QString &category = QString()) const = 0;
47
48 // Convenience to find a widget by class name. Empty category matches all
50 const QString &className,
51 const QString &category /* = QString() */,
53 // Convenience functions to create a DomWidget from widget box xml.
55 static DomUI *xmlToUi(const QString &name, const QString &xml, bool insertFakeTopLevel);
56
57private:
59};
60} // namespace qdesigner_internal
61
62QT_END_NAMESPACE
63
64#endif // QDESIGNER_WIDGETBOX_H
bool loadContents(const QString &contents) override
void dropEvent(QDropEvent *event) override
QString fileName() const override
Returns the name of the XML file \QD is currently using to populate its widget box.
Widget widget(int cat_idx, int wgt_idx) const override
Category category(int cat_idx) const override
bool load() override
Populates \QD's widget box by loading (or reloading) the currently specified XML file.
void dragEnterEvent(QDragEnterEvent *event) override
void dropWidgets(const QList< QDesignerDnDItemInterface * > &item_list, const QPoint &global_mouse_pos) override
void removeCategory(int cat_idx) override
void dragMoveEvent(QDragMoveEvent *event) override
void addWidget(int cat_idx, const Widget &wgt) override
int categoryCount() const override
void setFileName(const QString &file_name) override
Sets the XML file that \QD will use to populate its widget box, to fileName.
bool save() override
Saves the contents of \QD's widget box in the file specified by the fileName() function.
void addCategory(const Category &cat) override
QDesignerFormEditorInterface * core() const
Definition widgetbox.cpp:98
int widgetCount(int cat_idx) const override
void removeWidget(int cat_idx, int wgt_idx) override
QIcon iconForWidget(const QString &className, const QString &category=QString()) const override
Combined button and popup list for selecting options.
Auxiliary methods to store/retrieve settings.
static int qtMajorVersion(int qtVersion)
static QString widgetBoxFileName(int qtVersion, const QDesignerLanguageExtension *lang=nullptr)
static void setMinorVersion(int minorVersion, int *qtVersion)
static int qtMinorVersion(int qtVersion)
#define QDESIGNER_SHARED_EXPORT
#define QT_WIDGETBOX_EXPORT