1// Copyright (C) 2024 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 QQUICKTABLEVIEWDELEGATE_P_H
5#define QQUICKTABLEVIEWDELEGATE_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 <QtQuickTemplates2/private/qtquicktemplates2global_p.h>
20#include <QtQuickTemplates2/private/qquickitemdelegate_p.h>
21
22QT_BEGIN_NAMESPACE
23
24class QQuickTableView;
25class QQuickTableViewDelegatePrivate;
26
27class Q_QUICKTEMPLATES2_EXPORT QQuickTableViewDelegate : public QQuickItemDelegate
28{
29 Q_OBJECT
30
31 // Required properties
32 Q_PROPERTY(QQuickTableView *tableView READ tableView WRITE setTableView NOTIFY tableViewChanged REQUIRED FINAL)
33 Q_PROPERTY(bool current READ current WRITE setCurrent NOTIFY currentChanged REQUIRED FINAL)
34 Q_PROPERTY(bool selected READ selected WRITE setSelected NOTIFY selectedChanged REQUIRED FINAL)
35 Q_PROPERTY(bool editing READ editing WRITE setEditing NOTIFY editingChanged REQUIRED FINAL)
36
37 QML_NAMED_ELEMENT(TableViewDelegate)
38 QML_ADDED_IN_VERSION(6, 9)
39
40public:
41 explicit QQuickTableViewDelegate(QQuickItem *parent = nullptr);
42
43 bool current() const;
44 void setCurrent(bool current);
45
46 bool selected() const;
47 void setSelected(bool selected);
48
49 bool editing() const;
50 void setEditing(bool editing);
51
52 QQuickTableView *tableView() const;
53 void setTableView(QQuickTableView *tableView);
54
55Q_SIGNALS:
56 void tableViewChanged();
57 void currentChanged();
58 void selectedChanged();
59 void editingChanged();
60
61protected:
62 QQuickTableViewDelegate(QQuickTableViewDelegatePrivate &dd, QQuickItem *parent);
63
64 QFont defaultFont() const override;
65 void mousePressEvent(QMouseEvent *event) override;
66
67private:
68 Q_DISABLE_COPY(QQuickTableViewDelegate)
69 Q_DECLARE_PRIVATE(QQuickTableViewDelegate)
70};
71
72QT_END_NAMESPACE
73
74#endif // QQUICKTABLEVIEWDELEGATE_P_H
75

source code of qtdeclarative/src/quicktemplates/qquicktableviewdelegate_p.h