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
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
21#include <QtCore/qpointer.h>
22
24
26
27static const uint Default = 2;
28
46
48{
49 Q_DECLARE_PUBLIC(QSplitter)
50public:
52#if QT_CONFIG(rubberband)
53 rubberBand(nullptr),
54#endif
55 opaque(true), firstShow(true),
58
59#if QT_CONFIG(rubberband)
60 QPointer<QRubberBand> rubberBand;
61#endif
62 mutable QList<QSplitterLayoutStruct *> list;
64 bool opaque : 8;
65 bool firstShow : 8;
67 bool compatMode : 8;
71
72 inline int pick(const QPoint &pos) const
73 { return orient == Qt::Horizontal ? pos.x() : pos.y(); }
74 inline int pick(const QSize &s) const
75 { return orient == Qt::Horizontal ? s.width() : s.height(); }
76
77 inline int trans(const QPoint &pos) const
78 { return orient == Qt::Vertical ? pos.x() : pos.y(); }
79 inline int trans(const QSize &s) const
80 { return orient == Qt::Vertical ? s.width() : s.height(); }
81
82 void init();
83 void recalc(bool update = false);
84 void doResize();
85 void storeSizes();
86 void getRange(int index, int *, int *, int *, int *) const;
87 void addContribution(int, int *, int *, bool) const;
88 int adjustPos(int, int, int *, int *, int *, int *) const;
90 bool collapsible(int index) const
91 { return (index < 0 || index >= list.size()) ? true : collapsible(list.at(index)); }
95 void doMove(bool backwards, int pos, int index, int delta,
96 bool mayCollapse, int *positions, int *widths);
97 void setGeo(QSplitterLayoutStruct *s, int pos, int size, bool allowCollapse);
98 int findWidgetJustBeforeOrJustAfter(int index, int delta, int &collapsibleSize) const;
99 void updateHandles();
100 void setSizes_helper(const QList<int> &sizes, bool clampNegativeSize = false);
101 bool shouldShowWidget(const QWidget *w) const;
102
103};
104
106{
107 Q_DECLARE_PUBLIC(QSplitterHandle)
108public:
110
111 inline int pick(const QPoint &pos) const
112 { return orient == Qt::Horizontal ? pos.x() : pos.y(); }
113
117 bool opaq : 1;
118 bool hover : 1;
119 bool pressed : 1;
120};
121
123
124#endif
qsizetype size() const noexcept
Definition qlist.h:397
const_reference at(qsizetype i) const noexcept
Definition qlist.h:446
\inmodule QtCore\reentrant
Definition qpoint.h:25
\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:43
QSplitterHandle * handle
Definition qsplitter_p.h:37
Qt::Orientation orient
Definition qsplitter_p.h:63
int trans(const QPoint &pos) const
Definition qsplitter_p.h:77
int pick(const QPoint &pos) const
Definition qsplitter_p.h:72
void getRange(int index, int *, int *, int *, int *) const
int pick(const QSize &s) const
Definition qsplitter_p.h:74
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:79
QSplitterLayoutStruct * findWidget(QWidget *) const
bool collapsible(int index) const
Definition qsplitter_p.h:90
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:62
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.
Definition qcompare.h:63
Orientation
Definition qnamespace.h:98
@ Horizontal
Definition qnamespace.h:99
@ Vertical
Definition qnamespace.h:100
static const QCssKnownValue positions[NumKnownPositionModes - 1]
GLuint64 GLenum void * handle
GLfloat GLfloat GLfloat w
[0]
GLenum GLuint GLintptr GLsizeiptr size
[1]
GLuint index
[2]
GLdouble s
[6]
Definition qopenglext.h:235
GLuint GLsizei const GLuint const GLintptr const GLsizeiptr * sizes
static QT_BEGIN_NAMESPACE const uint Default
Definition qsplitter_p.h:27
#define QT_CONFIG(feature)
#define QT_REQUIRE_CONFIG(feature)
unsigned int uint
Definition qtypes.h:34
view show()
[18] //! [19]
if(qFloatDistance(a, b)<(1<< 7))
[0]
QObject::connect nullptr