123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106 |
- #ifndef QSTACKEDLAYOUT_H
- #define QSTACKEDLAYOUT_H
- #include <QtWidgets/qlayout.h>
- QT_BEGIN_NAMESPACE
- class QStackedLayoutPrivate;
- class Q_WIDGETS_EXPORT QStackedLayout : public QLayout
- {
- Q_OBJECT
- Q_DECLARE_PRIVATE(QStackedLayout)
- Q_PROPERTY(int currentIndex READ currentIndex WRITE setCurrentIndex NOTIFY currentChanged)
- Q_PROPERTY(StackingMode stackingMode READ stackingMode WRITE setStackingMode)
- QDOC_PROPERTY(int count READ count)
- public:
- enum StackingMode {
- StackOne,
- StackAll
- };
- Q_ENUM(StackingMode)
- QStackedLayout();
- explicit QStackedLayout(QWidget *parent);
- explicit QStackedLayout(QLayout *parentLayout);
- ~QStackedLayout();
- int addWidget(QWidget *w);
- int insertWidget(int index, QWidget *w);
- QWidget *currentWidget() const;
- int currentIndex() const;
- using QLayout::widget;
- QWidget *widget(int) const;
- int count() const Q_DECL_OVERRIDE;
- StackingMode stackingMode() const;
- void setStackingMode(StackingMode stackingMode);
-
- void addItem(QLayoutItem *item) Q_DECL_OVERRIDE;
- QSize sizeHint() const Q_DECL_OVERRIDE;
- QSize minimumSize() const Q_DECL_OVERRIDE;
- QLayoutItem *itemAt(int) const Q_DECL_OVERRIDE;
- QLayoutItem *takeAt(int) Q_DECL_OVERRIDE;
- void setGeometry(const QRect &rect) Q_DECL_OVERRIDE;
- bool hasHeightForWidth() const Q_DECL_OVERRIDE;
- int heightForWidth(int width) const Q_DECL_OVERRIDE;
- Q_SIGNALS:
- void widgetRemoved(int index);
- void currentChanged(int index);
- public Q_SLOTS:
- void setCurrentIndex(int index);
- void setCurrentWidget(QWidget *w);
- private:
- Q_DISABLE_COPY(QStackedLayout)
- };
- QT_END_NAMESPACE
- #endif
|