aboutsummaryrefslogtreecommitdiffstats
path: root/src/quick/util
Commit message (Collapse)AuthorAgeFilesLines
* Speed up object creationSimon Hausmann2015-04-161-2/+2
| | | | | | | | Avoid copying url and file name twice into the context every time we instantiate an object. Change-Id: I1c76b80b9c44f95512af5899d760151f6dcd7bb5 Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* Do not stall loading of local images if network is slowAlbert Astals Cid2015-04-091-10/+29
| | | | | | | | | | Without this patch it can happen that we're loading IMAGEREQUEST_MAX_REQUEST_COUNT http based images, if the next image to load is a local file it wouldn't be processed until one of the http ones finishes, which makes not much sense Change-Id: I515306005192a20722f0c4588a1db1241348407c Reviewed-by: Alan Alpert (Personal) <416365416c@gmail.com>
* Improve debug formatting of QAbstractAnimationJob and related classes.Friedemann Kleint2015-04-022-0/+17
| | | | | | | | | | | - Output the state. - Add output to QQuickAnimatorJob. - Add a private export to the debug operator for use by QQuickAnimatorProxyJob to format its contained job. Task-number: QTBUG-45220 Change-Id: Ic64bb5d949864de1c4fb322d53acc3e253977e5d Reviewed-by: Alan Alpert (Personal) <416365416c@gmail.com>
* Merge "Merge remote-tracking branch 'origin/5.4' into 5.5" into refs/staging/5.5Liang Qi2015-04-011-3/+5
|\
| * Merge remote-tracking branch 'origin/5.4' into 5.5Liang Qi2015-03-311-3/+5
| |\ | | | | | | | | | Change-Id: I54e66e992f5e5d441b8b5394e7a03ec5352e7bf3
| | * Always remove reply from replies when processing cancelledAlbert Astals Cid2015-03-301-3/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Otherwise we if we leave the entry in replies later QQuickPixmapReader::networkRequestDone will give a potentially already deleted pointer in replies.take(reply) which will then crash when trying to post something to it Change-Id: I157a58e3ebe0a3fd6422742843eafbbdc58a7801 Reviewed-by: Alan Alpert (Personal) <416365416c@gmail.com>
* | | Add inheritance documentation markup to animator classes.Friedemann Kleint2015-03-311-0/+6
|/ / | | | | | | | | | | Task-number: QTBUG-45220 Change-Id: Ie817275897f860b0d6c4dcac2f92a4f3469a4611 Reviewed-by: Leena Miettinen <riitta-leena.miettinen@theqtcompany.com>
* | Fixed a memory-leak when changing property bindings in states.Robert Griebl2015-03-251-0/+5
| | | | | | | | | | | | | | | | | | Bindings that were still stored in the revert-list when the state was destructed were not deleted before. This could lead to considerable memory leaks in big applications. Change-Id: I73250f7d03a42c25ca729c18082125fd8f3c8989 Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
* | Fix inconsistent overrides. [-Winconsistent-missing-override]Sérgio Martins2015-03-221-2/+2
| | | | | | | | | | Change-Id: Ia0f3b50fd14f846c4e36cdaa12d5579902137f1b Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
* | Fix usage of QtQmlDevTools private headers on OSX with framework buildsSimon Hausmann2015-03-162-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Previously this module borrowed its private headers from QtQml, so that when writing QT += qmldevtools-private, you'd get the private headers from QtQml. This doesn't work when QtQml is built as a framework. A cleaner solution is to give this module its headers proper by letting syncqt create the forwarding headers correctly (and consequently also include them in make install). In order for this to work, the included headers themselves cannot include any headers from QtQml, which this patch also takes care of, through a centralized inclusion of qv4global_p.h. Change-Id: I9bb8337956a2774cfaca6b338369face6c6ee785 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com> Reviewed-by: Frederik Gladhorn <frederik.gladhorn@theqtcompany.com>
* | QtQuick: Micro-optimize iterator loops.Friedemann Kleint2015-02-263-16/+12
| | | | | | | | | | | | | | Avoid repeated instantiation of end() in loops, use variable instead. Change-Id: I6ab1fe2b82406d5ee91710a0333587ffb82c04d4 Reviewed-by: Erik Verbruggen <erik.verbruggen@theqtcompany.com>
* | Merge remote-tracking branch 'origin/5.4' into 5.5Frederik Gladhorn2015-02-243-4/+5
|\| | | | | | | | | | | | | | | | | | | | | 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>
| * Doc: link issues qtdeclarativeNico Vertriest2015-02-042-3/+3
| | | | | | | | | | | | Task-number: QTBUG-43810 Change-Id: I154ffa83512435c3e455937a3f81931a45d9e368 Reviewed-by: Martin Smith <martin.smith@digia.com>
* | Cleanup math function includes and usageAllan Sandfeld Jensen2015-02-193-11/+10
| | | | | | | | | | | | | | | | Use std::math on floats and doubles, and qMath on qreals, and only include the math headers actually needed. Change-Id: I1d511d7b1bac0050eaa947c7baee760b736858bf Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* | Add Qt.hsva() functionSean Harmer2015-02-181-0/+5
| | | | | | | | | | | | | | | | | | | | | | | | This is more convenient than the alternative hsla() function in many cases as color pickers in other applications default to the HSV color space e.g. GIMP, kcolorchooser. [ChangeLog][QtQml] Added Qt.hsva() function Change-Id: Id5c1a78173757bf9842b164d90b31682e9a41749 Reviewed-by: Laszlo Agocs <laszlo.agocs@theqtcompany.com> Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
* | Update copyright headersJani Heikkinen2015-02-1266-462/+462
| | | | | | | | | | | | | | | | | | 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>
* | Introduce QSG_TRANSIENT_IMAGES.Gunnar Sletta2015-02-032-5/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | This feature enables the same feature that we already have in the 'nonpreservedtexture' in the scene graph playground. This change also cleans up some leftover logic from the early Qt 5.2 days when we had to manually extract the image from the default texture factory rather than going through QQuickWindow::createTexture(). This cleanup is required for the logic to work. Change-Id: I7cdf15d981ba8af94f8d51781fc01e2b834b77c6 Reviewed-by: Robin Burchell <robin.burchell@viroteck.net>
* | Introduce ShortcutJ-P Nurmi2015-01-234-2/+399
| | | | | | | | | | | | | | | | | | | | [ChangeLog][QtQuick] Added a Shortcut utility type for catching keyboard shortcuts Change-Id: I4af631bfa7987f0d809b1f5af499f1d9688a1e04 Reviewed-by: Caroline Chao <caroline.chao@theqtcompany.com> Reviewed-by: Alan Alpert <aalpert@blackberry.com> Reviewed-by: Shawn Rutledge <shawn.rutledge@digia.com>
* | Expose QStyleHints as Qt.styleHintsJ-P Nurmi2015-01-171-0/+8
| | | | | | | | | | Change-Id: I0fc94e680b011963e645bdbf51110820751e53aa Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* | Fix Qt.inputMethod ownershipJ-P Nurmi2015-01-171-1/+3
| | | | | | | | | | Change-Id: Ic51f9daf17742a421a810d95b2a510caf657e08f Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* | Remove v8engine usage in the value type providerLars Knoll2015-01-081-12/+9
| | | | | | | | | | Change-Id: I6b26a8249175a86c6e15d000b24ba3300e112715 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* | Initial work on gadget supportSimon Hausmann2014-12-223-150/+38
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Changed built-in QtQml value types to use gadgets. This is in preparation for supporting external gadgets. This replaces the mostly direct inheritance of the concrete value types with gadgets and "dynamic" inheritance through QQmlValueType being generic. Over time as some of the value types may become gadgets, we can remove the ones here. It's important that these "separate" gadgets have the same memory layout as the actual types (QPointF, etc.). Also while QQmlValueType remains practically a singleton, it's not required anymore to be one. Consequently the JS wrappers for value types keep their own instance of QQmlValueType. This allows eliminating the qobject_cast in various places that dealt with the singleton nature. This comes at a cost, making the JS wrappers slightly heavier. However that is meant to be a temporary situation and finally the value type wrapper should merely store the meta-object in addition to the data and the type. Change-Id: I15071ded0a1e54203f29ec1ecf7a9ab646d1168e Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* | Remove most of the places where getPointer() is usedLars Knoll2014-12-201-11/+11
| | | | | | | | | | | | | | This is no longer required, and simply uglifies the code Change-Id: Iba91a1d7735ebe23a43437f137a488423b6eb743 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* | Simplify QFont value type wrapper in preparation for gadgetsSimon Hausmann2014-12-132-21/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The value type wrapper for QFont tries to keep track whether pixel or point sizes were set and warns the programmer accordingly if both were set. This is implemented using separate boolean variables, but this can also be done using QFont's resolve mask. This move is motivated by the ability of the value type wrappers to operate only on the type they wrap in the future, without requiring additional helper variables. Change-Id: Ia05093b5dcc950281ef89b2bb6fe96c18329cdfa Reviewed-by: Lars Knoll <lars.knoll@digia.com> Reviewed-by: Michael Brasser <michael.brasser@live.com>
* | Merge remote-tracking branch 'origin/5.4' into devSimon Hausmann2014-12-091-0/+7
|\| | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/qml/jsruntime/qv4arraydata.cpp src/qml/jsruntime/qv4context_p.h src/qml/jsruntime/qv4globalobject.cpp src/qml/jsruntime/qv4internalclass.cpp src/quick/items/qquicktext_p.h src/quick/items/qquicktextedit_p.h src/quick/items/qquicktextinput_p.h Change-Id: If07e483e03197cb997ef47a9c647a479cdb09f4c
| * Fix QtQuick2 module unload supportChris Adams2014-12-041-0/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | This commit ensures that the value type providers installed by the QtQuick2 QML module during initialization are uninstalled when the plugin is unloaded. It also fixes a bug in the type compiler so that it now works with types from plugins which get unloaded and then reloaded. Task-number: QTBUG-43004 Change-Id: I4b3fb75aae65dfbc5de9c88701ed82514087ab7d Reviewed-by: Matthew Vogt <matthew.vogt@qinetic.com.au>
* | Merge remote-tracking branch 'origin/5.4' into devFrederik Gladhorn2014-10-296-16/+64
|\| | | | | | | | | | | | | | | | | Conflicts: src/quick/items/qquickaccessibleattached_p.h src/quick/items/qquickwindow.cpp src/quick/scenegraph/qsgthreadedrenderloop.cpp Change-Id: I8bf07487a75f9d1b0d6efa5914dd06875fc9654d
| * Add \since 5.4 to FontMetrics and TextMetrics.Mitch Curtis2014-10-222-0/+2
| | | | | | | | | | Change-Id: I5fa93d559cdfde5e6b84ab0f3f35fd600e6bec4f Reviewed-by: Topi Reiniö <topi.reinio@digia.com>
| * Improve performance of animators.v5.4.0-beta1Gunnar Sletta2014-10-104-16/+62
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The use of one QCoreApp::postEvent() per completed animation added up to a very large overhead when 1000+ animators were used at the same time. This is very relevant for sprite games and similar and deserves to work at least as good as normal animations. Instead, store the animations to stop and stop then on the gui thread later as a result of frameSwapped. For the benchmark in question this allows for roughly double the amount of animators being started and stopped. Change-Id: Iae3d1ec1502ee1908fdbba708fa9f976aa230064 Reviewed-by: Michael Brasser <michael.brasser@live.com>
* | Remove the "groupNode"Gunnar Sletta2014-10-171-9/+21
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We originally had the groupnode to simplify adding and removing clip / effect / opacity nodes to the item tree at a time when the renderer was a bit more trivial and only did a single pass over the tree during rendering. The runtime cost at the time was negligible. The QSGBatchRenderer has a bit more logic, so the extra node now costs a bit more. In addition to extra memory, we need to allocate shadow nodes for it and put those into the renderer's internal shadownode hash. This removal increases the performance of adding / removal of simple items by ~10% in addition to reducing the number of nodes in the scene graph by up to 1/3. Change-Id: I8cd64984f868d75820e25d33dfdbebd4d20651fe Reviewed-by: Robin Burchell <robin.burchell@viroteck.net>
* | Merge remote-tracking branch 'origin/5.4' into devFrederik Gladhorn2014-10-096-48/+109
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/quick/items/context2d/qquickcanvasitem.cpp src/quick/scenegraph/coreapi/qsgbatchrenderer.cpp src/quick/scenegraph/coreapi/qsgrenderer.cpp src/quick/scenegraph/qsgadaptationlayer.cpp src/quick/scenegraph/qsgrenderloop.cpp src/quick/scenegraph/qsgthreadedrenderloop.cpp src/quick/scenegraph/qsgwindowsrenderloop.cpp src/quick/scenegraph/util/qsgatlastexture.cpp src/quick/scenegraph/util/qsgtexture.cpp src/quick/util/qquickprofiler_p.h Change-Id: Ie274c3baf72a8a0711c87d67238d68e2b2887429
| * Fix memory leak and crash with transform animators.Gunnar Sletta2014-10-093-7/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Every time initialize() was called, we would increment the ref on an item. However, initialize is called every time the job is started, so the ref would increase and only decrease once, leading to a leaked helper. Change it to only increment the first time. A different problem was that when an item was destroyed, we could run the risk of the QQuickTransformAnimatorJob destructor being called with the helper's item being null. This would lead to the helper not being removed from the cache and a dangling helper would remain in the transforms cache. Now change it so that when a target is destroyed, we explicitly destroy the helper as well (as no animation can happen then anyway) and reset all pointers in the job. Change-Id: I1ce76db134bbc1871d32f1224ba5b68a4a4eeafa Reviewed-by: Michael Brasser <michael.brasser@live.com>
| * Remove alpha channel from images that doesn't actually have alpha.Gunnar Sletta2014-10-091-0/+25
| | | | | | | | | | | | | | | | | | We did this for QPixmap since forever, and it has a huge impact on rendering performance, so there is no reason why we shouldn't spend that extra bit of time. Change-Id: Ibd2e6d585525a5b5a975b8d7498c21dec00647c5 Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
| * Select specific features to be recorded when profiling QMLUlf Hermann2014-09-113-29/+38
| | | | | | | | | | | | | | | | | | | | | | | | Some features, like the memory profiler, create huge amounts of data. Often enough, we're not actually interested in all the data available from the profiler and collecting it all can lead to excessive memory consumption. This change enables us to optionally turn various aspects of QML profiling off. Task-number: QTBUG-41118 Change-Id: I7bb223414e24eb903124ffa6e0896af6ce974e49 Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
| * Merge remote-tracking branch 'origin/5.3' into 5.4Simon Hausmann2014-09-083-5/+14
| |\ | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: .qmake.conf src/qml/jsruntime/qv4arraydata.cpp src/quick/scenegraph/util/qsgatlastexture.cpp Change-Id: Ic4c96066d5c37dcf0d5446baed590ea005d445ce
| | * Fix crash with cleanup of animators.Gunnar Sletta2014-08-303-5/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We had several separate issues relating to how the jobs were cleaned up. The first was that upon getting setWindow(0), the animator did not reset m_controller to 0, leading to the starts() coming after that to post null jobs to the controller. This would later crash in beforeNodeSync as the starting job was null. The second issue was that during shutdown, QQuickAnimatorProxy would try to delete jobs on the controller which was already deleted. The controller is deleted on the GUI thread regardless of render loop, so this was solved with a QPointer. The third was that we were a bit too aggressive in trying to clean up jobs on the GUI thread, so we introduced a new bool which gets set to true in startJob() so that Proxy::deleteJob() knows who owns the job. Task-number: QTBUG-37833 Change-Id: I1b6221a2c1ce2bfd0758801b950cda00ff6899d0 Reviewed-by: Michael Brasser <michael.brasser@live.com>
* | | QQuickPixmapStore: Don't start expiration timer when application quitsOleg Shparber2014-10-021-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This change removes a warning printed during application closing stage about a timer started not from QThread. Change-Id: I93ca4da7066bd5e0784509676bc59969a8e2ad48 Reviewed-by: Richard J. Moore <rich@kde.org> Reviewed-by: Robin Burchell <robin.burchell@viroteck.net> Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
* | | Use QQuickProfiler's own timer to sample eventsUlf Hermann2014-09-122-7/+114
|/ / | | | | | | | | | | | | | | Like that the timings are more accurate. Task-number: QTBUG-39876 Change-Id: Ia6bdce9c8089417e88797ec3a98c8a3e367f73f2 Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
* | Merge remote-tracking branch 'origin/5.3' into 5.4Simon Hausmann2014-08-261-1/+1
|\| | | | | | | | | | | Conflicts: src/qml/qml/qqmlobjectcreator_p.h Change-Id: I60858ddb46866a8fa1a8576bb05b412afeeb4e41
| * Fix typo in StateChangeScript documentation.Mitch Curtis2014-08-191-1/+1
| | | | | | | | | | Change-Id: Iec72331c183ea02680bad01f04eae82ebd815cdb Reviewed-by: Gunnar Sletta <gunnar.sletta@jollamobile.com>
* | Update license headers and add new licensesJani Heikkinen2014-08-2564-1209/+697
| | | | | | | | | | | | | | | | | | - 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>
* | Add const & to argumentsAlbert Astals Cid2014-08-241-2/+2
| | | | | | | | | | Change-Id: I1bcf69638fee32b6e6565b8ea828c0adcff48a67 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* | CleanupSimon Hausmann2014-08-152-10/+10
| | | | | | | | | | | | | | | | | | Merge QV4::CompiledData::QmlUnit into QV4::CompiledData::Unit. For pure JS units it means a slight increase of memory usage by a few bytes, but overall it makes the code a lot simpler. Change-Id: Ib48927749720b056f004aac0fe22cb8ec729e3f6 Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* | Merge remote-tracking branch 'origin/5.3' into 5.4Simon Hausmann2014-08-121-2/+4
|\| | | | | | | | | | | | | | | | | | | Conflicts: src/qml/jsruntime/qv4include.cpp src/quick/items/qquickrendercontrol.cpp src/quick/items/qquickrendercontrol_p.h src/quickwidgets/qquickwidget.cpp Change-Id: Ib2dc0051a38cd283a37a7665eb4a76f6f7ec8b15
| * Fix crash when animators are deleted just after being started.Gunnar Sletta2014-08-081-2/+4
| | | | | | | | | | Change-Id: I35850e279dae596edb9a1b93143d6aa195221b41 Reviewed-by: Robin Burchell <robin+qt@viroteck.net>
* | Protect against crashes with invalid openglContext()Simon Hausmann2014-08-081-6/+6
| | | | | | | | | | | | | | | | | | 1) Don't fail the assertion in the animator jobs if we don't have a context 2) Delegate the opengl context check in QQuickWindow::createTextureFromImage to the QSGContext Change-Id: I1b248895dcd6db406f1af8866fd0052dd7564899 Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* | Add declarative QQuickTextMetrics API from QQuickFontMetrics invokablesMitch Curtis2014-08-085-5/+404
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This allows use of a declarative API for the functions in QFontMetricsF which take parameters. This solves the problem of QML expressions that use QML methods not being re-evaluated when the internal data changes, by allowing the user to set the arguments as properties of a TextMetrics object, that would otherwise have to be passed to QML methods. For example: FontMetrics { id: fontMetrics } property rect r: fontMetrics.boundingRect("Blah") At some point, the font of the FontMetrics object is changed, but r will still represent the original bounding rect. Instead, the user will now write: TextMetrics { id: textMetrics text: "Blah" } property rect r: textMetrics.boundingRect The QML methods remain in QQuickFontMetrics for those who need an imperative API. [ChangeLog][QtQuick] Added QQuickTextMetrics, which provides a declarative API for the functions in QFontMetricsF which take arguments. Change-Id: I019dc4639531906fc751ba61281cc1c695742287 Reviewed-by: J-P Nurmi <jpnurmi@digia.com>
* | Get rid of StringRefLars Knoll2014-07-221-11/+11
| | | | | | | | | | | | | | | | Remove the Ref classes, as they won't be required anymore once Managed and Managed::Data are separated. Change-Id: Ic6bec2d5b4ecf2595ce129dbb45bbf6a385138a5 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* | Add QQuickFontMetrics.Mitch Curtis2014-07-174-2/+455
| | | | | | | | | | | | | | | | | | | | | | | | This will be a private C++ type that is exposed to QtQuick 2.4 as FontMetrics. [ChangeLog][QtQuick] Added QQuickFontMetrics, which provides a subset of QFontMetricsF's API. Change-Id: Iac31e5a555bd8f1dc0904b8de0408e5f1a402b25 Reviewed-by: J-P Nurmi <jpnurmi@digia.com> Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@digia.com>