diff options
author | Bjørn Erik Nilsen <bjorn.nilsen@nokia.com> | 2009-08-19 08:39:40 (GMT) |
---|---|---|
committer | Bjørn Erik Nilsen <bjorn.nilsen@nokia.com> | 2009-08-19 08:39:40 (GMT) |
commit | 928f902015a0ad97279ce6e2ac4cb85e5baed684 (patch) | |
tree | c3afd6f5b72b32136ab9d40788e1cf05d7b91763 /src/gui/graphicsview | |
parent | 17d6f2a59fe2b170087cdf7074807c6a2dce1043 (diff) | |
parent | 5fb5c01bd0ac234eaca890d97053c7b0772861a3 (diff) | |
download | Qt-928f902015a0ad97279ce6e2ac4cb85e5baed684.zip Qt-928f902015a0ad97279ce6e2ac4cb85e5baed684.tar.gz Qt-928f902015a0ad97279ce6e2ac4cb85e5baed684.tar.bz2 |
Merge commit 'qt/master' into kinetic-graphicseffect
Conflicts:
src/gui/graphicsview/qgraphicsitem_p.h
Diffstat (limited to 'src/gui/graphicsview')
20 files changed, 51 insertions, 48 deletions
diff --git a/src/gui/graphicsview/qgraphicsgridlayout.cpp b/src/gui/graphicsview/qgraphicsgridlayout.cpp index ee7048f..0fb284f 100644 --- a/src/gui/graphicsview/qgraphicsgridlayout.cpp +++ b/src/gui/graphicsview/qgraphicsgridlayout.cpp @@ -44,7 +44,7 @@ \brief The QGraphicsGridLayout class provides a grid layout for managing widgets in Graphics View. \since 4.4 - \ingroup multimedia + \ingroup graphicsview-api The most common way to use QGraphicsGridLayout is to construct an object diff --git a/src/gui/graphicsview/qgraphicsitem.cpp b/src/gui/graphicsview/qgraphicsitem.cpp index 66f5f22..50b5b9e 100644 --- a/src/gui/graphicsview/qgraphicsitem.cpp +++ b/src/gui/graphicsview/qgraphicsitem.cpp @@ -44,7 +44,7 @@ \brief The QGraphicsItem class is the base class for all graphical items in a QGraphicsScene. \since 4.2 - \ingroup multimedia + \ingroup graphicsview-api It provides a light-weight foundation for writing your own custom items. @@ -328,6 +328,10 @@ used for Asian languages. This flag was introduced in Qt 4.6. + \value ItemNegativeZStacksBehindParent The item automatically stacks behind + it's parent if it's z-value is negative. This flag enables setZValue() to + toggle ItemStacksBehindParent. + \value ItemAutoDetectsFocusProxy The item will assign any child that gains input focus as its focus proxy. See also focusProxy(). This flag was introduced in Qt 4.6. @@ -1563,6 +1567,11 @@ void QGraphicsItem::setFlags(GraphicsItemFlags flags) d_ptr->scene->d_func()->updateInputMethodSensitivityInViews(); } + if ((flags & ItemNegativeZStacksBehindParent) != (oldFlags & ItemNegativeZStacksBehindParent)) { + // Update stack-behind. + setFlag(ItemStacksBehindParent, d_ptr->z < qreal(0.0)); + } + if (d_ptr->scene) { d_ptr->scene->d_func()->markDirty(this, QRectF(), /*invalidateChildren=*/true, @@ -3829,6 +3838,9 @@ void QGraphicsItem::setZValue(qreal z) itemChange(ItemZValueHasChanged, newZVariant); + if (d_ptr->flags & ItemNegativeZStacksBehindParent) + setFlag(QGraphicsItem::ItemStacksBehindParent, z < qreal(0.0)); + if (d_ptr->isObject) emit static_cast<QGraphicsObject *>(this)->zChanged(); } @@ -6952,11 +6964,12 @@ QGraphicsObject::QGraphicsObject(QGraphicsItemPrivate &dd, QGraphicsItem *parent By default, this property is true. - \sa QGraphicsItem::isEnabled(), QGraphicsItem::setEnabled(), enabledChanged() + \sa QGraphicsItem::isEnabled(), QGraphicsItem::setEnabled() + \sa QGraphicsObject::enabledChanged() */ /*! - \fn QGraphicsObject::enabledChanged() + \fn void QGraphicsObject::enabledChanged() This signal gets emitted whenever the item get's enabled or disabled. @@ -7008,7 +7021,7 @@ QGraphicsObject::QGraphicsObject(QGraphicsItemPrivate &dd, QGraphicsItem *parent \brief The QAbstractGraphicsShapeItem class provides a common base for all path items. \since 4.2 - \ingroup multimedia + \ingroup graphicsview-api This class does not fully implement an item by itself; in particular, it does not implement boundingRect() and paint(), which are inherited by @@ -7143,7 +7156,6 @@ QPainterPath QAbstractGraphicsShapeItem::opaqueArea() const \brief The QGraphicsPathItem class provides a path item that you can add to a QGraphicsScene. \since 4.2 - \ingroup multimedia \ingroup graphicsview-api To set the item's path, pass a QPainterPath to QGraphicsPathItem's @@ -7346,7 +7358,6 @@ QVariant QGraphicsPathItem::extension(const QVariant &variant) const \brief The QGraphicsRectItem class provides a rectangle item that you can add to a QGraphicsScene. \since 4.2 - \ingroup multimedia \ingroup graphicsview-api To set the item's rectangle, pass a QRectF to QGraphicsRectItem's @@ -7591,7 +7602,6 @@ QVariant QGraphicsRectItem::extension(const QVariant &variant) const \brief The QGraphicsEllipseItem class provides an ellipse item that you can add to a QGraphicsScene. \since 4.2 - \ingroup multimedia \ingroup graphicsview-api QGraphicsEllipseItem respresents an ellipse with a fill and an outline, @@ -7908,7 +7918,6 @@ QVariant QGraphicsEllipseItem::extension(const QVariant &variant) const \brief The QGraphicsPolygonItem class provides a polygon item that you can add to a QGraphicsScene. \since 4.2 - \ingroup multimedia \ingroup graphicsview-api To set the item's polygon, pass a QPolygonF to @@ -8142,7 +8151,6 @@ QVariant QGraphicsPolygonItem::extension(const QVariant &variant) const \brief The QGraphicsLineItem class provides a line item that you can add to a QGraphicsScene. \since 4.2 - \ingroup multimedia \ingroup graphicsview-api To set the item's line, pass a QLineF to QGraphicsLineItem's @@ -8404,7 +8412,6 @@ QVariant QGraphicsLineItem::extension(const QVariant &variant) const \brief The QGraphicsPixmapItem class provides a pixmap item that you can add to a QGraphicsScene. \since 4.2 - \ingroup multimedia \ingroup graphicsview-api To set the item's pixmap, pass a QPixmap to QGraphicsPixmapItem's @@ -8768,7 +8775,6 @@ QVariant QGraphicsPixmapItem::extension(const QVariant &variant) const \brief The QGraphicsTextItem class provides a text item that you can add to a QGraphicsScene to display formatted text. \since 4.2 - \ingroup multimedia \ingroup graphicsview-api If you only need to show plain text in an item, consider using QGraphicsSimpleTextItem @@ -9633,7 +9639,6 @@ void QGraphicsSimpleTextItemPrivate::updateBoundingRect() \brief The QGraphicsSimpleTextItem class provides a simple text path item that you can add to a QGraphicsScene. \since 4.2 - \ingroup multimedia \ingroup graphicsview-api To set the item's text, you can either pass a QString to @@ -9869,7 +9874,6 @@ QVariant QGraphicsSimpleTextItem::extension(const QVariant &variant) const \brief The QGraphicsItemGroup class provides treating a group of items as one. \since 4.2 - \ingroup multimedia \ingroup graphicsview-api A QGraphicsItemGroup is a special type of compound item that @@ -10342,6 +10346,9 @@ QDebug operator<<(QDebug debug, QGraphicsItem::GraphicsItemFlag flag) case QGraphicsItem::ItemAcceptsInputMethod: str = "ItemAcceptsInputMethod"; break; + case QGraphicsItem::ItemNegativeZStacksBehindParent: + str = "ItemNegativeZStacksBehindParent"; + break; case QGraphicsItem::ItemAutoDetectsFocusProxy: str = "ItemAutoDetectsFocusProxy"; break; diff --git a/src/gui/graphicsview/qgraphicsitem.h b/src/gui/graphicsview/qgraphicsitem.h index fdf9463..b4c7ed8 100644 --- a/src/gui/graphicsview/qgraphicsitem.h +++ b/src/gui/graphicsview/qgraphicsitem.h @@ -102,7 +102,8 @@ public: ItemHasNoContents = 0x400, ItemSendsGeometryChanges = 0x800, ItemAcceptsInputMethod = 0x1000, - ItemAutoDetectsFocusProxy = 0x2000 + ItemAutoDetectsFocusProxy = 0x2000, + ItemNegativeZStacksBehindParent = 0x4000 // NB! Don't forget to increase the d_ptr->flags bit field by 1 when adding a new flag. }; Q_DECLARE_FLAGS(GraphicsItemFlags, GraphicsItemFlag) @@ -460,6 +461,7 @@ private: }; Q_DECLARE_OPERATORS_FOR_FLAGS(QGraphicsItem::GraphicsItemFlags) +Q_DECLARE_INTERFACE(QGraphicsItem, "com.trolltech.Qt.QGraphicsItem") inline void QGraphicsItem::setPos(qreal ax, qreal ay) { setPos(QPointF(ax, ay)); } @@ -512,9 +514,9 @@ class Q_GUI_EXPORT QGraphicsObject : public QObject, public QGraphicsItem Q_OBJECT Q_PROPERTY(QGraphicsObject * parent READ parentObject WRITE setParentItem NOTIFY parentChanged DESIGNABLE false) Q_PROPERTY(QString id READ objectName WRITE setObjectName) - Q_PROPERTY(qreal opacity READ opacity WRITE setOpacity NOTIFY opacityChanged) + Q_PROPERTY(qreal opacity READ opacity WRITE setOpacity NOTIFY opacityChanged FINAL) Q_PROPERTY(bool enabled READ isEnabled WRITE setEnabled NOTIFY enabledChanged) - Q_PROPERTY(bool visible READ isVisible WRITE setVisible NOTIFY visibleChanged) + Q_PROPERTY(bool visible READ isVisible WRITE setVisible NOTIFY visibleChanged FINAL) Q_PROPERTY(QPointF pos READ pos WRITE setPos) Q_PROPERTY(qreal x READ x WRITE setX NOTIFY xChanged) Q_PROPERTY(qreal y READ y WRITE setY NOTIFY yChanged) @@ -522,6 +524,7 @@ class Q_GUI_EXPORT QGraphicsObject : public QObject, public QGraphicsItem Q_PROPERTY(qreal rotation READ rotation WRITE setRotation NOTIFY rotationChanged) Q_PROPERTY(qreal scale READ scale WRITE setScale NOTIFY scaleChanged) Q_PROPERTY(QPointF transformOriginPoint READ transformOriginPoint WRITE setTransformOriginPoint) + Q_INTERFACES(QGraphicsItem) public: QGraphicsObject(QGraphicsItem *parent = 0); diff --git a/src/gui/graphicsview/qgraphicsitem_p.h b/src/gui/graphicsview/qgraphicsitem_p.h index a6f833c..a5854b1 100644 --- a/src/gui/graphicsview/qgraphicsitem_p.h +++ b/src/gui/graphicsview/qgraphicsitem_p.h @@ -96,7 +96,7 @@ public: void purge(); }; -class Q_AUTOTEST_EXPORT QGraphicsItemPrivate +class Q_GUI_EXPORT QGraphicsItemPrivate { Q_DECLARE_PUBLIC(QGraphicsItem) public: @@ -170,6 +170,7 @@ public: sceneTransformTranslateOnly(0), notifyBoundingRectChanged(0), notifyInvalidated(0), + mouseSetsFocus(1), globalStackingOrder(-1), q_ptr(0) { @@ -206,7 +207,7 @@ public: virtual QVariant inputMethodQueryHelper(Qt::InputMethodQuery query) const; static bool movableAncestorIsSelected(const QGraphicsItem *item); - void setPosHelper(const QPointF &pos); + virtual void setPosHelper(const QPointF &pos); void setTransformHelper(const QTransform &transform); void appendGraphicsTransform(QGraphicsTransform *t); void setVisibleHelper(bool newVisible, bool explicitly, bool update = true); @@ -458,7 +459,7 @@ public: // New 32 bits quint32 fullUpdatePending : 1; - quint32 flags : 14; + quint32 flags : 15; quint32 dirtyChildrenBoundingRect : 1; quint32 paintedViewBoundingRectsNeedRepaint : 1; quint32 dirtySceneTransform : 1; @@ -473,7 +474,8 @@ public: quint32 sceneTransformTranslateOnly : 1; quint32 notifyBoundingRectChanged : 1; quint32 notifyInvalidated : 1; - quint32 unused : 3; // feel free to use + quint32 mouseSetsFocus : 1; + quint32 unused : 1; // feel free to use // Optional stacking order int globalStackingOrder; diff --git a/src/gui/graphicsview/qgraphicsitemanimation.cpp b/src/gui/graphicsview/qgraphicsitemanimation.cpp index 0d7a3c6..c9b95ad 100644 --- a/src/gui/graphicsview/qgraphicsitemanimation.cpp +++ b/src/gui/graphicsview/qgraphicsitemanimation.cpp @@ -44,7 +44,6 @@ \brief The QGraphicsItemAnimation class provides simple animation support for QGraphicsItem. \since 4.2 - \ingroup multimedia \ingroup graphicsview-api The QGraphicsItemAnimation class animates a QGraphicsItem. You can diff --git a/src/gui/graphicsview/qgraphicslayout.cpp b/src/gui/graphicsview/qgraphicslayout.cpp index 3f039c6..58c174c 100644 --- a/src/gui/graphicsview/qgraphicslayout.cpp +++ b/src/gui/graphicsview/qgraphicslayout.cpp @@ -57,7 +57,6 @@ QT_BEGIN_NAMESPACE \brief The QGraphicsLayout class provides the base class for all layouts in Graphics View. \since 4.4 - \ingroup multimedia \ingroup graphicsview-api QGraphicsLayout is an abstract class that defines a virtual API for diff --git a/src/gui/graphicsview/qgraphicslayout.h b/src/gui/graphicsview/qgraphicslayout.h index d7e087b..1a21e53 100644 --- a/src/gui/graphicsview/qgraphicslayout.h +++ b/src/gui/graphicsview/qgraphicslayout.h @@ -85,6 +85,8 @@ private: friend class QGraphicsWidget; }; +Q_DECLARE_INTERFACE(QGraphicsLayout, "com.trolltech.Qt.QGraphicsLayout") + #endif QT_END_NAMESPACE diff --git a/src/gui/graphicsview/qgraphicslayoutitem.cpp b/src/gui/graphicsview/qgraphicslayoutitem.cpp index 83e4888..6a25ade 100644 --- a/src/gui/graphicsview/qgraphicslayoutitem.cpp +++ b/src/gui/graphicsview/qgraphicslayoutitem.cpp @@ -264,7 +264,6 @@ void QGraphicsLayoutItemPrivate::setSizeComponent( \brief The QGraphicsLayoutItem class can be inherited to allow your custom items to be managed by layouts. \since 4.4 - \ingroup multimedia \ingroup graphicsview-api QGraphicsLayoutItem is an abstract class that defines a set of virtual diff --git a/src/gui/graphicsview/qgraphicslayoutitem.h b/src/gui/graphicsview/qgraphicslayoutitem.h index 44c1c0f..f315404 100644 --- a/src/gui/graphicsview/qgraphicslayoutitem.h +++ b/src/gui/graphicsview/qgraphicslayoutitem.h @@ -121,6 +121,8 @@ private: friend class QGraphicsLayout; }; +Q_DECLARE_INTERFACE(QGraphicsLayoutItem, "com.trolltech.Qt.QGraphicsLayoutItem") + inline void QGraphicsLayoutItem::setMinimumSize(qreal aw, qreal ah) { setMinimumSize(QSizeF(aw, ah)); } inline void QGraphicsLayoutItem::setPreferredSize(qreal aw, qreal ah) diff --git a/src/gui/graphicsview/qgraphicslinearlayout.cpp b/src/gui/graphicsview/qgraphicslinearlayout.cpp index c0ff00e..185780a 100644 --- a/src/gui/graphicsview/qgraphicslinearlayout.cpp +++ b/src/gui/graphicsview/qgraphicslinearlayout.cpp @@ -44,7 +44,6 @@ \brief The QGraphicsLinearLayout class provides a horizontal or vertical layout for managing widgets in Graphics View. \since 4.4 - \ingroup multimedia \ingroup graphicsview-api The default orientation for a linear layout is Qt::Horizontal. You can diff --git a/src/gui/graphicsview/qgraphicsproxywidget.cpp b/src/gui/graphicsview/qgraphicsproxywidget.cpp index 784ee0e..4f626a2 100644 --- a/src/gui/graphicsview/qgraphicsproxywidget.cpp +++ b/src/gui/graphicsview/qgraphicsproxywidget.cpp @@ -67,7 +67,6 @@ QT_BEGIN_NAMESPACE \brief The QGraphicsProxyWidget class provides a proxy layer for embedding a QWidget in a QGraphicsScene. \since 4.4 - \ingroup multimedia \ingroup graphicsview-api QGraphicsProxyWidget embeds QWidget-based widgets, for example, a diff --git a/src/gui/graphicsview/qgraphicsscene.cpp b/src/gui/graphicsview/qgraphicsscene.cpp index e4a02e2..db783ad 100644 --- a/src/gui/graphicsview/qgraphicsscene.cpp +++ b/src/gui/graphicsview/qgraphicsscene.cpp @@ -44,9 +44,8 @@ \brief The QGraphicsScene class provides a surface for managing a large number of 2D graphical items. \since 4.2 - \ingroup multimedia \ingroup graphicsview-api - \mainclass + The class serves as a container for QGraphicsItems. It is used together with QGraphicsView for visualizing graphical items, such as lines, @@ -1080,7 +1079,7 @@ void QGraphicsScenePrivate::mousePressEventHandler(QGraphicsSceneMouseEvent *mou // Set focus on the topmost enabled item that can take focus. bool setFocus = false; foreach (QGraphicsItem *item, cachedItemsUnderMouse) { - if (item->isEnabled() && (item->flags() & QGraphicsItem::ItemIsFocusable)) { + if (item->isEnabled() && ((item->flags() & QGraphicsItem::ItemIsFocusable) && item->d_ptr->mouseSetsFocus)) { if (!item->isWidget() || ((QGraphicsWidget *)item)->focusPolicy() & Qt::ClickFocus) { setFocus = true; if (item != q->focusItem()) @@ -3803,7 +3802,8 @@ void QGraphicsScene::wheelEvent(QGraphicsSceneWheelEvent *wheelEvent) bool hasSetFocus = false; foreach (QGraphicsItem *item, wheelCandidates) { - if (!hasSetFocus && item->isEnabled() && (item->flags() & QGraphicsItem::ItemIsFocusable)) { + if (!hasSetFocus && item->isEnabled() + && ((item->flags() & QGraphicsItem::ItemIsFocusable) && item->d_ptr->mouseSetsFocus)) { if (item->isWidget() && static_cast<QGraphicsWidget *>(item)->focusPolicy() == Qt::WheelFocus) { hasSetFocus = true; if (item != focusItem()) @@ -5345,7 +5345,7 @@ bool QGraphicsScenePrivate::sendTouchBeginEvent(QGraphicsItem *origin, QTouchEve // Set focus on the topmost enabled item that can take focus. bool setFocus = false; foreach (QGraphicsItem *item, cachedItemsUnderMouse) { - if (item->isEnabled() && (item->flags() & QGraphicsItem::ItemIsFocusable)) { + if (item->isEnabled() && ((item->flags() & QGraphicsItem::ItemIsFocusable) && item->d_ptr->mouseSetsFocus)) { if (!item->isWidget() || ((QGraphicsWidget *)item)->focusPolicy() & Qt::ClickFocus) { setFocus = true; if (item != q->focusItem()) diff --git a/src/gui/graphicsview/qgraphicsscene_p.h b/src/gui/graphicsview/qgraphicsscene_p.h index 7beae20..a405f31 100644 --- a/src/gui/graphicsview/qgraphicsscene_p.h +++ b/src/gui/graphicsview/qgraphicsscene_p.h @@ -59,6 +59,7 @@ #include "qgraphicssceneevent.h" #include "qgraphicsview.h" +#include "qgraphicsview_p.h" #include "qgraphicsitem_p.h" #include <private/qobject_p.h> diff --git a/src/gui/graphicsview/qgraphicsscenebsptreeindex.cpp b/src/gui/graphicsview/qgraphicsscenebsptreeindex.cpp index 4dccde9..2d2ce02 100644 --- a/src/gui/graphicsview/qgraphicsscenebsptreeindex.cpp +++ b/src/gui/graphicsview/qgraphicsscenebsptreeindex.cpp @@ -44,9 +44,8 @@ \brief The QGraphicsSceneBspTreeIndex class provides an implementation of a BSP indexing algorithm for discovering items in QGraphicsScene. \since 4.6 - \ingroup multimedia \ingroup graphicsview-api - \mainclass + \internal QGraphicsSceneBspTreeIndex index use a BSP(Binary Space Partitioning) diff --git a/src/gui/graphicsview/qgraphicssceneevent.cpp b/src/gui/graphicsview/qgraphicssceneevent.cpp index b89d6ba..90f1531 100644 --- a/src/gui/graphicsview/qgraphicssceneevent.cpp +++ b/src/gui/graphicsview/qgraphicssceneevent.cpp @@ -44,7 +44,6 @@ \brief The QGraphicsSceneEvent class provides a base class for all graphics view related events. \since 4.2 - \ingroup multimedia \ingroup graphicsview-api When a QGraphicsView receives Qt mouse, keyboard, and drag and @@ -86,7 +85,6 @@ \brief The QGraphicsSceneMouseEvent class provides mouse events in the graphics view framework. \since 4.2 - \ingroup multimedia \ingroup graphicsview-api When a QGraphicsView receives a QMouseEvent, it translates it to @@ -111,7 +109,6 @@ \brief The QGraphicsSceneWheelEvent class provides wheel events in the graphics view framework. \since 4.2 - \ingroup multimedia \ingroup graphicsview-api \l{QWheelEvent}{QWheelEvent}s received by a QGraphicsView are translated @@ -128,7 +125,6 @@ \brief The QGraphicsSceneContextMenuEvent class provides context menu events in the graphics view framework. \since 4.2 - \ingroup multimedia \ingroup graphicsview-api A QContextMenuEvent received by a QGraphicsView is translated @@ -160,7 +156,6 @@ \brief The QGraphicsSceneHoverEvent class provides hover events in the graphics view framework. \since 4.2 - \ingroup multimedia \ingroup graphicsview-api When a QGraphicsView receives a QHoverEvent event, it translates @@ -176,7 +171,6 @@ \brief The QGraphicsSceneHelpEvent class provides events when a tooltip is requested. \since 4.2 - \ingroup multimedia \ingroup graphicsview-api When a QGraphicsView receives a QEvent of type @@ -201,7 +195,6 @@ \brief The QGraphicsSceneDragDropEvent class provides events for drag and drop in the graphics view framework. \since 4.2 - \ingroup multimedia \ingroup graphicsview-api QGraphicsView inherits the drag and drop functionality provided @@ -226,7 +219,6 @@ \brief The QGraphicsSceneResizeEvent class provides events for widget resizing in the graphics view framework. \since 4.4 - \ingroup multimedia \ingroup graphicsview-api A QGraphicsWidget sends itself a QGraphicsSceneResizeEvent immediately @@ -243,7 +235,6 @@ \brief The QGraphicsSceneMoveEvent class provides events for widget moving in the graphics view framework. \since 4.4 - \ingroup multimedia \ingroup graphicsview-api A QGraphicsWidget sends itself a QGraphicsSceneMoveEvent immediately when diff --git a/src/gui/graphicsview/qgraphicssceneindex.cpp b/src/gui/graphicsview/qgraphicssceneindex.cpp index 37a2fc3..feb44bb 100644 --- a/src/gui/graphicsview/qgraphicssceneindex.cpp +++ b/src/gui/graphicsview/qgraphicssceneindex.cpp @@ -43,9 +43,8 @@ \brief The QGraphicsSceneIndex class provides a base class to implement a custom indexing algorithm for discovering items in QGraphicsScene. \since 4.6 - \ingroup multimedia \ingroup graphicsview-api - \mainclass + \internal The QGraphicsSceneIndex class provides a base class to implement diff --git a/src/gui/graphicsview/qgraphicstransform.cpp b/src/gui/graphicsview/qgraphicstransform.cpp index 95f137d..86f5b08 100644 --- a/src/gui/graphicsview/qgraphicstransform.cpp +++ b/src/gui/graphicsview/qgraphicstransform.cpp @@ -44,6 +44,7 @@ \brief The QGraphicsTransform class is an abstract base class for building advanced transformations on QGraphicsItems. \since 4.6 + \ingroup graphicsview-api As an alternative to QGraphicsItem::transform, QGraphicsTransform lets you create and control advanced transformations that can be configured diff --git a/src/gui/graphicsview/qgraphicsview.cpp b/src/gui/graphicsview/qgraphicsview.cpp index 91e654c..e9029c3 100644 --- a/src/gui/graphicsview/qgraphicsview.cpp +++ b/src/gui/graphicsview/qgraphicsview.cpp @@ -48,9 +48,8 @@ static const int QGRAPHICSVIEW_PREALLOC_STYLE_OPTIONS = 503; // largest prime < \brief The QGraphicsView class provides a widget for displaying the contents of a QGraphicsScene. \since 4.2 - \ingroup multimedia \ingroup graphicsview-api - \mainclass + QGraphicsView visualizes the contents of a QGraphicsScene in a scrollable viewport. To create a scene with geometrical items, see QGraphicsScene's diff --git a/src/gui/graphicsview/qgraphicswidget.cpp b/src/gui/graphicsview/qgraphicswidget.cpp index 64881b5..a833d4b 100644 --- a/src/gui/graphicsview/qgraphicswidget.cpp +++ b/src/gui/graphicsview/qgraphicswidget.cpp @@ -74,7 +74,6 @@ QT_BEGIN_NAMESPACE \brief The QGraphicsWidget class is the base class for all widget items in a QGraphicsScene. \since 4.4 - \ingroup multimedia \ingroup graphicsview-api QGraphicsWidget is an extended base item that provides extra functionality @@ -258,7 +257,7 @@ QGraphicsWidget::~QGraphicsWidget() //we check if we have a layout previously if (d->layout) { - delete d->layout; + QGraphicsLayout *temp = d->layout; foreach (QGraphicsItem * item, childItems()) { // In case of a custom layout which doesn't remove and delete items, we ensure that // the parent layout item does not point to the deleted layout. This code is here to @@ -269,6 +268,8 @@ QGraphicsWidget::~QGraphicsWidget() widget->setParentLayoutItem(0); } } + d->layout = 0; + delete temp; } // Remove this graphics widget from widgetStyles diff --git a/src/gui/graphicsview/qgraphicswidget.h b/src/gui/graphicsview/qgraphicswidget.h index 62b353a..57015f9 100644 --- a/src/gui/graphicsview/qgraphicswidget.h +++ b/src/gui/graphicsview/qgraphicswidget.h @@ -69,6 +69,7 @@ class QGraphicsWidgetPrivate; class Q_GUI_EXPORT QGraphicsWidget : public QGraphicsObject, public QGraphicsLayoutItem { Q_OBJECT + Q_INTERFACES(QGraphicsItem 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) |