Commit Graph

46503 Commits

Author SHA1 Message Date
Joerg Bornemann
3ac054d6a8 CMake: Re-work configure flags for CMake generators
Remove the -cmake-makefiles configure argument as its meaning was in
essence "do not pass a -G argument to CMake".
Instead, we add the following arguments:
    -cmake-generator <name> to pass -G <name> to CMake
    -cmake-use-default-generator to pass no -G argument to CMake

If none of those arguments is given, we try to autodetect the
generator. If a ninja executable is found, we prefer the Ninja
generator. On Unix we fall back to "Unix Makefiles".
On Windows, we do a poor man's compiler detection and select one of
"NMake Makefiles", "NMake Makefiles JOM" and "MinGW Makefiles".

Change-Id: Ic36669bd50956d15fbc71cee73720732cd4bfab8
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2020-07-06 17:43:35 +02:00
Joerg Bornemann
dbd3c75965 CMake: Teach configure.bat the -cmake argument
The configure scripts need to translate configure options to CMake
arguments. It is not sensible to implement this translation twice, in
sh and Windows batch language, so we're doing this once, in CMake
language.

The configure scripts write their options into config.opt and call a
CMake script that reads config.opt, does the translation to CMake
arguments and calls CMake to generate the build system.

While we're at it, implement some more translations than the sh
configure provided, like -extprefix, -top-level and -skip.

Fixes: QTBUG-85349
Fixes: QTBUG-85350
Task-number: QTBUG-85373
Change-Id: Ida5d8b2a3c178b9349d41ec76d190c69a9456e74
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2020-07-06 17:43:28 +02:00
Friedemann Kleint
ffb8464cef Windows: Fix trailing blank in native file dialog filter
Strip trailing blanks when not filtering by suffix.
Amends 76735f3fa0.

Pick-to: 5.15
Fixes: QTBUG-85423
Task-number: QTBUG-42405
Change-Id: Ic13a4e7718f7f1935b1fc329a7beaf1d357fd44d
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
2020-07-06 13:57:03 +00:00
Tor Arne Vestbø
f02dde3d74 Simplify QMainWindow::setUnifiedTitleAndToolBarOnMac
Task-number: QTBUG-83252
Change-Id: Ib6f7dcfe21407603d4cfd5d33f6615d8623db940
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2020-07-06 15:48:23 +02:00
Orgad Shaneh
04739ce4b4 Qmake: Share QMAKE_LINK_OBJECT_SCRIPT definition
It is only used by default on Windows, but can be enabled by setting
QMAKE_LINK_OBJECT_MAX.

The current file name is .project_name.

Use a sensible file name on this case.

Change-Id: Ic250d024e5feca739027c79a6e285d616234c4ea
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
2020-07-06 16:44:11 +03:00
Tor Arne Vestbø
de307a8ece Remove documentation reference to standalone KMS plugin
Change-Id: Idfc714340703af3faea17d2f1c4933902710f36d
Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
2020-07-06 15:43:13 +02:00
Orgad Shaneh
4c20a35cd9 MinGW: Use a response file for long include paths
Change-Id: I55ce73ad08473bca27c7ab5730f633fb77c9b8cd
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
2020-07-06 13:41:37 +00:00
Tor Arne Vestbø
1f0299b029 Remove OpenWFD platform plugin
It was added in 2011 and has not seen any development since, and was
never included in the build system.

The OpenWFD use-case is covered by EGLFS, which has a dedicated
OpenWFD backend.

Change-Id: Id08c505e2d869a96255163cae2ede51b9efeb73f
Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
2020-07-06 15:41:25 +02:00
Orgad Shaneh
cd75446c1e Makefile: Deduplicate logic for response file name
+ verify that the file was actually written.

Change-Id: I14a3c0b75f41f926b469109a1d7f2f80368ec9bb
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
2020-07-06 13:40:45 +00:00
Andy Shaw
96cea3b168 Export the letter and word spacing settings set on the default format
When the default format has letter and word spacing set then these
should be exported in the HTML's body tag. This also adds support
for the reading of letter-spacing and word-spacing set too, so that
the same html outputted can be read back in.

Fixes: QTBUG-83718
Change-Id: Ic4afca21eb05efb779dbf99c6b3c13373e851f15
Pick-to: 5.15
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2020-07-06 14:35:57 +02:00
Jarek Kobus
60c6f4a51a Use QList instead of QVector in statemachine
Task-number: QTBUG-84469
Change-Id: I2b1399c34ebcc2237ca2662d97b54e81f11cb7af
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
2020-07-06 14:06:13 +02:00
Timur Pocheptsov
c163ec1dbf qnetworkproxy_mac - do not use the deprecated API
CFURLStringByAddingXXX was deprecated, so we use QUrl combined
with existing QString-based converters (from/to CFStringRef).

Pick-to: 5.15
Task-number: QTBUG-83992
Change-Id: I6f1a3fdafa9532bb7816a1262169df3421169cb7
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2020-07-06 13:54:11 +02:00
Jarek Kobus
1e25b81e0d Use QList instead of QVector in plugins
Task-number: QTBUG-84469
Change-Id: Ic86f4a3000592a1c9ae62e4a83f4fe39832a6b24
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
2020-07-06 13:43:20 +02:00
Jarek Kobus
23b7e7972e Use QList instead of QVector in platformsupport
Task-number: QTBUG-84469
Change-Id: I8e4e6626cc840bc9c8bce014c595da9080025dd8
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
2020-07-06 13:43:11 +02:00
Giuseppe D'Angelo
75deec3462 QMake: fixup a mistake when porting to QRE
The original expression seems to have been accidentally
changed during the port.

Amends a1947aeffe.

Change-Id: I87821e1e025621a5efaf7a1e4f946fd3109fb256
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
2020-07-06 13:35:29 +02:00
Jarek Kobus
d17f259174 Use QList instead of QVector in printsupport
Task-number: QTBUG-84469
Change-Id: I540b5574e358b100a595eb1676b051dfe25cb640
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
2020-07-06 13:20:55 +02:00
Joerg Bornemann
860220bd33 CMake: Re-run tests in CI like we do for the qmake build
The test runner re-runs failing tests up to 5 times. We did not do this
for the CMake build, and now we're getting lots of flaky tests failing.
Fix this by passing the -repeat until-pass:5 parameter to ctest.

Change-Id: I6ff3c1e7901bc22cafec87b15d087eab2a565c65
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2020-07-06 12:17:51 +02:00
Shawn Rutledge
546e44d473 Add QInputDevice::availableVirtualGeometry()
This property tells what part of the virtual desktop the input device
can access.

This is not a one-to-one mapping with a QScreen, because a Wacom tablet
might be configured to access a whole desktop, a whole screen, or an
area corresponding to the drawing area of one window; a mouse normally
can access the whole desktop (so QScreen::virtualGeometry() would be
identical to QInputDevice::availableVirtualGeometry()); a touchscreen
normally is mapped to one screen but could be mapped differently; etc.
It's possible to find the intersection of the rectangular area with the
screen(s) that it overlaps, though.

Task-number: QTBUG-78839
Change-Id: I9040e20fb5a3dec8a9a0dd827735826c4c1eea38
Reviewed-by: Jan Arve Sæther <jan-arve.saether@qt.io>
2020-07-06 10:09:02 +00:00
Tor Arne Vestbø
8dd6957cd7 Make QtPlatformHeaders a private module
The APIs will be reintroduced as part of the new platform interface
API where appropriate.

Clients that still depend on the platform headers can include it
via QT += platformheaders-private.

Change-Id: Ifbd836d833d19f3cf48cd4f933d7fe754c06d2d9
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2020-07-06 11:52:14 +02:00
Lars Schmertmann
18cfabafa6 Remove unnecessary ; after function implementations
Task-number: QTBUG-82978
Change-Id: Iea3bcaec1ef9f4bd0f73e5dccca33354650f5bf4
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2020-07-06 11:46:39 +02:00
Lars Schmertmann
11b3092cc4 Refactor tst_Collections
This improves the readability and avoids code duplication
in tst_Collections::forwardDeclared. Also some warnings
are fixed:
* qSort is deprecated.
* The = operator for LargeStatic needs to be implemented
  explicitly when a copy constructor is given.
* QMap::insertMulti is deprecated, a MultiMap is required.

Task-number: QTBUG-82978
Change-Id: I577f851394edfaa30154bd3417ce391635cc546d
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
2020-07-06 09:42:36 +00:00
Lars Knoll
a5025efccf Fix a crash in QClipBoard when copying utf16 data
Properly use the new QStringConverter API and not an internal
qFromUtfEncoded method that was buggy after the changes.

Take the oppportunity to clean up and remove qFromUtfEncoded, as
QClipboard was its only user.

Fixes: QTBUG-85417
Change-Id: I8540d12056bf3f448c1f628ce0bd0ad462a6447d
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
2020-07-06 11:31:43 +02:00
Lars Schmertmann
cd67fe5821 Cleanup qtestspontaneevent.h for Qt 6
This change is motivated by the comment from bc087db59:
Qt 6: remove everything except QSpontaneKeyEvent::setSpontaneous()

Task-number: QTBUG-82978
Change-Id: I5f46ca366c193c06235f88022ec22c6848fbb7b0
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2020-07-06 09:30:22 +00:00
Lars Schmertmann
4d661884d9 Use Q_DECL_UNUSED_MEMBER instead of Q_UNUSED
Task-number: QTBUG-82978
Change-Id: I7ff71e10b61cf5c2528ebef81cc49c648385fc33
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2020-07-06 11:29:39 +02:00
Friedemann Kleint
9e733622a6 Move linuxaccessibility to QtGui
Change some too-generic file names.

Task-number: QTBUG-83255
Change-Id: I4497ee2508bc323566f4061d4547707b7bda7a77
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2020-07-06 11:15:08 +02:00
Alexandru Croitor
7067b2ca6e CMake: Don't propagate private defines for Qt header modules
Interface libraries like our Qt header modules should not propagated
private defines which are meant only for building a specific Qt
module, and in the case of a header module there is nothing to build.

Exclude the usual private defines we set in qt_add_module for header
modules. This also fixes the content of header module .pri files.

Change-Id: I0791ebdb73e8b020ddb8116433ed36c7b3d71303
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2020-07-05 13:54:02 +02:00
Friedemann Kleint
864466d2e5 Move xkbcommon to QtGui
Task-number: QTBUG-83255
Change-Id: Ia1c6a49af6be4aaa6b988537c38db3a2c0a646a5
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2020-07-04 20:46:07 +02:00
Mike Achtelik
90f1ef14aa Fix workaround in pthread destructor
Amends dcdfb6908d which failed to take the
workaround in destroy_current_thread_data into account.

Since pthread_getspecific was completely replaced with the thread_local variable
currentThreadData, the workaround has no effect anymore. Therefore we need to
replace it with a workaround that makes sure currentThreadData is set inside of
the destructor function.

This prevents a leak, where QThreadPrivate::finish() tries to access the
thread data, but since it already is null, recreates it without ever deleting it.

Pick-to: 5.15
Change-Id: I3811d262a411a6bde9d6eb90f8d17e0bbc5de657
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2020-07-04 17:56:11 +02:00
Paul Wicking
f172f0dee9 Doc: Fix connect syntax in snippet
Pick-to: 5.15
Fixes: QTBUG-85390
Change-Id: I67dbacd977acb6abdafb3b57818f24bf4a2dd302
Reviewed-by: Nico Vertriest <nico.vertriest@qt.io>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2020-07-04 08:10:03 +02:00
Volker Hilsheimer
a10bf2ec5a Improve data member ordering and initialization in some private classes
Put bit fields together, and generally order by size to maximize the
compiler's ability to pack data. Initialize in declaration where
possible.

Change-Id: I49d4a3d2271229d671aeaf3eb17e6b7ecdc5099e
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
2020-07-04 02:51:35 +02:00
Lars Schmertmann
ae890390e5 Avoid use of Q_UNUSED by eliminating the parameter names
This change only happens to files touched
by the commit to add missing ; to Q_UNUSED.

Task-number: QTBUG-82978
Change-Id: I10e6993a2bb3952cf9a262708b8573550e0dbe63
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
2020-07-03 21:10:09 +02:00
Tor Arne Vestbø
af3f5b8746 CMake: Re-run pro2cmake on gui, platformheaders
platformsupport and plugins/platforms

Change-Id: Id123bc4165387aa867bf4b61ffc3e9dabc2d4780
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2020-07-03 15:48:03 +02:00
Alexandru Croitor
ab8b8c96ef CMake: Regenerate rest of projects under src/
Change-Id: I7d7692306a80deb9e8d2a90454dad4b39320f380
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2020-07-03 15:47:48 +02:00
Alexandru Croitor
7c51f7ccc5 CMake: Enable enforcing CI tests in qtbase
Any failing tests in CMake configurations will now prevent
integrations to go through in the qtbase repository.

Task-number: QTBUG-84886
Change-Id: I8c963cb2540a29a9c8702acd3d282da82fb521e7
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2020-07-03 11:14:11 +02:00
Alexandru Croitor
0423814a2f CMake: Add support for enforcing passing CI tests per repository
Create a new test instructions yaml template that does not ignore the
exit code of running tests. This template can be included by
repositories where tests pass in all configurations tested by the CI.

The template should be included in module_config.yaml via

Test:
    - !include "{{qt/qtbase}}/coin_module_test_template_v3.yaml"

This allows us to opt into enforcing test runs per repository,
rather than waiting to fix all tests in all qt5.git repositories.

Implementation notes

Try to extract the common parts of the instructions as much as
possible to avoid duplication. Unfortunately some duplication still
remains due to the restricted yaml language supported by Coin.

Add a short README.md file that describes the differences between the
existing templates.

The v2 non-enforcing test template should probably be removed in
the future.

Task-number: QTBUG-84886
Task-number: QTBUG-85364
Change-Id: I718fc3cb44d6aefdbebc2fd2088a910a8095a375
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
2020-07-03 11:14:11 +02:00
Tor Arne Vestbø
939f5112a1 androiddeployqt: Fix format specifier warnings
Fixes: QTBUG-85344
Change-Id: I298370ef04b9be502c54bfee729e97379ad81231
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Reviewed-by: Andrei Golubev <andrei.golubev@qt.io>
2020-07-03 11:14:11 +02:00
Tor Arne Vestbø
7b2cc3fc75 macOS: Fix mapping of Qt to Carbon modifiers with AA_MacDontSwapCtrlAndMeta
The macOS platform plugin function toCarbonModifiers is based on a
mapping table with already swapped modifiers, where Qt::MetaModifier
maps to controlKey.

We were using the Carbon fooKeyBit constants instead of the fooKey
constants, so the logic for mapping from Qt to Carbon modifiers
when AA_MacDontSwapCtrlAndMeta was set to true would fail to reverse
the swap from the mapping table.

Since the command and control modifiers rarely produce different
unicode characters from the base keyboard layout, at least not in
the tested key layouts, and the AA_MacDontSwapCtrlAndMeta is not
commonly used, this bug was not that visible.

The logic maintains the behavior of mapping a single Qt modifier
to multiple Carbon modifiers (both left and right command e.g.).
This is a bit weird, but existing behavior that should be looked
at in a followup.

Change-Id: I8b30854770d1230a47f5144bf3245d0ac1493b51
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
2020-07-03 11:14:11 +02:00
Lars Schmertmann
fdc5e91dcf Only use one macro per line
Also add a ; where it is missing.

Task-number: QTBUG-82978
Change-Id: Ic5d2a07363c25ab641d234baca89bc62238458cb
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2020-07-03 11:14:11 +02:00
Friedemann Kleint
2eea8e0754 QDBusReply<void>: Fix warning about implicit copy constructor
Provide a copy constructor, fixing:

src/corelib/kernel/qmetatype.h:2702:11: warning: implicitly-declared QDBusReply<void>::QDBusReply(const QDBusReply<void>&) is deprecated [-Wdeprecated-copy]

Pick-to: 5.15
Change-Id: I725be78ace9d1b31fa2de9a23a82f92d5969dc27
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2020-07-03 05:39:35 +00:00
Friedemann Kleint
3fb31819fd Windows QPA: Refactor touch device creation
There was duplicated code in QWindowsMouseHandler::ensureTouchDevice() and
QWindowsPointerHandler::ensureTouchDevice() which caused deprecation
warnings since the setters of QInputDevice were deprecated.

Join the 2 functions into a single creation function and add simple getters
and setters.

Fix deprecation warnings:
qwindowscontext.cpp:357:108: warning: 'void
QPointingDevice::setCapabilities(QInputDevice::Capabilities)' is deprecated: Use the constructor
qwindowsmousehandler.cpp:132:97: warning: 'void QPointingDevice::setType(QInputDevice::DeviceType)' is deprecated: Use the constructor
qwindowsmousehandler.cpp:136:41: warning: 'void QPointingDevice::setCapabilities(QInputDevice::Capabilities)' is deprecated: Use the constructor
qwindowsmousehandler.cpp:137:49: warning: 'void QPointingDevice::setMaximumTouchPoints(int)' is deprecated: Use the constructor

Change-Id: Iab5385e84d600e45b60f38225175f25ef043c3eb
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
Reviewed-by: André de la Rocha <andre.rocha@qt.io>
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
2020-07-03 07:39:14 +02:00
Tor Arne Vestbø
39d99c714b Fix no-OpenGL build after introducing QOpenGLContext platform interface
Change-Id: I355f43c200adb3a12e71e0b02aa10060672bb9e4
Reviewed-by: Nodir Temirkhodjaev <nodir.temir@gmail.com>
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
2020-07-03 00:21:38 +02:00
Volker Hilsheimer
dd34ac5c34 Keep track of mouse button state in QTabBar
Get rid of call to QGuiApplication::mouseButtons

Task-number: QTBUG-73829
Change-Id: I7cc706b5e037c68ecf3c778b824ae8c93e5cfe38
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
2020-07-02 22:43:07 +02:00
Volker Hilsheimer
01d30f8399 Pass modifier and button information down the call stack
Gets rid of calls to QGuiApplication::mouseButtons and
QGuiApplication::keyboardModifiers.

Task-number: QTBUG-73829
Change-Id: Idba978fe8db21622ca05c4882c74fd2792b119e5
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
2020-07-02 22:42:49 +02:00
Volker Hilsheimer
117a5aa744 Maintain keyboard modifier state in QAbstractSpinBox's input event handlers
Gets rid of calls to QGuiApplication::keyboardModifiers. Need to handle
key and mouse events, since the spin buttons may be clicked on without
the spinbox having focus.

Task-number: QTBUG-73829
Change-Id: I455c42987f19bb5b7997dc8d61272863d7bc394e
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
2020-07-02 22:42:25 +02:00
Jarek Kobus
2a6cdec718 Use QList instead of QVector in widgets
Task-number: QTBUG-84469
Change-Id: I3007734f8e4f164ece9dd8850ef007cbef9e12ef
Reviewed-by: Maurice Kalinowski <maurice.kalinowski@qt.io>
2020-07-02 21:57:06 +02:00
Lars Schmertmann
d4c04acc65 Remove deprecated empty macro
Change-Id: Ib2a646ee22a7f97dae584e6f068f17378fe2b494
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
2020-07-02 20:51:52 +02:00
Alexandru Croitor
1b7a0bcbb5 CMake: Fix non-prefix builds
QT_WILL_INSTALL was set to ON, because an incorrect comparison was
done.

Amends 062318feb2

Change-Id: I201aa2a183563ce05077c36ac2ba3bd61cc827c0
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
2020-07-02 20:40:33 +02:00
Thiago Macieira
0d55d1c640 Doc: improve documentation about QVariant to JSON lossy conversions
Fixes: QTBUG-85299
Pick-to: 5.15
Change-Id: I24006db8360041f598c5fffd161c77638a54a27e
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
2020-07-02 10:32:13 -07:00
Volker Hilsheimer
634ce491e8 Manage keyboard modifier state in QPlainTextEdit
Gets rid of a call to QApplication::keyboardModifiers, at the expense
of some more bytes in QPlainTextEditPrivate.

Task-number: QTBUG-73829
Change-Id: I0394cb773034e832cffe5fa643ac308493f815b4
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
2020-07-02 19:28:29 +02:00
Tor Arne Vestbø
b5ae228aa0 macOS: Simplify QCocoaKeyMapper::(to/from)CocoaKey
Change-Id: I8daf735e9b49b24b8144b2aab8966b6313dfa3fa
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
2020-07-02 15:35:18 +02:00