Qt 6.x
The Qt SDK
Loading...
Searching...
No Matches
qquickheaderview_p_p.h
Go to the documentation of this file.
1// Copyright (C) 2020 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 QQUICKHEADERVIEW_P_P_H
5#define QQUICKHEADERVIEW_P_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 <QtCore/QAbstractItemModel>
19#include <QtCore/QPointer>
20#if QT_CONFIG(transposeproxymodel)
21#include <QtCore/QTransposeProxyModel>
22#endif
23#include <QtQuick/private/qquicktableview_p_p.h>
24#include <private/qquickheaderview_p.h>
25
27
28class Q_QUICKTEMPLATES2_PRIVATE_EXPORT QHeaderDataProxyModel : public QAbstractItemModel
29{
31 Q_DISABLE_COPY(QHeaderDataProxyModel)
32 Q_PROPERTY(QAbstractItemModel *sourceModel READ sourceModel)
33public:
34 explicit QHeaderDataProxyModel(QObject *parent = nullptr);
36
37 void setSourceModel(QAbstractItemModel *newSourceModel);
38 QPointer<QAbstractItemModel> sourceModel() const;
39 QModelIndex index(int row, int column, const QModelIndex &parent = QModelIndex()) const override;
40 QModelIndex parent(const QModelIndex &child) const override;
41 QModelIndex sibling(int row, int column, const QModelIndex &idx) const override;
42 int rowCount(const QModelIndex &parent = QModelIndex()) const override;
43 int columnCount(const QModelIndex &parent = QModelIndex()) const override;
44 QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const override;
45 bool setData(const QModelIndex &index, const QVariant &value, int role = Qt::EditRole) override;
46 bool hasChildren(const QModelIndex &parent = QModelIndex()) const override;
47
48 inline QVariant variantValue() const;
49 inline Qt::Orientation orientation() const;
50 inline void setOrientation(Qt::Orientation o);
51
52private:
53 inline void connectToModel();
54 inline void disconnectFromModel();
55 QPointer<QAbstractItemModel> m_model = nullptr;
56 Qt::Orientation m_orientation = Qt::Horizontal;
57};
58
60{
61 Q_DECLARE_PUBLIC(QQuickHeaderViewBase)
62public:
65
68 const QPointer<QQuickItem> delegateItemAt(int row, int col) const;
69 QVariant modelImpl() const override;
70 void setModelImpl(const QVariant &newModel) override;
71 void syncModel() override;
72 void syncSyncView() override;
73
74protected:
76#if QT_CONFIG(transposeproxymodel)
77 QTransposeProxyModel m_transposeProxyModel;
78#endif
80 {
83 };
87};
88
90{
91 Q_DECLARE_PUBLIC(QQuickHorizontalHeaderView)
92public:
95};
96
98{
99 Q_DECLARE_PUBLIC(QQuickVerticalHeaderView)
100public:
103};
104
106
107#endif // QQUICKHEADERVIEW_P_P_H
Q_INVOKABLE int const QModelIndex & parent
Returns the parent of the model item with the given index.
virtual Q_INVOKABLE bool hasChildren(const QModelIndex &parent=QModelIndex()) const
Returns {true} if parent has any children; otherwise returns {false}.
virtual Q_INVOKABLE int rowCount(const QModelIndex &parent=QModelIndex()) const =0
Returns the number of rows under the given parent.
virtual Q_INVOKABLE bool setData(const QModelIndex &index, const QVariant &value, int role=Qt::EditRole)
Sets the role data for the item at index to value.
virtual Q_INVOKABLE QModelIndex sibling(int row, int column, const QModelIndex &idx) const
Returns the sibling at row and column for the item at index, or an invalid QModelIndex if there is no...
virtual Q_INVOKABLE int columnCount(const QModelIndex &parent=QModelIndex()) const =0
Returns the number of columns for the children of the given parent.
QHeaderDataProxyModel is a proxy AbstractItemModel type that maps source model's headerData() to corr...
\inmodule QtCore
\inmodule QtCore
Definition qobject.h:90
\inmodule QtCore
Definition qpointer.h:18
QVariant modelImpl() const override
void setModelImpl(const QVariant &newModel) override
QQuickHeaderViewBasePrivate()
\qmltype HorizontalHeaderView \inqmlmodule QtQuick.Controls\inherits TableView
Qt::Orientation orientation() const
const QPointer< QQuickItem > delegateItemAt(int row, int col) const
QHeaderDataProxyModel m_headerDataProxyModel
void setOrientation(Qt::Orientation orientation)
QStack< SectionSize > m_hiddenSectionSizes
\inmodule QtCore
Definition qstack.h:13
\macro QT_RESTRICTED_CAST_FROM_ASCII
Definition qstring.h:127
This proxy transposes the source model.
\inmodule QtCore
Definition qvariant.h:64
Combined button and popup list for selecting options.
Orientation
Definition qnamespace.h:97
@ Horizontal
Definition qnamespace.h:98
@ EditRole
@ DisplayRole
EGLOutputLayerEXT EGLint EGLAttrib value
[5]
GLuint index
[2]
GLint GLsizei GLsizei GLenum GLenum GLsizei void * data
GLenum GLenum GLsizei void GLsizei void * column
GLenum GLenum GLsizei void * row
#define Q_PROPERTY(...)
#define Q_OBJECT
double qreal
Definition qtypes.h:92
QLayoutItem * child
[0]
IUIAutomationTreeWalker __RPC__deref_out_opt IUIAutomationElement ** parent