Commit Graph

48315 Commits

Author SHA1 Message Date
Timur Pocheptsov
cd6d53610a tst_QTcpSocket::connectToHostError - increase the timeout
As suggested by the message from QTestLib. This, indeed, fixed the
sadistic test. Also, make sure resources are not leaked.

Pick-to: 5.15
Fixes: QTBUG-87009
Change-Id: Id693a5a562ea5ebacc853e5fc0ab9654ba851e72
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2020-10-08 22:09:44 +02:00
Allan Sandfeld Jensen
e5e89d17b3 Avoid double pixel-ratio scaling of dbus tray icons
QIcon::pixmap does automatic scaling to DPR by default, so
use QIconEngine API to access internal pixmaps directly instead.

Pick-to: 5.15
Task-number: QTBUG-83806
Change-Id: I3ccbed8387811a87bbea3f5d4ad9963e1be28a49
Reviewed-by: Dmitry Shachnev <mitya57@gmail.com>
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
2020-10-08 21:31:56 +02:00
Fawzi Mohamed
f69144471b Allow getting a const pointer out of a variant containing pointer
Currently
  A a;
  QVariant::fromValue(&a).value<const A*>() == nullptr;
Still casting non const to const is safe, and worked in Qt5.
After this change
  A a;
  QVariant::fromValue(&a).value<const A*>() == &a;

Change-Id: I257049d084c712b00a338a2943d379aa478e0981
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2020-10-08 18:13:34 +02:00
Andrei Golubev
6c7ed4c013 Make QADP capacity functions use qsizetype instead of size_t
Change types returned and accepted by capacity-related QArrayDataPointer
functions to qsizetype:

1) QArrayData (underlying d-ptr) works with qsizetype
2) QArrayDataPointer::size is of type qsizetype
3) All higher level classes that use QADP (e.g. containers)
   cast capacity to qsizetype in their methods

Additionally, fixed newly appeared warnings through qtbase

Change-Id: I899408decfbf2ce9d527be7e8b7f6382875148fc
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2020-10-08 16:52:28 +02:00
Ulf Hermann
6443c2215e pro2cmake: Translate qmake's install_qmltypes CONFIG option
We do want to install our qmltypes files ...

Change-Id: I9769da852f92fcd9b1b8a8d093931f8c27d8a3d8
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Maximilian Goldstein <max.goldstein@qt.io>
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
2020-10-08 16:49:18 +02:00
Mårten Nordheim
335c5a8a6b QNetworkRequest: Close gap in enum
It was there for binary compatibility reasons, but it's not needed anymore

Change-Id: I659dadc710a5bcdbcba74f13fd4db6044a497cd2
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
2020-10-08 16:35:31 +02:00
Jerome Pasion
a80e1766d8 Add links to Qt 3D Studio and Qt Design Studio
Enables linking to them using QDoc \l command

Task-number: QTBUG-85517
Change-Id: I23073a5c7b2f06a8ecf66116c538dcd3fff08f61
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
2020-10-08 16:29:14 +02:00
Kai Koehne
ab4acdbeb1 Do not build tests and examples by default for configure -cmake
Tests were never built by default, except for -developer-build.
Examples were build, but aren't anymore by default if you
run cmake directly.

Let the default be figured out by cmake, and only set
BUILD_EXAMPLES and BUILD_TESTING if the user has
expicitly passed them via -make or -nomake.

Task-number: QTBUG-87217
Change-Id: I37321d96cc1e9e184a711a858c860b0205d5b74f
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
2020-10-08 11:12:30 +00:00
Kai Koehne
0cb0119f43 CMake: Remove outdated info from README.md
3.17.0 is released since a while. ANyhow, the requirement for
3.17 for simulator_and_device builds is already mentioned
at the start.

Change-Id: Ic8813bb60b010feb97a47b878124c3e75658813d
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2020-10-08 13:12:18 +02:00
Laszlo Agocs
56af9fb917 rhi: gl: Silence incorrect compiler warnings about uninitialized use
Change-Id: I09bd22f3ccb1231ad4ef123f581459ef5c1ac37c
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
2020-10-08 11:01:11 +02:00
Laszlo Agocs
14ddbba298 rhi: gl: Drop the unused WRAP_R member
If we do not use it for anything, do not spend time on comparing
and copying it either.

Change-Id: I3632792847010e5b73c48eb1ca88f5806f3ccd45
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
2020-10-08 11:01:11 +02:00
Laszlo Agocs
ea227fb915 rhi: gl: Fix missing texture bindings
The block to update the cached state needs to be run also
when the texture parameters have changed.

Change-Id: Ifa80c142c6ff31c95a718a1a900ff3db0bbfe4bc
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
2020-10-08 11:01:11 +02:00
Allan Sandfeld Jensen
96eea43d3b Do not trigger actions disabled directly or on group level
Only allow actions disabled due not being visible to trigger, when
enabled is not true.

This matches QQuickAction behavior, and doesn't apppear to affect QtGui
or QtWidgets.

Change-Id: I1a00b80213598ef1560be4c9ee9e65cd6fa6d760
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
2020-10-08 09:01:11 +00:00
Lars Knoll
8ccae33a81 Fix compilation on MSVC with /std:c++latest
Inline the definition of QMetaTypeForType::name and make it constexpr.
The old code was conflicting in it's definition (only const in the
declaration, constexpr in the definition), something MSVC didn't like.

Fixes: QTBUG-87225
Change-Id: I7182c421c9f7612e4ff3d538829b2daee0fe4c5c
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2020-10-08 08:21:48 +02:00
Allan Sandfeld Jensen
564b59d903 Another round of replacing 0 with nullptr
This time based on grepping to also include documentation, tests and
examples previously missed by the automatic tool.

Change-Id: Ied1703f4bcc470fbc275f759ed5b7c588a5c4e9f
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
2020-10-07 23:02:47 +02:00
Andreas Buhr
b5fc1e4e26 Add unit tests to assure QtConcurrent works on move-only sequences
Unit tests are added to make sure QtConcurrent works on
move-only sequences.

Change-Id: I1d066f75ceab9cef98832e96c5827103cbfd72a8
Reviewed-by: Andrei Golubev <andrei.golubev@qt.io>
Reviewed-by: Sona Kurazyan <sona.kurazyan@qt.io>
2020-10-07 19:19:30 +02:00
Alexandru Croitor
b7f1915bd2 CMake: Fix leftover usage of qt_add_executable
All usages should be replaced with qt_internal_add_executable instead.
This should fix configuration failure of benchmarks and manual tests.

Amends e0c62a48b8

Task-number: QTBUG-86815
Change-Id: I0791d849998ed9517e32f699d843367949b97cb9
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
2020-10-07 16:52:12 +02:00
Shawn Rutledge
a11c776c44 QApplicationPrivate: iterate QPointingDevPrv::activePoints values only
In translateTouchCancel() and findClosestTouchPointTarget(), in the
context of doing a range-for loop over activePoints:

 for (const auto &pair : devPriv->activePoints) { ... }

clang was warning that the reference to the pair is a copy:

 warning: loop variable 'pair' is always a copy because the range of type
  'QPointingDevicePrivate::EventPointMap' (aka 'QFlatMap<int, QPointingDevicePrivate::EventPointData>')
  does not return a reference [-Wrange-loop-analysis]

But we weren't using the key anyway, so we might as well iterate over
values() just as various functions in QPointingDevicePrivate are doing.

Change-Id: Id8ee784255af98064e8347d5fa6a806d442933a8
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
2020-10-07 16:03:01 +02:00
Edward Welbourne
e5dc46d966 Allow millisecond-overflow when the result remains valid
Even before adding support for fractional hours, a fraction of a
minute might potentially have represented a whole number of seconds by
a fractional part that, due to rounding, was less than the whole
number of seconds by less than half a millisecond. Previously, the
parsing would have clipped the fractional part at 999 milliseconds, in
the preceding second, instead of correctly rounding it up to the whole
second.

For QTime::fromString(), which can't represent 24:00, and for
TextDate, which doesn't allow 24:00 as a synomym for the next day's
0:0, applying such rounding to 23:59:59.999999 would produce an
invalid result from a string that does represent a valid time, so use
the nearest representable time, as previously.

Added some tests and amended others.

[ChangeLog][QtCore][QDateTime] QDateTime and QTime, in fromString()
with format ISODate or TextDate, now allow a fractional part of the
hour, minute or seconds to round up to the next second (hence
potentially into the next minute, etc.) when this is the closest
representable value to the exact fractional part given. When rounding
up would turn a valid result into an invalid one, however, the old
behavior of clipping to 999 milliseconds is retained.

Change-Id: I8104848d246cdb4545a12819fb4b6755da2b1372
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Andreas Buhr <andreas.buhr@qt.io>
2020-10-07 13:58:33 +00:00
Edward Welbourne
51a16a6862 Use fromIsoTimeString() in QDateTime::fromString() also for TextDate
That way it'll be consistent with QTime()'s parsing of the time part.

Change-Id: I3f66e5686ba6e2ea4bbc2d5a9a29a177de2d9e69
Reviewed-by: Andreas Buhr <andreas.buhr@qt.io>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2020-10-07 15:57:56 +02:00
Edward Welbourne
6404084b9c Use start of day when wrapping 24:00 to the next day
Previously we used 0:0 on the next day, which might fall in a
fall-back's gap.

[ChangeLog][QtCore][QDateTime] When fromString() reads 24:00 in ISO
format, it now uses the start of the next day, rather than 0:0 on the
next day. This only makes a difference if the next day's first hour is
skipped by a time-zone transition.

Change-Id: Ib81feca5dc09fa735321b6ab76d5d118d6db6fd2
Reviewed-by: Andreas Buhr <andreas.buhr@qt.io>
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2020-10-07 15:57:43 +02:00
Ulf Hermann
e1e61daf39 pro2cmake: Allow optional imports in qmldir
In order to funnel this through CMakeLists.txt we add an
OPTIONAL_IMPORTS entry in addition to the existing IMPORTS.

Task-number: QTBUG-87130
Change-Id: I57e882e75d17f5bc68d99ce7837425981fe6938b
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2020-10-07 13:06:11 +00:00
Lars Knoll
ae8ccbab45 Smaller code cleanup
remove the static qt_compare_string methods and inline the code
into the public ones.

Change-Id: Id6f4c85a21df63875fd9816a368358f3f750617b
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Karsten Heimrich <karsten.heimrich@qt.io>
2020-10-07 14:57:56 +02:00
Lars Knoll
8a7b74f6e7 Optimize equality operators for string classes
Using compare() for those operators is not a good idea, as we can't
shortcut comparisons if the string sizes are different. This alone
made our HTML parser in QtGui around 15% slower.

Don't go through QAnyStringView to implement compare() for
QUtf8StringView, use QtPrivate::compareStrings() directly instead.

Task-number: QTBUG-86354
Change-Id: I04869c29c9918161990dc1baf8e943b3a264ff3c
Reviewed-by: Karsten Heimrich <karsten.heimrich@qt.io>
2020-10-07 14:57:51 +02:00
Andrei Golubev
3807559d37 Add porting section for QVector/QList
Fixes: QTBUG-87099
Change-Id: If8ace4f77a4d9fa3dbb24204696e2f7602a76692
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2020-10-07 14:51:27 +02:00
Lars Knoll
0624da584d Cleanup the comparison operators for QVariant
The code was designed to avoid implicit casts when none of the two
types was a QVariant in C++98 times. This can nowadays be achieved
in a better way by making the operators hidden friends of QVariant.

Change-Id: I836b44027fc4ed2bfec401e94d41bddf865c431d
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2020-10-07 13:54:19 +02:00
Lars Knoll
bf5d52020b Remove methods that shouldn't be in the OpenGL wrappers
Those methods where only kept for BC in Qt 5.x, but were actually
asserting at runtime. Get rid of them.

Fixes: QTBUG-86475
Change-Id: I19e6e4ada22b6a4427a2cb13962792c5a3b461af
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
2020-10-07 13:54:06 +02:00
Joerg Bornemann
417ae745ec CMake: Issue warning if chainloaded toolchain file does not exist
Change-Id: Ib7e9b172c6e42feb074955786d49b071639ca86e
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2020-10-07 13:26:03 +02:00
Joerg Bornemann
3cb4f45ca8 CMake: Introduce QT_CHAINLOAD_TOOLCHAIN_FILE
This variable can be set when using qt-cmake[-private] to override the
CMake toolchain file that is chainloaded by Qt's toolchain file.

Task-number: QTBUG-87068
Change-Id: Id529408381e4174becda1ba07a489535c8cf1314
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2020-10-07 13:26:01 +02:00
Joerg Bornemann
9ef4411d81 CMake: Document convenience scripts in README
Change-Id: I7ec7f01f744285fc086de8a0430afbf49563adce
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2020-10-07 13:25:58 +02:00
Tor Arne Vestbø
539cd49cee Fix use of \inheaderfile
Pick-to: 5.15
Pick-to: 5.12
Change-Id: Ib969d6cf23b874e873cfc82b1b19dff2a4fe5f8f
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2020-10-07 13:16:59 +02:00
Christian Heimlich
dc19327751 Member initialization and default constructor for QProgressDialogPrivate
Change QProgressDialogPrivate to use default member initializers,
allowing its constructor to be explicitly defaulted since it was only
used for its member initializer list. Reduces #ifdefery.

Change-Id: Id3885e6d520cde47de96f3b475f6a6bba1ed001f
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
2020-10-07 07:03:27 -04:00
Tor Arne Vestbø
0efe79f80d Rename the new platform APIs from QPlatformInterface to QNativeInterface
We were already using the 'native' nomenclature when referring to these
kinds of APIs, e.g. when talking about native handles, or the existing
QPlatformNativeInterface on a QPA level. Using 'native' for the user
facing APIs also distinguishes them from the 'platform' backend layer
in QPA and elsewhere.

Change-Id: I0f3273265904f0f19c0b6d62471f8820d3c3232e
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2020-10-07 13:03:27 +02:00
Tor Arne Vestbø
4ef7985352 Rename Android offscreen surface interface
The convention for these interfaces is to not have 'platform' in
their name.

Change-Id: I4af831861b58dcfc2538d4206788231b9ec3a766
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
2020-10-07 13:03:27 +02:00
Alexandru Croitor
af9197ff91 CMake: Add missing Android values in qdevice.pri
These were introduced in
675805e9eb and
b9c85d6b0e

They should be exported if they were set.

Change-Id: Ieec565980ba148f675f84dcdd7c19894e349085f
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
2020-10-07 10:08:37 +02:00
Alexandru Croitor
4270522916 CMake: Export the chosen iOS SDK used when configuring Qt
The value is used by mkspecs/features/mac/default_post.prf and
ultimately by xcodebuild to decide which arch and SDK to build
against.

For a simulator_and_device build, no value needs to be set as far as
I can see.

Task-number: QTBUG-87218
Change-Id: I41992bec6b16aadfd87c3f7c10653a6094e76d3e
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
2020-10-07 10:08:31 +02:00
Alexandru Croitor
98cc32d93e CMake: Add iOS mkspec mapping for the wrapper qmake
If no mkspec is provided, we default to the macx-clang-ios mkspec when
building for iOS. This ensures that the wrapper qmake script is usable
for building iOS apps with qmake.

Task-number: QTBUG-87218
Change-Id: Ib02b580c8382b04455c9f820163062591d14a15b
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
2020-10-07 10:08:28 +02:00
Alexandru Croitor
1925909c5f qmake: Fix iOS code signing after QSettings behavior change
6d9ec41f6f changed the behavior of
QSettings::NativeFormat for .plist files.

Previously an array of values was flattened into a multi-key QMap.

Now that QMap doesn't support multiple values for the same key,
the array is returned as QVariantList.

Adjust the code to take that into account.

Task-number: QTBUG-87218
Change-Id: I0cbf8ac7ef10b81539a29d1e68a09a40d3fe74ca
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2020-10-06 18:49:32 +02:00
Dmitry Kazakov
f4442d4670 WinTab: Switch stylus pointer type when the tablet is in the tablet proximity
Some convertible tablet devices have a special stylus button that
converts the stylus into an eraser. Such button can be pressed right
when the stylus is in tablet surface proximity, so we should check
that not only during proximity event handling, but also while parsing
normal wintab packets.

Make sure that we don't switch tablet pointer type while any **mapped**
stylus button is pressed. Pressing the "eraser" button is reported
in pkButtons, but it maps to none by CSR_SYSBTNMAP

https://bugs.kde.org/show_bug.cgi?id=405747
https://bugs.kde.org/show_bug.cgi?id=408454

Pick-to: 5.15
Change-Id: I1d254f0cf79be6ceb194b1c4b314a11831f50170
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
2020-10-06 14:03:08 +00:00
Dmitry Kazakov
f80026ef9a WinTab: Fix updating tablet pressure resolution on every proximity enter event
The user can switch pressure sensitivity level in the driver,
which will make our saved values invalid (this option is provided
by Wacom drivers for compatibility reasons, and it can be adjusted
on the fly).

See the bug: https://bugs.kde.org/show_bug.cgi?id=391054

Pick-to: 5.15
Change-Id: I6cfdff27eaf5a587bf714871f1495a7ea150c553
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
2020-10-06 14:03:01 +00:00
Alexandru Croitor
6fb81a2c14 CMake: Remove leftover debug output
Amends 07b6d3367d

Change-Id: I8d5922af13903c6a10f967035bca70a89b19f86f
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
2020-10-06 14:55:36 +02:00
Tor Arne Vestbø
66550a2bee macOS: Remove dead event type MacGLClearDrawable
Change-Id: If35f3e2a67b94e403210c564bf337b54d621f8c5
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
2020-10-06 11:21:00 +02:00
Tor Arne Vestbø
500ce08b3c macOS: Remove WA_MacVariableSize widget attribute
It was used for the deprecated HI-based theming, removed
in 50428e9727.

Change-Id: Ic0c216c2c056de81c85bcb1e724c0b8ecb8ac7ec
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
2020-10-06 11:20:58 +02:00
Tor Arne Vestbø
31a2398e1d macOS: Remove dead MacQuartz QInternal::PaintDeviceFlags enum value
The QMacQuartzPaintDevice implementation was removed in c0065187d7.

Change-Id: I852c688601f105646d39c95341232512ee57a10d
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
2020-10-06 11:20:55 +02:00
Tor Arne Vestbø
b40d3b0690 macOS: Remove dead widget attribute WA_MacNoShadow
Change-Id: If17acc230fc7669e46956ac2150a5a395694666c
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
2020-10-06 11:20:53 +02:00
Tor Arne Vestbø
5930a0ebc0 macOS: Update slider metrics by explicitly asking it to layout
Pick-to: 5.15
Pick-to: 5.12
Change-Id: I283771624b513f4e8844c6130898ddf2531df0f1
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
2020-10-06 11:20:51 +02:00
Tor Arne Vestbø
57d6f842ea Un-special-case macOS in handling of QKeyEvent::nativeScanCode()
In the porting from Qt 4 to Qt 5 an assumption was made in QKeyMapper
that the underlying platform implementation needed the native scan
code to be able to resolve the possible keymaps for an event.

As a result, the macOS platform plugin started sending key events
with a fake native scan code of 1, so that it would still be allowed
to map key events.

Which in turn led to the documentation of QKeyEvent::nativeScanCode()
getting an exception for macOS.

Let's clean up this by removing the original assumption, and leave it
up to the platforms to decide what information from the key event
is needed.

QKeyMapperPrivate::possibleKeys() will still call extractKeyFromEvent
as a fallback if the platform layer doesn't return any possible keys.

Change-Id: I122a45bcec658c45ccc0b2c0671eb264d85d7be6
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
2020-10-06 11:20:49 +02:00
Tor Arne Vestbø
7aac974c78 macOS: Prevent mapping non-keydown events to characters
The [NSEvent charactersByApplyingModifiers:] API only supports key
down events, but we might get into QCocoaKeyMapper::keyMapForKey for
modifier key presses as well (even if QShortcutMap::nextState tries
to filter out modifier keys).

Change-Id: I02f163edac2baa9052f34b4d5d31b6a627d3d85c
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
2020-10-06 11:20:48 +02:00
Lars Knoll
fa8d021fa6 Convert a couple of APIs to use views
Try to get rid of APIs that use raw 'const {char, QChar} *, length'
pairs. Instead, use QByteArrayView or QStringView.

As QStringConverter is a new class, simply change the API to what we'd like
to have. Also adjust hidden API in QStringBuilder and friends.

Change-Id: I897d47f63a7b965f5574a1e51da64147f9e981f6
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2020-10-06 11:16:36 +02:00
Andreas Klots
40874625f9 Fix a bug in the initialization (and debug-output) of BSP trees
On a horizontal split the current rectangle is split along the y-axis,
creating two children with the dimensions [x, y, width, height / 2]
and [x, y + height / 2, width, height / 2] respectively. When the
BSP tree is initialized, the type of the root node is set to
"Horizontal". However, the offset of the root node is wrongly
initialized with a split along the x-axis instead of the y-axis.
This leads to wrong behavior on QGraphicsScenes with a non square
aspect ratio. E.g on a QGraphicsScene with an apsect ratio favoring
the y-axis, every item between yItem = sceneWidth/2 and
yItem = sceneHeight/2 will be added to the wrong leaf.

[ChangeLog][QWidgets][QGraphicsScene] Fixed a bug in the initialization
of BSP trees to increase the performance of QGraphicsScenes with non
quadratic scene rectangles.

Fixes: QTBUG-87174
Pick-to: 5.15
Change-Id: I360033e94e22eb961f820278993754d10bfc1e45
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2020-10-06 08:26:57 +00:00