File indexing completed on 2025-01-18 10:09:34
0001
0002
0003
0004 #ifndef QGRAPHICSLAYOUT_H
0005 #define QGRAPHICSLAYOUT_H
0006
0007 #include <QtWidgets/qtwidgetsglobal.h>
0008 #include <QtWidgets/qgraphicslayoutitem.h>
0009
0010 QT_REQUIRE_CONFIG(graphicsview);
0011
0012 QT_BEGIN_NAMESPACE
0013
0014 class QGraphicsLayoutPrivate;
0015 class QGraphicsLayoutItem;
0016 class QGraphicsWidget;
0017
0018 class Q_WIDGETS_EXPORT QGraphicsLayout : public QGraphicsLayoutItem
0019 {
0020 public:
0021 QGraphicsLayout(QGraphicsLayoutItem *parent = nullptr);
0022 ~QGraphicsLayout();
0023
0024 void setContentsMargins(qreal left, qreal top, qreal right, qreal bottom);
0025 void getContentsMargins(qreal *left, qreal *top, qreal *right, qreal *bottom) const override;
0026
0027 void activate();
0028 bool isActivated() const;
0029 virtual void invalidate();
0030 virtual void updateGeometry() override;
0031
0032 virtual void widgetEvent(QEvent *e);
0033
0034 virtual int count() const = 0;
0035 virtual QGraphicsLayoutItem *itemAt(int i) const = 0;
0036 virtual void removeAt(int index) = 0;
0037
0038 static void setInstantInvalidatePropagation(bool enable);
0039 static bool instantInvalidatePropagation();
0040 protected:
0041 QGraphicsLayout(QGraphicsLayoutPrivate &, QGraphicsLayoutItem *);
0042 void addChildLayoutItem(QGraphicsLayoutItem *layoutItem);
0043
0044 private:
0045 Q_DISABLE_COPY(QGraphicsLayout)
0046 Q_DECLARE_PRIVATE(QGraphicsLayout)
0047 friend class QGraphicsWidget;
0048 };
0049
0050 #ifndef Q_QDOC
0051 Q_DECLARE_INTERFACE(QGraphicsLayout, "org.qt-project.Qt.QGraphicsLayout")
0052 #endif
0053
0054 QT_END_NAMESPACE
0055
0056 #endif