Commit Graph

12601 Commits

Author SHA1 Message Date
Joerg Bornemann
6d82d0c532 Remove CMake compatibility functions for old API
All repositories define QT_NO_INTERNAL_COMPATIBILITY_FUNCTIONS by now,
and we can remove QtCompatibilityHelpers.cmake altogether.

Change-Id: I4d8104246e96a4514d5651c104607d651d208d95
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2021-06-04 14:27:20 +02:00
Assam Boudjelthia
965fc1148d JNI: Add calls to get field IDs
Task-number: QTBUG-92952
Change-Id: Ie68ede4b00a411064a29925b28b1f60a84d2d678
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
Reviewed-by: Ville Voutilainen <ville.voutilainen@qt.io>
2021-06-04 10:46:57 +03:00
Timur Pocheptsov
fd217e7f00 QDtls(Cookie) autotests - use the proper API to detect DTLS support
Instead of relying on some string comparisons and the current knowledge
of which backend supports DTLS, use the proper API we already have in
place to test if a particular class is supported by the active backend.

Change-Id: I58ca0f7b7fcef68ec375cd64b83e51d4335817da
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2021-06-03 20:08:32 +02:00
Volker Hilsheimer
5174f979a3 QAbstractItemView: add test for mouse selection
Covers all selection modes and various combinations of mouse press, click,
drag, with or without modifiers.

Task-number: QTBUG-59888
Change-Id: Ib8ddc319a89649338d55fbc47e5a7ccfed338af9
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2021-06-03 19:37:46 +02:00
Volker Hilsheimer
17c1ebf8bf QAbstractItemView: don't block dragging after double click
After d6551fe125 it was no longer possible to start a drag with a
double click (where the first click selects an item, and the second
press+move starts the drag). Resetting the pressedItem variable to block
the emission of the clicked() signal had this unwanted side effect.

Instead, use an explicit boolean to store that the next release event
will be the result of a double click, so that the clicked() signal is not
emitted again (preventing the double-emission was the purpose of change
d6551fe125).

Task-number: QTBUG-77771
Fixes: QTBUG-94087
Pick-to: 6.1 5.15
Change-Id: I082c5169d89eb980dcd7985ef3d302b6ff060fb9
Reviewed-by: Samuel Gaist <samuel.gaist@idiap.ch>
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
Reviewed-by: Olivier BARTHELEMY <perso.olivier.barthelemy@gmail.com>
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2021-06-03 19:37:46 +02:00
Timur Pocheptsov
eab0bb73a5 tst_QSslSocket::readBufferMaxSize() - workaround the flaky test
Task-number: QTBUG-94186
Change-Id: I8c82f1fede8f9512f531f4ff17508b9e71ebf0b7
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2021-06-03 17:05:44 +02:00
Laszlo Agocs
64089b900f rhi: Enable reading back slices of 3D textures
Change-Id: I0c687677b7e86b7284130c775718b29aca2cca40
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
2021-06-03 17:05:44 +02:00
Edward Welbourne
4652da536a tst_QDateTimeEdit::editingRanged(): use QScopedPointer
Test would previously have leaked on failure.
While checking for other uses of delete-after-checks, simplify one
place that tested deleting a calendar widget lead to recreation.

Pick-to: 5.15 6.1
Change-Id: I9524902a02dd42793bcf71113c6799dc925ac4a0
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
2021-06-03 16:14:00 +02:00
David Faure
4ec5622e62 QSortFilterProxyModel: create mappings on demand again
Calling create_mapping in setSourceModel as introduced by 8455bfee76
can lead to an early call to filterAcceptsRow, and some existing applications may crash.
It is also an incomplete solution since it was only done for the
toplevel index but not for child indexes.

Instead, go back to creating mappings on demand.
This means coming up with a different fix for QTBUG-87781 (dataChanged
not emitted for indexes that haven't been mapped yet, i.e. not queried
or shown anywhere).

When this happens, we can't know if the index was previously filtered
out or not (for lack of a dataAboutToBeChanged signal...). Creating
the mapping with the new data only gives us the new state of affairs,
there's no reference state to compare to. Therefore, when the mapping
is missing (during dataChanged handling), create it, but skip all the
logic about row insertion/removal, just forward the dataChanged signal
if the row isn't filtered out.

Creating the mapping might require creating first mappings for parents,
recursively, which wasn't done anywhere in QSFPM yet, hence the new
create_mapping_recursive() method.

In addition to all this, the handling of removed items was incorrect,
remove_source_items did nothing if the parent was gone, and then
source_items_removed was trying to adjust indexes in an incorrect list.
If the parent is gone, clear the proxy_to_source list, so there's
nothing to adjust afterwards. This bug actually doesn't happen anymore
in this version of the patch, but the change still seems right and might
prevent repeating a long debugging session in the future.

Thanks to ChunLin Wang for the unittest in this commit.

Done-with: ChunLin Wang
Pick-to: 6.1 6.0 5.15
Change-Id: Id543d0cc98f1a03b5852bda01d2f49b980e06be7
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
2021-06-03 00:53:08 +02:00
Eirik Aavitsland
2b52452843 Add load/fromdata() overloads taking QByteArrayView to QImage
Handy when one has the data buffer to be read in a QBAV.

This also fixes an issue and compiler warning about passing a
qsizetype data length value as an int, and makes it possible to pass
a qsizetype-size length without going through QByteArray.

Makes the QByteArray overload redundant.

Change-Id: Iba8825cf0fd8003fb2eac5b1d30a61ec91b85ceb
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
2021-06-02 23:02:45 +02:00
Karsten Heimrich
5b6f5c6fc2 Make bool isSymLink, isJunction inferred from resource.type
Change-Id: I90574b62c8d21e3559fb219543f564454b4335e1
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2021-06-02 23:02:45 +02:00
Karsten Heimrich
01f003f0aa Refactor createSymbolicLink() and createNtfsJunction()
Both functions now return a result object. Eliminates the need
to pass the errorMessage out-parameter. Adapt auto-tests.

Change-Id: I110b68fedc67b01f76796c44fa55383b2cc03460
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2021-06-02 23:02:45 +02:00
Karsten Heimrich
ebacf42561 Move createSymbolicLink() to the shared header
Change-Id: I737f521791faf07d704e15d36d57444b3187ba9d
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2021-06-02 23:02:45 +02:00
Andrei Golubev
e6a2892772 moc: Add relative property index to JSON output of PropertyDef
Needed for QML compiler to know property index of C++ type at
compile time without going through QMetaObject::indexOfProperty

Change-Id: I404e71d6071d36812661df17d12b879a8dcbd146
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2021-06-02 19:03:45 +02:00
Fabian Kosmale
d5ab0101ff Avoid use after free in tst_qsequentialanimationgroup
The test connects finished to the groups clear method, which in turn
deletes the animation instance. Thus, no member must be accessed after
calling stop, unless we use a (costly) QPointer to guard against
deletion.
Notify earlier that totalCurrentTime changed to avoid the issue.
As a drive-by, modernize the connect in the test.

Fixes: QTBUG-94143
Change-Id: I923101107b7f79115be69a58c8e8d5177a98d48f
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Sona Kurazyan <sona.kurazyan@qt.io>
2021-06-02 16:45:23 +02:00
Assam Boudjelthia
78ed8034d2 Add a const JNINativeMethod[] overload for registerNativeMethods()
The JNI interface expects a const JNINativeMethod[] and our wrapper
takes a non-const. Also, this was causing refactoring of exisisting code
with a const JNINativeMethod[] to fail because the call expects a
non-const.

Change-Id: If790c401650cb33fe31f93bafe41aab7714488e9
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2021-06-02 08:20:17 +00:00
Lars Knoll
6c1a9f2b4d Simplify storing of notification objects
QPropertyChangeHandler is a templated class and it's argument is
a functor. That makes it inherently cumbersome to use the class
in any context where the change handler needs to be stored.

Introduce a QPropertyNotifier class that stores the functor
in a std::function<void()>, and add a QProperty::addNotifier()
method that can be used instead of onValueChanged().

Also make QPropertyNotifier default constructible.

This significantly simplifies the code that needs to be written
and makes it possible to store notifications as class members
without major hassle.

Fixes: QTBUG-92980
Change-Id: Id5b7baec093b9ac0467946cded943d92ad21030b
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2021-06-01 16:29:15 +02:00
Friedemann Kleint
de15836dbf uic: No longer generate star imports in Python
Use class WriteIncludesBase and store classes encountered in a
per-module hash (Qt/custom widgets). Write out only the required
classes.

Add --star-import as a fallback should the change cause issues.

Task-number: PYSIDE-1404
Change-Id: Ic50e26758ddd0f2f8aebbce470d32a36fb09a2c4
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
2021-06-01 16:29:15 +02:00
Inho Lee
7ea2fbddcf QtGui/math3d : Fix QQuaternion::getEulerAngles
When rotating M_PI_2 based on x-axis, quaternion to euler conversion
makes NaN for the x-rotation value.  This patch fixes this corner case.

Fixes: QTBUG-93600
Pick-to: 6.1 6.0 5.15
Change-Id: Ice321a80ad90dba9cf3ee3a14ec7d3d047c21bd3
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
2021-06-01 09:01:23 +02:00
Mårten Nordheim
da955aadf5 QNetworkInformation: Behind captive portal
This patch adds the API, with no supporting backends

Task-number: QTBUG-93848
Change-Id: I50454717f928819e1b990df91872675e842f9987
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
2021-05-31 17:25:22 +02:00
Mårten Nordheim
69982182a3 QNetworkRequest: Add API to set a minimum archive bomb size
Fixes: QTBUG-91870
Change-Id: Ia23e8b8bcfdf65a91fe57e739242a355c681c9e6
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2021-05-31 17:25:20 +02:00
Laszlo Agocs
51c22a1f51 rhi: Add support for 3D textures
Supported on OpenGL (and ES) 3.0+ and everywhere else.

Can also be a render target, targeting a single slice at a time.

Can be mipmapped, cannot be multisample.

Reading back a given slice from a 3D texture is left as a future
exercise, for now it is documented to be not supported.

Upload is going to be limited to one slice in one upload entry,
just like we specify one face or one miplevel for cubemap and
mipmapped textures.

This also involves some welcome hardening of how texture subresources
are described internally: as we no longer can count on a layer index
between 0..5 (as is the case with cubemaps), simply arrays with
MAX_LAYER==6 are no longer sufficient. Switch to sufficiently dynamic
data structures where applicable.

On Vulkan rendering to a slice needs Vulkan 1.1 (and 1.1 enabled on the
VkInstance).

Task-number: QTBUG-89703
Change-Id: Ide6c20124ec9201d94ffc339dd479cd1ece777b0
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
2021-05-31 17:16:57 +02:00
Laszlo Agocs
5eab5d6253 rhi: vk: Switch to the modern validation layer internally
Task-number: QTBUG-88388
Change-Id: Ia30af6c4554594f094af7866ad6e10ed7929de27
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
2021-05-31 17:16:53 +02:00
Laszlo Agocs
bbc6b5c3a7 vulkan: Update legacy tests and examples to the modern validation layer
Fixes: QTBUG-88388
Change-Id: Ib072f203ada5d692dea8d35da2b24db0deac0297
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
2021-05-31 17:16:49 +02:00
Laszlo Agocs
0199640d44 rhi: manual tests: Switch to VK_LAYER_KHRONOS_validation
Task-number: QTBUG-88388
Change-Id: Ia6d7caf0357b017625d3245a72d21a3023d81035
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
2021-05-31 17:16:45 +02:00
Robert Löhning
82499a6a28 Fuzzing: Discard logging output from QSslCertificate
It's pointless in a fuzzer and slows down execution.

Change-Id: I0d36ed8814cf8fb332c196ea7e24eae8ee4d3c6e
Reviewed-by: Albert Astals Cid <albert.astals.cid@kdab.com>
2021-05-31 17:11:05 +02:00
Robert Löhning
75cdbb85ea Fuzzing: Discard logging output from QTextDocument
It's pointless in a fuzzer and slows down execution.

Change-Id: I160d7fd761118f9eba9b98fc024aef293e021845
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
2021-05-31 17:10:58 +02:00
Robert Löhning
8b691ce245 Fuzzing: Add CMake project files for fuzz targets
Change-Id: Ied44bfd2c83d5590066146187a7333b677ceb179
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2021-05-31 16:44:06 +02:00
Tang Haixiang
c77840d734 Fix PageDown behavior and PageUP
When the PageDown is pressed, the current's rect cannot be
used to match the item, because we don't know the size of
the rect. Move the rect by the height of the viewport, and
then move the rect upwards until it matches the
button <= viewport's bottom of the item

Fixes: QTBUG-92583
Pick-to: 6.1
Change-Id: I210edc0e8b942984f3fc20e7752c6e1315152ea1
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2021-05-31 03:27:12 +00:00
Volker Hilsheimer
d36ef40d18 QComboBox: propagate style change on widget to internal container
When changing the style of the combobox, the change will not propagate
to the internal container widget, so the changeEvent handler won't be
called. This is correct (as per QWidget::setStyle documentation).
QComboBoxPrivateContainer asks the combobox style for relevant settings,
such as the frame style, which is then used for sizing and positioning.
If the combobox's and container's settings become inconsistent, then the
combobox popup will not get the correct size and/or position.

Move some of the style-dependent changes into a separate function and
call it when the QComboBox::changeEvent handles the style change so that
both widgets have a consistent set of settings.

Add a test case that verifies that the style is asked for the relevant
setting when the style changes.

Note: QComboBox does a lot of style-dependent setup work in different
places, which is quite messy and complex. Trying to consolidate that
further breaks tests though, so this change is doing the minimum
necessary to fix the reported issue.

Pick-to: 6.1 5.15
Fixes: QTBUG-92488
Change-Id: Ia957d504b2d800add26fc0565be727b5c08a5358
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
2021-05-31 01:06:00 +02:00
Assam Boudjelthia
cbaff13701 Block flaky rhi and OpenGL tests on Android
Task-number: QTBUG-87429
Change-Id: I5a09a82b5fd27d9a36563e5270703a32c067d4b6
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2021-05-30 23:02:53 +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
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
Timur Pocheptsov
810e755c18 Fix auto-tests that are fooled by the presence of more than one plugin
It's possible that Qt is built with OpenSSL and some other backend.
The ifdefs generated are not mutually exclusive anymore, as it was
in the past. So tests should rely on the actual backend they have
working at runtime.

In the process of fixing the auto-tests, modernized feature #if-ery and
some associated compilation issues.

Fixes: QTBUG-92875
Change-Id: I2be1b924d506fd36dc4e2c6c9158b5023ff87f32
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2021-05-27 06:41:26 +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
Tor Arne Vestbø
7f4ec4ed88 Blacklist tst_QTcpServer::linkLocal on macOS ARM
Amends d790e9fda9.

Change-Id: If17a9e2f3f9858c0850006f48242248c4b812e27
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2021-05-26 21:24:40 +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
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
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
Tor Arne Vestbø
d790e9fda9 Blacklist problematic network auto-tests on macOS ARM
QNetworkInterface reports as up and running an interface,
seemingly having a valid IP address which actually has
not IPv4/IPv6 configured at all (this is what getifaddrs
gives us).

Change-Id: I5808d5dfdbc54004a1e02b791917e9b2ba62905f
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2021-05-26 12:49:56 +02:00
Tor Arne Vestbø
d4cff8c537 Fix wrong variable initialization in tst_QScrollBar::task_209492
Change-Id: Icf1f6da46caa7fb7f3bd308eaaf4e037af814d17
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2021-05-26 03:14:52 +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
7ac0621ad1 Introduce QHashSeed and switch to size_t seeds
Commit 37e0953613 added a to-do, but we
can actually change the type, since we've documented since Qt 5.10 that
setting a non-zero value (aside from -1) with qSetGlobalQHashSeed was
not allowed. Storing a value to be reset later is simply not supported.

Change-Id: Id2983978ad544ff79911fffd1671f7b5de284bab
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
2021-05-23 12:08:42 -07:00
Joerg Bornemann
895edcd7cd Support multiple equally named .qrc files in qt_add_big_resources
It is now possible to call qt_add_big_resources with multiple .qrc files
that are in different directories but have the same file name.
Before, this resulted in target name conflict errors.

Pick-to: 6.1
Fixes: QTBUG-93230
Change-Id: Ic3d9d6974a107163aeb7ada0b6f1fa113fb18de0
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2021-05-22 22:32:27 +02:00
Mårten Nordheim
4da22d6534 tst_QDecompressHelper: Move pointer size check inside the test
For some reason the test case was (no longer?) detected by moc

Change-Id: I20f20de76479f7d9db43fae985cefe0869a7e203
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2021-05-21 21:13:47 +02:00
Allan Sandfeld Jensen
f1983dcdf6 Correct RGB to Grayscale conversion
The existing conversions weren't handling gamma correctly and used
an ad-hoc definition of gray instead of based on true luminance.

[ChangeLog][QtGui] RGB conversions to grayscale formats are now
gamma-corrected and produce color-space luminance values

Change-Id: I88ab870c8f5e502ddb053e6a14a75102239a26f2
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2021-05-21 15:37:32 +02:00
Giuseppe D'Angelo
bf22f91441 QFuture/QPromise: don't check for is_copy_constructible
The check is over-arching. is_move_constructible is sufficient;
we don't have to support "ridiculous" types that are copiable but
have deleted move operations (such types are fundamentally broken).
This is in line with the Move* (legacy) named requirements.

Change-Id: Idc7116b39013501b9be39628a4e7afd35fe15530
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Sona Kurazyan <sona.kurazyan@qt.io>
Reviewed-by: Andrei Golubev <andrei.golubev@qt.io>
Reviewed-by: Ville Voutilainen <ville.voutilainen@qt.io>
2021-05-21 11:08:11 +02:00
Mårten Nordheim
5a701f5a7e Add function to QAuthenticatorPrivate to check method support
To see if a certain method is supported. To be used in an upcoming patch.

Change-Id: I1a5c2f655585331820701bb54f6991b4aba38273
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
2021-05-20 20:31:05 +02:00