Qt
Internal/Contributor docs for the Qt SDK. <b>Note:</b> These are NOT official API docs; those are found <a href='https://doc.qt.io/'>here</a>.
Loading...
Searching...
No Matches
qquicktreeviewdelegate_p.h
Go to the documentation of this file.
1// Copyright (C) 2021 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#ifndef QQUICKTREEVIEWDELEGATE_P_H
5#define QQUICKTREEVIEWDELEGATE_P_H
6
7//
8// W A R N I N G
9// -------------
10//
11// This file is not part of the Qt API. It exists purely as an
12// implementation detail. This header file may change from version to
13// version without notice, or even be removed.
14//
15// We mean it.
16//
17
18#include <QtQuick/qquickitem.h>
19#include <QtQuick/private/qquicktreeview_p.h>
20#include <QtQuickTemplates2/private/qtquicktemplates2global_p.h>
21#include <QtQuickTemplates2/private/qquickitemdelegate_p.h>
22
24
26
27class Q_QUICKTEMPLATES2_EXPORT QQuickTreeViewDelegate : public QQuickItemDelegate
28{
30 Q_PROPERTY(qreal indentation READ indentation WRITE setIndentation NOTIFY indentationChanged FINAL)
31 Q_PROPERTY(qreal leftMargin READ leftMargin WRITE setLeftMargin NOTIFY leftMarginChanged FINAL)
32 Q_PROPERTY(qreal rightMargin READ rightMargin WRITE setRightMargin NOTIFY rightMarginChanged FINAL)
33
34 // Required properties
35 Q_PROPERTY(QQuickTreeView *treeView READ treeView WRITE setTreeView NOTIFY treeviewChanged REQUIRED FINAL)
36 Q_PROPERTY(bool isTreeNode READ isTreeNode WRITE setIsTreeNode NOTIFY isTreeNodeChanged REQUIRED FINAL)
37 Q_PROPERTY(bool hasChildren READ hasChildren WRITE setHasChildren NOTIFY hasChildrenChanged REQUIRED FINAL)
38 Q_PROPERTY(bool expanded READ expanded WRITE setExpanded NOTIFY expandedChanged REQUIRED FINAL)
39 Q_PROPERTY(int depth READ depth WRITE setDepth NOTIFY depthChanged REQUIRED FINAL)
40 Q_PROPERTY(bool current READ current WRITE setCurrent NOTIFY currentChanged REQUIRED FINAL REVISION(6, 4))
41 Q_PROPERTY(bool selected READ selected WRITE setSelected NOTIFY selectedChanged REQUIRED FINAL REVISION(6, 4))
42 Q_PROPERTY(bool editing READ editing WRITE setEditing NOTIFY editingChanged REQUIRED FINAL REVISION(6, 5))
43
44 QML_NAMED_ELEMENT(TreeViewDelegate)
46
47public:
49
50 qreal indentation() const;
51 void setIndentation(qreal indentation);
52
53 bool isTreeNode() const;
54 void setIsTreeNode(bool isTreeNode);
55
56 bool hasChildren() const;
57 void setHasChildren(bool hasChildren);
58
59 bool expanded() const;
60 void setExpanded(bool expanded);
61
62 bool current() const;
63 void setCurrent(bool current);
64
65 bool selected() const;
66 void setSelected(bool selected);
67
68 bool editing() const;
69 void setEditing(bool editing);
70
71 int depth() const;
72 void setDepth(int depth);
73
74 QQuickTreeView *treeView() const;
75 void setTreeView(QQuickTreeView *treeView);
76
77 qreal leftMargin() const;
78 void setLeftMargin(qreal leftMargin);
79
80 qreal rightMargin() const;
81 void setRightMargin(qreal rightMargin);
82
84 void indicatorChanged();
85 void indentationChanged();
86 void isTreeNodeChanged();
87 void hasChildrenChanged();
88 void expandedChanged();
89 void depthChanged();
90 void treeviewChanged();
91 void leftMarginChanged();
92 void rightMarginChanged();
93 Q_REVISION(6, 4) void currentChanged();
94 Q_REVISION(6, 4) void selectedChanged();
95 Q_REVISION(6, 5) void editingChanged();
96
97protected:
98 QFont defaultFont() const override;
99 void geometryChange(const QRectF &newGeometry, const QRectF &oldGeometry) override;
100 void componentComplete() override;
101 void mousePressEvent(QMouseEvent *event) override;
102
103private:
104 Q_DISABLE_COPY(QQuickTreeViewDelegate)
105 Q_DECLARE_PRIVATE(QQuickTreeViewDelegate)
106};
107
109
110#endif // QQUICKTREEVIEWDELEGATE_P_H
\reentrant
Definition qfont.h:22
\inmodule QtGui
Definition qevent.h:196
The QQuickItem class provides the most basic of all visual items in \l {Qt Quick}.
Definition qquickitem.h:63
\inmodule QtCore\reentrant
Definition qrect.h:484
Combined button and popup list for selecting options.
GLint GLenum GLsizei GLsizei GLsizei depth
struct _cl_event * event
#define QML_NAMED_ELEMENT(NAME)
#define QML_ADDED_IN_VERSION(MAJOR, MINOR)
#define Q_PROPERTY(...)
#define Q_OBJECT
#define Q_REVISION(...)
#define Q_SIGNALS
double qreal
Definition qtypes.h:187
#define explicit