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
treewidgeteditor.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 TREEWIDGETEDITOR_H
5#define TREEWIDGETEDITOR_H
6
7#include "ui_treewidgeteditor.h"
8
10
11#include <QtWidgets/qdialog.h>
12
14
15class QTreeWidget;
16class QDesignerFormWindowInterface;
17
18namespace qdesigner_internal {
19
20class FormWindowBase;
21class PropertySheetIconValue;
22
24{
26public:
28
29 TreeWidgetContents fillContentsFromTreeWidget(QTreeWidget *treeWidget);
31
32private slots:
34 void newSubItemButtonClicked();
35 void deleteItemButtonClicked();
36 void moveItemUpButtonClicked();
37 void moveItemDownButtonClicked();
38 void moveItemRightButtonClicked();
39 void moveItemLeftButtonClicked();
40
41 void treeWidgetCurrentItemChanged();
42 void treeWidgetItemChanged(QTreeWidgetItem *item, int column);
43
44 void columnEditorIndexChanged(int idx);
45 void columnEditorItemChanged(int idx, int role, const QVariant &v);
46
47 void columnEditorItemInserted(int idx);
48 void columnEditorItemDeleted(int idx);
49 void columnEditorItemMovedUp(int idx);
50 void columnEditorItemMovedDown(int idx);
51
52 void togglePropertyBrowser();
53 void cacheReloaded();
54
55protected:
56 void setItemData(int role, const QVariant &v) override;
57 QVariant getItemData(int role) const override;
58 int defaultItemFlags() const override;
59
60private:
61 void setPropertyBrowserVisible(bool v);
62 QtVariantProperty *setupPropertyGroup(const QString &title, PropertyDefinition *propDefs);
63 void updateEditor();
64 void moveColumnItems(const PropertyDefinition *propList, QTreeWidgetItem *item, int fromColumn, int toColumn, int step);
65 void moveColumns(int fromColumn, int toColumn, int step);
66 void moveColumnsLeft(int fromColumn, int toColumn);
67 void moveColumnsRight(int fromColumn, int toColumn);
68 void closeEditors();
69
70 Ui::TreeWidgetEditor ui;
71 ItemListEditor *m_columnEditor;
72 bool m_updatingBrowser;
73};
74
76{
78public:
80
81 TreeWidgetContents fillContentsFromTreeWidget(QTreeWidget *treeWidget);
83
84private:
85 TreeWidgetEditor m_editor;
86};
87
88} // namespace qdesigner_internal
89
90QT_END_NAMESPACE
91
92#endif // TREEWIDGETEDITOR_H
The QtVariantProperty class is a convenience class handling QVariant based properties.
TreeWidgetContents fillContentsFromTreeWidget(QTreeWidget *treeWidget)
TreeWidgetContents fillContentsFromTreeWidget(QTreeWidget *treeWidget)
void setItemData(int role, const QVariant &v) override
QVariant getItemData(int role) const override
QAction * preferredEditAction() const override
QList< QAction * > taskActions() const override
Combined button and popup list for selecting options.
Auxiliary methods to store/retrieve settings.