Qt 6.x
The Qt SDK
Loading...
Searching...
No Matches
qquicksplitview_p_p.h
Go to the documentation of this file.
1// Copyright (C) 2018 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 QQUICKSPLITVIEW_P_P_H
5#define QQUICKSPLITVIEW_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 <QtQuickTemplates2/private/qquickcontainer_p_p.h>
19
21
22class QQuickSplitView;
25
26class Q_QUICKTEMPLATES2_PRIVATE_EXPORT QQuickSplitViewPrivate : public QQuickContainerPrivate
27{
28 Q_DECLARE_PUBLIC(QQuickSplitView)
29
30public:
31 void updateFillIndex();
32 void layoutResizeSplitItems(qreal &usedWidth, qreal &usedHeight, int &indexBeingResizedDueToDrag);
33 void layoutResizeFillItem(QQuickItem *fillItem, qreal &usedWidth, qreal &usedHeight, int indexBeingResizedDueToDrag);
34 void limitAndApplySizes(qreal usedWidth, qreal usedHeight);
35 void layoutPositionItems(const QQuickItem *fillItem);
36 void requestLayout();
37 void layout();
38 void createHandles();
39 void createHandleItem(int index);
40 void removeExcessHandles();
41 void destroyHandles();
42 void resizeHandle(QQuickItem *handleItem);
43 void resizeHandles();
44#if QT_CONFIG(cursor)
45 void updateCursorHandle(QQuickItem *handleItem);
46#endif
47 void updateHandleVisibilities();
48 void updateHoveredHandle(QQuickItem *hoveredItem);
49 void setResizing(bool resizing);
50
51 bool isHorizontal() const;
52 qreal accumulatedSize(int firstIndex, int lastIndex) const;
53
61 };
62
63 // Used during the layout
64 struct LayoutData {
67 bool wasResizedByHandle = false;
68 };
69
70 EffectiveSizeData effectiveSizeData(const QQuickItemPrivate *itemPrivate,
71 const QQuickSplitViewAttached *attached) const;
72
73 int handleIndexForSplitIndex(int splitIndex) const;
74
75 QQuickItem *getContentItem() override;
76 bool handlePress(const QPointF &point, ulong timestamp) override;
77 bool handleMove(const QPointF &point, ulong timestamp) override;
78 bool handleRelease(const QPointF &point, ulong timestamp) override;
79
83
84 void updatePolish() override;
85
86 static QQuickSplitViewPrivate *get(QQuickSplitView *splitView);
87
89 QQmlComponent *m_handle = nullptr;
92 int m_hoveredHandleIndex = -1;
93 int m_pressedHandleIndex = -1;
94 int m_nextVisibleIndexAfterPressedHandle = -1;
98 qreal m_leftOrTopItemSizeBeforePress = 0.0;
99 qreal m_rightOrBottomItemSizeBeforePress = 0.0;
100 int m_fillIndex = -1;
101 bool m_layingOut = false;
102 bool m_ignoreNextLayoutRequest = false;
103 bool m_resizing = false;
104};
105
107{
108 Q_DECLARE_PUBLIC(QQuickSplitViewAttached)
109
110public:
112
113 void setView(QQuickSplitView *newView);
114 void requestLayoutView();
115
117 static const QQuickSplitViewAttachedPrivate *get(const QQuickSplitViewAttached *attached);
118
121
122 unsigned m_fillWidth : 1;
123 unsigned m_fillHeight : 1;
124 unsigned m_isFillWidthSet : 1;
125 unsigned m_isFillHeightSet : 1;
138};
139
141{
142 Q_DECLARE_PUBLIC(QQuickSplitHandleAttached)
143
144public:
146
147 void setHovered(bool hovered);
148 void setPressed(bool pressed);
149
152
153 unsigned m_hovered : 1;
154 unsigned m_pressed : 1;
155};
156
158
159#endif // QQUICKSPLITVIEW_P_P_H
\inmodule QtCore
Definition qhash.h:818
Definition qlist.h:74
\inmodule QtCore\reentrant
Definition qpoint.h:214
The QQmlComponent class encapsulates a QML component definition.
static QQuickContainerPrivate * get(QQuickContainer *container)
void itemImplicitWidthChanged(QQuickItem *item) override
virtual bool handlePress(const QPointF &point, ulong timestamp)
virtual QQuickItem * getContentItem()
virtual bool handleRelease(const QPointF &point, ulong timestamp)
virtual bool handleMove(const QPointF &point, ulong timestamp)
void itemImplicitHeightChanged(QQuickItem *item) override
virtual void itemVisibilityChanged(QQuickItem *)
virtual void updatePolish()
The QQuickItem class provides the most basic of all visual items in \l {Qt Quick}.
Definition qquickitem.h:64
static QQuickSplitHandleAttachedPrivate * get(QQuickSplitHandleAttached *attached)
void setView(QQuickSplitView *newView)
static QQuickSplitViewAttachedPrivate * get(QQuickSplitViewAttached *attached)
QHash< QQuickItem *, LayoutData > m_layoutData
QList< QQuickItem * > m_handleItems
Combined button and popup list for selecting options.
Orientation
Definition qnamespace.h:97
@ Horizontal
Definition qnamespace.h:98
GLint GLsizei GLsizei height
GLuint index
[2]
GLint GLsizei width
static qsizetype accumulatedSize(const QStringList &list, qsizetype seplen)
unsigned long ulong
Definition qtypes.h:30
double qreal
Definition qtypes.h:92
QVBoxLayout * layout
QGraphicsItem * item