If an application runs on a macOS or iOS version that introduces new
permission statuses that we haven't accounted for, we don't want to
crash.
Replace Q_UNREACHABLE with a warning and Qt::PermissionStatus::Denied.
Change-Id: I063042f510caaa8936742f6195bd455d09c4d9ee
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit 993cbef7f4)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
The feature allows to not use OpenSSL in QCryptographicHash
implementation and removes OpenSSL from dependencies of QtCore if
disabled.
Fixes: QTBUG-114783
Change-Id: I2a49fa9ddfa5acedcfc95a3330fd7863a8052a5c
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
(cherry picked from commit bacb04d77b)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Similar to the isEmbedded() case, when the parent of a QWindow is a
foreign window, created via QWindow::fromWinId(), we don't have a
QNSView parent that will handle mouse enter/exit on our behalf.
Longer term we probably want to fold this case into the isEmbedded()
case, but as that function is used other places too this requires
some more research, so for now let's fix hover events.
Fixes: QTBUG-114605
Change-Id: Ib61aefc84ed080417a6820a4a365555424b208be
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit 21f3a6d8c5)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
For now we do not have a QCalendarPermission::AccessMode::WriteOnly,
so we have to report Qt::PermissionStatus::Denied.
Fixes: QTBUG-114864
Change-Id: I94e92912ef4c24adb524ccf2cf28553115d6781b
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Reviewed-by: Doris Verria <doris.verria@qt.io>
(cherry picked from commit 2736e908e9)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
CTFontDescriptorCreateMatchingFontDescriptors has been observed to
return nullptr, so we need to handle that explicitly.
Fixes: QTBUG-113698
Change-Id: Ic9fa574c14068fcae98fe8e6ceddd8a4f7008210
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit 9526a76936)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Since qt_noop() is supposed to be a no-op, it should not affect
constexpr'ness and noexcept'ness of functions and expressions it's
(indirectly) used in.
That requires that it be constexpr and noexcept itself. Add the
keywords, but guard against use from C. We can't use our Q_ macros
(which would enable noexcept for C, too, on some compilers, because
qcompilerdetection.h depends on qtnoop.h, and we don't want the
circular dependency.
Change-Id: Ie5441c423b7942a6c956345126fc7aec99907d25
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 7bad2902f8)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
A class-level [[nodiscard]] used to be the only way to get a waring
for code such as
QMutexLocker(&mutex);
with original C++17 means. This was because a few of our compilers
would warn about the presence of [[nodiscard]] on ctors, which is
really the semantics we want: we don't want to prevent users from
passing QMutexLocker out of functions and users of those functions
from ignoring the return value, if they so choose. That should be the
choice of the author of the function returning such types, not ours.
So QUIP-0019 makes class-level [[nodiscard]] conditional on proper
rationale in the user docs (or the commit message in case of private
API). Since none of the existing uses really strikes this author as
particularly convincing, remove them all.
All these classes have gotten Q_NODISCARD_CTOR on all their ctors, so
we continue to provide the same true positive warnings, minus the
false positives when returning from functions, at least on the
majority of compilers (and it's not as if all compilers interpreted a
class-level [[nodiscard]] as a trigger to warn on the initial example
of this commit message).
Task-number: QTBUG-104164
Change-Id: I163356486e7c80f9d69bf67023010a88233fe662
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 01e1dc273d)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Map QNetworkError::HostNotFoundError and QNetworkError::ConnectionRefusedError
to ProxyNotFoundError resp. ProxyConnectionRefusedError when it originated
from the communication with the proxy server.
Fixes: QTBUG-68821
Change-Id: I21b91f2667ba0cd329d4ece1fe543472cdab2d22
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
(cherry picked from commit 69de333e1f)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Previously, Qt would always ignore user's custom QSurfaceFormat
settings and this behavior makes user have no way to control
the preferred OpenGL version when running on WASM. And after reading
the wasm platform plugin code, I don't see any reason why we should
limit ourself to the default OpenGL version. And I've tested this
patch locally, Qt still work normally if I set a newer OpenGL version.
Change-Id: I0cfb831d6a722fe61cc85808a6d9e3098c73d82e
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
(cherry picked from commit 33a9cbef65)
QGtk3Theme uses the GTK button foreground as a default for the
WindowText color role. When a GTK3 theme has no specific color for the
entry text, this can lead to text on certain assets looking darker
and thus disabled.
This discontinues usage of the button foreground for the window text.
Finding the WindowText color role in QPlatformTheme::SystemPalette now
follows the following logic:
(1) GTK normal entry text is used if specified. This is the preferred
option, copying GTK behavior.
(2) If (1) is not specified, the GTK default text color is used, making
WindowText equal to Text.
(3) If neither (1), nor (2) are specified, the WindowText color role is
taken from qt_fusionPalette, where it is also equal to Text.
The SystemPalette is used as a default template for all other control
or widget speicific palettes. The rules above therefor apply to all
screen assets (unless they use a JSON file to specify a their
individual WindowText).
[ChangeLog][QGtk3Theme][SystemPalette][WindowText] Default to GTK
Entry Text / Normal Text / qt_fusionPalette
Fixes: QTBUG-114600
Change-Id: I4c96ac7d096526faf4c2feee436753990c6c9f92
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit 574a47dd5a)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Explicitly check that at least CMake 3.21 is used when building Qt or
when using Qt in a project.
This only affects macOS and iOS builds.
We check for 3.21 instead of 3.21.1 as described in the documentation
to avoid an error like:
Policy VERSION range "3.21.1...3.21" specifies a larger minimum than
maximum.
Until the technical limitation is addressed, if someone does end up
using 3.21.1, another existing check for "unsuitable" cmake versions
(as opposed to minimum required) will let them know they should use
something newer.
Amends 1cf3295cef321c9a587af2f2de7740c0cd3ca743.
Fixes: QTBUG-114869
Change-Id: I2a479baaa63cfbe23af187cf0796e1c00042692b
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
(cherry picked from commit 9ef864f56f)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Pins the vtable to a single TU and therefore prevents duplicate
vtables, -Wweak-vtables warnings and false-positive dynamic_casts.
This requires exporting QGenericRunnable, which hopefully won't
also export the nested class.
Task-number: QTBUG-45582
Change-Id: Ie1f29d25b0dcdee7654c33c497e8e0350d12e311
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
(cherry picked from commit be1b589cb9)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Mobile Safari generates touch pointer events with negative
pointer id's, which causes processTochEvent() to skip
the event instead of synthesizing a mouse event.
Ensure that the id's are always positive by taking the
absolute value of the event.
Change-Id: I1514329dc76ecc4b9103f7deca9642aaf304df8b
Reviewed-by: Piotr Wierciński <piotr.wiercinski@qt.io>
Reviewed-by: Lorn Potter <lorn.potter@gmail.com>
(cherry picked from commit 7a31911b79)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Newer msvc gives C4309 warning for 'initializing':
truncation of constant value
Warning would go away if we had 'enum foo: unsigned'.
Disable the warning for problematic enums is not enough
as it also complains about headers coming from windows sdk
like:
C:\Program Files (x86)\Windows
Kits\10\include\10.0.22621.0\shared\wtypesbase.h(395): warning C4309:
'initializing': truncation of constant value
Note 10.0.22621.0 is the latest sdk already.
Do not disable language extensions for header clean target.
This reverts commit 8bf602518d
Task-number: COIN-1059
Fixes: QTBUG-114931
Change-Id: Ifc3883f88a6bd52794a37dc640eca99c158a40e0
Reviewed-by: Kai Köhne <kai.koehne@qt.io>
(cherry picked from commit 2dcc30592b)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Behave identically to Vulkan, i.e. create a view that spans all array
elements. (except when the range is set)
This becomes relevant with multiview, where the depth/stencil attachment
the render target must be set up with a texture array as well, similarly
to the color attachment. But applies even to D3D11, even though it is
not common to use a texture array there, but it's possible.
Task-number: QTBUG-114896
Change-Id: Ieda8475500b0553f8c14aa9ecad57001b9714d49
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
(cherry picked from commit e126558b9b)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
We were storing the DPR as int; change to qreal.
Task-number: QTBUG-114175
Change-Id: I7dc7df82f584cddbbb3f690f1df74e7a30369ab2
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
(cherry picked from commit c0e48ed645)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Made this change because there was no example of the interaction
between QBindable and non-bindable properties.
Task-number: QTBUG-114689
Change-Id: Ief7662f8af5e6fab32491418fa35f0daa937819d
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
(cherry picked from commit 19b0800555)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
When moving a window with keyboard shortcuts, popup menus currently do
not follow along. Allow this to happen by accounting for a window's
transient children, and moving them after the owning window has finished
its move.
Fixes: QTBUG-106483
Change-Id: Id51a7c0163e4fdd2d139565f2bf500a3fc997488
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
(cherry picked from commit 530d092eae)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Use the new argument to bundle the OpenSSL prebuilt libararies so that
ssl operations are actually tested at runtime.
Task-number: QTBUG-110025
Change-Id: I0d73fed463a1724a9e0ee84ba603aa2ff1bc649b
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
(cherry picked from commit f667445006)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
The new argument would allow bundling the prebuilt OpenSSL libs
into the test apk so that SSL can actually run. It expects the CMake
argument OPENSSL_ROOT_DIR to be set ( we set that in Coin configs).
Task-number: QTBUG-110025
Change-Id: I4c82796635ca89f5511255ae26182f41a504b026
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
(cherry picked from commit 9d5a8162a5)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Replace const char * based connect statements by modern API and remove
'_q_' slot prefixes.
This requires explicit disconnection in the destructor -> add.
Replace bool traps for layouting and removing buttons by enum classes.
Replace if/elseif event handler by switch.
Replace iterator typedef with auto.
Encapsulate logic to ensure defaulting to first accept button in a
member function for better readability.
Remove dead code.
Move private header declaration from cpp to a new _p.h.
Task-number: QTBUG-114377
Change-Id: I8a2bc355e3816c3c826c10cd96194c89bf0ae510
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit df735d794f)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
There are two temporaries, reply.arguments() returns a temporary QList
and list.at(0) returns a temporary reference to the first element. The
local reference variable would only extend the lifetime of the temporary
object it's bound to, list.at(0), but not the temporary list itself.
Even though this a false positive in this case because QList is
implicilty shared, the compiler can't tell the difference and the fix is
simple.
tests/auto/dbus/qdbusabstractadaptor/tst_qdbusabstractadaptor.cpp:1845:21:
warning: possibly dangling reference to a temporary
[-Wdangling-reference]
1845 | const QVariant &retval = reply.arguments().at(0);
| ^~~~~~
tests/auto/dbus/qdbusabstractadaptor/tst_qdbusabstractadaptor.cpp:1845:50:
note: the temporary was destroyed at the end of the full expression
‘QDBusMessage::arguments() const().QList<QVariant>::at(0)’
1845 | const QVariant &retval = reply.arguments().at(0);
| ~~~~~~~~~~~~~~~~~~~~^~~
Change-Id: I03d54b56769cbd0f9f1165e4679ec4947267181a
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 3a9526468c)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
So no-one 'fixes' the test by pinning synchronizer.futures() into a
named variable or collapsing the two lines into one. Both would break
the premiss of the test.
Amends e8dcbaaaf6.
Change-Id: I7a98c382a7db0bf3ff369dcaf61af0942796d6a3
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
(cherry picked from commit 70a7a695fd)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Vcpkg detection is enabled by default, but we did not have a flag to
disable it, and it was not showing up in config.summary either. By
adding a -vcpkg flag, we get to use `-no-vcpkg` when necessary, as well
as adding an entry to config summary indicating whether vcpkg is in use
or not. Besides `-no-vcpkg`, one can pass `-DQT_USE_VCPKG=OFF` to cmake
command in order to disable the automatic vcpkg detection/integration.
[ChangeLog][configure] vcpkg detection, and integration can be disabled
by passing the -no-vcpkg flag to the configure command, or by passing
`-DQT_USE_VCPKG=OFF` to the cmake command.
Change-Id: Ide8da70a7b473ec23995104d162356e75e6d1240
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
(cherry picked from commit b3f27f75b6)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This fixes a crash while parsing an XML file with garbage data, the file
starts with '<' then garbage data:
- The loop in the parse() keeps iterating until it hits "case 262:",
which calls fastScanName()
- fastScanName() iterates over the text buffer scanning for the
attribute name (e.g. "xml:lang"), until it finds ':'
- Consider a Value val, fastScanName() is called on it, it would set
val.prefix to a number > val.len, then it would hit the 4096 condition
and return (returned 0, now it returns the equivalent of
std::null_opt), which means that val.len doesn't get modified, making
it smaller than val.prefix
- The code would try constructing an XmlStringRef with negative length,
which would hit an assert in one of QStringView's constructors
Add an assert to the XmlStringRef constructor.
Add unittest based on the file from the bug report.
Later on I will replace FastScanNameResult with std::optional<qsizetype>
(std::optional is C++17, which isn't required by Qt 5.15, and we want to
backport this fix).
Credit to OSS-Fuzz.
Fixes: QTBUG-109781
Fixes: QTBUG-114829
Change-Id: I455a5eeb47870c2ac9ffd0cbcdcd99c1ae2dd374
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
(cherry picked from commit 6326bec46a)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
For easier debugging, e.g. to print out value.len and value.prefix.
Change-Id: Ib0eed38772f899502962f578775d34ea2744fdde
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
(cherry picked from commit 1a423ce437)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
The syncqt tool was originally designed to run at build time, as a
part of dependency chain of Qt modules. This works well unless we need
the code model of the Qt project in IDE, since Qt source code actively
uses header aliases, and creating them at build time breaks the code
model until the initial build is done. So we made syncqt the configure
time tool to not break the developer experience.
It's more likely that developers build Qt using command line or don't
need the code model before the first build. So running the tool at
configure time should be optional.
QT_SYNC_HEADERS_AT_CONFIGURE_TIME switches the "mode" of the syncqt
tool from build time tool to the configure time tool. Without the
option enabled build procedure runs all the syncing targets at build
time only. The exception are the developer builds, if the
'-developer-build' option is enabled, QT_SYNC_HEADERS_AT_CONFIGURE_TIME
is set to TRUE by default. This gives better development experience for
the developers that don't use the code model in their IDE or don't
require it before the first build is finished. Also this build time
mode is preferred for the CI or similar build procedures where code
model is not required at all.
By default, the option initialized from the
QT_INTERNAL_CONFIGURE_FROM_IDE CMake variable.
TODO: The option is forced to TRUE for the static Ninja Multi-Config
builds. See QTBUG-113974 for details.
[ChangeLog][Build System] When building Qt from sources, syncqt and Qt
header files are now created at build time, not configure time. This
should speed up the configuration step. You can set the CMake variable
QT_CONFIGURE_TIME_SYNC_HEADERS to ON to use the previous behavior,
though. The old behavior is also preserved if cmake/configure is run
from inside an IDE - Qt Creator, Visual Studio Code, and CLion are
currently detected.
Task-number: QTBUG-111163
Task-number: QTBUG-109792
Change-Id: Ib61bda9546e58492be874a8591c37e100313d02c
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
(cherry picked from commit a8cf976ce6)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This amends 79ac430537.
Change-Id: Id68daff20de11361a1bb20071266e8adafe5e9c4
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
(cherry picked from commit d1f3ffc80b)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
As requested in code review. Big improvement, code-wise.
tst_Sleep::wait() was failing on the CI, so be more accurate by using
QElapsedTimer::durationElapsed(), which returns nanoseconds.
Change-Id: I5bed6d6bd768adfdecab2475e6cbe245c20aabd7
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 8ace5b26aa)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>