Commit Graph

46364 Commits

Author SHA1 Message Date
Alexandru Croitor
375831a3dc CMake: Mark all find_package(PkgConfig) to be quiet
This reduces the amount of warning messages when the pkg-config
feature is disabled.

Task-number: QTBUG-85276
Change-Id: I11a6dfb6273a1e48c47d1ef5c1a5f70ba990fbc0
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2020-06-29 12:23:10 +02:00
Alexandru Croitor
63f09a94db CMake: Transform absolute library paths into link flags in .pri files
Before this change, the qt_lib_foo_private .pri files contained
absolute paths to libraries, e.g.
  /usr/lib/x86_64-linux-gnu/libcups.so

Whereas the qmake build instead embeds link flags like -lcups.

Detect absolute library file paths, and transform them into link
flags. This should make the .pri files relocatable.

Fix the add_custom_commands to have the scripts as dependencies.
Make sure to pass the suffix, prefix and other options to the
qconfig.pri generation command as well.

Also reverse the order of the link flags, to mirror the order
that qmake generates for .pri files.

Task-number: QTBUG-84781
Task-number: QTBUG-85240
Change-Id: I7bc3b234d9c86c785b169b11f3042450aa225c1f
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
2020-06-29 12:23:05 +02:00
Alexandru Croitor
2ed63e587e CMake: WrapOpenGL target should also link AGL on macOS
This is consistent with the qmake mkspec in common/mac.conf

Task-number: QTBUG-85240
Task-number: QTBUG-84781
Change-Id: I99df365a3be541356482d29eda806020f4e298d9
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2020-06-29 12:23:00 +02:00
Alexandru Croitor
7fcc9cf055 CMake: Create a Find module wrapper for OpenGL
Our .prl files embedded an absolute path to the OpenGL.tbd file. This
obviously breaks their usage when used on another machine when no SDK
exists.

To fix that we need to use a "-framework OpenGL" linker flag instead
of linking against the absolute path library.
To convince CMake to do that, we have to create a wrapping
OpenGL target which sets an appropriate INTERFACE_LINK_LIBRARIES
property.

So create a FindWrapOpenGL find module to do that on darwin platforms.
Adjust helper.py and our build system to use it.

This tangentially amends 38cd18384f
because it recreates the FindWrapOpenGL module, but for a different
purpose.

Task-number: QTBUG-85240
Task-number: QTBUG-84781
Change-Id: I3498c19157ae31db5099e6edfb9d71490187f1d3
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
2020-06-29 12:22:49 +02:00
Edward Welbourne
cd74c867d3 Remove some long-deprecated methods of QLibraryInfo
Change-Id: If5e85f813921b44971ca8572858051b53e1127a8
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Reviewed-by: Sune Vuorela <sune@vuorela.dk>
2020-06-29 09:37:39 +02:00
Lorn Potter
f1638edf45 wasm: fix handling on int dead keys on mac
Q_OS_MAC is not defined when building wasm on mac, so we need
to use a runtime check.

Pick-to: 5.15
Change-Id: I1e9c5ec4e11aae94c9d8e918b5f1f1526723c782
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
2020-06-29 12:20:40 +10:00
Lorn Potter
4ed01f5d23 wasm: do not close QIODevice on error
Closing it early means the user may get this message when reading data
without checking for error:
'QIODevice::read (QNetworkReplyWasmImpl): device not open'

Change-Id: I377fc3da68e9d9f14f8504ace5addbb4f8e3c539
Fixes: QTBUG-85176
Pick-to: 5.15
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
2020-06-29 09:43:50 +10:00
Lorn Potter
0707b85cda wasm: search emscripten key first
This fixes key lookups with different keyboard layouts

Pick-to: 5.15
Fixes: QTBUG-84494
Change-Id: I18f1643331961d9bfc1ac6977181f8959e76449d
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
2020-06-29 09:39:19 +10:00
Mike Achtelik
76c3eee402 Remove pthread storage for thread local data
The thread specific QThreadData is currently referenced as a thread_local
variable and using a thread specific value via pthread_setspecific.

Having both is not necessary, as the pthread value is never directly accessed
and only used in the pthread destructor. Using a holder, we can achieve the same
and get rid of the pthread handling altogether.

This also fixes a bug, where the thread_local currentThreadData is already null,
when entering the pthread destructor. In this case it would lead to a new QThreadData
being created, when finishing an adopted thread.

Pick-to: 5.15
Change-Id: Ib23b840f804637e6b7cebd89016672a34a575380
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2020-06-28 19:12:32 +02:00
Joerg Bornemann
f6b7b64ed0 CMake: Adjust conversion scripts to iconv changes in qt5compat
Change-Id: I8e06a09768bd3554500d666273060d2e130965b8
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2020-06-28 17:17:02 +02:00
Joerg Bornemann
95244af2f9 CMake: Let qt_copy_or_install set the executable bit for PROGRAMS
In a prefix build, this function uses install(PROGRAMS) which correctly
sets the executable bit. In a non-prefix build, we did file(COPY)
without explicitly setting executable permissions.

Now, we're also setting the executable bit for
qt_copy_or_install(PROGRAMS) calls in non-prefix builds.

Change-Id: I283e9aeed2a23016ee196d83d584a7eaaa5edd66
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2020-06-28 17:16:29 +02:00
Joerg Bornemann
8c97ae0c1f CMake: Make the path variables in Qt6CoreConfigExtras.cmake relative
To be consistent with the Qt6HostInfo package, we're providing paths
without prefix in the variables like QT6_INSTALL_BINDIR.
The full path can be easily obtained by combining the relative path with
the QT6_INSTALL_PREFIX variable.

Also, the value of QT6_INSTALL_SYSCONFDIR was wrong. It usually is
located outside of the prefix.

Change-Id: I0035633a8c1c865d86d5ffc8b36565ceb2e7ea25
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2020-06-28 17:16:02 +02:00
Joerg Bornemann
a4f11fa99d CMake: Create Qt6HostInfo package
This package is supposed to be loaded when cross-building Qt from the
host Qt installation prefix. It provides information about the host Qt
by setting various variables. The information reflects what "qmake
-query" of the host Qt would return.

All provided variable names begin with "QT6_HOST_INFO_".

Change-Id: Id568923a318d6e3b48c450663519a3727f615a8f
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2020-06-28 17:15:30 +02:00
Richard Moe Gustavsen
040a7cfa93 macOS: Clean up modal sessions after each pass of processEvents()
The Qt macOS event dispatcher defers modal session cleanup until
the next runloop pass. But as it stood, we never did do so for
stand-alone qApp->processEvents() calls. The result was
that a NSModalSession would be kept alive longer than necessary, which
would impact the activation state of other QWindows.

Change-Id: I054f3084132c9d20a29a3f5823c19b7123ef40bf
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
2020-06-27 21:18:05 +00:00
Dimitrios Apostolou
33714b6c02 Adjust configure -cmake to accept both single and double dash arguments
This uses sed -E (extended regular expressions) to improve readability of
regular expressions. Shouldn't be a problem on most modern systems.

Change-Id: I12c9834c1ef83bf5f8547bccff655a6b8525cc3d
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
2020-06-27 02:58:24 +02:00
Dimitrios Apostolou
52a7d2e3a3 Fix configure -cmake -nomake examples -nomake tests
Change-Id: I4cea33ec5a231dc84805cb3e5052e662cc601749
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2020-06-27 02:58:16 +02:00
Dimitrios Apostolou
e3fe8524ed Fix -system-library and -qt-library arguments for configure -cmake
Change-Id: Ief19f2e8cb2996b7d09e2354328d30a67ad801fd
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2020-06-27 02:58:08 +02:00
Christian Ehrlicher
ab1e0961d4 QFileDialog: remove deprecated mode QFileDialog::DirectoryOnly
Change-Id: Ia06e80c1bbed3e5bb80793aebd0a4780eb81a36b
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
2020-06-26 22:40:34 +02:00
Alexandru Croitor
b0772b41c2 CMake: Display found information in some of the Find modules
Change-Id: I5d92f2f1a552888361a2939577c2b0177c62b596
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
2020-06-26 22:14:48 +02:00
Alexandru Croitor
fb5cf5be15 CMake: Fix some incorrectly included FindPkgConfig modules
This gets rid of a few warnings during configuration.

Task-number: QTBUG-85276
Change-Id: I07d2fdfd8d3f81f1d780528ee6350e1a3ded9523
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
2020-06-26 22:14:43 +02:00
Alexandru Croitor
cf3cef1ef5 CMake: Make more inner find_package calls quiet
Task-number: QTBUG-85276
Change-Id: I8ed84e2f2cdaf90224452a5e5a549791574edc15
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
2020-06-26 22:14:38 +02:00
Alexandru Croitor
2efd0fbc32 CMake: Add meta-target host_tools to easily build just the tools
A developer could write 'ninja host_tools' to build the qtbase tools
and their dependencies, and then configure another cross-compiling
build dir pointing to the previous host build. This shortens the
workflow for cross-building when working in qtbase.

Change-Id: I69e70d23ce9df8669bcadf326d0586f097e5cb21
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
2020-06-26 22:14:29 +02:00
Alexandru Croitor
3ef14c8943 CMake: Fix framework handling for .pri files
Rather than embedding the full absolute path to the framework, we
should instead write a -framework Foo flag.

qmake seems to do this by specifying QMAKE_LIBS_FOO in the mkspec.
We'll try to get away with just deriving the name of the framework
from the path, to avoid having to introduce a mkspec equivalent
mapping for CMake.

This doesn't currently handle framework include paths, which qmake
also handled by harcoding QMAKE_INCDIR_FOO in the mkspec, and then
sysrootifying it via mkspecs/common/mac/sdk.prf.
Hopefully that's not really needed, given that -framework flag
should imply include paths as well.

Somewhat partially amends c254254c55

Task-number: QTBUG-85240
Task-number: QTBUG-84781
Change-Id: I70ea5021422d7b1f5afa9c4a595d1a9b8a8217d3
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
2020-06-26 22:14:24 +02:00
Alexandru Croitor
167741717f CMake: Fix tst_qmake not to hang and re-enable it
We don't really know why, but using the ctest
--force-new-ctest-process flag stops the test from hanging.

Also re-enable the test.

Task-number: QTBUG-78449
Task-number: QTBUG-81365
Change-Id: I33094696dfe3f610dc257089074b1c2a9926f651
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
2020-06-26 22:14:09 +02:00
Alexandru Croitor
a2c772dc58 CMake: Use build environment prefix.bat when running tests
Tests like tst_qmake need the build environment to be able to build
apps / libraries. This is mostly needed for MSVC.

Set the TESTS_ENV_PREFIX env var to point to the proper prefix.bat
(host or target) and use that when running ctest.

Task-number: QTBUG-85240
Task-number: QTBUG-78449
Task-number: QTBUG-81365
Change-Id: I6fa68714202ac7fc703973fc772e03b84790a043
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
2020-06-26 22:14:04 +02:00
Joerg Bornemann
9a4391271b Remove superfluous define from tst_qmake
The QMAKE_CROSS_COMPILED define isn't used since 2011.

Change-Id: I9f03791e9f7c0ef439db5e65d930c0b7cb928974
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2020-06-26 21:24:52 +02:00
Joerg Bornemann
af61b5ca5c CMake: Fix tst_qmake::resources() on Windows
This test calls qmake on a project that generates a .qrc file. On
Windows, where debug_and_release is on by default, the generated qrc
file ends up in a "debug" or "release" subdirectory. On other
platforms the file is generated directly in the build dir.

To guess the right location, the preprocessor defines RELEASE_BUILD
and DEBUG_BUILD were passed to tst_qmake.cpp by the test's .pro file.
While the mapping from debug_and_release was fine for the .pro file,
it was commented out in the automatically converted CMakeLists.txt.

Instead of trying to fix the condition, we're going the easier route
that's used in all other .pro files of tst_qmake: make sure that
debug_and_release doesn't get in the way. In other tests this is done
by setting
    DESTDIR = ./
which doesn't work for the generated qrc file. That's why we simply do
    CONFIG -= debug_and_release
to make sure that everything is generated directly in the build dir.

Change-Id: I557ac4e21d7b385004d369fae8a3f727d76d4d88
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2020-06-26 21:24:50 +02:00
Giuseppe D'Angelo
b40f36603d QList: use =default for its default constructor
Change-Id: Id5270eac2464bf2d3810de18579d4dc295e98b38
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2020-06-26 20:51:21 +02:00
Eirik Aavitsland
95b5a56071 Improve deprecation message for QLine::angle(QLine)
angleTo() always gives an answer measured ccw, so between 0 and 360
degrees. The deprecated angle() would give either cw or ccw,
depending on which is smaller, so between 0 and 180 degrees.

Help users porting by showing a simple way to achieve the angle()
behavior in the deprecation message.

Change-Id: I66f77d2b4e688562e443428209737aa3332a448f
Pick-to: 5.15
Fixes: QTBUG-85087
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2020-06-26 13:24:17 +00:00
Eirik Aavitsland
1a63409579 QImageIO: use the new allocation checker in the format handlers
Change-Id: I604d99ce476d4758a1e20b78257082911f1f1546
Task-number: QTBUG-85037
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2020-06-26 15:24:05 +02:00
Eirik Aavitsland
5dea4fe956 Introduce a settable allocation limit on image loading
[ChangeLog][QtGui][QImageReader] Introduced a settable allocation
limit on image loading to limit resource usage from corrupt image
files.

Change-Id: Ibed7b0cac32798125a060e6db80b17ebc5e70759
Task-number: QTBUG-85037
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2020-06-26 15:23:58 +02:00
Tor Arne Vestbø
cc857a3c71 macOS: Remove examples for deprecated QMac(NativeWidget|CocoaViewContainer)
Change-Id: I60d694f868623ed9761baf0cf532a87ab3412208
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
2020-06-26 15:10:26 +02:00
Jarek Kobus
b043871d2b Use QList instead of QVector in opengl
Task-number: QTBUG-84469
Change-Id: I26c1cfab7f2d9aa5c71847ae02bfe0cf15c04a1b
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
2020-06-26 15:09:17 +02:00
Tor Arne Vestbø
f529f94132 macOS: Close popups on mouse down using synchronous QPA delivery
Change-Id: I5ccb5ca4f9b9f7a480c575c5a2710ec20361cf88
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2020-06-26 14:58:45 +02:00
Tor Arne Vestbø
cbd2973a19 cmake: Pick up custom Info.plist in user projects
We can't rely on the MACOS define as that's set by our private
QtPlatformSupport.cmake that's not shipped.

Change-Id: I86c578a282a0833408a06d923954510a3579bdaa
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2020-06-26 14:58:42 +02:00
Alexandru Croitor
554d40da58 CMake: Skip building tst_qprocess test when cross compiling
tst_qprocess hangs on the qemu armv7 configuration.

Task-number: QTBUG-85287
Change-Id: I5a77a81a24bb1bd315edfcf14f3bcbfd5b925e4d
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
2020-06-26 14:54:32 +02:00
Friedemann Kleint
7789c0dc86 SSL configure test: Fix confusing warning
Remove quote character, fixing:

Performing C++ SOURCE FILE Test HAVE_openssl_headers succeeded with the following output:
Run Build Command(s)
src.cxx 8 88: warning: missing terminating ' character
    8 | #  error OpenSSL was reported as >= 1.1.1 but is missing required features, possibly it's libressl which is unsupported

which makes one think the test failed.

Change-Id: I0ac02deee4282ef7c953186b820a31309e82b5e1
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
2020-06-26 14:49:08 +02:00
Laszlo Agocs
d8bf71026c Fix up QVulkanWindow docs
Pick-to: 5.15
Change-Id: I5a37a57245b8d859adf02810d3954e7532e4a475
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
2020-06-26 14:42:47 +02:00
Jarek Kobus
0e6f6507d5 Use QList instead of QVector in network
Task-number: QTBUG-84469
Change-Id: I7827da68e73ca8ff1e599c836f2157894c452b63
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
2020-06-26 14:42:43 +02:00
Laszlo Agocs
db61e43c81 rhi: Enable specifying just an adapter or phys dev
Required by OpenXR. A VkPhysicalDevice or an adapter LUID + feature
level pair should be adoptable while leaving the rest (device, queue,
etc. setup) to QRhi as normal.

Change-Id: Iada0972671b037b4efb03e7831b7c9b8c5f2393d
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
2020-06-26 14:42:42 +02:00
Laszlo Agocs
b60f516aca Fix qsizetype fallout in rhi manual tests
Change-Id: I574a2930b5eeb4b3e1f3c6fca6d70dbda64ec324
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
2020-06-26 14:42:36 +02:00
Assam Boudjelthia
6f837d6f07 Android: fix QDesktopServices::openUrl() error for file scheme path
If the url is a "file:" scheme url don't check for permissions
which the file won't have, and then disable StrictMode for API >= 24
to be able to pass the "file:" path to the openUrl intent.

Pick-to: 5.15
Fixes: QTBUG-67877
Change-Id: Ia3fecc24a67069dc76f866455277bf8b929e7697
Reviewed-by: Andy Shaw <andy.shaw@qt.io>
2020-06-26 12:41:42 +00:00
Tor Arne Vestbø
c644dc9700 cmake: Match tense of other log output
Change-Id: Ied164c97bd54f6b37450d7a2cf8225ee5190ce17
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2020-06-26 14:41:42 +02:00
Lars Knoll
e81330d327 Add explicit encode()/decode() methods to QStringConverter
The functional style interface is nice, but does feel alien in some
contexts, so better also have explicit encode and decode methods.

Change-Id: Ic07ced15f65cdb3a7f1cf044041e341d2ef87f79
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
2020-06-26 14:41:42 +02:00
Robert Loehning
873c099788 Fuzzing: Add fuzz target for QCryptographicHash::result
Pick-to: 5.15
Change-Id: Ifc12358dd8cb932fe62c13975554d753a4f1afd9
Reviewed-by: Albert Astals Cid <albert.astals.cid@kdab.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2020-06-26 14:41:42 +02:00
Giuseppe D'Angelo
d4bce57340 Unexport QModelIndex
It is entirely inline.

Change-Id: I626d6e4f6338dabfcc1e34127c898ed13c5a513b
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
2020-06-26 14:41:41 +02:00
Tor Arne Vestbø
28f6892717 macOS: Check that platform window is valid after delivering close event
Fixes: QTBUG-78814
Pick-to: 5.15
Change-Id: I551024c5d777999f7c79d21fd7b7de061c18f971
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
2020-06-26 14:41:41 +02:00
Thiago Macieira
e7d76d79e8 QThread: Fix unnecessary stricter accesses to QThreadData::thread
Commit ec6556a2b9 changed the member from
a plain pointer to a QAtomicPointer. Not all accesses were caught.

Pick-to: 5.15
Change-Id: I3d4f433ff6e94fd390a9fffd161b4ff25508c48d
Reviewed-by: David Faure <david.faure@kdab.com>
2020-06-25 18:03:34 -07:00
Jarek Kobus
48c8322a61 Use QList instead of QVector in dbus
Omitted type replacement in qDBusParametersForMethod() for now.

Task-number: QTBUG-84469
Change-Id: Ieb9fbb30b431c5e4183ad57acd35640e9556bf6c
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2020-06-25 22:31:13 +02:00
Jarek Kobus
0475460102 Use QList instead of QVector in corelib
Applied to headers only. Source file to be changed separately.
Omitted statemachine for now to avoid conflicts.
Omitted qmetatype.h for now - to be handled later.

Task-number: QTBUG-84469
Change-Id: I317376037a62467c313467d92955ad0b7473aa97
Reviewed-by: Sona Kurazyan <sona.kurazyan@qt.io>
2020-06-25 22:30:59 +02:00