Commit Graph

44820 Commits

Author SHA1 Message Date
Alexandru Croitor
a02ec931b6 CMake: Pass --verbose flag to ninja
To allow seeing the exact compiler flags when build in Coin.
We do the same for qmake builds.

Change-Id: I8c43f35b95d722d914aaeaa8860720a3a0578737
Reviewed-by: Leander Beernaert <leander.beernaert@qt.io>
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2020-03-13 19:14:59 +01:00
Alexandru Croitor
6e286247e8 CMake: Don't make a private module depend 1kk times on the public one
The exported INTERFACE_LINK_LIBRARIES property now looks a lot more
sane.

Change-Id: I093fcb242607023dd0b103298562b299cb803028
Reviewed-by: Leander Beernaert <leander.beernaert@qt.io>
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2020-03-13 19:14:55 +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
Giuseppe D'Angelo
2537d04785 QRegularExpression: inline some compatibility calls
The functions take QStringView now. The ones taking QString can
be implemented inline (BC break). Drive-by change, use
qToStringViewIgnoringNull.

Change-Id: Ia3089c574446418e5ab93e08e21869ef19fbfbfd
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2020-03-13 15:23:56 +01:00
Giuseppe D'Angelo
75514103e2 Remove an outdated comment
QRandomGenerator is now used to seed QHash, so the comment
is wrong.

Change-Id: Ic50fe95ea4169b55290cc758f5aebfbb0a3ea085
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2020-03-13 15:23:56 +01:00
Tor Arne Vestbø
3a2fa3fec5 cmake: Add default Info.plist for macOS with some important keys
The default Info.plist shipped with CMake lacks an NSPrincipalClass
entry, which is crucial for making macOS apps run in full resolution
on retina screens.

We make sure the file is only picked up on macOS, not iOS and friends,
since those platforms require another principal class. If needed we can
extract the value out as a CMake variable and use the same file for all
Apple platforms. Doing so would assume all keys are single-platform
only, so if that's not the case we need platform-specific files.

We should probably extract the package type out as a variable too,
so that the file can be used for both apps, plugins, and frameworks,
but doing so requires setting up that variable somewhere based on
the target type, which CMake doesn't allow in an easy way.

The file itself is based on the file CMake ships, combined with
keys inherited from Qt's existing plist templates for qmake, and
adjusted to match what Xcode generates by default these days.

Change-Id: I3f5109e5fff63cdbd109a99d4008948d4bd2102b
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2020-03-13 15:23:56 +01:00
Morten Johan Sørvig
951d490750 High-DPI: Enable AA_UseHighDpiPixmaps by default
The effect of this is that QIcon::pixmap() will/may
return a pixmap larger than the requested size (with
an appropriate devicePixelRatio set), suitable for
high-dpi displays.

Many use cases, such as painting the image with QPainter,
will be unaffected by this change. User code which e.g.
iterate over image pixels may have to be updated.

Change-Id: I63e867cc1e3f2a0b5cad92e1ffab4fe4de33ae19
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2020-03-13 16:23:56 +02: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ø
17be43c58e cmake: Disable GL deprecations on Apple platforms
Change-Id: I87b98ae68d996868cefaaf578722ac24be745145
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2020-03-12 17:05:10 +01:00
Leander Beernaert
a5ec9bea63 CMake: pro2cmake handle ${QT_SOURCE_TREE} for include statements
Replace ${QT_SOURCE_TREE} with top level project directory when
encountered in include statements.

This is required to parse tests/auto/testlib/selftests/test/test.pro.

Change-Id: I80f31142cf5a35441d1424c38e21bb097e44cd0f
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2020-03-12 16:30:46 +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
Alexandru Croitor
d4018dac8b CMake: Reformat the python scripts using black
Change-Id: I1e2eba46eb7c9dfefd267be91790be7898634c3a
Reviewed-by: Leander Beernaert <leander.beernaert@qt.io>
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2020-03-12 11:41:53 +01:00
Alexandru Croitor
60a93a15b1 CMake: Fix incorrect argument in QtBuildInternalsAndroid
Uncovered while building qtdeclarative.

Change-Id: If1a36f2640a3a5d765e7ca74b0ba1d39ef2a18f0
Reviewed-by: Leander Beernaert <leander.beernaert@qt.io>
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2020-03-12 11:41:46 +01:00
Alexandru Croitor
a1867333d4 CMake: Install the QtBuildInternalsAndroid.cmake fille
It's needed when building qtdeclarative.

Needs to be copy_or_install to support non-prefix builds as well.

Change-Id: Ied59f6a1f8403be3721a0ad46f5a3b2f569028ca
Reviewed-by: Leander Beernaert <leander.beernaert@qt.io>
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2020-03-12 11:41:42 +01:00
Alexandru Croitor
8facb31fde CMake: Regenerate tests projects
Change-Id: I559bf2c82d83fac9bd3c52a331d99e1e83bc3f87
Reviewed-by: Leander Beernaert <leander.beernaert@qt.io>
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2020-03-12 11:41:39 +01:00
Alexandru Croitor
aa77fbca69 CMake: Don't build tests and examples by default on Android and iOS
Change-Id: Ia31733e2cadfb52d11426c40f3543bedc48342c4
Reviewed-by: Leander Beernaert <leander.beernaert@qt.io>
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2020-03-12 11:41:35 +01:00
Alexandru Croitor
5804473578 CMake: Propagate minimum required C++ standard to consumers of Qt
Aka the version of C++ that needs to be supported when compiling
applications that use Qt headers (C++17 at the moment).

Change-Id: I64dec297e8329f31b1d9864f216a95782049ed06
Reviewed-by: Leander Beernaert <leander.beernaert@qt.io>
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2020-03-12 11:41:32 +01:00
Alexandru Croitor
d2419b0d8c CMake: pro2cmake: Handle LIBS_SUFFIX define correctly
Matches the LIBS_SUFFIX define we use in Android conditions
and replaces it with a sane amount of escaped characters.

Change-Id: I7d870f992c70b105dd80b6fa94f87d3fa5644006
Reviewed-by: Leander Beernaert <leander.beernaert@qt.io>
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2020-03-12 11:41:29 +01:00
Alexandru Croitor
14546d1816 rcc: Teach rcc the --no-zstd option
It is needed when cross-building Qt using CMake, where the zstd
feature might have different values between the host and target,
in which case the build system tells rcc not to use zstd when
the feature is disabled.

Amends d20c980576

Change-Id: I9dc55b59b1be5272b79aa5f1e2daf2b516a157d6
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
2020-03-12 11:41:26 +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
Tor Arne Vestbø
39ad96033c Fix spelling mistakes
Change-Id: I389727ce9b8d3ef2a54156b682ef5aeccb39ebd2
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2020-03-11 17:51:15 +01: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
Qt Forward Merge Bot
3d315860cd Merge "Merge remote-tracking branch 'origin/5.15' into dev" 2020-03-11 15:39:56 +01:00
Qt Forward Merge Bot
865afac250 Merge remote-tracking branch 'origin/5.15' into dev
Change-Id: Ibee5acec72a1a1769d4bc5f23f56c7dc8d4cf3cb
2020-03-11 15:34:21 +01:00
Tor Arne Vestbø
cd80f347cf Update instructions for developer builds with CMake
Change-Id: I101a4b12bae393fa188bb2633cc2d74170adbb4c
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2020-03-11 15:31:40 +01:00
Leander Beernaert
c4763e397d CMake: Fix mkspec install commands
If there is a file present in the globbed mkspecs_subdirs file list we
run into an invalid argument error for the install(DIRECTORY) command.

Change-Id: I0fe61a8f0a863854f55cf62a87417bcaec1d2c29
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2020-03-11 14:47:04 +01:00
Leander Beernaert
3c85440b16 CMake: Build standalone tests out of source in Coin
Due to a bug in upstream CMake regarding relative paths being encoded
into the build.ninja file when performing in source builds, we need to
build the tests in a standalone directory outside of the source
directory.

Failing to do so will cause the source directory for the test to be
incorrect which can cause tests to fails and never read the
BLACKLIST.txt file. See the mentioned issue for details.

Task-number: QTBUG-82820
Change-Id: Ie5c178a92369d6b9decff625bd9641e53088a9fa
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2020-03-11 13:46:51 +00:00
Vitaly Fanaskov
c977e74afd QtConcurrent::run: accept more then five function's arguments
[ChangeLog][Potentially Source-Incompatible Changes] QtConcurrent::run
has the following signatures: run(Function &&f, Args &&...args) and
run(QThreadPool *pool, Function &&f, Args &&...args). If f is a member
pointer, the first argument of args should be an object for which that
member is defined (or a reference, or a pointer to it). See the
documentation for more details.

Fixes: QTBUG-82383
Change-Id: I18f7fcfb2adbdd9f75b29c346bd3516304e32d31
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Sona Kurazyan <sona.kurazyan@qt.io>
2020-03-11 14:46:25 +01: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