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
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_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 QHash<int, QByteArray> roleNames() const override;
48
49 inline QVariant variantValue() const;
50 inline Qt::Orientation orientation() const;
51 inline void setOrientation(Qt::Orientation o);
52
53 QQuickHeaderViewBase *m_headerView = nullptr;
54
56 inline void connectToModel();
57 inline void disconnectFromModel();
58 QPointer<QAbstractItemModel> m_model = nullptr;
59 Qt::Orientation m_orientation = Qt::Horizontal;
60};
61
63{
64 Q_DECLARE_PUBLIC(QQuickHeaderViewBase)
65public:
68
69 Qt::Orientation orientation() const;
70 void setOrientation(Qt::Orientation orientation);
71 const QPointer<QQuickItem> delegateItemAt(int row, int col) const;
72 QVariant modelImpl() const override;
73 void setModelImpl(const QVariant &newModel) override;
74 void syncModel() override;
75 void syncSyncView() override;
76 QAbstractItemModel *selectionSourceModel() override;
77
78protected:
80#if QT_CONFIG(transposeproxymodel)
81 QTransposeProxyModel m_transposeProxyModel;
82#endif
88 QStack<SectionSize> m_hiddenSectionSizes;
89 bool m_modelExplicitlySetByUser = false;
91};
92
100
108
110
111#endif // QQUICKHEADERVIEW_P_P_H
\inmodule QtCore
Definition qbytearray.h:57
\inmodule QtCore
Definition qhash.h:820
QHeaderDataProxyModel is a proxy AbstractItemModel type that maps source model's headerData() to corr...
\inmodule QtCore
\inmodule QtCore
Definition qobject.h:103
QHeaderDataProxyModel m_headerDataProxyModel
QStack< SectionSize > m_hiddenSectionSizes
\macro QT_RESTRICTED_CAST_FROM_ASCII
Definition qstring.h:129
This proxy transposes the source model.
\inmodule QtCore
Definition qvariant.h:65
Combined button and popup list for selecting options.
Definition qcompare.h:63
Orientation
Definition qnamespace.h:98
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:187
#define explicit
mimeData setData("text/csv", csvData)
QLayoutItem * child
[0]