Commit Graph

164 Commits

Author SHA1 Message Date
Mitch Curtis 182bb9d04d Adjust to QUnifiedTimer slow mode changes
a318e331f1387eb3c9d13be96c28619453a35571 in qtbase.

Task-number: QTBUG-137919
Change-Id: I98e3871053bbb04b83aa114844f07293501d95d6
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
2025-06-27 19:27:12 +08:00
Marc Mutz 534241f723 Port to new Q_UNREACHABLE_RETURN()
This is a semantic patch using ClangTidyTransformator to convert
sequences of Q_UNREACHABLE() + return into Q_UNREACHABLE_RETURN(),
newly added to qtbase.

    const std::string unr = "unr", val = "val", ret = "ret";
    auto makeUnreachableReturn = cat("Q_UNREACHABLE_RETURN(",
                                    ifBound(val, cat(node(val)), cat("")),
                                    ")");
    auto ignoringSwitchCases = [](auto stmt) {
        return anyOf(stmt, switchCase(subStmt(stmt)));
    };

    makeRule(stmt(ignoringSwitchCases(stmt(isExpandedFromMacro("Q_UNREACHABLE")).bind(unr)),
                  nextStmt(returnStmt(optionally(hasReturnValue(expr().bind(val)))).bind(ret))),
             {changeTo(node(unr), cat(makeUnreachableReturn,
                                      ";")), // TODO: why is the ; lost w/o this?
              changeTo(node(ret), cat(""))},
             cat("use ", makeUnreachableReturn));

a.k.a qt-use-unreachable-return.

subStmt() and nextStmt() are non-standard matchers.

There was one false positive, suppressed it with NOLINTNEXTLINE.

It's not really a false positiive, it's just that Clang sees the world
in one way and if conditonal compilation (#if) differs for other
compilers, Clang doesn't know better. This is an artifact of matching
two consecutive statements.

Change-Id: I3855b2dc8523db1ea860f72ad9818738162495c6
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2022-10-20 23:59:33 +02:00
Marc Mutz c2d490a238 Port from qAsConst() to std::as_const()
We've been requiring C++17 since Qt 6.0, and our qAsConst use finally
starts to bother us (QTBUG-99313), so time to port away from it
now.

Since qAsConst has exactly the same semantics as std::as_const (down
to rvalue treatment, constexpr'ness and noexcept'ness), there's really
nothing more to it than a global search-and-replace.

Task-number: QTBUG-99313
Change-Id: I601bf70f020f511019ed28731ba53b14b765dbf0
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
2022-10-07 23:38:56 +02:00
Marc Mutz 958cd3ee10 Port from container::count() and length() to size()
This is a semantic patch using ClangTidyTransformator as in
qtbase/df9d882d41b741fef7c5beeddb0abe9d904443d8:

  auto QtContainerClass = anyOf(
      expr(hasType(cxxRecordDecl(isSameOrDerivedFrom(hasAnyName(classes))))).bind(o),
      expr(hasType(namedDecl(hasAnyName(<classes>)))).bind(o));
  makeRule(cxxMemberCallExpr(on(QtContainerClass),
                             callee(cxxMethodDecl(hasAnyName({"count", "length"),
                                                  parameterCountIs(0))))),
           changeTo(cat(access(o, cat("size"), "()"))),
           cat("use 'size()' instead of 'count()/length()'"))

a.k.a qt-port-to-std-compatible-api with config Scope: 'Container',
with the extended set of container classes recognized.

Change-Id: Idb1f75dfe2323bd1d9e8b4d58d54f1b4b80c7ed7
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2022-10-07 23:38:48 +02:00
Lucie Gérard 1b9808737a Change the license of all CMakeLists.txt and *.cmake files to BSD
Task-number: QTBUG-105718
Change-Id: Id89ed14990804a5024183e75382cc539d4293da1
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
2022-09-07 17:01:30 +02:00
Alexandru Croitor eed7b3f4e7 CMake: Don't use PUBLIC_LIBRARIES for executables
Change-Id: I346ea4eac1dfbfb7fb81609307f5f7c4716bb8d1
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
2022-07-21 13:19:04 +02:00
Lucie Gérard 5a7b716474 Add license headers to cmake files
CMakeLists.txt and .cmake files of significant size
(more than 2 lines according to our check in tst_license.pl)
now have the copyright and license header.

Existing copyright statements remain intact

Task-number: QTBUG-88621
Change-Id: I72c89a98c42bbc9234d8495e9e503bec81d11037
Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
2022-07-08 10:41:06 +02:00
Lucie Gérard 0dc4fd240a Use SPDX license identifiers
Replace the current license disclaimer in files by
a SPDX-License-Identifier.
Files that have to be modified by hand are modified.
License files are organized under LICENSES directory.

Pick-to: 6.4
Task-number: QTBUG-67283
Change-Id: I63563bbeb6f60f89d2c99660400dca7fab78a294
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
2022-06-11 08:05:15 +02:00
Ulf Hermann b3fc740080 Fix qmlscene CMakeLists.txt
qmlscene is not a tool. It should be built the same way no matter if
you're also building tools or not.

Change-Id: I2d83e72a4ce4df666639a1a14c70ac4a353be9d1
Reviewed-by: Andrei Golubev <andrei.golubev@qt.io>
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2022-01-24 17:39:21 +00:00
Joerg Bornemann 0d6d3c7bc5 Skip unnecessary commands when cross-building tools
Call qt_internal_return_unless_building_tools() directly after
qt_internal_add_tool() to avoid having to special-case code for when
this function only creates imported targets in cross-builds.

Task-number: QTBUG-85084
Change-Id: I5c8f2ecdf4936cfd15cb530e896bc4e5b5531620
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2021-10-08 10:37:35 +02:00
Joerg Bornemann 3e2a85384b Turn qml, qmlscene and qmlpreview into apps
Before, they were tools, which means they are not built when
cross-compiling.  However, all these tools are likely to be desired on a
target to run QML-only projects.

The earlier way to build these apps for a cross target was to set
QT_BUILD_TOOLS_WHEN_CROSSCOMPILING to ON.  That seems like overkill.

Pick-to: 6.2
Task-number: QTBUG-96454
Change-Id: Ibbdc4e4599b0c798ddbd96804a0bbb821f546415
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2021-10-07 18:02:44 +02:00
Craig Scott 63a601dc29 CMake: Remove unneeded *.pro and .prev_CMakeLists.txt files
The .pro files corresponding to the .prev_CMakeLists.txt files
have already been removed.

Change-Id: I254eafe4c7de1a516e33bd9cb3d9879e73fa83b4
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
2021-05-19 10:46:06 +10:00
JiDe Zhang 9dba08d048 Fix the qmlscene command help message
Pick-to: 6.1
Change-Id: Ie957bcc459a91d1c353be664074475545ec67510
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
2021-05-18 09:01:27 +00:00
Maximilian Goldstein a9c93e2716 qmlscene: Show deprecation warning
qmlscene will be removed in favor of qml in the future.

[ChangeLog][QML][Important Behavior Changes] qmlscene is deprecated, please use qml instead

Task-number: QTBUG-53557
Task-number: QTBUG-53219
Task-number: QTBUG-65862
Change-Id: Ia295cdf0749ce79f6523dabebd43f0168e81c1f0
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
2021-03-12 22:34:16 +00:00
Fabian Kosmale 78ab4b8d8b Remove the qmake project files
Remove all qmake project files, except for examples which are used to
test that qmake continues to work.

Change-Id: Ic4abb72dc2dcd75df7a797c56056b6b3c5fe62ac
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
2021-01-15 15:34:22 +01:00
Alexandru Croitor 08adbefa13 CMake: Regenerate projects to use new qt_internal_ API
Modify special case locations to use the new API as well.

Task-number: QTBUG-86815
Change-Id: I3b964e3baf0cc7040830156dac30358ea1152801
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
2020-10-06 13:19:37 +02:00
Volker Hilsheimer a15840a8df Fix additional warnings from usage of deprecated APIs
Replace QLibaryInfo::location with QLibraryInfo::path, and remove usage of
Qt::AA_EnableHighDpiScaling, which doesn't have any effect anymore.

Change-Id: I347e8a83e0f4c2b4405f2512e569ad3234f05a98
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2020-09-16 12:44:59 +02:00
Tor Arne Vestbø d0eb261836 Remove use of deprecated High-DPI application attributes
Change-Id: Ibfb50fdcbb51ba93d6e5d11f9e8ce0e7b3bfde79
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
2020-09-02 17:17:33 +02:00
Alexandru Croitor 0f19f571ee CMake: Regenerate projects
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>
2020-07-09 15:51:40 +02:00
Paul Olav Tvete 83fb4f6743 Clean up QT_CONFIG(opengl)
Accelerated graphics is now possible without OpenGL support. With
this change, a Qt build with -no-opengl can still run Qt Quick with
a Vulkan, Metal, or Direct3D backend.

Fixes: QTBUG-84027
Change-Id: Ib63c733d28cfdf7de16b138df136fa7628e1747b
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
2020-06-17 17:42:01 +02:00
Laszlo Agocs 0d43e21429 QQuickWindow: Remove (set)ClearBeforeRendering
The doc update reveals that this setting has been ignored with the RHI
always, and there is no plans (or ways) to support this.

As the beforeRenderPassRecording() signal documents, connecting to that
signal is effectively an alternative to disabling clearing the color
buffer. (because it allows the application to execute custom GL or other
calls after the clear but before the rest of Qt Quick's rendering)

Therefore, remove the clearBeforeRendering flag from Qt 6.

[ChangeLog][Qt Quick][QQuickWindow] setClearBeforeRendering() and
clearBeforeRendering() are removed.

Change-Id: I6a0a6f56552331923f2e07390e2f33f58c6c31e0
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
2020-06-16 09:39:12 +02:00
Laszlo Agocs 2ebdc9dc76 Remove the now unneeded moc include from qmlscene
Change-Id: Ieb8859c3695aa005a7d66476ac398142bbf22464
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
2020-06-10 12:51:53 +02:00
Laszlo Agocs abaf9bded3 Remove openGLContextCreated signal
No reason to have this in the API in 6.0, and it's already not emitted
at all in dev (because the direct OpenGL code path is now gone from the
render loops)

Some simple GL string printing has been removed from qml/qmlscene. This
opt-in feature has not been useful in practice anyway since QSG_INFO=1
prints the same things.

[ChangeLog][Qt Quick][QQuickWindow] The openGLContextCreated signal has
been removed from QQuickWindow.

Change-Id: Ifb647bbd1e828ebad2b775e8ce5c38723a0cda13
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
2020-06-10 12:51:53 +02:00
Alexandru Croitor 476d1f5760 CMake: Regenerate qtdeclarative/tools
Includes
 - A bunch of TARGET_DESCRIPTION

Change-Id: I6acfe05187afbdd45cf7e1bf8634f1554a51c791
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
2020-05-29 10:01:19 +02:00
Alexandru Croitor 14492ecee2 CMake: Regenerate and adapt to merge from dev
Change-Id: If8daa6152a563d4309d7342414780ef75b9f5589
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Reviewed-by: Leander Beernaert <leander.beernaert@qt.io>
2020-03-12 14:05:23 +00:00
Alexandru Croitor 26c5243491 Merge remote-tracking branch 'origin/dev' into wip/cmake
Conflicts:
	dependencies.yaml
	src/qml/qml/qqmlengine.cpp

Change-Id: I6a73fd1064286f4a2232de85c2ce7f80452d4641
2020-03-12 15:03:03 +01:00
Qt Forward Merge Bot 3e758800b4 Merge remote-tracking branch 'origin/5.15' into dev
Conflicts:
	src/imports/qtqml/plugin.cpp
	src/qml/qml/qqml.h
	src/qml/qml/qqmlmetatype.cpp
	src/qml/qml/qqmlmetatype_p.h
	src/qml/qml/qqmltypeloader.cpp
	src/qml/types/qqmlbind.cpp
	src/quick/items/qquickitemsmodule.cpp
	tests/auto/qml/qqmlecmascript/tst_qqmlecmascript.cpp

Change-Id: I52548938a582cb6510271ed4bc3a9aa0c3c11df6
2020-02-17 10:21:59 +01:00
Thomas Hartmann 3c24395934 Add QML_CORE_PROFILE support to QML tool
If QML_CORE_PROFILE is defined we use the CoreProfile surface format.
This is required for QtQuick3D.

For consistency we also introduce QSG_CORE_PROFILE.
Adding QSG_CORE_PROFILE also to qmlscene.

Change-Id: I4feee91740162cf36fa2668695b74f5a1279bb89
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
2020-02-06 11:33:01 +01:00
Alexandru Croitor b684ba2194 Merge remote-tracking branch 'origin/dev' into wip/cmake
Conflicts:
        dependencies.yaml

Change-Id: Ie3e9dc62031a85e5e81cbdf04694b95159d49fca
2020-01-29 16:52:58 +01:00
Ulf Hermann 406f15ce0e Quick: Don't qualify OpenGL includes
The headers are moving from QtGui to QtOpenGL. By avoiding the
qualification we can keep them compiling either way. Also, add
opengl-private to make the types available.

Also removed the QGraphicsRotation hack to get access to the projected
rotation function of QMatrix4x4. The function is public now.

Task-number: QTBUG-74409
Change-Id: I216e8ca09f8e247f96627b081308e3a57c55c29c
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
2020-01-27 13:03:18 +01:00
Alexandru Croitor ba494aaa24 Regenerate all projects with new CMake API version
Change-Id: Ie0db35f674137c229eaf049616f38f8e818f7092
Reviewed-by: Qt CMake Build Bot
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2019-11-15 12:24:51 +00:00
Alexandru Croitor e9cac99f37 Regenerate projects
Change-Id: I38044c382e4d84b5865a19cdd04cc8922bd72a77
Reviewed-by: Qt CMake Build Bot
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2019-11-14 10:22:26 +00:00
Alexandru Croitor 13374ceb16 Merge remote-tracking branch 'origin/wip/qt6' into wip/cmake
Change-Id: I2963c1209316fb6755f572969f368970450d7991
2019-07-11 17:24:39 +02:00
Laszlo Agocs 341ab77080 Add the graphics api independent scenegraph port
Opt in via environment variables:
QSG_RHI=1 -> enable using QRhi instead of GL
QSG_RHI_BACKEND -> set to vulkan, metal, d3d11, gl to override the default
(the default is d3d11 on Windows, metal on Mac, gl elsewhere)

Or force a given rhi backend via the existing
QQuickWindow::setSceneGraphBackend().

Otherwise the default behavior is the same as before, the rhi code path
is never active by default.

-no-opengl builds are supported in the sense that they work and default
to the software backend. However, the rhi code path cannot currently be
used in such builds, even though QRhi from qtbase is fully functional
with Vulkan, D3D, or Metal even when qtbase was configured with
-no-opengl. This cannot be utilized by Quick atm due to OpenGL usage
being all over the place in the sources corresponding to the default
backend, and those host the rhi code path as well. This will be cleaned up
hopefully in Qt 6, with the removal all direct OpenGL usage.

Other env.vars.:
QSG_RHI_DEBUG_LAYER=1 -> enable D3D debug or Vulkan validation layer
(assuming the system is set up for this)
QSG_RHI_SHADEREFFECT_DEBUG=1 -> print stuff from ShaderEffect
QSG_SAMPLES=1,2,4,... -> MSAA sample count (but QSurfaceFormat works too)
QT_D3D_ADAPTER_INDEX=0,1,... -> D3D adapter index
QT_VK_PHYSICAL_DEVICE_INDEX=0,1,... -> Vulkan physical device index
QSG_RHI_UINT32_INDEX=1 -> always use uint index data (both
merged/unmerged, convert when needed - with some rhi backends this is
implicit)
QSG_RENDER_LOOP -> to override the render loop as usual. The default
with RHI is threaded for Metal, threaded for Vulkan on Windows, basic
for Vulkan on Linux and Android (to be checked later), while the existing
rules apply for OpenGL.

Not supported when running with QRhi:
  - particles
  - compressed atlases (though this is transparent to the apps)
  - QSGRenderNode
  - QQuickRenderControl
  - QQuickFramebufferObject
  - certain QQuickWindow functionality that depends directly on OpenGL
  - anisotropic filtering for textures
  - native text may lack some gamma correction
  - QSGEngine applicability unclear
  - some QML profiler logs may be incorrect or irrelevant

Change-Id: I7822e99ad79e342e4166275da6e9e66498d76521
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2019-07-04 10:44:26 +02:00
Qt Forward Merge Bot e6c6cc8fde Merge remote-tracking branch 'origin/5.13' into dev
Conflicts:
	src/imports/imports.pro
	src/qml/qml/qqmlmetatype.cpp

Change-Id: I308436caf55402cb2246cb591c6ac8f83e1febf8
2019-07-01 10:29:06 +02:00
Qt Forward Merge Bot 63398defdb Merge remote-tracking branch 'origin/5.12' into 5.13
Change-Id: I59343fe228ca6b823b61577e5a0907e7381899c2
2019-06-28 13:28:10 +02:00
Ulf Hermann 9834ac5604 qmlscene: Avoid infinite loop
If the root document doesn't contain any executable code, we should
terminate with an error message rather than loop forever.

Change-Id: Ice2ff10ae5dc9d71df2d1c784597393695ab1d98
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2019-06-26 16:22:30 +02:00
Joni Poikelin 82f126599b qmlscene: Fix setting of the default surface format
Fixes: QTBUG-76603
Change-Id: I2977117dcaf45345c14599e0b38cb4a242ee449b
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
2019-06-25 14:00:12 +03:00
Alexandru Croitor 5a3e668533 Port the declarative tools
Also fix up QmlDevTools module to not depend on QtQml,
but instead make it include the headers / cpp files as it is done
in the qmake project.

Change-Id: I240c52d5357db150a7c0c819892fb0a3708ceee4
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2019-06-08 08:22:42 +00:00
Edward Welbourne 6d5a0a55d8 Convert uses of QTime as a timer to QElapsedTimer
Change-Id: Ia34d3980e48d2978c8c77e65b1ee2aa7f71fd985
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
2019-06-12 18:32:50 +02:00
Qt Forward Merge Bot 53bd6b8111 Merge remote-tracking branch 'origin/5.12' into 5.13
Change-Id: I9ef4be23bfe35aa48d4c65d4159e72c527943845
2019-04-19 01:00:04 +02:00
Qt Forward Merge Bot 1a62cad4a6 Merge remote-tracking branch 'origin/5.12.3' into 5.12
Change-Id: Ie2e6a4af1953cb5d7965b95090d369e7433ceb85
2019-04-17 10:34:17 +02:00
Qt Forward Merge Bot 8bc3329e2c Merge remote-tracking branch 'origin/5.12' into 5.13
Conflicts:
	src/3rdparty/masm/assembler/LinkBuffer.h
	src/qmltest/doc/src/qtquicktest-index.qdoc
	tests/auto/qml/qqmllanguage/tst_qqmllanguage.cpp

Change-Id: I7d83ad95cf489dda794dd7a0a33bad3ef3b05609
2019-04-15 09:36:12 +02:00
Thomas Hartmann 936cc8adcc Add support for selectors to qmlscene
This allows to use qmlscene together with file selectors.

Task-number: QDS-589
Change-Id: Icf613c938bfc2c56b33a36ab2da32c3c54b498a2
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
2019-04-09 14:29:19 +00:00
Thomas Hartmann 5ead393eba Fix qmlscene command parsing
If "QMLSCENE_CORE_PROFILE" is set the command line
parsing does not work anymore.

Change-Id: I75ffa733562708a412d1ae341b24d1f3bb35c034
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2019-04-08 09:12:26 +00:00
Qt Forward Merge Bot a6a8832078 Merge remote-tracking branch 'origin/5.12' into 5.13
Change-Id: I1dd04210f10895c509b5c637fc5e2dcf66e3bb91
2019-04-02 01:01:03 +02:00
Tim Jenssen 14109aaccc add core profile environment variable
Enables 3druntime scenes at macOS without calling it
with extra process arguments.

Task-number: QDS-553
Change-Id: I04e59f4f9061eb2a567c65406c5a8195b1896836
Reviewed-by: Tomi Korpipää <tomi.korpipaa@qt.io>
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2019-04-01 11:56:52 +00:00
Tomi Korpipaa 0df6977337 Fix surface format bug for macOS
Task-number: QT3DS-3238
Change-Id: Ie3a675ef32251481abaa460bb89bc1c4381573ea
Reviewed-by: Pasi Keränen <pasi.keranen@qt.io>
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
2019-03-29 08:53:54 +00:00
Qt Forward Merge Bot dca7fc3e3a Merge remote-tracking branch 'origin/5.12' into dev
Change-Id: I9c3d282c11a556e616c5e1ba1b51e88b741327f6
2018-12-23 01:00:12 +01:00
Kai Koehne aad66998c3 qmlscene: Make it explicit that QCA::installTranslator is static
Change-Id: I1b123981a9dae359c27c96d4b7ae276af1c5e90f
Reviewed-by: Jan Arve Sæther <jan-arve.saether@qt.io>
2018-12-14 12:49:46 +00:00