aboutsummaryrefslogtreecommitdiffstats
path: root/src
Commit message (Collapse)AuthorAgeFilesLines
* Fix QJSValue singletons only supporting object typesMaximilian Goldstein2021-02-222-8/+20
| | | | | | | | | | | Now primitives such as integers and strings should also work. Fixes: QTBUG-85615 Change-Id: I201d1844b7272ca50e32f1e33e9ac357b5e68dfe Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> Reviewed-by: Ulf Hermann <ulf.hermann@qt.io> (cherry picked from commit 64102ae231317eb6f637304918e55153dadef72d) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* CodeChecker: Assert that pointer canot be nullFabian Kosmale2021-02-221-2/+3
| | | | | | | | In the AST, the type always has a name. Change-Id: Ifc299573132b9edeb4c0b96054a101d95332236a Reviewed-by: Ulf Hermann <ulf.hermann@qt.io> (cherry picked from commit c6c37d12633cc9fc3be1a1aa8e18d1013f3ab2d9)
* QML: Make retrieval of a signal name from a handler accessibleUlf Hermann2021-02-193-18/+28
| | | | | | | | | We want to do that in other places, too. Change-Id: Id42495d239c2dccffa390478c8b57ec1acab7408 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> (cherry picked from commit 1daee0b03050487cfc4b483262ca73e5a24267ff) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Remove Windows 7 VM workaround from rhi initLaszlo Agocs2021-02-191-11/+1
| | | | | | | | | There is no longer a Windows 7 configuration in CI. Change-Id: Ic190735301f03e84974132ed1183adfd9352187a Reviewed-by: Andy Nichols <andy.nichols@qt.io> (cherry picked from commit 4d9d5ab8187a2e1391afdcd0716bd43196040984) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Improve QSGMaterial docsLaszlo Agocs2021-02-191-15/+31
| | | | | | | | | | | | | | Remove a Qt 6.0 editing issue where the docs continue saying "QSGMaterialShader and QSGMaterialShader", which is a leftover from 5.14/5.15 times when QSGRhiMaterialShader still existed. While we are at it, improve the code snippets and talk a bit more about type(), inspired by recent mailing list discussions. Change-Id: I4b21ed00285bf18e22e64a7574a273abdf8be3e5 Reviewed-by: Andy Nichols <andy.nichols@qt.io> (cherry picked from commit 258077e00eb8f3f4b0ef21a9a0395268b6c86532) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* qmllint: Resolve attached property scopesUlf Hermann2021-02-193-27/+32
| | | | | | | | | Previously, all attached property scopes were just ignored. Task-number: QTBUG-84369 Change-Id: I324becf92402eacea9d150e6e51359edae562dde Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> (cherry picked from commit f34ecc8f99522b69d1aaa3d5d233add9ed9b6da9)
* Layouts: Depend on QtQuickUlf Hermann2021-02-191-0/+2
| | | | | | | | | | | If we don't declare the dependency our tools won't figure out where QQuickItem comes from when analyzing the dependency hierarchy of layouts. Change-Id: I389c9e513a3a65143aa6b6fbf508eee584970181 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io> Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> (cherry picked from commit fe7318a6cf4398802f919766f2ac585bd844cf48)
* qquicktextinput: Fix validation for IM eventBartlomiej Moskal2021-02-192-2/+28
| | | | | | | | | | | | | | | | | | If validation did not pass after text pre-editing is finished, it need to be roll back to state before pre-editing started. Before this change, if validation did not pass, text was always rolled back to previous state. In pre-editing text case, it means back to the state in which part of the text was removed (and later changed to pre-edited text). It may cause a situation of removing part of the text that was already validated Fixes: QTBUG-90239 Change-Id: I3ec39e0f6b8a93d4e6fd190af30d4c80a0e495eb Reviewed-by: Rami Potinkara <rami.potinkara@qt.io> Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io> (cherry picked from commit b1ae151acc80254ab0ec2937c55b99223205875c) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* docs: Fix documentation of the Locale numberOptions propertyShawn Rutledge2021-02-191-1/+1
| | | | | | | | | | Document the property not the enum type. Fixes: QTBUG-91196 Change-Id: Id11a436caf1c683a0e70a1b8e8ce86c6118725d8 Reviewed-by: Paul Wicking <paul.wicking@qt.io> (cherry picked from commit 3670395af58f21f203ce2289a04feef7c6de53f5) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* QQmlProperty: document propertyMetaTypeFabian Kosmale2021-02-191-2/+9
| | | | | | | Change-Id: Ida75d35fb4eced20b206caf3bc247c734679cf10 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io> (cherry picked from commit edf8106be2b94dea5bd3b8a446705521957bf973) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* QQmlPropertyPrivate::signalExpression: handle object being nullFabian Kosmale2021-02-191-0/+4
| | | | | | | | | | | | | | | QQmlData::get expects a non-null pointer, therefore we need to check whether the object still exists. Note that while this fixes the crash in the referenced bug, PropertyChanges still does not support a dynamic target. Task-number: QTBUG-46350 Change-Id: Ifeecf5df83e87468a1d314ce2b120006124d6f4b Reviewed-by: Maximilian Goldstein <max.goldstein@qt.io> Reviewed-by: Ulf Hermann <ulf.hermann@qt.io> (cherry picked from commit 1ff376e64bf5af6df7e0079700d2b9164037dc89) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Doc: Fix warnings about snippets in qtdeclarativeNico Vertriest2021-02-194-5/+14
| | | | | | | | | | | Cannot find file to quote from: 'code/backend/backend.pro' Cannot find file to quote from: 'code/doc_src_qtqml.pro' Cannot find file to quote from: 'code/doc_src_qtquick.pro' Change-Id: I26642a375a659a3d8dbda097702ffc2f68d10137 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> (cherry picked from commit ca7d2c1f4ca010096b668108200cd9f1357a5b2e) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* QML: Do not JIT-compile AOT-compiled functionUlf Hermann2021-02-191-2/+4
| | | | | | | | | The AOT-compiled code is supposed to be the best one if available. Change-Id: Ib66a3d8e57cf437e0a5e6395f2ec6a0ab21f39c0 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> (cherry picked from commit d446cb746f4e8e84efea8b3afda530d6da52d5f5) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* CMake: Fix dependencies between metatypes and qmltypesUlf Hermann2021-02-191-0/+1
| | | | | | | | | | | | qmltyperegistrar needs all the metatypes declared in the foreign types file. Otherwise it produces incomplete output. Change-Id: I5876ca9add59fafa54e2d2e6eb2de058c9595870 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> Reviewed-by: Alexey Edelev <alexey.edelev@qt.io> Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io> (cherry picked from commit ce950d619aef3ad0534544b2e029a6f025b256a5) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* QQuickStackLayout: Fix include directiveUlf Hermann2021-02-191-1/+1
| | | | | | | | | | This include would only work when qquickstacklayout_p.h was included by a file in the same directory as qquicklayout_p.h. Change-Id: I872e3e85ebe08b58f9bb611d36c8428ff6bccdf9 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> (cherry picked from commit 424030efdb1ca416c91e4360865d7f4fd62f4b3f) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* QJSPrimitiveValue: Implement modulo operatorUlf Hermann2021-02-191-0/+28
| | | | | | | | | | | The modulo operator has special semantics in JavaScript. We need to mirror those. Task-number: QTBUG-84369 Change-Id: I5a4d63a01e232686832c83f2def0faf57e7359c2 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> (cherry picked from commit 84cf29933cee44e09590fc89ae800dd453f664ca) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* QJSValue: Allow casting integers to enumsUlf Hermann2021-02-191-0/+8
| | | | | | | | | You can also cast enums to integers, after all. Change-Id: I283d3dd280eeb44ba22bb45ca9be69e5358d5781 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> (cherry picked from commit 453be4e6065a323e7fc0ea93fa0bee845d2020cd) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Fix lookup of existing inline components by nameUlf Hermann2021-02-191-1/+1
| | | | | | | | | Previously this would always return the inline component iwth ID 1. Change-Id: I49dc6eb64fcd8428667f3b22afcb7212aa792db3 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> (cherry picked from commit 7104a3a6f8fe518bd8a0d0d246c0f65df340ee38) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* qmllint: Don't create properties for "on" assignmentsUlf Hermann2021-02-161-12/+15
| | | | | | | | | | | "on" assignments are assignments to the default property, with the property given interpreted as the target for the inner object. Change-Id: Ia93a171f759964d2c00d6c0293a5434f588123af Reviewed-by: Andrei Golubev <andrei.golubev@qt.io> Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> (cherry picked from commit 67c8afff346eae27c6fb833661d179326dd8b153) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* 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. Change-Id: I47003b9e525fe70d35dbd2450d03379b52d67c1d Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io> (cherry picked from commit a8685fdb4d57c0ba36d80c395c2ae878595f04da) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* 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. 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> (cherry picked from commit 6ec8c62ca22c363fa00e085de10198a90e3d65dc) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* 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 Change-Id: I04870d6e914092275d9d790312fc702fb99f2935 Done-with: Ivan Solovev <ivan.solovev@qt.io> Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io> (cherry picked from commit ba1246c543118515ea244787f3d7f9c1133ccf0f) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* 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 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> (cherry picked from commit df70d4f76f9c1c7b3de9ae91877df803c18b1264) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Use functions as signal handlers when accessing parametersUlf Hermann2021-02-1227-44/+46
| | | | | | | | | | Injected signal handlers are bad practice because they aren't declared. Task-number: QTBUG-89943 Change-Id: I3a691f68342a199bd63034637aa7ed438e3a037b Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> (cherry picked from commit 4cc91a6a0e4f9063233a4d6554ae64855cf99c14) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Doc: Avoid unqualified lookup in the signals documentationUlf Hermann2021-02-121-2/+2
| | | | | | | Change-Id: Ibcb20311c7e5a56038c738da77d9dfcc9464bce4 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> (cherry picked from commit 165ba01a6833e88896cf3f323d8fad67561e1edd) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* QML: Warn about variables being used before their declarationUlf Hermann2021-02-124-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. Task-number: QTBUG-89943 Change-Id: I8a9424ca8c6edd562402fe5c560ba7e8344b5585 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> (cherry picked from commit ab71cdafca87513a4e214d3af056d8990bc1eddb) Reviewed-by: Andrei Golubev <andrei.golubev@qt.io>
* Fix QJSValue string parameters used in signalsMaximilian Goldstein2021-02-101-1/+1
| | | | | | | | Fixes: QTBUG-86482 Change-Id: If938fad22f51b08fe3cb20b94634efe46a1eed47 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io> (cherry picked from commit e887f25dd6c4c9630a7367c3a2ed95a284191843) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Doc: Update type registration flowchartUlf Hermann2021-02-093-0/+3
| | | | | | | | | | You're not supposed to call the registration functions manually. Fixes: QTBUG-90718 Change-Id: I829800132484dea670657ed1679357fe58d0ddf9 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> (cherry picked from commit 707f7603fbb6bce60ed532cd42ff2dc9ae39e611) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Return errors if validation of inline components failsUlf Hermann2021-02-081-1/+3
| | | | | | | | Fixes: QTBUG-90038 Change-Id: Ic01b5d097e0b9e6720bcec7ccb18c22abb5418f4 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> (cherry picked from commit 001596d472557bca08eb93159e724301dea88ad6) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* 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. Change-Id: I40058ada6a6a5eb745ae559e8c9ed474fd41f75c Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io> (cherry picked from commit f0a51eef5696782ec325b20f14cfe353d0a58d20) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* 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. Task-number: QTBUG-41867 Change-Id: I016d2d76f4ebf731f5bfc931ba616ee5d074bc65 Reviewed-by: Tomi Korpipää <tomi.korpipaa@qt.io> Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io> (cherry picked from commit e3cb305a6a19bf394c1068a7e483e1c95e11c22b) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* 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. Change-Id: Ic937a6d7aea65368cceb1405bb81ef1502d988a5 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io> (cherry picked from commit d0b1bef8b889ab852eaf906fdc9cd4219238872e) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* 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 Change-Id: Ibd0ad21e8d3af4760604c3ff37dc46101d5f49ad Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> (cherry picked from commit 680f28b08f65ad38c8d5498b5738231b2a2779a3) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Invalidate external renderpass descriptors from Quick3DLaszlo Agocs2021-02-053-0/+19
| | | | | | | Change-Id: I362b35b3d038d4fb24fab0e73cb120027f2308ea Reviewed-by: Andy Nichols <andy.nichols@qt.io> (cherry picked from commit 93fe74ca433850e505f8f8940e99f3bf6a6dc050) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* 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. Change-Id: I687718ae9b4fabbf6456597a475507d2ec1a1f45 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io> Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io> (cherry picked from commit 6da66ff611902d8c4d485568d746f49c69f1330f) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* QQmlIRLoader: Actually load RequiredPropertyExtraDataFabian Kosmale2021-02-031-0/+7
| | | | | | | | | | | | | | | If a QML component wants to mark properties of its "parent" component as required, it can do so via required propertyName The information about those properties is stored in a RequiredPropertyExtraData data structure. This structure is already serialized to disk in the QQmlIRWriter. However, we neglected to restore it so far in the loader. Fixes: QTBUG-90538 Pick-to: 5.15 6.0 Change-Id: I789daff9bc881e4f35c942c77f5116b5284de81b Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* qmltyperegistrar: Fix handling of default propertiesUlf Hermann2021-02-021-26/+35
| | | | | | | | | Default properties are always local. There is no way to declare a default property for a foreign type as the default property is queried directly from the classinfo at runtime. Change-Id: I30efb6fba190957ac2a4ad86da437f209cd1f3ad Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* Remove superfluous include directiveFriedemann Kleint2021-02-021-1/+0
| | | | | | | | | | | It is not conforming to the include conventions (module missing) and thus breaks the Qt for Python doc build. Introduced by 48b4c1f450109b148f03f62574d78b460859c4a1. Pick-to: 6.0 Change-Id: I1ff56a967c457f1909b7f6e2e430458e3a3f47c9 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* Make the internals of QQuickAnimatorController privateUlf Hermann2021-02-021-1/+2
| | | | | | | | | | No one should mess with those. All the pointers have complicated ownership semantics. We can just befriend the test instead of making it all public. Task-number: QTBUG-90401 Change-Id: I6c4adbab7046b40db7f4628780ef928445ea3eb2 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* Fix Math.round edge-caseAllan Sandfeld Jensen2021-02-021-3/+6
| | | | | | | | | Round 0.49999999999999994 correctly Task-number: QTBUG-90444 Change-Id: I0e8a19fb52540c6e976308089a782f1f472bc77f Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* Add 'MANUAL_MOC_JSON_FILES' support by 'qt6_qml_type_registration'Alexey Edelev2021-02-021-1/+6
| | | | | | | | | | | Pass the 'qt6_qml_type_registration' function's 'MANUAL_MOC_JSON_FILES' argument to 'qt6_extract_metatypes', if specified. Align the 'qmltyperegistrar' test to modifications in the 'qt_manual_moc' and 'qt6_qml_type_registration' functions. Task-number: QTBUG-84906 Change-Id: I6b23526e1cc4633f55536871cbb7bc6d891f1dea Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* Remove obsolete folders in qmlcompilerDavid Skoland2021-02-022-2/+0
| | | | | | | | | | These were only present because qmake wanted them, but since qmake is no longer supported in dev, these can be removed. Folders: QtBootstrap and QtQmlDevTools Change-Id: I0426b43590eb90f97453429a5d5baac035a7d3c4 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
* qmltyperegistrar: Do not add extensions to local anonymous typesUlf Hermann2021-02-021-9/+2
| | | | | | | | | If we generate a local anonymous type, then that's the local part of a QML_FOREIGN local/foreign couple. Any QML.Extended in there belong to the foreign type. Change-Id: Ic1706045eff03dd7b1b553240596ffc21818c8bd Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* quickwidgets: fix build with -no-feature-messageboxNick Shaforostov2021-02-011-1/+3
| | | | | Change-Id: I51fb3064f12a0740434091ba696924090deaf839 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* Doc: Fix documentation warnings for Qt QuickTopi Reinio2021-02-014-20/+16
| | | | | | | | | | | - Source code for several QML modules has moved, adjust documentation configuration accordingly. - Comment out \instantiates commands referring to internal/undocumented classes. Task-number: QTBUG-90439 Change-Id: I360c8a5c02c5a03b84c77010f399d1a0e36b1263 Reviewed-by: Nico Vertriest <nico.vertriest@qt.io>
* QuickTest: Do not recurse forever on inline components in enumerateTestCasesFabian Kosmale2021-02-011-1/+4
| | | | | | | | | | | | | | | | | | | | In TestCaseCollector::enumerateTestCases, we visit the super compilation unit of QML tpyes to check if they might be instances of TestCase. However, in the case of inline components, the super unit is the current compilation unit, and we would recurse endlessly. This does not address the issue that an inline component might actually inherit TestCase. However, as this only affects the enumeration output and does not actually affect test execution, this is not that much of an issue. It should also be noted that the enumeration also fails in any case where TestCases are loaded dynamically (with a loader), so the method is not 100% accurate even in the absence of inline components. Fixes: QTBUG-90740 Task-number: QTBUG-90762 Pick-to: 5.15 6.0 Change-Id: I7e133d62c4f62fc46e9bd3999ff755f7ded3c386 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* QmlCompiler: Allow for multiple extensions per objectUlf Hermann2021-02-014-43/+27
| | | | | | | | | | | | | | | | | | | Previously, the assumption was that each object could only have a single extension object. As proven by the new qqmllanguage test this is not the case. Each registered object in the type hierarchy can have its own extension. Therefore, adjust the algorithms that generate qmltypes and iterate the extension objects when analyzing them. This leads us to the realization that anonymous types can in fact meaningfully carry extensions and implement interfaces. Adapt qmltyperegistrar accordingly. For the test to compile, however, we need to realize that the class declaring interfaces needs to befriend all potential subclass's QmlInterface structs. Fix that, too. The rabbit hole went deep. Change-Id: Ia451897e927e03b95c3062e829edf1dfcd216613 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* Prefer qHypot() over sqrt(a sum of squares)Edward Welbourne2021-02-011-1/+1
| | | | | | | | | It's apt to be more accurate and may even be optimised. Comment on a benchmark where we could use Math.hypot(), but that would break comparison with Qt 5 results. Change-Id: I7c37dd3df82fdef18e7ebb0e1548198afd256faa Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* Drop JavaScript root object members from builtins.qmltypesUlf Hermann2021-02-011-1593/+7
| | | | | | | | | | | | | | | | | | Those are not actually accessible from C++, and the description we had was incomplete and misleading. There was no way to know that the "Math" type, for example, was the type of a member of the global object called "Math", but the "float" type was not. Furthermore the types given for parameters and return values were only approximations. JavaScript's type coercion allows us to use a number of other types, too. There certainly is a place for a proper description of the global object, but such a description should be generated from the actual JavaScript root object as found in an actual QJSEngine. Furthermore, we do need better syntax to describe it. Change-Id: Ia573436df04ca967381e1e13dbd42a70bcc60979 Reviewed-by: Andrei Golubev <andrei.golubev@qt.io> Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* Use QDateTime as internal name for the builtin date typeUlf Hermann2021-02-011-17/+21
| | | | | | | | | | | | | | | | | | | | | The internal name serves as hint to the C++ class. This is the same as the internal name of url, for example. The internal name is not exposed to QML. So, from a language perspective, we can choose any name there. All the JavaScript methods of the Date prototype are not actually available on QDateTime. Due to the magic conversions the QML engine does in the background, much of them work in practice. Yet, when generating C++ code, we would need another conversion step to make them available. In order to express part of this, we introduce a second type for the JavaScript Date object. In the future we might link them via some "converts to" property. Then tools could know that creating a QJSManagedValue from a QDateTime (or QUrl etc) results in a richer API with additional methods. Change-Id: I13f66a37d985dbd3581d8bb84937adbbc31286fd Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> Reviewed-by: Andrei Golubev <andrei.golubev@qt.io>