4#ifndef WIDGETBOXTREEWIDGET_H
5#define WIDGETBOXTREEWIDGET_H
7#include <qdesigner_widgetbox_p.h>
9#include <QtWidgets/qtreewidget.h>
10#include <QtGui/qicon.h>
11#include <QtCore/qlist.h>
12#include <QtCore/qhash.h>
13#include <QtCore/qxmlstream.h>
17class QDesignerFormEditorInterface;
18class QDesignerDnDItemInterface;
37 explicit WidgetBoxTreeWidget(QDesignerFormEditorInterface *core, QWidget *parent =
nullptr);
47 void addWidget(
int cat_idx,
const Widget &wgt);
50 void dropWidgets(
const QList<QDesignerDnDItemInterface*> &item_list);
54 bool load(QDesignerWidgetBox::LoadMode loadMode);
72 void slotScratchPadItemDeleted();
73 void slotLastScratchPadItemDeleted();
75 void handleMousePress(QTreeWidgetItem *item);
76 void deleteScratchpad();
83 void adjustSubListSize(QTreeWidgetItem *cat_item);
85 static bool readCategories(
const QString &fileName,
const QString &xml, CategoryList *cats, QString *errorMessage);
86 static bool readWidget(Widget *w,
const QString &xml, QXmlStreamReader &r);
88 CategoryList loadCustomCategoryList()
const;
89 void writeCategories(QXmlStreamWriter &writer,
const CategoryList &cat_list)
const;
91 int indexOfCategory(
const QString &name)
const;
92 int indexOfScratchpad()
const;
93 int ensureScratchpad();
94 void addCustomCategories(
bool replace);
96 void saveExpandedState()
const;
97 void restoreExpandedState();
98 void updateViewMode();
100 QDesignerFormEditorInterface *m_core;
102 mutable QHash<QString, QIcon> m_pluginIcons;
104 QTimer *m_scratchPadDeleteTimer;
Combined button and popup list for selecting options.
Auxiliary methods to store/retrieve settings.
static const QDesignerMimeData * checkDragEvent(QDropEvent *event, bool acceptEventsFromWidgetBox)