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
qboxlayout.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 QBOXLAYOUT_H
5#define QBOXLAYOUT_H
6
7#include <QtWidgets/qtwidgetsglobal.h>
8#include <QtWidgets/qlayout.h>
9#ifdef QT_INCLUDE_COMPAT
10#include <QtWidgets/qwidget.h>
11#endif
12
13#include <limits.h>
14
16
17
19
20class Q_WIDGETS_EXPORT QBoxLayout : public QLayout
21{
23 Q_DECLARE_PRIVATE(QBoxLayout)
24public:
25 enum Direction { LeftToRight, RightToLeft, TopToBottom, BottomToTop,
26 Down = TopToBottom, Up = BottomToTop };
27
28 explicit QBoxLayout(Direction, QWidget *parent = nullptr);
29
31
32 Direction direction() const;
33 void setDirection(Direction);
34
35 void addSpacing(int size);
36 void addStretch(int stretch = 0);
37 void addSpacerItem(QSpacerItem *spacerItem);
38 void addWidget(QWidget *, int stretch = 0, Qt::Alignment alignment = Qt::Alignment());
39 void addLayout(QLayout *layout, int stretch = 0);
40 void addStrut(int);
41 void addItem(QLayoutItem *) override;
42
43 void insertSpacing(int index, int size);
44 void insertStretch(int index, int stretch = 0);
45 void insertSpacerItem(int index, QSpacerItem *spacerItem);
46 void insertWidget(int index, QWidget *widget, int stretch = 0, Qt::Alignment alignment = Qt::Alignment());
47 void insertLayout(int index, QLayout *layout, int stretch = 0);
48 void insertItem(int index, QLayoutItem *);
49
50 int spacing() const override;
51 void setSpacing(int spacing) override;
52
53 bool setStretchFactor(QWidget *w, int stretch);
54 bool setStretchFactor(QLayout *l, int stretch);
55 void setStretch(int index, int stretch);
56 int stretch(int index) const;
57
58 QSize sizeHint() const override;
59 QSize minimumSize() const override;
60 QSize maximumSize() const override;
61
62 bool hasHeightForWidth() const override;
63 int heightForWidth(int) const override;
64 int minimumHeightForWidth(int) const override;
65
66 Qt::Orientations expandingDirections() const override;
67 void invalidate() override;
68 QLayoutItem *itemAt(int) const override;
69 QLayoutItem *takeAt(int) override;
70 int count() const override;
71 void setGeometry(const QRect&) override;
72
73private:
74 Q_DISABLE_COPY(QBoxLayout)
75};
76
77class Q_WIDGETS_EXPORT QHBoxLayout : public QBoxLayout
78{
80public:
82 explicit QHBoxLayout(QWidget *parent);
84
85
86private:
87 Q_DISABLE_COPY(QHBoxLayout)
88};
89
90class Q_WIDGETS_EXPORT QVBoxLayout : public QBoxLayout
91{
93public:
95 explicit QVBoxLayout(QWidget *parent);
97
98
99private:
100 Q_DISABLE_COPY(QVBoxLayout)
101};
102
104
105#endif // QBOXLAYOUT_H
The QBoxLayout class lines up child widgets horizontally or vertically.
Definition qboxlayout.h:21
Direction
This type is used to determine the direction of a box layout.
Definition qboxlayout.h:25
The QHBoxLayout class lines up widgets horizontally.
Definition qboxlayout.h:78
The QLayoutItem class provides an abstract item that a QLayout manipulates.
Definition qlayoutitem.h:25
The QLayout class is the base class of geometry managers.
Definition qlayout.h:26
\inmodule QtCore\reentrant
Definition qrect.h:30
\inmodule QtCore
Definition qsize.h:25
The QSpacerItem class provides blank space in a layout.
Definition qlayoutitem.h:57
The QVBoxLayout class lines up widgets vertically.
Definition qboxlayout.h:91
The QWidget class is the base class of all user interface objects.
Definition qwidget.h:99
QOpenGLWidget * widget
[1]
qreal spacing
uint alignment
direction
Combined button and popup list for selecting options.
static qreal minimumHeightForWidth(qreal width, qreal minh, qreal maxh, const QGraphicsWidget *widget, bool heightForWidth=true)
GLfloat GLfloat GLfloat w
[0]
GLenum GLuint GLintptr GLsizeiptr size
[1]
GLuint index
[2]
GLenum GLenum GLsizei count
#define Q_OBJECT
QVBoxLayout * layout
scene addItem(form)
gridLayout addWidget(nameLabel, 0, 0)
vbox addStretch(1)