Qt 6.x
The Qt SDK
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_PRIVATE_EXPORT QQuickGridView : public QQuickItemView
29{
31 Q_DECLARE_PRIVATE(QQuickGridView)
32
33 Q_PROPERTY(Flow flow READ flow WRITE setFlow NOTIFY flowChanged FINAL)
34 Q_PROPERTY(qreal cellWidth READ cellWidth WRITE setCellWidth NOTIFY cellWidthChanged FINAL)
35 Q_PROPERTY(qreal cellHeight READ cellHeight WRITE setCellHeight NOTIFY cellHeightChanged FINAL)
36
37 Q_PROPERTY(SnapMode snapMode READ snapMode WRITE setSnapMode NOTIFY snapModeChanged FINAL)
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
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
93{
95public:
99};
100
101
103
105
106#endif // QQUICKGRIDVIEW_P_H
The QKeyEvent class describes a key event.
Definition qevent.h:423
\inmodule QtCore
Definition qobject.h:90
QObject * parent() const
Returns a pointer to the parent object.
Definition qobject.h:311
virtual void viewportMoved(Qt::Orientations orient)
QQuickGridViewAttached(QObject *parent)
void flowChanged()
void cellWidthChanged()
void snapModeChanged()
void highlightMoveDurationChanged()
void cellHeightChanged()
virtual void setHighlightFollowsCurrentItem(bool)
virtual void initItem(int index, QObject *item)
virtual void setHighlightMoveDuration(int)
void geometryChange(const QRectF &newGeometry, const QRectF &oldGeometry) override
The QQuickItem class provides the most basic of all visual items in \l {Qt Quick}.
Definition qquickitem.h:64
virtual void keyPressEvent(QKeyEvent *event)
This event handler can be reimplemented in a subclass to receive key press events for an item.
\inmodule QtCore\reentrant
Definition qrect.h:483
Combined button and popup list for selecting options.
GLenum mode
GLuint index
[2]
#define QML_DECLARE_TYPE(TYPE)
Definition qqml.h:19
#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:92
QGraphicsItem * item
IUIAutomationTreeWalker __RPC__deref_out_opt IUIAutomationElement ** parent