Supressing the linking warnings on macOS are relevant when we are
using AppleClang and not upstream Clang.
The provided arguments do not apply to llvm-ar and llvm-ranlib.
Change-Id: I8b664c01802b47077eb0ab80dab7681ee0bfcaa9
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
When doing a top-level build with ExternalProject examples, it doesn't
make sense to make qtbase examples depend on e.g. qtdeclarative
plugins. Instead the qtbase example should only depend on plugins
built in qtbase.
Create per-repo custom targets that depend on all plugins built within
that particular repo.
Create an additional per-repo target which depends on all
plugins built in that repo, as well as plugins from dependent repos.
Use the latter as a dependency for examples built as part of the
current repo.
Repo dependencies are parsed from dependencies.yaml.
Pick-to: 6.5
Fixes: QTBUG-110913
Change-Id: I149860cc549caf53271c9ea296eb7bac2a663715
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
Reviewed-by: Amir Masoud Abdol <amir.abdol@qt.io>
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
Recent Emscripten 3.1.27 reduces the stack size to 64KB,
which is way to small for Qt-based applications.
Restore the previous stack size (5 MB) by setting STACK_SIZE.
Change-Id: I6c25e31b32dc1d551fa423655fcef4891830bcd1
Reviewed-by: Piotr Wierciński <piotr.wiercinski@qt.io>
Reviewed-by: Lorn Potter <lorn.potter@gmail.com>
remove toHex() as it's not used at all and qTableName() with two params.
Also remove some SQLite 2 specific stuff
Change-Id: If285febdfbee5833f7174d70f386bd54674bd539
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Comparing the first character ahead of a strcmp() call is unlikely to
result in faster code than just calling strcmp() right away these days.
Any compiler worth its salt should have a specialization of strcmp()
that uses platform-specific tricks to produce the best performance.
Change-Id: I80b74e698a6636d056b44cbef372edcb417534eb
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
This code predates the public history. I don't know exactly how this
worked before, but I guess it's because the QT_USE_NAMESPACE in our
headers.
If there's _any_ get() function at the global scope, then name lookup
stops there and considers _only_ that function. And if that happens to
have a compatible signature, good night.
Use unqualified lookup instead. That will find the QT_NAMESPACE one,
ignoring other overloads at global scope. And when non-namespaced,
will emit an ambiguity error in the presence of another matching get()
function at global scope.
Task-number: QTBUG-111598
Pick-to: 6.5 6.4 6.2 5.15
Change-Id: Iea141ea543193394ba527b414caf31c1f3a2355b
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Following https://eel.is/c++draft/forward#lib:forward_like
step-by-step.
Temporarily add a q23utility.cpp to contain the static_assert()
tests. There's no point in establishing a tst_q23utility just to run
six static assertions. Should remove the .cpp again once an in-tree
user exercises the function with the same coverage.
Task-number: QTBUG-111598
Change-Id: Icb18eae089d65ca4e555921dbb71e74a7e255645
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
build/include/QtCore/../../../src/corelib/global/qcompilerdetection.h:546:7:
warning: '__cplusplus' is not defined, evaluates to 0 [-Wundef]
# if __cplusplus >= 201103L || defined(__GXX_EXPERIMENTAL_CXX0X__)
^
build/include/QtCore/../../../src/corelib/global/qcompilerdetection.h:648:7:
warning: '__cplusplus' is not defined, evaluates to 0 [-Wundef].
# if __cplusplus > 201103L
^
Change-Id: I8ed8e0c4b93977238986df0b3339ffae4d1d0fda
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Minimum size of QWasmWindow was not properly enforced.
Make sure that minimumu size constraints are respected
when the QWasmWindow is created, resized manually or
changed by setGeometry().
Fixes: QTBUG-111162
Change-Id: I2984b0836b5b53f9163275153d734cb1d81ef3b6
Reviewed-by: Mikołaj Boc <Mikolaj.Boc@qt.io>
Use a scope guard to print debug info in case of an early return.
Silences clang warning about sprintf being unsafe and deprecated.
Change-Id: Idcbfde1a6f2eb1143f51c1e5ecedbf3fe90d8ec8
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
Fix the link to QSurfaceFormat::StereoBuffers, and clean the text up
a bit. If everything is a \note, then we might just as well not have
notes, so move the statement about when this function is useful out
of a note, and combine the statements elaborating on ownership and
lifetime of framebuffer and contexts into a single note.
Pick-to: 6.5 6.5.0
Change-Id: I7cb1f9ff78ba760e99d639550130f5c833ad684a
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
And for good measure, I'm also removing BMI2. The one we really care
about ensuring gets enabled instead of -mavx2 is FMA anyway.
Complements commit 29d3938aa5 (which in
turn complemented commit a98cf15ed1),
which removed BMI1 because AMD introduced it before AVX2. Looks like
they also introduced LZCNT in some earlier processor too (family 10h) or
GCC 12 began emitting __LZCNT__ for that family -- IIRC the AMD feature
list was bigger than just the lzcnt instruction.
Fixes: QTBUG-111698
Pick-to: 6.4 6.4.3 6.5 6.5.0
Change-Id: I7f354474adce419ca6c2fffd1748f5b24f69a692
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
This requires compilers with constexpr offsetof(), which Clang seems to
be since at least 3.0 and GCC since 4.7, both of which are way older
than anything we need to support.
Pick-to: 6.5
Change-Id: I7f354474adce419ca6c2fffd1748b3dcfc616f4a
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
The qtPlatformTargetSuffix() function is used in various places to
determine the suffix of targets based on the config, which for macOS
will result in a _debug suffix in debug mode.
This becomes tricky when one project built in debug mode tries to depend
on the libraries/plugins of another project (Qt) built in release, as
the qtPlatformTargetSuffix() function uses the current CONFIG as input,
which may be different than the QT_CONFIG (or CONFIG of whatever project
is being depended on).
For libraries this was fixed in 50e664835b
by iterating all known library paths, and trying the CONFIG suffix before
falling back to release version.
For plugins this was never solved, which becomes an issue when linking
to static plugins, either in a fully static build of Qt, or when some
of the plugins are static (permission plugins e.g.).
In this situation, the user project has to have the same configuration
as Qt was built with, to avoid errors like:
error: no such file or directory: '~/6.x-static/qtbase/plugins/platforms/libqcocoa_debug.a'
To work around this, we assume that a plugin installed into the Qt
tree has the same build configuration as Qt itself, then then use
QT_CONFIG as the determining factor when linking to the plugin.
This still ties the build config of the plugin to the config of Qt,
but relaxes the relationship to the application, allowing it to be
built in either debug or release, which is an improvement to the
current state.
Pick-to: 6.5 6.5.0
Task-number: QTBUG-110356
Change-Id: Icee67fc01313a6c6f34178a6345ccae1b57429d7
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
Introduce a new feature for password dialog in cups that needs several widgets
Pick-to: 6.5 6.5.0
Change-Id: I93799b814ac06e661c19cffcd7d3c9bfa56ff814
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
The doc said positive values for a negative range were intermediate
but the code actually rejects them if the value has an overt plus
sign, so make clear that intermediate is only for the case without a
sign. Incidentally comment on a test where it might not have been
obvious to the reader that a space is the locale's digit-grouping
chracter.
Pick-to: 6.5 6.5.0
Change-Id: I3edab74fe8c2cbe8448c0e523676f1fd0d0d8a9f
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Make the wait(int) overload call the new one.
Task-number: QTBUG-110059
Fixes: QTBUG-100041
Change-Id: Ia085453c05e09e219ba56010b2504113bbc1dd34
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
From the manual page:
Note: modern applications may prefer to use the interfaces
described in utimensat(2).
Change-Id: Ib20d8b9b50626233852ca351452ce90841a39603
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
The function is in the QtNumeric documentation context.
Pick-to: 6.5 6.5.0
Change-Id: Ibc6a8961bc04efd4ab1eb50bb371e6a169d513dc
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
The Windows version didn't, ever since we started using strncpy_s(),
and we might change the non-Windows version, too.
Pick-to: 6.5 6.4 6.2 5.15
Change-Id: Iee1c09674d296be806d4be42b1891940120b4a01
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
This amends 9a4c98e556.
When a X server has multiple xscreens, for example, ":0.0" and ":0.1",
a Qt application, which uses ":0.1" as display, can't use the randr
monitor from other connection(":0.0") to show contents there. Then
we don't need to generate QXcbScreen for them.
Pick-to: 6.4 6.5
Fixes: QTBUG-110898
Change-Id: I04c1512664b763ffabb55b75db4411d100536255
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Reviewed-by: JiDe Zhang <zhangjide@uniontech.com>
Reviewed-by: Liang Qi <liang.qi@qt.io>
The only change is the signature of the function.
Also mark it as noexcept. It calls all functions in-contract and
doesn't allocate memory.
Task-number: QTBUG-111676
Pick-to: 6.5
Change-Id: I505c1f51da704fd46e538a68d6d8703f7cdefbc8
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
When the string we receive from the system doesn't parse into a valid
QUrl (because QUrl requires a valid IDN), then we shouldn't send the
QFileOpenEvent based on that invalid QUrl, but instead pass the string
through as the file name.
The file name is anyway not guaranteed to be path to a file that can be
opened, as per the existence of QFileOpenEvent::open and the repective
documentation stating:
"some files cannot be opened by name, but require specific information
stored in this event."
However, that API is not useful at all, the implementation just opens
the passed-in QFile, using the stored file name. There's no way
to override this, and QFileOpenEvent is a locked class with all data
stored inline. So we can't even redirect to a platform-implementation.
Deprecate that function. Applications should interpret the string
returned by file(), which might not be a path to a local file.
Fixes: QTBUG-98384
Change-Id: Iff75489de9d7c5fc034f44c0bda4963b2efb1925
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
There's no need to try the various permutations of the language
and region specific locales, as they all point back to the same
CTYPE in /usr/share/locale/UTF-8/LC_CTYPE
In addition, processes started from launchd come with an empty
locale environment (LC_ALL/LC_*/LANG), and hence will default
to the "C"/POSIX locale, even after picking up the environment.
This primarily applies to applications launched from Finder,
but also affects processes launched as background services.
And since a child process will inherit its parent's environment
the empty locale environment is propagated when running apps
from IDEs such as Qt Creator or Xcode, or commands in an SSH
login session (as sshd is a background service), unless the
environment has been explicitly set up by the shell (Zsh).
Since neither of these situations is the result of user
misconfiguration, it makes little sense to spit our a
warning.
We however still warn if we detect that the character
encoding has changed from the default "C" encoding, or
if the encoding is "C", but we detect that the user has
modified any of the relevant locale environment variables,
as this indicates either a change in the system default
behavior, or that the user has explicitly requested a
"C" locale, which is wrong.
Done-with: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Fixes: QTBUG-111443
Pick-to: 6.5.0 6.5 6.4 6.2
Change-Id: I6fd14d1f8adddc2914d6ff4d3b5ad34a3871ef82
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
If we fail to set a UTF-8 locale, the warning claims Qt shall use a
UTF-8 locale, for which it reports an empty string, when in fact it
isn't using a UTF-8 locale, although it'll interact with the system as
if it were.
Also, the user is liable to understand "system locale encoding" as
referring to the underlying system rather than whatever they may have
configured in a local shell; and a non-native speaker assures me the
use of "shall" is also apt to confuse; so reword the messages.
As the old locale is only needed for the code path prints the
warning we can defer resolving it until we know we're going to
use it, by querying the locale at that point.
Done-with: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Pick-to: 6.5.0 6.5 6.4 6.2
Change-Id: Ie6a6e7a707200e58335fcb64cb1584f0c307895a
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Explain each exception cleanly and as itself, thereby avoiding the
need for long and tangled #if-ery conditions.
Make sure to setlocale(LC_ALL, "") everywhere we think we have
initialized the locale, including Integrity - it plainly has
setlocale(), since we call it for LC_CTYPE - since we should at least
give it the chance to set its implementation-defined default locale,
instead of the standard-defined POSIX locale in use on entry to
main().
Done-with: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Pick-to: 6.5.0 6.5 6.4 6.2
Change-Id: Iab00984ba45dfc9a324b6a3c12e3d330b655a5a9
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
...which can happen if the OpenGL implementation reuses IDs
so that a glGenTextures results in the same ID that was used
by a texture destroyed by glDeleteTextures just before.
In this case the lastTextureUsed tracking needs to be aware
and invalidate, otherwise the newly created texture is
assumed to be already existing (the ID is the same as before
after all), and so operations such as setting the minification
filter is skipped (which is fatal with OpenGL given that we
do not use mipmaps).
This is exercised in practice by the drawPixmapFragments test
introduced in the previous patch. On Intel graphics it would
work, but it does not render correctly with NVIDIA due to how
the driver's internal ID handling works.
Pick-to: 6.5.0 6.5 6.4 6.2
Change-Id: Ic2771fe9a2dec7da4aa3804d8498dd89e3c18415
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
Until recently the buffer object-based code path (so not client-side
pointers) was only hit with a core profile context. This changed at
some point in 6.4 and later to support WebGL (that has no client-side
pointers, unlike OpenGL ES 2.0 it is based on). Now buffer objects
are preferred over client-side pointers, always. Problem is,
drawPixmapFragment() was never functional on this code path, it seems.
Expecting that transferMode() does all the uploadData() needed is wrong.
transferMode() bails out if the mode is the same as before, and that's
exactly what happens when an application calls drawPixmapFragments()
on the painter twice, after each other.
How exactly this works with client-side pointers is not fully clear, but
presumably the data buffer address stays the same so all pointers passed
in to the glVertexAttribPointer calls are valid, and it sources the data
for each draw call (probably), thus the rendering is all correct even
though only the first, not the second, drawPixmapFragment() led to
calling uploadData() internally.
Amends e487b07e18 although this patch on
its own is just as applicable pre-6.4 as well (to fix drawPixmapFragments
when using a core profile context).
Pick-to: 6.5.0 6.5 6.4 6.2
Fixes: QTBUG-111416
Change-Id: I2ad358424e613192a51b99b937aef7660f5dbe08
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
Make sure to properly close the cloned database connections and allow
one test for sqlite
Change-Id: Ia4eb4a684a3c432844e4b2a77bff69655b53f9b2
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Instead of going through the whole dance with provider loading,
context creation etc, just call EVP_MD_CTX_reset() to reuse the
already-setup context, if any.
This makes QCryptographicHash::reset() adhere to its noexcept
specification again (assuming EVP_MD_CTX_reset() doesn't allocate
state, and, despite its non-void return type, cannot fail on a valid
context), and should greatly improve the speed of reset(), addData(),
resultView() cycles.
Pick-to: 6.5
Change-Id: I7c35b61cbeab1ffd6dd258e8389ea614d49e2e1e
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Jan Grulich <jgrulich@redhat.com>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
The CFStringGetSystemEncoding() defaults to Mac Roman, unless overridden
via ~/.CFUserTextEncoding, which very few users do or even know about.
Make a note in the to/FromLocal8Bit() that we don't consult this function,
or its NSString wrapper, when determining what the local 8 bit encoding is.
Task-number: QTBUG-111443
Change-Id: I89b6040c62d42de0daea9df908d97d9a23e7b160
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Unlike on macOS, there's no colorSpace property on UIWindow or UIView,
but CAMetalLayer has one, which allows us to tell Core Animation that
the layer targets a specific color space, and Core Animation will then
do the rest of the color matching to the target display.
Now that we use Metal to flush raster content, this is even more useful.
Task-number: QTBUG-108094
Pick-to: 6.5
Change-Id: Ib04b42d9baa296b608983db38faf0398430db093
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>