aboutsummaryrefslogtreecommitdiffstats
path: root/src
Commit message (Collapse)AuthorAgeFilesLines
* Improve performance of animators.v5.4.0-beta1Gunnar Sletta2014-10-105-18/+63
| | | | | | | | | | | | | | | 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>
* Fix issues with Keyboard Focus documentation.Mitch Curtis2014-10-101-3/+3
| | | | | Change-Id: I0dcc364456404a761a555da065452a59d1249a2f Reviewed-by: Topi Reiniö <topi.reinio@digia.com>
* PathView: Fix QML engine thinking currentItem is null when it's notSérgio Martins2014-10-101-0/+5
| | | | | | | | QML didn't re-evaluate any bindings using currentItem because a notification was missing. Change-Id: Icdaa3022e0b01644a060e577d87f011b4ea9fabb Reviewed-by: Alan Alpert <aalpert@blackberry.com>
* Fix QQmlExpression/QQmlScriptString/QQmlBinding crashesSimon Hausmann2014-10-0923-87/+55
| | | | | | | | | | | | | | | | | | | | | | | | In the QQmlScriptString we store the binding id and it is an index into the runtimeFunctions array of the compilation unit. However we don't store the compilation unit and instead in QQmlBinding and QQmlExpression try to retrieve it from the cache via the context url (we have the context after all). That turns out to be not a reliable way, as sometimes the URL might slightly differ from the originally compiled cache (qrc:/// turning to qrc:/ maybe). Consequently the type is (unnecessarily) compiled again and unfortunately not _linked_, therefore the runtime functions array is empty. Another option is that when the component was created from a QByteArray, then no entry exists in the cache in the first place. This patch addresses the problem by storing a reference to the compilation unit in the QQmlContextData. That we can safely retrieve and it'll make sure the compilation unit also stays alive. In the process of that the manual reference counting was switched over to QQmlRefCount and QQmlRefPointer for QV4::CompilationUnit. Task-number: QTBUG-41193 Change-Id: I9111f9a3b65618e453954abcd789c039e65a94f7 Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* Return the content position rounded on the right sideGiulio Camuffo2014-10-091-9/+9
| | | | | | | | | | | | | | | | | | | QQuickFlickable::contentX/Y() returns the negative of the value stored in the QQuickTimeLineValue used by QQuickFlickable. So we must be careful when using things like qRound, and call it with the negative of the value ine the QQuickTimeLineValue, else code like this would fail: QQuickFlickable *f = ... f->setPixelAligned(true) f->setContentY(-10.5) assert(f->contentY() == qRound(-10.5)) // fail The assert expression indeed turns into -11 == -10, which is false but which is not what the user would expect. Change-Id: Ib92ee2fa613b751462237349d9e4e2f2b4652f82 Reviewed-by: Martin Jones <martin.jones@qinetic.com.au>
* Export QQuickKeyNavigationAttached as a part of the private APIOleg Shparber2014-10-091-1/+1
| | | | | | | | This change fixes linking problems when QQuickKeyNavigationAttached is used through private headers. Change-Id: I176a9551718d9ba25c160a3b1caa8872c88d39f3 Reviewed-by: Alan Alpert <aalpert@blackberry.com>
* Make QQuickKeyNavigationAttached respect user set valuesOleg Shparber2014-10-091-6/+6
| | | | | | | | | | Before this change, when user tried to set KeyNavigation property to the value which was previously automatically assigned, user set flag wasn't raised. Such behavior led to situations, when explicitly set values later were not respected by automatic mutual changes. Change-Id: Id5ba5061c03a61f4d7835a638dc746b1485b9a56 Reviewed-by: Alan Alpert <aalpert@blackberry.com>
* Doc: Updated the QML State Machine docsVenu2014-10-097-125/+111
| | | | | | | | | | | | | | - Excluded the src/imports/statemachine directory from qtquick.qdocconf to avoid unnecessary qdoc warnings. - corrected a broken link to an external source - changed the group name to avoid collision - added a \qmlmodule page for QtQml.StateMachine - Reduced the amount of duplication between the C++ and QML state machine overviews. Task-number: QTBUG-41561 Change-Id: I87c815fada7006f0609331e315bb338f062bb4db Reviewed-by: Topi Reiniö <topi.reinio@digia.com>
* 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>
* Relax ShaderEffectSource's sourceItem vs window handling.Gunnar Sletta2014-10-091-1/+5
| | | | | | | | | | | For dynamically loaded items, the window may not be set on either the source or the item, so we need to be a bit more relaxed in our checking. This fixes a regression for dynamically loaded GaussianBlur. Change-Id: I3e888405a95058ca79ecd2dff42c0ed4c8fff065 Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
* Fix missing glyphs in selectionEskil Abrahamsen Blomfeldt2014-10-092-27/+60
| | | | | | | | | | | | | | | | | Change 198009db79a85d3cab7fe3a6432635d36123a2d6 revealed a bug in the new selection algorithm which would occur sometimes when a given run of text spanned several script items. Since we are checking the glyph runs for overlaps in the actual text, we need to report the exact characters spanned by the glyph run. We use the new enabler for this in QGlyphRunPrivate. Added a new test case which is an error case we did not yet cover, which is when there is only a single script item, but several font engines are used to produce it (fallback fonts). Change-Id: Ie4c3e79ad98a033d5c75fd67ada4ae83df33435b Task-number: QTBUG-41808 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Prevent removeFirst call on empty list.Zeno Endemann2014-10-011-2/+2
| | | | | | | | | The hoverItems list might get changed as a result of the sendHoverEvent call, so it is safer to take the element out first. Change-Id: I88c7380a2e4dd2297f9d0cfe01edc453ca525cb3 Reviewed-by: Jan Arne Petersen <jan.petersen@kdab.com> Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
* use the new form of QTranslator::load() for more flexibilityShawn Rutledge2014-10-011-2/+4
| | | | | | | | | | | | | | As the docs explain, the variant of QTranslator::load() taking a const QLocale& is better because it "uses QLocale::uiLanguages() and not simply the locale name, which refers to the formatting of dates and numbers and not necessarily the UI language." And, using a default-constructed QLocale permits QLocale::setDefault() to override the system locale, so for example an application's main.cpp can do that before constructing a QQmlApplicationEngine. Task-number: QTBUG-7329 Change-Id: Ia29a4c894087c92b071c0fe484728866f2660fe6 Reviewed-by: Jan Arve Sæther <jan-arve.saether@digia.com>
* documentation for qmldir "depends" declarationShawn Rutledge2014-10-011-0/+19
| | | | | | | | | | [ChangeLog][QtQml][qmldir] added the ability to declare dependencies on other modules in a module definition qmldir file Task-number: QTBUG-41489 Change-Id: Icd526bc7617bc3e4f725c7d008d0522a201cf645 Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@digia.com> Reviewed-by: Topi Reiniö <topi.reinio@digia.com>
* qmldir parser: add support for "depends component version" syntaxShawn Rutledge2014-10-012-0/+30
| | | | | | | | | | | | Dependency declarations are initially for the benefit of qmlimportscanner which does not (yet) use this parser. This patch adds support for dependencies into the qmldir parser for completeness, along with autotests. It is necessary to prevent errors at runtime when parsing a qmldir which contains the "depends" declaration. Task-number: QTBUG-41489 Change-Id: Ief2524a30140c42874f94f1735755b171e15dcf7 Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@digia.com>
* Partially revert d9c531781e6c95f80681b3c82700833e1de88794Gunnar Sletta2014-10-015-48/+22
| | | | | | | | | | | | This logic changed then timing for when the layer's m_dirtyTexture was set and unset, which had some side effects. Revert to the old and known-to-work behavior of using a connection. Change-Id: I4048e7ae70491afe36b2d766e6c506d9febc44ed Task-number: QTBUG-41451 Reviewed-by: Mitch Curtis <mitch.curtis@digia.com> Reviewed-by: Giulio Camuffo <giulio.camuffo@jollamobile.com> Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Make Canvas use texture atlas for smallish Image based canvases.Gunnar Sletta2014-09-303-17/+10
| | | | | | | | | | | This makes Canvas with Image batchable in the renderer which means that it is feasible to have 100s of small Canvases in a scene, for instance as static icons rendered with a bit of script. Change-Id: I3ad57360d632b7093fd6993afa88ed35c21d178a Reviewed-by: Mitch Curtis <mitch.curtis@digia.com> Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
* Document that QQmlApplicationEngine's root item must be a window.Mitch Curtis2014-09-301-1/+5
| | | | | Change-Id: I22466e82105c9b56894a53400394d1124191f93d Reviewed-by: Robin Burchell <robin.burchell@viroteck.net>
* Fix compiler warningLars Knoll2014-09-301-0/+1
| | | | | | | | | Add a matching operator delete to our operator new to shut up MSVC. Task-number: QTBUG-40652 Change-Id: I1396094d23c4d0cfc88a73fabbab05f1d4ec7b44 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Doc: Combine the extending QML tutorial chapters into a single exampleTopi Reinio2014-09-301-113/+75
| | | | | | | | | | | | | Combine the six examples associated with each tutorial chapter into a single, top-level example project 'extending-qml', with subprojects for each of the tutorial chapters. Clean up the docs, add links, and a note about a warning that the user may see when running the code in the first chapter. Task-number: QTBUG-32947 Change-Id: Idba4e2153817ab29f1afaf1947d1f2e25964e7b3 Reviewed-by: Leena Miettinen <riitta-leena.miettinen@digia.com>
* Fix build when using -WerrorSérgio Martins2014-09-301-1/+1
| | | | | | | | | "'borderBottom' may be used uninitialized in this function [-Werror=maybe-uninitialized]" Observed when compiling for android. Change-Id: Ifcb26e28440f08528a192ea2fe88d6343e33710b Reviewed-by: BogDan Vatra <bogdan@kde.org>
* Add orientationUpdateMask to QQuickScreenAlex Blasche2014-09-302-1/+43
| | | | | | Task-number: QTBUG-38699 Change-Id: I173b7e53c27dba336351572859f7c9aeafe07ef9 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@digia.com>
* Fix example in scope documentationSimon Hausmann2014-09-301-2/+2
| | | | | | | | | | | | | The example tried to demonstrate the use of direct access to properties of the root component object, but unfortunately it also defined an id property that clashed with it. Therefore the provided example did not work as intended and produced a "stringified" object reference instead of the text of the "title" property. This patch changes the id to avoid a clash. Change-Id: Ib9abcf48482773a0dcdf5e2375d1445d87ccf4ef Reviewed-by: Michael Brasser <michael.brasser@live.com>
* Also search for visual children in TestCase::findChild().Mitch Curtis2014-09-291-2/+30
| | | | | | | | | It previously used QObject::findChild(), which won't work in all cases, because items like ListView don't seem to make their delegate items QObject children, while simple nested Items do. Change-Id: I1a8ed1fb55493212cb25abf595d016437812a80f Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Give Item::layer documentation some much needed love.Gunnar Sletta2014-09-2910-2/+460
| | | | | Change-Id: I31e038d961d3aa09a36db0c091c4e4910e395c2e Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
* Doc: Replace VisualDataModel with DelegateModelNico Vertriest2014-09-252-21/+21
| | | | | | | Task-number: QTBUG-37725 Change-Id: Iad3b31470af8ea965d19b3d0901822b901407d40 Reviewed-by: Venugopal Shivashankar <venugopal.shivashankar@digia.com> Reviewed-by: Topi Reiniö <topi.reinio@digia.com>
* Reset 'invalidatePending' after the FBO has been recreated.Gunnar Sletta2014-09-251-0/+1
| | | | | | | | | If not, we will always request a new FBO during updatePaintNode, even when the fbo is not following the items size. Task-number: QTBUG-41565 Change-Id: I20b4b3a8e3630ff963a876320808869bba62fb8a Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
* QDSM: Nested statemachines are supportedSebastian Sauer2014-09-241-6/+0
| | | | | | | | | | | | | | * Remove wrongly printed info that nested statemachines are not supported. * Added autotest for nested statemachines. * Re-enable commented out testcase in the nestedInitalStates autotest. The reason why the test was disabled was fixed a while ago. Change-Id: I921483fa49d751d14c877f8f63335fa88cf2ce7b Reviewed-by: Brett Stottlemyer <bstottle@ford.com> Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* move QQuickWindowAttached to QQuickWindowQmlImplShawn Rutledge2014-09-243-12/+7
| | | | | | | | | | It causes problems to do qmlRegisterType on QQuickWindow if the attached property also refers to QQuickWindow. Task-number: QTBUG-40816 Task-number: QTBUG-41047 Change-Id: I7a6f75af52f65e2be022b97128702982bec7cbe8 Reviewed-by: J-P Nurmi <jpnurmi@digia.com>
* Fix cleanup of non-threaded render loops.Gunnar Sletta2014-09-242-50/+23
| | | | | | | | | | | | | | | | | | | | | | They would unconditionally call cleanupNodesOnShutdown on hide(), but QQuickWindow::sceneGraphInvalidated would only be emitted if this was the last window being hidden, leading to an inconsistent state in the application. Since the non-threaded render loops do not support releasing resources (there is one OpenGL context and one QSGRenderContext shared between all windows) we delay cleanup until the window is destroyed. This change also make the render loops track the windows until they are destroyed, similar to what the threaded one does. The purpose of this is to, in the case of dangling windows, only trigger invalidation of the scene graph when the last QQuickWindow is destroyed through QSGRenderLoop::cleanup(). Task-number: QTBUG-41210 Change-Id: I7e12a4f726ebb3e7935c822b6046abb3590c583a Reviewed-by: Ulf Hermann <ulf.hermann@digia.com> Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
* Cleanup: Simplify CompiledData::Unit structure to always include the string ↵Simon Hausmann2014-09-244-14/+28
| | | | | | | table at the end Change-Id: Iae86b8f4dc0dc67c14974472f627e28d6795369f Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* Allow multiple cached qml unit registration functionsSimon Hausmann2014-09-241-5/+7
| | | | | | | | Only few will be necessary, but this allows for greater flexibility at run-time. Change-Id: Ia03abeb6296a5dee97544209c578dc2974af7cbc Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* Doc: apply title case to all section1 titlesNico Vertriest2014-09-2410-13/+13
| | | | | | Task-number: QTBUG-41250 Change-Id: I303d989992c9685f73baae50c64accf71b43549f Reviewed-by: Topi Reiniö <topi.reinio@digia.com>
* Recreate the fbo on screen change in QQuickWidget when neededLaszlo Agocs2014-09-232-29/+34
| | | | | | | | | | | | Move the rendering code out into a separate function since it is now called from three places. Like in QOpenGLWidget, the FBO may need to be recreated with a different size in case the window is moved onto a screen with a different device pixel ratio. Change-Id: Iaaa42a06dab9e02710b0a7dafb0ea8c018b69ec2 Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
* Add missing import to documentation code snippetSérgio Martins2014-09-231-0/+1
| | | | | Change-Id: I358b306fb286ffb00d2edd51bc3d97f1884fe34e Reviewed-by: Alan Alpert (Personal) <416365416c@gmail.com>
* Fix clip state tracking in Context2DMatt Fischer2014-09-223-6/+10
| | | | | | | | | | | | | | | | | | A recent change (f45fe58ad2aa741c90b756643da75f1a6bc2fdf6) introduced the concept of clipping being disabled for a context, so that it can start with no clip path set. However, this state is not properly tracked, so an attempt to restore a context state which has no clip path does not work properly. This change adds this information to the Clip command, so that it can be properly restored. This patch also re-enables a test case which was supposed to check this behavior, but had been disabled. Task-number: QTBUG-40312 Change-Id: I3fd5626ecfcc1298a81931828cbb590290098a92 Reviewed-by: Ulf Hermann <ulf.hermann@digia.com> Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
* Don't do qgetenv on library loadThiago Macieira2014-09-221-35/+39
| | | | | | | | | | Bad for two reasons: first, it increases the load time of the application and second, it makes it impossible to to setenv/putenv from main(). The latter is useful if you need to work on an embedded device that doesn't allow setting environment variables. Change-Id: Id543f77336d7ac2e4ea820b51f55ce5a40a33b4e Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
* Fix deadlock with QQuickView embedded via QWidget::createWindowContainerDyami Caliri2014-09-221-2/+9
| | | | | | | | | | | A QQuickView embedded in a widget application will be deleted in the QApplication destructor. At that point, events are not being posted, so the QQmlThread cannot properly shut down, and will deadlock waiting for an event. Task-number: QTBUG-36115 Change-Id: I4595f03e0afcf9463cfbc2ba95146d4777d19c56 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Cleanup remaining QtQuick.Dialogs leftoversJ-P Nurmi2014-09-191-3/+1
| | | | | | | QtQuick.Dialogs was moved to the qtquickcontrols module in Qt 5.3 Change-Id: I16d03dc1c342d396963c5bec3125b3d11d0d9bed Reviewed-by: Topi Reiniö <topi.reinio@digia.com>
* Doc: add documentation for Photo Viewer exampleLeena Miettinen2014-09-191-0/+2
| | | | | Change-Id: Iffedd9361bd0475a53c1a8b9567c9cbf5e5d4867 Reviewed-by: Topi Reiniö <topi.reinio@digia.com>
* Fix compiler warnings in qv8engine.cpp.Friedemann Kleint2014-09-191-1/+5
| | | | | | | | qml\v8\qv8engine.cpp(91) : warning C4805: '|' : unsafe mix of type 'bool' and type 'int' in operation Task-number: QTBUG-40431 Change-Id: Ibdc96907aaab132956c87dd6aec2eab2f3bf0e9f Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Revert mapping of var signal parameters to QJSValueSimon Hausmann2014-09-191-1/+1
| | | | | | | | | | | | | | | | | This reverts commit 70004585f89f325f398c556d101bfa1833d87b53, which is superseded by commit 3dbe05f6bf3fd51ce8097c35f6c7f12b39acb0f6, which is a much better solution. [ChangeLog][QtQml][Important Behavior Changes] Qt 5.3 changed the mapping of "var" parameters in QML declared signals to QJSValue. This was reverted to the behavior of earlier Qt versions to use QVariant. The original issue of not being able to pass function objects through var parameters of QML declared signals is solved by wrapping a QJSValue inside the QVariant. Task-number: QTBUG-39971 Change-Id: I44de2ef2660c64c68e6a3b2a1ae251ad563d6b3c Reviewed-by: Taylor Braun-Jones <taylor@braun-jones.org> Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* Replace vsnprintf with qvsnprintf.Bjoern Breitmeyer2014-09-191-1/+1
| | | | | | | | Windows CE does not have vsnprintf, so use qvsnprintf instead. Change-Id: I30ddbf2469424ec174903f0cce2b482c652b5d22 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Finally: A default animation driver which doesn't use walltime.Gunnar Sletta2014-09-184-22/+134
| | | | | | | | | | | I've wanted this for a long time, but the animation system didn't support it when mixed with timers/pauses. However, because of dfc8f8b5d4a02f33c7f9063c2a28450902a9d863 and 0db3ea4048fe572a256deb343ea5e64a55d98de9 to qtbase, it is now possible. Change-Id: Ic70c181ce49eae90276bd4f22a2d299061f96087 Reviewed-by: Michael Brasser <michael.brasser@live.com>
* Sync QQuickWindow::update() up with polishAndSync().Gunnar Sletta2014-09-172-3/+18
| | | | | | | | | | | | | | | When calling QQuickWindow::update() on the GUI thread, we would immediately flag the render thread that a repaint was needed and then schedule a polishAndSync. If the render thread completed the current frame before the GUI thread got to polishAndSync, it would repaint right away without syncing with GUI first. Instead of sending the repaint right away, register the need for a full repaint in the window and set it as part of the next sync phase. Change-Id: Ia731fb46724cc79f5391422213b069de9362d002 Reviewed-by: Giulio Camuffo <giulio.camuffo@jollamobile.com> Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
* QQuickWindow::setColor() should use update() rather than dirtyItem()Gunnar Sletta2014-09-171-1/+1
| | | | | | | | | | dirtyItem() will trigger maybeUpdate in the renderloop which may decide to skip the render pass if nothing changed in the scene graph. Use update() instead which forces the rendering to go through regardless. Change-Id: I4730bb0cd79d58fa21970a847cc1720060cb14a8 Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
* Don't assume a QSGRenderContext is valid just because it's not 0Ulf Hermann2014-09-171-1/+4
| | | | | | | Task-number: QTBUG-41353 Change-Id: I2a8c500ed974b3e5f45f3a1eb1f66c7a24b17d56 Reviewed-by: Andy Nichols <andy.nichols@digia.com> Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
* Protect QQuickWindow::openglContext against not having a context.Gunnar Sletta2014-09-171-1/+1
| | | | | Change-Id: I3d5087d9c322ee5ee3325858ee717161fd7801a3 Reviewed-by: Ulf Hermann <ulf.hermann@digia.com>
* Add a note about winId() to QQuickWidgetLaszlo Agocs2014-09-171-0/+5
| | | | | | | | | This unfortunate function causes the creation of a native window which is very wrong. Task-number: QTBUG-40765 Change-Id: Ia08138cf35c240c883c63a66a54f949b86ccc2d2 Reviewed-by: Paul Olav Tvete <paul.tvete@digia.com>