aboutsummaryrefslogtreecommitdiffstats
path: root/src
Commit message (Collapse)AuthorAgeFilesLines
* Complete splitting of delivery logic qqwindow.cpp -> deliveryagent.cppwip/qquickdeliveryagentShawn Rutledge2021-02-173-11/+24
| | | | | | | Event delivery logic will live in util/qquickdeliveryagent.cpp now. The actual QQuickDeliveryAgent class will be created in a followup patch. Change-Id: I5dcbb7602ff90d87f8e23e09e29b458d0d60905b
* Merge branch wip/qquickdeliveryagent into devShawn Rutledge2021-02-171-0/+1989
|\ | | | | | | | | | | This should finish the split between qquickwindow and qquickdeliveryagent. Change-Id: I6d440a146f84c0b3555be9537181ef48cca016e9
| * Stage 4: remove non-delivery code from qquickdeliveryagent.cppShawn Rutledge2021-02-171-3026/+0
| | | | | | | | Change-Id: Id729aa4ceac90e940a9e05405159970c0e677369
| * Stage 3: remove non-delivery code from qquickdeliveryagent.cppShawn Rutledge2021-02-171-827/+1
| | | | | | | | Change-Id: I94d2fb19b885a4821f3d2e12bde14fd834386848
| * Stage 2: splitting parts of qquickwindow.cpp to qquickdeliveryagent.cppShawn Rutledge2021-02-171-0/+0
| | | | | | | | | | | | | | | | This is another step in the process to split event delivery logic out of qquickwindow into qquickdeliveryagent, while keeping git blame intact. In this patch we just rename qquickwindow.cpp to qquickdeliveryagent.cpp Change-Id: I01b6a022c646239bb252654d4781b6efb81e9876
* | Remove code from qqwindow.cpp to be split into qqdeliveryagent.cppShawn Rutledge2021-02-171-1956/+12
|/ | | | | | | | | This is the first stage of a split according to the technique in https://devblogs.microsoft.com/oldnewthing/20190916-00/?p=102892 This won't compile as-is, but will after we merge the wip branch in which the functions exist in qquickdeliveryagent.cpp. Change-Id: I1a9749b7877248b54c557de564ec6fa5b0105f73
* Uniformly support shebangFawzi Mohamed2021-02-151-0/+14
| | | | | | | | | | | | | | | | | | | | | | | | The "qml" tool was the only way of loading QML files that would respect a shebang line. This is problematic as this way you cannot load such files programatically using QQmlComponent, limiting their re-use. Common tools like Qt Creator, but also qmllint, qmlformat, qmlcachegen, etc would not recognize files with shebangs. By moving she-bang support directly in the lexer all tools implicitly support it. Note that we could just as easily support '#' as extra comment character along with //, but here we narrowly add support for in the first line only, as node does (this means that javascript files using she-bang accepted by node, are now accepted also by qml). The only tool needing some adjustments is qmlformat, that has to emit the she-bang again as she-bang and as first line. Add tests for qmlformat, and sprinkle some she-bangs in the other tests just to be sure it doesn't affect anything. Change-Id: I1f6d881c7438bdb23163b5dbe829d59a35d11132 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* Rename DBG_* logging categories in Qt QuickShawn Rutledge2021-02-158-71/+71
| | | | | | | | | | | | | We prefer camelCase rather than SHOUTING for module constants. It fits well to have logging categories as constants that start with lc. That has become conventional in various modules, and we've been using that convention already for some time when defining new logging categories. Now we finish renaming the Qt Quick ones, ahead of a refactoring which will result in moving some of them around. Pick-to: 6.1 Change-Id: I47003b9e525fe70d35dbd2450d03379b52d67c1d Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* Add QWindow and QQuickWindow overloads for qmlInfo()Mitch Curtis2021-02-151-0/+15
| | | | | | | Otherwise you can't print out window objects with it. Change-Id: I2a177bd71215cfcb3f5fc47c9171eaba9a12ac0f Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* qquicktextinput: Fix Undo history for IM eventBartlomiej Moskal2021-02-151-4/+6
| | | | | | | | | | | | | | | | | | Do not set m_cursor (cursor position) before calling removeSelectedText() in processInputMethodEvent(QInputMethodEvent *) method. Before this change, DeleteSelection command was added to history with new cursor position. If this command will be later rolled back, cursor position will not be set correctly. It should be set to position before handling the event. Pick-to: 5.15 6.0 6.1 Task-number: QTBUG-90239 Change-Id: Ib5e46d232e6b32f904e745da4f9e5bc03a58963f Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Rami Potinkara <rami.potinkara@qt.io> Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
* QQmlPropertyBinding: Create more verbose binding loop warningFabian Kosmale2021-02-151-1/+6
| | | | | Change-Id: I6f83fc61c72993c04c99ff16c31c10b20ada5db8 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* MouseArea: fix containsMouse behavior during visibility changesVolker Hilsheimer2021-02-121-0/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | QQuickItem returns whether it contains QGuiApplicationPrivate's lastCursorPosition. Since that position stores the coordinate last seen by Qt (the window border), it will always be within the window, and within an item that covers that part of the window's border. However, QQuickWindow stores the lastMousePosition as well, and resets that value when it receives a QEvent::Leave. We can use that to test whether the window that contains the item has seen a Leave event, in which case the item is definitely not under the mouse. Notes on the test: That we use QPointF() as the "reset" value leave the small possibility that the cursor might be at position 0,0 of the window (ie inside the window), and the QQuickItem there will not be under the mouse. We can't confirm this (through an expected failure test), as QTest::mouseMove interprets a QPoint(0, 0) as "center of the window". And since we can't simulate mouse moves outside a window's boundary using QTest::mouseMove, the test needs to explicitly synthesize a QEvent::Leave for the window. Fixes: QTBUG-87197 Pick-to: 6.1 6.0 5.15 Change-Id: I04870d6e914092275d9d790312fc702fb99f2935 Done-with: Ivan Solovev <ivan.solovev@qt.io> Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* Animation: Export the remaining QtQuick animation typesUlf Hermann2021-02-121-3/+3
| | | | | | Change-Id: I058e7df9263be165ff0370ddc8c947aca1eba9b5 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> Reviewed-by: Maximilian Goldstein <max.goldstein@qt.io>
* QML: Warn about usage of injected signal parametersUlf Hermann2021-02-129-23/+85
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | You should declare functions with formal parameters if you want to use parameters passed by the signal. We need to generate two different warnings because there are two code paths by which such parameters are injected. If we compile with qmlcachegen, it simply inserts a lookup instruction in to the byte code. This lookup then triggers our special hack expressly made for signal parameters. If we don't compile using qmlcachegen, a function declaration with formal parameters is synthesized. We mark those formal parameters as injected and warn if we see one of them used. [ChangeLog][QML][Important Behavior Changes] The automatic injection of signal parameters into signal handlers is deprecated. This is because we cannot determine the names of the signal parameters at compile time. Furthermore, also for human readers it is difficult to discern between arguments, context properties, properties of the current object, and properties of the root object of the component. Requiring the signal parameters to be explicitly named resolves some of this confusion. You can turn the deprecation warning off using the "qt.qml.compiler" and "qt.qml.context" logging categories. Task-number: QTBUG-89943 Pick-to: 6.1 Change-Id: If0a5082adb735a73efd793868b3a55bc7d694cbe Reviewed-by: Mitch Curtis <mitch.curtis@qt.io> Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> Reviewed-by: Andrei Golubev <andrei.golubev@qt.io>
* Support runtime functions evaluation by index through QQmlEngineAndrei Golubev2021-02-124-0/+58
| | | | | | | | | | | Add execution function that can evaluate runtime functions available in the compilation unit. Private API for now as it's unclear what would be a comprehensive solution to support all existing use cases Task-number: QTBUG-84368 Task-number: QTBUG-91039 Change-Id: Icf755b53484587d7983eaae4821c1aa0111d5c05 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* Transform JSCallData args setting into a functionAndrei Golubev2021-02-124-22/+85
| | | | | | Change-Id: I4154a0b5c7115375292794e0564d2f3657e6b4dd Reviewed-by: Ulf Hermann <ulf.hermann@qt.io> Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* Unregister value types when tearing down QML typesUlf Hermann2021-02-1220-213/+157
| | | | | | | | | Move the value type registry into QQmlMetaTypeData. This way we can conveniently drop the relevant entries when unregistering a type. Fixes: QTBUG-86946 Change-Id: Id024a34a8b2b622fd9417fc0e52864b43c66cc01 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* Use functions as signal handlers when accessing parametersUlf Hermann2021-02-1227-44/+46
| | | | | | | | | Injected signal handlers are bad practice because they aren't declared. Pick-to: 6.1 Task-number: QTBUG-89943 Change-Id: I3a691f68342a199bd63034637aa7ed438e3a037b Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* Doc: Add missing \inmodule commandNico Vertriest2021-02-122-0/+3
| | | | | | Task-number: QTBUG-90439 Change-Id: I0e29e2ee090d5aa4ae40bcca4bd5fa14f87d9c0c Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
* Doc: Fix CI warnings qtdeclarativeNico Vertriest2021-02-121-10/+10
| | | | | | | | Fix errors with \fn and hidden friend functions Task-number: QTBUG-90439 Change-Id: I1de021c953efdd397de4bb25cbe3180175265174 Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
* Doc: Avoid unqualified lookup in the signals documentationUlf Hermann2021-02-121-2/+2
| | | | | | Pick-to: 6.1 Change-Id: Ibcb20311c7e5a56038c738da77d9dfcc9464bce4 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* QML: Warn about variables being used before their declarationUlf Hermann2021-02-114-13/+35
| | | | | | | | | | | | | | | | | | This collides with injected signal parameters. qmlcachegen cannot tell those cases apart. [ChangeLog][QML][Important Behavior Changes] QML warns about JavaScript variables being used before their declaration now. This is almost always a mistake. It is particularly dangerous in the presence of injected signal parameters because qmlcachegen cannot identify a name collision between an injected signal parameter and a variable being used before its declaration. It therefore miscompiles such code. You can turn off the deprecation warning using the "qt.qml.compiler" logging category. Pick-to: 6.1 Task-number: QTBUG-89943 Change-Id: I8a9424ca8c6edd562402fe5c560ba7e8344b5585 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* QQuickWidget/Documentation: Mention the need to set the graphics APIFriedemann Kleint2021-02-111-3/+7
| | | | | | Pick-to: 6.0 Change-Id: I3b60586604003e360070a0d481e1a3df2e087e5c Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
* SoftwareImageNodes: Initialize member variableDavid Edmundson2021-02-111-1/+1
| | | | | | | | | | | m_pixelRatio is not set in the constructor It seems the method setDevicePixelRatio is always called, so there are no ill effects, but without setting it we still read uninitialized data creating warnings when used with a memory checker. Change-Id: Iadfe07600d027dddb98fdd755b4022b2b81547a8 Reviewed-by: Andy Nichols <andy.nichols@qt.io>
* QHashedString(Ref): Use QStringView internallyFabian Kosmale2021-02-113-99/+28
| | | | | | | | | | | | | | | We cannot store a QStringView internally, as that would increase the size of our objects (QHashedString(Ref) does not support strings with sizes that do not fit into 32bit, thus it can store the hash and the size in one 64 bit block). What we can however do is to construct a QStringView on demand (which is cheap), and use its methods. The benefits are twofold: We get rid of some accidental complexity in qtdeclarative; and the code in QStringView is actually SIMD optimized. Change-Id: I2445a2d5a16b253f4971d7f3be0e1b274326eacb Reviewed-by: Maximilian Goldstein <max.goldstein@qt.io> Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* Restore String size assertFabian Kosmale2021-02-101-0/+2
| | | | | | | | | Just like all of the other datastructures in qv4compileddata, changing the size of String would require an inrcement of QV4_DATA_STRUCTURE_VERSION. Change-Id: I462d04204255946d309d245bc20b044ba9d222d7 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* QV4::Lookup: update comment about gc assumptionFabian Kosmale2021-02-101-0/+1
| | | | | Change-Id: I13304631a9870874fb130cd9e6598065fc952a71 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* QQmlPropertyPrivate: Remove documentation about flags parameterFabian Kosmale2021-02-101-3/+0
| | | | | | | The parameter is gone since 3bc239a0f16fb93f84def55a5980ef8561e7a7b4 Change-Id: Iae411b61f27efd60b489dbc219ef0ad07ad19938 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* Use QQmlBinding::Ptr typedefFabian Kosmale2021-02-101-7/+7
| | | | | | | | | | Instead of spelling out QExplicitlySharedDataPointer<QQmlBinding>. That is consistent with all other code, and makes grepping for binding pointers easiers, as they now all end with Binding::Ptr. Change-Id: I19018732a699368200f129cecf869ece1c8b1a7f Reviewed-by: Maximilian Goldstein <max.goldstein@qt.io> Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* Fix QJSValue string parameters used in signalsMaximilian Goldstein2021-02-101-1/+1
| | | | | | | Pick-to: 6.1 6.0 5.15 Fixes: QTBUG-86482 Change-Id: If938fad22f51b08fe3cb20b94634efe46a1eed47 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* Support and prefer QML_IMPORT_PATH over QML2_IMPORT_PATHUlf Hermann2021-02-105-36/+49
| | | | | | | | | | The 2 is meaningless. Task-number: QTBUG-85064 Change-Id: I9f140155d274c691b5eab1285d9b7153f9f93a87 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io> Reviewed-by: Andrei Golubev <andrei.golubev@qt.io> Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* Use QLibraryInfo::QmlImportsPath rather than Qml2ImportsPathUlf Hermann2021-02-093-5/+5
| | | | | | | | | The "2" is meaningless and there is a better name available now. Task-number: QTBUG-85064 Change-Id: I65d26b06712ed7dcf2825f16dffaa6060dd86985 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io> Reviewed-by: Andrei Golubev <andrei.golubev@qt.io>
* Doc: Update type registration flowchartUlf Hermann2021-02-093-0/+3
| | | | | | | | | You're not supposed to call the registration functions manually. Pick-to: 6.1 Fixes: QTBUG-90718 Change-Id: I829800132484dea670657ed1679357fe58d0ddf9 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* Reimplement Math.hypot() using QHypotHelperEdward Welbourne2021-02-091-21/+6
| | | | | | | | As part of adding qHypot() in qtbase, we now have a robust efficient implementation of arbitrarily-many-parameter hypot(), so reuse it. Change-Id: Iafd0eee84f3271c37003431a5f2b1a62d7ef6f86 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* qqmlengine: Fix some warnings not being displayed correctlyMaximilian Goldstein2021-02-091-8/+8
| | | | | | | | Use noquote() for qqmlengine warnings. Fixes: QTBUG-86595 Change-Id: Ibe161cb164b9fa2511e4bc02237de5d81172e114 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* Return errors if validation of inline components failsUlf Hermann2021-02-081-1/+3
| | | | | | | Pick-to: 6.0 6.1 Fixes: QTBUG-90038 Change-Id: Ic01b5d097e0b9e6720bcec7ccb18c22abb5418f4 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* QQmlInterceptorMetaObject::intercept: Avoid metatype<->id ping-pongFabian Kosmale2021-02-081-4/+3
| | | | | | | | | | There is no need to extract the metatype id to know whether the type is valid (aka != UnknownType). Moreover, as we already have a metatype, there is no need to do the typeid -> metatype lookup. Task-number: QTBUG-88766 Change-Id: I5f9512aa6e06b0d89be8d3cad970f12319dab156 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* qjsengine: Clarify to/fromScriptValue documentationMaximilian Goldstein2021-02-081-0/+2
| | | | | | Fixes: QTBUG-89956 Change-Id: I96439433b1f172e933c6c56daae639be7e18b931 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* QSGBatchRender: avoid crash if buffer shrinksFabian Kosmale2021-02-081-2/+2
| | | | | | | | | | | | The QRhiBuffer does not shrink; thus we can end up with buffer->buf->size > buffer->size. This would subsequently lead to an out-of-bounds memory access, and a crash. Fix this by using the uploadStaticBuffer overload which takes the size. As a drive-by, remove pointless QByteArray::fromRawData call. Pick-to: 6.0 6.1 Change-Id: I40058ada6a6a5eb745ae559e8c9ed474fd41f75c Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
* Do less work when there are no active ImageParticle particlesMichael Brasser2021-02-063-8/+29
| | | | | | | | | | Don't mark geometry and material as dirty if there is nothing to change. Pick-to: 6.1 6.0 5.15 Task-number: QTBUG-41867 Change-Id: I016d2d76f4ebf731f5bfc931ba616ee5d074bc65 Reviewed-by: Tomi Korpipää <tomi.korpipaa@qt.io> Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
* QQuickItemParticle give() method kill particleFabio Falsini2021-02-051-0/+1
| | | | | | | | | | | | | | Currently removing an item connected to a particle only invalidate the particle that will be reused for the next item set. This has the effect that the new item inserted appears in the same position as the old one just removed. This patch force killing the particle to assign next item to a new particle starting from initial position. Pick-to: 5.15 6.0 6.1 Change-Id: Ic937a6d7aea65368cceb1405bb81ef1502d988a5 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* Add "we mean it" warning to private headersVolker Hilsheimer2021-02-054-0/+44
| | | | | | | Fix warning from configure step. Change-Id: I5afeeeeabf1cb22149e1df3cecb27c6cf4a0567f Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* qqmlproxymetaobject: Support invoking methods and slotsMaximilian Goldstein2021-02-052-31/+55
| | | | | | | Previously this just failed silently and returned garbage data. Change-Id: Ia8b72836aa0ccfd50fd18b0f813c2bf3a00801c5 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* Use a QDoubleEndedList for the children of animation group jobsUlf Hermann2021-02-0512-122/+389
| | | | | | | | | | This way it's fundamentally impossible to add the same animation job to two different group jobs. The pointers are not exposed anymore and no one can re-order the jobs. Task-number: QTBUG-90401 Change-Id: Iebff4b64960c853915dd32714acd144fc5cdc00d Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* QSequentialAnimationGroupJob: Protect against self-deletionUlf Hermann2021-02-052-9/+9
| | | | | | | | | | | setCurrentAnimation() can indirectly delete the animation group job itself by invoking the animation controller. Use the RETURN_IF_DELETED mechanism to avoid the resulting dangling pointers. Task-number: QTBUG-90401 Pick-to: 6.1 6.0 5.15 5.12 Change-Id: Ibd0ad21e8d3af4760604c3ff37dc46101d5f49ad Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* Doc: Fix link error to Qt CreatorNico Vertriest2021-02-051-1/+1
| | | | | | | | Link to Exporting from Design Tools Task-number: QTBUG-90439 Change-Id: I4c0b6bc899a48bb2aa2c4ad083e8b2ee9f9a41ce Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
* Invalidate external renderpass descriptors from Quick3DLaszlo Agocs2021-02-053-0/+19
| | | | | | Pick-to: 6.1 6.0 Change-Id: I362b35b3d038d4fb24fab0e73cb120027f2308ea Reviewed-by: Andy Nichols <andy.nichols@qt.io>
* fix a commentJiDe Zhang2021-02-051-1/+1
| | | | | | | | | | There is no the QQuickWindow::setBackend() function, only QQuickWindow::setSceneGraphBackend() and QSGContext::setBackend() are available, assume it is the public one. Change-Id: If5c4650d96919715abce92aec30f474518139ce6 Reviewed-by: Liang Qi <liang.qi@qt.io> Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
* qquicktextinput: ensure we update IM when cursor changes positionRichard Moe Gustavsen2021-02-041-4/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | Normally the cursor will change position inside a text input after receiving a touch or a keypress event. But it can also change position by sending it a QInputMethodEvent. But as it stood, we would in that case not inform the platform input context about it, which meant that the IM state in QQuickTextInput would be different from the IM state in QPA. A bug on iOS could be seen from this when dragging the cursor around using the magnifier glass. In that case QIOSTextResponder would move the cursor in QQuickTextInput using QInputMethodEvents. But since this would not be forwarded back to UITextInput, the result would be that if you e.g pushed backspace on the input panel, you would delete the character at the position the cursor had before the drag. This patch will ensure that we update platform IM state whenever the cursor changes position from QInputMethodEvents. Pick-to: 6.0 5.15 Fixes: QTBUG-72757 Change-Id: Ic39c60fbce982f80d014befddbb2d4439ddeea4f Reviewed-by: Mitch Curtis <mitch.curtis@qt.io> Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
* Don't hide the inputMethod when finishing the editAndy Shaw2021-02-041-2/+0
| | | | | | | | | | | | | There is no reason to hide the inputMethod explicitly when finishing the editing. This will be taken care of for us by the platform plugin and will account for a situation where Qt Quick Controls 2 will check if the item had focus when it is in an popup being closed at this point too. Pick-to: 6.1 Change-Id: I687718ae9b4fabbf6456597a475507d2ec1a1f45 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io> Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>