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
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
15QT_BEGIN_NAMESPACE
16
17
18class QBoxLayoutPrivate;
19
20class Q_WIDGETS_EXPORT QBoxLayout : public QLayout
21{
22 Q_OBJECT
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
30 ~QBoxLayout();
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{
79 Q_OBJECT
80public:
81 QHBoxLayout();
82 explicit QHBoxLayout(QWidget *parent);
83 ~QHBoxLayout();
84
85
86private:
87 Q_DISABLE_COPY(QHBoxLayout)
88};
89
90class Q_WIDGETS_EXPORT QVBoxLayout : public QBoxLayout
91{
92 Q_OBJECT
93public:
94 QVBoxLayout();
95 explicit QVBoxLayout(QWidget *parent);
96 ~QVBoxLayout();
97
98
99private:
100 Q_DISABLE_COPY(QVBoxLayout)
101};
102
103QT_END_NAMESPACE
104
105#endif // QBOXLAYOUT_H
The QBoxLayout class lines up child widgets horizontally or vertically.
Definition qboxlayout.h:21
The QHBoxLayout class lines up widgets horizontally.
Definition qboxlayout.h:78
friend class QWidget
Definition qpainter.h:421
The QStylePainter class is a convenience class for drawing QStyle elements inside a widget.
The QVBoxLayout class lines up widgets vertically.
Definition qboxlayout.h:91
QSize minimumSizeHint() const override
\reimp
Definition qwizard.cpp:415
void setSideWidget(QWidget *widget)
Definition qwizard.cpp:421
QWatermarkLabel(QWidget *parent, QWidget *sideWidget)
Definition qwizard.cpp:409
QWidget * sideWidget() const
Definition qwizard.cpp:432
QWizardAntiFlickerWidget(QWizard *wizard, QWizardPrivate *)
Definition qwizard.cpp:496
QWizardDefaultProperty(const char *className, const char *property, const char *changedSignal)
Definition qwizard.cpp:141
QByteArray changedSignal
Definition qwizard.cpp:138
QString name
Definition qwizard.cpp:158
void resolve(const QList< QWizardDefaultProperty > &defaultPropertyTable)
Definition qwizard.cpp:178
QWizardField(QWizardPage *page, const QString &spec, QObject *object, const char *property, const char *changedSignal)
Definition qwizard.cpp:167
void findProperty(const QWizardDefaultProperty *properties, int propertyCount)
Definition qwizard.cpp:185
QByteArray property
Definition qwizard.cpp:161
QByteArray changedSignal
Definition qwizard.cpp:162
QVariant initialValue
Definition qwizard.cpp:163
QWizardPage * page
Definition qwizard.cpp:157
QObject * object
Definition qwizard.cpp:160
void paintEvent(QPaintEvent *event) override
This event handler can be reimplemented in a subclass to receive paint events passed in event.
Definition qwizard.cpp:383
QWizardHeader(RulerType, QWidget *parent=nullptr)
Definition qwizard.cpp:251
QWizardHeader(QWidget *parent=nullptr)
Definition qwizard.cpp:273
void setup(const QWizardLayoutInfo &info, const QString &title, const QString &subTitle, const QPixmap &logo, const QPixmap &banner, Qt::TextFormat titleFormat, Qt::TextFormat subTitleFormat)
Definition qwizard.cpp:323
bool operator!=(const QWizardLayoutInfo &other) const
Definition qwizard.cpp:221
bool operator==(const QWizardLayoutInfo &other) const
Definition qwizard.cpp:224
TriState completeState
Definition qwizard.cpp:456
void _q_maybeEmitCompleteChanged()
Definition qwizard.cpp:471
QMap< int, QString > buttonCustomTexts
Definition qwizard.cpp:460
void _q_updateCachedCompleteState()
Definition qwizard.cpp:479
bool cachedIsComplete() const
Definition qwizard.cpp:463
QPixmap pixmaps[QWizard::NPixmaps]
Definition qwizard.cpp:454
QList< QWizardField > pendingFields
Definition qwizard.cpp:455
The QWizardPage class is the base class for wizard pages.
Definition qwizard.h:177
QMap< int, QString > buttonCustomTexts
Definition qwizard.cpp:563
QList< int > history
Definition qwizard.cpp:552
QMap< QString, int > fieldIndexMap
Definition qwizard.cpp:550
void setStyle(QStyle *style)
Definition qwizard.cpp:1695
PageMap pageMap
Definition qwizard.cpp:548
QGridLayout * mainLayout
Definition qwizard.cpp:595
QList< QWizardDefaultProperty > defaultPropertyTable
Definition qwizard.cpp:551
QAbstractButton * commit
Definition qwizard.cpp:575
bool buttonLayoutContains(QWizard::WizardButton which)
Definition qwizard.cpp:1493
void updateCurrentPage()
Definition qwizard.cpp:1312
void _q_updateButtonStates()
Definition qwizard.cpp:1617
QVBoxLayout * pageVBoxLayout
Definition qwizard.cpp:593
QWatermarkLabel * watermarkLabel
Definition qwizard.cpp:586
QAbstractButton * cancel
Definition qwizard.cpp:577
QWizardLayoutInfo layoutInfoForCurrentPage()
Definition qwizard.cpp:856
bool startSetByUser
Definition qwizard.cpp:554
void connectButton(QWizard::WizardButton which) const
Definition qwizard.cpp:1381
void removeFieldAt(int index)
Definition qwizard.cpp:741
QAbstractButton * next
Definition qwizard.cpp:574
QAbstractButton * help
Definition qwizard.cpp:578
QAbstractButton * back
Definition qwizard.cpp:573
QLabel * subTitleLabel
Definition qwizard.cpp:590
QFrame * pageFrame
Definition qwizard.cpp:588
QLabel * titleLabel
Definition qwizard.cpp:589
void recreateLayout(const QWizardLayoutInfo &info)
Definition qwizard.cpp:917
QWizardAntiFlickerWidget * antiFlickerWidget
Definition qwizard.cpp:582
QAbstractButton * finish
Definition qwizard.cpp:576
QWizardHeader * headerWidget
Definition qwizard.cpp:585
void updateLayout()
Definition qwizard.cpp:1191
QHBoxLayout * buttonLayout
Definition qwizard.cpp:594
void updateMinMaxSizes(const QWizardLayoutInfo &info)
Definition qwizard.cpp:1276
void _q_emitCustomButtonClicked()
Definition qwizard.cpp:1605
void setButtonLayout(const QWizard::WizardButton *array, int size)
Definition qwizard.cpp:1460
bool isVistaThemeEnabled() const
Definition qwizard.cpp:1578
void updatePixmap(QWizard::WizardPixmap which)
Definition qwizard.cpp:1498
QWidget * sideWidget
Definition qwizard.cpp:587
void _q_handleFieldObjectDestroyed(QObject *)
Definition qwizard.cpp:1668
void switchToPage(int newId, Direction direction)
Definition qwizard.cpp:756
QList< QWizard::WizardButton > buttonsCustomLayout
Definition qwizard.cpp:565
void enableUpdates()
Definition qwizard.cpp:1596
int disableUpdatesCount
Definition qwizard.cpp:559
QPixmap defaultPixmaps[QWizard::NPixmaps]
Definition qwizard.cpp:568
QWidget * placeholderWidget2
Definition qwizard.cpp:584
QWizardRuler * bottomRuler
Definition qwizard.cpp:591
Qt::TextFormat subTitleFmt
Definition qwizard.cpp:567
void updateButtonTexts()
Definition qwizard.cpp:1391
void updateButtonLayout()
Definition qwizard.cpp:1420
QList< QWizardField > fields
Definition qwizard.cpp:549
bool ensureButton(QWizard::WizardButton which) const
Definition qwizard.cpp:1352
void updatePalette()
Definition qwizard.cpp:1252
bool buttonsHaveCustomLayout
Definition qwizard.cpp:564
void cleanupPagesNotInHistory()
Definition qwizard.cpp:705
QAbstractButton * btns[QWizard::NButtons]
Definition qwizard.cpp:580
Qt::TextFormat titleFmt
Definition qwizard.cpp:566
void disableUpdates()
Definition qwizard.cpp:1587
QWidget * placeholderWidget1
Definition qwizard.cpp:583
void addField(const QWizardField &field)
Definition qwizard.cpp:719
QWizardLayoutInfo layoutInfo
Definition qwizard.cpp:558
QWizardRuler(QWidget *parent=nullptr)
Definition qwizard.cpp:402
The QWizard class provides a framework for wizards.
Definition qwizard.h:19
Combined button and popup list for selecting options.
static const char * buttonSlots(QWizard::WizardButton which)
Definition qwizard.cpp:832
static QString buttonDefaultText(int wstyle, int which, const QWizardPrivate *wizardPrivate)
Definition qwizard.cpp:613
static QString object_name_for_button(QWizard::WizardButton which)
Definition qwizard.cpp:1326
Q_DECLARE_TYPEINFO(QWizardDefaultProperty, Q_RELOCATABLE_TYPE)
const int ModernHeaderTopMargin
Definition qwizard.cpp:50
static void changeSpacerSize(QLayout *layout, int index, int width, int height)
Definition qwizard.cpp:58
const int MacLayoutLeftMargin
Definition qwizard.cpp:53
const int GapBetweenLogoAndRightEdge
Definition qwizard.cpp:49
const char property[13]
Definition qwizard.cpp:100
static bool objectInheritsXAndXIsCloserThanY(const QObject *object, const QByteArray &classX, const QByteArray &classY)
Definition qwizard.cpp:84
static QWidget * iWantTheFocus(QWidget *ancestor)
Definition qwizard.cpp:66
Q_DECLARE_TYPEINFO(QWizardField, Q_RELOCATABLE_TYPE)
const int MacLayoutBottomMargin
Definition qwizard.cpp:56
const int MacLayoutRightMargin
Definition qwizard.cpp:55
static const char * changed_signal(int which)
Definition qwizard.cpp:113
const size_t NFallbackDefaultProperties
Definition qwizard.cpp:111
const int ClassicHMargin
Definition qwizard.cpp:51
const int MacButtonTopMargin
Definition qwizard.cpp:52
const char className[16]
[1]
Definition qwizard.cpp:99
QT_REQUIRE_CONFIG(wizard)