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
qquickgridview_p.h
Go to the documentation of this file.
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#ifndef QQUICKGRIDVIEW_P_H
5#define QQUICKGRIDVIEW_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/private/qtquickglobal_p.h>
19
20QT_REQUIRE_CONFIG(quick_gridview);
21
22#include "qquickitemview_p.h"
23
25
28class Q_QUICK_EXPORT QQuickGridView : public QQuickItemView
29{
31 Q_DECLARE_PRIVATE(QQuickGridView)
32
33 Q_PROPERTY(Flow flow READ flow WRITE setFlow NOTIFY flowChanged)
34 Q_PROPERTY(qreal cellWidth READ cellWidth WRITE setCellWidth NOTIFY cellWidthChanged)
35 Q_PROPERTY(qreal cellHeight READ cellHeight WRITE setCellHeight NOTIFY cellHeightChanged)
36
37 Q_PROPERTY(SnapMode snapMode READ snapMode WRITE setSnapMode NOTIFY snapModeChanged)
38
39 Q_CLASSINFO("DefaultProperty", "data")
40 QML_NAMED_ELEMENT(GridView)
43
44public:
45 enum Flow {
46 FlowLeftToRight = LeftToRight,
47 FlowTopToBottom = TopToBottom
48 };
49 Q_ENUM(Flow)
50
51 QQuickGridView(QQuickItem *parent=nullptr);
52
53 void setHighlightFollowsCurrentItem(bool) override;
54 void setHighlightMoveDuration(int) override;
55
56 Flow flow() const;
57 void setFlow(Flow);
58
59 qreal cellWidth() const;
60 void setCellWidth(qreal);
61
62 qreal cellHeight() const;
63 void setCellHeight(qreal);
64
65 enum SnapMode { NoSnap, SnapToRow, SnapOneRow };
66 Q_ENUM(SnapMode)
67 SnapMode snapMode() const;
68 void setSnapMode(SnapMode mode);
69
70 static QQuickGridViewAttached *qmlAttachedProperties(QObject *);
71
72public Q_SLOTS:
73 void moveCurrentIndexUp();
74 void moveCurrentIndexDown();
75 void moveCurrentIndexLeft();
76 void moveCurrentIndexRight();
77
84
85protected:
86 void viewportMoved(Qt::Orientations) override;
87 void keyPressEvent(QKeyEvent *) override;
88 void geometryChange(const QRectF &newGeometry, const QRectF &oldGeometry) override;
89 void initItem(int index, QObject *item) override;
90};
91
100
101
103
104#endif // QQUICKGRIDVIEW_P_H
The QKeyEvent class describes a key event.
Definition qevent.h:424
\inmodule QtCore
Definition qobject.h:103
QObject * parent() const
Returns a pointer to the parent object.
Definition qobject.h:346
QQuickGridViewAttached(QObject *parent)
void flowChanged()
void cellWidthChanged()
void snapModeChanged()
void highlightMoveDurationChanged()
void cellHeightChanged()
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.
GLenum mode
GLuint index
[2]
GLint GLsizei GLsizei GLenum GLenum GLsizei void * data
#define QML_NAMED_ELEMENT(NAME)
#define QML_ADDED_IN_VERSION(MAJOR, MINOR)
#define QML_ATTACHED(ATTACHED_TYPE)
#define QT_REQUIRE_CONFIG(feature)
#define Q_ENUM(x)
#define Q_PROPERTY(...)
#define Q_OBJECT
#define Q_CLASSINFO(name, value)
#define Q_SLOTS
#define Q_SIGNALS
double qreal
Definition qtypes.h:187
QGraphicsItem * item