Qt 6.x
The Qt SDK
Loading...
Searching...
No Matches
qsplitter_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 QSPLITTER_P_H
5#define QSPLITTER_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 <QtWidgets/private/qtwidgetsglobal_p.h>
19#include "private/qframe_p.h"
20
22
24
25static const uint Default = 2;
26
28{
29public:
31 int sizer;
36
41 int pick(const QSize &size, Qt::Orientation orient)
42 { return (orient == Qt::Horizontal) ? size.width() : size.height(); }
43};
44
46{
47 Q_DECLARE_PUBLIC(QSplitter)
48public:
50#if QT_CONFIG(rubberband)
51 rubberBand(nullptr),
52#endif
53 opaque(true), firstShow(true),
56
57#if QT_CONFIG(rubberband)
58 QPointer<QRubberBand> rubberBand;
59#endif
62 bool opaque : 8;
63 bool firstShow : 8;
65 bool compatMode : 8;
69
70 inline int pick(const QPoint &pos) const
71 { return orient == Qt::Horizontal ? pos.x() : pos.y(); }
72 inline int pick(const QSize &s) const
73 { return orient == Qt::Horizontal ? s.width() : s.height(); }
74
75 inline int trans(const QPoint &pos) const
76 { return orient == Qt::Vertical ? pos.x() : pos.y(); }
77 inline int trans(const QSize &s) const
78 { return orient == Qt::Vertical ? s.width() : s.height(); }
79
80 void init();
81 void recalc(bool update = false);
82 void doResize();
83 void storeSizes();
84 void getRange(int index, int *, int *, int *, int *) const;
85 void addContribution(int, int *, int *, bool) const;
86 int adjustPos(int, int, int *, int *, int *, int *) const;
88 bool collapsible(int index) const
89 { return (index < 0 || index >= list.size()) ? true : collapsible(list.at(index)); }
93 void doMove(bool backwards, int pos, int index, int delta,
94 bool mayCollapse, int *positions, int *widths);
95 void setGeo(QSplitterLayoutStruct *s, int pos, int size, bool allowCollapse);
96 int findWidgetJustBeforeOrJustAfter(int index, int delta, int &collapsibleSize) const;
97 void updateHandles();
98 void setSizes_helper(const QList<int> &sizes, bool clampNegativeSize = false);
99 bool shouldShowWidget(const QWidget *w) const;
100
101};
102
104{
105 Q_DECLARE_PUBLIC(QSplitterHandle)
106public:
108
109 inline int pick(const QPoint &pos) const
110 { return orient == Qt::Horizontal ? pos.x() : pos.y(); }
111
115 bool opaq : 1;
116 bool hover : 1;
117 bool pressed : 1;
118};
119
121
122#endif
Definition qlist.h:74
qsizetype size() const noexcept
Definition qlist.h:386
const_reference at(qsizetype i) const noexcept
Definition qlist.h:429
\inmodule QtCore\reentrant
Definition qpoint.h:23
\inmodule QtCore
Definition qpointer.h:18
\inmodule QtCore\reentrant
Definition qrect.h:30
\inmodule QtCore
Definition qsize.h:25
Qt::Orientation orient
int pick(const QPoint &pos) const
The QSplitterHandle class provides handle functionality for the splitter.
Definition qsplitter.h:98
int getWidgetSize(Qt::Orientation orient)
int getHandleSize(Qt::Orientation orient)
int pick(const QSize &size, Qt::Orientation orient)
Definition qsplitter_p.h:41
QSplitterHandle * handle
Definition qsplitter_p.h:35
Qt::Orientation orient
Definition qsplitter_p.h:61
int trans(const QPoint &pos) const
Definition qsplitter_p.h:75
int pick(const QPoint &pos) const
Definition qsplitter_p.h:70
void getRange(int index, int *, int *, int *, int *) const
int pick(const QSize &s) const
Definition qsplitter_p.h:72
void recalc(bool update=false)
void doMove(bool backwards, int pos, int index, int delta, bool mayCollapse, int *positions, int *widths)
int trans(const QSize &s) const
Definition qsplitter_p.h:77
QSplitterLayoutStruct * findWidget(QWidget *) const
bool collapsible(int index) const
Definition qsplitter_p.h:88
bool collapsible(QSplitterLayoutStruct *) const
bool shouldShowWidget(const QWidget *w) const
void addContribution(int, int *, int *, bool) const
QSplitterLayoutStruct * insertWidget(int index, QWidget *)
int adjustPos(int, int, int *, int *, int *, int *) const
QList< QSplitterLayoutStruct * > list
Definition qsplitter_p.h:60
void setSizes_helper(const QList< int > &sizes, bool clampNegativeSize=false)
void insertWidget_helper(int index, QWidget *widget, bool show)
void setGeo(QSplitterLayoutStruct *s, int pos, int size, bool allowCollapse)
int findWidgetJustBeforeOrJustAfter(int index, int delta, int &collapsibleSize) const
The QSplitter class implements a splitter widget.
Definition qsplitter.h:21
void update(T t)
The QWidget class is the base class of all user interface objects.
Definition qwidget.h:99
QOpenGLWidget * widget
[1]
Combined button and popup list for selecting options.
Orientation
Definition qnamespace.h:97
@ Horizontal
Definition qnamespace.h:98
@ Vertical
Definition qnamespace.h:99
static const QCssKnownValue positions[NumKnownPositionModes - 1]
GLuint64 GLenum void * handle
GLfloat GLfloat GLfloat w
[0]
GLenum GLuint GLintptr GLsizeiptr size
[1]
GLuint index
[2]
GLuint GLsizei const GLuint const GLintptr const GLsizeiptr * sizes
GLdouble s
[6]
Definition qopenglext.h:235
static QT_BEGIN_NAMESPACE const uint Default
Definition qsplitter_p.h:25
#define QT_CONFIG(feature)
#define QT_REQUIRE_CONFIG(feature)
unsigned int uint
Definition qtypes.h:29
view show()
[18] //! [19]
if(qFloatDistance(a, b)<(1<< 7))
[0]
QObject::connect nullptr