Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
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// Qt-Security score:significant reason:default
4
5#ifndef QBOXLAYOUT_H
6#define QBOXLAYOUT_H
7
8#include <QtWidgets/qtwidgetsglobal.h>
9#include <QtWidgets/qlayout.h>
10#ifdef QT_INCLUDE_COMPAT
11#include <QtWidgets/qwidget.h>
12#endif
13
14#include <limits.h>
15
16QT_BEGIN_NAMESPACE
17
18
19class QBoxLayoutPrivate;
20
21class Q_WIDGETS_EXPORT QBoxLayout : public QLayout
22{
23 Q_OBJECT
24 Q_DECLARE_PRIVATE(QBoxLayout)
25public:
26 enum Direction { LeftToRight, RightToLeft, TopToBottom, BottomToTop,
27 Down = TopToBottom, Up = BottomToTop };
28
29 explicit QBoxLayout(Direction, QWidget *parent = nullptr);
30
31 ~QBoxLayout();
32
33 Direction direction() const;
34 void setDirection(Direction);
35
36 void addSpacing(int size);
37 void addStretch(int stretch = 0);
38 void addSpacerItem(QSpacerItem *spacerItem);
39 void addWidget(QWidget *, int stretch = 0, Qt::Alignment alignment = Qt::Alignment());
40 void addLayout(QLayout *layout, int stretch = 0);
41 void addStrut(int);
42 void addItem(QLayoutItem *) override;
43
44 void insertSpacing(int index, int size);
45 void insertStretch(int index, int stretch = 0);
46 void insertSpacerItem(int index, QSpacerItem *spacerItem);
47 void insertWidget(int index, QWidget *widget, int stretch = 0, Qt::Alignment alignment = Qt::Alignment());
48 void insertLayout(int index, QLayout *layout, int stretch = 0);
49 void insertItem(int index, QLayoutItem *);
50
51 int spacing() const override;
52 void setSpacing(int spacing) override;
53
54 bool setStretchFactor(QWidget *w, int stretch);
55 bool setStretchFactor(QLayout *l, int stretch);
56 void setStretch(int index, int stretch);
57 int stretch(int index) const;
58
59 QSize sizeHint() const override;
60 QSize minimumSize() const override;
61 QSize maximumSize() const override;
62
63 bool hasHeightForWidth() const override;
64 int heightForWidth(int) const override;
65 int minimumHeightForWidth(int) const override;
66
67 Qt::Orientations expandingDirections() const override;
68 void invalidate() override;
69 QLayoutItem *itemAt(int) const override;
70 QLayoutItem *takeAt(int) override;
71 int count() const override;
72 void setGeometry(const QRect&) override;
73
74private:
75 Q_DISABLE_COPY(QBoxLayout)
76};
77
78class Q_WIDGETS_EXPORT QHBoxLayout : public QBoxLayout
79{
80 Q_OBJECT
81public:
82 QHBoxLayout();
83 explicit QHBoxLayout(QWidget *parent);
84 ~QHBoxLayout();
85
86
87private:
88 Q_DISABLE_COPY(QHBoxLayout)
89};
90
91class Q_WIDGETS_EXPORT QVBoxLayout : public QBoxLayout
92{
93 Q_OBJECT
94public:
95 QVBoxLayout();
96 explicit QVBoxLayout(QWidget *parent);
97 ~QVBoxLayout();
98
99
100private:
101 Q_DISABLE_COPY(QVBoxLayout)
102};
103
104QT_END_NAMESPACE
105
106#endif // QBOXLAYOUT_H
The QBoxLayout class lines up child widgets horizontally or vertically.
Definition qboxlayout.h:22
The QHBoxLayout class lines up widgets horizontally.
Definition qboxlayout.h:79
friend class QWidget
Definition qpainter.h:431
The QStylePainter class is a convenience class for drawing QStyle elements inside a widget.
The QVBoxLayout class lines up widgets vertically.
Definition qboxlayout.h:92
QSize minimumSizeHint() const override
\reimp
Definition qwizard.cpp:432
void setSideWidget(QWidget *widget)
Definition qwizard.cpp:438
QWatermarkLabel(QWidget *parent, QWidget *sideWidget)
Definition qwizard.cpp:426
QWidget * sideWidget() const
Definition qwizard.cpp:449
QWizardAntiFlickerWidget(QWizard *wizard, QWizardPrivate *)
Definition qwizard.cpp:513
QWizardDefaultProperty(const char *className, const char *property, const char *changedSignal)
Definition qwizard.cpp:142
QByteArray changedSignal
Definition qwizard.cpp:139
QString name
Definition qwizard.cpp:159
void resolve(const QList< QWizardDefaultProperty > &defaultPropertyTable)
Definition qwizard.cpp:179
QWizardField(QWizardPage *page, const QString &spec, QObject *object, const char *property, const char *changedSignal)
Definition qwizard.cpp:168
void findProperty(const QWizardDefaultProperty *properties, int propertyCount)
Definition qwizard.cpp:186
QByteArray property
Definition qwizard.cpp:162
QByteArray changedSignal
Definition qwizard.cpp:163
QVariant initialValue
Definition qwizard.cpp:164
QWizardPage * page
Definition qwizard.cpp:158
QObject * object
Definition qwizard.cpp:161
void paintEvent(QPaintEvent *event) override
This event handler can be reimplemented in a subclass to receive paint events passed in event.
Definition qwizard.cpp:392
QWizardHeader(RulerType, QWidget *parent=nullptr)
Definition qwizard.cpp:253
QWizardHeader(QWidget *parent=nullptr)
Definition qwizard.cpp:279
void setup(const QWizardLayoutInfo &info, const QString &title, const QString &subTitle, const QPixmap &logo, const QPixmap &banner, Qt::TextFormat titleFormat, Qt::TextFormat subTitleFormat, QWizard::BannerSizePolicy bannerSizePolicy)
Definition qwizard.cpp:329
bool operator!=(const QWizardLayoutInfo &other) const
Definition qwizard.cpp:222
bool operator==(const QWizardLayoutInfo &other) const
Definition qwizard.cpp:225
TriState completeState
Definition qwizard.cpp:473
void _q_maybeEmitCompleteChanged()
Definition qwizard.cpp:488
QMap< int, QString > buttonCustomTexts
Definition qwizard.cpp:477
void _q_updateCachedCompleteState()
Definition qwizard.cpp:496
bool cachedIsComplete() const
Definition qwizard.cpp:480
QPixmap pixmaps[QWizard::NPixmaps]
Definition qwizard.cpp:471
QList< QWizardField > pendingFields
Definition qwizard.cpp:472
The QWizardPage class is the base class for wizard pages.
Definition qwizard.h:187
QMap< int, QString > buttonCustomTexts
Definition qwizard.cpp:580
QList< int > history
Definition qwizard.cpp:569
QMap< QString, int > fieldIndexMap
Definition qwizard.cpp:567
void setStyle(QStyle *style)
Definition qwizard.cpp:1713
PageMap pageMap
Definition qwizard.cpp:565
QGridLayout * mainLayout
Definition qwizard.cpp:613
QList< QWizardDefaultProperty > defaultPropertyTable
Definition qwizard.cpp:568
QAbstractButton * commit
Definition qwizard.cpp:593
bool buttonLayoutContains(QWizard::WizardButton which)
Definition qwizard.cpp:1511
void updateCurrentPage()
Definition qwizard.cpp:1330
void _q_updateButtonStates()
Definition qwizard.cpp:1635
QVBoxLayout * pageVBoxLayout
Definition qwizard.cpp:611
QWatermarkLabel * watermarkLabel
Definition qwizard.cpp:604
QAbstractButton * cancel
Definition qwizard.cpp:595
QWizardLayoutInfo layoutInfoForCurrentPage()
Definition qwizard.cpp:874
bool startSetByUser
Definition qwizard.cpp:571
void connectButton(QWizard::WizardButton which) const
Definition qwizard.cpp:1399
void removeFieldAt(int index)
Definition qwizard.cpp:759
QAbstractButton * next
Definition qwizard.cpp:592
QAbstractButton * help
Definition qwizard.cpp:596
QAbstractButton * back
Definition qwizard.cpp:591
QLabel * subTitleLabel
Definition qwizard.cpp:608
QFrame * pageFrame
Definition qwizard.cpp:606
QLabel * titleLabel
Definition qwizard.cpp:607
void recreateLayout(const QWizardLayoutInfo &info)
Definition qwizard.cpp:935
QWizardAntiFlickerWidget * antiFlickerWidget
Definition qwizard.cpp:600
QAbstractButton * finish
Definition qwizard.cpp:594
QWizardHeader * headerWidget
Definition qwizard.cpp:603
void updateLayout()
Definition qwizard.cpp:1209
QHBoxLayout * buttonLayout
Definition qwizard.cpp:612
void updateMinMaxSizes(const QWizardLayoutInfo &info)
Definition qwizard.cpp:1294
void _q_emitCustomButtonClicked()
Definition qwizard.cpp:1623
void setButtonLayout(const QWizard::WizardButton *array, int size)
Definition qwizard.cpp:1478
bool isVistaThemeEnabled() const
Definition qwizard.cpp:1596
void updatePixmap(QWizard::WizardPixmap which)
Definition qwizard.cpp:1516
QWidget * sideWidget
Definition qwizard.cpp:605
void _q_handleFieldObjectDestroyed(QObject *)
Definition qwizard.cpp:1686
void switchToPage(int newId, Direction direction)
Definition qwizard.cpp:774
QList< QWizard::WizardButton > buttonsCustomLayout
Definition qwizard.cpp:582
void enableUpdates()
Definition qwizard.cpp:1614
int disableUpdatesCount
Definition qwizard.cpp:576
QPixmap defaultPixmaps[QWizard::NPixmaps]
Definition qwizard.cpp:586
QWidget * placeholderWidget2
Definition qwizard.cpp:602
QWizardRuler * bottomRuler
Definition qwizard.cpp:609
Qt::TextFormat subTitleFmt
Definition qwizard.cpp:584
void updateButtonTexts()
Definition qwizard.cpp:1409
void updateButtonLayout()
Definition qwizard.cpp:1438
QList< QWizardField > fields
Definition qwizard.cpp:566
bool ensureButton(QWizard::WizardButton which) const
Definition qwizard.cpp:1370
void updatePalette()
Definition qwizard.cpp:1270
bool buttonsHaveCustomLayout
Definition qwizard.cpp:581
void cleanupPagesNotInHistory()
Definition qwizard.cpp:723
QAbstractButton * btns[QWizard::NButtons]
Definition qwizard.cpp:598
Qt::TextFormat titleFmt
Definition qwizard.cpp:583
void disableUpdates()
Definition qwizard.cpp:1605
QWidget * placeholderWidget1
Definition qwizard.cpp:601
void addField(const QWizardField &field)
Definition qwizard.cpp:737
QWizardLayoutInfo layoutInfo
Definition qwizard.cpp:575
QWizardRuler(QWidget *parent=nullptr)
Definition qwizard.cpp:419
The QWizard class provides a framework for wizards.
Definition qwizard.h:20
static const char * buttonSlots(QWizard::WizardButton which)
Definition qwizard.cpp:850
static QString buttonDefaultText(int wstyle, int which, const QWizardPrivate *wizardPrivate)
Definition qwizard.cpp:631
const char className[16]
Definition qwizard.cpp:100
static QString object_name_for_button(QWizard::WizardButton which)
Definition qwizard.cpp:1344
Q_DECLARE_TYPEINFO(QWizardDefaultProperty, Q_RELOCATABLE_TYPE)
const int ModernHeaderTopMargin
Definition qwizard.cpp:51
static void changeSpacerSize(QLayout *layout, int index, int width, int height)
Definition qwizard.cpp:59
const int MacLayoutLeftMargin
Definition qwizard.cpp:54
const int GapBetweenLogoAndRightEdge
Definition qwizard.cpp:50
const char property[13]
Definition qwizard.cpp:101
static bool objectInheritsXAndXIsCloserThanY(const QObject *object, const QByteArray &classX, const QByteArray &classY)
Definition qwizard.cpp:85
static QWidget * iWantTheFocus(QWidget *ancestor)
Definition qwizard.cpp:67
Q_DECLARE_TYPEINFO(QWizardField, Q_RELOCATABLE_TYPE)
const int MacLayoutBottomMargin
Definition qwizard.cpp:57
const int MacLayoutRightMargin
Definition qwizard.cpp:56
static const char * changed_signal(int which)
Definition qwizard.cpp:114
const size_t NFallbackDefaultProperties
Definition qwizard.cpp:112
const int ClassicHMargin
Definition qwizard.cpp:52
const int MacButtonTopMargin
Definition qwizard.cpp:53
QT_REQUIRE_CONFIG(wizard)