aboutsummaryrefslogtreecommitdiffstats
path: root/src
Commit message (Collapse)AuthorAgeFilesLines
* 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>
* Qt.labs.folderlistmodel: Register old versions declarativelyMaximilian Goldstein2021-02-042-14/+2
| | | | | | | Register old versions declaratively so the plugin can be truly optional. Change-Id: I0f5774d90788208dfce7928a45a904fc6595faa1 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* QtQuick.Shapes: Make plugin optionalMaximilian Goldstein2021-02-044-9/+15
| | | | | | | | Mark plugin as optional and move out initialization code as to allow use with the QML compiler. Change-Id: I4c93168ebd42b6625fbf4c045beac4dcf41aafa6 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* Fix compiler warning, QJsonArray does not return referencesVolker Hilsheimer2021-02-031-6/+6
| | | | | | | | | Clang warning on macOS: warning: loop variable 'classInfo' is always a copy because the range of type 'const QJsonArray' does not return a reference [-Wrange-loop-analysis] Change-Id: I7657d85fe44b5e106ead6d26d4481256e7ccfc71 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* QQuickAnimatorController: Remove declaration of non-existent methodsUlf Hermann2021-02-031-2/+0
| | | | | Change-Id: I1c63d617c1f7ac57d9efb5f66a34e51bf625ccb3 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* Drop QQuickAnimatorProxyJob::m_animationUlf Hermann2021-02-032-5/+4
| | | | | | | | Keeping it around is dangerous and we only need it in the ctor. Task-number: QTBUG-90401 Change-Id: I128be1a5cef394bbf4be1a7b0e6a4595f9b25968 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* Animations: Drop checks for duplicate jobsUlf Hermann2021-02-032-19/+16
| | | | | | | | | | | We cannot return the same job multiple times from transition(). The calling code takes ownership of the job, and even retaining a pointer to it in the animation would be a problem. There are no animations that return the same job multiple times, though. Task-number: QTBUG-90401 Change-Id: I3a113c624a20dceee745cd6a4fca6f3634bdbdd1 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* QmlBind: support bindable propertiesFabian Kosmale2021-02-031-9/+40
| | | | | | | | | | | | This patch ensures that the QML Binding element can also save and restore C++ bindings. Should QQuickItem's x and y property be ported to the new property system, we'd need new test cases to verify that "old-style" bindings are still handled correctly. This task is however left for the change porting the properties. Task-number: QTBUG-90493 Change-Id: I506ffa1060ff32a7d722214e5ccd469bdaa61ff8 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* 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>