Commit Graph

51375 Commits

Author SHA1 Message Date
Ilya Fedin
9db7cc79a2 Don't own unique name for QDBusTrayIcon
Flatpak doesn't allow to own random name with PID. Even after adding
such a permission into manifest, all flatpaked apps have PID 2, so only
one Qt application at a time can have tray icon.

Even though unique name is a part of the spec, no tray hosts really
check it and SNI implementations without unique name run just fine
inside and outside of Flatpak.

This fixes the inability of Qt applications to have tray icon in Flatpak
outside of KDE.

Pick-to: 6.0 6.1 5.15
Change-Id: Ieea6dc335b7a74537a51929f6e70ca68c84228fb
Reviewed-by: Dmitry Shachnev <mitya57@gmail.com>
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
2021-04-21 22:21:36 +00:00
Eirik Aavitsland
3a1be7dfcb Don't use qreal as a loop counter
Fix static analyzer warning

Change-Id: I5c1a0c63e66b7c2511b4801bbe399681de998850
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
2021-04-21 23:47:16 +02:00
Allan Sandfeld Jensen
3b8031059a Fix missing CPU feature feedback
Add empty string first like we have for x86.
This fixes offset checks, and reported missing features.

Pick-to: 6.1
Change-Id: I09f6be05641d5ed9ae5d91fa72f678fef60bdbe7
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2021-04-21 22:57:04 +02:00
Niclas Rosenvik
fadd87ed15 Add Solaris support in cmake build
Add SOLARIS cmake platform definition.
Add settings for QT_DEFAULT_MKSPEC so that qplatformdefs.h can be found.
Solaris has its gssapi symbols in libgss.
Solaris supports @ORIGIN.

Solaris ld does not support --dynamic-list needed for reduce relocations.
Make solaris fail the reduce relocation test.

getauxval is specific to GNU libc and some other libc implementations on
Linux but sys/auxv.h is not. The bootstrap uses sys/aux.h as the only
indication for getauxval. This breaks builds on Solaris, so only make
sys/auxv.h an indicator for getauxval on linux or glibc based systems.

Solaris uses X11 so add it to the X11_SUPPORTED list.

Solaris network libraries for sockets etc are in socket and nsl.
ifreq does not have a member ifr_ifindex on Solaris, it uses
ifr_index. Add test to check if ifr_index is a member of ifreq.
The first struct in the in_addr union on solaris is defined as four
uint8_t, therefore four arguments are needed for its initializer list.

Change-Id: Ieed4c1bbac8559a7ae1db9c4e1e91f609f150270
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
2021-04-21 20:57:04 +00:00
Giuseppe D'Angelo
284d4e7125 QLayout: mark unsetContentsMargins as the RESET function
contentsMargins is a Q_PROPERTY on a QLayout. Qt 6.1 introduced
QLayout::unsetContentsMargins() to reset the contents margins to the
"default" ones (that the user can't know); that's the textbook
description of a RESET function for the property.

Add some tests also for unsetContentsMargins.

[ChangeLog][QtWidgets][QLayout] The unsetContentsMargins() function now
acts as the RESET function for the contentsMargins property.

Change-Id: I463d88363c11f4a15ad3d6af71401d8698de1d41
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2021-04-21 22:13:11 +02:00
Ivan Solovev
1a65a4faf5 QObject: port to new property system
Extended QObjectPrivate::ExtraData to store a pointer
to its parent, and reimplemented qGetBindingStorage()
function for QObjectPrivate::ExtraData.
This allows to use Q_OBJECT_COMPAT_PROPERTY macro
for a property, stored in QObjectPrivate::ExtraData
and solves all the problems with calling a custom
setter.

Task-number: QTBUG-85520
Change-Id: I40e01c29430846359ef9160fa1ae97c702be9a18
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Sona Kurazyan <sona.kurazyan@qt.io>
2021-04-21 15:34:28 +02:00
Giuseppe D'Angelo
696f5ffc64 QEdidParser: build only on XCB/EGLFS
No other platform needs it, so avoid building and shipping unused code.

Change-Id: I23b68b58eb0523459014df915ad8516c22adbcc1
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
2021-04-21 15:29:34 +02:00
Giuseppe D'Angelo
9d28886451 Edid vendor table generator (3/N): regenerate the table
Use an updated output from the script.

Change-Id: I85c4706c637bd5ceda6667257e48c16943637f9b
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
2021-04-21 15:29:11 +02:00
Giuseppe D'Angelo
00ee664f2f Edid vendor table generator (2/N): use idiomatic C++
In C++ we can give names to classes, so just use that, without
C-isms (typedef struct).

Change-Id: I27239d8d5c28864b3f4f7bd4013cc47c045b4b04
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
2021-04-21 15:28:54 +02:00
Giuseppe D'Angelo
7763b397e3 Edid vendor table generator (1/N): fix copyright message
The table has been moved to QtGui, adjust the generated "location"
in the (C) comment.

Change-Id: I536fe21ab59085c0d8d89aa638b50876fe3bf1cf
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
2021-04-21 15:28:47 +02:00
Alexandru Croitor
be1ee03a0f CMake: Fix auto-linking of static plugins in standalone tests
The change introduced in 98e8180e56
fixes reconfiguration issues for repositories that provide plugins
associated with modules from a different repository
(QSvgPlugin -> QtGui -> qtbase).

It does so by only loading the public Plugin CMake packages of
dependent repositories.

For executables / tests that are built as part of the current
repository, plugins are linked via a different simplified mechanism in
qt_add_internal_plugin and qt_internal_add_plugin in order to prevent
exporting link cycles between plugins and Qt modules.

This works for the majority of in-tree tests, but unfortunately breaks
static standalone tests.

For example in qtbase neither mechanism will link plugins to the
standalone tests:

 - qtbase has no repo dependencies, so the first mechanism (loading of
   public plugin packages) is skipped because we assume we are merely
   reconfiguring the main build of qtbase and we don't want to
   accidentally create duplicate plugin targets

 - because a standalone test configuration does not call
   qt_internal_add_plugin, no association is done between qt plugin
   and module and thus all tests (qt_internal_add_test ->
   qt_internal_add_executable) don't get the simplified plugin
   linking

Fix this by allowing loading of the public CMake plugin packages when
doing standalone tests. It should be safe to do so because we don't
build any plugins in this case, only tests.

Amends 98e8180e56

Pick-to: 6.1
Task-number: QTBUG-87580
Change-Id: I690a0366c73a24e7f49c65ed13cd70362c273d81
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
2021-04-21 15:21:08 +02:00
Alexandru Croitor
2e2ef31d41 CMake: Fix build of QJpegPlugin in static Windows build with PCH
Fails with

 C:\Dev\qt\src\qtbase\src\3rdparty\libjpeg\src\jmorecfg.h(242): error
 C2371: 'boolean': redefinition; different basic types
 C:\Program Files (x86)\Windows
 Kits\10\include\10.0.18362.0\shared\rpcndr.h(193): note: see
 declaration of 'boolean'

Don't use the precompiled header for the plugin source file.

Amends f641a0dbcf

Pick-to: 6.1
Task-number: QTBUG-88093
Change-Id: I6a57f791139d866622f7406fec45c11be6b86418
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
2021-04-21 15:21:05 +02:00
Robert Löhning
41af29238c QDateTime: Avoid compiler warning about issue impossible at runtime
Change-Id: I6e5f76582c4caff31c56bfb4badfcc318f299f51
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2021-04-21 15:05:09 +02:00
Andrei Golubev
3edba4b3d5 Update QList benchmark tests
Removed 5.15 specific QVector code, which is unlikely usable now when
we are at 6.1+ timeline (that was really only a nice-to-have during
5.15 -> 6.0 transition)

Added "remove first" benchmark to track the fast (or not so fast)
removal path

Updated mid insertion and mid emplace to actually trigger both paths
(growing at the beginning and at the end), before it was really using
just one side, which is not quite the "mid" way it feels. Also changed
mid insertion to actually use the insert algorithm. Seems like
insert(i, t) calls emplace under the hood at least from the visual
introspection

Change-Id: I01b82cfa0ae38d481ea7362947f3607d757bf5d0
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2021-04-21 15:01:13 +02:00
Eirik Aavitsland
cd5a60089a Avoid combining enum values from different enum types
Fixes static analyzer warnings.

Task-number: QTBUG-91911
Change-Id: I55599d53bb98ada74ceb73d5668fcc18813c3ec4
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2021-04-21 13:01:13 +00:00
Friedemann Kleint
1b1844afef Documentation: Fix broken links to QIODeviceBase::OpenMode
Previously, QIODeviceBase was not visible in the documentation
and the links from QIODevice::open() were broken.
Fix by fully qualifying the arguments.

Pick-to: 6.1 6.0
Change-Id: I43960ac2ff436251cc3bfad862d82f937b9bd4b1
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
2021-04-21 15:01:13 +02:00
Allan Sandfeld Jensen
ed82e1304d Cleanup qsimd ARM code
Switch to using getauxval.

Change-Id: I1a55cf24e3cacbbca1f57ad6f74a80df80fe60cf
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2021-04-21 15:01:13 +02:00
Allan Sandfeld Jensen
8179d7edf6 Add runtime aes/crypto check for ARM
Yocto apparantly enables it hard at compile time.

Change-Id: I1d4c7402eacc714859c61f469ebed85682d48b51
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2021-04-21 15:01:13 +02:00
Kai Köhne
5d0085049e MSVC: Fix size_to to int warning in qhash.cpp
Pick-to: 6.1
Change-Id: I5da2ae57b0f626bd46b71bab28af668bd1fbc7de
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2021-04-21 09:27:48 +02:00
Eirik Aavitsland
4345056630 Remove xcb-native-painting setting from the configure summary
No need to spam the summary with this unsupported feature.

Pick-to: 6.1
Change-Id: Ie644a7077762d818fd62a22a8b6d3db025f92c81
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2021-04-20 22:47:32 +02:00
Eirik Aavitsland
05eff54d66 Fix build when xcb_glx_plugin config is disabled
After 7266bd459e QGLXIntegration and
QGLXContext are not defined if xcb_glx_plugin is disabled. That will
happen e.g. when gles is requested instead of desktop GL.

Protect the usage of those symbols in the xcb plugin accordingly.

Change-Id: I4bea60787fd3175450de05a8e522ef9c8b438ee7
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
2021-04-20 22:46:54 +02:00
Thiago Macieira
8bae441d90 QUtf8StringView: ensure binary compatibility throughout 6.x
We can't depend on whether the user compiles with -std=c++17 or
-std=c++20. So select what we can depend on and make that permanent.

Prior to this change:

 $ cat /tmp/test.cpp
 #include <QtCore/QUtf8StringView>
 void f(QUtf8StringView) {}
 $ qcd include
 $ g++ -S -o - -I. /tmp/test.cpp | grep globl | c++filt
         .globl  f(QBasicUtf8StringView<false>)
 $ g++ -fPIC -std=c++20 -S -o - -I. /tmp/test.cpp | grep globl | c++filt
         .globl  f(QBasicUtf8StringView<true>)

After this change, they're both "false". QUtf8StringView should have
been a concrete class that derived from QBsicUtf8StringView<whichever>
and inherited all its constructors. We'd cause ODR violations in C++20,
but nothing worse than what we usually do for BC reasons.

That solution is too late for Qt 6.x. Let's revisit in 7.0.

Change-Id: I6bcbe88c072a438b8b4efffd166e77199ecb39e3
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
(cherry picked from commit c7deb3400faa1d9389137fe63ffbffade8203850)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2021-04-20 19:33:00 +00:00
Allan Sandfeld Jensen
b1f956106c Fix tst_qicon for fractional dpr
Add rounding one place, and skip addFile for now since
the assumption about rounding dpr up no longer applies.

Pick-to: 6.1
Change-Id: I0a84dfabb218acf42cb3816ba50ef899c8762523
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
2021-04-20 21:33:00 +02:00
Edward Welbourne
28b75584c8 In the POSIX zone parser, handle no-DST zones the same as name-only
If parsing the standard time data brings us to the end of the zone
info, there is no DST information to use later and it makes sense to
record the zone as simply a fixed-offset zone.

At the same time, handle the case of empty name in the standard time
data; use the zone info as name rather than an empty string.

Change-Id: I34d4ea25d93d821a937949730adee89d82105bc9
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2021-04-20 21:33:00 +02:00
Edward Welbourne
605ae62944 Correct the range of allowed hours for a POSIX rule's transition
A POSIX rule's transition time is allowed an hour in the range from
-137 to 137; in particular, a negative hour is allowed, and used by
some Greenland zones using Europe's time-of-transition which, as they
are more than two hours west of Greenwich, happens before midnight.

This means the time of transition can't be represented by a QTime(),
so propagate the int that represents it to the code that consumes it;
and treat parsing failure as an error rather than "correcting" it - if
the transition time is given, it must be valid.

Changed tst_QTimeZone::isTimeZoneIdAvailable()'s verification of
validity to report the name of the zone it thought was invalid.
(A later change, validating POSIX rules, caued this to fail for
America/Nuuk without the present fix.)

Change-Id: I5c9127ac34d878554dd0aca1c1c7338c7e0e1c28
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2021-04-20 21:33:00 +02:00
Edward Welbourne
8e4546b42f Make deserialization of QTimeZone less promiscuous
When asked to read an OffsetFromUtc record, it was trying the IANA ID
it read in as a possible zone name. If the backend accepted the given
ID as a zone name, however, the result might not be an offset-from-UTC
zone. So extend the isValid() check it was doing on the result to at
least check the zone has no DST and matches the record's offset.

Change-Id: I46a95aeb2a4d66887fd56a58fa72fe5d3b568a00
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2021-04-20 21:33:00 +02:00
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