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
widgetbox.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#ifndef WIDGETBOX_H
5#define WIDGETBOX_H
6
8#include <qdesigner_widgetbox_p.h>
9
11
12class QDesignerFormEditorInterface;
13class QDesignerFormWindowInterface;
14
15namespace qdesigner_internal {
16
18
20{
22public:
24 Qt::WindowFlags flags = {});
26
27 QDesignerFormEditorInterface *core() const;
28
29 int categoryCount() const override;
30 Category category(int cat_idx) const override;
31 void addCategory(const Category &cat) override;
32 void removeCategory(int cat_idx) override;
33
34 int widgetCount(int cat_idx) const override;
35 Widget widget(int cat_idx, int wgt_idx) const override;
36 void addWidget(int cat_idx, const Widget &wgt) override;
37 void removeWidget(int cat_idx, int wgt_idx) override;
38
39 void dropWidgets(const QList<QDesignerDnDItemInterface*> &item_list, const QPoint &global_mouse_pos) override;
40
41 void setFileName(const QString &file_name) override;
42 QString fileName() const override;
43 bool load() override;
44 bool save() override;
45
46 bool loadContents(const QString &contents) override;
47 QIcon iconForWidget(const QString &className, const QString &category = QString()) const override;
48
49protected:
50 void dragEnterEvent (QDragEnterEvent * event) override;
51 void dragMoveEvent(QDragMoveEvent * event) override;
52 void dropEvent (QDropEvent * event) override;
53
54private slots:
55 void handleMousePress(const QString &name, const QString &xml, const QPoint &global_mouse_pos);
56
57private:
58 QDesignerFormEditorInterface *m_core;
59 WidgetBoxTreeWidget *m_view;
60};
61
62} // namespace qdesigner_internal
63
64QT_END_NAMESPACE
65
66#endif // 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 QT_WIDGETBOX_EXPORT