summaryrefslogtreecommitdiffstats
path: root/src/gui/graphicsview/qgraphicswidget.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/gui/graphicsview/qgraphicswidget.cpp')
-rw-r--r--src/gui/graphicsview/qgraphicswidget.cpp15
1 files changed, 14 insertions, 1 deletions
diff --git a/src/gui/graphicsview/qgraphicswidget.cpp b/src/gui/graphicsview/qgraphicswidget.cpp
index edb648b..8e439be 100644
--- a/src/gui/graphicsview/qgraphicswidget.cpp
+++ b/src/gui/graphicsview/qgraphicswidget.cpp
@@ -324,6 +324,14 @@ void QGraphicsWidget::resize(const QSizeF &size)
*/
/*!
+
+ \fn QGraphicsWidget::geometryChanged()
+
+ This signal gets emitted whenever the geometry of the item changes
+ \internal
+*/
+
+/*!
\property QGraphicsWidget::geometry
\brief the geometry of the widget
@@ -384,13 +392,17 @@ void QGraphicsWidget::setGeometry(const QRectF &rect)
}
QSizeF oldSize = size();
QGraphicsLayoutItem::setGeometry(newGeom);
-
+ emit geometryChanged();
// Send resize event
bool resized = newGeom.size() != oldSize;
if (resized) {
QGraphicsSceneResizeEvent re;
re.setOldSize(oldSize);
re.setNewSize(newGeom.size());
+ if (oldSize.width() != newGeom.size().width())
+ emit widthChanged();
+ if (oldSize.height() != newGeom.size().height())
+ emit heightChanged();
QApplication::sendEvent(this, &re);
}
}
@@ -795,6 +807,7 @@ void QGraphicsWidget::setLayout(QGraphicsLayout *l)
l->setParentLayoutItem(this);
l->d_func()->reparentChildItems(this);
l->invalidate();
+ emit layoutChanged();
}
/*!