summaryrefslogtreecommitdiffstats
path: root/src/gui/graphicsview/qgraphicswidget.cpp
diff options
context:
space:
mode:
authorDavid Boddie <dboddie@trolltech.com>2009-08-26 12:35:45 (GMT)
committerDavid Boddie <dboddie@trolltech.com>2009-08-26 12:35:45 (GMT)
commit7e30c92186878beb300a13093c3668ae8a10f2be (patch)
tree313aa7f7a8345e65b7803bae1cb68ad866bdadbc /src/gui/graphicsview/qgraphicswidget.cpp
parentb98042831f4f6f6c5844965731b2dd64f27c076e (diff)
parentaeb4251c76560a070ce22320be00e860950b4668 (diff)
downloadQt-7e30c92186878beb300a13093c3668ae8a10f2be.zip
Qt-7e30c92186878beb300a13093c3668ae8a10f2be.tar.gz
Qt-7e30c92186878beb300a13093c3668ae8a10f2be.tar.bz2
Merge branch 'master' of git@scm.dev.nokia.troll.no:qt/qt
Diffstat (limited to 'src/gui/graphicsview/qgraphicswidget.cpp')
-rw-r--r--src/gui/graphicsview/qgraphicswidget.cpp12
1 files changed, 10 insertions, 2 deletions
diff --git a/src/gui/graphicsview/qgraphicswidget.cpp b/src/gui/graphicsview/qgraphicswidget.cpp
index a833d4b..7f9fe65 100644
--- a/src/gui/graphicsview/qgraphicswidget.cpp
+++ b/src/gui/graphicsview/qgraphicswidget.cpp
@@ -168,6 +168,8 @@ QT_BEGIN_NAMESPACE
\sa QGraphicsProxyWidget, QGraphicsItem, {Widgets and Layouts}
*/
+bool qt_sendSpontaneousEvent(QObject *receiver, QEvent *event);
+
/*!
Constructs a QGraphicsWidget instance. The optional \a parent argument is
passed to QGraphicsItem's constructor. The optional \a wFlags argument
@@ -334,7 +336,7 @@ void QGraphicsWidget::resize(const QSizeF &size)
void QGraphicsWidget::setGeometry(const QRectF &rect)
{
QGraphicsWidgetPrivate *wd = QGraphicsWidget::d_func();
- QGraphicsLayoutItemPrivate *d = QGraphicsLayoutItem::d_ptr;
+ QGraphicsLayoutItemPrivate *d = QGraphicsLayoutItem::d_ptr.data();
QRectF newGeom;
QPointF oldPos = d->geom.topLeft();
if (!wd->inSetPos) {
@@ -379,6 +381,8 @@ void QGraphicsWidget::setGeometry(const QRectF &rect)
QSizeF oldSize = size();
QGraphicsLayoutItem::setGeometry(newGeom);
+ wd->invalidateCachedClipPathRecursively();
+
// Send resize event
bool resized = newGeom.size() != oldSize;
if (resized) {
@@ -1097,7 +1101,11 @@ QVariant QGraphicsWidget::propertyChange(const QString &propertyName, const QVar
*/
bool QGraphicsWidget::sceneEvent(QEvent *event)
{
- return QCoreApplication::sendEvent(this, event) || QGraphicsItem::sceneEvent(event);
+ bool spont = event->spontaneous();
+ if (spont ? qt_sendSpontaneousEvent(this, event) : QApplication::sendEvent(this, event))
+ return true;
+ event->spont = spont;
+ return QGraphicsItem::sceneEvent(event);
}
/*!