summaryrefslogtreecommitdiffstats
path: root/examples/graphicsview/basicgraphicslayouts/layoutitem.h
diff options
context:
space:
mode:
Diffstat (limited to 'examples/graphicsview/basicgraphicslayouts/layoutitem.h')
-rw-r--r--examples/graphicsview/basicgraphicslayouts/layoutitem.h12
1 files changed, 8 insertions, 4 deletions
diff --git a/examples/graphicsview/basicgraphicslayouts/layoutitem.h b/examples/graphicsview/basicgraphicslayouts/layoutitem.h
index cbda636..8ec9038 100644
--- a/examples/graphicsview/basicgraphicslayouts/layoutitem.h
+++ b/examples/graphicsview/basicgraphicslayouts/layoutitem.h
@@ -44,18 +44,22 @@
#include <QtGui>
//! [0]
-class LayoutItem : public QGraphicsWidget
+class LayoutItem : public QGraphicsLayoutItem, public QGraphicsItem
{
- Q_OBJECT
-
public:
LayoutItem(QGraphicsItem *parent = 0);
~LayoutItem();
+ // Inherited from QGraphicsLayoutItem
+ void setGeometry(const QRectF &geom);
+ QSizeF sizeHint(Qt::SizeHint which, const QSizeF &constraint = QSizeF()) const;
+
+ // Inherited from QGraphicsItem
+ QRectF boundingRect() const;
void paint(QPainter *painter, const QStyleOptionGraphicsItem *option,
QWidget *widget = 0);
private:
- QPixmap *pix;
+ QPixmap *m_pix;
};
//! [0]