aboutsummaryrefslogtreecommitdiffstats
path: root/src
Commit message (Collapse)AuthorAgeFilesLines
* Doc: Fix extension plugin examples and documentationUlf Hermann2020-02-181-23/+26
| | | | | | | | | | | | We advertise the usage of QQmlEngineExtensionPlugin, as registerTypes() should be avoided if possible. The actual source code of the examples already does this, but some of the includes and the documentation was lagging. Task-number: QTBUG-81615 Change-Id: Ibbee60ad55114bf6dc07875080c963e727f49e6b Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* Remove some dead codeUlf Hermann2020-02-181-5/+0
| | | | | Change-Id: I57fed47c0a98d561165d319b93320e0af71c08a3 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* Add documentation for the QML_* macrosUlf Hermann2020-02-172-14/+290
| | | | | | Task-number: QTBUG-81615 Change-Id: Ida02001803230d7daed9352e27689b417f3ac15c Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* Rearrange QQuickPixmapKey operator==Shawn Rutledge2020-02-151-2/+5
| | | | | | | ...to do the comparisons in the same order as the variables are stored. Change-Id: I5faa1daa84757b94993c3135ddfc9a3fd6c10ea6 Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* MultiPointTouchArea: update the TouchPoint.x and y properties togetherShawn Rutledge2020-02-152-19/+13
| | | | | | | | | Letting them change sequentially is inconvenient when they are used to drive some sort of smooth stroke (drawing or motion). Fixes: QTBUG-81944 Change-Id: I46c5948dbec927682244daf00a0df3453a0d92a6 Reviewed-by: Michael Brasser <michael.brasser@live.com>
* V4 Debugger: Properly set up context object for expressionsUlf Hermann2020-02-141-4/+4
| | | | | | | | | | | We need to use the object in question as context object in order to access its properties. Otherwise we can only access the context properties and, incidentally, the root scope's properties. The latter is why the test didn't fail. Fixes: QTBUG-82150 Change-Id: I1f18f9e78dd61786310fd75e0695929522a4c90c Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Optimize QQuickPixmapCache readImage() slightlyShawn Rutledge2020-02-141-2/+3
| | | | | | | | Calling QImageReader::size() twice means calling the image format plugin twice, so it's best to avoid that. Change-Id: I4741e87c7c95252904d0dd9f484a57d953670559 Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* TestCase: deprecate mouseDoubleClick()Mitch Curtis2020-02-141-8/+9
| | | | | | | | | | | | in favor of mouseDoubleClickSequence(), which has a much more realistic event sequence. mouseDoubleClick() only sends a MouseDoubleClick event, without any press, release, etc. Change-Id: Ifa57cfe678c5f0aef7ee35dab8a1a97ce9a06de0 Fixes: QTBUG-82138 Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io> Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* QQuickItemView: do not set parent to nullptr upon destructionRichard Moe Gustavsen2020-02-141-1/+1
| | | | | | | | | | | | | | | | | | | | Setting a delegate item's parent to nullptr will make any bindings to the parent inside the item invalid, and warnings will as such be printed (first seen after 8c72e634b3b0eacbfdee883bfc34994d3c19ed77). I assume the reason for setting the (visual) parent to nullptr is to immediately hide it. So to avoid trigger any bindings, we instead just cull if from the scene graph. It's also dubious why a delegate should have bindings to its parent in the first place, since what ends up being the parent is an implementation detail, and probably not be the item the user expects it to be. Fixes: QTBUG-81976 Change-Id: I7bd8ab91461504b6e79d4aa2ab832be087245c3e Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* Merge remote-tracking branch 'origin/5.14' into 5.15Qt Forward Merge Bot2020-02-1313-73/+134
|\ | | | | | | | | | | | | Conflicts: src/qml/jsruntime/qv4engine.cpp Change-Id: I61f41672e2dfe7e542ca30fed5f173d0a9ee3412
| * Add a null check to QQuickWindowPrivate::rendererAnton Kreuzkamp2020-02-121-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Afaik there currently is no case in a regular execution where the renderer would actually be null, but for the sake of correctness add a null check as this seems to be the only code location that actually assumes the renderer to be non-null. Additionally, in order to en-/disable custom render modes at runtime, GammaRay actually needs to recreate the renderer and therefore resets the renderer to null in order for QQuickWindowPrivate::syncSceneGraph to recreate it. Thus we need a null check to make sure we don't crash in the short time frame where the renderer is null. Change-Id: Ief5c405f3bc8725d55e22cd33f2164830764e33d Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
| * QQuickLoader: store statusFabian Kosmale2020-02-122-39/+61
| | | | | | | | | | | | | | | | | | | | This allows us to emit the change signal only when the status has actually changed. Due to alignment restrictions, this does not even change the size of the class. Fixes: QTBUG-82002 Change-Id: I2192bf80e72b92108046780811c3acdab39af518 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
| * Fix a bug where a layout could crash or become non-responsiveJan Arve Sæther2020-02-124-5/+34
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This happened because of that QQuickText is ill-behaving: When the width on a QQuickText with word wrap enabled is changed to something less than its implicitWidth, its implicitHeight is changed to reflect the height it needs in order to fit all lines. This will cause the layout to be invalidated, and rearranged again. However, at the same time it will also change its implicitWidth actually become wider than its initial implicitWidth (this seems to be a bug). So the next time it is rearranged it will actually be wide enough so that it doesn't need to wrap. This again will cause its implicitWidth and implicitHeight to change to reflect that only one line is needed, which again will cause it to rearrange, but since the item has a too small width for that it will again change the implicitHeight to reflect that it needs more lines..... This went on forever until there was a stack overflow. In addition it also caused an endless (that is, if it didn't stack overflow) updatePolish()/polish() loop (basically polish() was called from within updatePolish() continuously). To make the layout more robust for such "ill-behaving" items we have to add one recursion guard, and one polish-loop guard. Change-Id: I9f752ed320a100c8d0f0fd340347a556e63318e5 Task-number: QTBUG-73683 Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
| * Fix QQmlProperty and Connections for properties starting with '_'Fabian Kosmale2020-02-112-3/+9
| | | | | | | | | | | | | | | | | | We do a weird renaming for the change handler of properties starting with '_', now we do it at least in a consistent way. Fixes: QTBUG-82017 Change-Id: I1535a5ee462f3a344c972461f1fb954f039aa854 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
| * Mention styleName in the Font QML type documentationAndy Shaw2020-02-111-0/+1
| | | | | | | | | | Change-Id: I1f2ec7b4bb96955f57b3afd4a295f04dbb70987f Reviewed-by: Paul Wicking <paul.wicking@qt.io>
| * Android: Don't include QtQuickParticles in the dependenciesAndy Shaw2020-02-101-4/+1
| | | | | | | | | | | | | | | | | | | | | | | | Before qmlimportscanner it was necessary to mark QtQuickParticles as a dependency, but now it is possible to have qmlimportscanner and androiddeployqt handle all of this for us. So we no longer need to make it an explicit dependency. Task-number: QTBUG-38296 Change-Id: I6e0baefdcf002746af26d8c95fa1f318770cc658 Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io> Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
| * QV4Engine: Do not construct invalid QVariantFabian Kosmale2020-02-071-19/+21
| | | | | | | | | | | | | | | | | | If the provided typeHint is -1, it does not make sense to construct a QVariant of this type and to check whether it is appendable. Fixes: QTBUG-81945 Change-Id: I32cbb9e70e210a7eca8d55801c1783338d1173b7 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
| * Fix QAccessibleQuickWindow::focusChild() to return focused descendantPeter Varga2020-02-061-2/+6
| | | | | | | | | | | | | | | | | | | | Same as the focusChild fix for qtbase: a132e02540 Fix QAccessibleWidget::focusChild() to return focused descendant Task-number: QTBUG-78284 Change-Id: Ibc3e3287790ebc879513a5b1a739e3a919e1f038 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io> Reviewed-by: Jan Arve Sæther <jan-arve.saether@qt.io>
* | Add UiAnnotation for annotation objectsFawzi Mohamed2020-02-125-8/+49
| | | | | | | | | | | | | | | | | | | | This is a partial patch that is fuilly fixed with the following one (big restructure) because it needs extra visit methods, and that leads to conflicts, but I think it gets lost if merged with the next one. Change-Id: I54331a47a5c7faaf78a97e580825d1feec5adf92 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* | Introduce BaseVisitorFawzi Mohamed2020-02-125-467/+801
| | | | | | | | | | | | | | | | | | | | Base Visitor is an abstract visitor that has all visit methods abstract, subclassing this one gets an error if some visit method is not implemented (dumper and reformatter for example will gain from this. Change-Id: I3f8cfeb6fc0ef917acf725bbe1c293d761304287 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* | Provide a macro for qmlRegisterTypeNotAvailableUlf Hermann2020-02-127-14/+60
| | | | | | | | | | | | | | | | | | | | | | That is, register QQmlTypeNotAvailable as foreign type under the name given as parameter. Also, statically register QQuickAnimatedImage as unavailable in case of !quick_animatedimage and register it for the right version. Task-number: QTBUG-68796 Change-Id: I2ea292d2aeda66d8ce43b3bccbd3d21663330bd6 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* | Add a static variant of qmlRegisterInterface()Ulf Hermann2020-02-123-10/+67
| | | | | | | | | | | | | | | | | | | | | | | | | | qmlRegisterInterface() should not be called procedurally, for the same reason that qmlRegisterType() should not be called procedurally. Also, add URI and major version parameters to qmlRegisterInterface(), and deprecate the typeName parameter. We want to identify which import an interface belongs to. Task-number: QTBUG-68796 Change-Id: Iba3d66e5ce6219b30aadba34396f12fca92f35a7 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* | Doc: Modernize backend example and adapt C++ integration docsUlf Hermann2020-02-124-13/+28
| | | | | | | | | | | | | | | | We want people to use the static type registration. Change-Id: I98e51af9df1a2f73df10f82458a7b7f5c5e5aad1 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> Reviewed-by: Paul Wicking <paul.wicking@qt.io>
* | Doc: Modernize the type definition docsUlf Hermann2020-02-121-79/+57
| | | | | | | | | | | | | | | | | | | | Mention the QML_* macros instead of the qmlRegister* functions and adapt the code examples to use them. Task-number: QTBUG-81615 Change-Id: I9e4cf5b3700b7e727b0f2a93035559b75b733adb Reviewed-by: Paul Wicking <paul.wicking@qt.io> Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* | Allow dynamic and static registration of same URI in any orderUlf Hermann2020-02-121-36/+44
| | | | | | | | | | | | | | | | | | Previously, a static registration would not go through if a dynamic registration was carried out before the first type of the statically registered module was referenced. Change-Id: Icf6a2b78dff7d0e5b29138501e04723510d6a668 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* | Add uri and version parameters to qmlRegisterExtendedType()Ulf Hermann2020-02-121-3/+11
| | | | | | | | | | | | | | | | | | We want to know which module a registration belongs to, even if the type is uncreatable. Change-Id: I8c417eeca2c0bfa186df43edc0c2f455ed0880e6 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> Reviewed-by: Maximilian Goldstein <max.goldstein@qt.io>
* | Documentation: reflow to limit line lengthFabian Kosmale2020-02-121-14/+63
| | | | | | | | | | Change-Id: I5f2f8383e4e8f6e650dcad1ae7c07e0bacd36136 Reviewed-by: Paul Wicking <paul.wicking@qt.io>
* | Put Ui visitors togetherFawzi Mohamed2020-02-121-3/+2
| | | | | | | | | | | | | | | | | | | | UiRequired is not with all Ui Vistors and introduced with a // Ui comment. Move it there for consistency. Change-Id: I51315ad380fd50998e7efe095c873d14a5ae7a97 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io> Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* | Avoid cast from ASCII in qv4engine warning messageFawzi Mohamed2020-02-121-2/+2
| | | | | | | | | | | | Change-Id: Idb48122c4e7e294de820cd40036d7a6537ea2cac Reviewed-by: Ulf Hermann <ulf.hermann@qt.io> Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* | Remove unused AST::ModuleItemFawzi Mohamed2020-02-122-4/+0
| | | | | | | | | | | | | | | | | | ModuleItem is unused we should either remove it or make it a used abstract superclass like UiObjectMember. Here we remove it. Change-Id: Icfcebd450e09ebe324a99728613eea0348b980ac Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* | Make UiObjectDefinition uniformFawzi Mohamed2020-02-121-4/+5
| | | | | | | | | | | | | | | | attributes are always at the end of AST objects, move them there also for UiObjectDefinition. Change-Id: I7630b1c40627913c3e7e46e752acf1d80203ce63 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* | Mark non visited AST partsFawzi Mohamed2020-02-121-0/+13
| | | | | | | | | | | | | | Add a commented out accept call for the non visited fields in accept0 Change-Id: Icb1ab0c77440f4c3eae5404bff2cf71086f96a2f Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* | Add annotations to ASTFawzi Mohamed2020-02-125-5/+68
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Annotations are added to UiObjectMember. This makes it easy to find the annotations of any UiObjectMember through the annotations attribute. The clean AST approach would add an UiAnnotatedObjectMember that contains both the annotation list and an UiObjectMember, but that makes finding the annotation more difficult. The annotations are not visited by default, if one wants to dump them before the current object the simplest way is to use the preVisit and use .uiObjectMemberCast(). Depending on how we use annotation we could change the current approach. Task-number: QTBUG-81714 Change-Id: I543a2cfe5157bcc86de6de9faebde9aea22974eb Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* | Deliver QTabletEvents to pointer handlersv5.15.0-alpha1Shawn Rutledge2020-02-117-20/+274
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | At this time, there are not yet any specialized handlers to do anything specifically with tablet events; but we demonstrate how to use HoverHandler to detect the type of stylus in use, and how to use PointHandler to draw on a Canvas. Unfortunately, events of types TabletEnterProximity and TabletLeaveProximity are not delivered to the window, only to QGuiApplication. So HoverHandler can detect when the stylus is moved out of its parent Item (as long as it's still hovering over the tablet surface), but cannot detect when the stylus leaves the tablet completely. In Qt 5 that would require a custom application subclass (see qtbase/examples/widgets/widgets/tablet/tabletapplication.cpp). Fixes: QTBUG-79660 Change-Id: I81fdb99082dc41c0455085e6b6d3952402bf8742 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Jan Arve Sæther <jan-arve.saether@qt.io>
* | Modernize scarceresources snippets and adapt docsUlf Hermann2020-02-114-65/+108
| | | | | | | | | | | | | | Also, make sure we can actually compile and test-run the snippets. Change-Id: I50d2bd85528ddbd8d6ad3f38e716b600df54a571 Reviewed-by: Paul Wicking <paul.wicking@qt.io>
* | QQmlCustomParser: Resolve import namespacesUlf Hermann2020-02-111-6/+25
| | | | | | | | | | | | | | | | | | Also, don't use plain QObject for testing registrations with extensions and foreign types. This interacts with other tests. Change-Id: I43df8a4e5b22def5a87f508130f1c7b4833ecfb6 Fixes: QTBUG-81970 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* | Fix QQmlObjectModel::destroyingItem emissionSimon Hausmann2020-02-101-2/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The signal is used to tell the view that the item is definitely going away. For the "view" based QQmlObjectModel that is almost never really the case, except - oddly - for clear(). The view is typically a QQuickItemView, which casts the item to a QQuickItem and calls setParentItem(nullptr). That in turn is caught by QQuickContainer, which calls remove() on the QQmlObjectModel. That is why remove() can't emit destroyingItem(). Amends 6d0a453f41d304239285d64b06612c36922be701 Change-Id: I5d82def872550744b947b4b53447647327e03f67 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* | QQmlEngine: Test that types are correctly removedFabian Kosmale2020-02-102-0/+13
| | | | | | | | | | | | | | Amends 4f0c9986069c690e8ed7a7d2b42dfbce5c492368 Change-Id: I10a0d7988e1f5a003ccc80faa5b5c9bda62359cd Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* | Fix QML type unregistrationFabian Kosmale2020-02-101-5/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | When the QQmlEngine gets destroyed, it unregisters all previously registered composite types. So far it only removed them from Qt's metatype system. This is however not enough, as the types also need to be removed from the global qmlLists datastructure. We achieve this by calling QQmlMetaType::unregisterInternalCompositeType. Task-number: QTBUG-81772 Change-Id: Iba124c890bc4613ffbb110003d74fe3a912f8df6 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* | Use the extended QQmlListProperty interface in a few placesUlf Hermann2020-02-0717-34/+211
| | | | | | | | | | | | | | Task-number: QTBUG-79263 Change-Id: If518f644b5b9eddbacfb1cb16fbb557127ffcfb2 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io> Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* | statemachine: Use new QQmlListProperty capabilitiesUlf Hermann2020-02-067-31/+125
| | | | | | | | | | | | Change-Id: Ic471ba4f82bdf1ac63953927d0a83f514d0e49d0 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io> Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* | Privately export QQuickFlickablePrivate and QQuickTableViewPrivateMitch Curtis2020-02-063-3/+4
| | | | | | | | | | | | | | | | | | We need this to implement header views (for TableView) in qtquickcontrols2. Task-number: QTPM-1300 Change-Id: I03068828cdf6dd79ec6a91c75f68eaf7c224d4a2 Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* | Add inline component documentationFabian Kosmale2020-02-065-0/+303
| | | | | | | | | | | | | | Change-Id: Ieff73eba115802722afdbb491b74df5eaad9a4f4 Reviewed-by: Paul Wicking <paul.wicking@qt.io> Reviewed-by: Pierre-Yves Siret <gr3cko@gmail.com> Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* | rhi: Handle beginFrame() failure correctly in threaded render loopLaszlo Agocs2020-02-061-6/+10
| | | | | | | | | | | | | | | | Also add some comments to improve maintainability. Task-number: QTBUG-81740 Change-Id: I4be90768f7a8506b1fb493885062b98be9f4f58a Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
* | QQmlTypeLoader: Prevent further trivial cyclesUlf Hermann2020-02-061-2/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | We can also detect cycles in the WaitingForDependencies stage, not only in the ResolvingDependencies stage. This is hard to test as the order of state transitions depends on thread scheduling. Also, do output a warning in those cases. Cyclic dependencies are bad style. Fixes: QTBUG-81678 Change-Id: I11f1a993afa29e4f2d6c71bb3379786d666a527a Reviewed-by: Mitch Curtis <mitch.curtis@qt.io> Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* | Add required property documentationFabian Kosmale2020-02-063-5/+148
| | | | | | | | | | Change-Id: I9e2c44ddcbb6c7e3a92b2bd7d2492ece0cd0e62d Reviewed-by: Paul Wicking <paul.wicking@qt.io>
* | Models: Make sure we can use QList<QObject *> as required modelUlf Hermann2020-02-064-2/+14
| | | | | | | | | | | | | | | | | | We can use it as model passed via a context property as shown in the objectlistmodel example. We should also be able to pass it directly then. Change-Id: I55db74df969d8024553d9470f1afe4710e61b1bf Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* | Merge remote-tracking branch 'origin/5.14' into 5.15Qt Forward Merge Bot2020-02-0613-103/+354
|\| | | | | | | | | | | | | | | | | | | Conflicts: .qmake.conf src/qml/types/qqmlbind.cpp src/quick/items/qquicklistview.cpp tests/auto/qml/qqmllanguage/tst_qqmllanguage.cpp Change-Id: Id6805c13256ad13d5651011e5dd09bba0ec02987
| * Clarify the Binding.restoreMode warning messageUlf Hermann2020-02-031-7/+11
| | | | | | | | | | | | | | | | | | | | Specify that you need to import QtQml 2.14 and where. Fixes: QTBUG-81787 Change-Id: Ia8e7fb3229971294cbade2791075dcd0b5943fae Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> Reviewed-by: Simon Hausmann <simon.hausmann@qt.io> Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
| * Doc: Remove outdated noteJoni Poikelin2020-02-031-4/+0
| | | | | | | | | | | | | | The behavior described in the note does not apply to Qt 5. Change-Id: Ia4d45ca35d095d6cdc193f276bd52c7ad403b82f Reviewed-by: Paul Wicking <paul.wicking@qt.io>