Commit Graph

42377 Commits

Author SHA1 Message Date
Timur Pocheptsov
0de6c26ac1 QLocalSocket - deprecate ambiguous 'error' overloads
QLocalSocket::error is overloaded as a signal and an accessor (for the
error reported by the signal). This means connecting to the signal using
a pointer to member function would require ambiguity resolution. We
deprecate the old accessor (to be removed in Qt 6) and introduce a new one -
'socketError'.

[ChangeLog][Deprecation Notice] QLocalSocket::error() (the getter) is deprecated; superseded by socketError().

Task-number: QTBUG-80369
Change-Id: Iab346f7b4cd1024dee9e5ef71b4b7e09f6d95b12
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2020-01-10 12:54:53 +01:00
Timur Pocheptsov
94b3dd77f2 QAbstractSocket: deprecate 'error' member-function
The one that is a getter for the last error found. This is to disambiguate
the expression '&QAbstractSocket::error'. Introduce a new member-function
socketError as a replacement.

[ChangeLog][Deprecation Notice] QAbstractSocket::error() (the getter) is deprecated; superseded by socketError().

Task-number: QTBUG-80369
Change-Id: Ia2e3d108657aaa7929ab0810babe2ede309740ba
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2020-01-10 12:54:53 +01:00
Friedemann Kleint
c4a9429be7 Fix developer build with clang-cl failing due exception spec
Clang does seem to understand  __declspec(nothrow) as
used by the COM macros like STDMETHOD. Suppress the warning,
fixing errors like:

qwindowsfontenginedirectwrite.cpp(105,24): error: 'AddBeziers' is missing exception specification '__attribute__((nothrow))' [-Werror,-Wmicrosoft-exception-spec]

Task-number: QTBUG-63512
Change-Id: If582cb0c12c62a7d12c4ae702747aac1f735db3c
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
2020-01-10 08:26:57 +01:00
Christian Ehrlicher
efff8ff57a QFileSystemWatcher/win: watch also for attribute changes of directories
The windows filesystemwatcher did not watch for attribute changes for
directories (e.g. hidden flag) so it was not in sync with other
backends. Fix it by adding FILE_NOTIFY_CHANGE_ATTRIBUTES to the watch
flags when watching a directory.

[ChangeLog][QtCore][QFileSystemWatcher] Fixed a bug that caused QFSW not
to watch for attribute changes on Windows. Now it will correctly report
when files and directories become hidden or unhidden, for example.

Fixes: QTBUG-80545
Change-Id: I31767a0da899963e3940b4f5b36d1d581e6aa57c
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
2020-01-10 06:24:14 +01:00
Nodir Temirkhodjaev
9a112bebe5 QWindowsVistaStyle: Fix build with no dockwidget & commandlinkbutton features
Change-Id: I0f7465cbe80e305680df37b2bf5e2f50874e6fe3
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
2020-01-10 10:03:28 +05:00
Allan Sandfeld Jensen
f1e5c5575c Remove use of QImage::alphaChannel()
A direct logical replacement. Not sure what is going on though or why
an inversion is necessary, but logic is unchanged.

Change-Id: Id9b5531895371f6467018fa82336aff6238ae126
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
2020-01-10 00:29:08 +01:00
Thiago Macieira
97645478de QProcess: use FFD_USE_FORK when the class is not QProcess itself
If the user derived from QProcess, it's likely to override the
setupChildProcess() virtual. Unlike fork(), the system calls for
enhenced functionality (FreeBSD pdfork() and Linux's clone()) won't call
pthread_atfork() callbacks and the environment in the child process
could be inconsistent. Qt's own code is safe, but we can't make the same
statement about users' code.

So we err on the safe side for correctness and run the old, less safe
implementation (thread-unsafe, subject to hijacking of the signal
handler, etc.).

Change-Id: Ia2aa807ffa8a4c798425fffd15d9703bd03f6f09
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2020-01-09 22:52:28 +01:00
Thiago Macieira
702e49eeb5 forkfd: add FFD_USE_FORK to force use of fork()
Change-Id: Ia2aa807ffa8a4c798425fffd15d933e47919247a
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@gmx.de>
2020-01-09 22:52:25 +01:00
Thiago Macieira
079fbebb6a forkfd/Linux: remove unused code
The detection code for Linux 5.2 and 5.3 went unused. We had it in the
initial commit so it got recorded for posterity, in case someone wants
to detect them (the road not taken).

Change-Id: Ib5d667bf77a740c28d2efffd15cccdff5aa5a622
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@gmx.de>
2020-01-09 22:52:23 +01:00
Thiago Macieira
22f0905b4a forkfd: Implement forkfd in terms of Linux 5.2's CLONE_PIDFD
Linux 5.2 added the CLONE_PIDFD flag to the clone(2) system call. Linux
5.3 also added the clone3(2) system call, which allows both CLONE_PIDFD
and CLONE_PARENT_SETTID, which we could use but don't really need.

Unfortunately, 5.2 missed one crucial and one convenient change. Without
the P_PIDFD support in waitid(2), we would need to either remember the
PID of the child process or obtain it from /proc. But without support
for polling on pidfds, we can't find out when the child process
exited. Support for the latter was added in 5.3, which would be
sufficient for us, but it's not easy to detect it at runtime. The
support is also being backported to Android's 4.9 kernel[1], so we can't
do version checks, only functionality.

This commit relies on waitid(2) support, which was the last to be added
and is fortunately the easiest to detect. If it's present, we assume the
whole series is present and use pidfds.

[1] https://android-review.googlesource.com/q/topic:%22pidfd+polling+support+4.9+backport%22

See-Also: https://lkml.org/lkml/2015/3/12/1044 (original idea)
See-Also: https://lkml.org/lkml/2019/4/19/441 (CLONE_PIDFD)
See-Also: https://lkml.org/lkml/2019/4/25/884 (poll(2) support)
See-Also: https://lkml.org/lkml/2019/7/27/334 (P_PIDFD)
Change-Id: Ia0aac2f09e9245339951ffff13c94b3aa13d8b63
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2020-01-09 13:52:20 -08:00
Laszlo Agocs
e8199a5c4d rhi: Add R16F and R32F
Can be relevant for Qt Quick 3D shadows, where the shadow map is R16F.

Task-number: QTBUG-81268
Change-Id: Ic33e100929e133d1cbe0b062a15697c82536f62a
Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
2020-01-09 20:57:19 +01:00
Laszlo Agocs
e4d0187edc rhi: metal: Fix incorrect native res. binding map check
Checking for nullptr is insufficient: just because there
is an empty map present, it does not mean it is valid. The
two cases must be handled identically.

This fixes a regression when using QShaders that do not
have an associated native resource binding map.

Amends 4639660ded

Change-Id: Icb239bf9a9261ed32f2cb7b22c60b608195618fc
Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
2020-01-09 20:57:08 +01:00
Laszlo Agocs
2671fb2777 rhi: Remove ugly fallthroughs
The coding style does not actually require this.

Change-Id: I2be7cd29c4dabfed2822cd7fb63e597c071e5e15
Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
2020-01-09 20:57:07 +01:00
Laszlo Agocs
0a78e5f117 xcb: Fix nullptr vs. VK_NULL_HANDLE error
Fallout from a recent 0 - nullptr fixup in 5.15.

Change-Id: I17adf742d4f65dc6a468fbe72d0f02d3efa276d7
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2020-01-09 20:57:05 +01:00
Liang Qi
a59c768489 Merge remote-tracking branch 'origin/5.14' into 5.15
Conflicts:
	src/corelib/kernel/qobject.cpp

Change-Id: I4780b25665672692b086ee92092e506c814642f2
2020-01-09 20:30:39 +01:00
Andy Shaw
1c75f59588 iOS: Handle positionFromPosition out of bounds
Based on the documentation for positionFromPosition, if the resulting
position is less than 0 or longer than the text, then we should return
nil. This fixes problems with placement of the cursor and selection
rectangle when auto-completion is used.

Fixes: QTBUG-79445
Change-Id: I44a18881527a8a22012fe5fcbbc3216e60c48bc9
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2020-01-09 15:28:43 +01:00
Morten Johan Sørvig
5507d0f1b0 Make setReadOnly track ReadOnlyChange events only
The test was previously tracking all Change events,
which made it fragile.

Change-Id: I17872341237009a9a0a2ad2fd5482f917991d7b2
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2020-01-09 13:52:25 +01:00
Sona Kurazyan
89c4bb5f24 Deprecate QJsonDocument methods for converting to/from JSON binary
Also remove the example code for deprecated methods and use CBOR instead
where it makes sense.

Task-number: QTBUG-81068
Change-Id: Iffb7a4b3d7b16a1e485fc05b3ab2e2468e9e0718
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
2020-01-09 13:52:25 +01:00
Friedemann Kleint
bfbf8ca453 Silence deprecation warning about QImage::alphaChannel() in qpixmap.h
Amends aa542be4e0.

Change-Id: Id1a256a101cc16fa36d1254d3523cf0732c24045
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
2020-01-09 13:52:25 +01:00
Friedemann Kleint
7b0f341872 Add a widget gallery example
Since 072ca960f5 changed the default
of the styles example back to Norwegian Wood, it is no longer
suited as gallery example.

Extract the dialog from it and re-add it as a gallery example Add a
tooltip displaying the class name and a help shortcut opening the
documentation.

Restructure the group boxes to add more widgets.

Remove the gallery meta-tag from the styles example.

Task-number: PYSIDE-1112
Change-Id: Ie6f13084012771bd8f5bf9cad23b58d0720fdd92
Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
2020-01-09 13:52:25 +01:00
Jani Heikkinen
1e42c97cf0 Bump copyright year
Change-Id: I9468ef21a2cf03cf07c38f012a2aa9bae6d02a03
Reviewed-by: Johanna Äijälä <johanna.aijala@qt.io>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
2020-01-09 14:41:53 +02:00
Joerg Bornemann
8bfdb25c1f Doc: Extend the documentation about qmake scopes
Fixes: QTBUG-18025
Change-Id: I2b587266cde2002d965dc824a869be255cf3522e
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
2020-01-09 11:27:10 +01:00
Edward Welbourne
11c5c078c7 Eliminate QLocale's default_number_options global static
It had create()'s default number options when passed to create, so
wasn't useful then; and otherwise shadowed the value held by the
cached private for the default locale. Noticed in the course of adding
an analogous global for the system locale.

Drive-by - eliminated a redundant language != C check.

Change-Id: I5601dc09188804c11dede5be460bfdd12b8152ce
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2020-01-09 11:15:50 +01:00
Edward Welbourne
0f80452b92 Improve QLocale method documentation
Add missing \sa lines, clarify what the exponential character is and
mention that C is an exception to the "no number options set".

Change-Id: I13ca483a07738908640408e0ca512de31586cec9
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2020-01-09 11:15:07 +01:00
Edward Welbourne
f91af791cc Add advance warning of change of return types coming in Qt6
The QLocale methods that report the fragments used in making up
numbers all return QChar. A note dating from before Qt5 times warned
that we need to change these to return QString (since we might need a
surrogate pair to represent the relevant characters). Give advance
warning in the documentation that this shall happen at Qt 6.

[ChangeLog][QtCore][QLocale] decimalPoint(), groupSeparator(),
percent(), zeroDigit(), negativeSign(), positiveSign() and
exponential() still return QChar but shall be changed to return
QString in Qt 6. Callers are encouraged to switch to QString early,
exploiting the QString(QChar) constructor.

Task-number: QTBUG-81053
Change-Id: Ia802c7665676ecf13669c6a6f173f2e70eac578e
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
2020-01-09 11:13:59 +01:00
Pasi Petäjäjärvi
6224130cc8 Add touch input device mapping support via QT_QPA_EGLFS_KMS_CONFIG
To be feature parity with evdev touch which already supports this

Change-Id: Ie7f9c868ea888725b24c3855106e1c0c0ba943a9
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
2020-01-09 12:06:33 +02:00
Edward Welbourne
70d484b5df Fix encoding expected by tst_qmessagehandler::qMessagePattern()
The actual logging code, qt_message_print(), uses toLocal8Bit(), so
testing by comaring with toUtf8() isn't robust.

Change-Id: I7d6614e4af8c679674dbbf4ff47a88b2b75fc2dc
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2020-01-09 10:58:25 +01:00
Edward Welbourne
bcc8cf5e3b Fix encoding inconsistency between tst_QNoDebug and QTestLog
Fix tst_QNoDebug::streaming() to use toLocal8Bit(), to match
QTestLog::ignoreMessage(), which uses fromLocal8Bit().

Change-Id: I65f7b995a582aeab7b7ba61781a229fecd1ed3c3
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: David Faure <david.faure@kdab.com>
2020-01-09 10:57:49 +01:00
Edward Welbourne
6f1ae59ee6 Change getMacLocaleName() to return a QString
Returning a QByteArray required doing a toUtf8() to a QString on one
of its paths, which was promptly undone by its caller using
fromUTf8(), since a QString was needed anyway.

Drive-by - remove spurious default for parameter in method definition.

Change-Id: I45f553d74cd0ba9dab25c439ba8291c00b7ceb5b
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2020-01-09 10:55:54 +01:00
Samuli Piippo
2385ab73be QInputDeviceManager: initialize device counts
The device counts were used before they were initialized, causing
problems e.g. with mouse cursor.

Fixes: QTBUG-81207
Change-Id: Ic9dadcaebeb4c4a64bb506e4236d5a9260e0fdbc
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
2020-01-09 10:45:48 +02:00
Lars Schmertmann
34e467b481 Remove dead code to fix a lint warning
Obsolete SDK_INT Version Check
------------------------------
This check flags version checks that are not necessary,
because the minSdkVersion (or surrounding known API level)
is already at least as high as the version checked for.

The mindSdkVersion in templates/AndroidManifest.xml is 21 for Qt 5.14
and androiddeployqt also ensures that the minSdkVersion is not below 21.

Change-Id: I452de5b152f572efc69e6b292a8b15dbbfba639b
Reviewed-by: BogDan Vatra <bogdan@kdab.com>
(cherry picked from commit b8e404f6d0631e04d30a864dc68b0574bfca90f1)
2020-01-09 08:04:41 +01:00
BogDan Vatra
3b54009b13 AAB files can be signed only with jarsigner tool
Fixes: QTBUG-80406
Change-Id: I04b99477c744e7dd729a791c81194b90c4ec658a
Reviewed-by: Andy Shaw <andy.shaw@qt.io>
2020-01-09 08:26:50 +02:00
BogDan Vatra
ce04fa345d Android: make sure we don't add _$${QT_ARCH} twice
Fixes: QTBUG-80582
Change-Id: I2b3790bb18754e146db611d61c48a3b7a532575c
Reviewed-by: Andy Shaw <andy.shaw@qt.io>
2020-01-09 08:25:42 +02:00
Andre Hartmann
1edf8bc465 QObject: Replace more 0 and NULL with nullptr
... in docs, comments, and warnings. Also adopt
some occurrences around there and in the snippets.

Change-Id: Icc0aa0868cadd8ec2270dda794bf83cd7ab84160
Reviewed-by: Christian Ehrlicher <ch.ehrlicher@gmx.de>
2020-01-09 02:33:08 +01:00
Tor Arne Vestbø
7b092b3fe3 Remove clearWidgetPaletteHash argument from setPalette_helper
The argument is only used when the application palette is set,
(as opposed to setting the palette for a specific widget class),
and that code path is only triggered from QApplication::setPalette,
which passes 'true' for this argument.

Change-Id: I67a1cc3741f6f62653b0f95ff88d28228f9977d4
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
2020-01-09 02:33:08 +01:00
Tor Arne Vestbø
2a02487ff0 Move tracking of widget specific app palettes to QApplicationPrivate
Change-Id: I43cc25207026f174e46534baedf08e0c300728d1
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
2020-01-09 02:33:08 +01:00
Tor Arne Vestbø
0c37bc11b5 Share updates to QGuiApplicationPrivate::app_pal via helper function
Change-Id: I2f582358efaadcd33b39c52317222322c589423f
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2020-01-09 02:33:08 +01:00
Inho Lee
445c1a873f Resolve a build error for ICC 19
This argument name makes an error with "line 302:Type t = Undefined;"

Change-Id: I5488ff02ab7c9f9391c17361da5e2aac2727a6a0
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2020-01-09 01:33:08 +00:00
Thiago Macieira
64359ad710 ucstrncmp: Fix UBSan report of array overflowing
The expression "a + offset + N" will eventually calculate an address
past the end of a, since we are comparing to end. That's undefined
behavior. Instead, calculate end - a and compare that to offset + N.

This commit subtracts "a" from both sides of the inequalities and swaps
the two sides to make them obey Qt coding style. Testing with GCC 9
(which is the only one I care about) shows the compiler generates the
same code.

Fixes: QTBUG-81218
Change-Id: Id84da383373844f3a4b0fffd15e7c1ab904daccd
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
2020-01-09 01:33:08 +00:00
Giuseppe D'Angelo
c61cedcc54 GCC: revoke constexpr before 5.0
It's causing build failures on GCC 4.9 due to our code hitting

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=57694

(at least since de82d239f8).

Task-number: QTBUG-80997
Change-Id: I80a9d1fcbf26d8c0bf514ddc7bdb86eb7173360f
Reviewed-by: Ville Voutilainen <ville.voutilainen@qt.io>
2020-01-09 02:33:08 +01:00
Nico Vertriest
22942058aa Doc: Correct qdoc compilation errors qtbase
Task-number: QTBUG-79824
Change-Id: I4be365d92b1adfde09efd04d088f75c506666a95
Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
2020-01-09 02:33:08 +01:00
Jean-Michaël Celerier
c77efa6d38 Disable support for RasterOpModes in GL paint engine
This leads to crashes for instance when displaying a text cursor
in a graphics scene.

Change-Id: I1b5c884ddb8325a7f5bdbc6027f0fae13f139a1c
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
2020-01-09 02:33:08 +01:00
Qt Forward Merge Bot
06b2d54e4b Merge "Merge remote-tracking branch 'origin/5.14' into 5.15" 2020-01-09 01:00:21 +01:00
Qt Forward Merge Bot
9bb9de461f Merge remote-tracking branch 'origin/5.14' into 5.15
Change-Id: I9b4816b4aa6f0c51a446742db58b9d0dcf69aa09
2020-01-09 01:00:08 +01:00
Lorn Potter
c2687d1e5d wasm: futureproof EmscriptenMouseEvent
Future versions of emscripten will remove the timestamp, so we need to
replace this with the current timestamp

See a7f058a1e6 (diff-9a5d68085dc7db2938b37a2b7b05c1f5)

Change-Id: Ieba323ad54933626d90ac7cbae5a2c471c52628e
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
2020-01-09 09:14:36 +10:00
Giuseppe D'Angelo
50f3ccd782 QStringView: add a test for overload resolution versus QString
In the presence of multiple overloads of a function taking either
QString or QStringView, QStringView should always be preferred.

The rationale is that the QStringView overload may have been
added "later" (read: the function was written when QStringView
was not available yet, so it took QString), and the fact that
a function with the _same name_ offers a QStringView overload
implies the function never needed to store/own the string in
the first place.

Add a (compile-time) test for this preference. This is in
preparation for a future QString(char16_t*) constructor
(in Qt 5.15 / Qt 6).

Change-Id: I60a435e494b653548f8f8d52c5d7e7cac2cc875a
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2020-01-09 00:01:55 +01:00
Błażej Szczygieł
f2a61f2ce2 xcb: Propagate size hints when window changes its scaling factor
Properly scale size hints to the new scaling factor.

Fixes: QTBUG-80476
Change-Id: I1081c9b01560f7e434f0f1de0199ef3d3cae787c
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
2020-01-08 01:28:48 +01:00
Robert Loehning
5e66ea373a Fuzzing: Move fuzz target to match path of tested code
Change-Id: I3e96f5ba89e9126ff8626f0e98397ad996fb1cd3
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
2020-01-07 21:15:09 +01:00
Nico Vertriest
f3b3c971cf Doc: Correct link errors
Task-number: QTBUG-79824
Change-Id: I05caaccab1efa16bc0a01ce3045a9377f9ef640e
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
2020-01-07 18:22:12 +01:00
Tor Arne Vestbø
5af73cd9db Skip WA_DontShowOnScreen widgets when checking whether application can quit
QApplication tries to close all windows on quit using closeAllWindows,
but closeAllWindows skips some windows, in particular any widget with
WA_DontShowOnScreen set.

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

We include WA_DontShowOnScreen so that widgets that are proxied via
QGraphicProxyWidget will not prevent the application from quitting.

There's still some divergence between closeAllWindows and the logic
in QApplication::event's quit handling, but aligning that requires
more work than this particular fix, and should probably also be
based on using the return value of tryCloseAllWindows() directly.

Change-Id: I2555eeee0cb04b8e736109fed57f37150efd1964
Fixes: QTBUG-81107
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
2020-01-07 15:16:13 +01:00