Commit Graph

12583 Commits

Author SHA1 Message Date
Vincent Baijot
366bdcde97 Correct prefix reported for end element in QXmlStreamReader
Before this change, QXmlStreamReader prefix value was always an empty
string for EndElement when the documentation state : "Returns the prefix
of a StartElement or EndElement."

The error was a missing update of the prefix value when parsing
EndElement.

I updated the tests data which were also wrong because no prefix were
reported even for </a:foo>. No new test is necessary, I think, the test
data already cover the cases of EndElement with a prefix and without one
(unchanged here).

Fixes: QTBUG-86847
Pick-to: 5.15 6.0 6.1
Change-Id: I0ad38b9741d760f1ce688a36f969ec14e20a928c
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2021-04-20 03:03:51 +02:00
Luca Beldi
fed2c0d236 Fix QAbstractItemModelTester false positive
When rows are removed from a model with no columns,
the test should not report a problem if indexes are invalid

Fixes: QTBUG-92886
Pick-to: 6.1 6.0 5.15
Change-Id: I7a042dfdb2575f87208a00cbed13db3869807f84
Reviewed-by: David Faure <david.faure@kdab.com>
2021-04-19 19:30:46 +01:00
Juha Vuolle
ed72147149 Fix qtbase cmake autotest
The testcase relied on having optional packages, and that the last
package in that list was found. Otherwise the version numbers of
the found modules were not set.

Change-Id: I76743fd029d6eed2f4b347280591e6fdaed19053
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2021-04-19 20:56:25 +03:00
Morten Johan Sørvig
fea54241aa Add ScreenGadget utility
ScreenGadget visualizes virtual desktop screen layout,
in device independent and native pixels.

This can be used to debug the (sometimes surprising)
device independent screen geometry resulting from Qt
applying a scale factor.

Change-Id: I5b18e0fc9a54ba3e14d648794429b2eeadd25748
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
2021-04-19 18:45:39 +02:00
Morten Johan Sørvig
74cae2580f Update DprGadadget
Display active environment variables. Reorder the
labels with device independent values to the left
and native values to the right. Display the Qt scale
factor.

Change-Id: If95c252b06eff5abd91a25847777246effe94be2
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
2021-04-19 18:45:39 +02:00
Andreas Buhr
7b6cef0e65 Port QSequentialAnimationGroup to new property system
There is only one property in QSequentialAnimationGroup,
currentAnimation.
This patch ports this property to the new property system

Task-number: QTBUG-85520
Change-Id: Id528d30f551e88a6165bbb6a3c09d44e89257de5
Reviewed-by: Sona Kurazyan <sona.kurazyan@qt.io>
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2021-04-19 15:18:46 +02:00
Andreas Buhr
97a8727f0e Port of QDBusServiceWatcher::watchMode to new property system
Port watchMode in QDBusServiceWatcher to the new property
system. This is the easiest part.

Task-number: QTBUG-85520
Change-Id: I588212af205e77765862b8fecdbdcbf871717142
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
Reviewed-by: Sona Kurazyan <sona.kurazyan@qt.io>
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2021-04-19 15:18:46 +02:00
Qiang Li
777053cfff Re-layout QProgressDialog when setting the cancel button
Setting a cancel button on QProgressDialog more than once caused the layout
to be invalid. The layout was only applied when the dialog resizes or the
style changes, but not when a new cancel button is set.

The solution is to update the layout() before showing the dialog when adopting
new child widgets.

Fixes: QTBUG-19983
Pick-to: 6.0 6.1
Change-Id: Id8fb1ac56e94a9bd97d4559a2e8d4835856fd7d0
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2021-04-19 09:22:04 +00:00
Andrei Golubev
7b7a6050e7 Inline test cases in tst_qlist
QList tests have mostly a scheme of:
void opInt() { op<int>(); }
void opMovable() { op<Movable>(); }
void opCustom() { op<Custom>(); }

As a drive by, move the leak checking into a separate struct/macro

Change-Id: I7cdda3a6c2aa324968aa26594da9f9eafbd49a0a
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2021-04-17 12:24:14 +02:00
Qt CI Bot
042e728752 Merge integration refs/builds/qtci/dev/1618599897 2021-04-16 22:01:34 +00:00
Qt CI Bot
09d99a8d5f Merge integration refs/builds/qtci/dev/1618592683 2021-04-16 19:56:04 +00:00
Fabian Kosmale
e835bccb1e QPropertyBinding: Add sticky mode
A sticky QPropertyBinding is a binding that does not get removed when a
write occurs. This is used in the QML engine to implement support for
the QQmlPropertyData::DontRemoveBinding flag.

Task-number: QTBUG-91689
Change-Id: Ib575b49abe634215318ccc7ba46212cc21eb4dad
Reviewed-by: Andrei Golubev <andrei.golubev@qt.io>
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
2021-04-16 20:33:02 +02:00
Giuseppe D'Angelo
a794c5e287 Unicode: fix the extended grapheme cluster algorithm
UAX #29 in Unicode 11 changed the EGC algorithm to its current form.
Although Qt has upgraded the Unicode tables all the way up to
Unicode 13, the algorithm has never been adapted; in other words,
it has been working by chance for years. Luckily, MOST
of the cases were dealt with correctly, but emoji handling
actually manages to break it.

This commit:

* Adds parsing of emoji-data.txt into the unicode table generator.
  That is necessary to extract the Extended_Pictographic property,
  which is used by the EGC algorithm.

* Regenerates the tables.

* Removes some obsoleted grapheme cluster break properties, and
  adds the ones added in the meanwhile.

* Rewrites the EGC algorithm according to Unicode 13. This is
  done by simplifying a lot the lookup table. Some rules (GB11,
  GB12, GB13) can't be done by the table alone so some hand-rolled
  code is necessary in that case.

* Thanks to these fixes, the complete upstream GraphemeBreakTest
  now passes. Remove the "edited" version that ignored some rows
  (because they were failing).

Change-Id: Iaa07cb2e6d0ab9deac28397f46d9af189d2edf8b
Pick-to: 6.1 6.0 5.15
Fixes: QTBUG-92822
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
2021-04-16 20:31:39 +02:00
Qt CI Bot
5839dee30f Merge integration refs/builds/qtci/dev/1618585460 2021-04-16 18:14:35 +00:00
Giuseppe D'Angelo
b9d0fd3a09 tst_qcborstreamwriter: don't pass char8_t strings to QByteArray
There isn't a QByteArray constructor taking a char8_t*. (I am not
sure if there should be one; QByteArray is not going to anything
special about that information anyways.)

Change such strings to be "ordinary" narrow string literals.
There should be no problems at doing so, as by default we build in
UTF-8 mode under all compilers.

Pick-to: 6.1 6.0
Change-Id: Ia200ec6e3b0453bad033d5d8ff34c013bb27abd1
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2021-04-16 18:48:28 +02:00
Qt CI Bot
931929865f Merge integration refs/builds/qtci/dev/1618564901 2021-04-16 15:28:18 +00:00
Lars Knoll
fdedcb6ec6 Add support for grouped property changes
Add Qt::begin/endPropertyUpdateGroup() methods.
These methods will group a set of property updates together and delay
bindings evaluations or change notifications until the end of the update
group.

In cases where many properties get updated, this can avoid duplicated
recalculations and change notifications.

Change-Id: Ia78ae1d46abc6b7e5da5023442e081cb5c5ae67b
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Andrei Golubev <andrei.golubev@qt.io>
Reviewed-by: Andreas Buhr <andreas.buhr@qt.io>
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2021-04-16 16:49:29 +02:00
Lars Knoll
bb44c18b67 Don't emit change notifications more often than required
When a property value changes, first update all dependent bindings to
their new value. Only once that is done send out all the notifications
and changed signals.
This way, if a property depends on multiple other properties, which all
get changed, there will only be one notification; and (potentially
invalid) intermediate values will not be observed.

Fixes: QTBUG-89844
Change-Id: I086077934aee6dc940705f08a87bf8448708881f
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Andreas Buhr <andreas.buhr@qt.io>
Reviewed-by: Andrei Golubev <andrei.golubev@qt.io>
2021-04-16 16:49:29 +02:00
Lars Knoll
cf42a0fe5e Remove lazy binding evaluation
Too much of the existing code in Qt requires eager evaluation without
large scale modifications. Combined with the fact that supporting both
eager and lazy evaluation has a high maintenance burden, keeping lazy
evaluation, at least in its current state, is not worth it.

This does not diminish other benefits of the new property system, which
include
- a C++ API to setup and modify bindings and
- faster execution compared to QML's existing bindings and the ability
  to use them without having a QML engine.

We do no longer benefit from doing less work thanks to laziness. A later
commit will introduce grouping support to recapture some of this
benefit.

[ChangeLog][Import Behavior Change][QProperty] QProperty uses always
eager evaluation now when a dependency in a binding changes.

Change-Id: I34694fd5c7bcb1d31a0052d2e3da8b68d016671b
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Reviewed-by: Andreas Buhr <andreas.buhr@qt.io>
Reviewed-by: Andrei Golubev <andrei.golubev@qt.io>
2021-04-16 16:49:29 +02:00
Qt CI Bot
07d4a981a2 Merge integration refs/builds/qtci/dev/1618561273 2021-04-16 14:49:26 +00:00
Qt CI Bot
7e15d57eb4 Merge integration refs/builds/qtci/dev/1618515869 2021-04-16 10:08:31 +00:00
Edward Welbourne
b4a875544b Extend time_t-based handling all the way to the end of time_t
At least some modern 64-bit systems have widened time_t to 64 bits
fixing the "Unix time" problem. (This is even the default on MS-Win,
although the system functions artificially limit the accepted range to
1970 through 3000.) Even the 32-bit range extends into January 2038
but the code was artificially cutting this off at the end of 2037.
This is a preparation for using the same also all the way back to the
start of time_t.

In the process, simplify and tidy up the logic of the existing code,
update the docs (this includes correcting some misinformation) and
revise some tests.

Fixes: QTBUG-73225
Change-Id: Ib8001b5a982386c747eda3dea2b5a26eedd499ad
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2021-04-16 10:22:27 +02:00
Edward Welbourne
c3aa4cf952 Catch invalid offset returns from QTimeZone backends
If the backends run into an error in computing the offset, they return
INT_MIN; but they are valled via the front-end, which returns zero
when the zone is invalid. So treat INT_MIN returns from the backend
the same as the case of being invalid.

Change-Id: Ic3c4dfe964dbfba4030c770213eca8a63e84736d
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2021-04-16 10:20:11 +02:00
Qt CI Bot
455994c2ee Merge integration refs/builds/qtci/dev/1618512247 2021-04-16 07:57:01 +00:00
Alex Trotsenko
063cdb9870 QWindowsPipe{Reader|Writer}: restructure signals
For QProcess, there is no point in suppressing recursive
QWPR::readyRead() emission, as the former manages this logic itself. On
top of that, the non-recursive nature of QWPR::readyRead() indirectly
disallowed reading from the channels inside
QProcess::waitForReadyRead(), if that is called from a slot connected
to QProcess::readyRead().

QWPW had two signals, one allowing recursion and one not.

This commit allows recursion of QWPR::readyRead() and
QWPW::bytesWritten(), and moves recursion suppression to the higher-
level classes. This makes the code more uniform and efficient, at the
cost of a few duplicated lines.

Change-Id: Ib20017fff4d92403d0bf2335f1622de4aa1ddcef
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@gmx.de>
2021-04-15 19:00:42 +00:00
Joerg Bornemann
d437a0bfca Remove Qt dependency from some test helper executables
pro2cmake did not take into account the
   QT -= qt
bit of the .pro files.

Fixes: QTBUG-91676
Change-Id: If1373ee966312e4246490bd7389d75be9fa739cb
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2021-04-15 20:38:44 +02:00
JiDe Zhang
50a7eb8cf7 Add the "Territory" enumerated type for QLocale
The use of "Country" is misleading as some entries in the enumeration
are not countries (eg, HongKong), for all that most are. The Unicode
Consortium's Common Locale Data Repository (CLDR, from which QLocale's
data is taken) calls these territories, so introduce territory-based
names and prepare to deprecate the country-based ones in due course.

[ChangeLog][QtCore][QLocale] QLocale now has Territory as an alias for
its Country enumeration, and associated territory-based names to match
its country-named methods, to better match the usage in relevant
standards. The country-based names shall in due course be deprecated
in favor of the territory-based names.

Fixes: QTBUG-91686
Change-Id: Ia1ae1ad7323867016186fb775c9600cd5113aa42
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2021-04-15 20:17:49 +08:00
Qt CI Bot
1d59fe368a Merge integration refs/builds/qtci/dev/1618405176 2021-04-14 16:39:38 +00:00
Qt CI Bot
5341569b41 Merge integration refs/builds/qtci/dev/1618401544 2021-04-14 15:08:32 +00:00
Qt CI Bot
fb0fcd7fe3 Merge integration refs/builds/qtci/dev/1618397939 2021-04-14 14:29:23 +00:00
Qt CI Bot
3766cd6ff5 Merge integration refs/builds/qtci/dev/1618392398 2021-04-14 13:33:24 +00:00
Volker Hilsheimer
1d3fe418e2 Replace deprecated APIs in metatype/variant benchmarks
Fix compiler warnings.

Change-Id: Id09b414f530a0d35c1a79e32112ff59185be2bc3
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2021-04-14 14:38:42 +02:00
Assam Boudjelthia
1359238572 Replace conversion operator by operator* in QJniEnvironment
Since conversion operators do implicit conversion that might bring
some potential issues while using the API, let's stick to having
an operator* instead.

Pick-to: 6.1 6.1.0
Change-Id: Ie7ad5537958944b8d1c11d69fbd30284b4b0344d
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
2021-04-14 12:38:20 +00:00
Eirik Aavitsland
f4d791b330 Avoid processing-intensive painting of high number of tiny dashes
When stroking a dashed path, an unnecessary amount of processing would
be spent if there is a huge number of dashes visible, e.g. because of
scaling. Since the dashes are too small to be indivdually visible
anyway, just replace with a semi-transparent solid line for such
cases.

Pick-to: 6.1 6.0 5.15
Change-Id: I9e9f7861257ad5bce46a0cf113d1a9d7824911e6
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
2021-04-14 13:52:37 +02:00
Mårten Nordheim
a7dac8e35b QNetworkCookie: Rename sameSite to sameSitePolicy
As suggested in the API review.
Amends 37bd7b5733

Pick-to: 6.1 6.1.0
Change-Id: Ic3e8567f349568dc3b4dbf79be27c304b39480cf
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2021-04-14 13:44:26 +02:00
Edward Welbourne
964f91fd25 Make POSIX transition rule parser more robust
The POSIX rule parser used by QTzTimeZonePrivate recklessly assumed
that, if splitting the rule on a dot produced more than one part, it
necessarily produced at least three. That's true for well-formed POSIX
rules, but we should catch the case of malformed rules.

Likewise, when calculating the dates of transitions, splitting the
date rule on dots might produce too few fragments; and the fragments
might not parse as valid numbers, or might be out of range for their
respective fields in a date. Check all these cases, too.

Added a test that crashed previously. Changed
QTimeZone::offsetFromUtc() so that its "return zero on invalid"
applies also to the case where the backend returns invalid, in
support of this.

Fixes: QTBUG-92808
Pick-to: 6.1 6.1.0 6.0 5.15
Change-Id: Ica383a7a987465483341bdef8dcfd42edb6b43d6
Reviewed-by: Andrei Golubev <andrei.golubev@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Robert Löhning <robert.loehning@qt.io>
2021-04-14 12:57:30 +02:00
Mårten Nordheim
e875c071ec QNetworkInformation: delete the instance as a post-routine
On Windows, on exit, the backend will deref (and then implicitly start
deletion of) a COM object. This object tries to communicate with an
object in another thread, though it seems this other thread quits before
the main thread in _most_ cases.

To get around this we move the deletion to earlier in the program. While
this is only reported as a Windows issue it makes for more consistent
behavior if all platforms behave the same.

Document and test that recreation of QNI works as expected after the
destruction (and recreation) of QCoreApplication.

Amends: 0875626e22

Fixes: QTBUG-92568
Pick-to: 6.1 6.1.0
Change-Id: Iffc07f38673019aa059efd4d64d2ad706a03f6fe
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
2021-04-14 10:47:20 +02:00
Fabian Kosmale
d5b79e876e QBindable: Mark non-modifying methods as const
A few methods in QBindable which do not modify anything were not marked
as const so far. This adds the missing const, and a test to verify that
they work.

As all methods are fully inline, this does not cause any binary
compatibility issues.

Fixes: QTBUG-89508
Change-Id: If06d33bc405232887b8c371c268840ba34dbadf6
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2021-04-14 09:24:33 +02:00
Heikki Halmet
409443a376 Extend blacklisting of tst_gestures including all RHEL's
These are also failing in RHEL 8.2

Task-number: QTBUG-52523
Change-Id: I1448124376a2b415351d1a755043431050808e38
Reviewed-by: Jani Heikkinen <jani.heikkinen@qt.io>
2021-04-13 08:20:48 +03:00
Qt CI Bot
fc0255ddc9 Merge integration refs/builds/qtci/dev/1618248052 2021-04-12 19:28:28 +00:00
Robert Löhning
c62a193ca3 Fuzzing: Simplify figuring out the failing datetime format
Task-number: QTBUG-92275
Change-Id: I732e72e614163b536c3fa9187011c57fea639b92
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2021-04-12 19:08:07 +02:00
Alexey Edelev
fcb766f588 Add test of the static plugin with resources
The test follows up the discussion about tests related to the static
plugin resources:

https://codereview.qt-project.org/c/qt/qtbase/+/341203/6/tests/auto/other/init_resources_static_plugin/CMakeLists.txt#1

It emulates the static plugin that contains resource files. Since the
test already exposed few issues related to the resource object linking
it makes sense to have it in test set.

Change-Id: I62621c2db1eae6ae5842ba52035774a662d93423
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2021-04-12 17:19:41 +02:00
Qt CI Bot
6d624ab01a Merge integration refs/builds/qtci/dev/1618224780 2021-04-12 13:55:09 +00:00
Mårten Nordheim
bb85831e4d QtFuture::connect: disconnect signals first
During reportFinished we may call a continuation which might end up
triggering one of the signals.

Pick-to: 6.0 6.1
Change-Id: I19546fcca12be71cd536e4287eb5eddd9d236830
Reviewed-by: Sona Kurazyan <sona.kurazyan@qt.io>
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2021-04-12 12:37:40 +02:00
Volker Hilsheimer
019f35524d Fix compiler warning on platforms without QRhiNativeHandles
Pick-to: 6.1
Change-Id: I61254290853cadf3b1edf6e7b0f82bba9e8d2efe
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
2021-04-12 10:41:50 +02:00
Volker Hilsheimer
5f31da62bb Disable warnings for tests using QSqlQuery assignment
Copying is deprecated as of 14f9f00fdb.

Pick-to: 6.1
Change-Id: I235d45ff6769a29a4fdfd888c20dd9fe2fe81346
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
2021-04-11 23:08:32 +02:00
Volker Hilsheimer
ed8429495e Fix gcc warnings from having only one of assignment/copy
For example:
warning: implicitly-declared
‘constexpr Complex& Complex::operator=(const Complex&)’
is deprecated [-Wdeprecated-copy]

Pick-to: 6.1
Change-Id: I7598e821acb7cb7bf17776d693af62778185afc5
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2021-04-11 19:53:51 +02:00
Volker Hilsheimer
fa3b672f99 Mark variables that might be unused under some configurations
Silence compiler warnings.

Pick-to: 6.1
Change-Id: I857cf2ee177eecf305e4fa14f6b69b019ce85468
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2021-04-11 19:53:43 +02:00
Volker Hilsheimer
65e3dc5eac Fix warnings about lossy double/float conversion in tests
QVectorND, QQuaternion, and QColor all operate on floats rather than
qreal or double, so explicit use float literals in the tests.

Pick-to: 6.1
Change-Id: If12cc12ddd9cd8219f3d78bf24e1400921e26c2b
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2021-04-11 19:53:32 +02:00
Qt CI Bot
33edff40e4 Merge integration refs/builds/qtci/dev/1617884275 2021-04-08 17:03:20 +00:00
Mårten Nordheim
d32b93afb3 tst_qsslkey: Clean up #if-ery
It was more complex than needed in a few places.

Change-Id: I0609423f82420f72c65637cf398ccd7694ee85e5
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
2021-04-08 12:42:26 +01:00
Alexey Edelev
70464b355e Specify QT_TESTCASE_BUILDDIR for Qt::Test users implicitly
QT_TESTCASE_BUILDDIR was implicitly defined by Qt::Test target for
library users in Qt5. By default, this definition will point to
CMAKE_CURRENT_BINARY_DIR. This logic works similarly to qmake logic.

From user's perspective it might be useful to not rely on standard
search paths, but specify own. This can be done by setting the
QT_TESTCASE_BUILDDIR property for the user's target. CMake will
substute the value of the QT_TESTCASE_BUILDDIR property into the
QT_TESTCASE_BUILDDIR definition.

The implicit QT_TESTCASE_SOURCEDIR also seems to be useful. According
to the current logic, it points to CMAKE_CURRENT_SOURCE_DIR.

Fixes: QTBUG-92079
Change-Id: I8a9065f08e859c713b3c8cc08142a9ced0677770
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2021-04-08 13:16:41 +02:00
Milla Pohjanheimo
9224f8e99f Add binary compatibility files for Qt 6.0.0
Binary compatibility files added.

Pick-to: 6.0 6.1
Change-Id: I89fe7daae970af697ec57a414e3c90b24d4f9a86
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2021-04-08 06:34:13 +00:00
Qt CI Bot
b187ce87f9 Merge integration refs/builds/qtci/dev/1617813097 2021-04-07 21:01:58 +00:00
Qt CI Bot
fecba62d32 Merge integration refs/builds/qtci/dev/1617798649 2021-04-07 16:50:55 +00:00
Alexey Edelev
cbdce59cd2 Add the SIMULATE_IN_SOURCE argument to _qt_internal_test_expect_pass
test_QFINDTESTDATA builds the project in the source tree, this is
necessary because the test requires relative paths to the source file
names. This function could be useful for other tests, so it makes sense
to extend the _qt_internal_test_expect_pass/fail macros to support
build in the source tree.
Note that, the SIMULATE_IN_SOURCE argument doesn't build the test in
the existing source tree, but copies source files to the build tree
first to do not litter the source directory.

Change-Id: I16e790d74be2a0c5ca0593e0f88580dbe09882b9
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2021-04-07 17:56:57 +02:00
ChunLin Wang
b8802071ed Fix get out of bounds index in QSortFilterProxyModel::filterAcceptsRow
Before calling the index function, we need to check the validity of the parameters.

Fixes: QTBUG-91878
Pick-to: 5.15 6.0 6.1
Change-Id: I9ec7265fff3f81b8a288c4ba8fae606a2ec808a6
Reviewed-by: David Faure <david.faure@kdab.com>
2021-04-07 19:30:08 +08:00
Alexandru Croitor
d0c2425d79 CMake: Choose better defaults for qt_add_plugin STATIC/SHARED
There was a recent behavior change where the public CMake API
qt_add_plugin API took into account the value of BUILD_SHARED_LIBS
to decide whether the plugin should be a static or shared library.

Instead, use the following new behavior

 - If no explicit option STATIC / SHARED option is passed, default to
   whatever flavor Qt was built as.
   Aka if Qt was configured with -shared, qt_add_plugin defaults
   to creating shared plugins. If it's a -static Qt, create static
   plugins.
 - If an explicit STATIC / SHARED option is set, override the default
   computed value with the given value.

As a result BUILD_SHARED_LIBS does not affect Qt plugins anymore. This
is more in line with Qt expectations.

Add SHARED as a new valid option to pass to qt_add_plugin (it wasn't
before).

Add tests to check for the above behavior.

Amends aa4a1006cb

Pick-to: 6.1
Fixes: QTBUG-92361
Task-number: QTBUG-88763
Change-Id: Iae806024ddd5cf10cfe58ddbcebd2818084b0bd7
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
2021-04-07 10:10:55 +02:00
Qt CI Bot
604087361c Merge integration refs/builds/qtci/dev/1617702467 2021-04-06 14:51:16 +00:00
Fabian Kosmale
595b4e1a9b QList: Satisfy contiguous_range requirements
With C++20, there is a new iterator_category: contiguous_iterator, for
containers whose elements are stored contiguously in memory. In Qt 6,
QList satisfies this requirement.

However, we still need to tell the standard machinery about it. Step one
is to mark the iterators as contiguous_iterator; as that exists only in
C++20, we have to ifdef accordingly.
We also have to ensure that the iterators satisfy pointer_traits by
defining element_type due to how contiguous_range is specified. As this
runs afoul of LWG 3346, we check for known bad _GLIBCXX_RELEASE
versions.

Change-Id: I8c134544e694ba937e4d912393eb72fa75b49e3d
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
2021-04-06 11:35:35 +02:00
Alex Trotsenko
72d1a54763 QWindowsPipeReader: determine pipe state before signaling
The 'pipeBroken' flag must be updated before emitting the readyRead()
signal to avoid deadlock of waitForReadyRead() inside slot connected
to readyRead().

Change-Id: Ie393fdd594c6691da6609ea18307589b7157c624
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@gmx.de>
2021-04-06 11:27:41 +03:00
Alexandru Croitor
0e6c4224f0 CMake: Build minimal subset of tests in desktop static builds
Add new configure option -make minimal-static-tests and CMake option
QT_BUILD_MINIMAL_STATIC_TESTS. In conjunction with QT_BUILD_TESTS
it will enable building a minimal subset of tests when targeting
a static desktop Qt build.

In qtbase the minimal subset includes all the auto tests of testlib,
tools, corelib and cmake. In particular this will also do cmake build
tests and qmake build tests (tst_qmake)

Adjust CI instructions to enable building a minimal subset of static
tests when a platform configuration is tagged with the
MinimalStaticTests feature.

Fix and skip a few tests that were failing.

Pick-to: 6.1
Task-number: QTBUG-87580
Task-number: QTBUG-91869
Change-Id: I1fc311b8d5e743ccf05047fb9a7fdb813a645206
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
2021-04-06 09:15:37 +01:00
Heikki Halmet
c87847db87 BLACKLIST tst_qfont for Red Hat
Task-number: QTQAINFRA-4363
Task-number: QTBUG-84248
Pick-to: 6.1
Change-Id: I791aba3bf2b26f9c90201b1dcd67c2a85d28f08b
Reviewed-by: Jani Heikkinen <jani.heikkinen@qt.io>
2021-04-06 07:35:24 +03:00
Ivan Solovev
33786e7b02 Fix Q_OBJECT_COMPAT_PROPERTY_WITH_ARGS when using the signal
This commit amends 4ceaf22bed.
Signal parameter was not actually used, even is the signal was
specified.
This patch fixes it and also introduces unit-tests for this issue.

Change-Id: I029d413644eb6a72af3bdce27cc5f5bcadfe946a
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2021-04-03 17:21:30 +02:00
Samuel Gaist
bc00daae71 Add support to set thread priority to QThreadPool
Currently, QThreadPool's generated threads inherit the priority from the
thread they are created and that cannot be changed. This merge request
adds a property to QThreadPool so that the priority of the threads can
be different.

The default behavior does not change.

[ChangeLog][QtCore][QThreadPool] QThreadPool can now be configured to
use a different thread priority when creating new threads than the one
it inherits from the thread it was created in. This will only apply to
the threads started after the property is changed.

Fixes: QTBUG-3481
Change-Id: Ic98d4312d055a3357771abb656516ebd0715918d
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2021-04-03 09:14:55 +02:00
Qt CI Bot
bf6f0c6cac Merge integration refs/builds/qtci/dev/1617264361 2021-04-01 10:32:08 +00:00
Fabian Kosmale
4ceaf22bed QObjectCompatProperty: Emit signal in notfiy
There is no need to write emit and notify at the same time, as not
emitting after notify does not make sense.
This naturally only applies to properties with a changed signal.

Change-Id: I99ff7863a509262ad9d4f7c9c5afbc66fd37001c
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
2021-04-01 10:04:31 +02:00
Fabian Kosmale
2ffb91ac59 QObjectCompatProperty: Require explicit notify
For QObjectCompatProperty, which allows to do basically anything in its
setter, it is actually easier to manually specify when the change should
become visible. This is in line with manually writing emit calls in the
old property system, and allows the preservation of class invariants.

Change-Id: I585bd3f25d722ca3fd721ead85fe73dbee26c5f6
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
2021-04-01 10:04:27 +02:00
Piotr Mikolajczyk
2e3f48637e Linux: Add abstract address support for QLocal{Socket,Server}
Takes advantage of Linux's and Android's support for abstract namespace
when binding sockets, which is independent of the filesystem (see man
entry for unix domain sockets).

To make QLocalServer and QLocalSocket use an abstract socket address,
one needs to set the socket options to QLocalServer::AbstractNamespaceOption.

Fixes: QTBUG-16090
Change-Id: Ia9f9c9cc1ac5c28f9d44b0a48d854a7cfbd39b11
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2021-04-01 06:57:04 +01:00
Volker Hilsheimer
15b0809f06 Remove QEXPECT_FAIL for tests that pass now on Android
Fixes: QTBUG-69214
Fixes: QTBUG-69218
Fixes: QTBUG-69220
Change-Id: I8b780db8d9dad1a877bc16e802e6ae92de0c8f23
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
2021-03-31 17:31:12 +02:00
Qt CI Bot
293d556fb4 Merge integration refs/builds/qtci/dev/1617183127 2021-03-31 11:47:55 +00:00
Andreas Buhr
2b8f7c9b15 Fix some warnings
Change-Id: Ief00228f83e16421fb4eec4c678632d5c996624f
Reviewed-by: Karsten Heimrich <karsten.heimrich@qt.io>
2021-03-31 10:51:50 +02:00
Volker Hilsheimer
83d4ca3f66 Remove QEXPECT_FAIL from passing test
The test is blacklisted in dev and 6.1, let it fail properly. We can
watch the history of the test and remove the blacklisting if/when it
passes consistently on supported macOS versions.

Pick-to: 6.1
Task-number: QTBUG-20984
Change-Id: I3211ecf565995578c83a092c637890c0e8bfd766
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
2021-03-31 10:20:07 +02:00
Qt CI Bot
ae0fe7d4da Merge integration refs/builds/qtci/dev/1617116580 2021-03-30 17:19:59 +00:00
Qt CI Bot
5d5cc3c7c7 Merge integration refs/builds/qtci/dev/1617109351 2021-03-30 16:02:41 +00:00
Laszlo Agocs
7ccd2d0246 rhi: Add support for custom bytes-per-line for uncompressed raw data
Fixes: QTBUG-90770
Change-Id: Icba328c417bcce256e7b44f1d540af7f8e83376b
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Christian Strømme <christian.stromme@qt.io>
2021-03-30 16:43:35 +02:00
Qt CI Bot
31c81e08c6 Merge integration refs/builds/qtci/dev/1617098611 2021-03-30 13:30:26 +00:00
Giuseppe D'Angelo
0e778b96f1 tst_qobject: enable some tests for narrowing
Compilers are catching up, so some #if 0 codepaths can now be
conditionally enabled.

Change-Id: Ia9e87a096bc2ae4789ab390a9170d9c1eb9690d6
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2021-03-30 13:27:14 +01:00
Andrei Golubev
c34f51d58c Remove meaningless QT_NO_UNICODE_LITERAL check in QString literal tests
This check doesn't really do anything useful anymore: QStringLiteral
is used in Qt without any extra QT_NO_UNICODE_LITERAL #if-ery

Additionally, clean the related (and outdated) comment in
{QString, QByteArray}::literals()

Change-Id: I65b1eac33c5470508997be24f9ba6cf56d8578ea
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2021-03-30 10:37:13 +01:00
Andrei Golubev
b1377ed02d Add literal operators for QString and QByteArray
[ChangeLog][QtCore][QString] Added literal operator
u"..."_qs that converts a char16_t string literal to QString

[ChangeLog][QtCore][QByteArray] Added literal operator
"..."_qba that converts char string literal to QByteArray

Change-Id: I4aa59b28cc17bff346b378eb70008fb8185d21ac
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2021-03-30 10:37:07 +01:00
David Faure
b4aac2af19 QAbstractItemModelTester: fix false positive when model has zero columns
Regression introduced by me in commit 72e0d699ce

Fixes: QTBUG-92220
Change-Id: Ic7dd4eda0a1993f9763933882baf928bfc83b08b
Pick-to: 6.1 6.0 5.15
Reviewed-by: Luca Beldi <v.ronin@yahoo.it>
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2021-03-30 10:36:06 +02:00
Piotr Mikolajczyk
c80f262258 Android: Add select and copy capability to read-only text widgets
In case of a read-only text editing widget it was imposibble to copy text
from it. In QtWidgets you could not even see the selection handless.
Text selection in QtWidgets module was filtered depending on readOnly
property of the widget. Additionally, in InputMethod the read-only state
was translated into disabled.

Patch also makes the edit menu to be aware of the read-only status of
the control - the menu items are different for rw and ro controls.

Task-number: QTBUG-91417
Change-Id: Ic7b27f78678eeaa87a38607af787f254db1383b8
Reviewed-by: Rami Potinkara <rami.potinkara@qt.io>
Reviewed-by: Ville Voutilainen <ville.voutilainen@qt.io>
2021-03-30 10:35:59 +02:00
Volker Hilsheimer
ccf1a1a953 Replace QTextDocumentResourceProvider with a std::function
376e3bd8ec added the new class for Qt 6.1,
but during header review we concluded that using a class introduces
complexity wrt instance ownership and API design that can be avoided by
using a std::function instead.

The functionality is tied to QTextDocument, so the type definition and
the default provider API is added there.

Since std::function is not trivially copyable, the atomicity of the
previous implementation is not maintained, and concurrent modifications
of and access to the global default provider from multiple threads is
not allowed. The relevant use case can be supported by implementing a
resource provider that is thread safe.

Task-number: QTBUG-90211
Fixes: QTBUG-92208
Pick-to: 6.1
Change-Id: I39215c5e51c7bd27f1dd29e1d9d908aecf754fb7
Reviewed-by: Kai Koehne <kai.koehne@qt.io>
2021-03-30 08:11:27 +02:00
Andreas Buhr
dfe86d0150 Fix some warnings
Change-Id: I546300b4e630a2234c83c03ece65a08f4c8652d2
Reviewed-by: Sona Kurazyan <sona.kurazyan@qt.io>
2021-03-29 16:06:25 +02:00
Volker Hilsheimer
5925daf969 Silence a bunch of gcc warnings for the moc test
We deliberately expose moc to warning-worthy C++, but we don't want the
compiler warnings coming from those.

Change-Id: I09c36d7c8bfbb88f7bde61fa7bcc52a5adde81da
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2021-03-29 15:59:48 +02:00
Volker Hilsheimer
c8f6f8a222 Rename QUrlResourceProvider to QTextDocumentResourceProvider
While the class name is now a bit more than a mouthful, it's purpose
is very narrowly tied to QTextDocument, so don't use a very generic
name for it. That resources are provided based on a URL is to some
degree an implementation detail, and URLs are resource locators so
we don't need that in the class name.

Address code review comment for 6.1. Add documentation and links to
existing APIs with a similar purpose.

Task-number: QTBUG-90211
Task-number: QTBUG-92208
Pick-to: 6.1
Change-Id: I4f09057cc2f53a5595513c1c9422e6ccaad6ca13
Reviewed-by: Kai Koehne <kai.koehne@qt.io>
2021-03-29 15:59:40 +02:00
Alex Trotsenko
d8c6052815 Repair tst_qwineventnotifier
- add missing include
- fix platform detection in CMakeLists.txt

Change-Id: If7d04765eb40310d2841e792e8f80e083e067ad2
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2021-03-29 15:54:05 +02:00
Laszlo Agocs
9e662a0baf Skip a tst_QRhi test case with the Android emulator
Pick-to: 6.1
Task-number: QTBUG-92211
Change-Id: I63ff17b226d502189bc769b0b28640b849b8d39a
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2021-03-29 09:57:48 +02:00
Giuseppe D'Angelo
8b9c8d417b tst_qobject: fix the detection for GCC
Q_CC_GNU is defined on compilers that masquerade as GCC (Clang, ICC),
so using it to work around GCC-specific bugs is wrong. Introduce a
local define for _only_ GCC and use it in place of Q_CC_GNU.

Drive by: version-fence a test we now know it's been fixed upstream,
and correct the link to the corresponding bug report.

Pick-to: 5.15 6.0 6.1
Change-Id: I9059d6e6bf86157aca71590ac22afb1a1c114313
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2021-03-26 14:57:45 +01:00
Giuseppe D'Angelo
0b4ccbf81e QPainterPath: fix handling of fill rules
fillRule() contained a major blunder: instead of checking if the
d-pointer was allocated, and return a default value if it wasn't,
it checked whether the path contained any points. This means that

  QPainterPath p;
  p.setFillRule(x);
  Q_ASSERT(p.fillRule() == x);

was failing.

As a drive-by to test this change, fix another mistake in clear():
clear is documented to clear the elements in a path, but instead
it also changed the fill rule.

This commit partially reverses 697910e5fb.

Change-Id: Ieb8145694b672439c3380d9ccb87d1206a2dd115
Pick-to: 5.12 5.15 6.0 6.1
Done-with: Milian Wolff
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
2021-03-26 10:45:46 +01:00
Assam Boudjelthia
b9f27335e7 Rename QJniEnvironment exceptionCheckAndClear to checkAndClearExceptions
Address feedback from header view.

Task-number: QTBUG-90211
Pick-to: 6.1
Change-Id: Iad2b609598b16f66fd6ab09484fe6e6899981263
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2021-03-26 09:29:18 +00:00
Fabian Kosmale
cb43aaca11 Introduce QMetaObject::metaType
This function returns the metatype corresponding to the metaobject, or
an invalid metatype for namespaces.

This works as follows: First we increment the metaobject revision for
new metaobjects. Metaobjects with older revisions are handled by doing a
lookup by name. That fallback is also used for dynamic metaobjects (from
QtDBUS and those created by QMetaObjectBuilder).
For new metaobjects, we store the metatype in its metatype array, behind
the property metatypes. This avoids any changes to the property and
method metatype extraction logic: For properties, the metatype access
does not change, as the new metatype is after their metatypes. For
method metatypes, we already have an indirection layer (using offsets),
so by adjusting those offsets by one, the same logic keeps working.

To distinguish between namespaces and dynamic metaobjects, namespaces
store the metatypeinterface pointer for void in the metatype array,
whereas dynamic metaobjects store a nullptr.

One nice additional benefit is that this simplifies the generator logic
in moc, as the metatype array is now never empty.

Task-number: QTBUG-92077
Change-Id: Id3f920f28553f12032a71a1a87dad29e5374dbe7
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
Reviewed-by: Andrei Golubev <andrei.golubev@qt.io>
2021-03-25 17:33:07 +01:00
Qt CI Bot
9145650302 Merge integration refs/builds/qtci/dev/1616671507 2021-03-25 15:25:08 +00:00
Qt CI Bot
14eeb52085 Merge integration refs/builds/qtci/dev/1616667899 2021-03-25 13:40:30 +00:00
Qt CI Bot
5fb347c93d Merge integration refs/builds/qtci/dev/1616664803 2021-03-25 11:48:36 +00:00
Andreas Buhr
d4fd996363 Adapt Catch2 to Apple Silicon
We are still using Catch2 2.11.3 which is not adapted to Apple
silicon yet. This patch backports the required change
from Catch v3.0.0-preview.3.

Change-Id: Ifa14a1fdd6cd1f661c94a0a78648cb01bd9699c1
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2021-03-25 12:06:31 +01:00
Fabian Kosmale
ce83e56cfe QTypeInfo: Handle T::value_type being equal to T
Fix operator checks for containers whose value_type equals themselves.
It does  not make sense to recurse on value_type in that case. Thanks to
std::disjunction having short-circuiting semantics, we can avoid that
issue by checking first whether T is T::value_type.

As a drive-by, check for value_type typedef before checking for
begin/end in is_container. This works around an issue in gcc <= 8.1,
which fails to correctly SFINAE the case where begin and end are private
methods.

Pick-to: 6.0 6.1
Fixes: QTBUG-89456
Change-Id: I27305a7cfe050f13a279c07f00bc229c01daa25b
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
2021-03-25 11:22:29 +01:00
Joni Poikelin
e287582cba Fix removing columns when QSortFilterProxyModel has not been sorted yet
Fixes: QTBUG-91788
Pick-to: 6.1 6.0 5.15
Change-Id: Iddcafd3171f0f3703b94893a32b4ccaaeea9e713
Reviewed-by: David Faure <david.faure@kdab.com>
2021-03-25 11:32:22 +02:00
Andreas Buhr
ce8f7e0ebd Fix some warnings
Change-Id: I9460606cefd8c4b5c01e576043c1bc8660b19de4
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2021-03-25 09:24:03 +01:00
Qt CI Bot
65b4937f34 Merge integration refs/builds/qtci/dev/1616419842 2021-03-22 19:25:52 +00:00
Qt CI Bot
55fdd5e705 Merge integration refs/builds/qtci/dev/1616418060 2021-03-22 19:08:26 +00:00
Qt CI Bot
e8c3fc7c43 Merge integration refs/builds/qtci/dev/1616410126 2021-03-22 15:22:00 +00:00
Allan Sandfeld Jensen
c32cd44d34 Fix alpha handling of QImage::setPixel
It was treated differently depending on format, made it consistently
behave the same for all formats (following the behavior of the primary
formats).

Pick-to: 6.1 6.0 5.15
Change-Id: Ie24e19957d076fdf3ebd333074e26ede187489eb
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
2021-03-22 14:29:14 +01:00
Eirik Aavitsland
14ccc11194 lance tool: fix build for Qt 6
Pick-to: 6.1
Change-Id: I639ffa60609b1e6036252cccc146dd98fded0b3e
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
2021-03-22 13:59:40 +01:00
Zhang Yu
c47bb4478a Fix invalid pointer return with QGridLayout::itemAt(-1)
QGridLayout::takeAt() and QLayoutItem *itemAt() only check the upper bound.
If the index < 0, these function will return invalid pointer.

Fixes: QTBUG-91261
Pick-to: 5.15 6.0 6.1
Change-Id: Idfb9fb6228b9707f817353b04974da16205a835c
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
2021-03-22 18:47:36 +08:00
hjk
8403fc7796 Make it even more obvious on what to do when tst_toolsupport fails
Triggered by 6778b247.

Pick-to: 6.0 6.1 5.15
Change-Id: Ic8e7136cd82eb8d3891450cfa8994f43b7cc09fc
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2021-03-22 09:56:51 +01:00
Giuseppe D'Angelo
14f9f00fdb QSqlQuery: make it a move only type
QSqlQuery is a broken value class. Copying one object would mean
copying database state (the result set, the cursor position, etc.)
which isn't generally available for all database drivers.
For that reason, the current implementation does not honor value
semantics -- modifying a QSqlQuery object has visible side effects
on its existing copies (!).

The correct solution is to accept that QSqlQuery is a move only
type, not a value type. Add move semantics to it, and deprecate
its copies.

(We can't just *remove* copies in Qt 6 due to SC/BC constraints).

[ChangeLog][QtSql][QSqlQuery] QSqlQuery copy operations have
been deprecated. QSqlQuery copy semantics cannot be implemented
correctly, as it's not generally possible to copy a result set
of a query when copying the corresponding QSqlQuery object. This
resulted in modifications on a QSqlQuery having visible (and
unintended) side effects on its copies. Instead, treat QSqlQuery
as a move-only type.

Fixes: QTBUG-91766
Change-Id: Iabd3aa605332a5c15c524303418bf17a21ed520b
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Andy Shaw <andy.shaw@qt.io>
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2021-03-21 10:16:56 +01:00
Fabian Kosmale
411ab34c96 QMetaObjectBuilder: remove unused serialization code
Change-Id: I73a13265a69079581d2974400b3311d3fdfda2d0
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2021-03-20 10:24:27 +01:00
Fabian Kosmale
919425cb3a Merge "tst_bench_qmetaobject: Fix test" 2021-03-19 15:52:31 +00:00
hjk
b38b9e2bb0 Merge "Tests: Clarify the course of actions when touching tst_toolsupport" 2021-03-19 14:35:26 +00:00
Fabian Kosmale
ed3df88846 tst_bench_qmetaobject: Fix test
The code has apparently been broken for quite a while, probably since
the change that made the QObject constructor invokable.

Fixes: QTBUG-91710
Pick-to: 6.0 6.1 5.15
Change-Id: I8b7e6c8a579913b3d0e2a364ffdbffe8d404c72b
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2021-03-19 14:37:51 +01:00
hjk
8b5561c7ee Tests: Clarify the course of actions when touching tst_toolsupport
Change-Id: Ifc9caa8f1b05cd642c1bb57b0f37866de97ca2c2
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2021-03-19 13:07:03 +01:00
Laszlo Agocs
19384f2e8f rhi: Make it possible to clone a QRhiRenderPassDescriptor
Pick-to: 6.1
Task-number: QTBUG-91888
Change-Id: Ib6d2e639e6c24f3e9a733c6563dc8a6d6da47719
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
2021-03-19 10:46:23 +00:00
Thiago Macieira
969337bcfd QHostAddress: prepare moving NetworkLayerProtocol from QAbstractSocket
This can only be completed in Qt 7, due to BC guarantees. I've only
updated the source code for QHostAddress and its unit test and even then
I did not touch the documentation. This needs to be completed in Qt 7.0

Change-Id: I26b8286f61534f88b649fffd166b695882f8f3b5
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2021-03-18 19:54:01 -08:00
Volker Hilsheimer
180f78d126 QDial: use qRound to round
The calculation rounds early and often, which is intentional. Add
unit test to make sure we don't regress.

Fixes static analzyer report about incorrect rounding in
c903a34347776fe3b89785faa35c446d.

Address some outdated comments and documentation. The property
is read only and calculated, so don't imply that it can be changed
from its default value.

Change-Id: If2dbd9890e533dfccda3eae4cbc96db4f1246f4d
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
2021-03-18 22:34:13 +01:00
Edward Welbourne
9d3a7c72ad Extend system zone test to check it matches LocalTime
Test we get the same starts of various days. Some coming changes shall
break some of these, but they should all be back to working by the
time we're taking account of DST before 1970 as well as after.

The first two or three test-cases work by accident in most zones, at
present, due to the zone-based code-path ignoring the LMT period
before the zone's first transition; but Europe/Helsinki had a renaming
transition in 1878, so does see its pre-zone offset between then and
the switch to UTC+2 in 1921, leading to failures in exactly the zone
Coin tests.  So suppress these three test-cases pending later fixes.
On Windows, the next text (still pre-epoch) gets bogus zone data for
its LocalTime, so suppress that likewise.

Task-number: QTBUG-80421
Change-Id: I2264e0e436d92112b03264faa410e30057b8f73b
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2021-03-18 15:30:48 +01:00
Andrei Golubev
f49c6a5672 Merge "Rename QList test to something meaningful" 2021-03-18 10:10:23 +00:00
Andrei Golubev
a2b362f2db Rename QList test to something meaningful
qtbug_xxxxx is a fairly ambiguous test name

Change-Id: I4b407160464c9b8300d3683549b0ede837161e7b
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2021-03-18 08:31:38 +01:00
Eskil Abrahamsen Blomfeldt
d860aaa200 Disable two tests in tst_QAccessibility on Wayland
These two tests (applicationTest() and mainWindowTest())
require QApplication::setActiveWindow() to work, which it
does not on Wayland.

Task-number: QTBUG-91418
Change-Id: I0e7b4e24050684b437de63d19bd885bab53d36b9
Reviewed-by: Liang Qi <liang.qi@qt.io>
Reviewed-by: Tony Sarajärvi <tony.sarajarvi@qt.io>
2021-03-18 07:58:42 +01:00
Volker Hilsheimer
48ce0bed62 Merge "QSqlError: protect against self-assignment" 2021-03-17 19:51:49 +00:00
Volker Hilsheimer
5a2ee82f2c Disable security warnings from MSVC in tests
MSVC generates the following for those tests:
warning C4996: '_open': This function or variable may be unsafe. Consider using _sopen_s
instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online
help for details.

We need to set the define before any C runtime headers are included, so
do it right away, it doesn't do any harm on other compilers.

Change-Id: Ia25afb87934058c3f27e63820eeb2db063a627f1
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2021-03-17 17:22:00 +01:00
Timur Pocheptsov
b477d823ad Convert QSslSocket(Backend)Private into plugin
All backend-specific code is now separated and removed
from QSslSocket(Private) code. The original code is mostly
preserved to avoid (as much as possible) regressions (and
to simplify code-review).

Fixes: QTBUG-91173
Task-number: QTBUG-65922
Change-Id: I3ac4ba35d952162c8d6dc62d747cbd62dca0ef78
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
(cherry picked from commit 9391ba55149336c395b866b24dc9b844334d50da)
2021-03-17 16:25:37 +01:00
Alexey Edelev
fac23d695f Merge "Rework the failure macros in the Qt CTest kit" 2021-03-17 15:15:38 +00:00
Alexey Edelev
fec5b8e81c Rework the failure macros in the Qt CTest kit
The _qt_internal_test_expect_fail macro fails when the test fails
during the configuration step. Rename this macro to
_qt_internal_test_expect_build_fail and add
the _qt_internal_test_expect_fail macro that expects inverted test
result.

Change-Id: I4635e99152f7a32f5c48202e84fec59800453d34
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2021-03-17 13:34:39 +01:00
Volker Hilsheimer
5c396be4e3 Port away from deprecated QVariant::type
Use QMetaType instead to silence compiler warnings.

Pick-to: 6.1
Change-Id: Ic28b3406ddcd51935f42779e7708ea8a459d3a9e
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2021-03-17 12:57:39 +01:00
Fabian Kosmale
a7f24218e3 tst_qguimetatype: Avoid deprecated methods
This makes the 5.15 and 6.x branches more comparable, as in 6.0 the
preferred way is to use the non-static methods (which avoids an
expensive lookup in 6.x).
As a drive-by, Avoid memory leaks if the test fails.

Pick-to: 6.0 6.1 5.15
Change-Id: I95b133342a4ea19dd23c235a408f38089706412b
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2021-03-17 10:19:10 +01:00
Eskil Abrahamsen Blomfeldt
6b82a3287f Fix tst_QPushButton tests on Wayland
The tst_QPushButton::sizeHint() test was leaking top level
windows and confusing the other tests, as they may end up
becoming active.

This also re-enables tst_QPushButton::setAccel() since I
cannot reproduce the failure with that, so maybe that was
related to the leaking widgets.

Task-number: QTBUG-91418
Change-Id: I33f4a12bf67f784c5d6a06b2407d067e804d766f
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Reviewed-by: Liang Qi <liang.qi@qt.io>
2021-03-16 08:08:49 +01:00
Eskil Abrahamsen Blomfeldt
75c1038311 Skip tst_QDockWidget::restoreDockWidget on Wayland
There is something wrong with dock widget positioning on Wayland.
In the interest of getting tests running at all, we skip the
test for now, like we already do with a few others.

Task-number: QTBUG-91418
Task-number: QTBUG-91483
Change-Id: I44f5fa0e4d0a43a46ce24a61a899bfcc03787f28
Reviewed-by: Liang Qi <liang.qi@qt.io>
2021-03-16 08:08:43 +01:00
Morten Johan Sørvig
f9f9004b40 Add auto-test for QT_USE_PHYSICAL_DPI
Test that setting QT_USE_PHYSICAL_DPI uses physical
DPI instead of logical DPI.

Change-Id: I7f89cf1af5e013454cc3d8ec3559f2719514fea3
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2021-03-15 11:49:59 +01:00
Morten Johan Sørvig
f0bf7667a9 Auto-test some high-dpi env variables
Add auto-tests for QT_SCALE_FACTOR and QT_SCREEN_SCALE_FACTORS

Change-Id: I57bffa266be910f2ba26cb1a870e09ae202fcae0
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2021-03-15 11:49:56 +01:00
Eskil Abrahamsen Blomfeldt
a5573cfbd5 Merge "Fix tsts_QShortcut::keys on Wayland" 2021-03-15 09:57:01 +00:00
Eskil Abrahamsen Blomfeldt
fe54c879cc Fix tsts_QShortcut::keys on Wayland
Wayland doesn't support explicit window activation, so the
qWaitForWindowActive() function won't actually wait for the
window to be active.

On platforms like this, we just QTRY_VERIFY() for the window
activation instead.

Task-number: QTBUG-91418
Change-Id: I5f728e6a6bcaac283c026b60e6378b9d5aaf1be5
Reviewed-by: Liang Qi <liang.qi@qt.io>
2021-03-15 08:21:40 +01:00
Eskil Abrahamsen Blomfeldt
2bf9061760 Skip tst_qwindow test when running on Wayland
The tst_qwindow test failed with a warning that programmatically
moving the mouse cursor is not possible with Wayland.

Task-number: QTBUG-91418
Change-Id: I02ceb2af43fbc83a4e6ae09718315f5f79ff8285
Reviewed-by: Liang Qi <liang.qi@qt.io>
2021-03-15 08:17:41 +01:00
Eskil Abrahamsen Blomfeldt
5552d3d446 Fix tst_qwidget_window::mouseMoveWithPopup on Wayland
The test assumed that a window was registered as the active
one immediately when it was exposed. This created a race
condition on Wayland, where we would often get the wrong
active window when simulating the events.

Task-number: QTBUG-91418
Change-Id: Ie41fe5adb339bbb43d5ee5db400a198e479de386
Reviewed-by: Liang Qi <liang.qi@qt.io>
2021-03-15 08:17:34 +01:00
Eskil Abrahamsen Blomfeldt
22ff16dc72 Make tst_qwidget pass on Wayland
Several tests failed due to side effects of client side
decorations. We explicitly disable this when initializing
the test to make things go smoother.

In addition, the setToolTip() test tries to set the mouse
cursor position programmatically, which is not possible
on Wayland.

And finally, the qWaitForWindowActive() falls back to
qWaitForWindowExposed() on platforms where explicit window
activation is not supported. This fixes a few issues, but
in cases like focusProxy(), it means we aren't actually
waiting for the WindowActivation event. Instead of testing
for exposed twice on such platforms (Wayland), we replicate
the logic from qWaitForWindowActive() instead and rely on
automatic window activation. If it fails, we do a QSKIP, so
this shouldn't cause any flaky test failures at least.

Task-number: QTBUG-91418
Change-Id: I767c881e7cdc91f43ad357294a2c6240ab1af43c
Reviewed-by: Liang Qi <liang.qi@qt.io>
2021-03-15 08:17:31 +01:00
Andrei Golubev
f226854d25 Fix QMultiHash::count(key) crash
As QMultiHash uses a pointer for the data, nullptr dereference is a
thing, so check for valid d before doing anything in count()

Fixes: QTBUG-91704
Pick-to: 6.0 6.1
Change-Id: Ia20440cd7bdc03cb09c77f796fb9c5b52765eac5
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2021-03-12 08:38:42 +01:00
Volker Hilsheimer
674747bac1 Revert "QPushButton: fix support of style sheet rule for text alignment"
This reverts commit 6269438af9, and adds a test.

This change introduced QTBUG-91735, without fixing QTBUG-86857 correctly. The
code already interprets the textAlignment values from the rule, also if no
icon is set. Adding the same, or some default textAlignment to the text flags
if there is no icon doesn't work.

Fixes: QTBUG-91735
Task-number: QTBUG-86857
Pick-to: 6.1 6.0 5.15
Change-Id: Iee07e63a40e72909275f32e1caa28b33a595f879
Reviewed-by: Oliver Eftevaag <oliver.eftevaag@qt.io>
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
2021-03-11 22:30:22 +01:00
Fabian Kosmale
e8b7e4e96a QObject: remove QAbstractDeclarativeData::parentChanged
The code in qtdeclarative did not do anything at all anymore.

Change-Id: Idd97145cb74aeb4f43dfce2f282a765e90945073
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2021-03-11 14:53:26 +01:00
Mårten Nordheim
f274f91ceb QEventDispatcher(Win): Always honor interrupted status to avoid races
There may be a race where e.g. thread 'B' is woken up by a queued invoke.
At the same time thread 'A' asks 'B' to quit, which will set various
atomics (some important ones are 'interrupt' in the dispatcher and
'exit' in the event loop), but it does _not_ try to send another wake
since there is already an unhandled wake triggered by 'B' itself.
Sadly 'B' reads the 'exit' atomic before 'A' updates it.
Then, slightly before, 'B' sets 'interrupt' back to 0, 'A' write 1 to
it, meaning 'A's interrupt is ignored. Then, since there is no
interrupt, 'B' goes back to waiting for events, leaving the thread alive
and running instead of quitting.

Maybe this has unforeseen consequences (one consequence is that it will
return and re-enter the event dispatcher once more, possible
unnecessarily)

Fixes: QTBUG-91539
Pick-to: 6.1 6.0 5.15
Change-Id: Ie6f861f42ffddf4817d5c8af2d764abe9d9103c2
Reviewed-by: Alex Trotsenko <alex1973tr@gmail.com>
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2021-03-11 12:11:18 +01:00
Eskil Abrahamsen Blomfeldt
d16b171f1b Make tst_shortcut pass on Wayland
There was a race condition in the test, since the window
might be exposed before the event to activate the
application has been received. And the short cut is not
triggered before the application is active, which
means it could just be discarded and the window would
never be closed.

This happened consistently when testing on Wayland.

Task-number: QTBUG-91418
Change-Id: I40cb143985175f5f2b5405e9502a48475c93074a
Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
2021-03-11 11:59:14 +01:00
Eskil Abrahamsen Blomfeldt
ea310c1d0f Fix tst_QDialog::keepPositionOnClose on Wayland
The test assumed that dialog.move() would actually move
the dialog box to the requested location, which is an invalid
assumption on Wayland.

Since the objective of the test is not to check if move() works
this way, but to check whether the dialog box shows up in the
same location when it is re-shown, we actually fetch the pos
after showing it the first time, rather than assume this is the
same as the requested one.

Task-number: QTBUG-91418
Change-Id: Ifa21fa08429f198988f90d7ee328e4f35a4764c2
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
2021-03-11 11:59:02 +01:00
Eskil Abrahamsen Blomfeldt
30245c8515 Skip tst_QOpenGL::glxContext test on Wayland
This test depends on XCB, but is only protected by a build-time
flag, so it will be executed as long as XCB is available at
build-time. Do as with the offscreen backend and just skip it
when a different platform plugin is in use.

Task-number: QTBUG-91418
Change-Id: Ida076dc81d0740af2cec164bd40ca10d16345f05
Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
2021-03-11 11:58:42 +01:00
Eskil Abrahamsen Blomfeldt
3416e5423e Merge "Fix tst_qgraphicseffect on Wayland" 2021-03-11 10:52:55 +00:00
Eskil Abrahamsen Blomfeldt
100840a4fb Fix tst_qgraphicseffect on Wayland
If we only wait until the window is shown before testing the
event delivery, we may be getting a WindowActivation event
and subsequent paint event after we start testing. This can
cause a shift in the paint events, so that we end up with an
unexpected paint event at the end.

We should wait until the window is active before we start
checking the response to updates, to be sure nothing is pending
on the queue still.

Note that you'd expect QTest::qWaitForWindowActive() to do this,
but this actually falls back to qWaitForWindowExposed() when
the platform does not have WindowActivation capability. While
there is no real link between WindowActivation capability and
waiting for a window to be active, changing the behavior of that
function would be too scary, so we just implement an explicit
wait in the functions that depend on this.

Task-number: QTBUG-91418
Change-Id: Iee40dcfa1377f543ea05042cc5a972270b346708
Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
2021-03-11 08:04:21 +01:00
Eirik Aavitsland
bea214e765 Fix: QBrush autotest failure on Android and Wayland
Since Qt 5.5, brush textures are stored as QImages. If the texture has
been set as a QPixmap, the conversion to QImage may change its pixel
format, depending on the native system format. That is acceptable.

Fixes: QTBUG-69193
Task-number: QTBUG-91418
Change-Id: Ic4dbeaa552b1f2183774a011e38414855a9dc4b1
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
2021-03-11 07:03:45 +00:00
Andreas Buhr
d0ba43f0f5 Fix warnings about marking functions override
Change-Id: I7737469d3016f9522e497b443edd864fa4d714cc
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2021-03-10 23:21:32 +01:00
Fabian Kosmale
3e46c22d94 tst_qguivariant benchmark: Only use valid QMetaTypes
Otherewise, we hit an assertion because the name is empty.

Fixes: QTBUG-91709
Pick-to: 6.0 6.1
Change-Id: I03a530d64ea8dead3efc5fcb8c00909388a387d0
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2021-03-10 18:00:39 +01:00
Fabian Kosmale
90dc1f9204 tst_bench_qguimetatype: only consider valid metatypes
Otherwise the benchmark crashes as the data tag for the row would be
empty.

Fixes: QTBUG-91708
Pick-to: 6.0 6.1
Change-Id: I484ded5b8670571b80012e64d67846d3b8db5320
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2021-03-10 17:59:49 +01:00
David Faure
1d567eb63d Merge "QConcatenateTablesProxyModel: skip dataChanged in hidden columns" 2021-03-09 15:32:01 +00:00
David Faure
f6efbd23b5 QConcatenateTablesProxyModel: skip dataChanged in hidden columns
When the source models don't have the same number of columns, the proxy
keeps only the smallest number of columns across all source models.
Afterwards, if a source model emits dataChanged in a column past
that number (a "hidden" column), the proxy needs to ignore it rather than
assert.
But also, if the source model emits a dataChanged signal across both
visible and hidden columns, then the last column number needs to be
adjusted so that the signal is correctly processed and forwarded.

Task-number: QTBUG-91253
Pick-to: 6.1 6.0 5.15
Change-Id: I939e8ec0faf41370472f86785851292e4372f72c
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
2021-03-09 13:39:45 +01:00
Laszlo Agocs
80029e0ca6 rhi: gl: Fix missing uniform data with certain command lists
Following patterns from the other backends is insufficient with OpenGL
because we do not use real uniform buffers. There is currently a
possibility that a shader program will be bound without following it
with setting uniforms. Correct this by having a second level of tracking
of the associated srb object in the pipelines.

Pick-to: 6.0 6.1
Fixes: QTBUG-91630
Change-Id: I74a012daade826dd22c436bde06381c1233bad11
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
2021-03-09 12:00:48 +01:00
Eskil Abrahamsen Blomfeldt
a6cdf41310 Fix testlib/tst_selftests::keyboard on Wayland
Wayland does not support WindowActivation capability, which
will trigger a warning in qWaitForWindowActive(). Since the
selftests depend on matching the exact output of the tests,
it gets confused by this, even though the tests are passing.

So we suppress the warning when the capability is not
supported.

Change-Id: I1e1f530a7b237183ee4ef123618e868b746ba863
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2021-03-09 07:42:50 +01: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
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
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
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
Øystein Heskestad
de658d8ca5 Merge "Make qdecompresshelper archive bomb check only trigger for large files" 2021-03-05 16:32:49 +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
Ø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
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
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
Allan Sandfeld Jensen
9fb81fc287 Merge "Add QColorSpace::description" 2021-03-05 00:04:34 +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
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
Friedemann Kleint
b62725608b Blacklist test QMenu::QTBUG_89082_actionTipsHide() for Windows
Apparently, ba13960392 is not
sufficient.
Amends 3f3d5e6716.

Pick-to: 6.0 6.1 5.15
Task-number: QTBUG-89082
Change-Id: I80a00abb330bebd3be8667762c279c2eef595c7f
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
2021-03-04 08:43:33 +00:00
Friedemann Kleint
65c6fbea24 Stabilize test QMenu::QTBUG_89082_actionTipsHide() on Windows, take 2
Use the QWindow-based overloads of QTest::mouseMove(), which do
not move the cursor position.

Amends ba13960392,
3f3d5e6716.

Task-number: QTBUG-89082
Pick-to: 6.0 6.1 5.15
Change-Id: I2cc62e4d1f24e4baebafd0d76fbf0fbdb6f588c7
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2021-03-03 10:16:30 +01:00
Friedemann Kleint
4b15a8ea8f Prospective fix for flaky test tst_QDoubleSpinBox::setReadOnly()
The test has been observed to fail with:

 FAIL!  : tst_QDoubleSpinBox::setReadOnly() 'QTest::qWaitForWindowActive(&spin)' returned FALSE. ()
 /Users/qt/work/qt/qtbase/tests/auto/widgets/widgets/qdoublespinbox/tst_qdoublespinbox.cpp(863) : failure location

Remove the widget member and use a widget instantiated on the stack instead.
Add a check for top level widget leaks in cleanup() and fix leaking task224497_fltMax()
by instantiating the widget  on the stack.

Pick-to: 6.1
Change-Id: Idbbb5d859c0df2d9b9f49fb9f69ef6bb7d1ee150
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2021-03-03 10:16:22 +01:00
Alex Trotsenko
f265c87e01 Allow QWindowsPipe{Reader|Writer} to work with foreign event loops, take 2
When a foreign event loop that does not enter an alertable wait state
is running (which is also the case when a native dialog window is
modal), pipe handlers would freeze temporarily due to their APC
callbacks not being invoked.

We address this problem by moving the I/O callbacks to the Windows
thread pool, and only posting completion events to the main loop
from there. That makes the actual I/O completely independent from
any main loop, while the signal delivery works also with foreign
loops (because Qt event delivery uses Windows messages, which foreign
loops typically handle correctly).

As a nice side effect, performance (and in particular scalability)
is improved.

Several other approaches have been tried:
1) Using QWinEventNotifier was about a quarter slower and scaled much
   worse. Additionally, it also required a rather egregious hack to
   handle the (pathological) case of a single thread talking to both
   ends of a QLocalSocket synchronously.
2) Queuing APCs from the thread pool to the main thread and also
   posting wake-up events to its event loop, and handling I/O on the
   main thread; this performed roughly like this solution, but scaled
   half as well, and the separate wake-up path was still deemed hacky.
3) Only posting wake-up events to the main thread from the thread pool,
   and still handling I/O on the main thread; this still performed
   comparably to 2), and the pathological case was not handled at all.
4) Using this approach for reads and that of 3) for writes was slightly
   faster with big amounts of data, but scaled slightly worse, and the
   diverging implementations were deemed not desirable.

Fixes: QTBUG-64443
Change-Id: I66443c3021d6ba98639a214c3e768be97d2cf14b
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@gmx.de>
2021-03-02 22:53:06 +02:00
Morten Johan Sørvig
ee409e6f0c High-DPI: Set the minimum scale factor to 1
Avoid painting errors with dpr < 1, also for the PassThrough
mode.

This limits the minimum high-dpi scale factor to 1,
for the code path which determines the scale factor
based on screen DPI.

Pick-to: 6.1
Task-number: QTBUG-89948
Change-Id: I14b3f130f0ae141d5f05c87437f926a9f76d1dec
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2021-03-02 13:36:38 +00:00
Friedemann Kleint
ba13960392 Stabilize test QMenu::QTBUG_89082_actionTipsHide() on Windows
Move the cursor out of the way to prevent it from interfering.
Amends 3f3d5e6716.

Task-number: QTBUG-89082
Pick-to: 5.15
Pick-to: 6.0
Change-Id: I0efbe2b5618a04e92839083a1bd3383e05d6ff93
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
2021-03-02 11:02:20 +01:00
David Faure
101581484b QCommandLineParser: fix crash if there's no QCoreApplication
It'll display <executable_name> instead in the help output.

Fixes: QTBUG-91430
Change-Id: Ib6211b24cdaa4683a4f62c90b5a1a20ba69f1cff
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2021-03-01 23:03:00 +01:00
Fabian Kosmale
9d6ba110e8 QMetaType: Store QMetaObject for pointer to const QObject, too
Before this change, the QMetaType for T const* where T is derived from
QObject would not store the static QMetaObject of T. This commit changes
this. As a consequence, the metatype system can now convert between
const and non-const pointers to QObject. Note that this allows casting
const away; but so does C++ with const_cast.
In addition, a new flag, QMetaType::IsImmutable is introduced, and used
to tag the metatypes of pointer to const types. This allows code to
discern between pointers to mutable and const QObjects, which is
relevant for the QML engine.

Task-number: QTBUG-82354
Change-Id: I3e4e4f39f565bd99a65e161528ce5304df73d6d6
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
2021-02-26 09:10:31 +01:00
Giuseppe D'Angelo
0e22001a3b Add more support for structured bindings
After QPoint(F), it's now the time of QSize(F) and QVectorND,
which can be unambiguously decomposed.

[ChangeLog][QtCore][QSize] QSize is now usable in a structured
binding declaration.

[ChangeLog][QtCore][QSizeF] QSizeF is now usable in a structured
binding declaration.

[ChangeLog][QtGui][QVector2D] QVector2D is now usable in a
structured binding declaration.

[ChangeLog][QtGui][QVector3D] QVector3D is now usable in a
structured binding declaration.

[ChangeLog][QtGui][QVector4D] QVector4D is now usable in a
structured binding declaration.

Change-Id: I67bb152f4210f2be27607179cd2ec522174cc483
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2021-02-25 16:08:44 +01:00
Sona Kurazyan
5a3bbb5585 tst_QFuture::continuationsWithContext: fix the flakiness
When attaching a continuation with the default (QtFuture::Launch::Sync)
policy, it will be launched in the same thread where the parent has
been executing, or in the thread where the parent lives, if the
continuation is attached after the parent has already finished. Fixed
the test-case to make sure the continuations are attached while the
parent is still running, so that they can be resolved in the parent's
context.

Fixes: QTBUG-91373
Pick-to: 6.1
Change-Id: I82b3b0c47b76d121b44bd512659c08b3b474e351
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2021-02-25 16:08:43 +01:00
Allan Sandfeld Jensen
c2bec047e2 And fix handling and test of QImage::fill(uint) as well
Only RGB444 and RGB666 were treated slighlty different from the rest,
but the test had a few additional mistakes.

Pick-to: 6.1 6.0 5.15
Change-Id: I4728b4036affedfffce8bca5c1e7be3869344fbe
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
2021-02-25 09:46:55 +01:00
Edward Welbourne
e8c52d0e8c Fix transitionEachZone() failures on Android
In QTimeZonePrivate::dataForLocalTime(), mistrust the Android
backend's hasDaylightTime(), as it has a comment saying it only knows
about future transitions, not past. This caller of it really needs to
query "has ever had a transition", which this doesn't answer. Many
zones that have no plans for future transitions have had transitions
in the past; these were failing the transitionEachZone() test.

In the process, refine the test itself, making sure we catch some
quirk cases that shouldn't arise and making the debug message on
failure more informative (while eliding the zone name, as this is part
of the test name anyway, so added to the output by qDebug() itself).

Fixes: QTBUG-69131
Change-Id: I88a0528182c247acb8b6327b40516178e455bcc0
Reviewed-by: Andrei Golubev <andrei.golubev@qt.io>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2021-02-24 12:08:57 +01:00
Joerg Bornemann
1f30bcf336 Move build tools to libexec instead of the bin dir
[ChangeLog][Build System] Tools that are called by the build system and
are unlikely to be called by the user are now installed to the libexec
directory.

This is a step towards easier co-installability of different Qt
versions.

Pick-to: 6.1
Task-number: QTBUG-88791
Change-Id: Id19575b5ba27795f7715e4ea6a09391b26dd4942
Reviewed-by: Kai Koehne <kai.koehne@qt.io>
2021-02-23 17:02:30 +01:00
Morten Johan Sørvig
700d1037aa Verify that QFileIconProvider returns valid pixmaps
Extend and rename the pixmap() crash test to also verify
that a non-null pixmap is returned.

Change-Id: Ia972c4f705724cfa1394521a2dfd87451d9c5d64
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
2021-02-23 15:34:05 +01:00
Andreas Buhr
a944de7742 Fix some warnings about virtual/override
This patch marks some functions "override" to silence the corresponding
warning.

Change-Id: I88ccc5fa7521ecccc84a6cba9f06ea185cc5679e
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
2021-02-23 15:15:45 +01:00
Thiago Macieira
d012e953bf QProcess/Unix: remove outdated notices about use of posix_spawn() on QNX
We haven't used the spawn functionality on QNX since Qt 5.7 (commit
005a8bfbf0) because that's when we dropped
support for QNX 6.5.0.

Change-Id: Ic90d8429a0eb4837971dfffd1664f9712bdce2d8
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@gmx.de>
2021-02-21 22:48:38 -08:00
Thiago Macieira
5d977b0fd2 QProcess::startDetached/Unix: report which function failed
Like QProcess::start().

Pick-to: 6.1
Change-Id: Ic90d8429a0eb4837971dfffd1664ef1293a6523d
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@gmx.de>
2021-02-21 22:48:30 -08:00
Thiago Macieira
73a04edce1 QProcess::startDetached: set the error condition on failure to start
And set *pid to -1.

[ChangeLog][QtCore][QProcess] If a startDetached() fails to start the
target application, the QProcess object should now have a proper error
string in errorString().

Pick-to: 6.1
Change-Id: Ic90d8429a0eb4837971dfffd1664e825ffcb923e
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@gmx.de>
2021-02-21 18:46:28 -08:00
Timur Pocheptsov
43d933bf50 Port QSslKey to the new plugin-based implementation
The idea is to have QSslKey(Private) backend-neutral and hide
all library-specific code inside plugins.

Fixes: QTBUG-90953
Task-number: QTBUG-65922
Change-Id: I2eeee3b2b72c78c2e24f2fb914abce3caa913be8
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
(cherry picked from commit 0352cf8e1bf57615b9faf3f6f383896444e762ac)
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
2021-02-19 11:57:05 +01:00
Thiago Macieira
31bb141aed QProcess::startDetached/Unix: move up the chdir() and remove qWarning
That qWarning cannot be in the child process (we don't know if a user
logger is fork-no-exec-safe) and the failure to chdir() should be
reported as a failure in QProcess::startDetached() instead.

Change-Id: Ic90d8429a0eb4837971dfffd1664e7577c81610b
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@gmx.de>
Reviewed-by: David Llewellyn-Jones <david.llewellyn-jones@jolla.com>
2021-02-18 12:34:17 -08:00
Ulf Hermann
a2e23bca0f QJsonObject: Fix operator<=()
We had a copy-paste error there.

Pick-to: 6.0 6.1
Change-Id: Ib1448197ac4f4641c6559f133f41dcf326f210f1
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2021-02-18 11:22:51 +00:00
Andreas Buhr
0955b610bd Fix warning about unused variable
I get a warning about the variable t_var being set but not used.
This patch fixes the warning.

Change-Id: Ib2df5ed2dddd283eb87f71a8b85951d1f67f04f2
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2021-02-18 11:25:01 +01:00
Edward Welbourne
6fa9f487db Return early after test-helpers if they fail
The QTimeZone tests have some helper functions to test details of a
QTZP instance; these use QCOMPARE(), so may return early on failure.
The callers then need to notice the failure and, in their turn, also
return.

Change-Id: I0a188e9641ced70c9ffedd95e91f39681fad768a
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Andrei Golubev <andrei.golubev@qt.io>
2021-02-18 11:21:03 +01:00
Edward Welbourne
60fd2808f6 Skip a timezone transition test on Android
Its back-end lacks transition data, so the test can't possibly
succeed. Make the skip conditional on the tested zone having
transitions, so that the test will come back into play if we ever gain
support for transitions on Android.

Fixes: QTBUG-69129
Change-Id: Ie4f96601b8b18cd496efbde7cf2557875cf3c1c9
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Andrei Golubev <andrei.golubev@qt.io>
2021-02-18 11:20:23 +01:00
Samuli Piippo
71eef476d7 tst_qprocess: enable test again for cross-compilations
All test cases pass with QEMU.

Fixes: QTBUG-85287
Fixes: QTBUG-67760
Pick-to: 6.1
Change-Id: I188d70c05f6d858e17f1099d3c02862ea9b2a2ab
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2021-02-16 07:26:19 +02:00
Tor Arne Vestbø
09cc63d425 tst_qapplication: Prevent desktopaware test from deactivating main test
Applications on macOS are automatically activated (put into the foreground),
when launched from the Finder, or via 'open' on the command line. But when
launched from the terminal, e.g. foo.app/Contents/MacOS/foo, the application
will launch in the background (inactive).

In Qt we override this behavior, activating the app even when launched from
the terminal, as a convenience, as long as the application is a GUI application.

Unfortunately this means that when tst_qapplication launches a subprocess that
is a GUI app, it will steal activation from tst_qapplication, which in turn
will break tests that later try to activate a window and check that the window
is then active. The window will not be active until the application is active.

We can work around it by preventing Qt from activating the application, but
ideally we'd find a better solution to this, as we don't want to sprinkle
overrides all over our tests.

Fixes: QTBUG-90699
Pick-to: 6.1 6.0 5.15
Change-Id: If53a86548002b739df0c0a7153d6244924a4a205
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
2021-02-15 14:20:08 +01:00
Andreas Buhr
6bdffefaa8 Fix QTimer::setInterval to remove existing bindings
A recent change ( a7ca8b1a28 )
led to failure of binding removal in setInterval().
This was fixed by introducing setterScope.
This patch add unit tests for this regression.

Change-Id: Ic8da1f2d82ad6c8ccd81c9b1eff72d42cf75f28a
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2021-02-15 13:47:31 +01:00
Edward Welbourne
c462793d67 Drop parsing of antique TextDate format
Apparently we used to have (back in 2007, only on Windows,
incompatibly with what we were then using on Unix) a TextDate format
(only for QDateTime, QDate used what it still uses) that put the
day-of-month number, with a dot after it, before the month's short
name. We have retained parsing of this format, on all platforms, ever
since.

It no longer matches the format we now use (since 5.2, in 2013, commit
61b56a89a1, which harmonised the format
with Unix and QDate); now seems like a good time to stop complicating
our parser for its sake.

[ChangeLog][QtCore][QDateTime] The parsing of Qt::TextDate in
QDateTime::fromString() no longer supports the old TextDate format
used (only) on Windows by Qt < 5.2 ("ddd d. MMM yyyy" with an
"HH:mm:ss" time either appended or inserted before "yyyy").

Change-Id: I73a798ab78f187543e415119cc4a11f1cfd73820
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2021-02-15 13:44:48 +01:00
Edward Welbourne
517578e071 QDateTime::toString(): use UTC-offset as time-zone suffix
Since fromString() can't parse the (ambiguous at the best of times;
also backend-dependent and thus potentially system-locale-dependent)
abbreviations currently produced (since 5.9) and can parse UTC-based
offsets, the OffsetName of the zone is a more robust format for the
zone-suffix. This also makes it possible to consistently use the C
locale, compatibly with everything else about post-6.0 date-time
serialization.

[ChangeLog][QtCore][QDateTime] When spec is Qt::TimeZone, the
offset-suffix now used for the toString(Qt::TextDate) format is now a
UTC-based offset string, compatible with the parsing (now) supported
by fromString(). The zone-abbreviation suffix in use since 5.9 was not
parseable.

Change-Id: I4024ae87980c6d3590c68a67b8d1c8f433e36855
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2021-02-15 13:44:21 +01:00
Edward Welbourne
3cf84287e7 Prepare TextDate to use UTC-offset rather than GMT-offset zone suffixes
There are GMT-offset zones whose convention for the sign of the offset
is the reverse of what we are (still) using, which is the usual
convention for UTC-offset zone: for example, the Olson Database's
Etc/GMT+3 has offset -3 hours in the UTC-based system we use, so we
give it suffix GMT-0300. The UTC-based suffix is also what we use as
the abbreviation for OffsetFromUTC() in toString().

For now this only adds support for parsing a planned future form: the
old form using GMT is retained, to give client code some chance to
prepare for a backwards-compatible transition. Although the GMT prefix
is matched case-insensitively, only match UTC if fully upper-case;
there is no meaningful precedent for case-insensitive usage here.

[ChangeLog][QtCore][QDateTime] The Qt::TextDate format now recognizes
UTC-based offset suffixes in addition to suffixes based on the
deprecated alias GMT. This prepares for toString() to use such
UTC-based suffixes for time-zones (fromString() cannot parse the
present abbreviation suffix). A future release of Qt shall use
UTC-based suffixes in place of the present GMT-based suffixes (which
conflict with GMT-based IANA zone names) for Qt::LocalTime and
Qt::OffsetFromUTC time-specs. Client code is encouraged to use and
recognize UTC-based zone suffixes in preparation for that transition,
unless compatibility with versions before 6.2 is required.

Change-Id: I5a42a488f1232a30f4b427b7954759283423b9b3
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2021-02-15 13:44:06 +01:00
Allan Sandfeld Jensen
b2631c72c0 Extend colorspace testing and fix bug it uncovered
When changing transferfunction the look-up-tables needs to be
regenerated.

Pick-to: 6.1 6.0 5.15
Change-Id: I83ca5fe570f85d478a374f52c0a82db84e70c3b8
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
2021-02-13 09:16:38 +01:00