aboutsummaryrefslogtreecommitdiffstats
path: root/src
Commit message (Collapse)AuthorAgeFilesLines
...
* Fix crash when QML engine warning handler feeds errors back into QMLSimon Hausmann2018-04-096-33/+15
| | | | | | | | | | | | | | When a QQmlEngine warning handler that's called during component instantiation results in subsequent component instantiations, either via the signal or via a Qt message handler like in the bug report, then we might end up modifying the linked list of errored bindings before returning from the QQmlEnginePrivate::warning() call. The easy fix is to extract the QQmlError, unlink the delayed error from the linked list and then deliver the error to the QQmlEngine. Change-Id: I6b7be61b57b35636282595937046ff76091144a3 Task-number: QTBUG-53293 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Improve QQuickItemGrabResult::image() docsMitch Curtis2018-04-091-1/+1
| | | | | | | | | It can return a null image. An "empty" image is confusing, as there's no function in QImage with that name, requiring the user to consult the docs. Change-Id: Iaa805510804162fe3a7df00394b4a9ad61ac1d20 Reviewed-by: J-P Nurmi <jpnurmi@qt.io>
* Avoid marking hidden windows as updatePending in Gui render loopDavid Edmundson2018-04-091-1/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | Since eeb320bbd8763f3e72f79369cc3908e999a0da3c the GL context only deletes textures when all windows with pending updates have finished rendering. renderWindow will not process any window that is not visible. This leaves a logic bug that we can have the updatePending flag set but never cleared. If we have two windows, this leaves the other window still updating normally, but lastDirtyWindow will always be false and we never call endSync. This results in an effective memory leak of all textures. This patch resets the flag on hide() a move that can be considered safe given the show() method will reset this flag anyway. Change-Id: Iab0171716e27e31077a66b5e36a00bf28a2e7a8c Reviewed-by: Kai Uwe Broulik <kde@privat.broulik.de> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Dominik Holland <dominik.holland@pelagicore.com> Reviewed-by: Aleix Pol Reviewed-by: Andy Nichols <andy.nichols@qt.io>
* Doc: Remove erroneous examplePaul Wicking2018-04-091-10/+8
| | | | | | | | | | The current documentation is not current anymore. Removed faulty example and added link to relevant page for more information. Task-number: QTBUG-67082 Change-Id: Ic2d29ab358b227289480d9986679676048a35821 Reviewed-by: Topi Reiniö <topi.reinio@qt.io> Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Doc: Improve the "Interacting with QML from C++" sectionMitch Curtis2018-04-091-4/+20
| | | | | Change-Id: I8930314179514d091a39640551f2816a23cbebc8 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Fix Flickable mouse wheel handling on macOSNils Jeisecke2018-04-061-4/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | On macOS a special movementEnding timer was added to the wheelEvent handling to fix QTBUG-63026. This has introduced a regression with wrong vData/hData.moving flags: When the timer fires before the Qt::ScrollEnd phase is reached, movementEnding is invoked early (can be reproduced with very slow scrolling using the Magic Mouse). In this case movementEnding sets vData.moving = false but not vMoved = false because scrollingPhase is still true. This will prevent any further invocation of movementStarting from inside the drag method (it expects a change in vMoved) so once this situation has occurred the "moving" flags will be out of sync. Visible effect: If a ListView has a currentItem set with setCurrentIndex, its viewportMoved method will no longer correctly set the moveReason to "Mouse" because the check depends on "moving" flag as an indicator for mouse interaction. This results in the view permanently jumping back to the current item on any scroll operation because the moveReason will be stuck at "SetIndex". The fix is to ignore the timer event if scrollingPhase is still true. Task-number: QTBUG-67460 Change-Id: I7cf02b8c625b7baf249ad26c4e0c3df874a18eae Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io> Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* Allow for QQmlData::set*Bit and clear*Bit to be inlinedErik Verbruggen2018-04-062-66/+70
| | | | | Change-Id: I216adf12e7ec402f3ccb4f846165171c9833f23b Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Doc: Change the section title to avoid a linking conflictVenugopal Shivashankar2018-04-061-1/+1
| | | | | | | Otherwise, all links to the Qt Quick Layouts module page will lead here. Change-Id: I04c14ca9a28ebf0e19e489229352ba4d11f24859 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* Improve documentation for qmlRegisterType<Foo>()Mitch Curtis2018-04-051-0/+68
| | | | | | | | Explain when it should be used. Task-number: QTBUG-67332 Change-Id: I759a192778a0370831f44b871e58c5ee49d3fe3c Reviewed-by: Venugopal Shivashankar <Venugopal.Shivashankar@qt.io>
* Link to C++ => QML flowchart in QML registration function docsMitch Curtis2018-04-051-4/+13
| | | | | Change-Id: I684bf2c461be5ebc78df06c816a0717d5958e0de Reviewed-by: Venugopal Shivashankar <Venugopal.Shivashankar@qt.io>
* Doc: correct Sprite's detailed descriptionMitch Curtis2018-04-051-2/+2
| | | | | | Task-number: QTBUG-58641 Change-Id: Ib339746d459328bdac8fa0eeff80300df99ff482 Reviewed-by: Venugopal Shivashankar <Venugopal.Shivashankar@qt.io>
* Doc: Add a section on scalable application UIVenugopal Shivashankar2018-04-054-6/+48
| | | | | | | | Also fixed a grammar issue and a few broken links. Change-Id: I807da06536d6a9101e67fd73858cbbfe90d00663 Reviewed-by: J-P Nurmi <jpnurmi@qt.io> Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* Doc: add a flowchart to aid choosing the correct C++ => QML integrationMitch Curtis2018-04-053-0/+6
| | | | | | | | | | | http://doc.qt.io/qt-5/qtqml-cppintegration-overview.html is currently a scary wall of text. A flowchart is something that is very easy to follow, making it much easier for users to choose the correct C++ => QML integration method for their situation. Change-Id: If684126395054c69e4583844aa0d7c0ff525c7a1 Reviewed-by: J-P Nurmi <jpnurmi@qt.io> Reviewed-by: Venugopal Shivashankar <Venugopal.Shivashankar@qt.io>
* qmltest: Use correct Testlib headerFriedemann Kleint2018-04-031-1/+1
| | | | | | | | | | Fix warning: QtTest/qtest_global.h:4:4: warning: #warning Header <QtTest/qtest_global.h> is deprecated. Please include <QtTest/qttestglobal.h> instead. [-Wcpp] introduced by qtbase/4db38197c2bac8bcee9d08a0e20ed2c8d127b8f2. Change-Id: Icb5b17d8680f9dc02f43fa9cf06f516cbef3de87 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* Doc: Drop the use of QT_PLUGIN_PATH in documentation configTopi Reinio2018-03-283-48/+5
| | | | | | | | | | | | This caused build issues in certain configurations. We don't actually need it, as we can rely on the base Qt include path instead. Also move the custom header under src/quick/doc and rename it. Task-number: QTBUG-67342 Change-Id: Id75e140f9d286f6a47c2ecc039bfb52b13a92608 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io> Reviewed-by: Martin Smith <martin.smith@qt.io>
* Fix QQmlExpression::hasError()/error() on syntax errorsSimon Hausmann2018-03-272-9/+10
| | | | | | | | | | | | Record errors that happen during QV4::Script::parse() time in the same way as we record errors during binding evaluation, in order to correctly set the error state of QQmlExpression. This also removes dead code about setting line, description, etc. which is taken care of by ExecutionEngine::catchExceptionAsQmlError. Task-number: QTBUG-67240 Change-Id: I2d586e16803d0883cdd2d1d262b4c67202c00562 Reviewed-by: Michael Brasser <michael.brasser@live.com>
* Qml Profiler: Store and send URL of compile eventsUlf Hermann2018-03-271-1/+1
| | | | | | Task-number: QTBUG-67354 Change-Id: I7251095570d5ba8d0a62d854cfcbc339b2455747 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Yarr: Add Q_FALLTHROUGH to silence GCC 7 warningPeter Varga2018-03-271-0/+1
| | | | | Change-Id: I258b5ea84a96f5269b241c9b0cce53202c19c61a Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* QQuickPointerHandler: make classBegin and componentComplete protectedShawn Rutledge2018-03-272-5/+13
| | | | | | | | | They are public in QQmlParserStatus but don't need to be public here. Also de-inline the default implementations, because this class will be public C++ API eventually. Change-Id: Ic7dfbec853e3d20f45b361401f710dedb5eae416 Reviewed-by: Jan Arve Sæther <jan-arve.saether@qt.io>
* QML Tooling: Don't send StartTrace if we haven't started any profilersUlf Hermann2018-03-271-2/+1
| | | | | | | | | | If the client requested the trace to be started before any engines were registered, this would result in a StartTrace with an empty list of engines, which would never be matched by an EndTrace. This is rather confusing. It's better to send nothing at all. Change-Id: I8728628bd7c9fe068f7275c499440f95542dcc11 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* QML Tooling: Remember global "enabled" flag in profiler serviceUlf Hermann2018-03-272-1/+14
| | | | | | | | | | If profiling has been enabled for all engines, that now also holds for engines to be registered in the future. This way the client doesn't need to employ the EngineControl service just to figure out when the first engine registers. Change-Id: I44a441bb6ead25abdadac1ae3e4edf9b0a9659f5 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Quick/DesignerSupport: Use QByteArrayList when checking property listsFriedemann Kleint2018-03-272-4/+4
| | | | | | | | | | Fix warnings like designer/qquickdesignersupportitems.cpp:112:63: warning: 'QString::QString(const char*)' is deprecated: Use fromUtf8, QStringLiteral, or QLatin1String [-Wdeprecated-declarations] Amends 01a40e1f920b58f00d52ff4542f6ef9c606a9b03. Change-Id: I0e8167f8eacc0d901f79fb5dd8b2772ab29c55a8 Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
* Fix isInt32 for -0.0Erik Verbruggen2018-03-261-1/+1
| | | | | | | Because no, that can't be represented as an 32bit integer. Change-Id: I83e5e74fdfbd9b13ac04a49311619d8939c7b093 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Add additional check for support JIT compilation on ARM platformMikhail Svetkin2018-03-221-0/+5
| | | | | | | | | | JIT compilation is require hardware with FPU double precision. On ARM platform we can check it via __ARM_FP (http://infocenter.arm.com/help/index.jsp?topic=/com.arm.doc.dui0774g/chr1383660321827.html) Change-Id: I8f3a00e639cebe65d874cb085d97aa8f1cc18a4f Reviewed-by: Simon Hausmann <simon.hausmann@qt.io> Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* doc: Fix qtquick.qdocconf to include stuff for qtquickwidgetsMartin Smith2018-03-222-0/+49
| | | | | | | | | | A fake module header is added for qtquick named QtQuick_pch.h, and qtquick.qdocconf is modified to use this fake module header instead of using QtQuick. The fake module header includes QtQuick and QtQuickWidgets. Change-Id: I2a3bd4ad32bdad878f8e7049cf71c393517547a0 Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
* Correct logging of swap time in software render loopMichael Brüning2018-03-221-1/+1
| | | | | | | | The conversion from nanoseconds to milliseconds wrongly divided the swap time by 10 million instead of 1 million. Change-Id: Id2b1594fbf7abafabfeae790c7083ad1cf4064a0 Reviewed-by: Andy Nichols <andy.nichols@qt.io>
* add qmlRegisterModule to all QML plugins (QUIP 99)Shawn Rutledge2018-03-219-0/+32
| | | | | | | | | | | | | | | | | Now it should always be possible to do import QtQuick.Module x.m where x is the module's major version and m is Qt's minor version. [ChangeLog][QtQuick][Important Behavior Changes] In Qt 5.11 and newer versions, QML plugin modules are available with the same minor version as the Qt release minor version number. For example it's possible to import QtQuick.Window 2.11 or import QtQuick.Layouts 1.11 even though there haven't been any API changes in these modules for Qt 5.11, and the maximum possible import version will automatically increment in future Qt versions. This is intended to reduce confusion. Change-Id: I0d28ed04d186bcdd5acde95b8ed0b66c1c4697e3 Reviewed-by: J-P Nurmi <jpnurmi@qt.io>
* Add a feature for DelegateModelUlf Hermann2018-03-2111-12/+72
| | | | | Change-Id: Ia24767b33a20bd70096bbb8b4f27729c788eb331 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
* Do not look up objects in deferred propertiesThomas Hartmann2018-03-213-1/+35
| | | | | | | | | | | If a property is a deferred property then skip it if searching for qobjects. This is not enough to avoid all asserts, but not reading deferred properties does make sense in any case. Task-number: QTBUG-67152 Change-Id: I495051745a5daf458909ff6c4cb5210597774ded Reviewed-by: J-P Nurmi <jpnurmi@qt.io>
* Simplify handling of function expressions as signal handlersMichael Brasser2018-03-214-22/+12
| | | | | Change-Id: I4bfa05b4619c248119c78d05e64270e6627f6065 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Handle function expressions in SignalTransitionMichael Brasser2018-03-211-3/+11
| | | | | | | | Extend 22b13921f8067f8a93164875a4ad59bed85b0400 to SignalTransition. Change-Id: Ic7d03353efaa7ba894b913e5b0bc193d648d21df Task-number: QTBUG-50328 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Doc: provide an example of the C++ - QML interaction pathMitch Curtis2018-03-211-11/+115
| | | | | Change-Id: Ib65bb9edbcbd1172cc620243b078c9691d961828 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Doc: mention alternative syntax for resource filesMitch Curtis2018-03-211-15/+35
| | | | | | | | This syntax allows creating distinct .qrc files without having to create them manually. Change-Id: Iab7c76fd162bb7f39b42fb983f85d74fce3036d4 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Fix QQmlListModel crash when appending an empty array in debug modeDaniel Vrátil2018-03-201-11/+12
| | | | | | | | | Calling QQmlListModel::append() with an empty JS array triggers an assert in QAbstractItemModel::beginInsertRows() because it's called with negative "last" parameter. Change-Id: I202da260d79f2e6677c663c5785ff754c715fef8 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Rename best practices page to "Best Practices for QML and Qt Quick"Mitch Curtis2018-03-201-5/+5
| | | | | | | | | | | Qt Quick is most often used via its QML types, and since some of the tips on this page are not specific to Qt Quick but apply to QML in general, it makes sense to list them both on the same page for convenience and completeness. Change-Id: I6d61b98ffd7e52dc28b33ef00a78dd745f39820a Reviewed-by: Frederik Gladhorn <frederik.gladhorn@qt.io> Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Remove qtquick-guidelines, move contents into qtquick-bestpracticesMitch Curtis2018-03-202-50/+15
| | | | | | | | | | | | This page doesn't offer much on its own, and qtquick-bestpractices.qdoc is already starting to gather useful guidelines, so move its contents there. Having everything related to best practices/guidelines on one page means less clicking between these "overview" pages, which I think is a bit of a problem currently. Change-Id: I18316dc177a6a7eb5a031e178cd0aed31dfa63ae Reviewed-by: J-P Nurmi <jpnurmi@qt.io> Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Tighten QML cache version checkingSimon Hausmann2018-03-205-39/+21
| | | | | | | | | | | | | Don't just include the "compile hash" of QtQml in the dependencies hash of QML files but use a dedicated field in the data structure, that we will also fill in when generating cache files ahead of time. This ensures that AOT generated cache files are considered invalid even when switching between different sha1s of declarative. Task-number: QTBUG-66986 Change-Id: I3d8ee103fd1a33a5b4c4576b3a2703fcd09712dd Reviewed-by: Erik Verbruggen <erik.verbruggen@qt.io>
* Fix QML data structure version checking for ahead-of-time generated filesSimon Hausmann2018-03-2015-56/+150
| | | | | | | | | | | | | | | | | | We must also do version checking for QML and JS files that were compiled ahead of time and are embedded in resources. If the lookup for the original source code fails, then we must generate an appropriate error message. As an upside we get better error reporting when trying to load an empty file and Qt.include() now reports the error message in the statusText field. The error reporting for imported scripts was not changed as importing an empty script is (oddly) allowed. Task-number: QTBUG-66986 Change-Id: Ie0ef81af371a51ecf8c66ae7954d43f5cc6c12de Reviewed-by: Erik Verbruggen <erik.verbruggen@qt.io>
* Handle function expressions as signal handlersErik Verbruggen2018-03-207-5/+39
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | There are two ways to use function expressions on the right-hand side of bindings: property var somethingPressed somethingPressed: function() { /* ..press something else.. */ } signal buttonPressed onButtonPressed: function() { /* ..handle buttonPress.. */ } In the former case, it declares a property that holds a function. So on initialization, the right-hand side of the binding returns a closure that gets assigned to the property 'somethingPressed'. In the latter case, the signal handler is explicitly marked as a function for clarity. So, the handler should not be returning the closure, but the handler should *be* the closure. In general, it is not possible to detect if the left-hand side is a property or a signal handler when generating QML cache files ahead of time. So for this case, we mark the function as only returning a closure. Then when instantiating the object, we check if it is a signal handler, and if the handler is marked as only returning a closure. If so, we set that closure to be the signal handler. Task-number: QTBUG-57043 Task-number: QTBUG-50328 Change-Id: I3008ddd847e30b7d0adef07344a326f84d85f1ba Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Doc: improve "Separate UI from Logic" sectionMitch Curtis2018-03-201-17/+31
| | | | | Change-Id: I0d36e009b4551e45e5e7fda6c95fc3fbfabfe1a5 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Doc: simplify "Qt Quick Best Practices" introduction paragraphMitch Curtis2018-03-201-4/+4
| | | | | | | | We don't need to mention specific challenges in the introduction. Change-Id: I03eec5fe543fbf0b1859850424eba8cfa9f134a5 Reviewed-by: J-P Nurmi <jpnurmi@qt.io> Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Doc: reorganize "Bundle Application Resources" sectionMitch Curtis2018-03-201-18/+30
| | | | | | | | | | Start off with the "direct" syntax, as that's the most straight-forward. Then, explain why it can be inefficient and introduce the concept of separate .qrc files. Change-Id: I63c2c3e188db04ed58e816f7e69ab98a42196ff1 Reviewed-by: hjk <hjk@qt.io> Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Fix assigning objects to QJSValue propertiesSimon Hausmann2018-03-202-1/+13
| | | | | | | | | | | | | | We support simple object bindings such as someProperty: Rectangle { ... } when the type of "someProperty" is QVariant, but we produce an error when it's QJSValue. There is no good reason for that, and the fix for QTBUG-67118 requires this. Change-Id: Ia5dc88749bcba0b5c781a6ab2b4a9fb92299e0ac Reviewed-by: Mitch Curtis <mitch.curtis@qt.io> Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Fix grammar in "Qt Quick Best Practices"Mitch Curtis2018-03-201-2/+2
| | | | | Change-Id: I3ba63110a3674675f44feca51ba98128844e1904 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Fix out of bounds reads in Array.concatLars Knoll2018-03-201-1/+1
| | | | | | | | | | In some cases, when our simple array data had an offset and data would wrap around, ArrayData::append would write out of bounds data into the new array, leading to crashes. Task-number: QTBUG-51581 Change-Id: I55172542ef0b94d263cfc9a17d7ca49ec6c3a565 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* QML debugger: Don't crash when creating objects on engine destructionUlf Hermann2018-03-191-1/+2
| | | | | | | | | | You can create further objects while the QML engine is being destroyed. The debug service is not interested in those because they will be rather short lived anyway. Task-number: QTBUG-62458 Change-Id: If5395ef058268e0e956d159bc636495da1c0c98f Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Fix crash when calling QQmlEngine::clearComponentCache()Simon Hausmann2018-03-196-61/+71
| | | | | | | | | | | | | | | | We must protect various resources in the type loader with our existing lock. The QQmlTypeLoaderQmldirContent is now value based, so that we can release the lock on the shared cache early. Copying it involves adjusting the refcount of the QHash and QString instances in the QQmlDirParser. The safety of this was verified with a TSAN build and the example supplied in the task. It crashed reliably with TASN errors first and with this patch it runs without errors. Task-number: QTBUG-41465 Change-Id: I616843c4b8bdfd65d1277d4faa8cb884d8e77df8 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Restore the QV4_WRITE_PERF_MAP featureUlf Hermann2018-03-191-6/+41
| | | | | | | | We want to be able to generate perf map files for JITed code. Task-number: QTBUG-67056 Change-Id: I56899e1dbf184083d94efe926d21fca4f9ea1e18 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Pass "this" object when evaluating debug jobsUlf Hermann2018-03-174-8/+21
| | | | | | | | | We have to explicitly specify the "this" object on QV4::Function::call, otherwise it will assume undefined or the QML global object. Task-number: QTBUG-66942 Change-Id: I1af7742b4fee1b49e9760a413834daf3edb15d74 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Fix lookup of enums declared in QML singletonsSimon Hausmann2018-03-1611-61/+3
| | | | | | | | | | | | | | | | | | | | | Given the following expression var x = MySingleton.MyEnumValue where MySingleton is a QML (composite) singleton and MyEnumValue comes from a QML declared enum, we had code in place up to (and including) 5.10 to attempt to optimize that expression to a enum constant at compile time. In 5.10 that optimization does not exist anymore. In <= 5.10 we would also skip the optimization under certain circumstances (too many statementes, etc.). The fallback that is in place for handling this at run-time tried to be smart by avoiding the QQmlContextWrapper::get lookup and return straight a reference to the singleton as QObject. That works for regular property lookups, but it fails when trying to look up something like an enum, that isn't a meta-object property. Change-Id: I1819b9d8ae06a3f595e067bf5b018c4065be76bb Reviewed-by: Lars Knoll <lars.knoll@qt.io>