Commit Graph

48114 Commits

Author SHA1 Message Date
Lars Knoll
0902508411 Fix compiler warnings from QKeyCombination
Change lots of code to avoid the deprecated operator+() or implicit
casts to int.

Change-Id: I0c343cd5b28603afdf1214eefb85e928313345e2
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2020-09-28 17:23:20 +02:00
Timur Pocheptsov
673da7d460 QSslConfiguration::setAllowedNextProtocol - remove the old signature
Change-Id: I0b4b18e6ea2b78917220e77865fd92eb7a684179
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2020-09-28 15:48:49 +02:00
Sona Kurazyan
a6e1f67937 Fix QtConcurrent algorithms to work with temporary sequences
QtConcurrent algorithms are making an internal copy of the passed
sequence, to make sure it won't be destroyed before the execution
is finished. However, they were using iterators of the originally
passed sequence. So, if the original sequence is deleted, QtConcurrent
algorithms would use invalid iterators to a deleted sequence. This
might work with Qt containers thanks to implicit-sharing, but with
other containers will lead to unexpected results. Fixed them to work
on the internal copy of the original sequence.

Change-Id: I1d68692ed9746223c85f51bb05977bc1443b681d
Reviewed-by: Andreas Buhr <andreas.buhr@qt.io>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Karsten Heimrich <karsten.heimrich@qt.io>
2020-09-28 15:48:17 +02:00
Edward Welbourne
b12d6c6a8a Don't guess UTC when we can't find a system zone name
If we're able to load a system zone without knowing its name, we
shouldn't claim that its name is UTC.  Instead, use the system zone
information's name for the zone.

Let the backend return an empty string if it can't determine the
system zone ID, provided it has some way to get system zone info
despite not knowing its name. This can happen on Windows if the system
zone is one of Microsoft's idiosyncratic names that we don't
recognize; or on Linux if /etc/timezone is a copy of a zoneinfo file,
instead of a symlink. In support of that, handle empty ID as a request
for system zone info, so that the backend constructors taking an IANA
ID never get passed an empty ID; that gets routed to the default
constructor instead.

This incidentally restores QTzTimeZonePrivate's behavior, for empty
ID, of reading the content of /etc/timezone if we are unable to
determine the name of its zone any other way.

Fixes: QTBUG-86306
Pick-to: 5.15 5.15.1
Change-Id: Iad57c18199124f651ebc3d32c3deffca6eaab512
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2020-09-28 15:48:17 +02:00
Julien Schueller
32309fb446 CMake: FindGLIB2 to include gthread2 sub-library
Avoids undefined references to g_thread_init.

Fixes: QTBUG-86727
Change-Id: Ic41b0dab9e4e23083faf4e9abcf7acc517172e49
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2020-09-28 15:48:17 +02:00
Alexandru Croitor
9bcabd71a7 By default don't try to use pkg-config when targeting Android
It causes issues in our Windows CI, because the strawberry perl
pkg-config is found. And even that one is unusable, due to a bug in
CMake which is tracked at
https://gitlab.kitware.com/cmake/cmake/-/issues/21239

Change-Id: I58816195d35459e8a44c923399c35a4956c222a2
Reviewed-by: Simon Hausmann <hausmann@gmail.com>
2020-09-28 15:48:17 +02:00
Alexandru Croitor
a9f352cce3 CMake: Regenerate configure.cmake files
Change-Id: I165c633d7c052fb80419d4b2c57561de40217ade
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
2020-09-28 15:48:17 +02:00
Alexandru Croitor
7bb91398f2 CMake: Allow finding Qt CMake packages in additional locations
By default, when using the Qt6 CMake package to look for components,
the find_package() calls for the components use NO_DEFAULT_PATH to
ensure that CMake doesn't accidentally find system (distro) packages.
Instead we limit the paths to one level up from where the Qt6 package
is.

Unfortunately that doesn't quite work for finding Qt packages that
might have been installed into a different prefix than where the main
Qt prefix is.
This happens when Qt addons are built by Conan, and installed into
a separate prefix.

To allow calls like find_package(Qt6 COMPONENTS ConanAddon) to work
in a scenario as described above, introduce a new variable called
QT_ADDITIONAL_PACKAGES_PREFIX_PATH which can be used to specify
additional paths where Qt CMake packages should be found.

This is similar to previously introduced QT_EXAMPLES_CMAKE_PREFIX_PATH
variable which was meant for a similar case, but only for examples.

Additionally, allow disabling the NO_DEFAULT_PATH option by setting
the QT_DISABLE_NO_DEFAULT_PATH_IN_QT_PACKAGES cache variable to TRUE.
This would allow regular usage of CMAKE_PREFIX_PATH to work, at the
risk that system Qt CMake packages might be found.

Augments 5cd4001bf2
and ffe0889413.

Fixes: QTBUG-86882
Change-Id: Ia8e060cbba6d2a10c3d63d81892f2c71e4236a9a
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2020-09-28 15:48:17 +02:00
Fabian Kosmale
1e883cf9b5 Prevent endless markDirtyAndNotifyObservers <-> notify loop
Before we had the option of eager evaluation, we were able to use the
dirty flag to detect whether we are recursing. However, eager properties
will lead to a evaluateIfDirtyAndReturnTrueIfValueChanged call, and that
in turn will clear the dirty flag.
Introduce a new member to detect that situation, and set the bindings
error state to BindingLoop if we detect that kind of loop.

Change-Id: If40b93221848bd9e9422502318d992fad95b0b74
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2020-09-28 09:11:16 +02:00
Volker Hilsheimer
de52ad0a0f Fix documentation for QStringList
Explicitly declare members in qdoc runs that are otherwise inherited
from QListSpecialMethods.

Note: Due to a bug in syncqt, those members need to be added in a
separate #ifdef Q_QDOC section.

Change-Id: I96850f3665359de4f97be1b8d10f8052ba252fab
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
2020-09-28 08:16:59 +02:00
Toni Saario
f26d4def67 Read test specific configure arguments from environment
Reading configure arguments for tests from environment allows control
of CMake args from outside of the module itself. TEST_CONFIGURE_ARGS is
read and appended to host tests build and TARGET_TEST_CONFIGURE_ARGS
respectively for target's tests.

Change-Id: I8270b0254525aec24f7614cba2b90b291e5eb3d2
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2020-09-28 05:28:22 +00:00
Volker Hilsheimer
258bf0c58e Fix qdoc warnings: supportedCiphers is a member of QSslConfiguration
... not of QSslSocket.

Change-Id: I9db5debe6a0aaa6a780b0047ae3f551ec3770fb4
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
2020-09-28 07:10:49 +02:00
Volker Hilsheimer
804ef8db7a Fix qdoc warnings: remove docs for inherited/implicit members
Change-Id: I8654dbc3c0d1b86690f805cc1282e581dbcc5c55
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
2020-09-28 07:09:56 +02:00
Volker Hilsheimer
4ccebdf12d Fix some qdoc warnings from QStaticPlugin
Move all the documentation for that class into one place, and remove
rawMetaData documentation and references; it is a private variable, and
shouldn't be documented.

The instance member is a function pointer type variable, but should
be treated as a member function. Even with a Q_QDOC ifdef'ery we can't fix
that warning (we would get a lot of new warnings instead), so leave that
as is for now.

Change-Id: I951aaafad8dca5ed2533ace69931f002eb97996a
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
2020-09-28 07:09:48 +02:00
Volker Hilsheimer
7542638e0c Fix qdoc warnings from Q(Latin1)String
arg() is now a variadic template, already documented in
qstringview.cpp, so document that and remove the documentation for
the removed overloads.

QString has no member subString, so remove that as well.

Fix return type in QLatin1String member function documentation.

Change-Id: I32e7bcba770bcee77ae4a07c06ac61228ffa93a6
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
2020-09-28 07:07:56 +02:00
Volker Hilsheimer
36df66591a Fix some qdoc warnings from QHash and QMultiHash
It's no longer possible to decrement an iterator, and the class uses
qsizetype, not int for sizes.

Fix incorrect function prototypes in the documentation, and remove
documentation for functions/overloads that don't exist.

QMultiHash doesn't have Java style iterators (not a new issue in
Qt 6), so remove the references to QMultiHashIterator.

Change-Id: I149b4620963f2087f3f66bb70a9c97b292a35378
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
2020-09-28 07:07:56 +02:00
Volker Hilsheimer
7083ddb582 Fix qdoc warning: button(s) are members of QSinglePointEvent
... and documented there already.

Change-Id: Ie66362d3b668caf93b100befef08bc91ae8add2f
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
2020-09-27 14:09:47 +02:00
Friedemann Kleint
38a5b6212d qtabletevent/regular_widget manual test: Add a toggle for WinTab
Task-number: QTBUG-83218
Change-Id: I179f53c051c92dbb86fbac710d4a514c4e5d3c49
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
2020-09-27 12:25:54 +02:00
Edward Welbourne
03c12974bb Simplify the preamble of QDateTimeEditPrivate::stepBy()
Repetition and needless complexity: eleven lines rewritten in three.

Change-Id: I1dadbbc5329b18d3e25f38f73b69abd2d7aac30d
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
Reviewed-by: Andrei Golubev <andrei.golubev@qt.io>
2020-09-27 09:32:17 +02:00
Edward Welbourne
e0ff15ffd8 QCalendar: use LGPL like everything else, not GPL
Pointed out by Lars.

Change-Id: Idb8427d77b35c84eb3037703957cf7f93ea5f387
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2020-09-27 09:31:48 +02:00
Johan Klokkhammer Helsing
400fb27208 Use WAYLAND_DISPLAY and DISPLAY instead of XDG_SESSION_TYPE
XDG_SESSION_TYPE is a non-standard part of systemd, and not set if you
run a compositor from the command line, for instance.

[ChangeLog][Wayland] XDG_SESSION_TYPE is no longer used to determine which
platform plugin to use. Instead, if WAYLAND_DISPLAY is set in the environment,
wayland is used. Similarly, if DISPLAY is set, xcb is used. If both are
detected, wayland will be attempted first, then xcb.

Gnome-shell is still skipped for automatic wayland detection.

Fixes: QTBUG-75732
Change-Id: Ieed123330662dc29eafa31148a9b99ba0810de90
Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
2020-09-27 09:30:53 +02:00
Edward Welbourne
8e15b2ac5e Remove QNX/Blackberry-related qpps* files from corelib/kernel/
They appear to be no longer in use.

Task-number: QTBUG-85700
Change-Id: Id4c134b99372ccb26eead2a033d99196778c418e
Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
2020-09-26 21:31:03 +02:00
Friedemann Kleint
d37b353e5d Windows Vista/XP Styles: Clean up some code
Remove public constructor of QWindowsXPStyle since it
cannot be instantiated via style factory since 5.0.
Remove overridden functions that merely call the base implementation.

Change-Id: I3b2998115c4ab65fabf3744874bc3a69a1f5e5b0
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2020-09-26 20:07:59 +02:00
Friedemann Kleint
18bd226564 Fix compilation of some manual tests
- qtabletevent/device_information
- dialogs
- windowflags

Change-Id: Id3e4b2aec2a873b00dcda39fb1227b24832181ca
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
2020-09-26 19:53:54 +02:00
Allan Sandfeld Jensen
b0b4fcd05c Preserve formats in QImage::scaled()
Do not always use the smoothScaled routine, the normal routines are
also optimized, and do not convert to alpha formats when not necessary.

Task-number: QTBUG-49719
Change-Id: I6ee9b620cc259472c419e7363357f41ce29b594a
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
2020-09-26 18:49:10 +02:00
Assam Boudjelthia
45896797c6 CMake: use ANDROID_SDK_ROOT instead of ANDROID_SDK consistently
Make the use of ANDROID_SDK_ROOT consistent.

Task-number: QTCREATORBUG-24678
Change-Id: If967bdc4d252996098fa210cf38429fe075eacb1
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2020-09-26 16:43:02 +00:00
Assam Boudjelthia
5a158a9512 Android: allow Android app building to use java 8 features
Enable Gradle builds to use Java 8 features like lambda expression by
default.

Task-number: QTBUG-86282
Pick-to: 5.15
Change-Id: Ib497b8a789690fcca6e13ea4995e5966331c6c0d
Reviewed-by: Andy Shaw <andy.shaw@qt.io>
2020-09-26 19:43:00 +03:00
Volker Hilsheimer
d26fe3c5d6 Don't error out when configuring Qt on a headless system
Configuring and building Qt should not require a running dbus session bus.
However, when building the html_docs target on a headless system, qmake bails
out with error if dbus is linked in, while only showing a warning if it's not.

This is unnecessary. We can warn in both cases, build the tests with dbus
linked in. Running the tests will fail if there is no session bus, ie.
tst_QDBusConnection_Delayed::delayedMessages fails with

QVERIFY(session.isConnected);

Pick-to: 5.15
Change-Id: Ia6b6e226398e87880449b003d28dfd76553bee2c
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
2020-09-26 14:36:13 +02:00
Volker Hilsheimer
c1fddbbd58 Fix qdoc warnings from references to removed APIs
Change-Id: Id41052be0878715eda4879fcd3171a30ddd5a9a7
Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
2020-09-26 14:36:03 +02:00
Volker Hilsheimer
0ebe1708e2 Fix qdoc warnings in QStringView
Fix prototype of template member function, and fix see-also reference.

Change-Id: Ibb39925063dfeb3fd511f47a1606a0b243d4c2ef
Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
2020-09-26 14:35:48 +02:00
Volker Hilsheimer
02dd77fa80 Fix qdoc warning from QMetaObject
It's QMetaObject::isWritable, not isReadOnly.

Change-Id: I47a0b07a1969740f67c081dade3720890077361e
Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
2020-09-26 14:35:44 +02:00
Volker Hilsheimer
aa62ee3f9a Fix qdoc warning: QTextBoundaryFinder
Change-Id: Iec38f33519f05b046d6995d6f7eef1557fd5f209
Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
2020-09-26 14:35:40 +02:00
Volker Hilsheimer
77d57706ff Fix qdoc warnings: QTextStream manipulators are in the Qt namespace
Change-Id: I55c0c6454e27e0a002021a73f6c1cf8d8ed4d6af
Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
2020-09-26 14:35:37 +02:00
Volker Hilsheimer
756104d5e1 Fix some qdoc warnings for QString/View/Tokenizer
Use correct member function prototype, which requires the template declaration.
Remove see-alsos that don't exist.
Document parameters for qTokenize.

Still lots of warnings from QStringTokenizer, due to the inheritance structure
of that template class and the declarations of nested types in undocumented
base classes.

Also, qdoc doesn't seem to recognize training this-lvalue/this-rvalue
declarations for overloads, and considers the second toContainer documentations
to override the first.

Change-Id: Iadf967d3328ddda52b6f66786836853bddeda79b
Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
2020-09-26 14:35:29 +02:00
Volker Hilsheimer
c2be134d15 Fix some qdoc warnings for QAnyStringView
Change-Id: I62f05fea897effff22e5031f02661c01b2e3c45f
Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
2020-09-26 14:35:21 +02:00
Julien Schueller
cc6677a6c7 Fix -Wmaybe-uninitialized warnings
Fixes few of these, for example:
qurlrecode.cpp:308:19: warning: 'ucs4' may be used uninitialized in this function [-Wmaybe-uninitialized]
*output++ = ucs4;

Change-Id: Iaf09fa854102c76b51e6e18556c5ef20212e57cf
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2020-09-26 11:40:21 +02:00
Alexandru Croitor
151323b94b CMake: Add $import_prefix/include as an include path for each Qt module
To support finding Qt headers of modules installed into a different
prefix than the main one, add the $import_prefix/include path as a
public include path for each built Qt module. With this, includes like
 #include <QtNetworkAuth/QOAuth2AuthorizationCodeFlow> will work.

The macOS framework case is handled automagically by CMake, which
ends up passing '-iframework $import_prefix/lib'.

Change-Id: I02ce9cacf157aab9721c1d6073a377607c5b89c7
Fixes: QTBUG-86881
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
2020-09-26 11:25:20 +02:00
Toni Saario
19d2e61f87 Respect abort testing on failure flag
On regular commits we do not want to waste time running all test if
there is failures.

Change-Id: I050d191058293f4311268169eb26754349930129
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2020-09-25 23:31:02 +03:00
Robert Loehning
74146e0102 Avoid heap-buffer-overflow
[ChangeLog][QOutlineMapper] Avoid heap-buffer-overflow

Fixes: oss-fuzz-24615
Pick-to: 5.12 5.15
Change-Id: Ia67e1fb830850d04f068d8b5c009687f3deff156
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
2020-09-25 18:00:49 +00:00
Alexander Volkov
a51b7844ca Stylesheet example: Get rid of auto-connection slots
Change-Id: I55d89cf33e5f9c8aef3a3dfbbdcd212415d35bcb
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
2020-09-25 18:04:06 +03:00
Alexander Volkov
065c4021ad xcb: Avoid BadMatch error when creating non-OpenGL window
The Xorg Server requires colormap when creating a window if
the window's parent either has a different visual or has no
colormap. To simplify logic and avoid extra requests, create
a new window with colormap unconditionally.

Pick-to: 5.15
Change-Id: I21a53f9146ae0a03b38bb3a07c8a478043a2eb89
Reviewed-by: Liang Qi <liang.qi@qt.io>
2020-09-25 18:03:56 +03:00
Joerg Bornemann
893ee16352 CMake: Fix build of Release user projects against RelWithDebInfo Qt
Building a user project in Release configuration against a Qt built with
CMAKE_CONFIGURATION_TYPES=RelWithDebInfo;Debug led to the user project
being linked against the Debug Qt libraries. This is especially painful
with MSVC where debug and release runtimes are incompatible.

We now create *AdditionalTargetInfo.cmake files along the
exported *Targets.cmake files that set the IMPORT_*_<CONFIG> properties
to the values of the release config Qt was built with.

User projects built with an unknown
configuration (CMAKE_BUILD_TYPE=ArbitraryName) will link against a
release Qt. This can be controlled by setting the variable
QT_DEFAULT_IMPORT_CONFIGURATION to, for example, DEBUG in the user
project.

Fixes: QTBUG-86743
Change-Id: I12c4b065a9845c7317f6acddab46b649f2732c9e
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2020-09-25 17:02:52 +02:00
Volker Hilsheimer
1e7a52005b QStaticPlugin: Reorder class members
Address ### Qt6 comment.

Task-number: QTBUG-85700
Change-Id: I31b65a76662b3dcdfa1400a3747c2e3c730b5ee3
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2020-09-25 17:02:51 +02:00
Volker Hilsheimer
51e138b695 Remove traces of QObject::trUtf8 from documentation
... and from the duplicated Q_DECLARE_TR_FUNCTION macro for QXmlStream.
We expect source code to be utf8 encoded in Qt 6, so the function is gone.

Change-Id: Ie25329a54e709dc92a22893ad5ab023852300d81
Reviewed-by: Kai Koehne <kai.koehne@qt.io>
2020-09-25 17:02:41 +02:00
Laszlo Agocs
7f3b62324e rhi: Switch command lists to QVLA
Change-Id: Ic163533eee973f0ee2f3e2efe25390caa57dd659
Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
2020-09-25 14:59:14 +00:00
Laszlo Agocs
63e54fbdfe rhi: gl: get rid of a wrapper QByteArray where a raw ptr suffices
This is a visible performance increase actually, given this is on a quite
hot chode path.

Change-Id: I165bfa0d4e490f80078551efb4bf2fe8e72d3596
Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
2020-09-25 16:59:00 +02:00
Laszlo Agocs
80091e0a0f rhi: Skip comparing to this in isCompatible tests
Change-Id: Ie1855f992315f6e02986016a254127cec0ac94c8
Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
2020-09-25 16:58:59 +02:00
Laszlo Agocs
89f7389494 rhi: gl: d3d: Do not use QByteArray where there is no point
The real benefit in practice is getting rid of profilers going wild
about QByteArray::begin() and similar. The actual perf. gain is
fairly small.

Change-Id: I25e4c762f303b41f0aaf914bc62751f3265d3cf8
Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
2020-09-25 16:58:46 +02:00
Volker Hilsheimer
cc5287a0a9 Fix qdoc warning and typo in QMetaSequence
There is no parameter called value in removeValueAtBeing/End.

Change-Id: Ife91d2014ea35ea636e9cfb1c815424e5f4ef7a6
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2020-09-25 13:15:50 +02:00
Laszlo Agocs
8059632fbd rhi: Drop the zeroing out of resource binding structs
This has a non-insignificant cost (since the size is at least 260 bytes)
in renderers that construct a lot of these objects per frame. After
changing the qHash implementation to be lighter we no longer rely on
qHashBits, so zeroing it is not essential anymore. Remove it.

Change-Id: If1fbd8dfd46fb3f0e9ea5a3c4794d24b8aeac1ba
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
2020-09-25 09:24:42 +02:00