aboutsummaryrefslogtreecommitdiffstats
path: root/src/quick
Commit message (Collapse)AuthorAgeFilesLines
* Deal with variable renaming in QDropEventShawn Rutledge2020-07-171-2/+2
| | | | | | | | | qtbase ea2ae140e99bbd21515a99c5480e53129ef843c3 gave QEvent variable names a consistent naming convention, but QQuickDropEventEx inherits QDropEvent and directly accessses them, so it needs updating. Change-Id: Id0a593145a292828504b22d557acae980f8357ec Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* Keep replaying touch press as mouse press after Flickable.pressDelayShawn Rutledge2020-07-151-1/+13
| | | | | | | | | | | | In the future, if QQuickFlickable has pressDelay set, and receives a touch event, we want it to replay the touch after the delay. But in Qt 5 it can only replay a delayed mouse press, and hacks are in place to deal with that. We aren't ready to change it all just yet, and need to keep the autotest working as-is for now. Task-number: QTBUG-78818 Change-Id: Ib37ccfc2b1b84254f40acac8f8ca8c51c9a88ddf Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* Begin handling the QEvent refactoringShawn Rutledge2020-07-155-101/+82
| | | | | | | | | | | | | | | | | | | | | | | | | | This is an intermediate step to get Qt Quick working again after qtbase 4e400369c08db251cd489fec1229398c224d02b4. - QQuickEventPoint::id() is no longer unique across devices, because now eventPoint.event.device tells which specific device the event comes from. (In Qt 5, we could not yet add the device pointer to QInputEvent.) - However, MultiPointTouchArea's docs say that each pointId is unique, and so do the HandlerPoint docs (for similar use cases with PointHandler). So we still need the same hack using a Qt-specific short device ID to unique-ify the QEventPoint::id(). Now we use the device index in QInputDevice::devices() as the short ID. - Otherwise, we trust QInputDevice::systemId() and QEventPoint::id() more than before. - Use QMutable* classes from qevent_p.h to continue using setters that were in QTouchEvent before, etc. But setTouchPoints() is not there, so we have to make new event instances in a couple of cases. - QGuiApplicationPrivate::setMouseEventCapsAndVelocity() and setMouseEventSource() are gone. - Use (compiler-written) event copy constructors when possible. Task-number: QTBUG-72173 Change-Id: I3915dc535ae4c5a81cbf333aba9355f01c420c15 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* Replace QTouchEvent::TouchPoint with QEventPointShawn Rutledge2020-07-159-105/+105
| | | | | | | | | | | | It's a cosmetic change at this time, because we have declared using TouchPoint = QEventPoint; Also replace Qt::TouchPointState enum with QEventPoint::State. Task-number: QTBUG-72173 Change-Id: Ife017aa98801c28abc6cccd106f47a95421549de Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* Remove explicit registration of QKeySequence::StandardKeyUlf Hermann2020-07-131-9/+0
| | | | | | | | | | | As QKeySequence itself gets registered in qquickforeignutils_p.h, its enums will also get registered. There is no point in doing this explicitly here. Task-number: QTBUG-85559 Change-Id: Ifb4129717d9daa9d5c46e12086ece2d0b59f535a Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
* Replace QInputDevice::id() with systemId()Shawn Rutledge2020-07-092-4/+4
| | | | | | | Required after qtbase c7c28b340662915a9f8fdb84c0a94c458fe6a290. Change-Id: Ife9efbf802e1e8984a950fa255e8917e2398cc7a Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* CMake: Regenerate projectsAlexandru Croitor2020-07-092-11/+12
| | | | | | | | | We need the qt_add_tool changes to successfully configure qemu builds. The rest of the changes are just to be in sync with the .pro files. Change-Id: I7bcc08ac58f57a5761aedef09761428c55235289 Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
* QSGTexture: Remove doc references to bind()Laszlo Agocs2020-07-061-9/+8
| | | | | Change-Id: Ibcdf6cb940c0f95a5baba0887b01a149611dfe04 Reviewed-by: Andy Nichols <andy.nichols@qt.io>
* layer: Check for <1 not ==0 when bailing out due to no sizeLaszlo Agocs2020-07-061-1/+1
| | | | | Change-Id: I87798db04e0bca6c2ea173b1b946549a747b2124 Reviewed-by: Andy Nichols <andy.nichols@qt.io>
* Make the qtquick and qtqml plugins optionalUlf Hermann2020-07-027-93/+15
| | | | | | | | | We can do the initialization and de-initialization as constructor and destructor functions. Then we don't need to load the plugins. Task-number: QTBUG-84639 Change-Id: I2aeeee7e8d028555e3af91e93518c2c2afd70dbb Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* Doc:Update docs with cmake package informationNico Vertriest2020-07-021-0/+1
| | | | | | Task-number: QTBUG-85179 Change-Id: I14a1d01c8e983021461f72c5108383f4b277478b Reviewed-by: Paul Wicking <paul.wicking@qt.io>
* Fix before/after frame signal emissionsLaszlo Agocs2020-07-012-4/+6
| | | | | | | | | Make the before signal closer to the actual QRhi::beginFrame() call. This fixes emitting a beforeFrameBegin unnecessarily when unexposing and then exposing a window again. Change-Id: Icc562a57798986c8d04c6800eabc41981c5da85b Reviewed-by: Andy Nichols <andy.nichols@qt.io>
* Fix leftover argument names in ShaderEffectLaszlo Agocs2020-06-302-28/+24
| | | | | | | | | | | "code" is misleading, and is a leftover from earlier times when the value could have contained actual source code as well. We now have a plain QUrl that is a local or qrc file reference. Update function argument names accordingly. Also remove a confusing comment that was again relevant when these properties were plain strings. Change-Id: Ie88040d0c300a33167518098399dc0d1722a5961 Reviewed-by: Andy Nichols <andy.nichols@qt.io>
* Use QQmlContext::resolvedUrl in places where it was not addedLaszlo Agocs2020-06-301-4/+2
| | | | | | Fixes: QTBUG-85063 Change-Id: Id96fe228a840de0f4760474db8bd9b1031640b50 Reviewed-by: Andy Nichols <andy.nichols@qt.io>
* Backdate QPointingDeviceForeign to 2.12Shawn Rutledge2020-06-301-1/+1
| | | | | | | | PointerDevice existed in QML since 2.12 even though the C++ type is changed in Qt 6. Amends d0ae3a312a03c118a1aa25a4c6c0352375d569fc Change-Id: Icb7e118a05302fc0bd980cce99d23969406b301c Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* Avoid unnecessary use of private APIShawn Rutledge2020-06-301-1/+1
| | | | | | | Use QInputDevice::id() instead of QInputDevicePrivate::id. Change-Id: I796a32219f5743f8445bab918f7be1969cb01945 Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* Update the window cursor on mouse releaseShawn Rutledge2020-06-301-0/+3
| | | | | | | | | | | | | | | | When a PointerHandler with a custom cursor deactivates, the cursor wasn't restored until the next mouse move. I was writing a test to ensure that there were no bugs analogous to QTBUG-85303 with a handler that uses its active state to change the cursor (unlike HoverHandler which changes it whenever the mouse is hovering) and found this new bug. Pick-to: 5.15 Fixes: QTBUG-85325 Task-number: QTBUG-85303 Change-Id: I4ea8dbd267046c8e972e723cc491bd44bbbfd7f2 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* Change the cursor within HoverHandler.marginShawn Rutledge2020-06-301-7/+11
| | | | | | | | | | | | | The visual cursor feedback was inconsistent with the hovered property when a margin is set. Amends 1c44804600ad3dbeb60d1f5209ce9cf937d30ab3 Pick-to: 5.15 Fixes: QTBUG-85303 Task-number: QTBUG-68073 Change-Id: I25506baecaecbd6450a0e95786f103024b46b1b8 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* Reimplement UniformAnimator for ShaderEffectJonas Karlsson2020-06-297-136/+139
| | | | | | Fixes: QTBUG-83976 Change-Id: I307e96be0d3d2edeb8d9065d100c1ef38c8824c7 Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
* Fix MouseArea mouseX/mouseY coordinates while draggingShawn Rutledge2020-06-291-1/+1
| | | | | | | | | | | | | | | | | When MouseArea is not anchored with the usual anchors.fill: parent, such that its position is not 0,0, calculating mouseX/mouseY as d->lastScenePos - mapToScene(position()) was wrong. It could be d->lastScenePos - mapToScene(QPointF()), but instead we use mapFromScene(d->lastScenePos) as in a few other places. Amends 8068e7b98cde09565efe27585b84e120f9c5ea99. Pick-to: 5.15 Fixes: QTBUG-85111 Task-number: QTBUG-75993 Change-Id: If1440d05ec3b75d9f9f4802fbc361756fadb559e Reviewed-by: Mitch Curtis <mitch.curtis@qt.io> Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* Doc: fix delegate snippetMitch Curtis2020-06-291-4/+4
| | | | | | Pick-to: 5.15 Change-Id: I50facb06e37c26bf86d032d3fd5377f23a5d2bc2 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* Make it possible to specify an adapter or physical device onlyLaszlo Agocs2020-06-294-37/+122
| | | | | | | | | As required by OpenXR. While we are at it, make the API a bit more type safe. Change-Id: I3c6152feeb71359056830ab02d35f8cb258722c0 Reviewed-by: Andy Nichols <andy.nichols@qt.io>
* Add missing include to qquickrendertarget.hLaszlo Agocs2020-06-261-0/+1
| | | | | Change-Id: I04fb455ea2336ada8e730b109b589ebf697a3b73 Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
* Follow QQuickGraphicsDevice changes in QQuickRenderTargetLaszlo Agocs2020-06-263-18/+164
| | | | | | | | | They are not strictly related of course, but the API pattern should be kept. We can also move away from the QSGTexture dependency which is good since that was never directly related. Change-Id: I9aedff5918443bda3d6e3ee1ea389071222d1ad7 Reviewed-by: Andy Nichols <andy.nichols@qt.io>
* Add ; to Q_UNUSED and UNUSED_PARAMLars Schmertmann2020-06-2617-25/+25
| | | | | | | | | This is required to remove the ; from the macro with Qt 6. Task-number: QTBUG-82978 Change-Id: Iead53d18fd790fb2d870d80ef2db79666f0d2392 Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io> Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* Add what-would-my-graphics-api-be getterLaszlo Agocs2020-06-263-0/+41
| | | | | Change-Id: I2bf50a46ea18fe06068192ad695652830c3a3861 Reviewed-by: Andy Nichols <andy.nichols@qt.io>
* webOS: Don't send synthetic hover event on a frame updateJaeyoon Jung2020-06-251-0/+4
| | | | | | | | | | | This reverts the commit 6f84a09 partially which generates a synthetic hover event on a frame update. Such hover event has never been expected in webOS and messes up the existing logic. Change-Id: I7b855d27d1d44f2fab240707ef1ec79cdbcff6e5 Task-number: QTBUG-83119 Pick-to: 5.15 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* Use QList instead of QVectorJarek Kobus2020-06-255-6/+6
| | | | | | Task-number: QTBUG-84469 Change-Id: I4c3353c00a566023503fbc178ba8454391dc334c Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* Add links to examples in scenegraph docsLaszlo Agocs2020-06-242-0/+8
| | | | | Change-Id: I00192314cdb954acdd4f933eec912cffab3584c6 Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
* Fix up the Scenegraph section in examples.qdocLaszlo Agocs2020-06-241-8/+6
| | | | | | | | Add the newly introduced custommaterials example. The list was out of date in other ways as well, fix it all up. Change-Id: I4dc6911930b834a8ac9992042605ceebcb5e450c Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
* Replace QQmlBoundSignalExpressionPointer with QQmlRefPointerUlf Hermann2020-06-241-8/+11
| | | | | | | They do the same thing. Change-Id: Ia35832e6175728e7480d09caba6d3833718d9e80 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* Remove QQuickPointerDevice in favor of QPointingDeviceShawn Rutledge2020-06-2317-426/+193
| | | | | | | | | | | | | | ...and generally deal with changes immediately required after adding QInputDevice and QPointingDevice. Also fixed a few usages of deprecated accessors that weren't taken care of in 212c2bffbb041aee0e3c9a7f0551ef151ed2d3ad. Task-number: QTBUG-46412 Task-number: QTBUG-69433 Task-number: QTBUG-72167 Change-Id: I93a2643162878afa216556f10808fd92e0b20071 Reviewed-by: Jan Arve Sæther <jan-arve.saether@qt.io>
* Move resetOpenGLState out of QQFBOGiuseppe D'Angelo2020-06-237-82/+202
| | | | | | | | | | | | | QQFBO is not the only client of resetOpenGLState. Although in theory third-party GL code that integrates with QtQuick should reset its state, in practice it doesn't. By making resetOpenGLState only available into QQFBO, now we're blocking a Qt5->6 upgrade path. There's also no compelling reason for this function to be in QQFBO at all, so move it out to as a free function in a ad-hoc new namespace. Change-Id: Ic8e5c7e244db37a5b6257d516e6aea3a9db44898 Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
* Add graphics instance and device basics to QQuickWindow docsLaszlo Agocs2020-06-231-0/+39
| | | | | Change-Id: I21fc32bfabfc297d6c345eb9c6647b0d8bb2113e Reviewed-by: Andy Nichols <andy.nichols@qt.io>
* MultiPointTouchArea: don't emit canceled() during ordinary touch releaseShawn Rutledge2020-06-221-2/+3
| | | | | | | | | | | Amends 0012f8bd152a36a67abc696465f27d612625b5d9. For some reason tst_QQuickMultiPointTouchArea::inFlickableWithPressDelay()'s check QCOMPARE(flickable->property("cancelCount").toInt(), 0); passed on Qt 5, but we get a canceled() signal in Qt 6. Task-number: QTBUG-78818 Change-Id: Ib77bc4fc5774bd697247351c274bb5deb8cc4009 Reviewed-by: Jan Arve Sæther <jan-arve.saether@qt.io>
* Defer setting a QVulkanInstance on the windowLaszlo Agocs2020-06-222-10/+13
| | | | | | | | ...to createRhi(). There is no need for the VkInstance before that point. Change-Id: I87f4e8154e96409bccd7844f1bf80b957bb54d69 Reviewed-by: Andy Nichols <andy.nichols@qt.io>
* Do not resolve URLs when assigning them to a propertyUlf Hermann2020-06-229-32/+63
| | | | | | | | | | | | | | | We don't know in advance if a URL is part of the source code and should be relative to the current element, or if it is part of the application data and should not be touched. [ChangeLog][QtQml][Important Behavior Changes] URLs are not resolved or intercepted anymore when assigning them to a "url" property. Instead they are resolved and possibly intercepted when used to access an actual resource. Fixes: QTBUG-76879 Change-Id: Iaa2385aff2c13aa71a12e57385d9afb5dc60a073 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* Rename setSceneGraphBackend to setGraphicsApiLaszlo Agocs2020-06-226-19/+58
| | | | | | | | | | | | | | | | ...and fix up the docs. The string-based setSceneGraphBackend() stays of course (the docs have been enhanced, however). The GraphicsApi enum-based overload is now renamed to setGraphicsApi(). Using the same name for both functions is a historical artifact, reflecting the evolution (5.0 - 5.8 - 5.14). In 6.0 we can give it a more appropriate name, since it does not have much to do with "backends" from the user's perspective. Change-Id: Id75dbf81f50a148797e5b5de9be4000153737473 Reviewed-by: Andy Nichols <andy.nichols@qt.io>
* Add test for rendercontrol + rendererinterfaceLaszlo Agocs2020-06-222-6/+13
| | | | | | | | | | Also add support for doing QQuickWindow::setSceneGraphBackend(QSGRendererInterface::Unknown). This becomes relevant especially in tests, where we may request a specific graphics API, but then want to switch back to the default behavior. Change-Id: Ib09c411432fc37bd4d36ce55d54d20af3f83860a Reviewed-by: Andy Nichols <andy.nichols@qt.io>
* Emit new frame signals from the software backendLaszlo Agocs2020-06-222-0/+8
| | | | | | | Introduce an autotest case too. Change-Id: I658b09b6e4e5b30cdc2174fdf21f60adf93e44ff Reviewed-by: Andy Nichols <andy.nichols@qt.io>
* Move a misplaced include to help no-pch buildsLaszlo Agocs2020-06-192-1/+1
| | | | | Change-Id: If3ffc6d80234e1e89a7e4e057768edffe8b84d29 Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
* Add getters for rendertarget/device/configLaszlo Agocs2020-06-192-0/+52
| | | | | | | | | | | All the classes are implicitly shared, as is the Qt standard, so just return them as is by value. This is useful when applications split up their logic and so certain settings are set from different places. (we see this a lot in practice with QSurfaceFormat for instance) In this case it is helpful if they can query what they previously stored via the setter. Change-Id: Id133df8a48d22b896754e6e47a4047ba374597ef Reviewed-by: Andy Nichols <andy.nichols@qt.io>
* Make it possible to specify device extensions in a future proof mannerLaszlo Agocs2020-06-1917-33/+473
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Follow the pattern of QQuickRenderTarget and QQuickGraphicsDevice. This makes it possible to integrate with real world frameworks, such as OpenXR, that, especially with Vulkan, expect this level of configurability. (i.e. one pulls the list of extensions to be enabled on the device, that then needs to be taken into account by Quick, otherwise it will end up with a VkDevice that is not usable by OpenXR) Same goes when integrating native Vulkan rendering into an application: if certain extensions need to be enabled on the VkDevice, today that can only be done with an environment variable which is not entirely ideal. These issues are now solved by a new simple (and extensible) container QQuickGraphicsConfiguration, which is associated with the QQuickWindow. When applicable, the scene graph will then pick up the relevant settings. Expand the related docs everywhere. Also rename the vulkanInstance() to defaultVulkanInstance() to emphasize that it is the instance that is used for normal QQuickWindows, and is not provided when redirecting via QQuickRenderControl. While we are at it, include another obvious candidate: the use-depth-buffer flag. It turns out that Quick3D's Overlay render mode can be pretty problematic if Quick writes to the depth buffer. In order to avoid relying on environment variables (QSG_NO_DEPTH_BUFFER), we now provide a proper API for controlling that as well. Change-Id: Iefdb62c1f53de8bd34e3f0d393b00c5020d6188a Reviewed-by: Andy Nichols <andy.nichols@qt.io>
* Fix up exposing the swapchain to Quick3DLaszlo Agocs2020-06-193-4/+30
| | | | | | | | | | Quick3D is broken in combination with QQuickRenderControl. This is because just exposing the swapchain is not enough - there is no swapchain with QQuickRenderControl. Rather, one needs access to the command buffer and render target then. Change-Id: I6c06ad3d83ab0018b9f985073757a3378dbce24b Reviewed-by: Andy Nichols <andy.nichols@qt.io>
* Fix typos in QQuickGraphicsDevice docsLaszlo Agocs2020-06-191-3/+3
| | | | | Change-Id: I1cee45abe31c4499bc4a598bc913943ec7f1f134 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* Remove comment that is no longer validEskil Abrahamsen Blomfeldt2020-06-191-2/+0
| | | | | | | | | In a8d357761dbf74cbdc72348be6c655cafb745ff2, we added the removed bit to the batch and implemented the suggested optimization, so this comment is no longer valid. Change-Id: I2a5c82f0ace206a989ef8c6d0c2c2b87dc83ad6f Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* Improve a qHash implementationGiuseppe D'Angelo2020-06-181-2/+2
| | | | | | | Fixup the signature and improve qHashMulti. Change-Id: I701a0f43ff0533269964334767dc220b8fd48188 Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
* Fix SceneGraphRendererFrame event for the Quick ProfilerLaszlo Agocs2020-06-181-0/+7
| | | | | | | | | | The Creator view only works correctly when each event has the pre-defined number of data points. So record the Binding timestamp, which went missing in the RHI port at some point, to get correct results. Change-Id: Iac2f458ac0264a6afd4bb91e56b19e7ac7343816 Reviewed-by: Christian Strømme <christian.stromme@qt.io>
* Fix outline shader with transparent fillEskil Abrahamsen Blomfeldt2020-06-182-2/+2
| | | | | | | | | | | | | | | | A bug snuck in via e8d9bc1bcada7d94af5a33d64a9afc860ede5b84 in one of the outline shaders where we would actually fill the entire glyph with the style color instead of just drawing the border. Since we were drawing the fill on top afterwards, this wasn't visible in a normal test, but when the fill color is set to transparent it showed. This changes the alpha channel-based outline shader to match the old code as well as the code in the red-channel based one. Task-number: QTBUG-69301 Change-Id: I2f9d4b9426577c331866172fc6f7240f379efef2 Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
* Remove broken profiler/trace points in the scenegraphLaszlo Agocs2020-06-182-55/+1
| | | | | | | | | | | | | | | As the todo note says: this profiling is all wrong Not reporting something is better than reporting something bogus. The other profiling points, f.ex. in the render loops, seem to work as expected and give reasonable results in the QML Profiler view in Creator. The autotest needs fixing because there is no SGContextFrame events left with the rhi code path either atm, just like with the software backend. Change-Id: Iee2d3feb586108db50c83c6c03ea415384561ede Reviewed-by: Christian Strømme <christian.stromme@qt.io>