Commit Graph

50553 Commits

Author SHA1 Message Date
Jan Grulich
acaabc9108 FileChooser portal: send window id in hex
We send window id in decimal, however, it is expected to be send in hex.
This causes a mismatch and makes portal dialog to show in background.

Pick-to: 5.15 6.0 6.1
Change-Id: Ibd77199bbb4a2ad4782a0457ddc5506c6b5608fe
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2021-03-08 20:05:19 +01:00
Qiang Li
d2d957ff67 Merge "Fix the crashes when animated QTreeWidgetItems are hidden" 2021-03-08 14:38:56 +00:00
Qiang Li
f140ef04a0 Fix the crashes when animated QTreeWidgetItems are hidden
QTreeView's drawTree implementation performs lazy layouting
when calling itemDecorationAt. If animations are enabled,
this can change the list of items, and invalidate the copy
made earlier.

Don't copy the list of items, use a reference instead so that
code iterating over the items later operates on valid data.

Add an assert in the private itemHeight method, it must not
be called with an index that is out of bounds.

Fixes: QTBUG-42469
Pick-to: 6.0 6.1 5.15
Change-Id: Ifdb782881447912e00baffd1c407de10a1d8d0d4
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2021-03-08 12:31:13 +00:00
Christian Ehrlicher
1df974590f QSql/MariaDB/MySQL: misc cleanup
Cleanup the mariadb driver a little bit:
 - use nullptr instead NULL
 - use unsigned long instead int for blob handling now that QByteArray
   can handle more than 2^31 bytes

Change-Id: I79639a42a739aabdf776cc688cb5d664248aa610
Reviewed-by: Andy Shaw <andy.shaw@qt.io>
2021-03-08 12:44:40 +01:00
Morten Johan Sørvig
6e899f8e8c Merge "Add deviceIndependentSize() to QPixmap and QImage" 2021-03-08 10:52:24 +00:00
Morten Johan Sørvig
1471f2ae09 Add deviceIndependentSize() to QPixmap and QImage
This function returns the size in device independent
pixels, and should be used when calculating user
interface sizes.


Change-Id: I528123f962595a3da42438ca560289a29aca4917
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2021-03-08 08:27:41 +00:00
Piotr Mikolajczyk
bacf9cd04c Android: Add grabWindow handling
Draws to a pixmap contents of the requested window. On Android it works
only for QtWidgets application.

Qml application contents could not be grabbed due to lack of access to
the contents of OpenGL framebuffer from QAndroidPlatformScreen

Fixes: QTBUG-63275
Pick-to: 5.15
Change-Id: Ief7de1b709387d798138387bb735f4b48cf2928d
Reviewed-by: Ville Voutilainen <ville.voutilainen@qt.io>
2021-03-08 08:00:18 +00:00
Nick Shaforostoff
4f37cf2ce5 string 16<->8 bits conversion: SIMD on arm32
this adds emulation for 2 NEON commands that armv7 lacks
this increases conversion speed by around 50% in my simple tests

Change-Id: I4f52d353184e9a8d88089de60e17bd5670637c0c
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
2021-03-08 00:31:23 +01:00
Thiago Macieira
d58d0bb970 Merge "QNetworkInterface/Unix: fix DNS eligibility of global addresses" 2021-03-06 00:05:35 +00:00
Joerg Bornemann
84d89dec2b Merge "Add QT_CONFIGURE_RUNNING variable for configure.cmake files" 2021-03-05 23:38:11 +00:00
Thiago Macieira
83876c0256 QNetworkInterface/Unix: fix DNS eligibility of global addresses
[ChangeLog][QtNetwork][QNetworkInterface] Fixed the reporting the "DNS
eligibility" factor (QNetworkAddressEntry::dnsEligibility) for global IP
addresses. Previously, QNetworkInterface interface erroneously reported
all global addresses as eligible, regardless of whether they had already
been deprecated by the OS or were temporary in the first place.

From the tst_QNetworkInterface::dump output (netmask & broadcast
suppressed for readability, IPv6 prefixes changed to protect the
innocent, but the local part is exactly as found on my system):

   address  0: 192.168.26.33/24  dns-eligible preferred:33546998ms valid:33546998ms
   address  1: 2001:db8::800/128  dns-eligible preferred:264817000ms valid:264817000ms
   address  2: fd00::800/128  dns-eligible preferred:forever valid:forever
   address  3: 2001:db8::2f5b:342c:fc53:b9b2/64  dns-ineligible preferred:12422000ms valid:264817000ms
   address  4: fd00::9351:adff:333d:5c8d/64  dns-ineligible preferred:12421999ms valid:531402999ms
   address  5: fd00::7297:9516:fbb4:17ac/64  dns-ineligible preferred:0ms valid:445585999ms
   address  6: fd00::fdc8:e620:691:3b44/64  dns-eligible preferred:forever valid:forever
   address  7: 2001:db8::ae82:a01:5a8a:e210/64  dns-ineligible preferred:0ms valid:264816999ms
   address  8: 2001:db8::c673:e0a2:8927:2118/64  dns-eligible preferred:264816999ms valid:264816999ms
   address  9: fe80::bd89:b998:4aeb:a5d0%bond0/64  dns-ineligible preferred:forever valid:forever

Prior to this commit, only address 9 was showing as ineligible.

Addresses 1 and 2 come from DHCPv6 and are thus always eligible.
Addresses 3, 4, 5, and 7 are temporary addresses added on account of
RFC 4941 and are therefore ineligible (they have the IFA_F_TEMPORARY
flag set). Note how 5 and 7 have also stopped being preferred. Address 3
is the one I see when I go to ip6.me and address 4 is the one used to
reach the router.

Addresses 6, 8, and 9 are the "permanent" addresses that would normally
be based on the MAC address of the interface, but are actually in
"stable privacy" mode for me (RFC 8064). Address 9 is the link-local
one, which makes it ineligible, leaving the other two stable addresses
eligible.

Addresses 1, 3, 7, and 8 are global, from a DHCPv6-PD delegation from my
ISP, which is why they have finite lifetime. Addresses 2, 4, 5, and 6
are from my local Unique Local Address (ULA) prefix, which is why 2 and
6 are valid forever.

Pick-to: 6.1
Change-Id: If8b43dc9678c4b4ba9c1fffd1668fdcae873c6bd
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2021-03-05 13:56:31 -08:00
Joerg Bornemann
37452051d6 Add QT_CONFIGURE_RUNNING variable for configure.cmake files
configure.cmake files are read twice when using the configure script /
qt-configure-module: First, when configure is running and a second time,
when CMake creates the local build system files.

In the first run, not every function and esp. no targets are
available. Code in configure.cmake that accesses targets or calls
functions unknown to configure will fail at the configure stage.

This patch introduces the QT_CONFIGURE_RUNNING variable that can be used
in configure.cmake files to guard such code:

if(QT_CONFIGURE_RUNNING)
    set(_qt_coord_type double)
else()
    get_property(_qt_coord_type TARGET Qt6::Core
        PROPERTY INTERFACE_QT_COORD_TYPE)
endif()

Change-Id: Iff39924d6a5133379d28c8204d7b7afdf47de5c8
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2021-03-05 21:22:31 +00:00
Timur Pocheptsov
734ab493f7 Fix a BIC introduced by extending the namespace QSsl in _p.h files
Renamed the private part of the namespace to QTlsPrivate.

Fixes: QTBUG-91531
Change-Id: Id2d9c458d8d958b35e437eee42889177dad0a7a7
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
(cherry picked from commit e4efa00c72c7011f4e5c27722c2a522b30274610)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2021-03-05 20:50:02 +00:00
Friedemann Kleint
7402f4171d Merge "imageviewer example: Show the color space description when loading" 2021-03-05 19:06:02 +00:00
Andreas Buhr
b2c96423bb Merge "Add documentation for Q_OBJECT_BINDABLE_PROPERTY" 2021-03-05 18:51:54 +00:00
Allan Sandfeld Jensen
d9da78b620 Merge "Add ARM version of the "AES" qhash algorithm" 2021-03-05 18:45:55 +00:00
Andreas Buhr
63b40b962e Merge "Fix warning about virtual override" 2021-03-05 18:09:24 +00:00
Edward Welbourne
a757d7123b Merge "Add more QDateTime test-cases close to the epoch" 2021-03-05 17:22:39 +00:00
Fabian Kosmale
9e6ad5dc22 Merge "qtypeinfo: make variable templates inline" 2021-03-05 17:18:47 +00:00
Friedemann Kleint
0a392780c8 imageviewer example: Show the color space description when loading
Change-Id: If9939676f29b9bbb43d698fb12efc42757e5c659
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
2021-03-05 17:35:25 +01:00
Øystein Heskestad
de658d8ca5 Merge "Make qdecompresshelper archive bomb check only trigger for large files" 2021-03-05 16:32:49 +00:00
Allan Sandfeld Jensen
ecf84e0989 Add ARM version of the "AES" qhash algorithm
Change-Id: Ia2c20e970a0149efb7665a5690538f83965e7be7
Reviewed-by: Erik Verbruggen <erik.verbruggen@me.com>
2021-03-05 18:31:27 +02:00
Andreas Buhr
89cc39a894 Add documentation for Q_OBJECT_BINDABLE_PROPERTY
The duo Q_OBJECT_BINDABLE_PROPERTY and QObjectBindableProperty
can only be documented together. The documentation is now with
QObjectBindableProperty. This patch adds a documentation entry
for Q_OBJECT_BINDABLE_PROPERTY which links the user to
QObjectBindableProperty.

Task-number: QTBUG-90511
Pick-to: 6.0 6.1
Change-Id: I9af4a99d49f4b02ee9645a2cc9a9a024a6a1a552
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2021-03-05 15:42:45 +00:00
Wang Yicun
89e9164abb Merge "Simplify code, remove redundant condition" 2021-03-05 15:35:26 +00:00
Zhang Hao
f13451539f Merge "Code tidies" 2021-03-05 15:14:28 +00:00
Edward Welbourne
33ffc27834 Add more QDateTime test-cases close to the epoch
The prior tst_QDateTime::setMSecsSinceEpoch(-1) testcase was the last
millisecond of 1969; which (deep in the relevant function) actually
uses time_t 0 (with the -1 ms offset taken aside to be put back
later); so add the matching -1 second test. At the same time, add +1ms
and +1s checks for symmetry.

Change-Id: Ib487305f6ad81b55563ea59926cae13fb1fde592
Reviewed-by: Andreas Buhr <andreas.buhr@qt.io>
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-03-05 16:11:26 +01:00
Andreas Buhr
230f41f670 Fix warning about virtual override
Change-Id: Ia9928c8ef5d1597e55f45c67c462c1e9756ee899
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
Reviewed-by: Sona Kurazyan <sona.kurazyan@qt.io>
2021-03-05 15:51:41 +01:00
Giuseppe D'Angelo
bcedeb6d3d Merge "QPoint(F): declare as PRIMITIVE, not RELOCATABLE" 2021-03-05 14:38:41 +00:00
Fabian Kosmale
6de9acf779 qtypeinfo: make variable templates inline
And refactor the TMP to use std::conjunction and use variable template
specialization instead of template class specialization for the base
cases.

Change-Id: Iea6a03f13ea3443a0fa7365af21c496670c1e07f
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2021-03-05 15:30:05 +01:00
Øystein Heskestad
be73ca7eb1 Make qdecompresshelper archive bomb check only trigger for large files
This is to avoid false positives.
By default files are large if uncompressed size > 10 MB. Only configurable internally.
Also add auto tests.

Task-number: QTBUG-91392
Pick-to: 6.0 6.1
Change-Id: I32258cb7c957f2a23a05157ba4ed5c0af2ba585e
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2021-03-05 15:13:53 +01:00
Timur Pocheptsov
684d44024f Merge "tst_qdtlscookie: use a proper 'enterLoopMSecs' instead of 'enterLoop'" 2021-03-05 13:00:56 +00:00
Wang Yicun
a913002f13 Simplify code, remove redundant condition
'clazz || (!clazz && isCached)' is equivalent to
'clazz || isCached'

Done-with: Tang Peng <tangpeng@uniontech.com>
Pick-to: 6.1
Change-Id: Ie9eab4a94a61be2b360f64980c4666a622f3a209
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2021-03-05 13:52:31 +01:00
Paul Wicking
c1c61c3bb4 Doc: Fix section titles that confuse QDoc's autolinker
Fixes: QTBUG-91620
Pick-to: 6.1 6.0
Change-Id: I7c407c7158324d1fbbeb78e47d2198e8ddf5daa0
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2021-03-05 13:47:53 +01:00
Zhang Hao
2801dc7f04 Code tidies
The return type goes on the same line of the rest of the signature.

Change-Id: Icacf2e00ed2876c4c9b72b8f6c428c2e37ee42a7
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
2021-03-05 12:26:47 +00:00
Toni Saario
90371e9250 Merge "Skip globalstatic threadStressTest on QEMU" 2021-03-05 11:02:17 +00:00
Giuseppe D'Angelo
48f685f5e5 QPoint(F): declare as PRIMITIVE, not RELOCATABLE
These types can be copied via memcpy, so use the correct tag.

Change-Id: Icba37d42dd8658225ce4889284661d108122d489
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Reviewed-by: Andrei Golubev <andrei.golubev@qt.io>
2021-03-05 11:19:46 +01:00
Fabian Kosmale
23636d4281 tst_qmetatype: RELOCATABLE -> PRIMITIVE is binary compatible
Based on the discussion in https://codereview.qt-project.org/c/qt/qtbase/+/336742
changing our types from RELOCATABLE to PRIMITVE is fine.

Change-Id: Ica867203aa813d19fdfd3753fc4ff36ef4332fc3
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2021-03-05 10:19:45 +00:00
Giuseppe D'Angelo
5f501b0e97 QQuaternion: mark as PRIMITIVE type
Change-Id: I043fef8bfc66875b72f34e7939e78c7d1c7f5381
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2021-03-05 11:19:44 +01:00
Timur Pocheptsov
b262007929 tst_qdtlscookie: use a proper 'enterLoopMSecs' instead of 'enterLoop'
It's a bit weird to calculate timeout in milliseconds and then pass
it as number of seconds ...

Pick-to: 6.1 5.15
Change-Id: I1127163ea06e49ac1b53eea6f60ee8590319bfa1
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2021-03-05 10:34:54 +01:00
Toni Saario
49e93b6e39 Skip globalstatic threadStressTest on QEMU
The test causes frequent failures in the CI. This is the most
subtle fix until it is properly fixed.

Pick-to: 6.1
Task-number: QTBUG-91423
Change-Id: I6499378dcd3ed1c31275db38d83b572e764366cc
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Samuli Piippo <samuli.piippo@qt.io>
2021-03-05 08:09:59 +00:00
Piotr Mikolajczyk
5c6b10c3ce Android: Place cursor correctly on screen when editing
When editing text the cursor is not placed correctly. So this
has been achieved by tricking Android into thinking that the
input area is only the line where the cursor is, so it is
forced to keep it on screen.

Fixes: QTBUG-91073
Pick-to: 5.15
Change-Id: Icc2e8315deb76ca1a84819d3fdceaa7b027b1174
Reviewed-by: Ville Voutilainen <ville.voutilainen@qt.io>
2021-03-05 07:57:14 +00:00
Wang Yu
852b070529 QContiguousCache: Remove redundant condition
The reverse condition was already checked three lines before.

Pick-to: 6.1
Change-Id: I2f78262004871ec2f3730e2a25f26fe22636cde7
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2021-03-05 07:27:14 +00:00
Allan Sandfeld Jensen
9fb81fc287 Merge "Add QColorSpace::description" 2021-03-05 00:04:34 +00:00
Volker Hilsheimer
26b53173d6 Merge "QMenu test: turn tooltip animations off" 2021-03-05 00:02:41 +00:00
Volker Hilsheimer
a60f763f25 Merge "Protect against self-assignment, plug potential memory leak" 2021-03-04 22:24:48 +00:00
Volker Hilsheimer
d76d8571e2 QMenu test: turn tooltip animations off
QTBUG_89082_actionTipsHide() is very flaky if tooltips fade in, as the
mouse move might happen while the tooltip is still appearing.

Fixes: QTBUG-91532
Pick-to: 6.1 6.0 5.15
Change-Id: I55305927fcf143d99dfff28d0bc70b2e831a139a
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
2021-03-04 22:49:47 +01:00
Joerg Bornemann
48488b810f Fix Android build
The Android build failed, because the namespace QNativeInterface could
not be found. Include the header file where it's defined.

Change-Id: If53eda4d4d4e6d5e66787d74c714215721ba0b60
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
2021-03-04 22:39:21 +01:00
Allan Sandfeld Jensen
01c55405fa Add QColorSpace::description
A way to read the description of the profile from ICC, or set one
yourself.

Change-Id: I68622e30ee209cac99c41f3df934712c3548c0de
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
2021-03-04 22:37:08 +01:00
Paul Wicking
3ae67b4434 Merge "Doc: Use correct include for QWGLContext" 2021-03-04 21:24:32 +00:00
Volker Hilsheimer
3ae09debab Protect against self-assignment, plug potential memory leak
Fixes static analyzer warning f03d95823e9f1395d64501cc111f0f63

As a drive-by, plug the potential memory leak if the assigned-to
QDockAreaLayoutItem already holds a QDockAreaLayoutInfo object.
The subinfo is deleted in the destructor, QDockAreaLayoutItem
has ownership for the subinfo.

Pick-to: 6.1
Change-Id: I8546adc6fb0537078eea9dfb45d1bd9967d8d149
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
2021-03-04 19:58:44 +01:00