summaryrefslogtreecommitdiffstats
path: root/src/gui/graphicsview
diff options
context:
space:
mode:
Diffstat (limited to 'src/gui/graphicsview')
-rw-r--r--src/gui/graphicsview/qgraphicsanchorlayout_p.cpp9
-rw-r--r--src/gui/graphicsview/qgraphicsitem.cpp36
-rw-r--r--src/gui/graphicsview/qgraphicsscene.cpp4
-rw-r--r--src/gui/graphicsview/qgraphicswidget.cpp16
4 files changed, 39 insertions, 26 deletions
diff --git a/src/gui/graphicsview/qgraphicsanchorlayout_p.cpp b/src/gui/graphicsview/qgraphicsanchorlayout_p.cpp
index eaa8ac2..deda3ff 100644
--- a/src/gui/graphicsview/qgraphicsanchorlayout_p.cpp
+++ b/src/gui/graphicsview/qgraphicsanchorlayout_p.cpp
@@ -2966,11 +2966,12 @@ bool QGraphicsAnchorLayoutPrivate::solvePreferred(const QList<QSimplexConstraint
AnchorData *ad = variables.at(i);
ad->sizeAtPreferred = ad->result - g_offset;
}
-
- // Make sure we delete the simplex solver -before- we delete the
- // constraints used by it.
- delete simplex;
}
+
+ // Make sure we delete the simplex solver -before- we delete the
+ // constraints used by it.
+ delete simplex;
+
// Delete constraints and variables we created.
qDeleteAll(preferredConstraints);
qDeleteAll(preferredVariables);
diff --git a/src/gui/graphicsview/qgraphicsitem.cpp b/src/gui/graphicsview/qgraphicsitem.cpp
index 0c218fc..9092593 100644
--- a/src/gui/graphicsview/qgraphicsitem.cpp
+++ b/src/gui/graphicsview/qgraphicsitem.cpp
@@ -5378,11 +5378,9 @@ void QGraphicsItemPrivate::invalidateParentGraphicsEffectsRecursively()
{
QGraphicsItemPrivate *itemPrivate = this;
do {
- if (itemPrivate->graphicsEffect) {
+ if (itemPrivate->graphicsEffect && !itemPrivate->updateDueToGraphicsEffect) {
itemPrivate->notifyInvalidated = 1;
-
- if (!itemPrivate->updateDueToGraphicsEffect)
- static_cast<QGraphicsItemEffectSourcePrivate *>(itemPrivate->graphicsEffect->d_func()->source->d_func())->invalidateCache();
+ static_cast<QGraphicsItemEffectSourcePrivate *>(itemPrivate->graphicsEffect->d_func()->source->d_func())->invalidateCache();
}
} while ((itemPrivate = itemPrivate->parent ? itemPrivate->parent->d_ptr.data() : 0));
}
@@ -5690,21 +5688,27 @@ void QGraphicsItem::update(const QRectF &rect)
d_ptr->invalidateParentGraphicsEffectsRecursively();
#endif //QT_NO_GRAPHICSEFFECT
- if (CacheMode(d_ptr->cacheMode) != NoCache) {
- // Invalidate cache.
- QGraphicsItemCache *cache = d_ptr->extraItemCache();
- if (!cache->allExposed) {
- if (rect.isNull()) {
- cache->allExposed = true;
- cache->exposed.clear();
- } else {
- cache->exposed.append(rect);
+#ifndef QT_NO_GRAPHICSEFFECT
+ if (!d_ptr->updateDueToGraphicsEffect) {
+#endif
+ if (CacheMode(d_ptr->cacheMode) != NoCache) {
+ // Invalidate cache.
+ QGraphicsItemCache *cache = d_ptr->extraItemCache();
+ if (!cache->allExposed) {
+ if (rect.isNull()) {
+ cache->allExposed = true;
+ cache->exposed.clear();
+ } else {
+ cache->exposed.append(rect);
+ }
}
+ // Only invalidate cache; item is already dirty.
+ if (d_ptr->fullUpdatePending)
+ return;
}
- // Only invalidate cache; item is already dirty.
- if (d_ptr->fullUpdatePending)
- return;
+#ifndef QT_NO_GRAPHICSEFFECT
}
+#endif
if (d_ptr->scene)
d_ptr->scene->d_func()->markDirty(this, rect);
diff --git a/src/gui/graphicsview/qgraphicsscene.cpp b/src/gui/graphicsview/qgraphicsscene.cpp
index 1551944..867880c 100644
--- a/src/gui/graphicsview/qgraphicsscene.cpp
+++ b/src/gui/graphicsview/qgraphicsscene.cpp
@@ -3504,7 +3504,9 @@ bool QGraphicsScene::event(QEvent *event)
}
break;
case QEvent::WindowDeactivate:
- if (!--d->activationRefCount) {
+ if (d->activationRefCount > 0)
+ --d->activationRefCount;
+ if (!d->activationRefCount) {
if (d->activePanel) {
// Deactivate the active panel (but keep it so we can
// reactivate it later).
diff --git a/src/gui/graphicsview/qgraphicswidget.cpp b/src/gui/graphicsview/qgraphicswidget.cpp
index 965b1b34..c275968 100644
--- a/src/gui/graphicsview/qgraphicswidget.cpp
+++ b/src/gui/graphicsview/qgraphicswidget.cpp
@@ -152,7 +152,7 @@ QT_BEGIN_NAMESPACE
\row \o Qt::WA_SetPalette
\o Set by setPalette().
\row \o Qt::WA_SetFont
- \o Set by setPalette().
+ \o Set by setFont().
\row \o Qt::WA_WindowPropagation
\o Enables propagation to window widgets.
\endtable
@@ -1173,6 +1173,12 @@ QVariant QGraphicsWidget::itemChange(GraphicsItemChange change, const QVariant &
QApplication::sendEvent(this, &event);
break;
}
+ case ItemChildAddedChange: {
+ QGraphicsItem *child = qVariantValue<QGraphicsItem *>(value);
+ if (child->isWidget())
+ static_cast<QGraphicsWidget *>(child)->d_func()->resolveLayoutDirection();
+ break;
+ }
default:
break;
}
@@ -1668,7 +1674,7 @@ void QGraphicsWidget::hoverLeaveEvent(QGraphicsSceneHoverEvent *event)
/*!
This event handler, for \a event, can be reimplemented in a subclass to
- receive notifications for Qt::GrabMouse events.
+ receive notifications for QEvent::GrabMouse events.
\sa grabMouse(), grabKeyboard()
*/
@@ -1679,7 +1685,7 @@ void QGraphicsWidget::grabMouseEvent(QEvent *event)
/*!
This event handler, for \a event, can be reimplemented in a subclass to
- receive notifications for Qt::UngrabMouse events.
+ receive notifications for QEvent::UngrabMouse events.
\sa ungrabMouse(), ungrabKeyboard()
*/
@@ -1690,7 +1696,7 @@ void QGraphicsWidget::ungrabMouseEvent(QEvent *event)
/*!
This event handler, for \a event, can be reimplemented in a subclass to
- receive notifications for Qt::GrabKeyboard events.
+ receive notifications for QEvent::GrabKeyboard events.
\sa grabKeyboard(), grabMouse()
*/
@@ -1701,7 +1707,7 @@ void QGraphicsWidget::grabKeyboardEvent(QEvent *event)
/*!
This event handler, for \a event, can be reimplemented in a subclass to
- receive notifications for Qt::UngrabKeyboard events.
+ receive notifications for QEvent::UngrabKeyboard events.
\sa ungrabKeyboard(), ungrabMouse()
*/