Commit Graph

47852 Commits

Author SHA1 Message Date
Timur Pocheptsov
b576011aa1 Huffman compression: handle QByteArray's elements as unsigned char
Fixes: QTBUG-86418
Pick-to: 5.15
Change-Id: Ie57ecad2b1fda7c2fc0de60cbdb4304c00e645d0
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2020-09-07 15:50:04 +02:00
Andrei Golubev
781cf0d7ae Update QList's documentation bits
Fixed some QList documentation that described old API/behavior

Change-Id: I9101ebb7bed9bcac328509765f8e9b85d63d305b
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2020-09-07 15:50:04 +02:00
Andrei Golubev
185498563a QCommonArrayOps: append when inserting into empty container
Ensured append is chosen instead of prepend for corner cases when
inserting into an empty container

Mirrored the logic in shouldGrowBeforeInsert function

Task-number: QTBUG-84320
Change-Id: I1c963a2588c331029e450fe55001bbf324f65fb4
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2020-09-07 15:50:03 +02:00
Andrei Golubev
6f76da5dd0 QList/QString/QByteArray: no prepend optimized allocation when empty
Scoped prepend optimized allocation to only work when prepending into
a non-empty container. Otherwise, even appends would be considered
prepends since d.size == 0 when container is empty

This is, of course, not good for prepend cases but we prefer appends
over prepends. My proposal is to figure out what's the best strategy
based on use cases and performance measurements. For now, let's just
make sure appends are not additionally pessimized

Anyhow, this is an implementation detail and should not be considered
behavior change (at least not the one that is user noticeable)

Task-number: QTBUG-84320
Change-Id: Ibed616a2afa9bc24f78252f15a617bf92e2c6ea3
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2020-09-07 15:50:03 +02:00
Andrei Golubev
6239246ea8 QCommonArrayOps: append when inserting into empty container
Ensured append is chosen instead of prepend for corner cases when
inserting into an empty container

Mirrored the logic in shouldGrowBeforeInsert function

Task-number: QTBUG-84320
Change-Id: I1c963a2588c331029e450fe55001bbf324f65fb4
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2020-09-07 15:50:03 +02:00
Andrei Golubev
08c70ca0cc QList/QString/QByteArray: no prepend optimized allocation when empty
Scoped prepend optimized allocation to only work when prepending into
a non-empty container. Otherwise, even appends would be considered
prepends since d.size == 0 when container is empty

This is, of course, not good for prepend cases but we prefer appends
over prepends. My proposal is to figure out what's the best strategy
based on use cases and performance measurements. For now, let's just
make sure appends are not additionally pessimized

Anyhow, this is an implementation detail and should not be considered
behavior change (at least not the one that is user noticeable)

Task-number: QTBUG-84320
Change-Id: Ibed616a2afa9bc24f78252f15a617bf92e2c6ea3
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2020-09-07 15:50:03 +02:00
Andrei Golubev
c9e419e026 Update QList's documentation bits
Fixed some QList documentation that described old API/behavior

Change-Id: I9101ebb7bed9bcac328509765f8e9b85d63d305b
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2020-09-07 15:50:03 +02:00
Giuseppe D'Angelo
cf482d702b tst_qmenubar: stop doing math on an enum
Cast to the right datatypes.

Change-Id: Ia1ba9be1b0530263e810b50408f432dca485744c
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2020-09-07 15:50:02 +02:00
Timur Pocheptsov
3e210dc19a Huffman compression: handle QByteArray's elements as unsigned char
Fixes: QTBUG-86418
Pick-to: 5.15
Change-Id: Ie57ecad2b1fda7c2fc0de60cbdb4304c00e645d0
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2020-09-07 15:50:02 +02:00
Giuseppe D'Angelo
fec51be209 tst_qshortcut (x2): use op | instead of op + to combine keys
Following the introduction of QKeyCombination, reduce the number
of warnings raised by the test. Drive-by, remove some pointless
math like Qt::SHIFT+0, which does not make any sense and would
actually fail to compile (shortly).

Refactoring the test to fully use QKeyCombination (instead of
ints) is left as a future exercise; some QKeyCombination->int
warnings are still around.

Change-Id: If825bc4c369986623447927bb11493c4f58b544f
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2020-09-07 15:50:02 +02:00
Tor Arne Vestbø
89f7a2759c Deliver Quit event when calling QCoreApplication::quit()
Instead of QCoreApplication::quit() directly calling exit(0), which would
leave QGuiApplication and client code out of the loop, we now send the
Quit event, and let it pass through event delivery, before finally ending
up in QCoreApplication::event(), where we call exit(0).

This has the advantage that QGuiApplication can ensure all windows are
closed before quitting, and if any of those windows ignore the close
event the quit will be aborted. This aligns the behavior of synthetic
quits via QCoreApplication::quit() with spontaneous quits from the
platform via QGuiApplicationPrivate::processApplicationTermination.

Clients who wish to exit the application without any event delivery or
potential user interaction can call the lower level exit() function
directly.

[ChangeLog][QtGui] Application termination via qApp->quit() will now
deliver Quit events to the application, which in turn will result in
application windows being closed as part of the application quit,
with an option to cancel the application quit by ignoring the close
event. Clients who explicitly want to exit the application without
any user interaction should call QCoreApplication::exit() explicitly.

Task-number: QTBUG-45262
Task-number: QTBUG-33235
Task-number: QTBUG-72013
Task-number: QTBUG-59782
Change-Id: Id4b3907e329b9ecfd936fe9a5f8a70cb66b76bb7
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2020-09-07 14:41:16 +02:00
Lars Knoll
0ae5b8af9c Clean up QTextBoundaryFinder and qunicodetools
Make QTBF ready for Qt6 by using qsizetype in the API and use
QStringView where it makes sense.

Change the exported API of qunicodetools to use QStringView as
well and use char16_t internally.

Change-Id: I853537bcabf40546a8e60fdf2ee7d751bc371761
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2020-09-07 09:09:55 +02:00
Lars Knoll
fae4f80ecc Make QStringMatcher ready for Qt 6
Use qsizetype for string indices everywhere.
Clean up the data structures and remove some Qt 3 or Qt 4
left-overs. This reduces the size of the QStringMatcher from
1056 to 288 bytes.

Change-Id: Icc351da8e3aad10a6c940196f52c39f8d2f5bf80
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2020-09-07 09:09:55 +02:00
Marcel Krems
c93b91c766 Remove deprecated method QQuaternion::conjugate
Change-Id: If539e47618357ef329925033842f266447632e6f
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2020-09-07 04:36:16 +02:00
Christian Ehrlicher
4e2656a6d2 QStyleOptionGraphicsItem: remove deprecated member matrix/levelOfDetail
QStyleOptionGraphicsItem::matrix and levelOfDetail are deprecated and
not used anywhere anymore.

Change-Id: Id4b0fa8ac3ac53d771e858ecda5524a5e690342d
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2020-09-06 18:31:43 +02:00
Allan Sandfeld Jensen
68198de4db Use C++17 [[maybe_unused]]
In some places needs to be ordered before const/constexpr though.

Change-Id: I57a521ac0ad22b5a018761c4d52befbef69d64c0
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2020-09-06 18:31:43 +02:00
Allan Sandfeld Jensen
d3ff95dcb8 Round float->qfloat16 to even
Calibrated to match F16C and ARM-FP16 hardware conversions.

Change-Id: I3bdd4d3db3046fee4aeb24e4ce8b9bc9a06e0397
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2020-09-06 12:35:12 +02:00
Lars Knoll
a0e0b51001 Inline QTest::qSleep()
Simply use QThread::msleep() to implement it.

Change-Id: I37c255fc70951715edc489d9f67669b01af380b1
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2020-09-06 00:17:14 +02:00
Lars Knoll
75d1d2a913 Get rid of hasPendingEvents() and flush()
They are unused.

Change-Id: I77383f2be45551401ed9c2f88285511134cc8b0d
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2020-09-06 00:17:12 +02:00
Lars Knoll
2caa2faf01 Remove two obsolete #defines
Change-Id: Icc13408cfdb8ce0db6f274904c3e44f8376cd1e5
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2020-09-06 00:17:09 +02:00
Lars Knoll
ff69227a49 Cleanup QSemaphore and make it always 64bit large
This simplifies the implementation so that we don't
need separate code paths for 32 and 64 bit anymore.

Change-Id: I823612865e7d648fb0bd1632385ce67b5a452b8a
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2020-09-05 17:51:22 +02:00
Lars Knoll
1cf08cbc5b Cleanup a ### Qt 6
Change-Id: If9dd04e25ddc5164cc23ac7d5684254e38b7eda6
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2020-09-05 17:51:10 +02:00
Marcel Krems
996e08734e Remove /INCREMENTAL:YES from linker flags
This flag doesn't exist in MSVC 2015+:
LINK : warning LNK4224: /INCREMENTAL:YES is no longer supported;  ignored
https://docs.microsoft.com/en-us/cpp/build/reference/incremental-link-incrementally?view=vs-2015

Change-Id: I3b2aace619351e2dc9cc86e1df28facc21b7d9fe
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2020-09-05 15:12:50 +00:00
Giuseppe D'Angelo
2ab91dd68e tst_qdbuscpp2xml: stop doing math on enumerations
Cast it to int to do math.

Change-Id: Ia553cccb7e160df50e77fba63d66d0ed45c246c2
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2020-09-05 17:12:50 +02:00
Wang Peng
2ee5449aca QCompleterItemDelegate: replace QItemDelegate with QStyledItemDelegate
Resolve remaining Qt6 TODOs

Change-Id: Ice8dae2f1cbd3ed452ab78d5d7735127d7662900
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2020-09-05 23:12:50 +08:00
Wang Peng
bb3cdd6e3a QCalendarDelegate: replace QItemDelegate with QStyledItemDelegate
Resolve remaining Qt6 TODOs

Change-Id: I018ef5e3761816dce052a78be3dcd07ede866135
Reviewed-by: JiDe Zhang <zccrs@live.com>
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2020-09-05 23:12:49 +08:00
Fabian Kosmale
7505422bbf QMetaType: optimize comparison
We can skip the id calls if we know that the pointers are equal.

Change-Id: I62f9cac557d7b82b640a143965f9056a8cd46028
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
2020-09-05 09:33:29 +00:00
Jarek Kobus
8ef41d1713 Use QList instead of QVector in qmake
Task-number: QTBUG-84469
Change-Id: I4a3da94702f1dad1ee10b1ba3c6712b6f40338c9
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
2020-09-05 07:07:44 +02:00
Andy Shaw
973a795bec When finding the engine for a fallback font, then clear the families
If it is a fallback font, then it should just have family set to that
font so it does not get interference from what the families were
originally set to.

Fixes: QTBUG-85560
Change-Id: I6232f3d2ae12052fa3b0b3bc0e7f106e239a585d
Pick-to: 5.15
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
2020-09-05 05:22:45 +02:00
Lars Knoll
247c10bf4c Get rid of the MSVC specific file
It used to contain the MSVC specific export hack for QVector,
but that one is not required in Qt 6 anymore and the file
was not doing anything anymore.

Change-Id: Ic8b4aa355a8934beb6abcf10235d218344a294cc
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2020-09-05 02:12:15 +02:00
Christian Ehrlicher
99e52b368e QStyle: remove deprecated SH_SpellCheckUnderlineStyle
It was deprecated with 88e6f8cff2 and is
not used anywhere anymore so it can be safely removed.

Change-Id: If4050ac8bf116fb31491b3b08096554c5ea3e4d5
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2020-09-05 02:09:51 +02:00
Lars Knoll
bbc19bd979 Make test pass on machines with many cores
Just starting 20 threads to test this won't cut it if
the machine you're testing on has an ideal thread count
of 16 or larger.

Change-Id: Icba8f00aa836fec6da41c71b318e9e17bdd47c0e
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2020-09-05 02:08:49 +02:00
Edward Welbourne
3d7d8346dd Remove some comments that are no longer relevant
Task-number: QTBUG-85700
Change-Id: I5ce368e8edca2b9483a0f0ef34bc9eb6b4e44574
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2020-09-05 02:08:29 +02:00
Lars Knoll
db61425225 Remove some obsolete code
Those checks aren't required anymore for Qt 6.

Change-Id: Ida9f93544f42cb03723659a81e0094aa0cf14799
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2020-09-05 02:07:29 +02:00
Giuseppe D'Angelo
e6c9ef72a9 QWindowsKeyMapper: fix mixed math between int and enum/flags
Either do it between ints, or cast to the right types before
doing it. This should enable removing operator+ and - between
int and QFlags.

Change-Id: I30ecc03566cff8ce880b048ba3a9d7d50f3c8509
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
2020-09-05 02:06:54 +02:00
Volker Hilsheimer
0f39cfae93 Change QWidget::enterEvent signature to take a QEnterEvent
This is a source incompatible change for widget implementors.
Leaving the old enterEvent as a virtual overload is problematic due to
shadowing. Best to make a clean cut, widget reimplementors will get a compile
time warning if they mark their override as such, or if they try to call the
parent class implementation.

Addresses ### Qt 6 comment.

[ChangeLog][QtWidgets][QWidget] The virtual enterEvent handler now receives
a QEnterEvent, which contains information about mouse position and button
states, rather than a plain QEvent.

Change-Id: I233f594fd79c0c090983b3db8532913d00132fde
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2020-09-05 02:06:26 +02:00
Volker Hilsheimer
403b01f866 Change translation context of strings to new class
The strings were in QFileDialog context even though they were in
QFileIconProvider, probably for historical reasons.

Now that the strings have been moved into QtGui, using a QtWidgets class
as the context makes no sense.

Change-Id: Ia4f3bd18abaab2a5fbbb94e945782f4d2d94e7d1
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2020-09-05 02:03:58 +02:00
Volker Hilsheimer
455d811b58 Fix compiler warnings from using deprecated qChecksum overload
Change-Id: Ib7a6d0e752dc662a42abe38f2010da3f2b4626f1
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2020-09-05 02:03:49 +02:00
Volker Hilsheimer
78695bbf19 Fix compiler warnings after QKeyCombination introduction
Change-Id: If5d7c5e037b99c14c51d83adf8b1e20d6b924bc5
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2020-09-05 02:03:40 +02:00
Volker Hilsheimer
c549c35408 Fix compiler warning from unused private field in QSequentialIterable
Change-Id: I9c330b4f99f77404eacda2506d264f917f9e1161
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
2020-09-05 02:03:31 +02:00
Liang Qi
c91d1fdc10 xcb: drop Xinerama support
[ChangeLog][Important Behavior Changes][X11] Xinerama is no longer
supported.

Fixes: QTBUG-86082
Change-Id: Ieb57d9035e1659fc22bf8333247fc3573fb62992
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Reviewed-by: Gatis Paeglis <gatis.paeglis@qt.io>
2020-09-04 17:28:49 +00:00
Liang Qi
d85bc34b79 Fix memory sanitizer complaint about uninitialized value
Fixes: QTBUG-86383
Pick-to: 5.15
Change-Id: Ib2bbe5d8e11574456fdc8b5c5fb07f5e41b538b3
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2020-09-04 19:28:48 +02:00
Volker Hilsheimer
c87b626d70 Merge QPainterPathPrivate and QPainterPathData
As per ### Qt 6 comment, and the code that never allocated QPainterPathPrivate.

Change-Id: I553e3559fdb2a675f37cdd9855462a2f22ef84c6
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
2020-09-04 08:38:10 +02:00
Volker Hilsheimer
00a5629d8d Remove deprecated QPrinter and QPagedPaintDevice APIs
Adjusting the QPrinter test case - some use cases no longer exist, or are
already tested in QPageSize and QPageLayout tests.

Adjust examples and manual tests.

Change-Id: I01cbc65f3d8031aea2dac86dd942126ba708b111
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2020-09-04 08:37:59 +02:00
Lorn Potter
6b171dc6c0 wasm: enable httpmultipart
This allows for multipart requests.

Change-Id: I1206d160cfd9150a9627c36ed60ea4cbb58e95aa
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2020-09-04 12:33:21 +10:00
Jarek Kobus
225cc60954 Fix flaky QFutureWatcher::startFinish() test
Since waiting for a spy employs polling, it may happen
that while waiting for a startedSpy we had received already
a signal for finishedSpy. This explains current flakiness.

The fix is to connect to lambdas instead and update
the hit count accordingly. Inside lambdas we also
ensure the correct order for started / finised signals.

After waitForFinished() unblocks we ensure that possible
pending asynchronous signals (started / finished) are processed
and check the final state.

Task-number: QTBUG-83076
Change-Id: I16963ef9c011cb613d7b409d3e3032303a942336
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2020-09-03 20:45:00 +02:00
Volker Hilsheimer
85b0335c41 Tighten up QDialogButtonBox::ButtonLayout enum
... and the equivalent enum in QPlatformDialogHelper.

No need to keep numerical values the same anymore.
Remove ### Qt 6 comment.

Change-Id: Ib369ea6ca2362f6ab0f71a3a6c90c4adaa7f11cd
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2020-09-03 18:51:41 +02:00
Volker Hilsheimer
f51b690e91 Remove timeStep parameter from QAnimationDrive::advanceAnimation
Addresses ### Qt 6 comment, and documentation pointing out that the parameter
value is ignored. It wasn't ignored in the code, but that's the kind of change
we can make now.

With this change, QUnifiedTimer::updateAnimationTimers is only called with -1
as the currentTick input parameter, also from Qt Declarative. Make it default,
so that leaf modules can be fixed. Once that it done, the parameter can be
removed completely.

Change-Id: I80c57ff92f3b615b932dd73d711cf6397347efd8
Reviewed-by: Jan Arve Sæther <jan-arve.saether@qt.io>
2020-09-03 18:43:22 +02:00
Tasuku Suzuki
21de5aa1ac Fix build without features.highdpiscaling
Broken since 37d5aaa4b4

Change-Id: Id741f23ccae4f619e6a389ee71b3e7fe0c599989
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
2020-09-04 00:33:50 +09:00
Morten Johan Sørvig
fdb442a72a Remove obsolete native client platform
Change-Id: Ia27cfbb618d216c371a0f8210f0bec483d4f15db
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2020-09-03 14:51:13 +02:00