aboutsummaryrefslogtreecommitdiffstats
path: root/src/quickcontrols2/qquickiconimage.cpp
Commit message (Collapse)AuthorAgeFilesLines
* QQuickIconImage: prevent color from being applied twiceMitch Curtis2018-07-301-1/+2
| | | | | | | | | | | | | | | | | | | | | QQuickIconImage::componentComplete() calls QQuickIconImagePrivate::updateIcon(), which loads the icon's image via QQuickImageBase::load(). That eventually calls QQuickImageBase::requestFinished(), which calls QQuickIconImage::pixmapChange(). That then calls QQuickIconImagePrivate::updateFillMode(), which can in turn cause QQuickIconImage::pixmapChange() to be called again, causing recursion. This recursion resulted in icon.color being applied twice. We already have a recursion check in place in QQuickIconImagePrivate::updateFillMode(), so we can reuse that in QQuickIconImage::pixmapChange() to know whether or not we should apply the color to the image. Task-number: QTBUG-69506 Change-Id: I5cd9edaa524c7ceb9c41c53a9efefcc4c647e246 Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
* Controls: use C++11 default member initializationJ-P Nurmi2018-05-041-8/+0
| | | | | Change-Id: Ief81868a8d314f7e7722fc0cb6670ae0dc4da50f Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* QQuickIconImage: fix crash with image providersJ-P Nurmi2017-10-231-2/+1
| | | | | | | | | | | | | QQuickImageBase::load() cannot call until the component creation is completed, because it requires an associated QML engine. All calls to updateIcon() are guarded with the appropriate isComponentComplete() check, but the sourceSizeChanged() signal was connected directly to updateIcon(). Establish the signal-slot connection at component completion to avoid calling updateIcon() to soon. Task-number: QTBUG-63959 Change-Id: I3c935291796dbae031d2728e1d51c55596a51cd0 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* QQuickIconImage: use QQuickPixmap::width/height instead of implicitSizeMitch Curtis2017-05-031-1/+1
| | | | | | | | | | | | | | QQuickPixmap's implicitSize is the original size of the image on disk before any scaling was done on it, which means that it doesn't account for the scaling that QQuickImageProviderWithOptions::loadSize() does. This was causing updateFillMode() to alternate between setting PreserveAspectFit and Pad when the icon color was changed. I was not able to come up with an auto test that reproduced the issue. Task-number: QTBUG-60528 Change-Id: I1cc31f0c50875d794c37a6fc76ff0942e44d271a Reviewed-by: J-P Nurmi <jpnurmi@qt.io>
* QQuickIconImage: fix file selectors for named theme iconsJ-P Nurmi2017-04-261-2/+10
| | | | | | | | | QQuickIconImage needs to be associated with a QML context to be able to call QQmlContext::resolvedUrl(), which in turn passes it to the URL interceptor aka. QQmlFileSelector. Change-Id: Iff34fb8316c765ac0ff04d5d7a6ab23002b31385 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* QQuickXxxImage: don't attempt to colorize null imagesJ-P Nurmi2017-04-191-4/+6
| | | | | | | | | | | QPainter threw such warnings: QPainter::begin: Paint device returned engine == 0, type: 3 QPainter::setCompositionMode: Painter not active Task-number: QTBUG-60200 Change-Id: I2cdedb7a547d0c069964929663297c969de9b2a7 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* QQuickIconImage: only call updateIcon() when necessaryMitch Curtis2017-03-221-1/+1
| | | | | | | | Unconditionally updating the icon was causing binding loops when changing the spacing of a Button with icons. Change-Id: Ie8511afea7ebc365a28f954091d9cc22883d2e40 Reviewed-by: J-P Nurmi <jpnurmi@qt.io>
* Add IconImageJ-P Nurmi2017-03-081-0/+211
This adds an internal helper item that will be used for showing icons on various controls (in follow-up commits). Change-Id: I792b423737023ba663211371f82fedb2b92857bb Reviewed-by: J-P Nurmi <jpnurmi@qt.io>