Commit Graph

60056 Commits

Author SHA1 Message Date
Volker Hilsheimer
55f2b448b0 Turn elidedlabel example into a code snippet
The example is 90% boiler plate for subclassing QFrame and providing
a bit of GUI to change the size of the label using sliders. The
interesting bit is a block of 25 lines of code, so turn those into a
snippet and add that to the QTextLayout overview documentation.

Fixes: QTBUG-111011
Pick-to: 6.5
Change-Id: I6e97b2ea47b553c8d998ad185cfac006721ef7ee
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
2023-02-09 00:23:33 +01:00
Amir Masoud Abdol
31518f1a4e Add some utilities for UNITY_BUILD
- The following commands accepts NO_UNITY_BUILD, and
  NO_UNITY_BUILD_SOURCES arguments to opt out of the unity build, and
  to exclude some source files from unity build, respectively.
  - qt_internal_add_executable
  - qt_internal_add_module
  - qt_internal_add_plugin
  - qt_internal_add_tool
  - qt_internal_extend_target
  - qt_internal_add_common_qt_library_helper
  - qt_internal_add_cmake_library
  - qt_internal_add_simd_part
- Unity build is disabled by default in these:
  - qt_internal_add_test
  - qt_internal_add_test_helper
  - qt_internal_add_benchmark
  - qt_internal_add_3rdparty_library
- qt_update_ignore_pch_source also excludes the files from unity_build

Pick-to: 6.5
Task-number: QTBUG-109394
Change-Id: I5d0e7df633738310a015142a6c73fbb78b6c3467
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2023-02-08 23:47:07 +01:00
Christian Ehrlicher
66a1a71f1f Fix QVariant(QString) <-> enum conversion
A QVariant(QString) was not convertible to an enum not registered with
Q_ENUM() which worked fine in Qt5.
The same problem exists for QVariant(enum) to QString.
Fix it by not bailing out when no metatype for the enum was found and
try to convert it to a qlonglong instead (which is then correctly
converted to the enum type).

Fixes: QTBUG-109744
Pick-to: 6.5 6.4
Change-Id: Ie7bb016a860455b69508f0f46b36474c9c294f3a
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2023-02-08 23:20:42 +01:00
Christian Ehrlicher
e30ed4d431 SQL/DB2: apply misc changes
Similar to the ODBC changes from 901c86032c

Change-Id: I552b2e43d380080bfac62d61b0e27ba42d13024d
Reviewed-by: Andy Shaw <andy.shaw@qt.io>
2023-02-08 23:20:42 +01:00
Dennis Oberst
7cbdc8abbd QVarLengthArray: add STL-style assign()
Implemented assign() methods for QVarLengthArray to align
with the criteria of std::vector, addressing the previously
missing functionality.

Reference:
https://en.cppreference.com/w/cpp/container/vector/assign

[ChangeLog][QtCore][QVarLengthArray] Added assign().

Fixes: QTBUG-106200
Change-Id: If671069808ff561b0f4c77b6c7f7aca360a0c663
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
2023-02-08 21:13:08 +01:00
Friedemann Kleint
65cda1f06a QtGui: Add a header declaring the Windows image conversion functions
The declarations with default parameters cause
conflicts in CMake Unity (Jumbo) builds.

Pick-to: 6.5
Task-number: QTBUG-109394
Change-Id: Icf48193498d70dfacadf1b2499cb3359169f72c0
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2023-02-08 21:13:08 +01:00
Mårten Nordheim
eb585d63ca Move qHash function for a Windows type into global namespace
Otherwise leads to QHash being unable to find it upon usage:
qtbase/src/corelib/tools/qhash.h(64): error C2338: static_assert failed: 'The key type must have a qHash overload or a std::hash specialization'
qtbase/src/corelib/tools/qhash.h(665): note: see reference to function template instantiation 'size_t qt::QHashPrivate::calculateHash<D3D12_SAMPLER_DESC>(const T &,size_t)' being compiled

Since we rely on ADL for qHash the qHash overload should live in the
same scope as the original type.

Change-Id: I701447c49076980a1aed47d64ba8ac3358cf8b1c
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
2023-02-08 20:07:41 +01:00
Mikolaj Boc
a1867208a6 wasm: Don't grab menu bar item shortcuts on Mac
On Mac there's no concept of menu bar alt+key shortcuts. Therefore we
cannot expect users on Mac, even when in a web application, to be
familiar with those. Additionally, alt+key combinations yield special
characters on Mac so that is the behavior we should support in WASM apps
on Mac.

To disable the menu bar item shortcuts, a new platform style hint
UnderlineShortcut was created. Shortcut grabbing was disabled exactly
the same as on regular Mac builds, i.e. through
qt_set_sequence_auto_mnemonic.

Task-number: QTBUG-76587
Change-Id: Ice6ed123c01e46b58d6d2c3e639813161b5a9a40
Reviewed-by: Mikołaj Boc <Mikolaj.Boc@qt.io>
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
2023-02-08 20:07:40 +01:00
Volker Hilsheimer
d3dfe5a3b7 Silence some qdoc warnings
\internal needs to be on its own line, otherwise qdoc doesn't know what
\a means.

Pick-to: 6.5
Change-Id: Ie7bd2fd779540b8d7ea92f9d1dd94e73a771d2b6
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
2023-02-08 20:07:40 +01:00
Marc Mutz
ac6e8b3b21 savegame ex.: fix include order [2/2]: game.h
Includes should be ordered from most specific to most general. This
means that project-specific includes always come before Qt includes.

This example didn't follow that guideline. Fix.

Amends 88e8094f18.

Task-number: QTBUG-108857
Pick-to: 6.5 6.4 6.2 5.15
Change-Id: Iafdae9dd8e70ff99882c4344a023a21d15fa3c54
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2023-02-08 18:24:17 +01:00
Marc Mutz
fa55d46e1f savegame ex.: make Level ctor explicit
A QString is not a full representation of a Level, so the
Level(QString) ctor should be explicit.

Pick-to: 6.5 6.4 6.2 5.15
Task-number: QTBUG-108857
Change-Id: I24b705139e61c4aaf59cb0aad3b536013e0d07df
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2023-02-08 18:24:16 +01:00
Fabian Kosmale
d926490c80 QProperty: Remove recursive notify logic
Grouped property updates have been ported to make use of the
non-recursive variant, and thus the last remaining user of recursive
notify() is gone.

Change-Id: I617db0dedc66555152a9b43514d9d8658d528f2c
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
2023-02-08 16:54:26 +01:00
Fabian Kosmale
7a415a051a Avoid accessing deleted binding data in grouped updates
This fixes a use-after-free in QPropertyDelayedNotifications::notify.

Before this patch, evaluateBindings or a notify from a property index
might have caused the originalBindingData to become reallocated.
However, at that point, we've already restored the original bindingData
in evaluateBindings, so we won't track updates, and thus won't adjust
originalBindingStatus, which will then point to already freed data.

To remedy this, we no longer do the notification with data fetched from
originalBindingData, but instead use the information we have in the
proxyData.
We also need to enure that referenced bindings do not get deleted; for
that we keep the PendingBindingObserverList alive for the whole duration
of the endPropertyUpdateGroup.

As we now have the PendingBindingObserverList, we use it for the
notification logic, and only notify change handlers in
QPropertyDelayedNotifications::notify. That will allow a follow-up
cleanup of QPropertyObserverPointer::notify, and aligns the logic for
grouped updates with the logic for "nornal", non-grouped updates.

Amends f1b1773d0a.

Task-number: QTBUG-110899
Pick-to: 6.5 6.4 6.2
Change-Id: Iae826e620d9614b7df39d86d8a28c48c8a5c4881
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2023-02-08 16:54:26 +01:00
Fabian Kosmale
f69bcf8d80 Deprecate QPropertyAlias
That use case for the class never materialized, and it was actually
meant for internal use. However, we put it into the public header, so
we cannot remove it (and while undocumented, someone actually used it at
some point, compare e4d62651c2).

Mark it as deprecated instead so that it can be finally be removed in Qt
7.

Change-Id: I058c5831a44610121fbec6eaddebd8b33d4a16c9
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
2023-02-08 16:54:25 +01:00
Volker Hilsheimer
1dc5e20c16 Clean up QUtiMimeConverter API
Based on header review comments, make the internal constructor private
and declare classes that need it as friends.

QFlag-ify the HandlerScope enum, as it is a list of flags, and adjust
code accordingly.

Pick-to: 6.5
Change-Id: I1d8843265e49e696d463e9eea8306f4dbae75c78
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2023-02-08 14:53:43 +01:00
Mate Barany
84f0596c0c Avoid potential data races caused by qt_ntfs_permission_lookup
qt_ntfs_permission_lookup is a global, non-atomic variable which
could cause problems in case of multiple threads. Introduce a
new atomic variable to handle permission lookups but instead of
manual incrementation/decrementation, implement a class to manage
the variable.

Since the atomic variable is not directly available to the user,
implement helper functions to increase/decrease/check the status
of the variable.

Task-number: QTBUG-105804
Change-Id: If6cbcdd653c7f50ad9853a5c309e24fdeb520788
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
2023-02-08 12:59:19 +01:00
Alexey Edelev
214c3a033a Add simple project generation based on existing source files
Introduce the qt-cmake-create script. The script generates the simple
CMakeLists.txt based on the source files located in the current or
specified directory. The initial version can generate a CMake code for
the following file types:
  - .c .cc .cpp .cxx .h .hh .hxx .hpp - generates the qt_add_executable
    call with prerequisites.
  - .qml .js .mjs - generates the qt_add_qml_module call with
    prerequisites.
  - .ui - adds the found ui files to the existing executable. Requires
    C++ files be present in the directory too.
  - .qrc - generates the qt_add_resources call and adds the resources
    to the existing executable. Requires C++ files be present in the
    directory too.
  - .proto - generates qt_add_protobuf call with prerequisites.

The QtInitProject.cmake script contains the 'handle_type' function that
allows extending the script capabilities and establish simple relation
chains between the file types.

Note: The initial implementation doesn't deal with sub-directories, so
all files from sub-directories will be added to and handled in the
top-level CMakeLists.txt file. This can be extended by user request.

Task-number: QTBUG-104388
Change-Id: I5abd9e07da109e867ff95986572ed2bf02ef9d3d
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2023-02-08 12:59:19 +01:00
Paul Olav Tvete
52150469a8 Resurrect wiggly example as a manual test
In addition to being an iconic part of Qt's history, wiggly is also
widely used for verifying on embedded hardware.

Change-Id: Ica86626d98ade2570eebe787860293380c21f96a
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Jan Arve Sæther <jan-arve.saether@qt.io>
2023-02-08 09:35:56 +01:00
Laszlo Agocs
8f1d8139c4 Avoid glDrawBuffers on ES 2.0 / WebGL 1
Fixes: QTBUG-111007
Pick-to: 6.5
Change-Id: If1d84df56ad47ac89ea43ad5091392416fe9fc5f
Reviewed-by: Christian Strømme <christian.stromme@qt.io>
2023-02-08 09:30:21 +01:00
Marc Mutz
4493334393 savegame ex.: use ranged instead of indexed loops
Modernizes the code, and fixes qsizetype/int mismatch.

Task-number: QTBUG-108857
Pick-to: 6.5 6.4 6.2
Change-Id: Id4262ee0bcb673d62135a81c30976903eef3e5e2
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2023-02-08 08:37:21 +01:00
Marc Mutz
35b94f8b43 savegame ex.: use NSDMI, =default the default ctor
Modernizes the code.

Task-number: QTBUG-108857
Pick-to: 6.5 6.4 6.2 5.15
Change-Id: I6ddf1de3699506ffc0fc4b1034ab48defafcf174
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2023-02-08 08:37:21 +01:00
Marc Mutz
88e8094f18 savegame ex.: fix include order
Includes should be ordered from most specific to most general. This
means that project-specific includes always come before Qt includes.

This example didn't follow that guideline. Fix.

Task-number: QTBUG-108857
Pick-to: 6.5 6.4 6.2 5.15
Change-Id: I42727ff8bdef5336368cde349cbcb8d10bb6289f
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2023-02-08 08:37:21 +01:00
Marc Mutz
06a9b85f8f savegame ex.: fix extra ';' after Q_GADGET
Fixes compiler warnings.

Amends 1ff52e478b.

Task-number: QTBUG-108857
Pick-to: 6.5 6.4 6.2 5.15
Change-Id: Id8b81c67e55baf490aabd0483b5800b3e61965ee
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2023-02-08 08:37:21 +01:00
Marc Mutz
ee1bd7decd Qt::Appearance: don't assign values to enumerators
The compiler does that for us. This makes the enum look like an enum
again. A non-flags enum shouldn't have intializers of the form 0xNNNN,
as that makes it looks like flags.

Found in API review.

Pick-to: 6.5
Change-Id: If49e94cdad719b7dc9e8a7b17f6883dc789e62d6
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2023-02-08 08:37:21 +01:00
Yuhang Zhao
c3455ded49 Windows QPA: Rework how we activate the window
The new implementation has the following advantages compared to
the old one:

0. Qt's default activation behavior is not changed, this patch only
   improves how we forcely activate the window.
1. Account for the special case that the foreground window maybe hangs.
2. Truly bring the window to front if the window is hidden or minimized.
3. Use early return to save many indentation.

Change-Id: If51ad943fbc9771ebdddfa0e49732b12566ca2b6
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
2023-02-08 13:09:03 +08:00
Giuseppe D'Angelo
13a8414696 Deprecate QTypeInfo::isPointer and isIntegral
They're completely superseded by standard traits, and there are no more
users in-tree. I'm not hiding them behind a QT_DEPRECATED_SINCE,
because these are private APIs, so there's no source compatibility
guarantees here. I'm also using [[deprecated]] directly to avoid
an extra inclusion after the QtGlobal split.

Change-Id: If649e52ffe51c5eba1c51da25b6fe0621a0b17b3
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2023-02-08 01:37:07 +01:00
Thiago Macieira
b41c44d966 qdbusxml2cpp: don't emit Q_DECL_DEPRECATED for the adaptor
The adaptor is a server-side implementation that must exist anyway and
is called by the QtDBus runtime. We don't want warning on the server
side because it must call those methods to implement the client API.

Since we have the XML introspection saved in a class property anyway,
the runtime won't be inspecting the method tags to see if
Q_DECL_DEPRECATED is there, to add to the XML (which it isn't
generating).

Pick-to: 6.5
Change-Id: I9671dee8ceb64aa9b9cafffd17416596135d26ca
Reviewed-by: David Faure <david.faure@kdab.com>
2023-02-07 16:32:23 -08:00
Thiago Macieira
f67b32e735 qdbusxml2cpp: invert Q_DECL_DEPRECATED and inline in the output
Commit 93dad2bf91 (6.0) changed
Q_DECL_DEPRECATED to use the [[deprecated]] attribute, which must appear
before inline and other keywords.

To keep it next to Q_NOREPLY, I also moved the "inline" into the next
string.

Added missing tests for both.

Pick-to: 6.2 6.4 6.5
Fixes: QTBUG-110979
Change-Id: I9671dee8ceb64aa9b9cafffd1741656e86f40453
Reviewed-by: David Faure <david.faure@kdab.com>
2023-02-07 16:32:22 -08:00
Thiago Macieira
0128c3742e tst_qdbusxml2cpp: test the old-style QDBusReply interface output too
Pick-to: 6.2 6.4 6.5
Change-Id: I9671dee8ceb64aa9b9cafffd17416487c07f148a
Reviewed-by: David Faure <david.faure@kdab.com>
2023-02-07 16:32:21 -08:00
Tor Arne Vestbø
bac93ce5eb macOS: Skip deployment target runtime check when detecting compat version
When the main executable is built with a pre-macOS 11 SDK, the macOS
kernel and system libraries will enable a compatibility mode for
reporting the system version, reporting 10.16 instead of 11/12/13 etc.

This happens at at such a low level that even manually reading the
version from /System/Library/CoreServices/SystemVersion.plist is
intercepted.

Working around this by temporarily setting the SYSTEM_VERSION_COMPAT
environment variable is unfortunately not possible, as it's only read
on process creation/initialization.

The same goes for the kern.system_version_compat sysctl, as once it's
set it can not be changed back to its original value, and it's not
clear whether this sysctl should even be touched.

As long as we have no reliable way of reading the actual current
operating system version, we need to bail out of the deployment
target verification, to avoid false negatives where a plugin or
library, built with a deployment target of say 11.0, is loaded
into an application built with a pre-11.0 SDK, but running on
macOS 11+.

Pick-to: 6.5 6.4 6.2 5.15
Change-Id: I9c757a276726175c5dda694ffc1b88f1681d00fb
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
2023-02-07 23:13:55 +00:00
Tor Arne Vestbø
a3697f2b84 permissions: Replace deprecated location permission usage key
And add the macOS specific key.

Pick-to: 6.5
Change-Id: I1e0446a1927ef530322388417b9300ae287752c3
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Reviewed-by: Juha Vuolle <juha.vuolle@qt.io>
2023-02-08 00:13:55 +01:00
Fabian Kosmale
55ca636180 Fix proxy-data handling
This addresses two different issues:
- Firstly, we were casting the resolved binding data pointer to
  QPropertyProxyBindingData, instead of the d_ptr of
  QPropertyBindingData. Fix this by introducing a helper function,
  and consistently using it to access the proxy data.
- Secondly, we were not resetting the originalBindingData when the
  pointed to object was destoyed. Fix that, too.

Pick-to: 6.5 6.4 6.2
Task-number: QTBUG-110899
Change-Id: I7691c9df5cc26e761f6b0e5f16d152f7f2183208
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
2023-02-07 22:27:37 +01:00
Christian Ehrlicher
efce30bb43 ODBC/SQL: Fix usage of SQLGetData
SQLGetData was called with a nullptr for the output buffer to determine
the buffer length which is not allowed. Fix it by passing a valid buffer
with a buffer size of 0.

Fixes: QTBUG-70362
Fixes: QTBUG-110803
Change-Id: I4d547383100714901a4e2ca3b4777326cfab12fe
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2023-02-07 22:27:37 +01:00
Christian Ehrlicher
a53fe60a92 SQL/ODBC: optimize QVarLengthArray usage
Optimize the QVarLengthArray usage by passing the prealloc size and
directly initializing the allocated memory instead using a memset
where needed.

Change-Id: I61c6f9387fae63ae0c62ee1e87d3b3a7430369b7
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2023-02-07 22:27:37 +01:00
Christian Ehrlicher
6b58a40d32 SQL/ODBC: misc cleanup for fromSQLTCHAR()
Change fromSQLTCHAR() to honor the fact that we know the size of
SQLTCHAR during compile time.

Change-Id: I1cebf2550be7228980083703e143c7577e8ad377
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2023-02-07 22:27:37 +01:00
Albert Astals Cid
d619a952cd dbus: Register QDBusObjectPath
Fixes: QTBUG-108822
Pick-to: 6.2 6.4 6.5
Change-Id: Ib6d1a9cfc449df80cb7e5ad6211b07bdfd556093
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2023-02-07 21:15:18 +00:00
Amir Masoud Abdol
60c8a68746 Retrieve an old -redo behavior
It is not possible to manually edit the `config.opt` and do a redo, and
`configure/` uses the `config.opt` in this case.

Task-number: QTBUG-108287
Change-Id: I3d87b13a900b97fb50e49a4f155bec964ecb5d1a
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2023-02-07 18:51:58 +00:00
Amir Masoud Abdol
04a3e411ec Rename Qt CMake policies argument names
We decided to go with REQUIRES/SUPPORTS_UP_TO.

Pick-to: 6.5
Task-number: QTBUG-96233
Change-Id: Ia82d22618d31c06b5260a632ba079eeba7a506e0
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2023-02-07 19:05:12 +01:00
Ahmad Samir
27db859c6a Use QtMiscUtils hex/oct-related helpers
Thanks to Thiago for pointing them out in review.

Change-Id: I14d588a8bd5ba29d43a5daeacfd55d974eb65557
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2023-02-07 20:04:11 +02:00
Ahmad Samir
498f345228 QtMiscUtils: add some more character helpers
isHexDigit, isOctalDigit, isAsciiDigit, isAsciiLower, isAsciiUpper,
isAsciiLetterOrNumber.

This de-duplicates some code through out.

Rename two local lambdas that were called "isAsciiLetterOrNumber" to not
conflict with the method in QtMiscUtils.

Change-Id: I5b631f95b9f109136d19515f7e20b8e2fbca3d43
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2023-02-07 20:04:11 +02:00
Mate Barany
9a8b9473d5 Update CLDR to v42
New languages (and one local for each) added with v42
- Haryanvi
- Moksha
- Northern Frisian
- Obolo
- Pijin
- Rajasthani
- Toki Pona

It also appears that Canada has changed its date format. Modify the
relevant test case to reflect this change.

Task-number: QTBUG-110333
Pick-to: 6.5
Change-Id: Ia8975c2866cd54c9e565543d05bacd52f4987909
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2023-02-07 19:04:11 +01:00
Topi Reinio
275d510ce3 Doc: Update copyright year in the template
Pick-to: 6.2 6.4 6.5
Fixes: QTBUG-110271
Change-Id: I70ce5356941d2499a219ab9fb1875df23acda3dc
Reviewed-by: Venugopal Shivashankar <Venugopal.Shivashankar@qt.io>
2023-02-07 18:04:11 +00:00
Tor Arne Vestbø
364c462d80 macOS: Reduce verboseness of NSUserNotification deprecations
Task-number: QTBUG-110998
Pick-to: 6.5
Change-Id: I8fe252a9f6798e38f77c96b715f334427ffd062e
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
2023-02-07 19:04:10 +01:00
Pino Toscano
eeb66b99df Add/enable Alpha detection
- uncomment the Alpha detection defining Q_PROCESSOR_ALPHA, which is
  already used/documented in few places
- set the right machine type in QElfParser for Alpha ELF files

Pick-to: 6.5
Change-Id: I072bdee8b73ad3c86591c764aa7075c114967fd9
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Lisandro Damián Nicanor Pérez Meyer <perezmeyer@gmail.com>
2023-02-07 18:00:00 +00:00
Yuhang Zhao
07c234ae0b Windows QPA: make one function static
It doesn't use any non-static functions or variables, so it can be
static, and a function that sets a process's DPI awareness mode
doesn't need to be non-static anyway.

Change-Id: I4cc6e0f423b6cd4cf43d8afed86f26b5d04e3605
Reviewed-by: Timothée Keller <timothee.keller@qt.io>
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
2023-02-08 01:59:59 +08:00
Yuhang Zhao
c53c292c1b Windows QPA: fix debug message
Before applying this patch, the debug message will contain new lines
which will look rather weired, this patch fixes that.

Amends commit 5e0d9a077d

Change-Id: I2420c04dd7e18a6556664a05ac4ef35c9b652f0c
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
2023-02-08 01:59:59 +08:00
Yuhang Zhao
ad7227ada1 Use qt_winrtbase_p.h workaround in more places
This patch addresses the following issues:
(1) some places are still using the original workaround, replace
them with the new qt_winrtbase_p.h workaround.
(2) add more comment to let people know how to workaround other
cppwinrt issues (it was a common issue for many years and may be
fixed upstream recently, but let's at least document it in case
the user is still using old version cppwinrt).

Amends commit b2c1237b45

Pick-to: 6.5 6.4
Change-Id: Ife676f41739bbe69d9fb23bf5758be4b1fab4855
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
2023-02-07 17:59:59 +00:00
Mikolaj Boc
d141d68949 Transfer the key handling logic to QWasmWindow
Also, use the embind approach as the rest of the events do, and
introduce a KeyEvent class which simplifies and streamlines event
support.

The event translator has been given a more specific function of
just handling the dead keys. Rest of the translation functionality
is coded directly in KeyEvent for more encapsulation.

Change-Id: I11b0262fc42fe920206ecc6de0d434b9d9ab9998
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
2023-02-07 18:59:59 +01:00
Giuseppe D'Angelo
62be4ab5be XCB: simplify atom registration code
There's no need of calculating offsets into the \0-separated string
of atom names; since we're going to iterate that string exactly once,
do that, and register the corresponding atom name as we iterate.

(This means that solutions that calculate the offsets at compile-time,
like qOffsetStringArray, are also overkill for the use case).

Change-Id: I71ed512dee4f2a8bfb99ca2392efbd8a07f2a7c1
Reviewed-by: JiDe Zhang <zhangjide@uniontech.com>
Reviewed-by: Liang Qi <liang.qi@qt.io>
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
2023-02-07 18:59:59 +01:00
Giuseppe D'Angelo
3d72e8829f XCB: do not use reserved identifiers
Any identifier starting with underscore followed by a capital letter is
reserved for the implementation in C++, so don't use them. Rename the
entries in the Atom enumeration by adding an "Atom" prefix to them.

Pick-to: 6.2 6.4 6.5
Change-Id: I059e2093149f39cc9324cd1159c0d9e076eda93a
Reviewed-by: JiDe Zhang <zhangjide@uniontech.com>
Reviewed-by: Liang Qi <liang.qi@qt.io>
2023-02-07 18:59:58 +01:00