| 1 | // Copyright (C) 2016 The Qt Company Ltd. |
| 2 | // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only |
| 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 file may change from version to version |
| 10 | // without notice, or even be removed. |
| 11 | // |
| 12 | // We mean it. |
| 13 | // |
| 14 | |
| 15 | #ifndef QTTREEPROPERTYBROWSER_H |
| 16 | #define QTTREEPROPERTYBROWSER_H |
| 17 | |
| 18 | #include "qtpropertybrowser_p.h" |
| 19 | |
| 20 | QT_BEGIN_NAMESPACE |
| 21 | |
| 22 | class QTreeWidgetItem; |
| 23 | class QtTreePropertyBrowserPrivate; |
| 24 | |
| 25 | class QtTreePropertyBrowser : public QtAbstractPropertyBrowser |
| 26 | { |
| 27 | Q_OBJECT |
| 28 | Q_PROPERTY(int indentation READ indentation WRITE setIndentation) |
| 29 | Q_PROPERTY(bool rootIsDecorated READ rootIsDecorated WRITE setRootIsDecorated) |
| 30 | Q_PROPERTY(bool alternatingRowColors READ alternatingRowColors WRITE setAlternatingRowColors) |
| 31 | Q_PROPERTY(bool headerVisible READ isHeaderVisible WRITE setHeaderVisible) |
| 32 | Q_PROPERTY(ResizeMode resizeMode READ resizeMode WRITE setResizeMode) |
| 33 | Q_PROPERTY(int splitterPosition READ splitterPosition WRITE setSplitterPosition) |
| 34 | Q_PROPERTY(bool propertiesWithoutValueMarked READ propertiesWithoutValueMarked WRITE setPropertiesWithoutValueMarked) |
| 35 | public: |
| 36 | enum ResizeMode |
| 37 | { |
| 38 | Interactive, |
| 39 | Stretch, |
| 40 | Fixed, |
| 41 | ResizeToContents |
| 42 | }; |
| 43 | Q_ENUM(ResizeMode) |
| 44 | |
| 45 | QtTreePropertyBrowser(QWidget *parent = 0); |
| 46 | ~QtTreePropertyBrowser(); |
| 47 | |
| 48 | int indentation() const; |
| 49 | void setIndentation(int i); |
| 50 | |
| 51 | bool rootIsDecorated() const; |
| 52 | void setRootIsDecorated(bool show); |
| 53 | |
| 54 | bool alternatingRowColors() const; |
| 55 | void setAlternatingRowColors(bool enable); |
| 56 | |
| 57 | bool () const; |
| 58 | void (bool visible); |
| 59 | |
| 60 | ResizeMode resizeMode() const; |
| 61 | void setResizeMode(ResizeMode mode); |
| 62 | |
| 63 | int splitterPosition() const; |
| 64 | void setSplitterPosition(int position); |
| 65 | |
| 66 | void setExpanded(QtBrowserItem *item, bool expanded); |
| 67 | bool isExpanded(QtBrowserItem *item) const; |
| 68 | |
| 69 | bool isItemVisible(QtBrowserItem *item) const; |
| 70 | void setItemVisible(QtBrowserItem *item, bool visible); |
| 71 | |
| 72 | void setBackgroundColor(QtBrowserItem *item, QColor color); |
| 73 | QColor backgroundColor(QtBrowserItem *item) const; |
| 74 | QColor calculatedBackgroundColor(QtBrowserItem *item) const; |
| 75 | |
| 76 | void setPropertiesWithoutValueMarked(bool mark); |
| 77 | bool propertiesWithoutValueMarked() const; |
| 78 | |
| 79 | void editItem(QtBrowserItem *item); |
| 80 | |
| 81 | Q_SIGNALS: |
| 82 | void collapsed(QtBrowserItem *item); |
| 83 | void expanded(QtBrowserItem *item); |
| 84 | |
| 85 | protected: |
| 86 | void itemInserted(QtBrowserItem *item, QtBrowserItem *afterItem) override; |
| 87 | void itemRemoved(QtBrowserItem *item) override; |
| 88 | void itemChanged(QtBrowserItem *item) override; |
| 89 | |
| 90 | private: |
| 91 | QScopedPointer<QtTreePropertyBrowserPrivate> d_ptr; |
| 92 | Q_DECLARE_PRIVATE(QtTreePropertyBrowser) |
| 93 | Q_DISABLE_COPY_MOVE(QtTreePropertyBrowser) |
| 94 | }; |
| 95 | |
| 96 | QT_END_NAMESPACE |
| 97 | |
| 98 | #endif |
| 99 | |