Commit Graph

38017 Commits

Author SHA1 Message Date
Lorn Potter
f677f62943 wasm: fix screen offset logic
Change-Id: Id71dfcba5d0bc1fe660a478db5f4c57e68468b4b
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
2021-05-27 21:45:02 +00:00
Mårten Nordheim
ec716dc1fd QNetworkInformation: Move android dependencies and perms to plugin
It was a necessary workaround at the time, but this has since been fixed

Task-number: QTBUG-90812
Change-Id: I8c0d5bf4c61d379736cd07a28c089c55d6befdee
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2021-05-27 23:45:01 +02:00
Volker Hilsheimer
a3f3af8a8f macOS: don't show invisible separator items
Give QCocoaMenu access to the item's visibility property by adding a
public getter, and respect that state when syncing the separator to the
corresponding QCocoaNSMenuItems.

Pick-to: 6.1 5.15
Fixes: QTBUG-88651
Change-Id: I7e238e5d3be141ec8f4e8f6f3ab22d761094d2d2
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
2021-05-27 22:18:32 +02:00
Janne Koskinen
b2e053072d Add explicit default constructor for QEglFSContext
Fixes Integrity compiler issue where it cannot find implicitly defined

Change-Id: I126333dd4b02b9b653b8e1ac5da07679b343c91f
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
Reviewed-by: Kimmo Ollila <kimmo.ollila@qt.io>
2021-05-27 18:37:15 +03:00
Giuseppe D'Angelo
606d72da17 QFuture: remove incorrect sentence from docs
QFuture shouldn't be passed by value: it's a reference counted
class ("shared future").

Change-Id: I3890062c45f9a6470b278223b88d482f57bf68a0
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Andrei Golubev <andrei.golubev@qt.io>
2021-05-27 17:18:20 +02:00
Volker Hilsheimer
7f543c6afa Fix qdoc warning after port to QProperty
As of 7b6cef0e65 the signal is a const
member function.

Change-Id: Ia5559904b7a47c9763863c73bb357d3d241307ea
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
2021-05-27 17:18:18 +02:00
Volker Hilsheimer
d7e478475e Fix qdoc warnings
Change-Id: Ie51ccff3272f078e062380033678828a01f03eb8
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
2021-05-27 17:18:18 +02:00
Volker Hilsheimer
5ac479f599 macOS: respect underline attribute in menu item fonts
When we draw menu item text with CoreText instead of QPainter, then we
need to translate QFont::underline() explicitly to an entry in the
attribute dictionary.

Task-number: QTBUG-73990
Pick-to: 6.1 5.15
Change-Id: I7e0c258f7cf80a89b29517fa8122576342654de1
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2021-05-27 16:53:09 +02:00
Andrei Golubev
6ac2b902d1 QList: do some minor cleanups in the internal code
Change-Id: I7e502e4d2fa5af94c20e7da62d1c06597b6b16a7
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2021-05-27 14:28:18 +02:00
Kai Köhne
fd9c2c8033 Silence warning C4996 (use of deprecated GetDesktopDpi)
Silences warnings

   warning C4996: 'ID2D1Factory::GetDesktopDpi': Deprecated. Use DisplayInformation::LogicalDpi for Windows Store Apps or GetDpiForWindow for desktop apps.

Using GetDpiForWindow sounds like the right approach, but it's not obvious
where to get the window handle from here.

Task-number: QTBUG-94043
Pick-to: 6.1
Change-Id: I2fc005e0c970c8338184f4500b876774ec9d976b
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
2021-05-27 14:28:18 +02:00
Alexey Edelev
19e789bace Implement propagation of object files to the end-point executable
This proposal collects all the resource objects to the qt-specific
property of the static libraries. This is done to avoid littering
of other static libraries and put resource object files to the
source part of the linker line when linking the end-point
executable.
The way we link object resource libraries is changed back to the
target_link_libraries approach as we may omit using finalizers
with linkers other than ld. Users may enforce finalizers by calling
the qt6_enable_resource_objects_finalizer_mode function if need.

Refactor tests related to the static resources.

Amends ddaa7150d8

Task-number: QTBUG-93002
Change-Id: I74135e291cd82fb54d1b284b4b4a1e002b1fef98
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2021-05-27 14:28:17 +02:00
Kai Köhne
029425478a Clarify that QLoggingCategory works independent of compiler build type
Also mention exception for internal categories starting with 'qt.'

Fixes: QTBUG-93852
Change-Id: Iff8657a31074ee70cba25f6acdccb5ba4b1d3b01
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2021-05-27 14:28:17 +02:00
Alexandru Croitor
a3c430f390 CMake: Revise plugin finalizer mode usage
Only use plugin finalizer mode if qt_finalize_target is called at the
end of the user project (which we can't really check, the user has to
ensure that) or when qt_finalize_target is automatically defer-called
by CMake 3.19+ (which is done by qt_add_executable).

This removes the previous behavior of using the finalizer mode if
qt_import_plugins is called. Instead the old regular mode is used
if the above preconditions are not met.

The removed behavior had ordering issues if qt_import_plugins was called
before target_link_libraries. The dependency walking would be done
before Qt dependencies were added and thus no plugins would be
linked.

Amends 6fcc272ac9

Task-number: QTBUG-80863
Task-number: QTBUG-92933
Task-number: QTBUG-94030
Change-Id: I78702b653a35596f5581c2f4282b2336f0124e60
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
2021-05-27 14:28:17 +02:00
Eskil Abrahamsen Blomfeldt
a5085d7f6a minor: Clean up areMetricsTooLarge() conditions
This amends e2bdff3555.

The linearAdvance property has some history. First it was
a 16 bit value (allowing for 10.6 fixed point numbers). Then
it was turned into 22 bits to fit the 16 bits of Freetype
integer parts into it (16.6). Then back to 10.6. Then in
b7e4367387 it was turned
back into 16.6 again. But this was accidentally reverted
as part of a bad conflict resolution in
afb326f071.

Since there was no check for it, we would sometimes overflow
the linearAdvance, but only in the rare cases where the
width and height did not also overflow. Specifically this
is the case for whitespace, which always has a width of 0
regardless of the advance.

This change just moves the linearAdvance condition in
together with the other checks to avoid fragmentation, and
also adds this fun story to the commit log.

Pick-to: 6.1 5.15
Change-Id: Iaac09942f4c50d1aced4a160b6eabb11eb8e6373
Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
2021-05-27 10:13:55 +02:00
Timur Pocheptsov
71d242c6d3 QSsl::ImplementedClass - add DtlsCookie
To report QDtlsClientVerifier implementation supported.

Change-Id: I23812396c0c6a9595769d8ddb9cc2f85cc636ecb
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2021-05-27 06:41:16 +02:00
Assam Boudjelthia
478ed8b71f Android: Add runOnMainAndroidThread() under QNativeInterface
This replaces QtAndroidPrivate::runOnAndroidThread{Sync} calls.
This also now allows passing std::function<> that can return values,
and not only an std::function<void()>.

This adds some tests for this calls as well.

Fixes: QTBUG-90501
Change-Id: I138d2aae64be17347f7ff712d8a86edb49ea8350
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2021-05-26 23:24:11 +00:00
Allan Sandfeld Jensen
da30e402f3 Add SIMD optimizations for color-transform writes
Add NEON for RGB32 and RGBA64 writeback, and SSE2 for
RGBA64 writeback.

Change-Id: Id9ee803267a78f5bdff5beaa719e7a59c1dbb9fb
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2021-05-27 00:18:04 +02:00
Allan Sandfeld Jensen
f3e7073f93 Add NEON optimizations to QColorTransform
And avoid some needless shuffling.

Change-Id: I5101eb0582c17f5e3cb6db8e20d315ef38bd1863
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2021-05-27 00:18:04 +02:00
Giuseppe D'Angelo
1a86bfa672 QNetworkManagerService: do not use a module-wide include
We don't need all of QtDBus + QtCore dragged in.

Change-Id: I99dd6b1a50587d8d520ec5240c5129b406e4f40d
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2021-05-26 22:07:57 +02:00
Alexandru Croitor
76e4b13e7c CMake: Fix finalizers not being run for android executables
Android executables are actually loadable modules, not executables.
Instead of checking for the target type if it's a MODULE, be explicit
and mark the target with a special qt property that we then use to
decide whether the finalizer should run.

Amends c4df673dd9

Change-Id: I5330d80d39488cfda6ebe07e2a1883200a796be8
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
2021-05-26 22:07:56 +02:00
Xiao YaoBing
135dbdb553 Partially modified to use C++11 standard nullptr
Change-Id: Ibfd76357ceb56b347afe7122fc252b866b21cb11
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2021-05-27 03:24:40 +08:00
Alexandru Croitor
6dd1b66517 CMake: Don't apply invalid infixes to INTERFACE libraries
And object libraries.

Setting properties like IMPORT_SUFFIX on them doesn't make sense and
can cause configuration issues.

Amends 1bd408d6f7

Change-Id: Ie91d1fbc7ba130816854d50c5b00ef793e4bad1f
Reviewed-by: Martin Storsjö <martin@martin.st>
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2021-05-26 20:37:21 +02:00
Allan Sandfeld Jensen
93cd9130d6 Introduce float QImage formats and rendering
Useful for some HDR representations and HDR rendering.

Change-Id: If6e8a661faa3d2afdf17b6ed4d8ff5c5b2aeb30e
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2021-05-26 18:00:01 +02:00
Edward Welbourne
451500f8f8 Check for overflow in QDateTime::setMSecsSinceEpoch()
When adding an offset from UTC, arithmetic may overflow.  Likewise
when combining a date and time (that have been offset for UTC).  Also
check the return from epochMSecsToLocalTime(), as it can fail; and pay
attention to the status stored by setDateTime(), to notice when it
hits an overflow. Fixed some tests that only passed because we
neglected these checks. Extended a test to check we detect overflow in
a couple of cases close to the extremes.

Change-Id: I127a670302f94a07bb9b087b1b9c608b7c08785c
Reviewed-by: Andrei Golubev <andrei.golubev@qt.io>
Reviewed-by: Øystein Heskestad <oystein.heskestad@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2021-05-26 18:00:01 +02:00
Edward Welbourne
fc6629b6bb Harmonize zoneMSecsToEpochMSecs() and localMSecsToEpochMSecs()
Now that the latter calls the former in its fall-back, this saves that
call the need to follow up with determining DST and abbreviation. This
also lets refreshZonedDateTime() update its DST guess for timezones as
well as for local time.

Change-Id: I820b65c1d6db78619defe2af5e947cb98ae336f0
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2021-05-26 18:00:01 +02:00
Edward Welbourne
35412acd88 Use time-zone transition data before 1970 as well as after
QDateTime has long followed a convention of ignoring what it knows
about time-zone transitions before the epoch. This produces unhelpful
artefacts (such as an ahistorical spring-forward skipping the first
hour of 1970 in Europe/London, which was in permanent DST at the time)
and complicates the code. It documented that DST transitions were
ignored, but in fact ignored all transitions prior to 1970 and simply
assumed that the current time-zone properties (half a century later)
applied to all times before 1970.

This appears to be based on the fact that the MS APIs using time_t all
limit their range to after 1970. Given that we have to resort to
"other means" to deal with times after the end of time_t, when it's
only 32-bit (and after year 3000, on MS systems), we have the means in
place to handle times outside the range supported by the system APIs,
so have no need to mimic this restriction. (Those means are not as
robust as we might want, but they are less bad than assuming that the
present zone properites were always in effect prior to 1970.) On
macOS, the time_t functions only reach back to the start of 1900; it
reaches to the end of its time_t range and Linux covers the whole
range. Given this variety, the range is now auto-detected the first
time it is needed (based on some quick and dirty heuristics).

Various CET-specific tests now need adjustments in tests of times
before the introduction of time-zones (when they are in fact on LMT,
not CET). The systemZone() test of QTimeZone can now restore its
pre-zone test cases. Various comments on tests needed updates.

[ChangeLog][QtCore][QDateTime] Available time-zone information is now
used to its full extent, where previously QDateTime used LocalTime's
current standard time for all dates before 1970. Where we have
time-zone information, it is considered reliable, so we use it.  This
changes the "best efforts" used for times outside the range supported
by the system APIs, in most cases giving less misleading results.

Fixes: QTBUG-80421
Change-Id: I7b1df7622dd9be244b0238ed9c08845fb5b32215
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2021-05-26 18:00:01 +02:00
Mårten Nordheim
9b5fadb9f8 Android: fix missing include
qtbase/include/QtCore/../../../../src/qtbase/src/corelib/kernel/qcoreapplication_platform.h:58:57: error: unknown type name 'QCoreApplication'
    QT_DECLARE_NATIVE_INTERFACE(QAndroidApplication, 1, QCoreApplication)

Change-Id: I0a14a2f2ab80f9cc0e7fd3b3060719a1c772bf57
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2021-05-26 13:28:44 +02:00
Andreas Buhr
7d760480c0 Initialize SYSTEMTIME to {} instead of memset()ing
Change-Id: I7ee02a6bcf5961adce26b635f12722e12c4865d3
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2021-05-26 13:08:09 +02:00
Paul Wicking
a1dfe27955 Doc: Use \deprecated instead of \obsolete
Task-number: QTBUG-93990
Change-Id: I4e512354a49dde6678ca89cabc56bc76ba666bb3
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2021-05-26 13:06:56 +02:00
Friedemann Kleint
ae02188233 QTestlib: Add formatting for QObject * in QCOMPARE
Output object name and class in QCOMPARE(). This should help
to debug flaky QWidget tests that for example check on focusWidget().

[ChangeLog][QtTestLib] QCOMPARE() now reports QObject * values by class and objectName().

Task-number: QTBUG-64446
Change-Id: Ife04e89bba04fc78d077c8f0f07af17a17c9cf8c
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2021-05-26 11:02:48 +00:00
Aleksei Nikiforov
25a7034d78 Qt xcb: remove false detects of Qt::GroupSwitchModifier
In some cases, if X11 is configured with CapsLock as
keyboard language switch key, and CapsLock is toggled
via Shift+CapsLock key combination,
toggled CapsLock is falsely detected as Qt::GroupSwitchModifier
for subsequent key events.

This change fixes this false detect,
but doesn't fix detection of Qt::GroupSwitchModifier
which is likely still broken.

Fixes: QTBUG-49771
Pick-to: 5.15 6.0 6.1
Change-Id: I485e2d4f3c654707c62adaba367c1b8afb3fc36c
Reviewed-by: Liang Qi <liang.qi@qt.io>
2021-05-26 11:02:08 +00:00
Giuseppe D'Angelo
4b60cea602 Farewell Q_DISABLE_MOVE
In hindsight, this macro is an API mistake, as it should NEVER be used
alone, but always in combination with Q_DISABLE_COPY. But in that case,
there's a better macro: Q_DISABLE_COPY_MOVE; hence this API is either
bad, or completely redundant.

A GitHub search reveals that luckily there's a handful of usages in the
wild (of which 0 in Qt/dev and KDE). Hence, I'm going for the kill, and
removing it entirely.

[ChangeLog][Source-Incompatible Changes][QtGlobal] The Q_DISABLE_MOVE
macro has been removed. Code that was using it can be ported to
Q_DISABLE_COPY_MOVE instead.

Change-Id: I7e346f7e2288f3f5a45315f4f6bfaeb2661f1de5
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Andrei Golubev <andrei.golubev@qt.io>
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2021-05-26 03:14:52 +02:00
Tor Arne Vestbø
f20edffcc8 testlib: Disable automatic backtrace when test crashes on macOS on ARM
The trick we use by spawning lldb to print the backtrace doesn't work
for some reason, and just results in:

    Process 91619 stopped
    * thread #1, stop reason = signal SIGSTOP
        frame #0: 0xffffffffffffffff
    Target 0: (No executable module.) stopped.

    Architecture set to: .
    (lldb) bt all
    * thread #1, stop reason = signal SIGSTOP
      frame #0: 0xffffffffffffffff
      thread #2
        frame #0: 0xffffffffffffffff
      thread #3
        frame #0: 0xffffffffffffffff
      thread #4
        frame #0: 0xffffffffffffffff

Debugging the stopped process manually with lldb works fine.

Change-Id: If5582803a11f1c5c84c31b42d1ae52bdd245bbbb
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2021-05-26 03:14:52 +02:00
Edward Welbourne
55765898fe Initialize SYSTEMTIME to {} instead of memset()ing
Change-Id: Ic17b90d10d6b5b7f4610e904e18979fc1d658a0a
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2021-05-25 22:55:14 +02:00
Fabian Kosmale
e16afd66fc gcc 11: Adjust pragma warning placement
Apparently, gcc's pragma warning logic has changed from 10 -> 11. For
gcc 11, we need to place the macro directly next to the the line which
triggers the warning.

Task-number: QTBUG-93360
Pick-to: 6.1
Change-Id: Ifaa6136050fe5b887660a8a0acf6938388f4f77d
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2021-05-25 22:54:55 +02:00
Alexandru Croitor
1bd408d6f7 CMake: Introduce a public qt_add_library function
Internally it uses a new _qt_internal_add_library function (similar
how we have qt_add_executable and _qt_internal_add_executable) as well
as finalizer code line the executable case.

_qt_internal_add_library forwards arguments to add_library with some
Qt specific adjustments to the selected default target type (based on
whether Qt is configured as static or shared).

The new _qt_internal_add_library is now used in qt_add_plugin as well
as some internal library creating functions like
qt_internal_add_module.

This reduces some duplication of file name adjustments across
functions and creates a central point for creation of Qt-like
libraries (for some definition of Qt-like).

Change-Id: Id9a31fe6bf278c8c3bb1e61e00a9febf7f1a2664
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2021-05-25 22:36:53 +02:00
Fabian Kosmale
5e96c64afb QSharedPointer: Use matching new/delete
When a weak pointer calls getAndRef and there is no strong reference
yet, getAndRef creates a new ExternalRefCountData. Normally,
ExternalRefCountData is never constructed directly, only its subclasses
are constructed via placement new into a memory buffer.
To that end, ExternalRefCountData has a custom operator delete, which
calls the global operator delete (do deallocate the memory buffer
correctly).
When using operator new directly in getAndRef, gcc notices a new/delete
mismatch with the delete in the same function: global operator new
matched with class operator delete. This isn't actually an issue in
practice, as the class operator delete simply calls the global delete.
But to avoid the warning, we can simply call the global operators
explicitly.
To make it clear that allocation of ExternalRefCountData requires some
care, we additionally delete the class operator new, and only allow
placement new (or usage of global operator new, as in getAndRef).

Pick-to: 6.1
Task-number: QTBUG-93360
Change-Id: I132d1e4e07520eadc5b8f3f955c06aecec80c646
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2021-05-25 22:23:57 +02:00
Andrey Butirsky
b45b9090c3 qxkbcommon: Map Super/Hyper to Meta early enough to have an effect
Super/Hyper keys are detected during a direct mapping phase, but the
function returned before the translation to Meta could take place.

Task-number: QTBUG-62102
Pick-to: 5.15 6.0 6.1
Change-Id: I9f7ccfd757fa86dbc648951306deb1b43ccf4167
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Reviewed-by: Andrey Butirsky <butirsky@gmail.com>
2021-05-25 20:02:12 +00:00
Friedemann Kleint
cb881f7c97 uic: Add further widgets to class lib map
It should be possible to use them with promotion.

Task-number: PYSIDE-1404
Change-Id: Idea0ab076c66d2842958eabf66e5dc4f8e1bad3f
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
2021-05-25 22:01:56 +02:00
Friedemann Kleint
4b82c1c727 uic: Extract a base class for WriteIncludes
Extract base class WriteIncludesBase from WriteIncludes which
basically adds the dependent classes.
Move the classlibmap there as well.

Task-number: PYSIDE-1404
Change-Id: I899c7818cb96dd3b1af5f328cd20d64fbaf7755b
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
Reviewed-by: Christian Tismer <tismer@stackless.com>
2021-05-25 22:01:53 +02:00
Andrey Butirsky
6ecde6265a qxkbcommon: Keep lower case as Qt key when upper case is not in Latin1
Upper-casing a Latin1 character might move it out of Latin1 range,
for example U+00B5 MICRO SIGN, which upper-case equivalent is
U+039C GREEK CAPITAL LETTER MU. If that's the case, then map the
original lower-case character.

Fixes: QTBUG-93858
Pick-to: 5.15 6.0 6.1
Change-Id: Ibd86fbb7c70d620c0884015ec1c40aa6351e6320
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Reviewed-by: Andrey Butirsky <butirsky@gmail.com>
2021-05-25 15:29:49 +00:00
Xiao YaoBing
6519bcf85d Remove unnecessary type conversion
Change-Id: Ic362f6647d8eaf2004d3bd5e1c6d6411cfb31d86
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2021-05-25 23:06:17 +08:00
Kimmo Ollila
95c6eb2f2e Add #include <mutex>
Needed for having std::unique_lock

Pick-to: 6.1
Change-Id: I3665e9e2afab0d9230778b8b36f2b7f0c8f44a2a
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2021-05-25 15:28:32 +03:00
Giuseppe D'Angelo
0c7e653ffd QDateTime(Parser): code tidies
Fixup a bunch of QFlags usage that ended up triggering implicit
conversions. These conversions happen because QDateTime tries to save
some space and shove a QFlags value in a bitfield, so there's
no way around them; use explicit conversions instead.

In other places: fix QFlags->bool conversions by using testAnyFlag.

Change-Id: I50e8d92ed829b64ac46097c09e547e1c89cc2e35
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2021-05-25 13:38:44 +02:00
Paul Wicking
3bc80defdc Doc: Add missing preposition
Fixes: QTBUG-93969
Pick-to: 6.1
Change-Id: I60e08ab7f17459b6cff969767273228a8406cfc3
Reviewed-by: Johanna Vanhatapio <johanna.vanhatapio@qt.io>
2021-05-25 12:36:09 +02:00
Pekka Gehör
32cdf0ce0f Android: Fix select handles misplacement on QDialog
Get select handles {Left, Right}Point from a mapToGlobal with a cursorRectangleof anchorRectangle
of the selected word/text.

Task-number: QTBUG-90799
Change-Id: I4fed19a1d3bb2247656b052306307e6980074405
Reviewed-by: Rami Potinkara <rami.potinkara@qt.io>
Reviewed-by: Ville Voutilainen <ville.voutilainen@qt.io>
2021-05-25 08:45:39 +03:00
Janne Koskinen
bd31bb4166 Fix compilation for other compilers
Fixes property offset macro compilation issues.

Change-Id: I401a9a35acd1d389c670960edb363a4d919cdb76
Reviewed-by: Kimmo Ollila <kimmo.ollila@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2021-05-24 10:18:25 +03:00
Giuseppe D'Angelo
0fecaaec54 QUrl: use QFlags::toInt / qToUnderlying
In preparation for blocking QFlags->int conversions. The existing
casts to uint are wrong, in the general case, as the enumeration
might actually be backed by signed integers; that makes them
fail to compile. Port them to toInt(). For symmetry, also use
qToUnderlying.

Change-Id: I851544f6ba05295fa5f6c5cc355b9de0f1362e2b
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2021-05-23 21:54:29 +02:00
Thiago Macieira
64bfc927b0 QHash: fix qHash(std::pair)
There were two problems here: first, qHash(std::pair) must be declared
before qHashMulti that might call back to qHash(std::pair) (i.e., a pair
with one element that is also a pair). But moving the declaration above
causes the second problem: the noexcept expression can't refer to qHash
functions that aren't declared yet. So we forward-declare a constexpr
function for that result, but implement it far below.

Fixes: QTBUG-92910
Change-Id: Ia8e48103a54446509e3bfffd16767ed2e29b026c
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2021-05-23 12:08:43 -07:00
Thiago Macieira
a5ff71578d QRandomGenerator: let qt_initial_random_value() return 128 bits of data
It's how much there is in Linux's AT_RANDOM block.

I've also removed the check for validity. It's highly unlikely that 128
bits are bad.

Change-Id: Id2983978ad544ff79911fffd16723161ea7ec315
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
2021-05-23 12:08:43 -07:00