Qt already runs on Vision Pro as "Designed for iPad", using Qt
for iOS. This change enables building Qt for visionOS directly,
which opens the door to visionOS specific APIs and use-cases
such as volumes and immersive spaces.
The platform removes some APIs we depend on, notably UIScreen,
so some code paths have been disabled or mocked to get something
up and running.
As our current window management approach on UIKit platforms
depends on UIWindow and UIScreen there is currently no way to
bring up QWindows. This will improve once we refactor our
window management to use window scenes.
To configure for visionOS, pass -platform macx-visionos-clang,
and optionally add -sdk xrsimulator to build for the simulator.
Change-Id: I4eda55fc3fd06e12d30a188928487cf68940ee07
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
This function finds the translations that belong to the Qt modules that
are used by the project. "Used by the project" means just all modules
that are pulled in via find_package for now.
This code was in Qt6CoreDeploySupport.cmake before. Now, we can call it
in other places too like Qt6LinguistToolsMacros.cmake.
Task-number: QTBUG-110444
Change-Id: I338d54d93cf285190b1430608b32334692ae4c07
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
The lengths are only needed to check if one of the two strings is empty
and in the direct 8-bit comparisons with memcmp(). So we don't need this
division by 2, which was here since the initial commit.
Amends d4c7da9a07.
Pick-to: 6.7
Change-Id: Ie28eadac333c4bcd8c08fffd17c5ecbce564ccd1
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
This is similar to the UTF16-to-UTF16 comparison code added in commit
d4c7da9a07, but instead of converting to
UTF-32, we convert to UTF-8 so we only need to convert one string.
This change allows us to mark the entire recursive comparison sequence
as noexcept.
Change-Id: I5f663c2f9f4149af84fefffd17c07971d8b368cc
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
This isn't a bug, it just removes dead code. The code to compare
US-ASCII to UTF-16 was never engaged because this conditional was wrong
and effectively catching everything. Fortunately, because that
comparison code is now wrong with the unit tests added to tst_QCborValue
in the past few commits.
Pick-to: 6.7
Change-Id: If1bf59ecbe014b569ba1fffd17c4ce184948e646
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
Added in 1bd755465e
We already access oldtlw and oldtlw->d_func() in other places,
and the source of oldtlw is a call to QWidget::window(),
which returns the widget itself if it doesn't have a parent.
This should also fix a CodeChecker issue where it thinks
that the other unchecked accesses to oldtlw are suspicious.
Add assert just in case, so we catch it explicitly if for
some reason this assumption doesn't hold in the future.
Pick-to: 6.7 6.5
Change-Id: Iefa9b2df6b25a993afe87e4ee90fe9d2075ebbd0
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
Makes it more obvious to code-checker what is possible.
Change-Id: I8b2bbc55a600e8b570644135867a3244c6d57be7
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
This is the correct license for the data they contain. The types that
are used to package them can be made available under the same.
Pick-to: 6.7 6.5
Task-number: QTBUG-121653
Change-Id: I7fb5f332f9e7f4f6db0f1f0c3964a36ce03bccb2
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Replace public friend operators operator==(), operator!=() of
QNativeIpcKey to friend methods comparesEqual() and
Q_DECLARE_EQUALITY_COMPARABLE macro.
Task-number: QTBUG-120304
Change-Id: If18d86fb18e44f8d2210cba7ca93e4ac478a2a48
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
Replace public friend operators operator==(), operator!=() of
QKeyCombination to friend method comparesEqual() and
Q_DECLARE_EQUALITY_COMPARABLE_LITERAL_TYPE macro.
Task-number: QTBUG-120304
Change-Id: I679f3fa5fcc4c675a763cc5a5fe0e0880439a64f
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
To get clang-tidy to stop complaining about missing
copy/move-ctor/assign
Task-number: QTBUG-102855
Change-Id: Iefc19da324090db3a38d017859ad0a32ae7d6ff5
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Initialize the hardcoded things inside the class.
Task-number: QTBUG-102855
Change-Id: I06da0a615ec066e63d9cd0359313e8e8f588718e
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Now we can nicely initialize it as a member-initializer.
Do channels at the same time, NSDMI follows.
Task-number: QTBUG-102855
Change-Id: I59c1fe044687500ed3a9d5878c6e4fc137114542
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
It complains about the declaration arg. name differing from the definition name
Task-number: QTBUG-102855
Change-Id: I005ab69b0f41db0bda3ef64f2c779c3cb3f6fd38
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
We want to get rid of the other one, it's all internal
API anyway.
Task-number: QTBUG-102855
Change-Id: I2b621c20f4dd7c8bf5f07db8db908c2b7b86976f
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
Our new way of doing it is atomic, so while conflicts can
still happen that leads to e.g. access denied, those will be
because the _target file_ is already accessed for some reason.
The fallback might be lucky enough that it happens after this
other access is done, but probably not. So remove the fallback
and just do the atomic rename.
Change-Id: I13f6b4b70974500b8dd9309138b9052b6a5acc62
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
We want to drop the fallback path, so we need to set an appropriate
error when the native rename fails.
Change-Id: I2746d79b9e5666f54c35ff7ac29a74191cf22740
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
SetFileInformationByHandle only works when we have opened the file with
DELETE access. Since the code is shared with QTemporaryFile it is not
necessarily always a given. Since it was anyway falling back to the old
way of doing it it was not a problem, but it is cleaner to only use it
when we know it will work.
Pick-to: 6.7
Change-Id: I3c744734d45272c41e49bb6971adf4f82213d97d
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
I accidentally copied const from another signature.
It's not changing any members so it's technically fine,
but it leaves a bad feeling and we will change members soon.
Pick-to: 6.7
Change-Id: Ib0236d7e7dda84834ba35907d75c52cf77fb3843
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
The header file is not guarded properly in qglobal.h. This installs
it unconditionally in systems where version tagging is not supported.
Task-number: QTBUG-124346
Change-Id: I130b7d016e28a7a03d8929bc17fad50c80648f49
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
It was missing for a long time
Pick-to: 6.7 6.5
Change-Id: I209838a3c7b45c8c2e8da21efea306fafddea891
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Mate Barany <mate.barany@qt.io>
Their implementations call only constexpr functions, so they should be
constexpr, too.
[ChangeLog][QtCore][QByteArrayView] The startsWith(char) and
endsWith(char) functions are now constexpr.
Change-Id: I41f57ce3428a8de441e3c230aafc7bf426651c9f
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
Having already caught some bugs in real code because of unchecked calls
to QFile::open, this commit marks QFile::open (and open() in other
file-I/O classes) as [[nodiscard]].
Since it's going to raise warnings, the plan is to keep the existing
behavior up to and including the next LTS. Then the warnings will switch
on by default. All of this is protected by system of macros to opt-in or
opt-out the behavioral change at any time.
A possible counter-argument for doing this is that QFile::open is also
used for opening files in the the resource system, and that opening
"cannot fail". It clearly can, if the resource is moved away or renamed;
code should at a minimum use a Q_ASSERT in debug builds. Another
counter-argument is the opening of file handles or descriptors; but
again, that opening may fail in case the handle has been closed or if
the flags are incompatible.
---
Why not marking *every* open() override? Because some are not meant to
be called directly -- for instance sockets are supposed to be open via
calls to `connectToHost` or similar.
One notable exception is QIODevice::open() itself. Although rarely
called directly by user code (which just calls open() on a specific
subclass, which likely has an override), it may be called:
1) By code that just takes a `QIODevice *` and does something with it.
That code is arguably more rare than code using QFile directly.
Still, being "generic" code, they have an extra responsibility when
making sure to handle a possible opening failure.
2) By QIODevice subclasses, which are even more rare. However, they
usually ignore the return from QIODevice::open() as it's
unconditionally true. (QIODevice::open() doesn't use the protected
virtual pattern.)
I'll try and tackle QIODevice in a future commit.
[ChangeLog][QtCore][QFileDevice] The open() functions of file-related
I/O classes (such as QFile, QSaveFile, QTemporaryFile) can now be marked
with the "nodiscard" attribute, in order to prevent a category of bugs
where the return value of open() is not checked and the file is then
used. In order to avoid warnings in existing code, the marking can be
opted in or out, by defining QT_USE_NODISCARD_FILE_OPEN or the
QT_NO_USE_NODISCARD_FILE_OPEN macros. By default, Qt will automatically
enable nodiscard on these functions starting from Qt 6.10.
Change-Id: Ied940e1c0a37344f5200b2c51b05cd1afcb2557d
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Log using emscripten_log by default, unless
QT_FORCE_STDERR_LOGGING has been set.
It is now possible to log at different levels:
qDebug() -> Info
qWarning() -> Warning
qCritical() -> Error
#ifdef out functions which are now no longer in use
on Q_OS_WASM
Change-Id: I0485e5c070069998a8dfc6759c02bc3b7d6a8a4b
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
The rounding policy is used to calculate QScreen geometry
during startup. Changing it afterwards is not supported
since we don't have an update mechanism.
This restriction is already documented but printing
a warning makes sense since this is easy to miss.
Fixes: QTBUG-123102
Change-Id: Ib88511e61abbf97436a13dc5d38d3d1fbd5aab2c
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Make qt_finalize_target call qt6_extract_metatypes() on any library
targets if the finalization is deferred and the target uses automoc.
This makes sure the metatype information is always available when
necessary (e.g. in QML's foreign types setting).
[ChangeLog][CMake][Important Behavior Changes] With CMake 3.19 or later
qt_extract_metatypes() is automatically called during target
finalization for libraries that use automoc now. This has no
effect if you've already manually called qt_extract_metatypes() before,
but it does make sure that the metatypes are also generated if you
haven't.
Task-number: QTBUG-121199
Fixes: QTBUG-101143
Fixes: QTBUG-99051
Change-Id: If72ce5887a9cd71a4c15e9509b2eaab5af271adf
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
In order to build a complete graph of metaobjects via properties and
methods we need to know about all argument and return types as
metaobjecs. Such a graph is desirable for reasoning about the
consistency of the type system.
Task-number: QTBUG-101143
Change-Id: Ic4e2f58a4275df06178437c6d45270f3f2aa5ce6
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
The threee enumerations
- PM_DialogButtonsSeparator
- PM_DialogButtonsButtonWidth
- PM_DialogButtonsButtonHeight
Are not documented since Qt3 times and also not used anywhere. Therefore
deprecated them and remove the logic to handle them.
Change-Id: Ia59fe15482e744123e7fbf04b8d44661afb58b5c
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
When a slot is connected to the modelReset signal before the model is
set on the view, then such a slot might try to resize the columns or
rows to fit the contents before the view had a chance to perform layout
work.
In that case, the while-loop that calculated the size hint of a rows
(or column) by checking the size hint of each cell might not exit, as
cached information about visual indexes would be invalid.
To prevent this, don't loop over the cells if the actual last row/column
of the model (after the reset) is less than the first (cached) visible
row/column. Also, make sure we increase the counter for number of
rows/columns processed with each iteration.
Add a test (that loops infinitely without the fix, resulting in the
test being killed by the framework), and make the 'actual' variables
constant for clarity.
Fixes: QTBUG-124301
Pick-to: 6.7
Change-Id: I0adb2f1e8a1e78760ef7c19e9686c9572eca8be6
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
While <DIGIT>+<Character> is not a valid identifier by itself in the C++
language, it might become one when using it with the token pasting
operator.
This risks confusing some number literals with suffix as Identifiers,
but those are currently not supported anyway, so this shouldn't break
anything that is currently working.
Fixes: QTBUG-87219
Fixes: QTBUG-124288
Pick-to: 6.7
Change-Id: If73255cc0e6649bc90c52b1d177aac8ff975ae69
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
This reverts commit 220afb358f.
The change caused segfault after menus or dialogs were closed.
The global raster compositing context is still being used by root
window and cannot be deleted from child window.
Pick-to: 6.7
Fixes: QTBUG-123962
Change-Id: Ie88925052f0f424617382388c587ae47570d13a7
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
It's exposed in the QPlatformSystemTrayIcon::contextMenuRequested()
signal. In order to make sense of it on meta object level, it needs a
Q_GADGET.
Task-number: QTBUG-101143
Change-Id: I327d31f36e2cf3460398e328b26e9e5e5edec45e
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
This reverts commit 5898e0e4f1.
Likely broke a CMake deployment test in qtdeclarative.
Change-Id: I90c8343f0657845dd514e573b7333f441b70cc9e
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
The code was already OK because it used QFile::isOpen to check
if open() succeeded or not. In preparation for making open()
[[nodiscard]], refactor the code to just use its return value.
Change-Id: Ibab86ca894103f01ff3b6084caedb3117ffb6c7e
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
This is speculative fix for the crashes in QTextLine::layout_helper()
we're observing on users side.
The possible reason is in that fontEngine and previousGlyphFontEngine,
which are stored in LBH, became invalid during the layout cycle
(destroyed by trimming font cache?).
To prevent this we need to handle font engine's ref-counter
gracefully, so just wrap them into QExplicitlySharedDataPointer.
As a drive-by change, use in-class initialization for LBH members.
Task-number: QTBUG-117500
Pick-to: 5.15 6.2 6.5 6.7
Change-Id: I6987a2b5618bb4ba8762f2ef01b4ce0dd60cb232
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
This reverts commit 654f3c5634.
That commit enabled a work-around for CMake upstream issue #19005 for
Visual Studio project generators. It turns out that this is not actually
needed, and that the work-around causes unnecessary rebuilds.
Fixes: QTBUG-121046
Pick-to: 6.5 6.6 6.7
Change-Id: Ie502e2df999a204ab09d28322017be3c7ed8ebc5
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
There are 9 functions in the 4.5 API that were initially specified
to use GLsizei, but later "magically" became GLsizeiptr (i.e.
64-bit or 32-bit depending on the arch).
The current gl.xml, unlike old ones, uses GLsizeiptr, as do the
extension headers and most of the online docs, except some that of the
reference pages are stuck with GLsizei.
Assuming that today's OpenGL implementations expect GLsizeiptr, fix
the the internal signatures, so that calling into the GL implementation
is done using the correct argument sizes.
In addition, add GLsizeiptr signatures in the public API guarded with
>= QT_VERSION(7, 0, 0).
Pick-to: 6.7 6.6 6.5
Fixes: QTBUG-67807
Change-Id: Ifc7e97b0479a186000a56709c37ba7f77b6f1ff2
Reviewed-by: Christian Strømme <christian.stromme@qt.io>
Deleting QNetworkReply is a common way to cancel pending request.
Wasm implementation was not treating it properly.
Task-number: QTBUG-124111
Pick-to: 6.7
Change-Id: I46d8624e323fca0932411c575922415d9f9d7986
Reviewed-by: Piotr Wierciński <piotr.wiercinski@qt.io>
Rename qsignalspy.qdoc to .cpp, include qsignalspy.h and add the
namespace macros.
Task-number: QTBUG-123544
Change-Id: Ibd89844018afc277e6a69e7200cdbd08befd4da2
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
JNI_OnLoad gets called automatically by the JVM when it loads a shared
library. A native library that is loaded by native code shouldn't have
it's JNI_OnLoad entry point function called, as that would indicate
that the plugin is loaded by the JVM, which it is not.
If framework or application code requires that function to be called
(and wants to perform error handling, such as closing the library again
if the function returns JNI_ERR), then that can and should be done
explicitly.
[ChangeLog][Android][QLibrary] Loading a shared library with QLibrary
no longer implicily calls a JNI_OnLoad implementation.
Fixes: QTBUG-92007
Pick-to: 6.7
Change-Id: I9aa71ec73b950029e0ae1be7d54e1c8576f356ab
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
Most of the cases, a file handle (stdin/out) is opened without checking
for error. That operation may still fail, so check for it.
Change-Id: I30c3e7b40858acd8b1662622129bd6557722dccd
Reviewed-by: Ahmad Samir <a.samirh78@gmail.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
A click on the corner widget should select all items, not reset the
selection. This was accidentally added with
3e144bdc74.
Pick-to: 6.7
Fixes: QTBUG-124267
Change-Id: Ie20b7cf0ff730214dca80116ad888f42c2b7a670
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>