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
4//
5// W A R N I N G
6// -------------
7//
8// This file is not part of the Qt API. It exists for the convenience
9// of Qt Designer. This header
10// file may change from version to version without notice, or even be removed.
11//
12// We mean it.
13//
14
15#ifndef QDESIGNER_WIDGETBOX_H
16#define QDESIGNER_WIDGETBOX_H
17
19#include <QtDesigner/abstractwidgetbox.h>
20
22
23class DomUI;
24
25namespace qdesigner_internal {
26
27// A widget box with a load mode that allows for updating custom widgets.
28
30{
32public:
34
35 explicit QDesignerWidgetBox(QWidget *parent = nullptr, Qt::WindowFlags flags = {});
36
37 LoadMode loadMode() const;
39
40 virtual bool loadContents(const QString &contents) = 0;
41
42 // Convenience to access the widget box icon of a widget. Empty category
43 // matches all
45 const QString &category = QString()) const = 0;
46
47 // Convenience to find a widget by class name. Empty category matches all
49 const QString &className,
50 const QString &category /* = QString() */,
52 // Convenience functions to create a DomWidget from widget box xml.
54 static DomUI *xmlToUi(const QString &name, const QString &xml, bool insertFakeTopLevel);
55
56private:
58};
59} // namespace qdesigner_internal
60
61QT_END_NAMESPACE
62
63#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:97
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.
#define INIT_PLUGIN_INSTANCE(PLUGIN)
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