aboutsummaryrefslogtreecommitdiffstats
path: root/src/quick/util/qquickimageprovider.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Doc: AnimatedImage incompatible with QQuickImageProviderNico Vertriest2020-04-231-5/+5
| | | | | | | | | - specify the incompatibility in AnimatedImage documentation - remove unwanted references to AnimatedImage in QQuickImageprovider documentation Task-number: QTBUG-83489 Change-Id: I6f72dde6b19983ff24d08330690d06c65356ccf5 Reviewed-by: Paul Wicking <paul.wicking@qt.io>
* Image ColorSpace bindings for Quick/QMLAllan Sandfeld Jensen2020-01-311-1/+17
| | | | | | | | | | Adds a ColorSpace type mapped to QColorSpace, and adds a property to Image nodes to read and change it, converting the image if necessary on read. Fixes: QTBUG-80616 Change-Id: Ie80c8bc045f66de01de3a5d2c4a9974f07d2871d Reviewed-by: Andy Nichols <andy.nichols@qt.io>
* QQuickImageProvider: PDF is a scalable format like SVGShawn Rutledge2020-01-231-4/+4
| | | | | | | | | We could perhaps determine this by asking the QImageReader in readImage(), but supportsOption(ScaledSize) might return true for some other non-scalable formats. Change-Id: Ia18e9245c408245933774520ab68655905251e4d Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* Add support for semi-automatic QML type registrationsUlf Hermann2019-10-141-1/+1
| | | | | | | | | | | | | | | We can use the new moc JSON output to collect all meta-objects at build time and, for those that include QML element registration meta-data, generate code that automatically registers these types with QML. This eliminates the need to call qmlRegisterType manually. For now this generates free-standing functions (per module) that need to be called manually. This is intended as an intermediate step. Task-number: QTBUG-68796 Change-Id: Ib414eef9757344feee488ebc7388f957b975347f Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Documentation: Start using the \nullptr macroFriedemann Kleint2019-01-211-1/+1
| | | | | | Task-number: PYSIDE-903 Change-Id: I0c4640eb20157673eabb131e8834e79cbbf95d5c Reviewed-by: Paul Wicking <paul.wicking@qt.io>
* Doc: Remove references to Qt Quick 1Kai Koehne2018-10-011-2/+0
| | | | | | | | | | Qt Quick 1 is dead since Qt 5.0, so it doesn't make much sense anymore to link to different names there, or highlight behavioral differences. Task-number: QTBUG-70780 Change-Id: Iac5e0b226621f127714e722a11208ca1b21d977f Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
* Merge remote-tracking branch 'origin/5.11' into devUlf Hermann2018-06-251-16/+5
|\ | | | | | | | | | | | | | | | | | | Conflicts: src/plugins/qmltooling/packetprotocol/qpacketprotocol.cpp src/quick/handlers/qquickhandlerpoint.cpp src/quick/handlers/qquicksinglepointhandler.cpp tests/auto/qml/ecmascripttests/test262 Change-Id: I8908ec8c6116ca626fbd269af7625d4c429429ca
| * Doc: Move the code snippets to a separate snippet fileVenugopal Shivashankar2018-06-221-16/+5
| | | | | | | | | | Change-Id: I17671563f2beebe16ae1d08552854eaf44ae43ee Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
* | Fix race condition in async image response handlingSimon Hausmann2018-05-171-0/+5
|/ | | | | | | | | | | | | | | | | It may happen that the finished() signal is emitted from a super quick image loading thread in the implementation before we had a chance to connect to the signal in Qt Quick. In that case, record the emission through a private connection established in the constructor. The unit test simulates this scenario by emitting the signal before returning the object, but in a real world scenario it may happen that the response object is used in a separate thread that ends up emitting the signal. That may also happen before the thread that will try to connect to the signal runs. Task-number: QTBUG-59601 Change-Id: I14de9719db47f4bca2e8a2c6659343cfb4deb526 Reviewed-by: Albert Astals Cid <albert.astals.cid@kdab.com>
* Scale up SVG images if source size is larger than original sizeAndy Shaw2018-03-151-3/+6
| | | | | | | | | | | | | | Since SVG images can be scaled up without any loss of quality then we should allow this to happen even though it is not done for other image formats. This restores the 5.9.x behavior for SVG images. Additionally the manual test is updated to showcase an embedded image inside a SVG one to indicate this is continuing to work as before too. Task-number: QTBUG-67019 Change-Id: Ia719899937f8146e8fab50aa85adf18e2f79aa98 Reviewed-by: Evangelos Foutras <evangelos@foutrelis.com> Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* init variables where they are declared when possible (clang-tidy)Shawn Rutledge2018-02-261-6/+3
| | | | | | | | clang-tidy -p compile_commands.json $file -checks='-*,modernize-use-default-member-init,readability-redundant-member-init' -config='{CheckOptions: [{key: modernize-use-default-member-init.UseAssignment, value: "1"}]}' -header-filter='qtdeclarative' -fix Change-Id: I705f3235ff129ba68b0d8dad54a083e29fcead5f Reviewed-by: Johan Helsing <johan.helsing@qt.io>
* use nullptr consistently (clang-tidy)Shawn Rutledge2018-02-261-3/+3
| | | | | | | | | | | | | From now on we prefer nullptr instead of 0 to clarify cases where we are assigning or testing a pointer rather than a numeric zero. Also, replaced cases where 0 was passed as Qt::KeyboardModifiers with Qt::NoModifier (clang-tidy replaced them with nullptr, which waas wrong, so it was just as well to make the tests more readable rather than to revert those lines). Change-Id: I4735d35e4d9f42db5216862ce091429eadc6e65d Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Image: respect aspect ratio of an SVG when width or height is zeroAndy Shaw2018-02-211-1/+1
| | | | | | | | This amends f42f1366dcd4b070c69c9e7fe42a704ef23da14d Task-number: QTBUG-65789 Change-Id: I1db05259f0aeb3310bbaf5ea03be52cbd243d115 Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* Use the image handler to return a scaled size for the SVGAndy Shaw2018-01-311-3/+5
| | | | | | | | | | | | When the SVG was made to be drawn at a small width and a large height then it would lead to blurring in the rendering of the SVG. By having the image handler deal with returning the image we want for the scaled size it will ensure this is rendered correctly since it is able to account for the ratio already inside the SVG image handler. Task-number: QTBUG-65789 Change-Id: Ib8627c0537679aab022e88a0eea73a21d8cbc564 Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* Merge remote-tracking branch 'origin/5.9' into 5.10Liang Qi2017-09-051-3/+3
|\ | | | | | | | | | | | | | | Conflicts: src/quick/items/qquickwindow.cpp src/quick/scenegraph/qsgrenderloop.cpp Change-Id: Idd7106995b5545fcac869e9056a365ef9edb36ca
| * Doc: Fix capitalization in section titlesTopi Reinio2017-08-291-3/+3
| | | | | | | | | | | | | | | | ...and fix some section titles to be less confusing. Change-Id: If83c3faffead9e2e9be7fc0fb360f1c5b8b1bb51 Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io> Reviewed-by: Nico Vertriest <nico.vertriest@qt.io>
* | Merge remote-tracking branch 'origin/5.9' into devLars Knoll2017-05-021-0/+1
|\| | | | | | | Change-Id: I71275a2076c3d32ee2896571be882067320a2e9e
| * Run includemocs in qtdeclarativeThiago Macieira2017-04-261-0/+1
| | | | | | | | | | Change-Id: I84e363d735b443cb9beefffd14b8c023a37aa489 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* | Merge remote-tracking branch 'origin/5.9' into devSimon Hausmann2017-04-071-1/+44
|\| | | | | | | | | | | | | | | | | | | Conflicts: src/qml/jit/qv4assembler.cpp src/qml/jit/qv4assembler_p.h src/qml/jit/qv4isel_masm.cpp src/qml/jsruntime/qv4vme_moth.cpp Change-Id: I865d794e550a263387a39ca8d051ebf48b70cbc0
| * Use new ImageProviderWithOptions also for sync image loadingEirik Aavitsland2017-04-061-0/+8
| | | | | | | | | | | | | | | | | | | | | | When the new extended image provider api was added, only the async image loading function was changed to use it. This commit makes also the sync image loading function check for the new api, and use it if the provider implements it. Change-Id: I982e4de05b8119e1668e2b982d2d62b03a52b302 Reviewed-by: Albert Astals Cid <albert.astals@canonical.com> Reviewed-by: Robin Burchell <robin.burchell@crimson.no>
| * Make scaled image size calculation available to image providersEirik Aavitsland2017-04-051-1/+36
| | | | | | | | | | | | | | | | | | | | | | | | | | When reduced size image loading is requested through Image::sourceSize, the precise calculation of the scaled size to load is somewhat complex. This commit moves that calculation into a function accessible to image providers, so that they may use the same scaling as Quick's default image loading, and avoid code duplication. This is a code restructuring only; no behavior should change. Change-Id: Ic965fb2b6c22a5d21add41b8395e3a3842697d20 Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* | QQuickImageProvider: Improve documentation about cancel() and finished()Robin Burchell2017-03-201-2/+12
|/ | | | | | | | | | | Makes it a little more obvious how best to use this. We could do with including some snippets showing how to ideally implement cancel() I think, but this is a good start. Change-Id: I88d63a451239f91aa3619ccb74e306a2052a6e70 Task-number: QTBUG-59485 Reviewed-by: Albert Astals Cid <albert.astals@canonical.com> Reviewed-by: Pasi Petäjäjärvi <pasi.petajajarvi@qt.io>
* Merge remote-tracking branch 'origin/5.8' into 5.9Liang Qi2017-02-241-0/+4
|\ | | | | | | | | | | | | | | | | | | | | Conflicts: src/qml/compiler/qv4ssa.cpp src/quick/accessible/qaccessiblequickview_p.h src/quick/items/qquickmousearea.cpp src/quick/util/qquickanimatorjob.cpp tools/qmlplugindump/main.cpp Change-Id: I84474cf39895b9b757403971d2e9196e8c9d1809
| * Improve QQuickAsyncImageProvider exampleAlbert Astals Cid2017-02-081-0/+4
| | | | | | | | | | | | | | Also link it from more places Change-Id: Ib5fbf89f4a039f885e918d57ee477e9788049d8d Reviewed-by: Robin Burchell <robin.burchell@crimson.no>
* | Remove qWarning about QQuickImageProviderWithOptionsAlbert Astals Cid2017-01-241-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | If you're an user it's a bit annoying since it may show a lot and you don't know what to do with it If you're a developer it's a bit annoying since it's telling you to use a private class If we had a "debug for developers only mode" we could improve the message to be a bit more fine tuned and suggest that if they really want to be precise they can implement QQuickImageProviderWithOptions but as far as i know we don't have it, so i think it's better to remove the message altogether. Also mark the internal classes with the private export and add \internal to documentation of the internal class Change-Id: I5d7fc8d8b333c9a12321ed8135433603251815fc Reviewed-by: Robin Burchell <robin.burchell@crimson.no>
* | Scale images correctly with sourceSize and PreserveAspectCrop/FitAlbert Astals Cid2016-11-111-16/+149
|/ | | | | | | | | | It also introduces a private QQuickImageProviderWithOptions to allow passing options to image providers so that they can return more fine-tuned images. This private class will disappear in Qt6 and the functionality will be merged into QQuickImageProvider. Change-Id: I619065d889d21d3a9e1f8e45fdb6076b9657c7ed Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* Merge remote-tracking branch 'origin/5.6' into 5.7Liang Qi2016-10-051-0/+2
|\ | | | | | | Change-Id: I081d9b15796b4133d2ba6f1a862f15b873a4846d
| * Fix crash on cancel QQuickImageResponseAlbert Astals Cid2016-10-031-0/+2
| | | | | | | | | | | | | | | | | | | | | | We don't need to deleteLater here, we can not be sure that the response won't continue for a bit after this, and it's not even needed since documentation says you need to emit finished in all cases and this will call deleteLater on the response anyway. Task-number: QTBUG-56056 Change-Id: I7cc90620f499beaaaaa61aac77d72d067308838c Reviewed-by: Michael Brasser <michael.brasser@live.com>
* | Doc: add spec on parameter imageNico Vertriest2016-10-041-1/+1
| | | | | | | | | | | | | | | | Error message: Undocumented parameter 'image' in QQuickTextureFactory::textureFactoryForImage() Change-Id: If7cb1e63091c23304b64c5688af0abe55fc37ff4 Reviewed-by: Martin Smith <martin.smith@theqtcompany.com>
* | Updated license headersJani Heikkinen2016-01-191-14/+20
|/ | | | | | | | | | | From Qt 5.7 -> LGPL v2.1 isn't an option anymore, see http://blog.qt.io/blog/2016/01/13/new-agreement-with-the-kde-free-qt-foundation/ Updated license headers to use new LGPL header instead of LGPL21 one (in those files which will be under LGPL v3) Change-Id: Ic36f1a0a1436fe6ac6eeca8c2375a79857e9cb12 Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
* Merge remote-tracking branch 'origin/5.5' into 5.6Liang Qi2015-11-171-0/+21
|\ | | | | | | | | | | | | Conflicts: src/quick/util/qquickimageprovider.cpp Change-Id: I7ca4e49468b5ba697208287be4684e42b9900023
| * Doc: added documentation to undocumented functionsNico Vertriest2015-11-021-0/+21
| | | | | | | | | | | | | | Task-number: QTBUG-36985 Change-Id: I219375d405fbfb53611c0138698e955d9cd5d821 Reviewed-by: Venugopal Shivashankar <venugopal.shivashankar@digia.com> Reviewed-by: Topi Reiniö <topi.reinio@digia.com>
* | Improve QQuickTextureFactory::textureFactoryForImage docuAlbert Astals Cid2015-09-211-1/+3
| | | | | | | | | | Change-Id: I80edbcf627c6a2ba27779d0edfe8f0343b765dda Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
* | Improve QQuickImageResponse::textureFactory documentationAlbert Astals Cid2015-08-191-2/+5
| | | | | | | | | | Change-Id: Id754f1f1454af566cb3cf20f5ca947f972ef2caf Reviewed-by: Robin Burchell <robin.burchell@viroteck.net>
* | Improve QQuickImageResponse::textureFactory documentation a bitAlbert Astals Cid2015-06-301-2/+3
| | | | | | | | | | Change-Id: Iabbe4fc3fe1806d8b0740fa3dd9309d6137ccbac Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
* | Fix/suppress compiler warning about unused private field.Erik Verbruggen2015-04-231-0/+1
| | | | | | | | | | | | | | | | | | | | In file included from /Users/erik/dev/qt5-dev/qtdeclarative/src/quick/util/qquickimageprovider.cpp:34: /Users/erik/dev/builds/qt5-dev-debug/qtbase/include/QtQuick/../../../../../qt5-dev/qtdeclarative/src/quick/util/qquickimageprovider.h:107:38: warning: private field 'd' is not used [-Wunused-private-field] QQuickAsyncImageProviderPrivate *d; ^ Change-Id: Ia5b279233f4b5bea85d733b6cdd894b82b6abd68 Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
* | Add QQuickAsyncImageProviderAlbert Astals Cid2015-03-261-1/+123
|/ | | | | | | It allows for providers to implement threading on their side Change-Id: I34042b213ce7697a3e39470387357d733e15723c Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
* Merge remote-tracking branch 'origin/5.4' into 5.5Frederik Gladhorn2015-02-241-1/+2
|\ | | | | | | | | | | | | | | | | | | | | Conflicts: .qmake.conf LICENSE.GPLv2 examples/qml/networkaccessmanagerfactory/view.qml src/qml/jsruntime/qv4runtime.cpp src/qml/jsruntime/qv4stringobject.cpp Change-Id: I5d12f436d60995e51d5c2f59d364e9cbc24f8e32
| * Doc: fix exampleJoerg Bornemann2015-02-161-1/+2
| | | | | | | | | | | | Change-Id: I818e0a3235060fa48c61d4f21f1202d976b15d5e Task-number: QTBUG-38456 Reviewed-by: Topi Reiniö <topi.reinio@digia.com>
* | Update copyright headersJani Heikkinen2015-02-121-7/+7
|/ | | | | | | | | Qt copyrights are now in The Qt Company, so we could update the source code headers accordingly. In the same go we should also fix the links to point to qt.io. Change-Id: I61120571787870c0ed17066afb31779b1e6e30e9 Reviewed-by: Iikka Eklund <iikka.eklund@theqtcompany.com>
* Update license headers and add new licensesJani Heikkinen2014-08-251-18/+10
| | | | | | | | | - Renamed LICENSE.LGPL to LICENSE.LGPLv21 - Added LICENSE.LGPLv3 & LICENSE.GPLv2 - Removed LICENSE.GPL Change-Id: I84a565e2e0caa3b76bf291a7d188a57a4b00e1b0 Reviewed-by: Jani Heikkinen <jani.heikkinen@digia.com>
* Doc: correct link/compilation errors in Qt DeclarativeNico Vertriest2014-07-021-4/+3
| | | | | | | Task-number: QTBUG-34749 Change-Id: I507d54b0568d77c6099a0bd99f5c369b8667032a Reviewed-by: Venugopal Shivashankar <venugopal.shivashankar@digia.com> Reviewed-by: Martin Smith <martin.smith@digia.com>
* fix whitespaceOswald Buddenhagen2014-01-221-9/+9
| | | | | | | remove trailing spaces and expand tabs Change-Id: Ieacb9d096b612c45d1a64700044c114d1f7522bc Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Fix license headers of QtQuick sources.Gunnar Sletta2013-09-301-1/+1
| | | | | Change-Id: I3750c47640bf21c3567c5fa1c4667e3e2552942e Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* Doc: Made Qt Quick items' \since consistent.Jerome Pasion2013-09-251-2/+2
| | | | | | | | | | | | | | | | Qt 5.2: -"\since QtQuick 2.2" -> "\since 5.2" Qt 5.1: -"\since QtQuick 2.1" -> "\since 5.1" -"\since Qt 5.1" -> "\since 5.1" Qt 5.0: -"\since QtQuick 2.0" -> "\since 5.0" Task-number: QTBUG-32172 Change-Id: I699b00b31373a434ddb8f4caccfef40c588bf8a4 Reviewed-by: Martin Smith <martin.smith@digia.com>
* Merge remote-tracking branch 'origin/stable' into devFrederik Gladhorn2013-05-281-3/+3
|\ | | | | | | | | | | | | | | Conflicts: src/quick/doc/src/appdevguide/porting.qdoc sync.profile Change-Id: Iec5516c596c3eca60a3e6ceb1d45f2a7a1595c12
| * Doc: Fix some broken snippet pathsSze Howe Koh2013-05-061-3/+3
| | | | | | | | | | Change-Id: Ib79bfbea402b86e26a503de47383522317ca906b Reviewed-by: Jerome Pasion <jerome.pasion@digia.com>
* | Merge remote-tracking branch 'origin/stable' into devFrederik Gladhorn2013-04-291-1/+1
|\| | | | | | | Change-Id: I35f07a1725af104952f822274763dd7a96a9d560
| * Doc: Create links to Qt Quick 1Sze Howe Koh2013-04-241-1/+1
| | | | | | | | | | | | | | | | | | | | | | Point to the porting guide, so that users who search for the old names will be directed to an explanation of the name change. Also made some new links to Qt Quick 2, and changed "favour" -> "favor" (Sanity Bot complained) Change-Id: If30c8d619d8fdb9df72b7b5f3efd356f1e07b23a Reviewed-by: Jerome Pasion <jerome.pasion@digia.com>
| * Doc: Qt Quick: Fix module name format (Pt 2/2)Sze Howe Koh2013-04-231-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | Follow the conventions at http://qt-project.org/wiki/Spelling_Module_Names_in_Qt_Documentation Attempt to differentiate between the whole module ("Qt Quick") and the QML import ("QtQuick") by encoding the latter with monospace font. There are places in the text where both representations are valid. Change-Id: If398304757e0a5106542c09099e1814084e54c5c Reviewed-by: Jerome Pasion <jerome.pasion@digia.com>