Commit Graph

42489 Commits

Author SHA1 Message Date
Friedemann Kleint
2a5f5f6049 QWindowsXPStyle: Factor out repetitive code for MDI/Window title bars
Use static helpers to populate the XPTheme struct.

Task-number: QTBUG-75927
Change-Id: I49201f56fd5a4ef7eeb86c01dfc858022f465792
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
Reviewed-by: André de la Rocha <andre.rocha@qt.io>
2020-02-01 09:39:50 +01:00
Allan Sandfeld Jensen
5ac1516edd Check for (__ARM_FP & 2) to verify 16-bit FP support
It appears __ARM_FP16_FORMAT_IEEE is sometimes incorrectly set, and
we need to double-check that 16-bit floating point is available in the
__ARM_FP macro as well.

Task-number: QTBUG-68314
Fixes: QTBUG-81461
Change-Id: I878d6b286aa31e21271163dc6c8f8038b9534c76
Reviewed-by: BogDan Vatra <bogdan@kdab.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2020-02-01 09:23:17 +01:00
Tor Arne Vestbø
facb8b7491 testlib: Properly cleanup after caught exception
We were only doing half of what qCleanup was doing in the
exception case, and in an inconsistent order. There's no
reason not to just call qCleanup to align the behavior.

Change-Id: Ic4e63afb4733de5b01a79272cca8908fca3de762
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2020-02-01 00:49:23 +01:00
Tor Arne Vestbø
0dc31e667f testlib: Simplify macOS setup/teardown code
Change-Id: If92845ccb044becee136c7791fdb3cfe3641b28d
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2020-02-01 00:49:19 +01:00
Tor Arne Vestbø
5940d20c69 testlib: Fix indentation
Change-Id: I54bb2c3dda731e1fd6c7e909aa30a3cedb53612b
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2020-02-01 00:49:15 +01:00
Tor Arne Vestbø
828e14b5f9 Fix unused argument warning in test
Change-Id: I9f55efee82f8d855d89977b3e4db32855e110c87
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2020-02-01 00:49:11 +01:00
Tor Arne Vestbø
ac0a266e75 testlib: Don't disable watchdog when the macOS crash reporter is enabled
The debuggerPresent() function was used both to decide whether we should
print our own stacktrace, and if we should start the watchdog timer, but
checking for the macOS crash reporter only applies to the former usecase.

The crash reporter check has now been split into a separate function, only
used to decide whether we should print our own stacktrace or not.

Change-Id: I282aa57a51c14b07d3cbd547b551b6bf81b61897
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2020-02-01 00:49:07 +01:00
Sze Howe Koh
e6f479a830 tst_QDataStream::readQCursor(): Replace deprecated QCursor API
Task-number: QTBUG-48701
Change-Id: I4205d278b1cd6b088f8f58020f6a5e49a7f1ca33
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
2020-02-01 07:31:02 +08:00
James McDonnell
aec3c6a9cb Add EglDisplay resource to the QNX platform plugin
QtWayland requires this resource.

Change-Id: I41f83d93582bfe7c471208e8ca844e24dc2c6da5
Reviewed-by: Dan Cape <dcape@qnx.com>
Reviewed-by: Johan Helsing <johan.helsing@qt.io>
2020-01-31 18:31:01 -05:00
Sze Howe Koh
b90eaa3bb5 Examples: Replace deprecated QLabel API
Task-number: QTBUG-48701
Change-Id: I6fc875a35dfc3bf4d906d0f0e495c18ef566d1e1
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
2020-02-01 07:31:01 +08:00
Allan Sandfeld Jensen
967e55a628 Allow creating a valid QColorSpace one value at a time
The change to using setters left a quirk from the previous un-mutable
design where you couldn't set values on an invalid color space and
create a valid one.

This changes that so it works as expected for an imperative API, but
is also needed for the declarative QML bindings.

Change-Id: I246cfc38b364b156238151c42c1df82a3f1cc9d3
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
2020-02-01 00:31:01 +01:00
Allan Sandfeld Jensen
c76dd72dc6 Add a constructor for QRunnable from anonymous functions
This makes it easier to create one without having to create
a derivative class. The patch also adds a path to avoid using
QRunnable directly in QThreadPool.

Change-Id: I9caa7dabb6f641b547d4771c863aa6ab7f01b704
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Sona Kurazyan <sona.kurazyan@qt.io>
2020-01-31 19:20:43 +01:00
Edward Welbourne
6c4e0f2d2d Deprecate QLocale::toTime() variants taking a calendar
The calendar is ignored, so adding these methods was a mistake.

[ChangeLog][QtCore][QLocale] Deprecated toTime() variants taking a
calendar. The calendar is ignored in time parsing.

Change-Id: I79fa994ce88f13fdb931163b447eb1a9ad655c09
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2020-01-31 19:20:43 +01:00
Edward Welbourne
d6ba2ae441 Consolidate some Q(Date|Time)+ methods to call calendared versions
The string-returning methods were in any case delegating to either a
local static or QLocale methods that delegate to their calendar
variants, so do the default-calendar step early and reduce the number
of distinct code-paths, along with the gross number of lines of code.

In the process, short-cut past QDate::toString() when we can save its
switch and go direct to the toString{Text|Iso}Date() it's calling.
Tidy up somewhat in the process.

Change-Id: I8ba70b29ef9e8b6553c41310ebb2b63ec5570bb9
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2020-01-31 19:20:43 +01:00
Edward Welbourne
d6d98f782a Deprecate locale-related DateFormat enum members
Qt 6 shall remove all locale-dependence from Q(Date|Time)+.

Task-number: QTBUG-80441
Change-Id: Iebaaa2bd776bccfe0d73c15f36cbdd456b71ca59
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2020-01-31 19:20:43 +01:00
Edward Welbourne
05ce1821cd Add missing calendar methods to QDateTime and docs
We missed a few, so complete the general scheme of accepting an
optional calendar, where it would be relevant.

[ChangeLog][QtCore][QDateTime] Added some missing QCalendar variants
of QDateTime::toString(). Included docs for QCalendar variants in both
QDate and QDateTime.

Change-Id: Ief7b4dada73d7a4055b75d8b47ff4d2e310ce738
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2020-01-31 19:20:43 +01:00
Edward Welbourne
2b1068af97 Pass QDate and QTime by value in various static and local functions
They're value types, so pass them as such.

Change-Id: I0dc46c63a3a0e6d859b821362f71390f0148b64c
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2020-01-31 14:02:53 +01:00
Edward Welbourne
90fbd086c6 Pass QDate and QTime by value in manual calendar test code
They're value types, pass them as such.

Change-Id: I78e93165d431ac4eff145f47a9385d6bf5cd0c15
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
2020-01-31 14:02:53 +01:00
Johan Klokkhammer Helsing
d8df846631 glgen: Fix compile error
Fixes compile error introduced in ff2b2032a0.

Change-Id: Iee1016f7cf05638db575475c5c0d632f8edb3a8c
Reviewed-by: Sona Kurazyan <sona.kurazyan@qt.io>
2020-01-31 14:02:53 +01:00
Alexandra Cherdantseva
f998e630e7 wasm: fix QWasmString::toQString assertion for emscripten 1.39.4
In emscripten 1.39.4 `maxBytesToWrite` argument is
required for function `stringToUTF16(str, outPtr, maxBytesToWrite)`

Fixes: QTBUG-81728
Change-Id: I634134a30454ae09a9a05593428397b40464b31f
Reviewed-by: jian liang <jianliang79@gmail.com>
Reviewed-by: Lorn Potter <lorn.potter@gmail.com>
2020-01-31 13:02:53 +00:00
Mike Achtelik
287b570ad5 Handle exceptions when accessing android clipboard
In some circumstances android throws an exception or returns null,
when trying to access the clipboard.

Fixes: QTBUG-80689
Change-Id: I92c134e2a002fc648ff966e15a19eb3307c428a1
Reviewed-by: BogDan Vatra <bogdan@kdab.com>
2020-01-31 14:02:53 +01:00
Edward Welbourne
b4b3b5c694 Clarify handling of unspecified year in two QCalendar methods
[ChangeLog][QtCore] QCalendar::monthsInYear(QCalendar::Unspecified)
now returns maximumMonthsInYear(). QCalendar::daysInYear() now makes
clear that its handling of unspecified year is undefined.

Change-Id: Ifef8723193868c666f6afeb7f190af4929d30dea
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2020-01-31 12:26:34 +01:00
Christian Ehrlicher
b4db334c03 Doc/Printsupport: misc fixes
- use new signal/slot syntax
- fix includes
- adjust style

Change-Id: Icdc9b33e72e24c39cc6e96b4f2cafa78e179efbf
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
2020-01-31 06:23:59 +01:00
Christian Ehrlicher
c7f59cad19 Examples: fix compile without printsupport
Checking for QT_CONFIG(printdialog) is not enough when printsupport is
completely disabled since then the macro will throw an error. Therefore
add an additional check 'defined(QT_PRINTSUPPORT_LIB)' before using the
QT_CONFIG macro.

Fixes: QTBUG-81626
Change-Id: Ie9898f057cdd6bf9daf4ba9135987cb6e901e7bf
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
2020-01-31 06:23:58 +01:00
Thiago Macieira
9ede07613d QLockFile: Disable flock() on QNX
It appears it's not implemented.

[ChangeLog][QtCore][QLockFile] Suppressed the warning on QNX that said
'setNativeLocks failed: "Function not implemented"'. There is no
difference in behavior: Qt will continue not to be able to apply an OS-
level file lock, which means the lock could be accidentally stolen by
buggy software. Correct software using QLockFile should not be affected.

Fixes: QTBUG-81701
Change-Id: If79a52e476594446baccfffd15ee35bbac6c6e47
Reviewed-by: David Faure <david.faure@kdab.com>
2020-01-30 20:47:55 -08:00
Laszlo Agocs
a5be18cc7d rhi: Enable sampler address mode W in the API
Internally this is already supported by all backends. The frontend was just
not exposing addressW, instead defaulting to the (arbitrarily chosen) ClampToEdge.

Add the parameter to newSampler(), but make it optional, defaulting to the more
natural Repeat (because that's what one would get with OpenGL for WRAP_R by default)

Change-Id: I0b991d8b649db37d4da86ac8e98ab7845601cf67
Reviewed-by: Christian Strømme <christian.stromme@qt.io>
2020-01-30 19:56:21 +01:00
Edward Welbourne
037369cc4d Deprecate QDateTime(const QDate &) in favor of QDate::startOfDay()
It needed re-implemented in terms of the new API (in case QTime(0, 0)
was skipped, on the date in question, by a spring-forwrd), which makes
it redundant (and supports choice of spec and zone or offset, which it
did not).

Change-Id: I1e3c3e794632c234f254be754ed6e4ebdaaaa6bc
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2020-01-30 19:56:21 +01:00
Mårten Nordheim
6a1df2d206 QNetworkProxy/doc: Remove mention of network configuration
The support for QNetworkConfiguration was deprecated in 5.10 but the
documentation was still alluding to the functionality.

Change-Id: I7597388c646196fb4744d7bac4f890ca582c5b75
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
2020-01-30 19:56:21 +01:00
Edward Welbourne
3041393d2e Fix flawed logic in QSystemLocalePrivate::getLocaleInfo()
If the first call to GetLocaleInfo() returned non-zero, then
GetLastError()'s return has nothing to do with GetLocaleInfo(), since
it didn't fail. The check for ERROR_INSUFFICIENT_BUFFER as last error
needs to happen in the branch where GetLocaleInfo() failed, returning
zero.

Change-Id: Idb6eaad1515a003133c787998aff0c265ef98251
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
2020-01-30 18:17:07 +01:00
Joerg Bornemann
495db2cd2b Add function for initializing plugin resources for static builds
Also move the setting of default RCC_DIR into qtFlattenResources as we
need a valid RCC_DIR there.

Fixes: QTBUG-81699
Fixes: QTBUG-81713
Change-Id: I7558d99f3aca75d2e9cad0ec89fbb0aa0758dcc7
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2020-01-30 16:59:31 +01:00
Allan Sandfeld Jensen
caef33ae2d Fix NEON support on Android armeabi-v7a
Task-number: QTBUG-81461
Change-Id: Ic3e8367aee990291fc676204b9299530953fc87a
Reviewed-by: BogDan Vatra <bogdan@kdab.com>
2020-01-30 16:07:13 +01:00
Joni Poikelin
128db60f4c Doc: Update out dated QImage::constScanLine documentation
Change-Id: I0c09a9a6168422c7e41ded289a3e5ba39b84b0ee
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
2020-01-30 16:10:56 +02:00
Morten Johan Sørvig
17affdfbcb Blacklist failing tests on macOS 10.14
These tests fail locally, and have been reported to
fail on the CI system.

Change-Id: Ia76bb15c288af4171ebe47b3c30f3651a63df3f2
Task-number: QTBUG-75786
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2020-01-30 13:47:27 +00:00
Friedemann Kleint
d7a5d6a98d Windows style: Fix wrong color of non-editable combo box
Use QPalette::Button instead of Base as does QFusionStyle
so that style sheets specifying colors for the non-editable
case work correctly.

Fixes: QTBUG-81573
Change-Id: I84cecb38a48a1450c82498558aa350f3e60a5df6
Reviewed-by: André de la Rocha <andre.rocha@qt.io>
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
2020-01-30 13:51:17 +01:00
Edward Welbourne
2130d282b1 Change examples and snippets to pass QDate and QTime by value
They're value types, so we should show them being used as such.

Change-Id: If9f0c366fac66306b7861f04e2f047540d444acc
Reviewed-by: Christian Ehrlicher <ch.ehrlicher@gmx.de>
2020-01-30 13:32:57 +01:00
Edward Welbourne
45967dfbd8 Simplify textdate/datestring #if-ery
Since datestring implies textdate, we don't need to check the latter
inside the #if-ery of the former.

Change-Id: I01e648245bc7707db024eac925092ed816173781
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2020-01-30 13:32:30 +01:00
Edward Welbourne
6bac3552ac Convert two QDateTime::toString() usages to QLocale::toString()
Qt::LocalDate has been deprecated for ages as an alias for
Qt::SystemLocaleDate, which we intend to remove at Qt 6; and all use
of them can (and should) be converted to use QLocale::toString().
So do that.

Task-number: QTBUG-80441
Change-Id: I0a40fa287cb347c704ec3673d17ef18381063f7f
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2020-01-30 13:31:59 +01:00
Paul Wicking
ee41a5941b Doc: Add see also link to QScreen::handle()
As the method returns a pointer to a private type (QPA), add see
also with link to QPA docs.

Fixes: QTBUG-76978
Change-Id: If59670ca0a9a47b42b6441baa23525eb20f92979
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2020-01-30 13:00:48 +01:00
Joerg Bornemann
1f8ced2d6d Fix line ending in custom build steps of vcxproj files
We must use Windows line endings in .vcxproj files to separate command
lines of custom build steps.

This amends commit f65cfadd.

Fixes: QTBUG-81553
Change-Id: I8d257f3846af7006df7f8d462b8f44efdce6a1fd
Reviewed-by: Miguel Costa <miguel.costa@qt.io>
2020-01-30 11:56:09 +00:00
Joerg Bornemann
5399f9443e Fix qt5_make_output_file macro for file base names with dots
The qt5_make_output_file macro returns the wrong outfile for infiles
containing multiple dots in the file name, e.g. 'foo.bar.h'. To fix
this we need to use get_filename_component(... NAME_WLE) which is
available since CMake 3.14. Re-implement the NAME_WLE functionality
for older CMake versions by using multiple get_filename_component
calls.

Fixes: QTBUG-80295
Change-Id: Ib8e11a69a41ba7f6739eb3d5541ce8f6f59dc18c
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2020-01-30 12:55:59 +01:00
Friedemann Kleint
9b0525729b Add missing \since for QTextEdit::markdown
The property was introduced by
23c2da3cc2.

Task-number: PYSIDE-1208
Change-Id: I2b9c5f116ffb154458de88d0efa0ac81f625121b
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
2020-01-30 12:11:54 +01:00
Allan Sandfeld Jensen
49b158e07d Don't use libpng allocated buffer to store ICC profile data
The data becomes invalid by the next PNG read or write.

Fixes: QTBUG-81671
Change-Id: I738f5c2abbeebf2c9080d64fef7e66cc082afe89
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
2020-01-30 11:45:33 +01:00
Paul Wicking
f24b247961 Doc: Add since version to enum value documentation
Fixes: QTBUG-80980
Change-Id: I707c4f45d45cb088fb7419038a448d29a2e8dbf5
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
2020-01-30 11:42:57 +01:00
Topi Reinio
5d82cbcfc3 Doc: Specify install path for Vulkan examples
Vulkan examples, although part of the Qt GUI documentation project,
live under their own directory under /examples. Mark the correct
install path for these using the \meta command.

Fixes: QTBUG-81360
Change-Id: I0b98a19bf56d5b1953dbd90c0d5103be9041689a
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
2020-01-30 10:42:57 +00:00
Allan Sandfeld Jensen
2e7a28958d Deprecate QImageIOHandler gamma correction
Don't do gamma correction at image decoding time, it can be a whole
lot more than just a simple gamma function, so it is better to use
QColorSpace and QColorTransform.

Change-Id: Iebc960bad6ecdd878240be965699d2df869572ad
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
2020-01-30 11:23:50 +01:00
Mårten Nordheim
22d0e91970 QHash: Re-remove Java-style iterator
When deprecating reverse iteratation for QHash the macro defining
QHashIterator was expanded but QT_NO_JAVA_STYLE_ITERATORS was
unfortunately forgotten. This patch brings it back.

Amends dbb54805f6

Change-Id: I7b1912a13f6f8d2446c1f61a1c4a19afb2f28993
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2020-01-30 07:11:40 +01:00
Kari Oikarinen
4f077b7e5f QScopeGuard: Make constructor public
With Class Template Argument Deduction users might want to use the constructor
itself instead of a separate helper function. In both cases it's possible to let
the compiler deduce the template arguments.

Try to make the usefulness of the helper function in the absence of CTAD still
clear in the documentation.

Change-Id: I9b07983c1fb276a6dd9e7ed4c3e606764e9b68ca
Reviewed-by: Ville Voutilainen <ville.voutilainen@qt.io>
2020-01-30 07:30:17 +02:00
Volker Hilsheimer
601ce9e08a Implement moving of a single file system entry to the trash
This implements the operation for Windows, macOS, and Unix, for now
only as a private API (since QFileSystemEngine is private). This adds
the capability as a testable function; public API to be agreed on and
added in a separate commit.

The Unix implementation follows the freedesktop.org specification [1]
version 1.0.

[1] https://specifications.freedesktop.org/trash-spec/trashspec-1.0.html

On macOS and Windows, native APIs are used, with each having some
limitations:

* on macOS, the file in the trash won't have a "put back" option,
  as we don't use Finder automation, for the reasons provided in the
  comments
* on Windows, we might not be able to use the modern IFileOperation
  API, e.g. if Qt is built with mingw which doesn't seem to provide
  the interface definition; the fallback doesn't provide access to
  the file name in the trash

The test case creates files and directories, and moves them to the
trash. As part of the cleanup routine, it deletes all file system
entries created. If run on Windows without IFileOperations support,
this will add a file in the trash for each test run, filling up
hard drive space.

Task-number: QTBUG-47703
Change-Id: I5f5f4e578be2f45d7da84f70a03acbe1a12a1231
Reviewed-by: Vitaly Fanaskov <vitaly.fanaskov@qt.io>
2020-01-30 06:14:56 +01:00
Mårten Nordheim
7321a2c624 QNetworkAccessManager: deprecate bearer related functions
In Qt6 QNAM will no longer use bearer in any way so we deprecate it now.

Also mark bearermanagement-conditioned sections for removal in Qt6,
the _q_networksession property is part of how QNAM passes the
QNetworkSession around.

Task-number: QTBUG-81609
Change-Id: I04aad9dd96482c6822dffba1b9af7aa58961149c
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
2020-01-30 05:29:35 +01:00
Lorn Potter
4df303ece7 wasm: fix c++17 detection on windows
Our copy function for qtloader.js does not handle quoting when a
directory has '+' in the path, and this makes the copy method fail.

This is fixed the same way the cxx_future test works

Fixes: QTBUG-79552
Change-Id: Iad8331800aa73eea948e7d2650568645a4c0640c
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
2020-01-30 13:59:23 +10:00