aboutsummaryrefslogtreecommitdiffstats
path: root/src/quick/util
Commit message (Collapse)AuthorAgeFilesLines
* Make deletion of transitions safeLars Knoll2017-12-112-15/+29
| | | | | | Task-number: QTBUG-63844 Change-Id: I65029e9039ea3db85152fc3cdefaac3deee0db6c Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* watch for the actual render window if there is a QQuickRenderControlMarco Martin2017-11-221-0/+3
| | | | | | | | | | | if the scene is rendered by a QQuickRenderControl and we have a different target window (for instance QQuickWidget) we check the target window of the render control instead of the own window, this fixes window keyboard shortcuts for QQuickWidget Task-number: QTBUG-64548 Change-Id: I7614be580f2a707c752189e4c9b53a5d5f0159d7 Reviewed-by: J-P Nurmi <jpnurmi@qt.io>
* Make sure we remove stopped animators from the list of rootsGunnar Sletta2017-11-101-1/+3
| | | | | Change-Id: I89b36ee7d03ac6b8d07b24c656d3311728e8f9c3 Reviewed-by: J-P Nurmi <jpnurmi@qt.io>
* QQuickAnimatorProxyJob: Disconnect from window when unsetting itUlf Hermann2017-10-241-1/+5
| | | | | | | | | | Otherwise we may get called back when the window's scene graph is ready, but we don't have a controller anymore then. This leads to a crash. Change-Id: I8075619e1fd3c69ca0f7d0b1d72952b8cc5040f8 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io> Reviewed-by: J-P Nurmi <jpnurmi@qt.io> Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* Doc: Fix capitalization in section titlesTopi Reinio2017-08-292-5/+5
| | | | | | | | ...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>
* Doc: Enclose regular expressions with \badcodeTopi Reinio2017-06-161-1/+7
| | | | | | | | | Without them, qdoc tries to parse the backslashes as qdoc commands: src/quick/util/qquickvalidator.cpp:231: warning: Unknown command '\d' Change-Id: I36322586c477822f7efbae8b80adaee177c7ca44 Reviewed-by: Venugopal Shivashankar <Venugopal.Shivashankar@qt.io>
* Doc: add doc and examples to RegExpValidator QML typeNico Vertriest2017-06-131-0/+13
| | | | | Change-Id: I0ebc06aec6d2392f613fb4c312c189cc1d90a184 Reviewed-by: Venugopal Shivashankar <Venugopal.Shivashankar@qt.io>
* qquickpixmapcache: fix crash when loading images asynchronouslyArnaud Vrac2017-05-051-1/+1
| | | | | | | | | | Use copied data instead of data that might be destroyed. This was already fixed in most places in commit 22c39eda8ab316c. Change-Id: Ie31ebb2e53945dd66ce3d0114629c284407ff26c Reviewed-by: Albert Astals Cid <aacid@kde.org> Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io> Reviewed-by: Robin Burchell <robin.burchell@crimson.no>
* Run includemocs in qtdeclarativeThiago Macieira2017-04-2625-0/+45
| | | | | Change-Id: I84e363d735b443cb9beefffd14b8c023a37aa489 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* QQuickShortcut: Initialize idRobin Burchell2017-04-191-0/+1
| | | | | | Change-Id: If1a8b91c11ca3d84e80691e247c0281a966a2939 Task-number: QTBUG-60206 Reviewed-by: J-P Nurmi <jpnurmi@qt.io>
* Fix warning for -no-feature-desktopservicesStephan Binner2017-04-181-0/+1
| | | | | Change-Id: Ia3a590a564ab9bde9b19c4e7955420a7d1eacb2b Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* QQuickAnimatorProxyJob: make sure to stop when detached from a windowJ-P Nurmi2017-04-181-3/+11
| | | | | | | | | | | | | | The previous attempt to fix this (05a88ef) had to be reverted (7fe0d1a) because Q_ASSERT(m_controller) in updateCurrentTime() failed in QQC1 auto tests. It seems that m_controller can be null when m_internalState is still State_Starting. Task-number: QTBUG-59034 Task-number: QTBUG-59953 Change-Id: I07ceec8fe4e66ba0571092b4385d8140035a4b33 Reviewed-by: Robin Burchell <robin.burchell@crimson.no> Reviewed-by: Aleix Pol Reviewed-by: Gunnar Sletta <gunnar@crimson.no>
* Doc: Fix property name from "url" to "source"Leena Miettinen2017-04-121-1/+1
| | | | | | | URL is the type of the property, not its name. Change-Id: Id76bdb70031a3cacdfd0951ff132e57a512ae208 Reviewed-by: Markus Goetz (Woboq GmbH) <markus@woboq.com>
* Doc: Write URL in capital letters in textLeena Miettinen2017-04-121-1/+1
| | | | | Change-Id: Ibac6a3f8ddf4b441dd8359162094eb786fda84d7 Reviewed-by: Nico Vertriest <nico.vertriest@qt.io>
* Use new ImageProviderWithOptions also for sync image loadingEirik Aavitsland2017-04-064-6/+17
| | | | | | | | | | | 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>
* Fix crash in QQuickPixmapReader & friendsAlbert Astals Cid2017-04-051-9/+9
| | | | | | | | | | | | | In 9c50216c7bbbdb2bb51d4485286bf09e12fb5b62 I made the mistake of not copying providerOptions inside QQuickPixmapReply as is done for requestSize and url since i thought that i could just use the data pointer to access it, but that's not possible since data can get deleted in other thread so we need to copy the value Change-Id: Ie1d466b210108e1af1f0c8d3c618d4516448b73d Reviewed-by: Donald Carr <d@chaos-reins.com> Reviewed-by: Robin Burchell <robin.burchell@crimson.no>
* Make scaled image size calculation available to image providersEirik Aavitsland2017-04-053-26/+41
| | | | | | | | | | | | | 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>
* Build fix for -no-feature-quick-shadereffectPaul Olav Tvete2017-03-101-1/+2
| | | | | Change-Id: Ie1f601c6ae4c6c5d8d23b14a6670979d9c24e209 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Revert "QQuickAnimatorProxyJob: make sure to stop when detached from a window"Liang Qi2017-03-071-7/+1
| | | | | | | | | | This reverts commit 05a88efb266ec3b7b16d6db0d971c21ae7f45c9d. It caused some test failures in qtquickcontrols and qtquickcontrols2. Task-number: QTBUG-59326 Task-number: QTBUG-59327 Change-Id: I9a26a4518bf7c106372916761aae69ba65f6df9e Reviewed-by: J-P Nurmi <jpnurmi@qt.io>
* QQuickAnimatorProxyJob: make sure to stop when detached from a windowJ-P Nurmi2017-03-061-1/+7
| | | | | | | | Qt Quick Controls 2 StackView auto tests exposed an issue that animator proxy jobs keep ticking after being unassociated from a window. Change-Id: Ib9b3a0e02ac4cc3f3e98ddf05c8b01f0bbd614d3 Reviewed-by: Gunnar Sletta <gunnar@crimson.no>
* Merge remote-tracking branch 'origin/5.8' into 5.9Liang Qi2017-02-242-1/+7
|\ | | | | | | | | | | | | | | | | | | | | 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>
| * Fix regression with UniformAnimator target property validationJoni Poikelin2017-02-011-1/+3
| | | | | | | | | | | | Task-number: QTBUG-58549 Change-Id: Iaa2a9cd8b86e8c2bb7e20b99fabad99d0bd51799 Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
* | Allow to pass all the relevant info to QQuickPixmap::isCachedAlbert Astals Cid2017-02-032-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | If we don't allow to pass the QQuickImageProviderOptions to the isCached we are missing one of the three components that identify if the pixmap is actually cached. Old code is ok for the QQuickAnimatedImagePrivate use case since it always creates QQuickPixmap with the default QQuickImageProviderOptions options, but if someone else wants to use QQuickPixmap::isCached they will need to be able to pass the options part of the cache key. Change-Id: I3153ad9ed30e7332b5cb4896dcebd408f2bd9afe Reviewed-by: Robin Burchell <robin.burchell@crimson.no>
* | Make Item::grabToImage work in more cases, and improve test coverageAlbert Astals Cid2017-01-272-2/+12
| | | | | | | | | | | | | | | | | | | | | | This fixes a regression caused by 9c50216c7bbbdb2bb51d4485286bf09e12fb5b62 when the Image specified fillMode: aspectRatioCrop/Fit. [ChangeLog][QtQuick][Image] Item::grabToImage on an Image element will now work regardless of the Image's sourceSize or cache properties. Change-Id: I225854c48f0c35a3cb2ef0dd56bf51bd88c31779 Reviewed-by: Robin Burchell <robin.burchell@crimson.no>
* | Merge remote-tracking branch 'origin/5.8' into devLiang Qi2017-01-262-3/+15
|\| | | | | | | | | | | | | | | Conflicts: src/quick/util/qquickutilmodule.cpp tools/qmllint/main.cpp Change-Id: Ic2283f88c293ca7fc776de3e83eb4c7812309d8a
| * Fix build without feature.shortcutTasuku Suzuki2017-01-152-3/+15
| | | | | | | | | | Change-Id: Id0ea0037db4cc3878ae2f75109aa3a7daa120189 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* | Remove qWarning about QQuickImageProviderWithOptionsAlbert Astals Cid2017-01-243-12/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* | PathAnimation: fix bug when PathSvg or PathLine is the last item in PathOleg Yadrov2017-01-202-15/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Both QQuickPathLine and QQuickPathSvg inherit QQuickCurve class which has “x” and “y” properties that return qreal type, but internally they are stored as QQmlNullableValue<qreal>. At the same time, if any of them is not specified explicitly, its getter returns 0. QQuickPath processes QQuickPath%Type% objects and produces a QPainterPath which later used by QQuickPathAnimation. QQuickPathAnimation only created a QAbstractAnimationJob if QQuickPath::hasEnd returned true, and hasEnd returned true only if both “x” and “y” were specified explicitly. All that in conjunction led to the situation when if you had either - a PathLine with unspecified “x” or “y”; or - a PathSvg which was the last (or the only) path element in your Path, PathAnimation would not start. This patch removes hasEnd check, it should be safe to do because QPainterPath is always valid anyway due to the fact QQuickCurve::x() and QQuickCurve::y() return 0 if they have not been not explicitly set. Task-number: QTBUG-57666 Change-Id: Id320aaeb5aff0964d6493b7b80d5d9a7d36acce8 Reviewed-by: Robin Burchell <robin.burchell@crimson.no>
* | Merge remote-tracking branch 'origin/5.8' into devLiang Qi2017-01-141-0/+1
|\| | | | | | | | | | | | | Conflicts: .qmake.conf Change-Id: I9d87ed86e95b5901a86cc3aa65d7ac39b0b708c2
| * Added the missing link to AnimationKavindra Palaraja2017-01-031-0/+1
| | | | | | | | | | | | | | | | | | | | Animator inherits from QQuickAbstractAnimation which is known as Animation in QML. Its properties are inherited. Task-number: QTBUG-55738 Change-Id: If16c87c9367825d7661940e7c1930179862e59cb Reviewed-by: Mitch Curtis <mitch.curtis@qt.io> Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
* | Port existing qmlInfo callers to qmlWarningRobin Burchell2017-01-117-16/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | Now that qmlInfo actually reports info messages, we want to change existing callers to use warning-level messages to preserve the original message level. This was done through: perl -p -i -e "s/qmlInfo\(/qmlWarning\(/" **/*.{cpp,h,qdoc} .. with a little care taken to only add the hunks that should be changed. Change-Id: I511cee11ce0a26ec1048cd2b84c7536b812a0d89 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* | QQuickValueTypes: Avoid QVariant boxing (and unboxing) to convert color to ↵Robin Burchell2016-12-211-2/+1
| | | | | | | | | | | | | | | | | | | | | | string We can maintain the spoken about compatibility without the performance penalty by inlining what qguivariant.cpp does. Change-Id: I95a8b8d660fb9104ae2d30d0ece943bccf169679 Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io> Reviewed-by: Michael Brasser <michael.brasser@live.com>
* | Keys: add shortcutOverride signalMitch Curtis2016-12-181-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This allows an item to accept the shortcutOverride event, preventing e.g. Shortcut from stealing key events. The original use case that prompted the creation of this patch was using a Popup from Controls 2 to create a keyboard shortcut editor. When the user wanted to cancel the shortcut that they were editing, they could press escape, but Popup would grab the shortcut and close itself. As the test case demonstrates, the same problem occurs with the Shortcut type in Qt Quick. [ChangeLog][QtQuick][Keys] Added shortcutOverride signal to Keys attached object to allow prevention of e.g. Shortcut from stealing key events. Task-number: QTBUG-57098 Change-Id: I594e4ea17ec417d8c7d93c6cf347c1a1a2e62b93 Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io> Reviewed-by: Robin Burchell <robin.burchell@viroteck.net>
* | Merge remote-tracking branch 'origin/5.8' into devLiang Qi2016-12-147-59/+110
|\| | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/plugins/qmltooling/qmldbg_debugger/qv4debugjob.cpp src/plugins/qmltooling/qmldbg_inspector/globalinspector.cpp src/plugins/qmltooling/qmldbg_nativedebugger/qqmlnativedebugservice.cpp src/qml/qml/qqmlimport.cpp src/quick/items/context2d/qquickcontext2dtexture_p.h tools/qmleasing/splineeditor.h Change-Id: I8f6630fcac243824350986c8e9f4bd6483bf20b5
| * Get rid of FunctionObject::createQmlFunctionLars Knoll2016-12-091-2/+2
| | | | | | | | | | | | | | | | Instead, simply create a QmlContext, and setup the bindings with the QV4::Function itself. Change-Id: I9db93b15112e43a6d5e275d126fb20f9c8833e8f Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
| * Change signature of QQmlBinding::create to take a FunctionObject *Lars Knoll2016-12-091-1/+1
| | | | | | | | | | | | | | This is what's in the Value in all cases anyway. Change-Id: I212c4c4076050e8d0ea4cf6f72a1683e132cd51b Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
| * Cleanup and reduce the number of overloads for QQmlBinding::create()Lars Knoll2016-12-061-4/+4
| | | | | | | | | | Change-Id: Ibcd277bc434638e5c6e8e9ccea634aa25cde1643 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
| * Get rid of most QT_NO_FOO usagesLars Knoll2016-11-295-8/+8
| | | | | | | | | | | | | | | | Instead use QT_CONFIG(foo). This change actually detected a few mis-spelled macros and invalid usages. Change-Id: I06ac327098dd1a458e6bc379d637b8e2dac52f85 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
| * Merge remote-tracking branch 'origin/5.7' into 5.8Liang Qi2016-11-281-45/+96
| |\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The renderers added in 5.8 had to be adapted to the changed profiling macros from 5.6. Conflicts: src/plugins/scenegraph/d3d12/qsgd3d12renderloop.cpp src/plugins/scenegraph/d3d12/qsgd3d12threadedrenderloop.cpp src/quick/scenegraph/adaptations/software/qsgsoftwarerenderloop.cpp src/quick/scenegraph/adaptations/software/qsgsoftwarethreadedrenderloop.cpp src/quick/util/qquickprofiler_p.h tests/auto/qml/qjsengine/tst_qjsengine.cpp tests/auto/qml/qqmlvaluetypes/tst_qqmlvaluetypes.cpp Change-Id: Icb370b7c95aab12589ad73881ac6d178759a5c6b
| | * Merge remote-tracking branch 'origin/5.6' into 5.75.7Liang Qi2016-11-251-44/+96
| | |\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/qml/compiler/qv4ssa.cpp src/qml/qml/v8/qqmlbuiltinfunctions.cpp src/quick/util/qquickprofiler_p.h Change-Id: I11a89c2a166115d6697adfba09928805643e709e
| | | * QmlProfiler: Explicitly specify the offsets for scene graph eventsUlf Hermann2016-11-241-44/+96
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The profiler can be switched on in the middle of a frame. In that case the last offset into the timing data would be some random number, which may lead to a crash when recording the sample. However, as we know all the data points we are going to record, we can as well specify where they are supposed to go. The timings themselves may still be random for frames of which we only recorded parts, but the clients can deal with this. Task-number: QTBUG-57304 Change-Id: I1d507f2591516e43d5b3cd25f7939716f2b64ed9 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* | | | headers: Add missing override and remove redundant virtualAlexander Volkov2016-12-071-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | Change-Id: Ifa816ebcd79372afca42dbd0dc0ecde006bb688a Reviewed-by: Anton Kudryavtsev <antkudr@mail.ru> Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* | | | Shortcut: add support for multiple key sequencesJ-P Nurmi2016-11-163-38/+140
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | [ChangeLog][QtQuick][Shortcut] Added support for multiple shortcut sequences. Previously it was possible to specify a single sequence that could consist of up to four key presses. Now it is possible to specify multiple sequences that can each consist of multiple key presses. Change-Id: Id12f25da2f352cc542ec776049d8e81593951d41 Reviewed-by: Robin Burchell <robin.burchell@viroteck.net> Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* | | | Scale images correctly with sourceSize and PreserveAspectCrop/FitAlbert Astals Cid2016-11-114-92/+326
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* | | | Fix building with -no-openglAndy Nichols2016-11-111-3/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Asserts were added to qquickanimatorjob.cpp that check for a current opengl context and which thread they are current on. This is not relevant for non-opengl builds. Change-Id: I9714c99cb6a0374fbb983a037c4fc24a99c8a645 Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
* | | | Merge remote-tracking branch 'origin/5.8' into devJ-P Nurmi2016-11-031-20/+35
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: tools/qmljs/qmljs.cpp Change-Id: Ifa9e74bdb780eaff22fbc9ba1c514d0078a3fb29
| * | | Merge remote-tracking branch 'origin/5.7' into 5.8v5.8.0-beta1Liang Qi2016-10-271-20/+35
| |\| | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: tests/auto/quick/qquicktextedit/BLACKLIST Change-Id: I0b9e5bea5da5d2666887c202e62d889b4aa56900
| | * | QQuickShortcut: allow setting a custom context matcherJ-P Nurmi2016-10-261-20/+35
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This allows Qt Quick Controls 2 to register a shortcut context matcher that makes shortcuts behave well with QQC2's item-based popups, which QQuickShortcut is not aware of. Task-number: QTBUG-56562 Change-Id: Ia2518fd6ac7140f60aa38c7d9af557007e9db23b Reviewed-by: Mitch Curtis <mitch.curtis@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
* | | | Remove unused variable after animator redoGunnar Sletta2016-10-242-4/+0
| | | | | | | | | | | | | | | | | | | | Change-Id: Ib4bbd058dd243e9ab4b6f9908da2b0793a59e11e Reviewed-by: J-P Nurmi <jpnurmi@qt.io>