diff options
author | Yann Bodson <yann.bodson@nokia.com> | 2010-06-17 06:50:10 (GMT) |
---|---|---|
committer | Yann Bodson <yann.bodson@nokia.com> | 2010-06-17 06:51:40 (GMT) |
commit | f0c02624791441d45cc8b2f084505cfc5add7237 (patch) | |
tree | 623986609c20c4370dd62b5ad277dbfaa01036c5 /src/declarative | |
parent | d2c04d76fc26300a33842a2ef52613f189a07c3c (diff) | |
download | Qt-f0c02624791441d45cc8b2f084505cfc5add7237.zip Qt-f0c02624791441d45cc8b2f084505cfc5add7237.tar.gz Qt-f0c02624791441d45cc8b2f084505cfc5add7237.tar.bz2 |
BorderImage is not updated when border values change
Task-number: QTBUG-11509
Reviewed-by: Michael Brasser
Diffstat (limited to 'src/declarative')
3 files changed, 16 insertions, 1 deletions
diff --git a/src/declarative/graphicsitems/qdeclarativeborderimage.cpp b/src/declarative/graphicsitems/qdeclarativeborderimage.cpp index cf458da..d4ca9eb 100644 --- a/src/declarative/graphicsitems/qdeclarativeborderimage.cpp +++ b/src/declarative/graphicsitems/qdeclarativeborderimage.cpp @@ -449,6 +449,11 @@ void QDeclarativeBorderImage::sciRequestFinished() } } +void QDeclarativeBorderImage::doUpdate() +{ + update(); +} + void QDeclarativeBorderImage::paint(QPainter *p, const QStyleOptionGraphicsItem *, QWidget *) { Q_D(QDeclarativeBorderImage); diff --git a/src/declarative/graphicsitems/qdeclarativeborderimage_p.h b/src/declarative/graphicsitems/qdeclarativeborderimage_p.h index 5e725ca..07f049e 100644 --- a/src/declarative/graphicsitems/qdeclarativeborderimage_p.h +++ b/src/declarative/graphicsitems/qdeclarativeborderimage_p.h @@ -91,6 +91,7 @@ private: void setGridScaledImage(const QDeclarativeGridScaledImage& sci); private Q_SLOTS: + void doUpdate(); void requestFinished(); void sciRequestFinished(); diff --git a/src/declarative/graphicsitems/qdeclarativeborderimage_p_p.h b/src/declarative/graphicsitems/qdeclarativeborderimage_p_p.h index 3535109..01e4a00 100644 --- a/src/declarative/graphicsitems/qdeclarativeborderimage_p_p.h +++ b/src/declarative/graphicsitems/qdeclarativeborderimage_p_p.h @@ -77,11 +77,20 @@ public: { } + QDeclarativeScaleGrid *getScaleGrid() { Q_Q(QDeclarativeBorderImage); - if (!border) + if (!border) { border = new QDeclarativeScaleGrid(q); + static int borderChangedSignalIdx = -1; + static int doUpdateSlotIdx = -1; + if (borderChangedSignalIdx < 0) + borderChangedSignalIdx = QDeclarativeScaleGrid::staticMetaObject.indexOfSignal("borderChanged()"); + if (doUpdateSlotIdx < 0) + doUpdateSlotIdx = QDeclarativeBorderImage::staticMetaObject.indexOfSlot("doUpdate()"); + QMetaObject::connect(border, borderChangedSignalIdx, q, doUpdateSlotIdx); + } return border; } |