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
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_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
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
80 void itemVisibilityChanged(QQuickItem *item) override;
81 void itemImplicitWidthChanged(QQuickItem *item) override;
82 void itemImplicitHeightChanged(QQuickItem *item) override;
83
84 void updatePolish() override;
85
86 static QQuickSplitViewPrivate *get(QQuickSplitView *splitView);
87
89 QQmlComponent *m_handle = nullptr;
90 QList<QQuickItem*> m_handleItems;
91 QHash<QQuickItem*, LayoutData> m_layoutData;
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
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\reentrant
Definition qpoint.h:217
The QQmlComponent class encapsulates a QML component definition.
The QQuickItem class provides the most basic of all visual items in \l {Qt Quick}.
Definition qquickitem.h:63
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:98
@ Horizontal
Definition qnamespace.h:99
static QDBusError::ErrorType get(const char *name)
GLint GLsizei GLsizei height
GLuint index
[2]
GLint GLsizei width
static qsizetype accumulatedSize(const QStringList &list, qsizetype seplen)
unsigned long ulong
Definition qtypes.h:35
double qreal
Definition qtypes.h:187
QVBoxLayout * layout
QGraphicsItem * item