Commit Graph

42889 Commits

Author SHA1 Message Date
Tor Arne Vestbø
d4a4202caa widgets: Sync client rect of paint-on-screen widgets during resize
Paint events are delivered with the client rect of the widget, and
this applies to paint-on-screen widgets as well. The same goes for
how the widget repaint manager tracks dirty rects. Internally we
were also calling paintOnScreen() with client rects, so the use
of geometry() in the resize handler was likely a bug/oversight.

Change-Id: I1312ccf77218d1162e0971e4cbabaa80f49c852c
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2020-03-27 11:19:52 +01:00
Lorn Potter
6434101360 wasm: refactor network to use fetch API
This has better support for threaded use, and gets rid of bind use.

This requires emscripten 1.38.37 and above

Task-number: QTBUG-76891
Change-Id: Ic30a6820c2ce945c314751c06cfc356914a71217
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
2020-03-26 22:36:36 +00:00
Topi Reinio
96de59d7c1 Doc: Document new property change notifiers for QSortFilterProxyModel
Change-Id: I02789fa2281d33c7344a5d5e730a27fe6fa50e56
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
2020-03-26 15:28:42 +01:00
Topi Reinio
0b5a1100ff Doc: Adjust offline style for the litehtml rendering engine
Qt Creator now has the option to use the litehtml backend as a
replacement for the QTextBrowser-based help viewer.

Fix a few issues that the offline style has with the litehtml renderer:

- Fall back to using an unordered list for the navigation bar.
- Remove the background image for #buildversion and adjust font size.
- Adjust the generated padding around code snippets.

Keep the script that switches the offline-simple.css style to the
full offline style (offline.css) for JavaScript-enabled browsers.
The litehtml backend in Qt Creator will handle this switch internally.

With these changes, the generated offline documentation looks
acceptable when rendered with QTextBrowser, litehtml, or desktop
web browsers.

Fixes: QTBUG-82567
Change-Id: I86b179b1985b7ef54feddab30cb227b28021efe5
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
2020-03-26 15:28:31 +01:00
Topi Reinio
07558ae12d Doc: QItemSelectionModel: Note when function default arguments were added
Change-Id: I4b7a9269b68c86548035b57211c4c1b5ad451767
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
2020-03-26 15:28:08 +01:00
Topi Reinio
7d0f24b166 Doc: Mark QTextStream manipulators as deprecated
and instruct to use the ones from the Qt namespace instead.

Task-number: QTBUG-82532
Change-Id: I6a85f5096da8aec925a287beff136b77d113926e
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
2020-03-26 15:27:58 +01:00
Topi Reinio
beffcc590c Doc: Expand reasoning for QHash deprecations
and mark QHash::[const_|key_]iterator operators correctly as deprecated.

Change-Id: I01da16254759b9bdb7920709de45a72933d6b5c8
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
2020-03-26 15:27:49 +01:00
Topi Reinio
f588804725 Doc: Expand reasoning for QMap deprecations
Change-Id: Idaec1ebd2a392af2b8d778e72acda6bd117d1a48
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2020-03-26 15:27:39 +01:00
Topi Reinio
bd9a13b370 Doc: Fix \fn command for qScopeGuard(F &&f)
and tag it in the header file to ensure the documentation is matched.

Change-Id: Id1e7cd395ca0ec337845da9a207bfbf95db01064
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2020-03-26 15:27:28 +01:00
Topi Reinio
737e7524e8 Doc: Fix documentation for deprecated QSet functions
QDoc has trouble applying the \obsolete command for multiple
topic (\fn) commands in one go. Separate them out and expand
the reasoning for deprecation.

Mark the rest of the deprecated functions and typedefs related
to reverse iterators as \obsolete.

Change-Id: I09858efd7e1e5fc890d4f3f063f00c8812fc0b52
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
2020-03-26 15:27:16 +01:00
Topi Reinio
5a7a590e8a Doc: Mark deprecated QMutableSetIterator functions as \obsolete
Change-Id: I07a4ade20242fbe4139c0b88cf8728dd74628511
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
2020-03-26 15:27:07 +01:00
Topi Reinio
e16137d2db Doc: Document QDBusReply copy constructor
Change-Id: Ice71b8d48f92b9ecd3075fba1927d3657934b018
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
2020-03-26 15:26:48 +01:00
Topi Reinio
c81b172781 Doc: Mark gamma-related functions deprecated in QImageReader/Writer
Change-Id: I0a9fbcca7a10a6555f5879cc4955f046eaa56602
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
2020-03-26 15:26:35 +01:00
Topi Reinio
a320b57f1d Doc: Don't mention deprecated functions in QTabletEvent overview
Change-Id: I5d41d6061403f2923d673376be7cf1250d0f0e82
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
2020-03-26 15:26:21 +01:00
Volker Hilsheimer
5f87fb8813 QLineEdit: Include the horizontal margin in minimumSizeHint
The margin is respected in the sizeHint, but not in the minimumSizeHint.
Since the latter should be the former for a single character (as per the
documentation promising enough space for one character), the margin
calculation needs to be identical.

Adjusting the documentation nevertheless, as there are characters that
won't fit either way. As reported, the permyriad character doesn't fit
even with this fix on macOS, as the core graphics API we are using
doesn't report a glyph-index for U+2031 (so our existing assumption
that 'W' is the widest character is still the best we can do).

Change-Id: I30573960c316cc7b8c9bbe3c3f4c6351792bed36
Fixes: QTBUG-82970
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2020-03-26 14:56:57 +01:00
Lars Knoll
b3b51a7665 Fix deprecation warnings for QInputDialog::getDouble()
The way this was done didn't really make sense. The change added
an overload with one additional argument. The deprecation warning
would have now forced everybody to explicitly specify all arguments
to avoid the warning.

Instead, keep both overloads in 5.15, but document them as one method.
Remove the old version in Qt6 and move the default arguments to the
new version.

Change-Id: I738d4d1b99cdf30db53acf14382a00cac74aa10a
Reviewed-by: Kai Koehne <kai.koehne@qt.io>
2020-03-26 14:48:17 +01:00
Andre de la Rocha
319ac188eb Windows QPA: Enable Toggle UIA pattern for all checkable controls
This change allows the checked/unchecked state to be detected by screen
readers for all controls with a checkable state.

Task-number: QTBUG-81919
Change-Id: I604151397b4ae21297009c274ffe634723ebe783
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
2020-03-26 14:25:00 +01:00
Andre de la Rocha
c91b7f15ce Add "checkable" state to QAccessibleTableCell
The information about whether a table/tree item may be checked is necessary
to allow the platform code (in particular, Windows UI Automation layer)
to make this information available to screen readers.

Task-number: QTBUG-81919
Change-Id: Id68eea4a004788751404d70567222a2c531578aa
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
2020-03-26 14:24:43 +01:00
Ulf Hermann
fc49325c80 qmake: Document QML_FOREIGN_METATYPES
Task-number: QTBUG-82709
Change-Id: I0ca648114adbbed1ab3c6406e9f14f60f7924e96
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2020-03-26 13:51:44 +01:00
Morten Johan Sørvig
85a1582412 wasm: add braces around multiline else case
From clang warning:

qwasmcompositor.cpp:335:13: warning: misleading indentation;
	statement is not part of the previous 'if' [-Wmisleading-indentation]
		offset += (delta +delta);

Change-Id: Id372dfdd8fda1c705c61a24c26843dfb33fba40c
Reviewed-by: Lorn Potter <lorn.potter@gmail.com>
2020-03-26 12:31:09 +01:00
Paul Wicking
3f3e200aef Doc: Fix coverity warnings in SQL snippets
Fixes: QTBUG-83008
Change-Id: I126bc04719cd221a3d80ae825fca44e63aeec934
Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
2020-03-26 12:25:06 +01:00
Sona Kurazyan
f22c929c8a Make tst_QRandomGenerator::qualityReal() test more stable
Increasing the sample size of randomly generated test samples reduces
the probability of small deviations from the expected uniform
distribution.

On my machine with the new values the test fails approximately once per
3000 consecutive runs, instead of failing once per 300.

Change-Id: I4d1815504c353290a2fb350b3fd1cbb802f8d559
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2020-03-25 22:19:24 +01:00
Thiago Macieira
028ddf3633 QProcess/Linux: use the FFD_VFORK_SEMANTICS flag
... when we are not using the FFD_USE_FORK flag. We use the FFD_USE_FORK
flag when we have user code to run in setupChildProcess(). This code is
enabled for all Unix, but forkfd() honors this flag only on Linux >=
5.4.

See the commit adding the flag for more information on what the flag
does and see the comment in this commit on why it's safe to use it.

Fixes: QTBUG-17331
Change-Id: I1bee3bc466a04f19bd6efffd15f448cb23ce1e91
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@gmx.de>
2020-03-25 20:19:41 +01:00
Thiago Macieira
defd49f7bf forkfd: add FFD_VFORK_SEMANTICS flag
This flag asks forkfd() to use vfork semantics wherever available. That
is, suspend the calling process execution until the child either does an
execve(2) or _exit(2). The advantage of that is that it puts lower
pressure on the OS VMM system, as the number of pages that need to be
copy-on-write duplicated is much smaller (still not zero, as at least
the stack in the child will be written to).

However, the only implementation that supports using this flag for now
is Linux's pidfd. It would be possible to add to FreeBSD, but pdfork(2)
does not have a flag for this behavior -- if it gets one, we can add
support for it later. Everywhere else, we need to force the child to not
exit until we store the child process's PID in the ProcessInfo structure
we allocated, which means the parent process must run before we even
return from forkfd().

Change-Id: I1bee3bc466a04f19bd6efffd15f447f28c201aa9
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2020-03-25 20:19:38 +01:00
Thiago Macieira
ba5e2ce49a forkfd: fix forkfd_wait when FFD_USE_FORK was active
If we detected that the OS supports a version of system forkfd (Linux
pidfd, FreeBSD procdesc), the forkfd_wait() function was using only the
system waiting implementation, which of course can't work for file
descriptors created with FFD_USE_FORK. So just detect EBADF and attempt
again.

If the file descriptor is neither one of our pipes nor a system forkfd,
bad things will happen...

Fixes: QTBUG-82351
Change-Id: I4e559af2a9a1455ab770fffd15f59fb3160b22eb
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@gmx.de>
2020-03-25 20:19:36 +01:00
Thiago Macieira
4605583fec forkfd: introduce forkfd_wait4() that takes options
"wait4" because it looks like the wait4() BSD function, which has the
signature:

       pid_t wait4(pid_t pid, int *wstatus, int options,
                   struct rusage *rusage);

And because ours also has 4 parameters.

Having options is important anyway. I might want to add some more later,
but we can't really support them with the fall back implementation (in
fact, we don't honor WNOHANG in the fall back implementation either).

Change-Id: I4e559af2a9a1455ab770fffd15f5858bb357e15b
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@gmx.de>
2020-03-25 20:19:34 +01:00
Robert Loehning
2b91374261 Fuzzing: Add fuzz target for QRegularExpression::optimize
Change-Id: I693af83caed60cdffc83af368a15567d72524844
Reviewed-by: Albert Astals Cid <albert.astals.cid@kdab.com>
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
2020-03-25 20:07:04 +01:00
Allan Sandfeld Jensen
f7f9977a6f Detect Visual C++ 2019 mode in clang_cl / intel_icl
Change-Id: Icdca1551a56e894f6266b33ac059bbbfa3b18453
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2020-03-25 19:07:04 +00:00
Michal Klocek
b1e3f33a28 Call post routines from ~QGuiApplication
Currently depending if user uses QApplication
or QGuiApplication we end up in different behavior
when running post routines. For example QApplication
destructor calls post routines before stopping event dispatcher,
In case of QGuiApplication post routines are called
from QCoreApplication destructor, so no more event dispatcher.
This behavior is not consistent and creates troubles
when releasing resources of web engine.

Attached test will hang on windows with QGuiApplication,
however works fine with QApplication.

Task-number: QTBUG-79864
Change-Id: Ice05e66a467feaf3ad6addfbc14973649da8065e
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2020-03-25 14:40:32 +00:00
Kai Koehne
e63d227289 CMake: Warn about using internal macros and functions
These functions and macros were never documented.
Let's warn about using them for now, with the option of
removing / renaming them in Qt 6.

Change-Id: Ia595aa35b73e54534e535d2946581651af8023f2
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2020-03-25 14:43:02 +01:00
Friedemann Kleint
cc333f5faf Diaglib: Fix build
Use range-based for and fix deprecation warnings.

Change-Id: I54152b2598e9e4a7a3cc9db9b7072bbabcef7fcf
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
2020-03-25 14:30:24 +01:00
Lars Knoll
46ebd11e66 Fix deprecation of QComboBox:::currentIndexChanged(const QString&)
Don't introduce another overload with two parameters. Users
want a simple signal to connect to, not another overload. Deprecate
the currentIndexChanged(QString) overload, usage of that can/should
get replaced by currentTextChanged().

This partially reverts commit 11dc7b35c8.

Change-Id: I5e7d16413f3d62b1a5a7a197f510af2c45cdfa55
Reviewed-by: Vitaly Fanaskov <vitaly.fanaskov@qt.io>
2020-03-25 13:09:38 +01:00
Giulio Camuffo
b15ed929f3 Fix memory leak
When creating a new QColorSpacePrivate it must be reffed otherwise in
the destructor the deref() will bring the count to -1 which is true
and will not delete the d_ptr.

Change-Id: Id569bae22134b56bf6ad37158d7079b495599fd7
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
(cherry picked from commit 20eabb72de)
2020-03-25 01:15:51 +01:00
Morten Johan Sørvig
1d5eb202b9 wasm: Add OpenGL version check
QtQuick3D probes for the supported OpenGL level by testing
multiple OpenGL versions in descending order. Context creation
must fail for versions not supported by WebGL. It does not
appear that Emscripten does this for the 3.x minor versions,
at least.

Add version check which allows OpenGL (ES) 3.0 and 2.0.

Change-Id: Ide8745dd79e69af86812a8d6f5d6cc16ecdd099a
Reviewed-by: Lorn Potter <lorn.potter@gmail.com>
2020-03-24 21:08:54 +00:00
Morten Johan Sørvig
d00f28afda Revert "wasm: support emsdk >= 1.39.4"
This reverts commit bcdf49bcc6.

This was a 5.14-only commit which accidentally found its
way to 5.15.

Change-Id: Iaef6f05fce20ab61d3afb8cb3c359a037e4c0b28
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Reviewed-by: Lorn Potter <lorn.potter@gmail.com>
2020-03-24 21:50:55 +01:00
Allan Sandfeld Jensen
5e1e4b9d52 Extend tiled optimization in 64-bit painting to 64-bit sources
Change-Id: I74b88781d631ee68822cd08f9cb0aca03f7b688e
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
2020-03-24 21:29:22 +01:00
Liang Qi
08fff0cb55 Merge "Merge remote-tracking branch 'origin/5.14' into 5.15" 2020-03-24 21:22:40 +01:00
Timur Pocheptsov
4561370661 More qOverload cleanups in qtbase
Task-number: QTBUG-82605
Change-Id: I1c3c14ed82911ed5483258c11e76f5dd7744fa12
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2020-03-24 20:58:13 +01:00
Allan Sandfeld Jensen
28a0f1ba79 Fix use of deprecated ::forcesign
Change-Id: I39322bcc0e24d0bfccf43c8700a166ce350208ea
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
2020-03-24 17:41:30 +01:00
Mårten Nordheim
fc1b5eac1a QAbstractSocket: Fix usage of deprecated error signal in example
Task-number: QTBUG-82605
Change-Id: I83a8777d32302607d48dd670b6c787ac05db88d2
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
2020-03-24 17:40:40 +01:00
Kai Koehne
45a131d465 Fix whitespace in Qt5XXConfig files
Remove some unneeded empty lines, and fix indentation.

Change-Id: Ie35e95f35f9625cc75070074be96bdeb62d5fd4c
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2020-03-24 17:40:40 +01:00
Kai Koehne
99ace38d22 CMake: Also import Qt plugins that are not literally named *Plugin
There are some plugins in qtlocation, qtdeclarative whose names are not
suffixed with 'Plugin', so the current logic fails to load the
corresponding QtModule_XXX.cmake file.

Work around this by just searching for

  Qt5$${CMAKE_MODULE_NAME}}_*.cmake.

Users can define QT5_STRICT_PLUGIN_GLOB
or Qt5$${CMAKE_MODULE_NAME}_STRICT_PLUGIN_GLOB
to change back to the old behavior.

[ChangeLog][cmake] Fixed an issue where some Qt location and
declarative plugins whose name did not end with "Plugin"
where not imported by the corresponding Qt component package.

You can force the old behavior by setting QT5_STRICT_PLUGIN_GLOB or
Qt5ModuleName_STRICT_PLUGIN_GLOB before the find_package(Qt5 ...)
call.

Fixes: QTBUG-58812
Change-Id: Ic8adf9562841ed49eabc4f7fb2b5ae257ca606cd
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2020-03-24 17:40:40 +01:00
Liang Qi
576dc2c701 Merge remote-tracking branch 'origin/5.14' into 5.15
Conflicts:
	src/plugins/platforms/xcb/qxcbdrag.cpp

Change-Id: I0b47324b70b0b4894e54b21aa3e7a5041f9bd5e3
2020-03-24 14:36:02 +01:00
Sze Howe Koh
6a972f44f3 QXcbCursor: Replace deprecated QCursor API
Align with e79a625381 in qtbase.

Task-number: QTBUG-48701
Change-Id: Ia3ca2de6bbf4e9c1738f77193351dd95a14dd2dc
Reviewed-by: Liang Qi <liang.qi@qt.io>
2020-03-24 06:26:33 +00:00
Volker Hilsheimer
34fe5f75bc Deprecation warnings: replace qrand with QRandomGenerator
Change-Id: I80fe6f611b367c6c8a1b77e82dc791493f88929b
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
2020-03-23 20:24:58 +01:00
Alexander Volkov
cc1d891b8e xcb: Add support for XdndActionList property
This allows to pass and receive possible drop actions from other
processes, including GTK applications.

Fixes: QTBUG-75744
Change-Id: I944edc6fa00f8801a25912e70eb104a647a9fc0e
Reviewed-by: JiDe Zhang <zccrs@live.com>
Reviewed-by: Liang Qi <liang.qi@qt.io>
2020-03-23 19:35:19 +03:00
Mitch Curtis
3f744be923 Merge "Merge remote-tracking branch 'origin/5.14' into 5.15" 2020-03-23 13:55:35 +01:00
Timur Pocheptsov
da1d6bccd2 Fix the name in invokeMethod
Task-number: QTBUG-82605
Change-Id: If21d9c25d607e8a363fe703b4ffa1e2d207eef39
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2020-03-23 12:58:06 +01:00
Ulf Hermann
94c564a082 Fusion Style: Use qobject_cast rather than dynamic_cast
We want to avoid RTTI.

Fixes: QTBUG-82287
Change-Id: Ib034094d4035d6dfa99d00ac198c93cc9572755b
Reviewed-by: Christian Ehrlicher <ch.ehrlicher@gmx.de>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
2020-03-23 12:00:46 +01:00
Jean-Michaël Celerier
b4b8ffb233 rhi: gles2: fix uniform gathering after struct-type member in UBOs
Given:

    struct Light { vec4 foo; };
    layout(std140, binding = 2) uniform material {
      Light light;
      int lightCount;
    };

the previous code would keep "light" appended for the prefix and look for
`light.lightCount`.

Change-Id: Ia8deacd0cb4833f45151e922fa7b5970169332eb
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
2020-03-23 10:59:30 +01:00