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
qstackedlayout.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 QSTACKEDLAYOUT_H
5#define QSTACKEDLAYOUT_H
6
7#include <QtWidgets/qtwidgetsglobal.h>
8#include <QtWidgets/qlayout.h>
9
11
12
14
15class Q_WIDGETS_EXPORT QStackedLayout : public QLayout
16{
18 Q_DECLARE_PRIVATE(QStackedLayout)
19 Q_PROPERTY(int currentIndex READ currentIndex WRITE setCurrentIndex NOTIFY currentChanged)
20 Q_PROPERTY(StackingMode stackingMode READ stackingMode WRITE setStackingMode)
21 QDOC_PROPERTY(int count READ count)
22
23public:
26 StackAll
27 };
28 Q_ENUM(StackingMode)
29
31 explicit QStackedLayout(QWidget *parent);
32 explicit QStackedLayout(QLayout *parentLayout);
34
35 int addWidget(QWidget *w);
36 int insertWidget(int index, QWidget *w);
37
38 QWidget *currentWidget() const;
39 int currentIndex() const;
40 using QLayout::widget;
41 QWidget *widget(int) const;
42 int count() const override;
43
44 StackingMode stackingMode() const;
45 void setStackingMode(StackingMode stackingMode);
46
47 // abstract virtual functions:
48 void addItem(QLayoutItem *item) override;
49 QSize sizeHint() const override;
50 QSize minimumSize() const override;
51 QLayoutItem *itemAt(int) const override;
52 QLayoutItem *takeAt(int) override;
53 void setGeometry(const QRect &rect) override;
54 bool hasHeightForWidth() const override;
55 int heightForWidth(int width) const override;
56
60
61public Q_SLOTS:
62 void setCurrentIndex(int index);
63 void setCurrentWidget(QWidget *w);
64
65private:
66 Q_DISABLE_COPY(QStackedLayout)
67};
68
70
71#endif // QSTACKEDLAYOUT_H
The QLayoutItem class provides an abstract item that a QLayout manipulates.
Definition qlayoutitem.h:25
virtual QWidget * widget() const
If this item manages a QWidget, returns that widget.
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 QStackedLayout class provides a stack of widgets where only one widget is visible at a time.
void widgetRemoved(int index)
This signal is emitted whenever a widget is removed from the layout.
void currentChanged(int index)
This signal is emitted whenever the current widget in the layout changes.
The QWidget class is the base class of all user interface objects.
Definition qwidget.h:99
QOpenGLWidget * widget
[1]
rect
[4]
Combined button and popup list for selecting options.
GLfloat GLfloat GLfloat w
[0]
GLuint index
[2]
GLenum GLenum GLsizei count
GLint GLsizei width
#define Q_ENUM(x)
#define Q_PROPERTY(...)
#define Q_OBJECT
#define Q_SLOTS
#define QDOC_PROPERTY(text)
#define Q_SIGNALS
scene addItem(form)
QGraphicsItem * item
gridLayout addWidget(nameLabel, 0, 0)