The .qtmetadata section is already suppressed for static plugins, but we
carried this unnecessary magic string. For library file formats where we
don't have a scanner (Windows COFF PE), a library that linked multiple
static plugins could end up with multiple metadata found.
We can't suppress the header because the version of moc could be
different to the version of Qt, so we need to read the header version
too. Right now, the version isn't output by moc (all the logic is in
qplugin.h), but this could change again in the future. In any case, 4
extra bytes are not a big deal, so the header stays.
Change-Id: I3eb1bd30e0124f89a052fffd16a82088d8303081
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Looks like it was copied from QUtf16::convertFromUnicode(), but for the
UTF-32 case that is not correct. UTF-16 to UTF-32 conversions can change
the length of the string due to surrogates.
There are unit test tests for creating and parsing UTF-32 headers, and
for detecting content as UTF-32, but there aren't any for UTF-32
conversions. I don't have time to add a full test for that.
Fixes: QTBUG-97122
Pick-to: 6.2 6.1
Change-Id: Ic17a33f599b844d8ab5dfffd16ab2c4cb6b0547d
Reviewed-by: Ievgenii Meshcheriakov <ievgenii.meshcheriakov@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
This allows Qt Quick Controls to detect if a dark theme is in use,
and if so, use a dark theme of the current style (if available).
Fixes: QTBUG-93955
Pick-to: 6.2
Change-Id: I15fc8a2271acf9ba27232359056d5a681d4cffca
Reviewed-by: Dmitry Shachnev <mitya57@gmail.com>
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
Leaving it set to 0 will cause mktime() to interpret other fields as
in standard time, potentially "correcting" them and tm_isdst to
represent the equivalent moment in daylight-saving time. Set it to -1
to tell mktime() to let the system work out whether the time is
standard or daylight-saving.
Change-Id: Id33d4cb0afdb14f236ca5ce04cf605610a30d712
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
It's available on MinGW, so not limited to MSVC; and the MinGW
localtime() and localtime_r() fail in some cases where it works.
Use the generic name rather than _localtime64_s(), since localtime_s()
now just calls it; and, in any case, we were assuming time_t is
__time64_t when calling it.
Change-Id: I316cc5b1a3e19cd6725555042dfaba3124a25a03
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
QDialog overrides setVisible to set focus on the default push button, or
(if there is no such button), make the first autoDefault push button the
default button. QDialog also explicitly sends a FocusIn event to the
focus widget in the dialog.
All this should not be done if the dialog does not become active after
getting shown, which will be prevented if the WA_ShowWithoutActivating
attribute is set.
Add a test case.
Fixes: QTBUG-8857
Pick-to: 6.2
Change-Id: If47021a4721a280ba45e95b43d0424cdacd9b4ea
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
The need for this union has disappeared at some point during refactoring
It does confuse MemorySanitizer, though, so it's good to remove it.
Change-Id: I5f5050adba302bf96db96d5f303d2a25630543ce
Fixes: QTBUG-97109
Reviewed-by: Ievgenii Meshcheriakov <ievgenii.meshcheriakov@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
For a widget that implements height-for-width, the vertical scrollbar
becoming visible might be just enough to make the scrollbar unnecessary.
In that situation, the scrollbar flips on and off continuously.
To avoid that situation, make the width of the widget smaller until the
height fits without scrollbar, up to the point where we have space for
the scrollbar anyway.
The calcuation here is assumed to be cheap, but depends on the
heightForWidth implementation in the widget. Running the while-loop a
few dozen times should have no performance impact during resizing
and laying out the scroll area contents.
Add a test that confirms that within a brief period of time we only get
the one hide-event we expect.
Done-with: Zou Ya <zouya@uniontech.com>
Fixes: QTBUG-92958
Pick-to: 6.2 5.15
Change-Id: I0faeb5f9b1a226aada958c18333d9c2ac8203dd1
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
Previously, when deciding where the actual data is, Frame was calling
padding() to test if offset is needed. A curious case with a DATA frame
containing compressed body and having 'PADDED' flag set with a padding
equal to ... 0, ended in a decompression error (and assert in 6.2 code).
Pick-to: 6.2 5.15
Fixes: QTBUG-97179
Change-Id: I9341a4d68510aa4c26f4972afdcd09a530d5a367
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
When setCurrentIndex is called by removeTab, the old current index
might no longer be valid. Only update the lastTab value of the new
current tab if the old current index is still valid.
As a drive-by, use the validIndex helper function.
Fixes: QTBUG-94352
Pick-to: 6.2
Change-Id: I945e2093a90a1fccbba86d32b1113f83fedd41de
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
This simplifies the code. While at it, also expand default case
so changes in the QChar::Direction enum don't go unnoticed.
Change-Id: Id52140b0aaf7fd259c4b8079462811603eb3ff93
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
No need to reinevent the wheel. Also, use nanoseconds
now that we have the precision available.
Change-Id: I287d06198edc3f5bdf7f85bd5f3e235b1fea95a3
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Unify cancel and finish in QPromise destructor in a single call. This
saves us one extra mutex lock and atomic state change.
Task-number: QTBUG-84977
Change-Id: Iac06302c39a2863008b27325fcf6792d4f58c8ae
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Change-Id: I5d66a67a5c16a479f62b9f43cb769d5ee5f66b60
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Use '-G Ninja' instead of '-G"Ninja"'.
Pick-to: 6.2
Change-Id: I53a77ea3b2d1547bb516b3ab756f5ae0f24092b1
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
We prefer the shared cache path, because there is no reason to give up
benefitting from sharing the content between applications. If that path
is not QFileInfo().isWritable(), we fall back to the local cache path.
However, there are reportedly systems with security solutions such as
AppArmor where the writable check passes and yet attempting to create a
file still fails. Then there is no cache in effect, because nothing ever
gets written out.
Handle this better: if writing the file fails and we still use our first
choice, the global cache location, fall back to the secondary choice
(the app-local path) and try again.
Pick-to: 6.2 6.1 5.15
Fixes: QTBUG-96789
Change-Id: Ifea32e9af0cf85aa70f3069256ed3d6a7e2fbe90
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Dalton Durst <dalton@ubports.com>
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
This was confusing for me, being unfamiliar with the API.
Pick-to: 6.2 5.15
Change-Id: I831c6d0aa30847e069a7c21c279f147a1b24e486
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Unfortunately we can't depend on the C++11, 14 or 17 Standard
Library, which is not properly and completely implemented
everywhere. All Library features above C++98 must be checked with
their corresponding __cpp_lib macro before use. This does not
apply to the C++17 Core Language.
qwaitcondition_p.h:144:20: error: 'mutex' in namespace 'std' does not name a type
144 | using mutex = std::mutex;
| ^~~~~
qwaitcondition_p.h:59:1: note: 'std::mutex' is defined in header '<mutex>'; did you forget to '#include <mutex>'?
58 | #include <condition_variable>
+++ |+#include <mutex>
59 | #include <mutex>
qwaitcondition_p.h:145:33: error: 'condition_variable' in namespace 'std' does not name a type
145 | using condition_variable = std::condition_variable;
| ^~~~~~~~~~~~~~~~~~
qwaitcondition_p.h:59:1: note: 'std::condition_variable' is defined in header '<condition_variable>'; did you forget to '#include <condition_variable>'?
58 | #include <condition_variable>
+++ |+#include <condition_variable>
59 | #include <mutex>
Pick-to: 6.2
Change-Id: I2bbf422288924c198645fffd16a9249e5330136a
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
On a mobile device, selecting text in a line edit brings up the text
action popup for select/copy/cut. In a spinbox where the user changes the
value using the buttons, this can be very irritating, without providing
any usability - the user is unlikely to start typing, at least not
without first transferring focus into the lineedit first to bring up the
keyboard.
This style hint allows styles to override the default behavior of
QAbstractSpinBox. Implement the customization for the Android style, and
add a test case for QSpinBox.
[ChangeLog][QtWidgets][QStyle] A new style hint, SH_SpinBox_SelectOnStep,
specifies whether pressing the up/down buttons or keys in a spinbox will
automatically select the text.
Fixes: QTBUG-93366
Change-Id: If06365a7c62087a2213145e13119f56544ac33b5
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
Moving the class out makes it easier to navigate the code
Change-Id: I8de67641512a7dbbf6446cdca9d8dea79a63c217
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
We were using the non-standard interface for PropertiesChanged, and
support for this was dropped in a Network Manager update earlier this
year[0].
Switch to using the standard interface.
[0] https://networkmanager.dev/blog/networkmanager-1-32/
Pick-to: 6.2
Change-Id: Ibdf2b635ae13a3150c4d2faa028c15c70c8af5ca
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Ievgenii Meshcheriakov <ievgenii.meshcheriakov@qt.io>
The first callback added for the android backend does not have the value
as a parameter which is something the other callbacks have. Change it so
it does.
And promote the lambda to a real function.
Change-Id: I06f10f7c79f33a5ea3154f2fc6d20d550cd7eca7
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
It's part of the capabilities which we are already using. It also lets
us work around a pre-existing edge-case where, if you have a VPN enabled
and enable Airplane mode it will continue to tell you it is Online even
when it is not. This happens because VPN is reported as a transport and
when Airplane mode is enabled it may be left enabled as the _only_
transport.
At the same time clear the default filters (if any), and filter out
suspended connections. May not necessarily make any difference.
And add a comment for why we cannot use a technically more suitable
type of callback.
Task-number: QTBUG-91023
Change-Id: Ic26c4d4e8da139ec8606a0b1bf5fb7157bd0beaf
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
The new public API returns and notifies changes to the currently active
transport medium for the application. And there's a new private API to
report it, with backends to follow.
Task-number: QTBUG-91023
Change-Id: I527985f9dabcd7bc4a32f36597e21bc4ab664c4e
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
On macOS, when showing a window, we decide if it should be made
key and therefore active, if the app has no active modal session
or if the window's worksWhenModal returns true.
However, the window needs to be made key also when a modal window
is present, but not visible. Add this condition when checking if
the window needs to be made key.
This makes the behavior consistent with what happens when a modal
is minimized on macOS. The input focus is passed to the next window,
and the window appears active, even if it can not be interacted with.
Fixes: QTBUG-85574
Pick-to: 5.15 6.2
Change-Id: I204d4f912128f4a46840789fc2ee08e1b2716bfc
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
In QDoubleSpinBoxPrivate::validateAndInterpret() some code still
assumed checking one entry in a QString is enough (it isn't - the
grouping separator may be a surrogate pair) and nothing considered the
case of an empty grouping separator (as can arise if the user sets
that in their system configuration, as a brute-force way to suppress
digit-grouping). Failure to consider this case failed an assertion on
dereferencing the first character of the separator.
Handle the case of empty separator and suppress tests that try to
match a separator, when there is no separator.
Pick-to: 6.2
Fixes: QTBUG-96734
Change-Id: I63d3205ef8656a2cd2c0d855a25e712ad66e2429
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
WM_GETDPISCALEDSIZE and WM_DPICHANGED.
Pick-to: 6.2
Change-Id: I0614b0f552e52fc77d026dbc7e8c13b05f7d0e9e
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
The event flow for programatic window geometry change
(e.g. from MoveWindow()) differs from user-interactive
geometry change: We still get WM_DPICHANGED, but this
event is not preceded by WM_GETDPISCALEDSIZE, so we don’t
get to override the window size.
However, Qt has already scaled the window size for the
new DPI in this case (the scaled size is provided to
QWindowsWindow::setGeometry()), so we can omit making
second native set-geometry call.
Pick-to: 6.2
Change-Id: Ia7d42d7fee49adf757e7fe75d77f1731405ad519
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
By handling WM_GETDPISCALEDSIZE we can keep QWindow’s
device independent size constant across DPI changes.
This is done by scaling QPlatformWindow’s native size
such that the change of scale factor and change of
QPlatformWindow size cancels out.
Qt now handles DPI change using two events:
WM_GETDPISCALEDSIZE: Compute the new size for the window.
WM_DPICHANGED: Apply the new DPI and window geometry.
The reason for this complication is that Windows retains
control over the window position during the DPI change,
in order to e.g. accurately track the cursor position
during a screen change.
The default WM_GETDPISCALEDSIZE implementation (provided
by Windows) scales the win32 window size linearly with
the DPI change. We want to use linear scaling as well,
however the win32 window size includes the margins, which
do not change linearly as the DPI changes.
Instead, scale the QPlatformWindow size, and then add
the new margins.
Pick-to: 6.2
Change-Id: I4f225be8fad56b1fa77e9e3cfd6538a206589d73
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
We want to have as little code in the QWindowsContext
event switch as possible.
Pick-to: 6.2
Change-Id: I04d578aae81c4ee804310a70bd87ee60b2890b6a
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
Closing a window with a native child results in the native child's
QWidgetWindow being closed. That explicitly calls setVisible(false)
on the child, which will still have the ExplicitShowHide attribute
set from the initial (explicit) show. Even though we then reset
the ExplicitShowHide, the WState_Hidden attribute will still be
set, so Qt considers the window to have been hidden, and not show
it again when the parent becomes visible.
Add a test case.
Fixes: QTBUG-96286
Fixes: QTBUG-79012
Fixes: QTBUG-71519
Change-Id: I482e6d5236c959d82ce66798176b259a3176972c
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
The only place where we use it, we swiftly cast it to QMetaObject*
anyway. Generating an object with virtual methods, only to then cast to
its non-virtual base type is dangerous. Also, if we are required to
return a QAbstractDynamicMetaObject from a method of
QDynamicMetaObjectData, we cannot implement QDynamicMetaObjectData
without also implementing QAbstractDynamicMetaObject. This indirectly
forces us to copy metaobjects around as we cannot wrap an existing
metaobject into a QDynamicMetaObjectData subclass.
Copying metaobjects around makes QMetaObject::inherits() unusable
because inherits() assumes identity is determined by identity of the
pointer.
Change-Id: Icbe697efa6fd66649eef3c91260c95cda62e3c90
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
The static analyzer can't see that the QPointer not being null implies
that the QWidget pointer is still valid. Since we reset the widget
pointer to nullptr earlier on if the QPointer is null, just test for the
widget pointer instead.
Amends f6befd3e63 and fixes report
020fbdde70065e8de370537304d13d21.
Change-Id: I715764956a02b1300766a3cea2d427f840f1cec8
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
This reverts commit 7fd9ed3201.
While trimming the font name worked for cases with application fonts,
it actually introduced an assert for system fonts that ended with a
space, because enumerating these failed. So the original assumption
that all Windows APIs also trimmed the family name was wrong.
The original bug was that the font with the trailing space could
not be selected, but when using setFamilies(), it can. So there is
a perfectly fine way around the original bug when using a font that
has this problem. Therefore, no additional fix is needed for that.
[ChangeLog][Windows] Fixed an assert that happened when the system
had a font with a trailing or leading space in its name.
Pick-to: 5.15 6.1 6.2
Fixes: QTBUG-93885
Task-number: QTBUG-79140
Change-Id: I6d9df31a4f2c6555d38d51da374f69b6fb0f1ecb
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Even if the code fails, the runtime will have a xdg-open binary
that supports the required API (portals in flatpak and userd launcher
in snap)
Task-number: QTBUG-83939
Change-Id: I8527cfe20411c535686b7171ff9ef285ab9e10aa
Reviewed-by: Jan Grulich <jgrulich@redhat.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
This rewrite uses the actual structures supplied by the system's C
library, so it should be easier to read. It removes hardcoded constants
with little evident meaning in favor of sizeof() and the macros from
that header. It also removes advancing the data pointer in favor of
having absolute offsets.
The resulting implementation is stricter than the original, checking
more fields in the header. Because the QPluginLoader and QFactoryLoader
users may make decisions based on availability of plugins before
attempting to load them, it's better to be stricter here than to fail
later when trying to dlopen() them.
Debugging and testing are much improved. Instead of stored artifacts, I
added a routine to modify a valid plugin to make it invalid, given the
conditions we've found so far.
If you turn debugging on for this category, you'll see things like:
not-elf.fcqdMq.so : Not an ELF file (invalid signature)
wrong-word-size.QrnSAx.so : ELF 32-bit LSB (GNU/Linux), version 1, shared library or PIC executable, x86-64
invalid-word-size.bOkXvp.so : Invalid ELF file (class 0), LSB (GNU/Linux)
unknown-word-size.ogYKeF.so : Invalid ELF file (class 66), LSB (GNU/Linux)
wrong-endian.owiElX.so : ELF 64-bit MSB (GNU/Linux), version 1, shared library or PIC executable, x86-64
invalid-endian.FRxClR.so : ELF 64-bit invalid endianness (0) (GNU/Linux)
unknown-endian.FfvRrP.so : ELF 64-bit invalid endianness (65) (GNU/Linux)
elf-version-0.gPTdpQ.so : ELF 64-bit LSB (GNU/Linux), file version 0
elf-version-2.jlIUUg.so : ELF 64-bit LSB (GNU/Linux), file version 2
executable.LlXiFp.so : ELF 64-bit LSB (GNU/Linux), version 1, executable, x86-64
relocatable.UsOYuy.so : ELF 64-bit LSB (GNU/Linux), version 1, relocatable, x86-64
core-file.hqvNRz.so : ELF 64-bit LSB (GNU/Linux), version 1, core dump, x86-64
invalid-type.CIJgfS.so : ELF 64-bit LSB (GNU/Linux), version 1, unknown type 259, x86-64
wrong-arch.UcNmgz.so : ELF 64-bit LSB (GNU/Linux), version 1, shared library or PIC executable, AArch64
file-version-0.lZYuda.so : ELF 64-bit LSB (GNU/Linux), version 0, shared library or PIC executable, x86-64
file-version-2.ucfdwL.so : ELF 64-bit LSB (GNU/Linux), version 2, shared library or PIC executable, x86-64
no-sections.rSjsHh.so : ELF 64-bit LSB (GNU/Linux), version 1, shared library or PIC executable, x86-64
no-sections.rSjsHh.so : contains 0 sections of 64 bytes at offset 0 ; section header string table (shstrtab) is entry 0
no-sections.rSjsHh.so : no section table present, not able to find Qt metadata
qtmetadata-executable.vrxcIf.so : ELF 64-bit LSB (GNU/Linux), version 1, shared library or PIC executable, x86-64
qtmetadata-executable.vrxcIf.so : contains 42 sections of 64 bytes at offset 997256 ; section header string table (shstrtab) is entry 41
qtmetadata-executable.vrxcIf.so : shstrtab section is located at offset 996831 size 423
qtmetadata-executable.vrxcIf.so : section 0 name "" type NULL flags X offset 0x0 size 0x0
qtmetadata-executable.vrxcIf.so : section 1 name ".note.gnu.property" type NOTE flags AX offset 0x2a8 size 0x30
qtmetadata-executable.vrxcIf.so : section 2 name ".note.gnu.build-id" type NOTE flags AX offset 0x2d8 size 0x24
qtmetadata-executable.vrxcIf.so : section 3 name ".hash" type HASH flags AX offset 0x300 size 0x44c
qtmetadata-executable.vrxcIf.so : section 4 name ".gnu.hash" type 0x6ffffff6 flags AX offset 0x750 size 0x3b8
qtmetadata-executable.vrxcIf.so : section 5 name ".dynsym" type DYNSYM flags AX offset 0xb08 size 0xd50
qtmetadata-executable.vrxcIf.so : section 6 name ".dynstr" type STRTAB flags AX offset 0x1858 size 0x15d8
qtmetadata-executable.vrxcIf.so : section 7 name ".gnu.version" type 0x6fffffff flags AX offset 0x2e30 size 0x11c
qtmetadata-executable.vrxcIf.so : section 8 name ".gnu.version_r" type 0x6ffffffe flags AX offset 0x2f50 size 0xb0
qtmetadata-executable.vrxcIf.so : section 9 name ".rela.dyn" type RELA flags AX offset 0x3000 size 0x480
qtmetadata-executable.vrxcIf.so : section 10 name ".rela.plt" type RELA flags AX offset 0x3480 size 0x7e0
qtmetadata-executable.vrxcIf.so : section 11 name ".init" type PROGBITS flags AX offset 0x4000 size 0x1b
qtmetadata-executable.vrxcIf.so : section 12 name ".plt" type PROGBITS flags AX offset 0x4020 size 0x550
qtmetadata-executable.vrxcIf.so : section 13 name ".plt.got" type PROGBITS flags AX offset 0x4570 size 0x8
qtmetadata-executable.vrxcIf.so : section 14 name ".text" type PROGBITS flags AX offset 0x4580 size 0x110e
qtmetadata-executable.vrxcIf.so : section 15 name ".fini" type PROGBITS flags AX offset 0x5690 size 0xd
qtmetadata-executable.vrxcIf.so : section 16 name ".rodata" type PROGBITS flags AX offset 0x6000 size 0x473
qtmetadata-executable.vrxcIf.so : section 17 name ".qtversion" type PROGBITS flags AX offset 0x6478 size 0x10
qtmetadata-executable.vrxcIf.so : section 18 name ".qtmetadata" type PROGBITS flags AX offset 0x64a0 size 0x19b
qtmetadata-executable.vrxcIf.so : found .qtmetadata section
qtmetadata-writable.stzwrk.so : ELF 64-bit LSB (GNU/Linux), version 1, shared library or PIC executable, x86-64
Change-Id: I42eb903a916645db9900fffd16a4437af9728eea
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
OpenSSL v3 among other nice things brought some nasty crashes
(essentially, finally breaking what was already not so nice
in 1.x: see, e.g. ASN1_ITEM_free and ASN1_ITEM_ptr that we
have to use to free resources allocated by openssl). Let's,
at least, not use v3 from Qt built with 1.1.1 and vice
versa.
Pick-to: 6.2 5.15
Change-Id: If14a2a0ce2189a1b7967b7ab7248d11d0f2fc423
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Update the build.gradle for main Qt jar code, and add same files for
network and network information backend, so the code can be managed
from Android Studio.
This also adds .gitignore to ignore Android Studio build artefacts.
Pick-to: 6.2
Change-Id: Ic06e9d12708070fad112f17e58b8754608d184f3
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
jcenter() is deprecated and will be shutdown by next year [1], thus
the replacement mavenCentral() could be used instead.
[1] https://blog.gradle.org/jcenter-shutdown
Pick-to: 6.2
Change-Id: Ic9d1c15d657f23712ee4c866d5c1a45706353429
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Add startOnReservedThread that specifically releases a reserved thread
and uses it atomically for a given task. This can make a positive
number of reserved threads work.
Change-Id: I4bd1dced24bb46fcb365f12cbc9c7905dc66cdf1
Reviewed-by: David Faure <david.faure@kdab.com>
This allows to create EGL context without involving Xlib.
This extension was created a year ago and is present in Mesa since 21.0
Change-Id: Id9bcbffe8c46cb00d9cc0a9a425c1706d1b52b28
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
After calling close(), the socket can enter 'Closing' state, in which
we try to write buffered data before disconnecting. As the device is
already closed, we must disable any pipe reader activity and clear the
read buffer.
Change-Id: I8994df32bf324325d54dd36cbe1a1ee3f08022d1
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@gmx.de>
Although the Apple docs claim that Rosetta can translate apps that
contain just-in-time (JIT) compilers, it seems to have problems with
the PCRE JIT.
https://developer.apple.com/documentation/apple-silicon/about-the-rosetta-translation-environment
To be on the safe side we disable the JIT explicitly when detecting that
we are running under Rosetta. It's already disabled when we're running
on macOS ARM natively (see 2f8df4d1a8).
Fixes: QTBUG-97085
Pick-to: 6.2
Change-Id: I0e133939f28087560d4bc8354b7e49013e94a9f9
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
Since 9e1875483c the logic of sending
QKeyEvent was changed to only happen when we explicitly decided to not
treat input as complex text, or when a selector for a command was not
found. This missed the case where we handle cancelOperation by falling
back to sending a regular key event. We now set m_sendKeyEvent to true
to trigger this logic.
Fixes: QTBUG-97119
Pick-to: 6.2
Change-Id: Ibb72f4b068cce735db8d76e5e0a1882aae115207
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
The various macros that implement a test's main() call a test object
initMain() static function, except for QTEST_APPLESS_MAIN. Add it to it.
[ChangeLog][QtTest] initMain() is now also supported when using
QTEST_APPLESS_MAIN.
Change-Id: I46b1eae5ce3bb8c9a5aca525f193c9250e520c6d
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
The brush transform was ignored for pattern/texture brushes. Since
fill patterns always have a transform in pdf anyway, we can just
multiply in the brush transform.
Fixes: QTBUG-96978
Pick-to: 6.2
Change-Id: I80357f61fb879dfb1226d4ef9469ae5c9a9c1147
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Reviewed-by: Albert Astals Cid <albert.astals.cid@kdab.com>
We were doing this for composeAndFlush already, which accesses the image
via graphicsBuffer().
Task-number: QTBUG-64504
Task-number: QTBUG-64414
Pick-to: 6.2
Change-Id: I51cc002db8a15991f8a8aa32e849c07318e6e74c
Reviewed-by: Błażej Szczygieł <mumei6102@gmail.com>
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
Use CMake external project to crosscompile android libraries for
mutliple android ABIs at the same time.
The idea behind is to use pre-compiled Qt for each android ABI in
external projects, compile libraries and then utilize results of
compilation in common androiddeployqt call.
By default multi-abi build uses the main ABI that qt toolchain file
belongs to. The list of the autodetected Qt for Android ABIs is stored
in QT_DEFAULT_ANDROID_ABIS cache variable. Users may change the set of
the Android ABIs project-wide using QT_ANDROID_ABIS CMake variable or
for the specific target by adding the ANDROID_ABIS argument when
calling qt6_add_executable. To enable build for the autodetected ABIs
user may set the QT_ANDROID_BUILD_ALL_ABIS option to TRUE.
By default build procedure is looking for the respective android_<abi>
folders to run per-abi build. If user's Qt for Android folder structure
is different then one is created by Qt installer, path to the each
Qt for Android might be overwritten using QT_PATH_ANDROID_ABI_<abi>
CMake variable.
Note: This only adds support for the multi-abi build of user's
applications.
TODO: This commit limits projects to not have in-tree library
dependencies. That means that executable targets may have
dependencies only from Qt directories or android sysroots.
See QTBUG-94714 for details.
[ChangeLog][Android][Platform Specific Changes] Added basic support
for multi-abi builds of user projects.
Task-number: QTBUG-88841
Change-Id: I3239ffe61e6b437e170c8decc5c36a9e774ed0fb
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
Everywhere else in this code, it says
if (update_source_sort_column() && dynamic_sortfilter)
so, doing the same here.
This originally comes from commit 3ffcfc357d
but skelly isn't around anymore, and Milian (reviewer) had
no objection to this change either. Looking into the implementation,
calling it twice is a no-op anyway, create_mapping will early-return
with "already done".
On the other hand, now it has a chance of returning true, while before
it would always return false in the second call ("return true if the column was changed").
I couldn't write a unittest for that case though, it would require that
a source reset also changes the proxy->source column mapping somehow,
but I don't see how that can be done (the latter being the QSFPM setup).
Change-Id: Ie560facf1039a1afc02543e83bfdef0f8f2e09fc
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
- Those files were moved as part of Qt3D as its the sole
user of these
- Also removed associated unit tests
Pick-to: 6.2 5.15
Change-Id: I302bc219218a58071c86d2447cb4449601fca32c
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Mike Krus <mike.krus@kdab.com>
Using individual booleans to track that the value had changed was not
necessary.
Change-Id: Ieb4712776339aa78bdc75d7608fd74f96d19bbae
Reviewed-by: Ievgenii Meshcheriakov <ievgenii.meshcheriakov@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
The client and server do in practice depend on each other.
So setting up things is a tad more complicated, and the use
case not big enough to warrant both to be highlighted.
Task-number: QTBUG-96575
Pick-to: 6.2
Change-Id: I0ed69f7a20ec490cc977bde7f1b09162153d0bd2
Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
operator-> was only defined if QWEAKPOINTER_ENABLE_ARROW is defined.
However, even in that case it would call QWeakPointer<T>::data, which
does not actually exist. Take this as an indicator that nobody actually
uses operator->, and remove the code completely.
Note that the QWEAKPOINTER_ENABLE_ARROW was not documented, and neither
was operator->.
Change-Id: I2f4aa961a64281542c8c1b248a993e83471c059d
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Calling pipeWriter->checkForWrite() can indirectly close the socket
even if the bytesWritten() signal has not been sent. So, we need to
make sure the handle is valid before checking pipe state in the
reader.
There is no harm in calling PeekNamedPipe() with an invalid handle,
but the wrong call should be avoided.
This patch amends b2c3b3e8fe.
Change-Id: I5d2ecbbbe0af817aac68ad6f1173b0ed9b324e98
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@gmx.de>
This is done in preparation for storing the metadata without the magic
string in static plugins and in ELF notes.
Change-Id: I3eb1bd30e0124f89a052fffd16a820454dd56d3e
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
GCC is right, the maximum memory allocation is half the VM size,
not the full VM size or multiple times that. QHashPrivate::Span
is big.
qhash.h:552:17: warning: argument 1 value ‘18446744073709551615’ exceeds maximum object size 9223372036854775807 [-Walloc-size-larger-than=]
Change-Id: Ie72b0dd0fbe84d2caae0fffd16a071ffb5d0c70f
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Emscripten only supports
SSE1, SSE2, SSE3, SSSE3, SSE4.1, SSE4.2, and 128-bit AVX instruction
sets at this time.
https://emscripten.org/docs/porting/simd.html
Browsers might need to enable simd support in the advanced
configurations
about: config or chrome:flags
Enable by configuring Qt with -sse2
Pick-to: 6.2
Fixes: QTBUG-63924
Change-Id: Ifeafae20e199dee0d19689802ad20fd0bd424ca7
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
If __cpp_lib_hypot is undefined in macos you may observe the error:
error: '__cpp_lib_hypot' is not defined, evaluates to 0 [-Werror,-Wundef]
Adding the explicit check for definition suppresses the warning that
is treated as an error.
Change-Id: Ie4c185fefde2f5bab699d8fc79b6a170e64af393
Reviewed-by: Andrei Golubev <andrei.golubev@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
Reviewed-by: Ievgenii Meshcheriakov <ievgenii.meshcheriakov@qt.io>
This is the already-loaded counterpart to the file scanning code
Change-Id: I3eb1bd30e0124f89a052fffd16a81f518fa95f0d
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Those two scanners always return exact results, if the metadata is
present, so we don't need to re-scan (haven't needed since Qt
5.0). Especially since we scan from the end, we were spending cycles
doing unnecessary work.
Change-Id: I42eb903a916645db9900fffd16a4ccfdc7342278
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Both functions took a QString for the input file name, but while the ELF
parser had an optional QLibrary pointer (which was never null) where to
store the error string, the Mach-O parser received a pointer to a
QString. So make both of them take a single in/out QString pointer,
which has the file name on input and is cheap for us because of COW.
Drive-by fix the name of the static function in qmachparser.cpp from
"ns" (which stood for "not suitable") to "notfound".
Change-Id: I3eb1bd30e0124f89a052fffd16a8182f4f8541c3
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
When we created the functionality, the levels were not yet standardized.
Now they are and you can use -march=x86-64-v3 (for example) to get to
them. We're making a split between "v1" and "baseline" here for the
benefit of 32-bit, which is not included in the ISA levels.
Change-Id: I2de1b4dfacd443148279fffd16a397a700b9a15a
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
This will allow us to make changes in QtCore itself, without having to
worry about moc compatibility.
The output uses an #ifdef so this version of moc can still be used to
compile earlier versions of Qt (usually, in cross-compilation
environments). See discussion in the mailing list[1].
[1] https://lists.qt-project.org/pipermail/development/2021-September/041732.html
Change-Id: I2de1b4dfacd443148279fffd16a39784c80c5f3b
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
The reason it scanned backwards was valid, but unfortunately that
doesn't work if the metadata magic appears in the debug info that comes
after the metadata.
Task-number: QTBUG-67461
Change-Id: I2bbf422288924c198645fffd16a9276767ca2589
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
The current CMake configuration sets QT_ANDROID_SDK_BUILD_TOOLS_REVISION
only internally, taking the latest build-tools found. A project might
still want to manually set specific build-tools version.
Pick-to: 6.2
Task-number: QTBUG-97002
Change-Id: I553563638160fdef7a27b9b334d1d9aae5d8b7e1
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Previous code was getting the QFontEngine from the font+script instead of from
the QTextEngine.
The font+script is not enough information to know if a given character is
smallcaps or not, while the QTextEngine actually has access to the information
needed and returns a properly a scaled fontengine if character is small caps
Pick-to: 6.2
Fixes: QTBUG-13965
Change-Id: I9f95bd2f3c3bdff76c3acb94fa2edc99cdeb0a13
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
It tried to sanity-check the correction being made to the time as a
result of converting zone to UTC, but handling also the case where the
correction avoided a gap. However, there are too many quirky cases to
permit a simple condition. The latest to trip it up is a case of a
zone leaving local solar mean time; a time in the gap that hits is
shunted by the width of the gap, which could be any old thing, and
won't show up on the data describing the zone before or after the
transition.
In any case, one branch of the check was doubling the zone's standard
time offset, which makes no sense. As that was checking for
double-DST, it would need to check standard offset plus twice the
usual DST offset; but the data it's looking at probably has its DST
offset set to the doubled one that needs to deal with. In general a
change in DST without going via standard time will have problems here,
and a change to standard time could also present problems.
Stop trying to shore up the assert and just trust the offset we got.
Change-Id: I4519f47e79dfb7595f4a12c259b80a338bc7033c
Reviewed-by: Andreas Buhr <andreas.buhr@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
So far the pages were only 'rooted' in the separate qtcmake
documentation. Let them have a page per module too, so that
it's easy to navigate.
At the same time rename the cmake-macros-qtcore group to
cmake-commands-qtcore. This will require a fixup in qtdoc
repository.
Pick-to: 6.2
Change-Id: Ifc09b27a6c220b5feab64686ca47c60d3342e71a
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
The property is nowadays on QGuiApplication.
Pick-to: 6.2
Change-Id: I8759761b08b0cdcef786ca96a7fa6364331f157d
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
For normal \page elements, \brief is just showing in the
\generatelist or \annotatedlist commands. Make sure the description
is also visible in the actual CMake command/variable/property
page by defining a \summary macro.
Pick-to: 6.2
Change-Id: I12bc854d547059a2f6309a5922bb0b2a36d4e41c
Reviewed-by: Craig Scott <craig.scott@qt.io>
Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
androiddeployqt writes a list of architectures into the build.gradle
file. This list should only contain the architectures which are enabled.
This patch adapts the generation of this list accordingly.
Amends 07cfab07a2.
Change-Id: I5c7c1886c54cc3b9a7e42af6eefbaf2a067a67d5
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
Since Qt6, QByteArray uses qsizetype as an integral type for offsets
and sizes. In order to support large blocks, we have to migrate to
that as well.
Change-Id: I2c2983129d6a2e0a1e8078cc41d446a26e27288c
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@gmx.de>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
This patch removes most of the checks that are made using C++20
__cpp_* macros for features available in C++17 and earlier.
Library feature check macros (__cpp_lib_*) are unaffected.
Change-Id: I557b2bd0d4ff09b13837555e9880eb28e0355f64
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
The comments are not needed, since we're adding a docs page
for the manifest, which include the information from these
comments and more. Keep the manifest clean.
Pick-to: 6.2
Task-number: QTBUG-95285
Change-Id: I1fd8bc695f5aab1bcc69f549cb3ddeeaac168b98
Reviewed-by: Ville Voutilainen <ville.voutilainen@qt.io>
The Gradle version in qt_attribution.json doesn't mention the actual
version that is currently used.
This amends 67c3f3f4ff.
Pick-to: 6.2
Fixes: QTBUG-71328
Change-Id: I50fbabd56beb44389f9453666822f9667bab7d61
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Given that we rely on C++17, it should be safe to mandate that level of
language support.
Change-Id: If07ccb36bea2a5113a8f5aacf635be7d2590baf7
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
[ChangeLog][Third-Party Code] PCRE2 has been updated to version 10.38.
Change-Id: Ib6ab544790747a94a00b8eb516314ff3c57e4c79
Pick-to: 6.2 5.15
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
The modification to the existing constructor was necessary to avoid
ambiguous overloads from plain strings. They'd previously only match
QByteArray, but now they match QByteArrayView too.
The QByteArray constructor must stay even in Qt 7 because the pattern is
stored. The QByteArray indexIn also stays in because of ambiguous
overloads. Unless we want to remove the const char* overloads.
Change-Id: I2bbf422288924c198645fffd16a92859b67f3978
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
We were to strict in what surface type we allowed scrolling for. The
RasterGLSurface type is an odd one, used by widgets to compose GL
and raster content, which means we still have a raster backingstore
we can scroll. It's just the flush that's different.
Pick-to: 6.2
Change-Id: Ia229c21c00ad38df9e87f4fc78e341e030ef228d
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
The comment against the use of this claimed qvsnprintf() lacks 64-bit
support, which is probably untrue by now but certainly irrelevant as
the value being formatted is a qreal, not a 64-bit integral type.
Since %g wants a double, make the value passed explicitly double by
casting its denominator. Casting its numerator to qreal was
superfluous as that's its type already.
Change-Id: I5ff885fbeb9b638b2b0507061e0a19e3b8522143
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Make the overloads taking a size private (they're only called by the
implementation of the others) and have them take qsizetype for the
size, rather than size_t. Make the still-public ones consistently
return 0 on failure and move the documentation to them.
Change some spurious checks (QTestCharBuffer::size() is necessarily
positive) to assertions, use '\0' for the nul character to make it
visually distinct from the integer 0. Use a do..while loop instead of
break-ing out of the tail of a for (;;) loop. Remove spurious extra
nul-termination - the function taking size alread did that, so the
wrapper to size-expand needn't. Minor style cleanups.
Change-Id: I7440f3d9be5e3b2dd88c2aad62bcd1af9fc02278
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
The extern declaration for filter_unprintable() was nowhere used and
no such function is anywhere defined.
The for (;;) loop with lots of reasons to break; was better structured
as a do {...} while loop. A comment on -1 as return from qvsprintf()
was misplaced. The '\0'-termination after calling qvsprintf() was
redundant as vsprintf() reliably '\0'-terminates anyway. Turned a
static const into a constexpr. Assert size (a QTestCharBuffer
necessarily has size >= 512).
Change-Id: I5b7729b9bd66fea0ee7ce3e7cfdde6770f10b36c
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
The QtNetwork project file excludes the dnslookup source files for Unix,
despite the dnslookup feature is always on. This inconsistency leads to
linker errors when building applications against QtNetwork:
(error #412) unresolved symbols: 1
QDnsLookupRunnable::query(int, const QByteArray &, const QHostAddress
&, QDnsLookupReply *) from libQt6Network.a(qdnslookup.cpp.o)
Turn the feature off for INTEGRITY and remove the condition from the
project file.
Pick-to: 6.2
Change-Id: If086da51ca343f598eb273236e7b6338f5da1e97
Reviewed-by: Tatiana Borisova <tatiana.borisova@qt.io>
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
This patch introduces support for the WinRT UI languages API.
We are using the Win32 API to get the list of preferred languages when
the system locale is used. However, this API returns an incomplete
list.
As Qt 6 supports Windows 10 and above, we can make use of the WinRT
API, if it's supported by the compiler. This API returns the full list,
as reported by the Windows system itself.
Note however, that this API can't be used with Clang and MinGW, so
we still have to fall back to Win32 API for these compilers. We also
do it if WinRT API returns an empty list of languages for some reason.
Fixes: QTBUG-94341
Pick-to: 6.2
Change-Id: I1d23c68d2ec298ae7835d0d18718876ff041aede
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
We don't have any APSPI2 includes in our public headers and should
therefore not export the target that provides ATSPI2 include paths for
consumers.
Link against PkgConfig::ATSPI2 instead of the _nolink target.
The former will not be exported.
Pick-to: 6.2
Fixes: QTBUG-97023
Change-Id: I4b12e0c2230917feeb963c02565e6db24f757bd3
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
The `QFont` documentation refers to Roman Czyborra's personal page with
the intent of providing information about encodings.
The page seems to have been down for many years and may contain
information that is now deprecated such that it is now replaced with a
link to the Unicode Technical Report 17 about the Unicode Character
Encoding Model.
The new link was chosen as a substitute as it seems to cover or provide
the intuition for, standing by the last captured version of Roman
Czyborra's personal page on the Wayback Machine, many of the same
concepts.
Task-number: QTBUG-96127
Pick-to: 6.2
Change-Id: Ibf901b5023688c14efb3d6f77a10609f7ba80e72
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
The "qt" property can also be filled with a json object like this:
"qt": {
"x86":"/home/.../Qt/6.3.0/android_x86",
"x86_64":"/home/.../Qt/6.3.0/android_x86_64",
"arm64-v8a":"/home/.../Qt/6.3.0/android_arm64_v8a",
"armeabi-v7a":"/home/.../Qt/6.3.0/android_armv7"}
That allows to update the options.qtInstallDirectory when changing the
current architecture.
The "qtHostDir" property is also added to provide the path to the qt
host installation (rcc, qmlimportscanner).
Change-Id: I3f0c36cc7a7030d45adc1a4dccaaad61dd538aea
Task-number: QTBUG-88841
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
Calling emscripten_async_run_in_main_runtime_thread_()
with a pointer to a static lambda was too clever, use
an anonymous function as callback instead.
Pick-to: 6.2
Task-number: QTBUG-94344
Change-Id: I2d8a8b0ffc2dd1d02018aa5902550216d00f641d
Reviewed-by: Lorn Potter <lorn.potter@gmail.com>
The await() method waits for the result of async operation in a
non-blocking way (triggering processEvent periodically).
It means that during this wait some other things might happen, and
there would be no reason to wait for the end of the operation execution.
This patch implements an additional parameter - a function that specifies
a condition for an early return. When this function returns true, the
await() method returns with E_ABORT, which makes it possible to
distinguish it from timer expiration.
Task-number: QTBUG-96057
Pick-to: 6.2 5.15
Change-Id: Ide73d768b7cbb3a35be7160ce7555aeb2dca5235
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
Reviewed-by: Juha Vuolle <juha.vuolle@insta.fi>
\relates takes a class name as argument, but doesn't deal nicely
with a templates full definition.
Pick-to: 6.2
Task-number: QTBUG-97028
Change-Id: I7c608717c5d552bc553073534104dece01b8ff96
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
We can only start timers in threads started via QThread, and even then
we cannot assume that the thread runs an event loop. So only start the
timer when we are in the main thread.
Add a test that verifies that we don't get the warning message.
Pick-to: 6.2
Change-Id: I40d7d9ff115720f9ecd3eedaebbade2643daf843
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Not relying on some implicit include coming from other include.
Pick-to: 6.2 5.15
Fixes: QTBUG-96621
Change-Id: I11f6a20e98871eacee51ad723c484f25916c2882
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Don't bother overwaiting in waitForDone(), if it was done at one point
after it was called we can return true. And do not stop threads recently
awakened by a startThread call as they have tasks to do.
Make allowing at least one thread regardless of reservation more
standard instead of hacked in certain places.
Pick-to: 6.2
Change-Id: I304bcdc5822f440d5e72fc33ba2aa1678c9ba0d0
Reviewed-by: David Faure <david.faure@kdab.com>
If we know at compile time that a window system interface event will be
delivered synchronously, then we can allocate it on the stack avoid a
new/delete. This is the case for a large number of events.
Add a template helper class that is specialized for the three delivery
types to allocate the event object on the stack if possible, and on the
heap otherwise. We can use that factory in the event handler functions,
via a helper function, to replace the heap-allocation and call to
handleWindowSystemEvent.
Done-with: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Change-Id: If92fc91ef07f3542a37dfb0fed20e15a3d19b8f0
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
This header is a C++17 feature that is already used unconditionally
in qtypeinfo.h.
Change-Id: I26330d298e95102f3e94c0c69fc95c1025666eb4
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Qt requires a compiler that support C++17 thus __cplusplus
is always 201703L or higher. This patch removes checks
for __cplusplus value that always succeed.
Change-Id: I4b830683ecefab8f913d8b09604086d53209d2e3
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Item views can open an editor widget on the first key press, and need to
take special care not to break input methods. The initial key press
starts compositing by the system input method, which is then interrupted
by the focus transfer to the editor.
To solve this problem, the widget needs to keep focus while the initial
composition is ongoing, and only transfer focus to the editor once the
composition is either accepted or cancelled by the user. Add a state flag
that is set during this initial preedit phase.
During this initial composition, the item view will receive all input
method events, and needs to forward these to the open, but not yet focused
editor for the user to get the correct visual feedback during the preedit
phase. The item view also needs to report to input method queries on
behalf of the editor to make sure that the IM UI is correctly positioned
without covering the user input.
Implement a test that simulates the sequences through synthesized
QInputMethodEvents; we can't simulate the entire system input stack.
Fixes: QTBUG-54848
Change-Id: Ief3fe349f9d7542949032905c7f9ca2beb197611
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
In addition to checking the .lnk extension, check that the
the specified path is not a path to a directory.
Pick-to: 6.2
Fixes: QTBUG-85058
Change-Id: I83cef3d94c6ffa82a88f374c5b41779e88fe40b8
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Kai Koehne <kai.koehne@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
On macOS, we get explicit notifications when a window becomes or resigns
the key, before we have had a chance to close open popups. The popup is
then closed later, but the delivery of the WindowDeactivate event has
already been aborted as QApplication interprets such notifications while
in popup mode as delayed focus events.
This leaves the focus widget still displaying focus even though its
window is no longer active. Trying to activate the window again then
does not correctly transfer focus.
To fix this, close all popup explicitly when a window resigns key.
Task-number: QTBUG-78750
Fixes: QTBUG-66513
Fixes: QTBUG-69710
Pick-to: 6.2
Change-Id: I590757c7d3532dbe4b5358a8e121ce8aa871a699
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
When building for armeabi-v7a, building and APK using
"ninja foo_make_apk" works. Building it by calling
"gradlew assembleDebug" works. Opening the "android-build" folder
in Android Studio and clicking the "Build" button works.
But clicking the "Run" or "Debug" button in Android Studio does not
work when the attached phone is arm64-v8a. Then Android Studio
automatically selects the v8 architecture which does not find the Qt
libraries. This patch adds explicit ABI selection to the gradle
configuration files. With explicit ABI selection, Android Studio does
not try to outsmart you.
Pick-to: 6.2
Fixes: QTBUG-96701
Task-number: QTBUG-87022
Change-Id: I4ad6356c38b7eca004c0e0dbbb357cab7de84c0f
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
This fixes a bug where calling exec() on a secondary
thread would make the thread exit.
Task-number: QTBUG-94344
Pick-to: 6.2
Change-Id: I259c7ebbd53271609af88aca141d88c282cbcd34
Reviewed-by: Lorn Potter <lorn.potter@gmail.com>
In the Android gradle files, the variable qt5AndroidDir refers to Qt5
and might confuse users. This patch renames to qtAndroidDir.
Pick-to: 6.2
Change-Id: Ib18a3cd2c38646e4c6c0435dae9234f0f7887eb5
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
Store isWidgetType and isWindowType once to avoid multiple tests, and
use a single QWidget* variable for widget receivers once we handle those
explicitly, rather than separate declarations for each event type.
Fix indentation to make it more obvious that the entire switch statement
is only executed for widget receivers.
Remove unreachable code for QGraphicsWidget key handling. At that point,
we already know that the receiver is a widget, which QGraphicsWidget is
not, so this code was never executed anyway.
Minor clean-ups, coding style improvements, and standardisations of
repeating patterns.
Change-Id: Idfe944f041ae82372b17082a5ffc4df13802359b
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
On Android, when the system library directory does not exist,
no error message was given. This led in turn to error messages like
Can't find 'nulllibQt6Core_armeabi-v7a.so'
which are not very helpful.
Pick-to: 6.2
Task-number: QTBUG-80766
Task-number: QTBUG-96701
Change-Id: I4187e4a68d9e78e198152306a3e664c30c51ab18
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
This adds a few snippets to show how the functions can be used, and also
removes workarounds for oldver versions of qdoc that weren't clang based
- those workarounds also seem to have caused some bitrot.
Remove documentation for an overload of registerMutableView that
currently does not exist (for a member function with an ok parameter).
Fixes: QTBUG-96963
Pick-to: 6.2
Change-Id: Ibc867d08bcacbc7add8c965df9864d6f339a5d54
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
qobject.h has #include <chrono>, which #includes <ctime>, which includes
<time.h>.
datetime.cpp:2621:23: error: 'localtime_r' was not declared in this scope; did you mean 'localtime_s'?
Pick-to: 6.2
Change-Id: I2bbf422288924c198645fffd16a922719c4ce7d4
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
There was a bug in the pdf writer for cosmetic pens when they were
drawn using native pdf strokes (QTBUG-68537). The workaround that was
done for that bug was to disable native atroking for such pens, so
they would always be emulated. The drawback of that was that painting
with dashed cosmetic pens would then produce unexpectedly large pdf
files, since it would contain individual strokes for every dash.
This change fixes the original bug and removes the workaround,
re-enabling native stroking for cosmetic lines.
Pick-to: 6.2 5.15
Fixes: QTBUG-86094
Change-Id: I58d06ad2db81206025ca2de394f072e822c03d47
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Reviewed-by: Albert Astals Cid <albert.astals.cid@kdab.com>
Reviewed-by: André de la Rocha <andre.rocha@qt.io>
In the PDF engine, transforms are implented with a global pdf
transform if and only if the current pen is "simple", that is,
renderable by a native pdf pen. For non-simple pens, the painted
objects are transformed by QTransform instead. Hence, the internal
simplePen flag was used to indicate both a pen state and a transform
state.
This commit splits these two states into separate flags. No behavior
is changed, but it prepares for an improved implementation of cosmetic
pen rendering.
Pick-to: 6.2 5.15
Task-number: QTBUG-86094
Change-Id: If02e1dfc021778e3db7c9ff9a1ed35b3d6cbf3f8
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Reviewed-by: André de la Rocha <andre.rocha@qt.io>
MSVC defaults to a C++ dialect which is not standard-compliant. For
a number of years, it has offered a switch (/permissive-) to enable
standards conformance, but it was entirely opt-in. While we do build
(and test) Qt under /permissive-, our users do not necessarily do
that for their own software.
Meaning, we risk subtle bugs and build issues for the code present
in our headers (because users may use them in non-/permissive- mode).
This has already happened multiple times (QTBUG-95880, as well as
19b5520abf).
So far, we couldn't *enforce* /permissive- for client code, as MSVC
didn't deem it stable, and various SDKs (like Windows') were not even
building under it.
This has now changed. /permissive- is now deemed fully stable and
supported, and turned on by default when using /std:c++20 (since VS 2019
16.11 [1]). So, starting from 6.3, we can now pretend its presence.
Unfortunately /permissive- does not set any special macros for us to
test [2], so test one of its side-effects: that an implicit conversion
from std::nullptr_t to bool is ill-formed (the conversion is explicit).
[1] https://devblogs.microsoft.com/cppblog/msvc-cpp20-and-the-std-cpp20-switch/
[2] https://developercommunity.visualstudio.com/t/Pre-define-a-macro-when-compiling-under/1253982?space=62&q=permissive-+sfinae&entry=myfeedback
[ChangeLog][Platform Specific Changes][Windows] When using MSVC
Qt now requires standards compliance mode. This requires passing
the /permissive- command line switch. Note that when using C++20 or
above, the /permissive- switch is implied by default.
Change-Id: I464ed36ff707fa3ada52c543433a6b0ab715748e
Reviewed-by: Kai Koehne <kai.koehne@qt.io>
Currently it is not possible to build unit tests for
Android in a developer build.
This patch fixes this.
Fixes: QTBUG-94882
Change-Id: I30ccacc4536032ee3a7fbf05ce90bbbcdb8331a6
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
This adds preview support in GTK file dialog implementation,
this is helpful for a lot of applications
like image viewers, messengers and etc.
[ChangeLog][Platform Specific Changes][Linux] A native GTK
file dialog (created via QFileDialog or QtQuick.Dialogs)
now shows an image preview pane.
Task-number: QTBUG-3796
Task-number: QTBUG-53167
Change-Id: Ib80108c09b84d774440a0445adcccab4b64652ef
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
Destroy the QDBusPendingCallWatcher object when received
the QDBusPendingCallWatcher::finished signal later.
Pick-to: 5.15 6.2
Change-Id: I1ec67bf7c286f38200c374ad92df2a1579588a8a
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Unix QThread implementation stores pthread_t as a system thread ID
when the thread is created, but never resets the system ID when
those threads are destroyed. Some implementations may reuse the
same thread IDs for new threads, and this may cause QThread::wait()
to erroneously complain that "Thread tried to wait on itself".
This patch sets the system thread ID to nullptr when the thread is
about to exit and be destroyed by the system.
A regression test is added to tst_qthread.
Fixes: QTBUG-96846
Pick-to: 5.15 6.2
Change-Id: I0850425dd0e09af50e59c9038e7e662a2a624beb
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
First, issue glMemoryBarrier() only if the read-after-write or
write-after-write occurs for a write involving incoherent memory
access. In practice this means a QRhiTexture with UsedWithLoadStore
or a QRhiBuffer used as an SSBO. Doing the barrier call for other
types of texture or buffers is pointless, and potentially
wasteful. What is more, some OpenGL implementations feature bugs that
manifest themselves when glMemoryBarrier() is called, see associated
Jira issue for details.
Second, reduce GL_ALL_BARRIER_BITS to the ones relevant for the type
of the resource, in an attempt to provide a minor optimization. Real
fine-grained resource usage tracking is not implemented for OpenGL so
this still means specifying all buffer-related or all texture-related
barriers together, but this is still better than all. As the usage of
compute is quite close to zero in Qt at the moment, this won't make
much of a difference in practice.
Fixes: QTBUG-96322
Pick-to: 6.2
Change-Id: Ibf794e2e8a4cbc3c69acaa88476e85de6646b605
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
Currently in QSpiApplicationAdaptor::eventFilter, the
ATSPI_MODIFIER_SHIFTLOCK flag (actually capslock modifier) only set
when the capslock key is kept pressed, not when the capslock modifier
is enabled.
Orca however really needs to know the capslock modifier state, to be
able to properly determine whether to enable/disable capslock when the
user presses double-capslock.
Task-number: QTBUG-84225
Pick-to: 6.2 5.15 5.12
Change-Id: I98ab8b7261c5560ebad49410b1358b2279080ec8
Reviewed-by: Liang Qi <liang.qi@qt.io>
Reviewed-by: Jan Arve Sæther <jan-arve.saether@qt.io>
QWidget::setParent might be called to change the window flags, without
changing the parent. For those cases, we don't have to clear the focus.
Decouple the newParent state from the wasCreated flag. In most places
where newParent was tested, wasCreated was either tested previously and
can't be false anyway, or the code executed is irrelevant for widgets
that are not yet created (there can't be a paint manager). In the
remaining case, test wasCreated explicitly to maintain existing logic.
Add test for the cases where the previous code broke the focus, both
for QWidget and QDialog.
Fixes: QTBUG-93005
Pick-to: 6.2
Change-Id: I39dc179c2d348054de3927aa8b69eecef4935511
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
Reviewed-by: Doris Verria <doris.verria@qt.io>
With the contents from src/jversion.h
Pick-to: 6.2 5.15 5.12
Change-Id: I3d4d2b40b3ed6576655b97b1709ee42c9c81ebe7
Reviewed-by: Kai Koehne <kai.koehne@qt.io>
Unlike the other conversion functions, convertWithPalette() did not
call copyMetadata().
Fixes: QTBUG-96926
Pick-to: 6.2 5.15
Change-Id: I2b171cec16bc5a90d33e80d6fe178c650ed3fe36
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
The thread ID is already initialized inside QThread::start() while
the thread lock is taken. This is completed before the attempted
initialization in QThreadPrivate::start() because it tries to take
the same lock.
Task-number: QTBUG-96846
Pick-to: 5.15 6.2
Change-Id: Ic9588f3e2e2f3c2180afbed8ec01155b33043eb3
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Using MS Gothic UI as the fallback on Japanese locale has been
outdated for many years. The default font on Japanese is Yu Gothic UI,
and this caused mismatches between Japanese text when using the
fallback and when just relying on the default.
[ChangeLog][Text] Made the primary fallback font on Japanese
locale "Yu Gothic UI" (the default system font).
Fixes: QTBUG-96689
Pick-to: 6.2
Change-Id: I9cf34410619ff4a2ceb9b03d523018c5061c3634
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
We allow QWidget::closeEvent to "delete this", and verify that this works
in the tst_QWidget::testDeletionInEventHandlers test function. Sadly,
that test didn't reliably catch the issue introduced in
28b14b966f, where the receiver is accessed
after the delivery of QEvent::Close.
Handle the QWindow event delivery explicitly so that we don't need to
access the receiver after the event has been delivered.
There's nothing we can do to make the test fail more reliably in CI.
A QWindow deleting itself in closeEvent will still crash; perhaps we don't
want to allow that anyway.
Change-Id: I2b5c2d11ded71c4f22ae9862cdc459e1f93b3374
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Introduce a new macro qt_internal_return_unless_building_tools which
simply calls return() if tools are not built. This macro is supposed to
be called after qt_internal_add_tool().
Using this macro avoids having to special-case code for when
qt_internal_add_tool() creates imported targets in cross-builds.
Adjust pro2cmake accordingly.
Task-number: QTBUG-85084
Change-Id: I9e1c455c29535dd8c318efa890ebd739c42effc1
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Task-number: QTBUG-96844
Change-Id: I9af60ef0cf3def699e58b3477b647f2e071afa40
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
Put stars after spaces, not before; indent cases level with switch.
Change-Id: I1dc29d0729d5be449b8123e15510177d814d42da
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
The compiler ought to figure them out, but we can just help it.
Change-Id: I42eb903a916645db9900fffd16a4981ac966f982
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@gmx.de>
The multi-state return code was a legacy of how Arvid wrote the ELF
parser code back in the day, the fact that it scanned for two different
types of plugins in Qt 4 and that the metadata could exist in different
places. None of that matters nowadays: who cares if the file is a
corrupt binary, not a valid binary, does not have the right
architecture, or has no suitable section? It's not a plugin, period.
The Qt 4 plugin mechanism was removed for Qt 5.0 in commit
7443895857 ("Remove support for Qt 4 style
plugins").
Change-Id: I42eb903a916645db9900fffd16a442d800399b98
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@gmx.de>
The Cocoa QPA plugin no longer tracks popups, but dispatches enter/leave
events when popups show and hide. So the special handling in tests and
QWidgetWindow can go away now.
Change-Id: Ib6ef00689de231996e5e57ecdd8fd0d4c861d68b
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
If we can't mmap(), then libdl won't be able to either.
Pick-to: 6.2
Change-Id: I42eb903a916645db9900fffd16a492a1ac25903f
Reviewed-by: Lars Knoll <lars.knoll@qt.io>