diff options
author | Qt Forward Merge Bot <qt_forward_merge_bot@qt-project.org> | 2019-10-12 03:03:41 +0200 |
---|---|---|
committer | Qt Forward Merge Bot <qt_forward_merge_bot@qt-project.org> | 2019-10-12 03:03:41 +0200 |
commit | 56963a4485445d91bd1ab37ad0bdf22f504ea0ce (patch) | |
tree | 86b1679aa6b1b34986747d1e922025057e60db53 /src/imports/controls/imagine/qquickninepatchimage.cpp | |
parent | b57d78d32238fc7f7dcccb02be29aa3df3da531e (diff) | |
parent | 9685d8f97e8bb448c90dd87b4e86c0ea8438436a (diff) |
Merge remote-tracking branch 'origin/5.13' into 5.14
Change-Id: I0b00323007dc02adf98dc581e2694e44b298da29
Diffstat (limited to 'src/imports/controls/imagine/qquickninepatchimage.cpp')
-rw-r--r-- | src/imports/controls/imagine/qquickninepatchimage.cpp | 19 |
1 files changed, 18 insertions, 1 deletions
diff --git a/src/imports/controls/imagine/qquickninepatchimage.cpp b/src/imports/controls/imagine/qquickninepatchimage.cpp index c840c6f8..7d5e4f71 100644 --- a/src/imports/controls/imagine/qquickninepatchimage.cpp +++ b/src/imports/controls/imagine/qquickninepatchimage.cpp @@ -397,7 +397,24 @@ void QQuickNinePatchImage::pixmapChange() d->updatePatches(); } else { - d->resetNode = !d->ninePatch.isNull(); + /* + Only change resetNode when it's false; i.e. when no reset is pending. + updatePaintNode() will take care of setting it to false if it's true. + + Consider the following changes in source: + + normal.png => press.9.png => normal.png => focus.png + + If the last two events happen quickly, pixmapChange() can be called + twice with no call to updatePaintNode() inbetween. On the first call, + resetNode will be true (because ninePatch is not null since it is still + in the process of going from a 9-patch image to a regular image), + and on the second call, resetNode would be false if we didn't have this check. + This results in the oldNode never being deleted, and QQuickImage + tries to static_cast a QQuickNinePatchImage to a QSGInternalImageNode. + */ + if (!d->resetNode) + d->resetNode = !d->ninePatch.isNull(); d->ninePatch = QImage(); } QQuickImage::pixmapChange(); |