Commit Graph

51199 Commits

Author SHA1 Message Date
Edward Welbourne
ec8808c302 Return early from QTimeZone constructor if alleged IANA ID is invalid
If the ID isn't even valid, don't waste cycles trying to make sense of
it as identifying a time-zone.

Add test of an invalid ID that provoked an integer overflow on trying
to parse it as a POSIX zone specification.

Fixes: QTBUG-92842
Change-Id: Ib80bbb88c11c0484ce0358acabbdc25c5bd8e0b3
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2021-04-20 21:33:00 +02:00
Edward Welbourne
e41dbfd3a4 Fix bug in QDateTimeParser::findTimeZoneName()'s length-limiting
The recent commit 0c9fc20e7f missed the
case of a slash after some invalid character. That could lead it to
reinclude the invalid after previously working out it should ignore
it.

Change-Id: I3e29d2bf4d8df3878b581a969348ff5087b5d847
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Robert Löhning <robert.loehning@qt.io>
2021-04-20 21:33:00 +02:00
Giuseppe D'Angelo
7cdf77f5e7 tst_qpromise: build fix
The test use aggregate initialization on some classes which however
are no longer aggregates in C++20 (the rules changed again; in C++20
having a user-*declared* constructor makes a class not an aggregate).

Just add a constructor so the code keeps compiling in both 17 and 20.

Fixes: QTBUG-92963
Pick-to: 6.0 6.1
Change-Id: I52371c5ee34c84358987b5ae8bee9ab9c49c8eab
Reviewed-by: Sona Kurazyan <sona.kurazyan@qt.io>
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2021-04-20 20:34:53 +02:00
Sona Kurazyan
d83132c629 QTest: improve the read-only property test helper
Add a check that setting a binding on the read-only property has no
effect, nor does trying to change its value via such a binding.

Change-Id: Id7b55cd53256961faface7ef155225664cdee97a
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2021-04-20 20:34:53 +02:00
Edward Welbourne
855f8a3f98 Handle overflow in QTimeZonePrivate::dataForLocalTime() and its caller
If the final result is outside the representable range, we can only
declare the given date-time invalid.

Change-Id: Ibce09462048bf351199657a5da2c55bb3ce5b934
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2021-04-20 16:04:14 +02:00
Andreas Buhr
4dccdd3693 Port QPropertyAnimation::propertyName to the new property system
Task-number: QTBUG-85520
Change-Id: Id439783672b17810a51f867bcb69ee6c3eb5a022
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Sona Kurazyan <sona.kurazyan@qt.io>
2021-04-20 15:56:39 +02:00
Fabian Kosmale
2136406b4c Work around MSVC compilation issue
MSVC does not seem to instantiate code in the else branch of the
constexpr if statement even though the condition is true. This causes
an error if the PropertyType is void, as we then would attempt to
create an object of type void.

Work-around the issue by explicitly checking that the type is not void.

Fixes: QTBUG-92962
Change-Id: Ie5acb6fae532bcc441be34418d4724de9d65b340
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
2021-04-20 13:56:39 +00:00
Ilya Fedin
6560778616 Read DPI from X Settings initially as well
Currently, Xft.dpi from X Resources is read initially,
while changes are monitored for Xft/DPI from X Settings.
These protocols are different and can have different values.
E.g. MATE sets X Resources' Xft.dpi to 96.30859375,
while X Settings' Xft/DPI is set to 197240 at 2x scale.

This results in a very weird bug when Qt can't determine
2x scale initially, but if scale is changed at run time,
Qt changes scale to the right value.

The difference could be checked via xrdb -query and dump_xsettings
(the second is from xsettingsd project).

[ChangeLog] Qt now reads Xft/DPI from X settings at startup,
and will prefer this value over Xft.dpi from X resources.

Pick-to: 6.0 6.1 5.15
Change-Id: If6adac0c88198579332ddebc673f1524f324c0e4
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
2021-04-20 17:20:10 +04:00
Li Xinwei
c7a27678d6 MSVC: define _CRT_SECURE_NO_WARNINGS for all internal CMake targets
In commit 013abe3206, I add
_CRT_SECURE_NO_WARNINGS definition for all Qt internal module targets,
to suppress MSVC warnings like:
warning C4996: 'strncpy': This function or variable may be unsafe.

However, when compiling some internal tools, such as qmake and qdoc,
such warnings also exist. To suppress this kind of warning entirely,
_CRT_SECURE_NO_WARNINGS definition should be added for all Qt internal
targets when using MSVC compiler.

Pick-to: 6.1
Change-Id: I9c37b20672f9d0f470e3e9ea847e5221f43bfc04
Reviewed-by: Yuhang Zhao <2546789017@qq.com>
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
2021-04-20 21:19:32 +08:00
Tang Haixiang
e99a883bd3 Draw the cursor considering the descent is 0
When the descent of the item is 0, ascent is the
height of the item, base(base = si.ascent)> sl.base.
At this time, sl.descent is not considered. The
calculated y value may be <0.

Fixes: QTBUG-86823
Fixes: QTBUG-92468
Pick-to: 5.15 6.0 6.1
Change-Id: I9cf088dec9162595e52ff72aa90ec3153a30fb72
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2021-04-20 10:15:33 +00:00
Li Xinwei
5d2da76c1e make FindWrapBrotli.cmake not depend on vcpkg or PkgConfig
Currently, FindWrapBrotli.cmake depends on vcpkg or PkgConfig. But for
users who build Brotli by themselves and don't have vcpkg or PkgConfig,
the Brotli cannot be found.

As a reference, I use following CMake commands to build Brotli:
cmake path/to/Brotli/source -G"Ninja Multi-Config"
-DCMAKE_CONFIGURATION_TYPES=Release;Debug -DCMAKE_CROSS_CONFIGS=all
-DCMAKE_DEFAULT_CONFIGS=all -DCMAKE_DEBUG_POSTFIX=d
-DCMAKE_INSTALL_PREFIX=path/to/install

Pick-to: 6.1
Change-Id: I2fa8d3293dd55ebc18937e13fac40d144ca4c1e2
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2021-04-20 18:15:33 +08:00
Eirik Aavitsland
259dee218e Fix another compilation error in QDateTime
Similar fix as 538e9fa568 : gcc 7.5,
used e.g. on Jetson, is not able to resolve the add_overflow overload
without help.

Change-Id: I4d497480bb8dc82d7b1cbd13fda8e291935c8752
Reviewed-by: Andrei Golubev <andrei.golubev@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2021-04-20 07:07:52 +02:00
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
Shawn Rutledge
3bb523eb66 cocoa: Use the system-provided color for QPalette::PlaceholderText
Task-number: QTBUG-92947
Task-number: QTBUG-86195
Change-Id: I2aa61ad23aae526c3fff9982f4df9847a279712c
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2021-04-20 02:02:16 +02:00
Allan Sandfeld Jensen
ccd17fbc57 Fix ARM and MIPS runtime CPU feature flags
The set values didn't match tested values, as the enum were already
on flag form.

Pick-to: 6.1 6.0 5.15
Change-Id: I9e8b0d419682122e8d40cd47bd68d840386c2066
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2021-04-20 00:26:12 +02:00
Joerg Bornemann
b226e99c71 Fix DESTDIR handling on Windows for Qt modules != qtbase
On the CI system, we build qtbase with CMAKE_INSTALL_PREFIX set to a
path without a drive letter to support DESTDIR when installing.
Other Qt modules are built without CMAKE_INSTALL_PREFIX set. The
Qt6BuildInternals package provides a default value.

Since commit e6527e2f73 this default
prefix is calculated from the current installation location. This
default prefix however has a drive letter, breaking DESTDIR support.

Broken DESTDIR support in this case means for Android that file(INSTALL)
can properly install but stripping will silently fail.

We now compare the "real path" of the original prefix from qtbase and
the calculated prefix. When they're equal, we use the original
CMAKE_INSTALL_PREFIX.

Fixes: QTBUG-92890
Change-Id: I96fb0655e02c5c695722b7e01a32e209cbdea4cc
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
(cherry picked from commit 15b26935fca4ab14298abdcc70b3cb15b6cca195)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2021-04-19 20:42:55 +00:00
Luca Beldi
3c74ee5682 Allow proxy models access to the parent-child hierarchy of source
As discussed in the related bug report, the current way proxy models
access the parent-child hierarchy of the source model requires modifying
Qt sources. This changes adds a method to allow easy implementation
of this common feature to proxy model subclasses.

Fixes: QTBUG-83911
Change-Id: Ic88d40c13c2be7b6b44fcc58118bac471a11da95
Reviewed-by: David Faure <david.faure@kdab.com>
2021-04-19 21:42:55 +01: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
Alexandru Croitor
4d838dae5a CMake: Generate better Xcode iOS projects
Add an iOS specific plist file like we do for macOS.

If the user hasn't specified a bundle identifier or a development
team id, do what qmake does and query the Xcode preferences file to
pre-populate those if possible.

This allows running

 cmake -GXcode ./foo

on a Qt example project and building it with xcodebuild on the
command line without having to go through the IDE to set a development
team id or modifying the example project to add a product
bundle identifier.

Note that the change assumes that the development team id has been
previously set / configured via Xcode. If no such id is found, then
the value will not be set and the user will still have to specify it
either in the project file or via the Xcode UI after the project
has been generated.

Amends 3a2fa3fec5

Pick-to: 6.1
Change-Id: Iaab4e57de72c9877fb9035d28f9a879b2c91a33c
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
2021-04-19 20:30:45 +02:00
Alexandru Croitor
b25eb6e0bd CMake: Introduce zlib find script to work around hardcoded iOS SDK
Xcode allows building a project targeting either the device or
simulator sysroot in one single build dir, but for the sysroot
switching to work there should be no linker or compiler flags
referencing absolute paths of a specific sysroot.

During CMake configuration of a project targeting iOS, all found
system libraries will be within one single sysroot, either the device
one or the simulator one, whichever one was passed to
CMAKE_OSX_SYSROOT. CMake will then generate the Xcode project
and pass those absolute paths, which makes sysroot switching within
Xcode not work.

To avoid that, the CMake documentation recommends passing linker and
framework flags of the form '-lfoo' and '-framework bar' instead of
absolute paths. Xcode then takes care of setting the correct framework
search path.

Zlib is one of the libraries found in the iOS sysroot and thus passed
as absolute path.
To avoid that, create a new FindWrapZLIB find script. The target it
creates will pass the absolute path to the library on non Apple
platforms and an -lz linker flag on Apple platforms (macOS and iOS).

To avoid issues with target global promotion when system PNG package
is found, ensure that a found ZLIB::ZLIB target is promoted to global
manually in src/gui/configure.cmake.

Pick-to: 6.1
Change-Id: I8bd8649be4f680a331ad51925f27cb9d13ac5e5f
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
2021-04-19 20:30:45 +02: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
Shawn Rutledge
76537c065a Avoid divide-by-zero in the gradients example
After 7a738daa97 we require
QLineF::setLength() to take a finite length, and this code was probably
always risky when HoverPoints has two points that are both 0,0.
It's probably a transient condition anyway.

Fixes: QTBUG-92908
Change-Id: If81122d2f78761026b0d656ceffe173132751317
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
2021-04-19 19:56:25 +02:00
Volker Hilsheimer
8f429ac926 Add documentation for the QtLiterals namespace
Pick-to: 6.1
Change-Id: I7932de5f91590acd30c8d4c87f760fd47b1fe0b0
Reviewed-by: Andrei Golubev <andrei.golubev@qt.io>
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
2021-04-19 19:56:25 +02: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
Giuseppe D'Angelo
fd0c3170c8 Unicodetools: compile
Add an #include for a header that was only accidentally included
transitively.

Pick-to: 5.15 6.0 6.1
Task-number: QTBUG-92822
Change-Id: Ie29bb0e065f2db712e9cf9539b15124ff0ced349
Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
Reviewed-by: Andreas Buhr <andreas.buhr@qt.io>
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
2021-04-19 17:06:56 +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
Volker Hilsheimer
673d9c34f4 Assert that engine isn't nullptr before dereferencing
The engine pointer is guaranteed to be initialized in line 1838, so we
can assert that the correct value is passed into the function to fix
static analyzer warning 1d9b8ce922ee0891fb0d477dc17fdb8d.

Change-Id: I773bbaa579afec0d7a79d4393ee66fd26ba9629b
Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
Reviewed-by: Jonas Karlsson <jonas.karlsson@qt.io>
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
2021-04-19 15:18:46 +02:00
Volker Hilsheimer
6c3599460c Assert that engine isn't nullptr before dereferencing
Various checks for "engine" in the previous code suggested that
engine might be nullptr by the time we want to populate the
out-parameters.

This must not be the case, and QFontDatabase::load asserts
already that a valid engine is loaded and returned.

Fix static analyzer warning 7f68daa282c72e8cc172c681eb02f559 by
asserting it here as well.

As a drive-by, change the tested out-parameter to the last one
in the list of optional parameters.

Pick-to: 6.1
Change-Id: I3d9ff0f5f7c4740014301c073480d14fef54e2fb
Reviewed-by: Jonas Karlsson <jonas.karlsson@qt.io>
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@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
Joerg Bornemann
82f8519b82 Fix top-level build repository targets
The directory-level targets missed the first level of sub-targets.
E.g. `qtbase_qmake` did not have a dependency to `qmake`.

Fix qt_build_internals_get_repo_targets to first grab all targets of the
subdirectory and then recurse.

Pick-to: 6.1 6.0
Change-Id: I3604000caec22fac9a4cc5f5aaf651d550d16793
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2021-04-19 08:15:52 +02:00
Qt CI Bot
ec7ff5cede Merge integration refs/builds/qtci/dev/1618660601 2021-04-17 13:47:06 +00:00
Alexandru Croitor
aab8a0ac6e CMake: Warn when using CMake 3.20.1 due to crashes in AUTOMOC
With CMake 3.20.1 AUTOMOC can crash or hang on Windows when used with
a Qt installation that supports moc depfiles due to missing
multi-threaded locking.
Warn and advise to use a different CMake version instead.

Change-Id: I78d2269c48dfc2541bebcd6ab23aaa5595012149
Pick-to: 6.1 6.0
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
2021-04-17 13:55:21 +02: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
Volker Hilsheimer
6a4aa096e9 Port examples away from deprecated QTouchEvent APIs
Use the QEventPoints API instead.

Change-Id: I7310fd34df110cad508f6188a41ad452a3cf848d
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
2021-04-17 09:18:11 +02:00
Thiago Macieira
7709463b55 QHash: allow an empty QT_HASH_SEED env variable to reset
It's much easier to un-do a QT_HASH_SEED=0 by simply setting it to empty
in a command-line, as in:
  QT_HASH_SEED= ./appname

[ChangeLog][Important Behavior Changes] Previously, if the QT_HASH_SEED
environment variable was set but empty, Qt would interpret that as if it
had been set to 0, thus disabling the hash salting functionality. Since
this makes setting and unsetting this variable difficult in scripts, it
has been changed: if the variable is set but empty, it is interpreted
now as if it had not been set and the hash salting functionality is
enabled.

Change-Id: Id2983978ad544ff79911fffd1671f5473978a6bc
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2021-04-16 17:51:30 -07:00
Thiago Macieira
9252b9bb92 QHash: remove the ability to set a non-zero global seed
We've been warning since commit 4ba740b3ba
(2017-03-31, Qt 5.9.0).

Change-Id: Id2983978ad544ff79911fffd1671f505fee6f282
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2021-04-16 17:51:28 -07: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
Volker Hilsheimer
bf23fc3cdc Make the documented API visible to qdoc
Pick-to: 6.1
Change-Id: Ic511af71cd0cc202f86fd39f5a4e0707bcf9fe36
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2021-04-16 18:43:46 +02:00
Volker Hilsheimer
70d99512ee Fix call to QMessageBox::information
The call assumes two arguments for QString::arg, but only one was passed.
The error string became a buttontext argument, which is clearly wrong.

Task-number: QTBUG-92483
Change-Id: I1fab5be88331f636185693b721f0d9688c0d9ff3
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
2021-04-16 18:43:35 +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
Fabian Kosmale
984bc7cc3e Address thread safety issues in QProperty classes
While we do not support cross-thread bindings, reading of properties
from a different thread when no bindings are involved must continue to
work.
However the check whether bindings are involved used the QBindingStatus
in the QObjectPrivate. That one contains the wrong value when the
QObject is accessed from a different thread than the one it has affinity
with. This patch reads from the thread_local directly instead to
sidetstep the issue.

Change-Id: I8ce2092f35e210566934e2439beb5d48fd8cf226
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2021-04-16 16:49:29 +02:00