Commit Graph

47746 Commits

Author SHA1 Message Date
Andreas Buhr
3a1dad83ed [QtCore] QDateTime: switch from newRow to addRow in unit tests
Instead of doing string formating first and then using QTest::newRow,
we can do both at the same time using QTest::addRow

Change-Id: Ia5c90eb705a806e37b96a1fa174a6557f91bee6d
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Andrei Golubev <andrei.golubev@qt.io>
2020-09-11 06:12:13 +02:00
Andreas Buhr
1ab2d8f5eb [QtCore] Adapt QDateTime unit tests to use QByteArray
To not have to bother with encodings, a few QStrings are changed
to QByteArrays. This way, a few calls to QString::fromLatin1 and
to QString::toLocal8Bit can be removed

Change-Id: Ia0cf27fc2a86f9842ed0f3ebe47b050bb8a3f4e6
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Andrei Golubev <andrei.golubev@qt.io>
2020-09-11 06:12:04 +02:00
Joerg Bornemann
7ddb4dcad5 CMake: Implement configure -qpa
Change-Id: I38a938cda91a525d2af22deec864c6a12af3e29d
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
2020-09-11 00:41:20 +02:00
Joerg Bornemann
69004cb290 Do not expose xlib as public dependency of QtGui
Consumers of QtGui should link explicitly to xlib if needed.

Fixes: QTBUG-86421
Change-Id: Ibc94eb1c1ac405b53749b320c388b037bf693a08
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2020-09-11 00:41:13 +02:00
Joerg Bornemann
0f4422113c Do not expose ATSPI as public dependency of QtGui
This was always a compile-only dependency and atspi includes are only
used in private headers. The atspi headers can never be a requirement
for consumers of QtGui.

In Qt5 this code was part of the QtLinuxAccessibilitySupport private
module, and for that module the atspi dependency was public. This only
affected users that explicitly instructed qmake to pull in the
linuxaccessibility_support-private module.

Task-number: QTBUG-86421
Change-Id: I23c6a1c466f86b2015dde13fca605fd26299c9db
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2020-09-11 00:41:11 +02:00
Joerg Bornemann
457cf10f7e CMake: Introduce qt-configure-module
Add a convenience script to configure a Qt module separately.
This script reads and interprets the qt_cmdline.cmake files of the
Qt module to be configured and eventually calls qt-cmake-private.

Example usage:
<install-prefix>/bin/qt-configure-module <source-root>/qtdeclarative
  -qml-network -- --trace-expand --trace-redirect=cmake.trace

Change-Id: I026f1a050cd3f4df740611c32ba8c03161bba7a3
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
2020-09-11 00:41:10 +02:00
Joerg Bornemann
c30ea1f412 CMake: Re-generate src/gui/CMakeLists.txt
Change-Id: Id2666c3021bcfbeec0e661129c7998977411aaee
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2020-09-11 00:41:08 +02:00
Joerg Bornemann
36a5cd0ac1 Fix markdown syntax in cmake/README.md
Make this file parsable by tools that are less lenient than github.
Triple-backquotes are for fenced code blocks. Inline code uses backticks
(or double backticks if you have code with backticks).

Change-Id: Ic49d946fbcaa6f7e97702eadf4a0b0c726fc3217
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2020-09-11 00:40:53 +02:00
Joerg Bornemann
069fc33e8a Remove the -no-compile-examples configure switch
If '-make examples -no-compile-examples' was specified, sources of Qt's
examples would be installed, but the examples would not be built.

This switch has always been a source for confusion and is only
interesting for distributors, who can just package the examples
directory tree.

Change-Id: I0291d70e4951d98b553a4abf217db49d05316d3a
Reviewed-by: Kai Koehne <kai.koehne@qt.io>
2020-09-11 00:40:46 +02:00
Lars Knoll
6ae7a02104 Remove most compiler warnings about missing overrides
Remove around 1000 compiler warnings about missing overrides
in our auto tests.

This significantly reduce the compiler warning noise in our auto
tests, so that one can actually better see the real problems
inbetween.

Change-Id: Id0c04dba43fcaf55d8cd2b5c6697358857c31bf9
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2020-09-11 00:20:47 +02:00
Lars Knoll
459e8dfdfb Document that this method got added in 6.0
Change-Id: I6a7f35f81b9df83f911781516ec7e0ed82e09303
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2020-09-11 00:12:59 +02:00
Jarek Kobus
e15153a738 tst_QTimer::remainingTime(): get rid of QTest::currentTestFailed()
Looks this is redundant in fact and unneeded. The check can never be
evaluated to true, since if so, it would mean it had failed in the
previous iteration, in which we already handled the exit from the loop.

Fixed also some comments.

Task-number: QTBUG-83419
Change-Id: I4fe56bfac39cd58b1166967f3ccb80cdff882748
Reviewed-by: Andrei Golubev <andrei.golubev@qt.io>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2020-09-10 20:08:12 +02:00
Mårten Nordheim
219ed70957 QAuthenticator(Negotiate): Try provided credential
Windows only so far, need a similar patch for *nix, or an alternate
approach when there is no server set up.

Pick-to: 5.15
Task-number: QTBUG-85123
Change-Id: Iff7a6b1540a2f1984153a237eea07c7bb1970064
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
2020-09-10 19:23:17 +02:00
Mårten Nordheim
b41a7afb00 QAuthenticator: Don't use Negotiate if unsupported
If we compiled without support for it then we shouldn't consider it an
option either.

Pick-to: 5.15
Change-Id: If6e0a6afa738f375e360bf3d439196b39e47bee8
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
2020-09-10 19:23:15 +02:00
Lars Knoll
287d2d7753 Get rid of qtconcurrentexception.h
It only contained two aliases that have been deprecated
since 2012.

Change-Id: I6f65aa5144aca2d8d99f8a6e586b805f685afad2
Reviewed-by: Sona Kurazyan <sona.kurazyan@qt.io>
2020-09-10 18:55:55 +02:00
Mårten Nordheim
8a3847aab9 QNAM: Enable HTTP/2 by default
It has been in Qt for some years now and 6.0 marks a good point to
enable it by default. The exception is connectToHostEncrypted where we
still require the users to enable it explicitly since there's no logical
way to disable it.

[ChangeLog][QtNetwork][QNetworkAccessManager] HTTP/2 is now enabled by
default.

Fixes: QTBUG-85902
Change-Id: Ia029a045727cc593d77df9eb3a5888522ad19199
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
2020-09-10 18:28:43 +02:00
Paul Wicking
00d9a0ea8e Doc: Compile snippets only when running tests
Turn snippets projects into subdirs with libraries to avoid
messy dependencies.

Fixes: QTBUG-86497
Pick-to: 5.15
Change-Id: Idb2c43f97d56c9b8d9992617ef716bde40fff5b7
Reviewed-by: Venugopal Shivashankar <Venugopal.Shivashankar@qt.io>
2020-09-10 18:26:43 +02:00
Paul Wicking
e7c15a60ea Doc: Clean up widget snippets project
The main snippets project must be a subdirs project.
Move some files and update the affected documentation.

Task-number: QTBUG-86497
Pick-to: 5.15
Change-Id: I60073d1b8bd53aa09600eeccf06ba8457ac7c708
Reviewed-by: Venugopal Shivashankar <Venugopal.Shivashankar@qt.io>
2020-09-10 18:26:39 +02:00
Joerg Bornemann
8a2ca17b2d CMake: Fix generation of XXX_tracepoints.cpp
The include directive was incorrectly written.
This amends 5c092c2b40.

Change-Id: Ia72ca3a5d5e1486ade4d71a764550d36979640f6
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2020-09-10 18:06:06 +02:00
Joerg Bornemann
4c8e231568 CMake: Fix race condition in -trace configured build
qt_create_tracepoints(Core) creates a dependency from Core to
Core_tracepoints_header, but the helper library Core_qobject also uses
qtcore_tracepoints_p.h and must therefore depend on
Core_tracepoints_header too.

This amends 5c092c2b40.

Change-Id: I0ed51f3ab9accea00f524c170cd319bb8af11df7
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
2020-09-10 18:06:00 +02:00
Joerg Bornemann
2a9ef0ecee CMake: Fix call to tracegen when cross-compiling tools
We need to use the imported host tracegen target to generate files, not
the one we're going to cross-build.

This amends 5c092c2b40.

Change-Id: Ib74dd2d87110383c31216872eb55bebf5d90df37
Reviewed-by: Samuli Piippo <samuli.piippo@qt.io>
2020-09-10 18:05:54 +02:00
Joerg Bornemann
b5234817f1 Introduce QProcess::startCommand(QString, OpenMode)
The removal of the QProcess::start(QString, OpenMode) leads to more
porting work than anticipated. A call like

    QProcess p;
    p.start(cmdline);

must be transformed in the following cumbersome way:

    QProcess p;
    QStringList args = QProcess::splitCommand(cmdline);
    QString program = args.takeFirst();
    p.start(program, args);

This patch revives QProcess::start(QString, OpenMode) and renames it to
QProcess::startCommand. This is still source-incompatible, but the
transformation is much simpler:

    QProcess p;
    p.startCommand(cmdline);

[ChangeLog][QtCore][QProcess] Added QProcess::startCommand(QString,
OpenMode) as replacement for the removed QProcess::start(QString,
OpenMode).

Change-Id: I5499bbb39a025e115042c43a4cc63affddae585c
Reviewed-by: hjk <hjk@qt.io>
2020-09-10 18:05:28 +02:00
Joerg Bornemann
d774930891 CMake: Re-generate configure.cmake files
Change-Id: I9c325db8031e14cf2a2cfb49e5080e3043a0811a
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
2020-09-10 18:05:22 +02:00
Joerg Bornemann
74c48f0864 configurejson2cmake: Handle expressions of the form "foo != 0"
Such expressions were translated to "foo NOT = 0" which is invalid code.

Change-Id: I8b485bfe1d1f553c08df3b5d59b0f39f2dcbd5c0
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
2020-09-10 18:05:16 +02:00
Joerg Bornemann
6b363bbde3 CMake: Document more configure argument mappings
Change-Id: I4f96fd59566d011088e426342db9cc6536d63a71
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2020-09-10 18:05:10 +02:00
Assam Boudjelthia
298413de77 Android: use bin for instead of QT6_HOST_INFO_BINDIR
${QT6_HOST_INFO_BINDIR} is returning an empty string making
the tools paths unusable, and android apps building fails.

Partially revert 09ac1bdfc5.

Task-number: QTBUG-86557
Change-Id: I1522b3a4b45fbcb41894ea3bd7c714f7a79eb954
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2020-09-10 15:42:25 +00:00
Lars Knoll
c4dbd1cddc Cleanup ProString::append/prepend
Don't use evil hacks that make assumptions
about QString internals.

Change-Id: I663602d197f0fcf62886dbfb9a87547097cdab04
Reviewed-by: Andrei Golubev <andrei.golubev@qt.io>
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
Reviewed-by: Kai Koehne <kai.koehne@qt.io>
2020-09-10 17:36:10 +02:00
Michael Brüning
ac310d5b23 [macOS] Add native virtual key code to modifier keys
Not forwarding the native virtual key code when sending key events
in the flagsChanged handler caused a number of problems, e.g. the
inability to determine which of the Alt or Shift keys were pressed.

Use handleExtendedKeyEvent to include the native virtual key code.

Patch inspired by Nyan Pasu.

Fixes: QTBUG-69608
Change-Id: I15e9ff1069528d4b50ee4638ab2d8a6fd279db0b
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2020-09-10 17:33:21 +02:00
Mitch Curtis
a4e4436e85 Doc: explain how to blacklist QML tests on certain platforms
Change-Id: Icd505175805820c64593d7eb8f580a51008e2e1a
Pick-to: 5.15 5.12
Reviewed-by: Daniel Smith <Daniel.Smith@qt.io>
2020-09-10 17:32:34 +02:00
Timur Pocheptsov
4f658d04da Fix a rather sloppy test case in tst_QSslKey
It's not guaranteed that all curves we want to use are supported
by a specific build of OpenSSL library we have to link with. Filter
out files that contain EC, which is not among the curves, reported
by QSslConfiguration::supportedEllipticCurves.

Fixes: QTBUG-46203
Pick-to: 5.15
Change-Id: I70d7e6fcacb3d81f8c771e4a8d6cca06295e7474
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
2020-09-10 17:32:09 +02:00
Andrei Golubev
781ecbfc6f QString/QBA: change realloc*Data signatures to use qsizetype
Changed reallocData, reallocGrowData signatures to use qsizetype
instead of size_t

Change-Id: Iebe7def5430d3d3f4660e19cb6c12612543c5abc
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Reviewed-by: Sona Kurazyan <sona.kurazyan@qt.io>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2020-09-10 17:31:31 +02:00
Andrei Golubev
ec7e680c50 Remove '\0' space reservation logic in QString
Changed QString to use implicit element reserved by QArrayData

Task-number: QTBUG-84320
Change-Id: If517500b3f0e71bb8d2989c64815a634aa8dd554
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2020-09-10 17:31:23 +02:00
Andrei Golubev
04d78df344 Remove '\0' space reservation logic in QByteArray
Changed QByteArray to use implicit element reserved by QArrayData

Task-number: QTBUG-84320
Change-Id: I2a0091c814a47a5c052da7a83d10cb641834c7bd
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2020-09-10 17:31:19 +02:00
Allan Sandfeld Jensen
7249a87b06 Cleanup PageSize enum for Qt6
Fixes B5/B6 order and removes abandoned documentation for a removed duplicate.

Change-Id: I7647ee31a4ef4aa754058c8a6f68b4d4304e0043
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2020-09-10 17:30:33 +02:00
Volker Hilsheimer
43735342b5 QOpenGLTexture: Remove obsolete data upload overloads
Address ### Qt 6 comment

Change-Id: I2952175ec72c5c4c7b4e518754fb1bc6f88b21df
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
2020-09-10 17:30:09 +02:00
Volker Hilsheimer
55dda687fd QOpenGLFramebufferObject: merge toImage overloads
Address ### Qt 6 comment

Change-Id: I60b1dba72dbf2490294c84e5d1a85ae7e7181fc3
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
2020-09-10 17:30:02 +02:00
Volker Hilsheimer
8186bd628f Remove obsolete APIs and comments from QAbstractPrintDialog
Merging QAbstractPrintDialog with QPrintDialog, as proposed in the
removed comment, seems to have little value, given that the platform
specific implementations rely on the current abstraction.

Adjust examples and tests; with the QAbstractPrintDialog test now
testing the QPrintDialog::options API, the corresponding test function
can be removed from the QPrinter test.

Change-Id: Ia8906627898332e8590ea9b27e3d71dfcc6e8d71
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2020-09-10 17:29:52 +02:00
Andreas Buhr
1b02cfd38d Adapt QDate unit tests to not take into account system locale
QDate was changed to consistently use the C local in
serialization and parsing in git commit
5ba66c5622.
This commit reflects this change in the unit tests.

Task-number: QTBUG-80441
Change-Id: Ib21a215ef0e36c9eaa2c161b92c6877a50ae6f06
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Andrei Golubev <andrei.golubev@qt.io>
2020-09-10 17:29:38 +02:00
Alexandru Croitor
8bc739fcc2 CMake: Register qtwaylandscanner dependency when cross-compiling
qt_record_extra_package_dependency is called by qtwayland to register a
dependency between the qtwaylandscanner tool and the waylandscanner
tool.

When cross-compiling the tools in a Yocto environment, the adjusted
target name was not taken into account.

Task-number: QTBUG-83968
Change-Id: Ibf7b94876bf29827cf0d9c9bb471f359ef6ff15f
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
2020-09-10 17:29:15 +02:00
Alexandru Croitor
abf7239541 CMake: Apply $ORIGIN style rpaths for non-prefix builds as well
This works around linking issues when doing yocto non-prefix Qt
builds, because CMake does not add -rpath-link flags even though it
probably should.

Task-number: QTBUG-86533
Change-Id: Iaaf246ac71ca05d9369ceb6eb9c4a1e206c42839
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
2020-09-10 17:29:11 +02:00
Assam Boudjelthia
ff1a44be33 Android: don't use avx and avx2 when building for Android x86_64
The Android build for x86_64 fails with CMake. It should also fail with
qmake builds but the current multi-ABI build is testing the feature for
arm64-v8a only.

In [1], it's stated that AVX and AVX2 are not supported on x86_64 ABI.

[1] https://developer.android.com/ndk/guides/abis#86-64

Task-number: QTBUG-85982
Change-Id: I20c9366bdee2a13ca554ec67f5d0c041bd068b91
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2020-09-10 18:29:05 +03:00
Allan Sandfeld Jensen
54c37146b7 Clean-up of old VC6 work-around
Change-Id: Ic518f48b62055a4fa229751a80362f9426e0ac42
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
2020-09-10 17:28:12 +02:00
Morten Johan Sørvig
7238123521 X11: set fallback logical DPI to 96
Returning physical DPI from logicalDpi() is problematic,
as explained in commit 77e04acb.

The most predictable implementation is to never return
physical DPI from QPlaformScreen::logicalDpi(). Other
platform plugins already does this, and this change
brings xcb in line with the rest of Qt.

We have the QPlatformScreen::physicalSize() API which
covers returning physical DPI (indirectly); Options
for selecting which one to use can be implemented on
top of these (see QT_USE_PHYSICAL_DPI).

Change-Id: Ifc41229fa63734a2eb06b3acefd97b2ed3e57c2d
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2020-09-10 17:28:11 +02:00
Morten Johan Sørvig
b3c991ae8f Port from devicePixelRatioF() to devicePixelRatio()
This ports all of QtBase.

Change-Id: If6712da44d7749b97b74f4614a04fac360f69d9e
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2020-09-10 17:28:11 +02:00
Topi Reinio
e1ce78d484 Doc: Fix documentation issues for event and input device classes
* Document the new base classes QPointerEvent and QSinglePointEvent,
  and move relevant documentation to be located under them.
* Replace linking to deprecated functions with their new counterparts.
* Remove non-existent function and parameter documentation.
* Document QEventPoint::State enum.
* Prefer \obsolete over \deprecated and fix the usage.
* Document the Capabilities enum in the correct location and
  add docs for the missing enum values.

Change-Id: Ic8f2732f2e90ecbf522cd744c601cedcc574825c
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
2020-09-10 17:28:11 +02:00
Edward Welbourne
2c63164012 Inline QMetaObject::cast(QObject *), as requested by ### Qt 6 comment
Task-number: QTBUG-85700
Change-Id: I29405df37b82d34a92537e39a3863b5f6c998556
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2020-09-10 14:21:48 +02:00
Edward Welbourne
4b9ec075f8 Remove spurious const from QVariant::convert()'s first parameter
As per ### Qt6 comment.

Task-number: QTBUG-85700
Change-Id: I24292d9f2b8f7781032aa8df2a7a0c58ad4fb6c9
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2020-09-10 14:21:48 +02:00
Edward Welbourne
c0e51ee9df Remove some pre-Qt6 code
Task-number: QTBUG-85700
Change-Id: Id4856d035b697276f6a7090956359044bac7d817
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
2020-09-10 14:21:48 +02:00
Andrei Golubev
7a15d71def Fix possible corner cases in qarraydataops.h
Updated moveNonPod function to behave correctly under
exceptions being thrown. This is the version that was implemented
at some point but then got changed prior to merge. Added tests for
moveInGrowthDirection (which uses moveNonPod in general case) to
verify that range movements are correctly done

Updated QCommonArrayOps access modifier from private to protected
to allow testing of internal stuff by subclassing

Task-number: QTBUG-84320
Change-Id: Idb994a72ee601762e32248670cdc7819aaca0088
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2020-09-10 14:21:47 +02:00
Shawn Rutledge
a81859a3c8 Move grabbing API from QEventPoint to QPointerEvent
We plan to move storage of the grabbers into QPointingDevice so that
QEventPoint will store only data that does not need to persist between
deliveries of individual events. These API changes prepare for that.

addPassiveGrabber/removePassiveGrabber is a better API than
setPassiveGrabbers(), because it will never require constructing a
temporary QList just to call the function. Eventually we need to emit
signals to notify about grab changes, so it's better to have incremental
changes to the list rather than needing to iterate and find differences.

Fix up the docs.

QEventPoint IDs are no longer written in hex in debug output.
That was done in Qt 5 because an ID was a composite of device ID
with the OS-provided touchpoint ID; but since the QPointingDevice
is always available, it's more readable if the IDs are in decimal.

Change-Id: I86b9016d9b28c331ca05c7c108d9788de93fb642
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2020-09-10 14:21:47 +02:00