summaryrefslogtreecommitdiffstats
path: root/src/gui/graphicsview/qgraphicswidget.h
diff options
context:
space:
mode:
authorLars Knoll <lars.knoll@nokia.com>2009-06-03 12:14:09 (GMT)
committerAndreas Aardal Hanssen <andreas.aardal.hanssen@nokia.com>2009-06-11 09:49:23 (GMT)
commit05cb12eb18605aa32ff7a6761ff82d86aa339995 (patch)
treebb21b0addc7407361071d95daedd1466f0851dc4 /src/gui/graphicsview/qgraphicswidget.h
parent615f8a53355ea501e489eecddab1d5c4295cab80 (diff)
downloadQt-05cb12eb18605aa32ff7a6761ff82d86aa339995.zip
Qt-05cb12eb18605aa32ff7a6761ff82d86aa339995.tar.gz
Qt-05cb12eb18605aa32ff7a6761ff82d86aa339995.tar.bz2
add a QGraphicsObject class and change QGraphicsWidget and QGraphicsTextItem to inherit from it
This changes the inheritance hierarchy of QGraphicsWidget from multiply inheriting from QObject, QGraphicsItem and QGraphicsLayoutItem to inherit from QGraphicsObject and QGraphicsLayoutItem. QGraphicsObject then simply inherits from QObject and QGraphicsItem. This change is binary compatible as it will leave the vtable layout unchanged and as the parent class doesn't appear in the C++ name mangling on any of our platforms. It's also source compatible as it isn't noticable by existing code. The restriction we have on QGraphicsObject is that we can not add any new virtual methods to it, or add data members to the class. We can however implement a QGraphicsObjectprivate inheriting from QGraphicsItemPrivate if there is a need to add data members to the class. This change will allow us to now have one single base for all QGraphicsItems that inherit from QObject: QGraphicsTextItem, QGraphicsWidget and in the future QFxItem. Having that single base class will significantly simplify our work in the qml engine. Reviewed-by: Andreas
Diffstat (limited to 'src/gui/graphicsview/qgraphicswidget.h')
-rw-r--r--src/gui/graphicsview/qgraphicswidget.h3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/gui/graphicsview/qgraphicswidget.h b/src/gui/graphicsview/qgraphicswidget.h
index a5c9068..6f324cf 100644
--- a/src/gui/graphicsview/qgraphicswidget.h
+++ b/src/gui/graphicsview/qgraphicswidget.h
@@ -66,9 +66,10 @@ class QStyleOption;
class QGraphicsWidgetPrivate;
-class Q_GUI_EXPORT QGraphicsWidget : public QObject, public QGraphicsItem, public QGraphicsLayoutItem
+class Q_GUI_EXPORT QGraphicsWidget : public QGraphicsObject, public QGraphicsLayoutItem
{
Q_OBJECT
+ Q_INTERFACES(QGraphicsLayoutItem)
Q_PROPERTY(QPalette palette READ palette WRITE setPalette)
Q_PROPERTY(QFont font READ font WRITE setFont)
Q_PROPERTY(Qt::LayoutDirection layoutDirection READ layoutDirection WRITE setLayoutDirection RESET unsetLayoutDirection)