Commit Graph

43105 Commits

Author SHA1 Message Date
Assam Boudjelthia
dbaf62033a Android: fix mimeTypes handling for file dialog
Since Android native file manager supports mimeTypes, I use
QMimeDatabase to get the correct mime type for the nameFilter
used with the file dialog.

[ChangeLog][Android] Support setting mimetypes and and namefilters for
Android native file dialog.

Task-number: QTBUG-83089
Change-Id: I46545576dc9b51aa872bb37dbf4fe12b2533bdd9
Reviewed-by: Ville Voutilainen <ville.voutilainen@qt.io>
2020-05-05 10:29:15 +03:00
Kai Koehne
540b6f6d64 Doc: Fix compilation of testlib snippets if sql, widgets are missing
Change-Id: Ibcc872408ba829085809737004d9d3186bd20bab
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
2020-05-05 08:33:49 +02:00
Kai Koehne
fcceae605a Allow switching of QT_NO_CREATE_VERSIONLESS_TARGETS
Fixes: QTBUG-83774
Change-Id: Ib3f2507a917046426b94a779e205012ce52cbfe9
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2020-05-05 08:33:40 +02:00
Kai Koehne
ec2ac17c10 Improve QTranslator documentation code snippet
Use :/i18n/, because this is the place where translations are stored
by default if using qmake's CONFIG += lrelease embed_translations.

Also revert change of app.exec() done in 16da0b2cf8. First of all,
both QGuiApplication and QApplication feature overloads of exec(),
so using QCoreApplication::exec() might miss functionality.
Anyhow, while it's true that all of them are static member functions,
the vast majority of our examples and templates call them with
class member access syntax, so let's try to be consistent.

Finally, the example since a while uses QCoreApplication::translate,
not tr(), so let's not mention it in the description.

Change-Id: Ic6e5d91cf04d3f0d1a4296c5c09e790773e6fc62
Reviewed-by: Miłosz Kosobucki <milosz@kosobucki.pl>
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
2020-05-05 08:33:31 +02:00
Thiago Macieira
8f7e21bc50 Don't compile pcre2 if we will use the system library
Change-Id: I99ab0f318b1c43b89888fffd160b4923a06c4585
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
2020-05-04 12:49:30 -07:00
David Faure
f0ea852d4d QCommandLineParser: Wrap very long option names to leave room for descriptions
Fixes: QTBUG-79926
Change-Id: I3302e0ed5b58949a35ccb001c71b22a6400a6c81
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2020-05-01 10:53:55 +02:00
Nico Vertriest
a426326e99 Doc: Make snippets Qt Widgets compilable
Removed mainwindowsnippet.cpp and widgetdelegate.cpp
from snippets.pro

Task-number: QTBUG-81497
Change-Id: I40d1f34e64d958d2fb857dc8e468b9c40fff527c
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
Reviewed-by: Kai Koehne <kai.koehne@qt.io>
Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
2020-05-01 06:44:07 +02:00
Qt Forward Merge Bot
94fe42a753 Merge "Merge remote-tracking branch 'origin/5.15.0' into 5.15" 2020-04-30 18:04:07 +02:00
Qt Forward Merge Bot
5ed024a5da Merge remote-tracking branch 'origin/5.15.0' into 5.15
Change-Id: I1b46a9485d86f4d8ea104df31366fb6ad16a4654
2020-04-30 18:03:53 +02:00
Mårten Nordheim
90012f12b0 QNAM: Don't check if a session is needed for a cache lookup
QNetworkAccessCacheBackend didn't override the virtual start() function
which then deferred to QNetworkAccessBackend::start() which conditions
its success on whether or not a network session is available.

Override the function and reimplement it without the network session
check.

Fixes: QTBUG-83205
Change-Id: I45d98a6f5da8ad04bb9da551a131f109e83074d7
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
2020-04-30 13:55:03 +02:00
Mårten Nordheim
8e4c32857d QAuthenticator: make sure we load the SSPI library
Change-Id: Iac371065dfc20ad5920889be66c8282a45c5805e
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
2020-04-30 13:45:55 +02:00
Edward Welbourne
c78a960198 QCOMPARE: treat values as equal if qFuzzyIsNull(each)
We hope this shall avoid some flaky failures noticed in quick tests,
e.g. tst_QQuickMenu::Material::subMenuPosition(cascading,flip) was
recently seen failing with 3.88e-11 != 0. This required some revision
to test data in the testlib selftest for floats; the resulting
expected output differs in details but not in which tests pass or
fail. QEMU, naturally, made life difficult, requiring special-case
code in the test-driver.

[ChangeLog][QtTestLib][QCOMPARE] QCOMPARE() now treats its values as
equal when qFuzzyIsNull() is true for both of them.

Change-Id: Icc6ad5164b609937eddbe39cc69120f0abf0f3b4
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
2020-04-30 13:44:08 +02:00
Thiago Macieira
821e71fded QCborValue: check parsing of invalid URL
QUrl will reject invalid URLs for us, so we don't get normalization. The
original junk should be retrievable, of course.

Change-Id: Ibdc95e9af7bd456a94ecfffd160610f5b2c8e1a2
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2020-04-30 08:01:28 -03:00
Thiago Macieira
8366c06d46 QCborValue: add tests of parsing invalid ISO date-time strings
We rely on QDateTime::fromString being proper, so this is not extensive
testing.

Change-Id: Ibdc95e9af7bd456a94ecfffd160610cdac5d62e1
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2020-04-30 04:01:05 -07:00
Thiago Macieira
2a53017df4 QCborValue: add an extra check against producing invalid ISO dates
By QCborValue design, we store the textual representation in ISO format,
equivalent of CBOR tag 0, which isn't allowed to have negative years or
beyond year 10000.

Change-Id: Ibdc95e9af7bd456a94ecfffd16060ccff359c296
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
2020-04-30 04:00:47 -07:00
Thiago Macieira
52a2505672 QCborValue: avoid signed integer oveflows when decoding time_t
QDateTime::fromSecsSinceEpoch() multiplies by 1000 but does not check
for overflow. That means we must do so in QCborValue validation. We
can't use mul_overflow<qint64> on 32-bit platforms, so we do a compare-
and-branch there. For 64-bit platforms, we prefer to do the
multiplication with checked overflow, as the common case is that it will
not overflow and we'll need the multiplication anyway.

Change-Id: Ibdc95e9af7bd456a94ecfffd16060cba6f1c86b8
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2020-04-30 11:00:29 +00:00
Andy Shaw
1eeabc6652 Don't output a warning that can trigger before Qt has fully initialized
If a warning is outputted before Qt has had a chance to initialize the
logging rules then it will cause it to hang as it will be stuck trying
to initialize but can't continue because it needs to output the warning
which triggered during that initialization. Therefore the warning should
not be outputted to avoid this from happening.

Change-Id: I202752c377bf69def2f7fb76be71b78d00ad3fd5
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2020-04-30 10:59:56 +00:00
Tor Arne Vestbø
91d18c6464 iOS: Pick up theme palette from system colors
For now we just fill out the system palette, and react to the system
changing theme from dark to light. A further improvement would be to
fill in the control-specific palettes.

Change-Id: I764db4415f5b55ccb193dae43e9f4386c765b30b
Fixes: QTBUG-42944
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
2020-04-30 12:21:30 +02:00
Shawn Rutledge
f9d219b926 iOS: Teach edit menu popover to have a readonly mode
We should have foreseen the need for customizing this menu in 2014 when
Controls 1 needed it, but here we are: Qt 5 is "done", this still wasn't
done, and it's too late for new enum values in 5.15. So the workaround is
to add a property on the focus object that the iOS plugin can query, and
give us a menu that has Copy instead of Paste.

Task-number: QTBUG-83811
Change-Id: Id8d18260002952fe7aa77aa5608cf7d0e440dacb
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2020-04-30 12:21:30 +02:00
Tor Arne Vestbø
042b118caf macOS: Avoid modifying hash while iterating it
QCocoaTouch sneakily updated the list of active touches in the
destructor, causing problems when we switched from Q_FOREACH
to ranged-for.

Fixes: QTBUG-83876
Change-Id: If7ec9e9116b7eb581580b461ae12ad70c739906d
Reviewed-by: Simon Hausmann <hausmann@gmail.com>
2020-04-30 08:40:49 +02:00
Liang Qi
b8e1321273 Merge "Merge remote-tracking branch 'origin/5.15.0' into 5.15" 2020-04-29 07:57:36 +02:00
Timur Pocheptsov
15026f309b QMacStyle - change the arrow type only for 'OnlyOneTab' option
It appears the hack was not needed when we have several
tabs (popup button works as expected). Otherwise, this button
suddenly has a different size: it's bigger when selected and
smaller if not (and the holes clipped under the tab shape are
becoming quite visible in the dark mode to the left and right
of a tabbar). For the single tab we need some adjustment in
the size not to have visible difference between inactive/selected
tab.

Fixes: QTBUG-83216
Change-Id: I52511e610ae7b36f261e0218b7e432e747bc9491
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2020-04-29 07:13:57 +02:00
Lorn Potter
5e8bd204e2 wasm: fix network download crash
It seems it was defaulting to the indexdb filesystem, but it is not mounted.

Fixes: QTBUG-83827
Change-Id: I1f81d790e5786fe41b59c0f41ca7f6025732c9b2
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
2020-04-29 11:28:05 +10:00
Liang Qi
00edd2a7e7 Merge remote-tracking branch 'origin/5.15.0' into 5.15
Change-Id: I42afd73badf41ac990ff9cf8c6bc650850d2dacf
2020-04-28 23:00:20 +02:00
Paul Wicking
e6a39c13bf Doc: Remove manual duplicate alias descriptions
With the introduction of the \typealias command to QDoc, QDoc generates
a standardized line for aliased types.

This patch removes duplication caused by the change in QDoc.

Change-Id: I1a01c378f85b0decb7c0400a3b21146f0898c6ec
Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
2020-04-28 20:04:54 +02:00
Oliver Wolff
85dab30b15 Fix building of autotests for certain configurations
When a configuration is static and has builtin_testdata defined, it was
possible that the "testdata" resource that is generated in testcase.prf was
used for a qmlimportscan directly. This generated test data resource  is no
file though. It's a "qmake struct" that contains files and a base folder
so that we should add every file from the "file list" of that struct.

It is possible, that the generated resource has a base, but no files. Thus
we need two loops or we can end up with a command line that ends with
"-qmldir". If qmlimportscanner decided to warn/error out in this case in
the future this feature could be broken and the point of breakage might
not be obvious.

Change-Id: I2111f594f7d5cf40521b8fe9236a8be9e2ed1b07
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
2020-04-28 20:04:42 +02:00
Morten Johan Sørvig
562d7ded3b macOS: draw toolbar separator line in unfifed mode
Commit 836a2fb8 changed the contentBorderThickness
property to also include the title bar height, in
order to position sheets correctly when unified toolbar
mode is enabled. As an accidental side effect this made
Qt stop drawing the toolbar separator line.

Account for the added title bar height also in
testContentBorderAreaPosition().

Task-number: QTBUG-78110
Change-Id: I4ecfd010a6784bbb592646affc676d8cbfd9b6da
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2020-04-28 11:32:14 +02:00
Mårten Nordheim
084525a034 QNAM/QNetConMon: emit networkAccessibleChanged on changes
For compatibility with the bearer functionality.

Change-Id: I26ba6bad046b3f99c8ee13e709a26ddcbd868e25
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
2020-04-28 11:28:58 +02:00
Andy Shaw
85c09f3c51 Use QMAKE_TARGET for the name of the object script file
Since TARGET at this point contains the path to where the target will
be then it can include ".." as part of it which will cause problems when
building for Android on Windows. Therefore, QMAKE_TARGET should be used
as an identifier here as the path is not needed.

Change-Id: Idb8babd0459c65cbcfd64fe47baeac4303a3fd87
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
2020-04-28 06:32:59 +00:00
Marc Mutz
bfde4f4a96 torrent example: fix stripping of file extension
Due to QChar being convertible from almost any integral type,
the old code actually called QString::remove(QChar).

Fix by using QString::chop() instead.

Change-Id: I345b018aa137ecff608a130e69ade5d37ef0805c
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
2020-04-27 18:11:13 +00:00
Antti Kokko
f58c8fb453 Add changes file for Qt 5.15.0
Change-Id: I28732113bcfd65e983dff6746f6787a266211c8c
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2020-04-27 20:11:04 +02:00
Shawn Rutledge
c068edcecf Always open a submenu on the same screen where the parent menu is
We've seen submenus opening on different screens in different scenarios,
but probably there's never a sensible reason to do that.
QWidgetPrivate::setScreenForPoint() can often give incorrect results
in multi-screen desktop configurations; this is a way of avoiding that.

Task-number: QTBUG-76162
Change-Id: I895696c6858ad953258c84b21117beea4c4fc01d
Reviewed-by: Andy Shaw <andy.shaw@qt.io>
2020-04-27 16:37:30 +02:00
Allan Sandfeld Jensen
a1f9729b74 Fix 32bit int overflow
Do not continue if the conversion to 32bit int would cause an overflow.

Change-Id: I8a198dce5962e7ebd248b9baa92aba8730bfd3b0
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2020-04-27 15:25:32 +02:00
Allan Sandfeld Jensen
41387bb330 Fix 8bit image conversions with non-default bytes_per_line
Copy line by line when bytes per line doesn't match between input and
output.

Fixes: QTBUG-83777
Change-Id: I44ca75963df6188c1de76196d9c12fd8bb081688
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
2020-04-27 15:24:36 +02:00
Paul Wicking
d433d0e089 Doc: add since for QWheelEvent::position
Fixes: QTBUG-83779
Change-Id: Icd39c6e3b65e17a51d04ea3c0718f2957948aaa4
Reviewed-by: Nico Vertriest <nico.vertriest@qt.io>
2020-04-27 09:37:07 +02:00
Qt Forward Merge Bot
c6d6348fdf Merge remote-tracking branch 'origin/5.14' into 5.15.0
Change-Id: I889c639db2fe24d17d535a2c4f52d72ea32491f8
2020-04-27 09:25:10 +02:00
Tor Arne Vestbø
6fa50601ab Don't warn when loading icons via the image loaders
9d5ae9f26c98 introduced a warning when a matching icon engine was not
found for a given file suffix, under the assumption that all formats
would go through icon engine plugins. Unfortunately QIcon itself falls
back to a direct use of QPixmapIconEngine when no icon engine plugin
is found, which would lead to the warning being emitted for built in
formats such as PNG.

Until this code can be moved properly into QPixmapIconEngine we'll
remove it.

Change-Id: I14d1d33a0f0c29e4b4604ef3b53c05cb8e02f867
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2020-04-26 20:10:08 +02:00
Tor Arne Vestbø
d5f759cf66 iOS: Use storyboard instead of .xib file for launch screen
Apps on the iOS app store are required to use storyboards for their
launch screens from June 30th 2020.

Change-Id: Iae34042294fb167a2c893542c57dfaacaf1e929c
Fixes: QTBUG-83512
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
2020-04-26 20:09:58 +02:00
Andy Shaw
7c7b09dbac Cocoa: If the grabRect is null then add in a null image for the area
If it is null then it has nothing to grab, so a null QImage and QRect
is added to the lists so that there is still a representation in some
form for that display. This additionally ensures that it does take
up space for the display in the final image too.

Fixes: QTBUG-63086
Change-Id: I6e80ecc1170642025f6930e2211017c114e25c16
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2020-04-26 20:09:51 +02:00
Leena Miettinen
37bd3fbccd Doc: Describe updating fonts with substitutes
Fixes: QTBUG-82577
Change-Id: I40662240da69c0d93d0386172c10f375fbb5fefc
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
2020-04-24 07:27:27 +00:00
Eirik Aavitsland
9e83d268d6 Fix data corruption regression in QJsonObject::erase()
The internal removeAt(index) method was implemented as taking cbor
indexes directly, in contrast to the other ...At(index) methods.

Fixes: QTBUG-83695
Change-Id: I16597eb6db1cf71e1585c041caa81bf8f7a75303
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2020-04-23 13:42:01 +02:00
Kai Koehne
1e4801c7ce Fix build with -no-compile-examples
configure -no-compile-examples means that the examples won't be
compiled, but processed by qmake to generate install targets. So we
shouldn't do any substitution (like it is done for CMake targets), or
extra compilers / copies (like it is done for qmltypes).

Also install the qmldir files that some qml examples need.

Fixes: QTBUG-83375
Fixes: QTBUG-83704
Change-Id: I6a9393bd914d98a5d85f4089205510e49a435842
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2020-04-23 12:33:02 +02:00
Kai Koehne
10acfec765 Doc: Fix compilation issue with QVERIFY2 example
Fixes

   error C2124: divide or mod by zero

when compiling the test code (enabled by
713cd83200).

Pick-to: 5.15
Change-Id: I2ae39426fc0012f79714ff3d6484d792cab4bd92
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2020-04-23 12:32:37 +02:00
Edward Welbourne
89dc1a1865 Make t specifier for time-zone only apply to date-time
It previously applied to dates and date-times, but was documented as
applying to times (and date-times then included it by reference).
It's only meaningful for a date-time.

Change-Id: Id9e8e8cb987b03e5ddc77b05c581b9b6944065fc
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2020-04-23 12:11:35 +02:00
Assam Boudjelthia
9802b93cc7 note QFileDialog::setNameFilters() is not supported on Android
Task-number: QTBUG-83089
Change-Id: I134917476548f9756a14975be6b1b20312a8ca40
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
2020-04-23 09:33:46 +00:00
Alexandru Croitor
79381ca10d Merge 5.15 into 5.15.0
Change-Id: Ib5251a8cb59693f076da7f75b86bfb6767bdf958
2020-04-23 11:22:00 +02:00
Marc Mutz
5c1446e3fa QImage: optimize convertWithPalette()
The old code got a QMap serialized as a QString and parsed it to
re-create the same map.

Just copy the map.

Change-Id: Ic71b9fa9d822eab53fe37dfb4d76223cd69ac057
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
2020-04-23 08:38:49 +00:00
Albert Astals Cid
871e2981dd QStringLiteral: Remove const temporary that may prevent optimization
clang-tidy 10 was complaining about
http://clang.llvm.org/extra/clang-tidy/checks/performance-no-automatic-move.html

Change-Id: Iea5276e401a10f3ead8599e135dec1f0fa63a0dc
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2020-04-23 10:30:44 +02:00
Tor Arne Vestbø
0c6b4dd4ad macOS: Don't optimize out aggressive backingstore flushes when single-buffered
Comparing the layer contents to the backingstore surface doesn't make
sense when we're single buffered since we're always using the same
surface.

And once Core Animation has picked up on the surface it's not enough to
just keep drawing to it, we also need to tell Core Animation that the
contents has changed.

Change-Id: I517a0b7a3ba7e9d96033465c9bd5a192985643ac
Fixes: QTBUG-81071
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
2020-04-22 23:46:44 +02:00
Thiago Macieira
c197615bd9 QCborValue: don't update internal states if decoding a string failed
Change-Id: Ibdc95e9af7bd456a94ecfffd16061db982ad3fa7
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2020-04-22 18:04:42 -03:00