The -mno-direct-extern-access tells the compiler and linker that
references to symbols outside this ELF module mustn't be direct and must
instead always go through the GOT or PLT (the PLT can additionally be
disabled with -fno-plt). The ELF protected visibility tells the compiler
and linker that this symbol is present in the dynamic symbol table as an
export, but it cannot be interposed by another ELF module.
This option is required for user code to link properly to Qt, otherwise
they will get linker errors (assuming GNU binutils >= 2.39) or runtime
failures (glibc >= 2.35). Both versions of glibc and binutils are older
than GCC 12, so it's a safe assumption they are in use and downgrading
the toolchain or libc is not supported. Adding this option to the
compilation is assured for CMake and qmake-based projects.
For example, all accessess to QCoreApplication::self in QtCore, after
this change and with GCC 12 are relocation-free and direct:
000000000013ebf0 <QCoreApplicationPrivate::checkInstance(char const*)>:
13ebf0: cmpq $0x0,0x4f73d0(%rip) # 635fc8 <QCoreApplication::self>
13ebf8: setne %al
13ebfb: je a90fe <QCoreApplicationPrivate::checkInstance(char const*) [clone .cold]>
13ec01: ret
Meanwhile, accesses to the same variable in other modules are indirect
via the GOT:
66650: mov 0x876e1(%rip),%rax # edd38 <QCoreApplication::self@Qt_6>
66657: cmpq $0x0,(%rax)
This replaces the -Bsymbolic and -Bsymbolic-functions (broken)
functionality that Qt has been using or attempting to use since ~2006.
See https://gitlab.com/x86-psABIs/x86-64-ABI/-/issues/8#note_606975128
Change-Id: Iad4b0a3e5c06570b9f5f571b26ed564aa0811e47
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
And also remove check for DtlsV1_2OrGreater for negotiated
session protocol, since it must have been resolved to a specific
protocol by this point.
Fixes: QTBUG-100154
Pick-to: 6.3 6.2
Change-Id: I3aec31faed8b9cb22be0062da057c62864eba34f
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
The data scope was wrong, it needs to live beyond the attribute strut
Change-Id: If1ceb4967fc1755d4968a69bcd9d82b234bd871d
Done-with: Vincent Rouillé
Fixes: QTBUG-101551
Pick-to: 6.3 6.2 5.15
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
Reviewed-by: David Skoland <david.skoland@qt.io>
QObject's cache the binding status pointer to avoid TLS lookups.
However, when an object is moved to a different thread, we need to
update the cached pointer (as the original thread might stop and thus no
longer exist, and to correctly allow setting up bindings in the object's
thread).
Fix this by also storing the binding status in QThreadPrivate and
updating the object's binding status when moved. This does only work
when the thread is already running, though. If it is not running, we
instead treat the QThreadPrivate's status pointer as a pointer to a
vector of pending objects. Once the QThread has been started, we check
if there are pending objects, and update them at this point.
Pick-to: 6.2 6.3
Fixes: QTBUG-101177
Change-Id: I0490bbbdc1a17cb5f85044ad6eb2e1a8c759d4b7
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
QComboBox is included because it works like a button when it is not
editable. QGroupBox is included because it has a checkbox and QCheckBox
is a subclass of QAbstractButton.
Change-Id: Iad89259314e77f78c915dce83ec601df94c88941
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
The q_toPercentEncoding() overload without percent parameter and the
q_normalizePercentEncoding() function are nowhere used. Although they
were extern symbols, they were not declared in a header. Thei names
mark them as Qt-internal. So removal should be safe.
Change-Id: If6cece20796a80d98a9af4e764443f3ab8c555c9
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Qt Creator crashes when max is INT_MAX and min is -1, see bugreport.
Change-Id: I441e76c0ff87052083ed3d77e6085b186402e5d8
Fixes: QTBUG-101581
Pick-to: 6.2 6.3
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
There seems to be lot of timeouts on testing where qemu is not able to
start at current 60 seconds period.
Pick-to: 6.2 6.3
Change-Id: Icbc47b75a8288e672237789cb273ef5a644c08ba
Reviewed-by: Dimitrios Apostolou <jimis@qt.io>
Rename isLocked in preparation for a future commit. Rename m
as well for consistency.
Change-Id: I1c8d040bca6825a698ec804ea142d208abacd5cc
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
From Clang 13:
qlocale.cpp:854:161: error: expression with side effects has no effect in an unevaluated context [-Werror,-Wunevaluated-expression]
Pick-to: 6.3
Change-Id: Ibf4acec0f166495998f7fffd16d6c75ef1e04262
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
Required for the API symmetry between QStringView and QLatin1String.
[ChangeLog][QtCore][QStringView] Added an overload of
QStringView::count() for QLatin1String.
Change-Id: Ic49a4b31e8f6f0969eff0f792654d23a60e06c49
Task-numer: QTBUG-98431
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Due to some unfortunate shadowing
Pick-to: 6.3 6.2 5.15
Change-Id: Ib2660516f9ba9974c84a043bd2677b7890fc76f9
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
In static member function 'static QQnxAbstractVirtualKeyboard::EnterKeyType
QQnxAbstractVirtualKeyboard::qtEnterKeyTypeToQnx(Qt::EnterKeyType)':
warning: control reaches end of non-void function [-Wreturn-type]
Pick-to: 6.2 6.3
Task-number: QTBUG-101382
Change-Id: If3b0eda5d36257b0fbed54fb0a032c3b9d7ff989
Reviewed-by: James McDonnell <jmcdonnell@blackberry.com>
Also change qt_safe_read to use correct return value.
warning: format '%d' expects argument of type 'int',
but argument 3 has type 'size_t' {aka 'long unsigned int'} [-Wformat=]
warning: format '%u' expects argument of type 'unsigned int',
but argument 3 has type 'ssize_t' {aka 'long int'} [-Wformat=]
Pick-to: 6.2 6.3
Task-number: QTBUG-101382
Change-Id: I1ee42b84a477451a98838c8cea3cca7c73f7cbaa
Reviewed-by: James McDonnell <jmcdonnell@blackberry.com>
Patch 13399bd54d084ed837ec061ca9315dbd173f3b48 removed the accept
handler on QQuickFileDialog, which was triggering setSelectFiles on
android.
So changed qandroidplatformfiledialoghelper to also emit currentChanged
which will trigger the QQuickFileDialog to setSelectFiles since there
is a connect to that signal. Emitting currentChanged signal is also the
signal used in others QPlatformFileDialogHelpers.
Fixes: QTBUG-101013
Pick-to: 6.3
Change-Id: I22f2d583f4be26a83e1c19190458fb5011e40095
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
libjpeg's internal putenv() function uses system setenv(), but that is
not found when building for webassembly. Just disable the entire
putenv function, since it is not used anyway.
Pick-to: 6.3 6.2 5.15
Change-Id: I1eb60f31562ef4e33c656ff3b3752bef6f88fcb8
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
Reading the kernel sources, I was sure we'd get an ECHILD if the child
hadn't exited yet, but that's not the case. We only get ECHILD if the
current process has no child processes. But if we do have one and the
one we're waiting for hasn't exited, waitid() returns 0.
So let's not attempt to correct it with forkfd_wait() or forkfd_wait4().
Those have "wait" in the name, so they should behave exactly the same
way. The man pages say:
waitpid(): if WNOHANG was specified and one or more child(ren)
specified by pid exist, but have not yet changed state, then 0 is
returned.
waitid(): returns 0 on success or if WNOHANG was specified and no
child(ren) specified by id has yet changed state
This was found while studying QTBUG-100174.
QProcess does not use this code path (blocking mode forkfd only).
Matching OpenDCDiag PR:
https://github.com/opendcdiag/opendcdiag/pull/62
Pick-to: 6.2 6.3
Change-Id: Ibf4acec0f166495998f7fffd16d6de6853a6e5a8
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@gmx.de>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Specify that it should not be called until the internal
socket engine has been created.
Given that most usages of this function will be on QUdpSockets
and that people will likely want to call bind() on those
anyway, we just document this rather than implement some
caching mechanism.
Pick-to: 6.3 6.2
Fixes: QTBUG-67576
Change-Id: Ia5d3ade95460b7c5685681ee098f1c00bff43a90
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
By changing it to unique_ptr.
Pick-to: 6.2 6.3
Change-Id: I91abb69445b537d4c95983ae735341882352b29d
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
We always enable directories, so that the user can navigate into them,
so we should do the same for symlinks and aliases to directories.
This is the same behavior the native dialog has when not implementing
shouldEnableURL and relying purely on allowedFileTypes.
Fixes: QTBUG-28379
Pick-to: 5.15 6.2 6.3
Change-Id: I7ae4eb8120aa87cb685f3561d5e1c7257b0c9349
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Also contains some fixes which fix the Windows build, amending
e1b8257dee.
Pick-to: 6.3
Fixes: QTBUG-101294
Fixes: QTBUG-101304
Change-Id: I779f50fc705ed32f0314daf28b39b477a7fe925d
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
These five classes add no members to QTextFormat, so their streaming
must, by all means, be identical to QTextFormat. But should that change
in the future, we don't want to accidentally slice the objects by
calling the parent operators.
Required by "Cause compilation errors if you forget to declare
QDataStream operators"
Pick-to: 6.3
Change-Id: Ic15405335d804bdea761fffd16d4a4193db28bc4
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
We have VAES code in qhash.cpp that isn't getting compiled right now.
Change-Id: Ibf4acec0f166495998f7fffd16d6961261dec361
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
Check that the expected overloads are selected in
QString/QAnyStringView overload sets.
Pick-to: 6.3
Change-Id: I38148c20a72eb60cf86844a39fe0ed419d2fa562
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Makes for easier reading of code, and allows qt_get_hex_rgb(), which is
called from different TUs, to be marked as PURE.
Change-Id: Ie7d4e5a164ca1daf521e18ff47f17885bc1443c1
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
This private method doubled as the implementation of both fromString()
and isValidColorName(). By reformulating isValidColorName() as
fromString().isValid(), we can then turn setColorFromString() into
fromString(), by returning the data, instead of setting it on *this
through use of exported functions.
Since we need to touch the if's anyway, to remove braces, use C++17
if-with-initializer to turn the second if into an else-of, saving one
return {}.
Change-Id: If3f8182a40c0c6d6ad514431b5870e69d0e95769
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
It is customary for Qt types that can be constructed from string-ish
to provide a fromString() named constructor. QColor didn't, relying
instead on a set of overloaded implicit and explicit constructors.
Add the named constructor, with the intent to deprecate the string-ish
QColor constructors after a grace period.
To prevent new users from using known-to-become-deprecated API, mark
the old functions as \obsolete.
Also rename isValidColor() to isValidColorName(). The only reason why
these are lumped together in single commit is so that their docs can
refer to each other instead of having to temporarily refer to obsolete
API.
[ChangeLog][QtGui][QColor] Added fromString() and isValidColorName(),
both taking QAnyStringView.
Task-number: QTBUG-101389
Change-Id: I2857c728257ad2f14c7c968b45547bdf07c44b63
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Add qmake2cmake[.bat] wrapper scripts that can be used to convert user
projects to CMake. For now, user projects are internally handled as Qt
examples with one difference: the generation of example-specific
installation code is suppressed.
Fixes: QTBUG-98655
Change-Id: I1a57f6d12efe0bdf383592ab33682a611692db80
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
This function does not handle installation.
Change-Id: I02fdc244f49b5935aa1ac51bff8a25970ad3a335
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
This makes the QT_VERSION_(MAJOR|MINOR|PATH) variables available.
Task-number: QTBUG-98852
Change-Id: I7e40f2a7ac09975ce21e45cda384af928e1fa629
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
...and write a separate find_package(Qt6 OPTIONAL_COMPONENTS Foo Bar)
call for those.
Task-number: QTBUG-96799
Change-Id: I3386487774c386edde6767dca92ce433bfed906e
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
If you can set the environment variable DEBUG_PRO2CMAKE_TEST_CONVERSION
to 1, the output of pro2cmake is written to the temp directory. This
helps analysing test failures.
Change-Id: Ida42c5b76a67172d00ce0d2488adc7fb376c6b11
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
LibraryMapping.components is a list that holds the sub-components of a
CMake package. Before, we held this information in
LibraryMapping.extra as find_package argument.
A subsequent patch will make use of LibraryMapping.components and
doesn't have to do find_package argument parsing.
Change-Id: Ie0d317245fb6ec1511e06b2e14c364292fced63a
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
We prefer it when the CMakeLists.txt project files for examples use
qt_add_qml_module() when adding resource files, rather than
qt6_add_resource().
A bit of refactoring was needed to re-use the code that extracts
resource information from the .pro file.
The new function write_qml_module is now responsible for writing
qt_add_qml_module calls.
Task-number: QTBUG-96799
Change-Id: I74dc2d681dcf4fc848e1147b3232ce9a9e0946c9
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Without this change, the test fails when run twice in a row. Also, skip
the test if we can't move the cursor.
Pick-to: 6.3
Change-Id: Ic45c073007d114fbd7825cedef6761c1e410b4af
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
The data is guaranteed to be in US-ASCII (result of toHex()), so
there's no need to jump through ASCII → UTF-16 → UTF-8 hoops.
Found by Clang and QT_ASCII_CAST_WARN.
Amends 16b614f2e1.
Change-Id: Ib6789af9fb90952ecbe805e182b0639e1d0704b1
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Ievgenii Meshcheriakov <ievgenii.meshcheriakov@qt.io>