8#include "private/qwidget_p.h"
9#include "private/qlayoutengine_p.h"
29 if (idx < 0 || idx >=
list.
size() || !newitem)
33 qWarning(
"QStackedLayout::replaceAt: Only widgets can be added");
194 d->list.insert(
index, wi);
199 if (index <= d->
index)
214 return d->list.value(
index);
232 if (index <0 || index >=
d->list.size())
237 if (
d->list.size() > 0 ) {
243 }
else if (index < d->
index) {
268 bool reenableUpdates =
false;
272 reenableUpdates =
true;
273 parent->setUpdatesEnabled(
false);
277 const bool focusWasOnOldPage = fw && (prev && prev->
isAncestorOf(fw));
293 if (focusWasOnOldPage) {
300 while ((
i =
i->nextInFocusChain()) != fw) {
302 && !
i->focusProxy() &&
i->isVisibleTo(
next) &&
i->isEnabled()
303 &&
next->isAncestorOf(
i)) {
316 parent->setUpdatesEnabled(
true);
339 qWarning(
"QStackedLayout::setCurrentWidget: Widget %p not contained in stack",
widget);
355 return d->index >= 0 ?
d->list.at(
d->index)->widget() :
nullptr;
367 if (index < 0 || index >=
d->list.size())
369 return d->list.at(
index)->widget();
381 return d->list.size();
390 std::unique_ptr<QLayoutItem> guard(
item);
393 qWarning(
"QStackedLayout::addItem: Only widgets can be added");
406 int n =
d->list.size();
408 for (
int i = 0;
i <
n; ++
i)
415 s =
s.expandedTo(ws);
427 int n =
d->list.size();
429 for (
int i = 0;
i <
n; ++
i)
441 switch (
d->stackingMode) {
447 if (
const int n =
d->list.size())
448 for (
int i = 0;
i <
n; ++
i)
462 for (
int i = 0;
i <
n; ++
i) {
464 if (
item->hasHeightForWidth())
479 for (
int i = 0;
i <
n; ++
i) {
524 return d->stackingMode;
534 const int n =
d->list.size();
538 switch (
d->stackingMode) {
541 for (
int i = 0;
i <
n; ++
i)
549 for (
int i = 0;
i <
n; ++
i)
562#include "moc_qstackedlayout.cpp"
void hide()
Hides the item (items are visible by default).
The QLayoutItem class provides an abstract item that a QLayout manipulates.
virtual QWidget * widget() const
If this item manages a QWidget, returns that widget.
static QWidgetItem * createWidgetItem(const QLayout *layout, QWidget *widget)
The QLayout class is the base class of geometry managers.
QRect geometry() const override
\reimp
void addChildWidget(QWidget *w)
This function is called from addWidget() functions in subclasses to add w as a managed widget of a la...
void invalidate() override
\reimp
QWidget * parentWidget() const
Returns the parent widget of this layout, or \nullptr if this layout is not installed on any widget.
virtual int indexOf(const QWidget *) const
Searches for widget widget in this layout (not including child layouts).
qsizetype size() const noexcept
const_reference at(qsizetype i) const noexcept
void replace(qsizetype i, parameter_type t)
static QObjectPrivate * get(QObject *o)
QObject * parent() const
Returns a pointer to the parent object.
\inmodule QtCore\reentrant
constexpr bool isNull() const noexcept
Returns true if the rectangle is a null rectangle, otherwise returns false.
constexpr Policy verticalPolicy() const noexcept
Returns the vertical component of the size policy.
constexpr Policy horizontalPolicy() const noexcept
Returns the horizontal component of the size policy.
QLayoutItem * replaceAt(int index, QLayoutItem *newitem) override
QList< QLayoutItem * > list
QStackedLayout::StackingMode stackingMode
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.
StackingMode stackingMode
determines the way visibility of child widgets are handled.
void setCurrentIndex(int index)
int heightForWidth(int width) const override
\reimp
QSize minimumSize() const override
\reimp
void setStackingMode(StackingMode stackingMode)
QLayoutItem * itemAt(int) const override
\reimp
int insertWidget(int index, QWidget *w)
Inserts the given widget at the given index in this QStackedLayout.
bool hasHeightForWidth() const override
\reimp
void currentChanged(int index)
This signal is emitted whenever the current widget in the layout changes.
int currentIndex
the index position of the widget that is visible
int addWidget(QWidget *w)
Adds the given widget to the end of this layout and returns the index position of the widget.
void setGeometry(const QRect &rect) override
\reimp
void setCurrentWidget(QWidget *w)
Sets the current widget to be the specified widget.
QWidget * currentWidget() const
Returns the current widget, or \nullptr if there are no widgets in this layout.
~QStackedLayout()
Destroys this QStackedLayout.
QStackedLayout()
Constructs a QStackedLayout with no parent.
void addItem(QLayoutItem *item) override
\reimp
QLayoutItem * takeAt(int) override
\reimp
QSize sizeHint() const override
\reimp
int count() const override
the number of widgets contained in the layout
qDeleteAll(list.begin(), list.end())
Combined button and popup list for selecting options.
Q_WIDGETS_EXPORT QSize qSmartMinSize(const QSize &sizeHint, const QSize &minSizeHint, const QSize &minSize, const QSize &maxSize, const QSizePolicy &sizePolicy)
constexpr const T & qMin(const T &a, const T &b)
constexpr const T & qMax(const T &a, const T &b)
GLfloat GLfloat GLfloat w
[0]
GLint GLsizei GLsizei height
GLdouble GLdouble GLdouble GLdouble q
static bool qt_wasDeleted(const QWidget *w)
IUIAutomationTreeWalker __RPC__deref_out_opt IUIAutomationElement ** parent