Commit Graph

50017 Commits

Author SHA1 Message Date
Christian Ehrlicher
05706bd2b0 QPdfWriter: fix embedding fonts in pdf files
The container size change from int32_t to int64_t created a subtle error
during font serialization. The size of a QByteArray was serialized
without a proper cast and therefore now 8 bytes instead 4 bytes were
written to the stream.

Fixes: QTBUG-89727
Pick-to: 6.0
Change-Id: If9255a5a3124038356bc5053810f98c7c88f8a01
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
2021-01-09 09:04:29 +00:00
Andreas Buhr
d26da5fc09 Remove outdated comment and unnecessary initialization call
In construction of QPropertyBindingPrivate was an initialization
of inlineDependencyObservers with a comment that this is necessary
because of a union. But inlineDependencyObservers is not inside a
union. The comment is outdated and the explicit initialization
superfluous. This patch removes it.

Change-Id: I06544a816533c41af8fc5da3ef44ddd7c18ca86e
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2021-01-09 10:03:21 +01:00
Timur Pocheptsov
3d5f86e77d tst_QSslSocket::setSslConfiguration - skip if SecureTransport is in use
SecureTransport does not allow deprecated digest algorithms, and
(depending on ST version) it may or may not accept our server's
certificate.
Funnily enough, they 'fluctuate' between versions again and again.

Fixes: QTBUG-89922
Change-Id: Ie5fbfca316806bd5000ce2d128b81b718bb36624
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2021-01-08 20:33:24 +00:00
Li Xinwei
0c7042defa CMake: improve FindMySQL.cmake
On Windows, Qt should libmysql.lib instead of mysqlclient.lib.

Add support for mariadb.

Re-indent FindMySQL.cmake.

Fixes: QTBUG-88661
Fixes: QTBUG-89775
Pick-to: 6.0
Change-Id: I6bdf195b8976c59230a12af335a838af55df0caf
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
2021-01-09 00:16:34 +08:00
Ahmad Samir
138fa9f2f4 QDir/QFileInfo: add doc notes about paths starting with ':'
This is an addendum to commit 0da5726a43b; making the note about paths
starting with ':' being treated as absolute paths by the underlying
QFileSystemEngine, more visible, so that users of the class don't hit
that pitfall.

Add similar docs to QFileInfo.

Pick-to: 5.15 6.0
Change-Id: Ib34d066d31bb673d340ec41422ed4daf911765b8
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
2021-01-08 18:13:42 +02:00
Allan Sandfeld Jensen
d5a980df97 Send Qt::Key_MediaTogglePlayPause for VK_MEDIA_PLAY_PAUSE
Speculative fix to get the right keys in WebEngine

Pick-to: 6.0 5.15
Fixes: QTBUG-89915
Change-Id: I79519b715a1415dccfc4601aae5025b3222a79ae
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
2021-01-08 16:56:27 +01:00
Alexey Edelev
4d34314679 Remove redundant .qch from installed docs
Use upper-level document build directory for generated .qch files. This
avoids copying of .qch with html documents and duplicating them in
the installation directory.

Pick-to: 6.0
Change-Id: I63b2de0047005419d352ea259dec6f17a826a477
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
2021-01-08 16:51:26 +01:00
Volker Hilsheimer
9963aaacdb Remove irrelevant test row, fix compiler warning
With the introduction of QKeyCombination, the result of |'ing together
a set of modifiers and a key goes always through the same QKeySequence
constructor, no matter the order.

The implicit conversion through int when the wrong order is used
causes a compiler warning as that conversion is deprecated. So remove
that test case.

Pick-to: 6.0
Change-Id: I04e27bcd51723ee0efc77e52e45ca3eb8bac5fc7
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
2021-01-08 16:37:22 +01:00
Friedemann Kleint
867b11596b Windows QPA: Fix missing QScreen change updates
Remove the logic compressing WM_DISPLAYCHANGE signals by the
WParam/LParam since it also triggers when the geometry is changed
by rearranging screens.

Fixes: QTBUG-79442
Change-Id: I00042c9e687bdb67fc17d6c507818b79a7aee0a2
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
2021-01-08 13:43:47 +01:00
Alex Trotsenko
423e6c3635 QProcess/Unix: consolidate process state tracking socket notifiers
There is no reason to have the startup notifier and the death notifier
be active at the same time, as the former will detect death as well.

Previously, these notifiers were racing, but _q_processDied() ordered
signals by calling _q_startupNotification() manually. Thus, the
started()/finished() sequence was always emitted if the child process
was killed anywhere. Now this ordering is simply not necessary anymore.

This makes it possible to reuse the startup notifier for death
notification.

Change-Id: I5ebed9b5f28b19fe56c80498977a3b21be9288fd
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@gmx.de>
2021-01-08 14:29:43 +02:00
Edward Welbourne
7fea8a079f Assert that wchar_t's size matches one of the unicode character types
This is assumed in various places, so best checked explicitly.

Change-Id: I475dcf5cbb60c0272dec560acd2893cff73872ce
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2021-01-08 12:41:28 +01:00
Edward Welbourne
4724d017ef Minor tidy-up: two sizetype fixes, two \nullptr uses
Change-Id: I6c4a1296350ecaf9a661dba22670fbb2ad23bd77
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2021-01-08 12:41:06 +01:00
Edward Welbourne
c9c598d4d7 Mark places where we missed conversion to unicode character types
We should use char32_t for the toUcs4() methods of QString and
QStringView and use char16_t for QString::utf16(), thereby matching
QStringView. These naturally imply knock-on changes in various places.
Unfortunately, we didn't make those changes in Qt 6, so they'll have
to wait for Qt 7.

Change-Id: I18451d4b31b76658092e19d3fcbc8bc0fe5ce307
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2021-01-08 12:40:53 +01:00
Samuli Piippo
d3399092db tst_qdatastream: expect failure on 32bit system with large QBitArray
Test data causes the QBitArray to be read as 0 byte length. Same issue
on all 32bit systems, removing android blacklisting as this was the only
one failing there.

Task-number: QTBUG-87660
Change-Id: I63f0c1c6fa4e2242e6ebe70f50e422ab0fbf1c88
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
2021-01-08 12:25:55 +02:00
Alexey Edelev
7f5429f2f4 Add newline to the end of the config.summary
Amends 94b6bec01f

Pick-to: 6.0
Change-Id: I0d4be9c7f9aff071468a66d7940d6cd2488136ca
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
2021-01-08 10:01:29 +01:00
Andreas Buhr
618dd6b5a7 QProperty docs: update macro name
Use Q_OBJECT_BINDABLE_PROPERTY instead of non-existing ones.
Follow-up to 50e1976437.

Task-number: QTBUG-85520
Pick-to: 6.0
Change-Id: I138f0775d9804029f2ecd6bd3594ab47b247392e
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
2021-01-08 10:01:23 +01:00
Samuli Piippo
18ef1b83fb tst_qtextmarkdown: blacklist tests for QEMU ARMv7
Most tests fail when running on QEMU ARMv7, but not on target HW or
QEMU ARM64.

Task-number: QTBUG-89819
Change-Id: I686268c200cce1a44a717b80c2970f608be44636
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
2021-01-08 09:04:55 +02:00
Andy Shaw
dce43106e2 PSQL: Fix the QSqlDatabase test
Pick-to: 6.0 5.15
Change-Id: Ic7956b556f1f0f10574fd79f5cbd283208240353
Reviewed-by: Christian Ehrlicher <ch.ehrlicher@gmx.de>
2021-01-07 22:28:41 +01:00
Nico Vertriest
1b636b72e5 Doc: Fix \sa statement link error
Change-Id: I19f131a7bcbbed5ec39a7ad79a9d7a46d1320529
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
2021-01-07 18:36:33 +01:00
Samuli Piippo
19a756047e tst_qstylesheetstyle: blacklist tests for QEMU ARMv7
QEMU ARMv7 uses different font, which doesn't pass the tests.

Task-number: QTQAINFRA-3836
Change-Id: I8454c35d99045adfd28d3bcbbaf791b0a668978f
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
2021-01-07 16:53:43 +02:00
Samuli Piippo
ea16299072 tst_qlineedit: expect failure only on armv7
Works correctly on ARM64

Change-Id: I7a7d54525a5411a5d7363053c28e131a64f0cc40
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
2021-01-07 16:53:22 +02:00
Frederik Gladhorn
a62fa9b7cc Revert "Fix invalid text layout data when a full layout run is interrupted"
This reverts commit 09ee4282e5.
The commit made the layouting time go from linear to quadratic, which is
problematic when rendering big documents impractical.

I wrote an alternative fix for QTBUG-20354 which will come as separate
change since it approaches the problem in a different way.

Fixes: QTBUG-89599
Task-number: QTBUG-20354
Pick-to: 5.15
Pick-to: 6.0
Change-Id: Ie450332f06ee40e60c8e4c6c7d10834bff1acf74
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
2021-01-07 14:48:34 +00:00
Joerg Bornemann
ad2da2d27a Remove the qmake project files
Remove the qmake project files for most of Qt.

Leave the qmake project files for examples, because we still test those
in the CI to ensure qmake does not regress.

Also leave the qmake project files for utils and other minor parts that
lack CMake project files.

Task-number: QTBUG-88742
Change-Id: I6cdf059e6204816f617f9624f3ea9822703f73cc
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Kai Koehne <kai.koehne@qt.io>
2021-01-07 15:32:28 +01:00
Friedemann Kleint
fca3ea040c QTestlib: Fix custom toString() implementations for QList comparison
d25589e052 mistakenly changed the code
to use toString() from the QTest namespace. Call toString()
unqualified and move the compareSequence() helper out of the
internal namespace.

Fixes: QTBUG-89737
Pick-to: 6.0
Change-Id: I8452a0aead7771ad13a5b95438b54e202ccce76b
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2021-01-07 15:13:44 +01:00
Alexey Edelev
0f38f69d44 Fix qch install path
Exclude qch_file_name from install DESTINATION

Fixes: QTBUG-89769
Pick-to: 6.0
Change-Id: I8dba13a0a2c2c92d6b2d6aa438c295b42a04156b
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
2021-01-07 14:13:41 +00:00
Allan Sandfeld Jensen
4c6c094895 Windows QPA: Lookup DISPLAYCONFIG data for monitors
Gives more accurate orientation and refresh-rate.

Change-Id: I90b0b7563efc35c9bace07ccb3996350a957e8e5
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
2021-01-07 12:00:47 +01:00
Samuli Piippo
ac970d48fd tst_qdatetime: blacklist zone-change test for QEMU ARMv7
systemTimeZoneChange() fails also on 32bit QEMU ARMv7.

Task-number: QTBUG-87663
Change-Id: I5c006a8637edff0a95b1f9b76d2c58006aeae6d6
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2021-01-07 06:35:31 +00:00
Samuli Piippo
5a0f9004e2 tst_qarraydata: blacklist dataPointerAllocate on all 32bit systems
The test case fails also on QEMU ARMv7.

Task-number: QTBUG-88705
Change-Id: Ibe8c777f0205b298f6b9a27c067dd552253fcf33
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
2021-01-07 08:35:21 +02:00
Samuli Piippo
513be303b7 tst_toolsupport: fix expected alignment on ARMv7
The alignment has been recently updated but never correctly tested,
as test has either been disabled or marked as insignificant.

Change-Id: If6e529c290b2057f58c3b27c89279d9e90728ad4
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Reviewed-by: hjk <hjk@qt.io>
2021-01-07 08:35:10 +02:00
Camille Viot
8fa91c75ad Clean up code that handle clipboard image conversion on Windows
This commit remove old legacy code that try to deal with clipboard
image conversion in the qwindowsmime class. It now uses
qbmphandler under the hood which is much more complete.
It also add a small fix for the conversion
of BI_RGB clipboard image with an explicit alpha layer (which Firefox
use on Windows).

Change-Id: Iae026378831799dc676e1aba7d5bd6a0d1c01e7f
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
2021-01-06 21:53:44 +01:00
Tor Arne Vestbø
e7370d0583 Skip already closing widgets when checking whether application can quit
QApplication tries to close all windows on quit using closeAllWindows,
but closeAllWindows skips windows that are already closing. This can
happen when calling quit() from a close event for example.

QApplication then tries to verify that all windows have been closed,
and that logic should skip the same kind of windows as closeAllWindows
does.

The fact that these two logics diverge was identified earlier in
5af73cd9db, but aligning them required further work. As that
commit notes, the right fix to align them is building on top of
tryCloseAllWidgetWindows(), which already returns true/false based on
whether it could close all windows or not. But, unlike the existing
logic in QApplication::event(), it doesn't skip Popups or Dialogs,
so that discrepancy needs further research.

Pick-to: 6.0
Fixes: QTBUG-89580
Change-Id: I87bff56f2eb8a539f1c859c957f5f239dc1eb93d
Reviewed-by: Andy Shaw <andy.shaw@qt.io>
Reviewed-by: Kai Koehne <kai.koehne@qt.io>
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2021-01-06 16:59:11 +00:00
Ulf Hermann
c9a1102269 Make QString and QByteArray sequentially iterable
As lists of QStrings and QByteArrays are sequentially iterable the base
types should really also be.

The only problem is that they don't have methods to remove items from
the back or the front, but that is well within what we can support with
QSequentialIterable.

Change-Id: I2ab551e7b11a092aba363fb4012d131bbc4b11b4
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2021-01-06 17:15:03 +01:00
Kai Köhne
05146a77fc Doc: Improve QMap, QMultiMap description
Make it clear that the fast lookup is by key, not by value.
See also discussion in

https://forum.qt.io/topic/121907/misleading-documentation-of-qhash-qmap/

Pick-to: 5.15 6.0
Change-Id: I396297e0e4674e0a1f889f4138ab52ff224c0ee2
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
Reviewed-by: Samuel Gaist <samuel.gaist@idiap.ch>
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
2021-01-06 17:00:42 +01:00
Laszlo Agocs
3ce5128d80 Fix missing repaints with QOpenGLWidget in a QDockWidget
When AA_ShareOpenGLContexts is not set, docking or undocking
will lead to changing the associated top-level window. This
leads to changing the OpenGL context, and tearing down and
then recreating all OpenGL resources (assuming a well written
application). The problem is, there are no paint events after
the Show, meaning the user code's paintGL is often not invoked,
which leads to showing an empty QOpenGLWidget until something
else triggers a paint event. To remedy this, send a paint event
upon Show, which should be harmless enough, while fixing the
case of docking/undocking.

Pick-to: 6.0 5.15
Fixes: QTBUG-89812
Change-Id: I3c4560f8f069d86645a6314bf7ad1b4ee8e2c716
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
2021-01-06 16:18:25 +01:00
Laszlo Agocs
f0d1a50333 rhi: vk: Prevent WAW hazard reported from sync validation with offscreen rt
...when a QVkRenderBuffer is used as depth-stencil (i.e. a "throwaway"
depth-stencil buffer that is a lazily allocated / transient VkImage
under the hood). Such a resource is not tracked by the
QRhiPassResourceTracker, so do an explicit barrier in beginPass
instead of having it generated by the tracker.

Fixes: QTBUG-89764
Change-Id: Ice794f44342175f712ea56f450270cbb8929f516
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
2021-01-06 16:18:20 +01:00
Laszlo Agocs
5f8efb2597 rhi: gl: Reset tracked state upon a buffer update or readback
...encountered in the command list.

Move all, previously local, tracking variables into a struct. This
allows creating helper functions to reduce error-prone repetition in the
executeCommandBuffer() function body.

The only real change in the patch is in the handling of
Command::BufferSubData and Command::GetBufferSubData: here, instead of
calling glBindBuffer directly, use a helper function that also resets
the relevant state tracking variables. A subsequent
Command::BindVertexBuffer or BindIndexBuffer will therefore correctly
rebind the appropriate buffers.

This is particularly relevant with certain command stream patterns
exercised by some Qt Quick 3D scenes:

- A View3D renders a mesh,
- another View3D has some 2D Qt Quick content, as well as a model with
  the same mesh.

When both View3Ds use the default Offscreen render mode, the resulting
command list consists of segments along the lines of:

1. prepare resources for first View3D

2. render content for first View3D - this binds the vertex and index
   buffers for the mesh (state is tracked; all 1-4 steps are within
   the same command list, processed by a single call to
   executeCommandBuffer())

3. prepare the content for the "inline" 2D Qt Quick scene - this may
   update vertex and index buffers, that may lead to adding
   BufferSubData commands to the list (tracked state (last
   vertex/index buffer) may need invalidation/updating - and that's
   where our problem lies)

4. the second View3Ds 3D content is rendered: a model with the same
   mesh as the last (Quick)3D draw call, so same vertex and index
   buffers. If #3 did not invalidate and/or update the tracked state,
   the glBindBuffer calls are (incorrectly) skipped.

Fixes: QTBUG-89780
Pick-to: 6.0
Change-Id: Icc933252f3993b8727d192e7ba4aa0f842bab51e
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
2021-01-06 16:18:15 +01:00
Andreas Buhr
6a664d0660 Fix segmentation fault in QObject::dumpObjectInfo
There was a check "if (cd && cd->signalVectorCount())" in the code
which was faulty because "signalVectorCount()" could return -1 to
indicate that no signalVector is available. This patch fixes
the problem.

Fixes: QTBUG-89846
Pick-to: 5.15
Change-Id: I12c512ff8d889ba2bd298789ab6081930f739089
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2021-01-06 16:17:47 +01:00
Alexey Edelev
5f867f4b1f Add 'oci' to possible Oracle Client library names
In latest Oracle Instant Client releases for windows the OCI library
name is 'oci.dll'. Add it as option to find_library call.

Change-Id: I6e6f4a998207d16583a380c1bd95db857051606b
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
2021-01-06 16:17:47 +01:00
Kai Köhne
05ec5a47ab QLocale: Remove dead code
The code using it got removed in qttools commit 01da5d9a

Change-Id: I14d36ac939f2647139fcc42591a044a03e707553
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2021-01-06 16:17:47 +01:00
Volker Hilsheimer
7114b6d23c Prefix binary produced by QAbstractItemModelTester testcase with tst_
This is standard for all test cases. It matters, because cmake targets
are generated, and e.g.

$ ninja tst_qabstractitemmodeltester

should do what the user expects.

Change-Id: Iac8160c53d5005382e61c03b7daceaba0a4c2596
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: David Skoland <david.skoland@qt.io>
2021-01-06 11:16:13 +00:00
Joerg Bornemann
36b1e03ecd Remove superfluous OpenGL_GL_PREFERENCE assignment
We did set this variable, however after src/gui/configure.cmake
was loaded (it is early-loaded in src/CMakeLists.txt), meaning the
assignment had no effect.

Also, what this assignment tried to achieve is covered by our global
CMake policies now.

Pick-to: 6.0
Task-number: QTBUG-89754
Change-Id: Ie7aeee1505d112d799455b2915acbfa7e9a12a64
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
2021-01-06 09:30:31 +01:00
Paul Wicking
32a46a1dcf Doc: Use correct include for QtFuture namespace
Pick-to: 6.0
Fixes: QTBUG-89766
Change-Id: I20c5d3c12490a5eed7bb4e267b2edb5d45dbaadf
Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
2021-01-06 08:02:06 +01:00
Craig Scott
ae91e3365b android: Generate deployment settings file with correct qml-import-paths
The qt6_android_generate_deployment_settings() command had been
creating deployment settings files with the wrong key name for qml
import paths. This resulted in the QT_QML_IMPORT_PATH target property
having no effect.

The QT_QML_IMPORT_PATH property can also potentially hold a list, not
just a single value. This change now handles the list case as well,
previously qt6_android_generate_deployment_settings() was assuming it
always held a single path if it was set.

Fixes: QTBUG-89628
Pick-to: 6.0
Change-Id: Ibdd74ec8d130f160433a60a14a0a9f496f496a1b
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
2021-01-06 13:11:57 +11:00
Zhang Yu
22416ecaaf Fix QMultiHash::equal_range crashes
QMultiHash::equal_range crashes when called in a const member function.
The Data `d` is a NULL pointer when calling equal_range()
before inserting data into an empty QMultiHash.
Then calling`d->find` crashes.

Fixes: QTBUG-89687
Pick-to: 6.0
Change-Id: I10c3d196cbc72aed8c8c922ef16534bba51037b7
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2021-01-06 09:07:10 +08:00
Alex Trotsenko
13f9e2857b Remove superfluous call in QProcessPrivate::_q_startupNotification
There is no need to disable startupSocketNotifier because the call to
QProcessPrivate::processStarted() will do that.

Change-Id: I20b816533d9a5c4b9bf57135d26166c961a07d07
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@gmx.de>
2021-01-05 21:15:37 +02:00
Andy Shaw
9d36ee1904 TableView: Trigger the resizing of editors resizing a row/column
If there is an editor in the table then this needs to be updated as
the resize happens, otherwise it will not adapt to the new size
correctly and can appear drawn over other cells.

Fixes: QTBUG-85484
Pick-to: 5.15 6.0
Change-Id: I918c37f1ee1b0614c03c6b38f95f0f8b35a571f2
Reviewed-by: Samuel Gaist <samuel.gaist@idiap.ch>
2021-01-05 18:31:54 +00:00
David Faure
0cbbba2aa5 Update shared-mime-info to the 2.1 release, adjust implementation
The spec hasn't changed, but I made the same mistake in xdgmime
(the reference implementation) and in Qt: when multiple globs match,
and the result from magic sniffing is unrelated to any of those globs,
then I used the magic result, but that's wrong, globs have priority
and one of them should be picked up.

This is now fixed in xdgmime
(https://gitlab.freedesktop.org/xdg/xdgmime/-/merge_requests/3)
and in the expected results in shared-mime-info
(https://gitlab.freedesktop.org/xdg/shared-mime-info/-/merge_requests/99)
which this commit is also tested against.

This change also optimizes QMimeBinaryProvider::addFileNameMatches
to have the same logic as xdgmime for glob matching:
literals > extensions > other globs
As soon as one category matches, we can stop there.
This makes no difference in the overall results, in practice.

The user bug report (against the Qt implementation, actually)
is https://gitlab.freedesktop.org/xdg/shared-mime-info/-/issues/138
as well as https://bugs.kde.org/show_bug.cgi?id=411718

Pick-to: 6.0 5.15
Change-Id: Ia0a34080427daff43c732609443ee6df8f41447c
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2021-01-05 18:31:54 +00:00
Liang Qi
e688b99995 QInputControl: accept surrogate category character
See also https://unicodebook.readthedocs.io/unicode_encodings.html#utf-16-surrogate-pairs .

Fixes: QTBUG-89184
Pick-to: 6.0 5.15
Change-Id: I04eff7f42f0030346603a7b31e4ac854a477030c
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2021-01-05 16:24:29 +01:00
David Skoland
34f0841451 Fix minor errors in tests
Fix indentation in tst_qlockfile and remove QtTest include in
tst_qcheckbox.

Change-Id: Idf630c6337859dbcc8f644010b941bfe55bb0633
Reviewed-by: David Faure <david.faure@kdab.com>
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2021-01-05 12:43:09 +01:00
Edward Welbourne
6974737695 Change QLineF::setLength() to work whenever length() is non-zero
Previously it only worked when isNull() was false, which is true for
very short lines, even though length() may be non-zero.

[ChangeLog][QtCore][QLineF] QLineF::setLength() will now set the
length if the line's length() is non-zero. Previously, it was
documented to only set the length if isNull() was false; this is a
fuzzy check, so isNull() could be true for a line with non-zero
length().

Fixes: QTBUG-89569
Pick-to: 6.0 5.15
Change-Id: I803e622ad09c85815dde25df8dd3ba6dfcba0714
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2021-01-05 12:43:09 +01:00