Commit Graph

42774 Commits

Author SHA1 Message Date
Christian Ehrlicher
f5213ab799 QMySQL: return QVariant::ByteArray for POINT column
qDecodeMYSQLType() did not handle FIELD_TYPE_GEOMETRY and therefore the
type for a POINT column was incorrectly treated as QVariant::String.
Even the type can not (yet) be properly decoded to a QPoint, treating it
as QVariant::ByteArray is the better option here.

Fixes: QTBUG-72140
Change-Id: I12e75b326ae3acb75cb36f2e650464528bd43c0e
Reviewed-by: Andy Shaw <andy.shaw@qt.io>
2020-03-15 23:00:41 +01:00
Topi Reinio
26ed956cbc Doc: Remove \contentspage commands
The command is deprecated and has no effect apart from generating
a documentation warning.

Change-Id: I30871bfd6975f8268930cce99993a8579242fdb8
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
2020-03-15 10:48:58 +01:00
Lucas Wang
9287447a67 macOS: Ensure GL symbols are resolved from the OpenGL framework
The app or its dependencies may link against X11's libGL.1.dylib from
XQuarz, to support GLX on macOS. Doing so may place libGL earlier in
the load order than Apple's OpenGL framework, which results in dlsym
picking symbols from libGL when using the RTLD_DEFAULT lookup strategy,
breaking Qt's OpenGL support in various ways:

  QOpenGLShaderProgram: could not create shader program
  Warning: "" failed to compile!

To fix this we use RTLD_NEXT, which looks up the symbol in
dependency order of the image that called dlsym, rather than
the global load order.

Change-Id: I1ec3055a4ab0bb96566c7e196d301b30785f2dc0
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2020-03-15 00:02:45 +01:00
Harald Meyer
91436e2409 Add native iOS file dialog
This patch adds native iOS file open and directory picking support for
the QFileDialog using the iOS UIDocumentPickerViewController class.

Change-Id: Ia724a59742650a01c62067aed3477f82ab1fd546
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2020-03-14 16:22:17 +01:00
Tor Arne Vestbø
395e2d9bc4 macOS: Modernize QCocoaSystemTrayIcon
The code had not been touched in a very long time and was overgrown
with weeds from pre-QPA times.

We no longer maintain an indirection through QSystemTrayIconSys,
which was a remnant from Qt 4 times.

The Objective-C helper class used for callbacks has been slimmed
down to just a simple delegate, with the actual work done in the
QCocoaSystemTrayIcon implementation, further reducing indirection.

We no longer use a custom NSView for the status bar item, something
that has been deprecated for a long time. Instead we set properties
on the NSStatusItem's button. This gives us automatic support for
drawing the icon with the right highlight, including in dark mode.

Finally, the code has been updated to modern Objective-C syntax.

Change-Id: I59706081f6b179035b8216a7a6ebc08a47cec127
Fixes: QTBUG-77189
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2020-03-14 14:21:28 +01:00
Edward Welbourne
54f8be6cc0 Update UCD to Revision 26
Include WordBreakTest.html, since a test uses sample strings from it,
albeit without actually reading the file.

Had to comment out more of the new tests, as at Revision 24, pending
an update to harfbuzz and the text boundary detection code.

Task-number: QTBUG-79631
Task-number: QTBUG-79418
Task-number: QTBUG-82747
Change-Id: I0082294b09d67ffdc6a9b5c15acf77ad3b86f65f
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2020-03-14 11:26:59 +01:00
Lorn Potter
7ddbd179a1 qpa: Return accepted state from mouse, touch and wheel handlers
Return the value from handleWindowSystemEvent so platform plugins can
detect whether it was accepted or not.

Change-Id: I53ffb713afc8e0ec1789107c912433133cfaa11a
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2020-03-13 15:56:40 +01:00
Robert Loehning
9133bdcf26 Fuzzing: Add fuzz target for ctor of QSslCertificate
Change-Id: I483f17e7cb6108e5096cf57594183a206f605fbc
Reviewed-by: Albert Astals Cid <albert.astals.cid@kdab.com>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
2020-03-13 14:51:02 +01:00
Andy Nichols
20f7e18d9c Make it possible to set the EGL_DEFAULT_DISPLAY
Change-Id: I564f1ce72501bc12b960c87c953343fd64ee9011
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
2020-03-13 22:46:22 +09:00
Morten Johan Sørvig
ef5c747aba Fix range-loop implicit copy warning
Make the copy explicit.

qhighdpiscaling_p.h:282:24: warning: loop variable 'rect' has type
	'const QRectF &' but is initialized with type 'const QRect' resulting
	 in a copy [-Wrange-loop-analysis]
    for (const QRectF &rect : pixelRegion) {
                       ^

Change-Id: I4080ff42c41e464d081ab2b01cb2d010867b041b
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
2020-03-13 12:37:38 +00:00
Eskil Abrahamsen Blomfeldt
36325f9d86 Hide default-invisible characters when shaping is disabled
When shaping is disabled we also skipped the step which set
dontPrint to true for soft hyphens, line separators, and
similar characters. This caused boxes to appear in text with
e.g. line separators.

There is a minor modification to the code that is moved:
In the case on unshaped text and only the CMAP able is used,
the font engine for the soft hyphen can be a fallback engine,
so we need to also set the correct engine index when changing
the glyph index.

[ChangeLog][QtGui][Text] Fixed an issue with QFont::PreferNoShaping
where boxes would appear in place of unprintable characters.

Fixes: QTBUG-81994
Change-Id: Ifc9f4f89d928475ca0487a92b4480bd5db5918fd
Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2020-03-13 10:17:54 +01:00
Jean-Michaël Celerier
6dbe03c4d1 Make vulkan-flavored GLSL known to QShaderFormat
Change-Id: I6a3799c35aafa38095b316ee01d14b9db3af5e04
Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
2020-03-13 09:43:13 +01:00
Topi Reinio
65a7648329 Doc: Remove incorrect see-also link
The link is actually a self-reference; setCurrentSection() is setter
for the currentSection property, and has no dedicated documentation.

Change-Id: I4977650566913c590d46aede92d8678b7b7ea291
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
2020-03-12 21:44:57 +01:00
Tor Arne Vestbø
67c3999e02 macOS: Pass on QCursor pixmap with original scale
There's no need to scale the cursor down to 1x, since we're now passing
the correct device pixel ratio on to the NSImage by setting its size.

Letting macOS deal with the scaling produces a higher resolution cursor.

Change-Id: Icdb3d59998f9a32094c2973c3b222cf22b6398ac
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
2020-03-12 11:49:18 +01:00
Tor Arne Vestbø
059c3ae66a macOS: Pass on QIcon as NSImage if possible, instead of going via QPixmap
The QIcon can be turned into a NSImage directly, with all the supported
representations that the icon contains. This allows macOS to choose the
best representation for whatever context it's rendering the NSImage in,
and will likely do a better job of scaling it if none of the sizes fit
target context.

This fixes e.g. application window icons not taking retina screens into
account.

Change-Id: Idbd97cae4ef50cc0dd3f38c355cfceec007e0d19
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
2020-03-12 11:49:16 +01:00
Tor Arne Vestbø
bee3d0fc13 macOS: Streamline QIcon to NSImage conversion
The conversion uses NSBitmapImageRep and correctly sets the display
pixel ratio and size of the resulting image, reducing the need for
clients to deal with this.

It also propagates the isMask property of the icon to the NSImage.

The function returns an auto-released object, as is customary for
class-functions like these.

Change-Id: If97f3d383959cd0f58a0d1249f5c26e52c1da9cd
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
2020-03-12 11:49:08 +01:00
Tor Arne Vestbø
52e9c8b4be macOS: Streamline QImage to NSImage conversion
The conversion uses NSBitmapImageRep and correctly sets the display
pixel ratio and size of the resulting image, reducing the need for
clients to deal with this.

The function returns an auto-released object, as is customary for
class-functions like these.

Change-Id: I5124d1d8145a7f5266921b22fda1987798771ec1
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
2020-03-12 11:49:06 +01:00
Mårten Nordheim
28d3d82a0d QtNetwork deprecations: suppress internal warnings
There're some uses we can't get rid of until the deprecated functions
are deleted, so suppress them for now.

Change-Id: I85b737eefc71f8f3ac939dfa961383220a8244af
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2020-03-12 11:00:29 +01:00
Mårten Nordheim
6e32de256d Bearer deprecation: centralize and suppress internal warnings
We can't get rid of internal use, so let's work around that by not
marking it deprecated in private code.

Change-Id: If6cbfff4f16c30892335633567326141fbc44092
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2020-03-12 10:48:22 +01:00
Marc Mutz
179c23efb1 QStringBuilder: make the nested ConvertTo typedef public
It's needed by QStringTokenizer, and it's more generally useful as a
public type (you don't need to match the type of the conversion
operator, but can just access the nested typedef).

Change-Id: I2cf8b22f1ca31c38d51d2143932115da6aefc5a7
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2020-03-12 09:27:27 +00:00
Tor Arne Vestbø
d9580c2beb macOS: Log occlusion state changes
Change-Id: I5a0a3a96a59a1eae42fa94f2f9f406f22807a354
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
2020-03-12 10:07:22 +01:00
Marc Mutz
12b4ce7281 QStringView: adapt to C++20 constexpr std::basic_string
Just mark the constructor constexpr. If std::basic_string isn't, then this
will be silently dropped. If std::basic_string is, we can now construct
QStringView from std::basic_strings at compile-time.

[ChangeLog][QtCore][QStringView] Conversion from std::basic_string can now
be constexpr (when std::basic_string is).

Change-Id: Ia608f1a71c9a24f417b3e21e150ff6bd3d2f4fc4
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2020-03-12 09:44:59 +01:00
Sona Kurazyan
0ae6803d39 Try to stabilize flaky test cases of tst_qsequentialanimationgroup
Use QTRY_COMPARE in the flaky tests instead of waiting.

Change-Id: Ic18fc5fde3fa47f3b3ef21e6acd876bd6990981d
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
2020-03-12 09:40:43 +01:00
Friedemann Kleint
a719c630f1 Mandelbrot Example: Use High DPI scaling
Create the pixmap with a device pixel ratio set.

Change-Id: I7f7e90aec4d117304852f050be70e14a0c6bf69d
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
2020-03-12 08:24:09 +01:00
Friedemann Kleint
2c390e85cf QFileDialog: Improve default implementation of getOpenFileContent()
Use QFileDialog::ExistingFile and check whether file can be opened,
fixing warnings like:
QIODevice::read (QFile, "/home/.../blub"): device not open

Change-Id: I7ee1d59f01383c581bc09fb44855835aae8c246b
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
2020-03-12 08:23:45 +01:00
Tor Arne Vestbø
5f940253bf macOS: Merge qcore_mac cpp and mm files
Files ending with .mm are Objective-C++ files, so we don't need
a separate file for the C++ parts.

Change-Id: I3ef52bc98291fd461b889978a538e81630d17c6e
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
2020-03-12 06:07:35 +01:00
Lorn Potter
739382a1bf wasm: fix emsdk 1.39.9 build
Change depreciated and removed preferLowPowerToHighPerformance to the new
powerPreference

Fixes: QTBUG-82730
Change-Id: I53e4e39626fce75897701b0134adadf00dac2dea
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
2020-03-12 12:33:11 +10:00
Allan Sandfeld Jensen
7cec37572a Add test for conversion of "large" images
This exercises the multi-threaded codepath and also tests precision
a bit higher.

To avoid quadratic blowup, only a short set of formats are tested in
the larger conversion tests.

Task-number: QTBUG-82818
Change-Id: I411deb97aea61a69fbdb24cbaf6559dd9436b703
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
2020-03-11 18:45:46 +00:00
Allan Sandfeld Jensen
198d8eb5d0 Fix multi-threaded shrinking conversion
The conversion takes place in separate blocks, but may need to be
compressed after converting.

Fixes: QTBUG-82818
Change-Id: I71431af3d41e1bfe1f9b3d8cd7c1e0a2020846cd
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
2020-03-11 15:34:33 +00:00
Edward Welbourne
296bbbfa50 Fix minor errors in QDeadlineTimer docs
Change-Id: I0f33094da29300ca8a609cfffd700c2a82d86ad1
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
2020-03-11 12:27:40 +01:00
Qt Forward Merge Bot
12f903b155 Merge "Merge remote-tracking branch 'origin/5.14' into 5.15" 2020-03-11 12:27:40 +01:00
Allan Sandfeld Jensen
ee259ff60b Replace initialization of sparse table of converts with setters
This is similar to how the similar table in qblendfunctions.cpp is now
set, and is easier to read and maintain.

Change-Id: I43a885fae7b1a92110bb33f0b22a5b02fddc0115
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
2020-03-11 12:27:40 +01:00
Qt Forward Merge Bot
116d68f105 Merge remote-tracking branch 'origin/5.14' into 5.15
Conflicts:
	src/corelib/plugin/qlibrary.cpp
	src/corelib/plugin/qlibrary_unix.cpp
	src/corelib/plugin/qpluginloader.cpp

Change-Id: I866feaaa2a4936ee5389679724c8471a5b4b583d
2020-03-11 11:27:49 +01:00
Allan Sandfeld Jensen
bd3c82f8db Fix non-trivial soft-hyphen line breaks
The effect of the soft-hyphen needs to be updated once the final the
break point has been found.

This change cleans the logic by using two variables keeping track of
soft-hyphen at current evaluated position and at last confirmed break
point. Also adds tests for supression of soft-hyphens in the tight
WrapAnywhere case.

Fixes: QTBUG-35940
Fixes: QTBUG-44257
Change-Id: I7a89a8ef991b87691879bb7ce40cec4a3605fdd5
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
2020-03-10 21:58:21 +01:00
Topi Reinio
52de905d0e Doc: Fix documentation for class qfloat16
This class has documented member functions, but only the related
\headerfile was documented. The class documentation itself was
omitted with the \dontdocument command.

Replace the \headerfile with a \class command, and move the global
functions to be related to the class itself. Keep the title as a
\keyword to avoid breaking any external links. The new class page
will inherit the .html file name of the header page, so we're safe
in that regard as well.

Fixes: QTBUG-82800
Change-Id: Id51539b45e0642d91b304a37f95461ca3d6c9841
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
2020-03-10 17:51:56 +00:00
Laszlo Agocs
67edae9a08 QVulkanWindow: Fix setQueueCreateInfoModifier signature
...per API review.

Change-Id: I4a5a1cc895eac32f21f8a830507b841318509992
Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
2020-03-10 17:06:07 +01:00
Cristian Adam
d4207cb1a9 Mimetypes: Build fix for Android builds on Windows
Due to Android's multi-abi the build will fail due to concurrent
access:

cmd /c C:\Projects\Qt\repo\qtbase\src\corelib\mimetypes\mime\generate.bat C:\Projects\Qt\repo\qtbase\src\corelib\mimetypes\mime\packages\freedesktop.org.xml > .rcc\qmimeprovider_database.cpp
The process cannot access the file because it is being used by another process.

Change-Id: I647e0a6d8aa03cf116b08a1dce6e61e8882661f4
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2020-03-10 17:05:37 +01:00
Laszlo Agocs
3dd13d4075 rhi: d3d11: Honor resource/sampler slot limits
Show a warning but allow applications to survive by not attempting
to call VS/PS/CSSetWhatever() with an invalid number of resources.

Relevant for samplers in particular, where the limit is 16. Qt Quick 3D
exhibits problems with this when using custom materials combined with
shadow mapping, and while this is not a solution to the problem there,
at least the problem is now clearly indicated instead of crashing.

Task-number: QTBUG-82719
Change-Id: I83914b7648001fa421ed1cf07a7b7444e0ef8fc0
Reviewed-by: Christian Strømme <christian.stromme@qt.io>
2020-03-10 09:38:03 +01:00
Mårten Nordheim
19a76200ea QDataStream: keep brace delimiters inside #if-scopes
Because it looks odd.

Change-Id: Ic272ae7b1b5a3e0a70884caa683ccbdd3a61ff6a
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2020-03-10 09:29:12 +01:00
Mårten Nordheim
d340cc1512 Schannel: Fix readBufferMaxSize impl with incomplete data optimization
Following the incomplete data guesstimation optimization the
tst_QSslSocket::readBufferMaxSize test would fail due to it waiting for
16K, but the readBufferMaxSize was 10 bytes.

Amends 559b563d71

Change-Id: I5d17fac24e73c1305161aff744710b4c5b0b457a
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
2020-03-10 09:28:56 +01:00
Mårten Nordheim
d52a553754 Bearer management deprecation cleanup
For QNAM:
Deprecate the to-be-unused enum and mark the property deprecated in docs

For bearermanagement:
Add a warning on the bearermanagement documentation page that it is
deprecated.

Change-Id: I2cbe12ddec444d9f704601f07f3a7c9b70dc4f3c
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
2020-03-10 09:07:18 +01:00
Friedemann Kleint
9aa2932701 Polish the Mandelbrot Example
Fix warnings about float constants and comparison.
Use member or constructor initialization.
Introduce some const for clarity.
Use Qt_CONFIG.

Task-number: QTBUG-81254
Change-Id: I71a6ebfba397c0f8e1dd2e61167233c8e5c137af
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
2020-03-10 08:15:15 +01:00
Topi Reinio
a8ae9718b0 Doc: Mention .qrc compression attributes in resource compiler docs
Fixes: QTBUG-76321
Change-Id: Idf7b4157b46d98392314ccddf6b714f9e620b5f8
Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
2020-03-10 06:47:45 +01:00
Allan Sandfeld Jensen
332816779c Multithread some QImage routines
Use QThreadPool to process QImage smooth-scaling, format conversions,
and colorspace transforms multithreaded.

Change-Id: Ic142b1fa899f56e7e5099d36ca713701a47b681b
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2020-03-09 23:22:43 +01:00
Tor Arne Vestbø
cc59f0de55 macOS: Support printing when no printers are installed
Even if there are no printers installed, we can still show the print
dialog, which gives the user feedback about no printers being installed,
allows them to install one, or allows them to print to PDF as a
fallback.

The code for printing to PDF has been re-enabled, and the conditions
of QTBUG-38820 have been removed as the problem is no longer present.
The code also takes into account the possibility that the user chose
to print to PostScript, which we don't yet support, but warn about.

We now also support opening the printed document in Preview. This
requires a minor assumption about the print operation being done
synchronously after the print dialog is accepted, but this is
something we can improve in the future with internal APIs if it
turns out to be a problem.

Printing workflows such as sending the printed document via mail
or messenger are not not supported, and will give a warning.

Fixes: QTBUG-36112
Change-Id: I8ba9e2c5ce31a5a06542c4a7126d005e4b27f2be
Reviewed-by: Andy Shaw <andy.shaw@qt.io>
2020-03-09 14:53:50 +01:00
Kai Koehne
2097932dc5 Document how to use CMake for Qt Network
Add documentation on how to use a module from CMake, alongside
the existing documentation about qmake.

While at it, also remove the mentioning of the central include;
It is not something we should actively advocate anymore. Instead,
the documentation of every class gives the correct include to use.

Task-number: QTBUG-73058
Change-Id: I71ed5a62f4f0a6d868dd1f84ea39e5ac385a2fb8
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
2020-03-09 14:53:50 +01:00
Andy Shaw
20167a7fe9 WinRT: Use the fallbacks for getting the save file name
To bring it in line with the other platforms, then it needs to check if
the initially selected files are set and use the first one. Otherwise it
can fall back to the initial directory if that happens to include a
filename.

Change-Id: If34ae0e7e10b6a3c25e9422d9b4f2c21e6bfc8d1
Reviewed-by: Maurice Kalinowski <maurice.kalinowski@qt.io>
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
2020-03-09 14:53:50 +01:00
Ulf Hermann
37a66236d2 qmake: Document qmltypes and metatypes
Task-number: QTBUG-81615
Fixes: QTBUG-82305
Change-Id: I0a411ff2ebc2dbf5462fa110b1eb70a1876b6ae5
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
2020-03-09 09:25:06 +01:00
Christian Ehrlicher
3702a4c37e QSortFilterProxyModel doc: do not mention deprecated function reset()
QSFPM::reset() is deprecated and begin/endResetModel() should be used.
Therefore adjust the documentation to reflect this.

Fixes: QTBUG-82470
Change-Id: I786b3f25e5674d97d0ef6a0c91342973d5e952e9
Reviewed-by: Sze Howe Koh <szehowe.koh@gmail.com>
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
2020-03-09 06:29:25 +01:00
David Faure
4bc9e3b847 QDataStream: fix compilation with QT_DISABLE_DEPRECATED_BEFORE=0x0050F00
Fixes: QTBUG-81023
Change-Id: I0d56785d1fed2c4c8e0e87ccefb0b72b0ed3644a
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
2020-03-08 15:38:04 +01:00