Commit Graph

45110 Commits

Author SHA1 Message Date
Lars Knoll
90f17d8584 Clean up memory
And remove a test failure when compiling with asan enabled.

Change-Id: I2b8e676665572adcbbac6a910983d5b209bf6d23
Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
2020-04-17 11:24:35 +02:00
Simon Hausmann
f395cedc5b Simplify signature of untyped property bindings
Instead of requiring the implementation to do the compare dance, let's
do this in the library. This reduces the amount of duplicated code
slightly and makes it easier to generate binding code from qml files.

Change-Id: Ia3b16cf9769e74d076b669efe4119ab84af3cdf0
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2020-04-17 11:24:10 +02:00
Simon Hausmann
4857f0ebd7 Make it possible to take bindings from properties without private headers
Passing the QExplicitlySharedDataPointer by reference may lead compilers
to wanting to have visibility to the destructor of the contained type
(QPropertyBindingPrivate), which is not public. Fortunately
QExplicitlySharedDataPointer is safe to use with raw pointers and those
can be safely forward declared.

Change-Id: I131ab6363eaee10b6dce196fb2c769e09a5c9557
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2020-04-17 11:24:10 +02:00
Alex Trotsenko
6ce4c7d002 QEventDispatcherWin32: relax memory ordering on setting wakeUps flag
There is no need in 'acquire' operation for the next reasons:

  - wakeUps is simply used as an atomic boolean that does not require
    ordering with other loads or stores;
  - any of testAndSet...() always gets a latest version of wakeUps.

Change-Id: Ica38fc62bc181166995946dee9d6887c71d87cec
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2020-04-17 06:36:03 +00:00
Lars Knoll
fd550c943f QString::from/toLocal8Bit: Assume locale is utf8 if we don't have codecs
If there is no text codec support, assume local8bit is utf8, not latin1.
This is in line with what 99% of all modern systems do.

Change-Id: I35ebcd43ef3572a25f549a8375857dcabcfec4ca
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2020-04-16 23:15:10 +02:00
Lars Knoll
0b12b7f518 Fix compilation with QT_RESTRICTED_CAST_FROM_ASCII
Fix the QString constructor used for restricted casts
from char *.

Change-Id: Id7e71f6d0bcd4627bb44b2bd6d6790be2b6ed976
Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
2020-04-16 23:15:05 +02:00
Lars Knoll
83f5c3c26a Remove QString::from/toAscii()
These methods have been deprecated since 5.0

Change-Id: I3ceed57a364ea59a63ccc51452ab3b4da7140ce4
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2020-04-16 23:14:57 +02:00
Volker Hilsheimer
ea7cc7f6f9 Remove deprecated members from QtWidgets/kernel classes
Cleaning up those that are trivial to remove because they have direct
replacements.

Change-Id: Ie8ac02c3d6273110f1f11e17fdeae496bc66321f
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
2020-04-16 16:53:50 +02:00
Volker Hilsheimer
09dd94091f Remove deprecated members from graphics view classes
Change-Id: Ia192de674b1085edcf4a88cdeada6df89b442ddd
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
2020-04-16 16:53:33 +02:00
Volker Hilsheimer
90295dcd03 Remove deprecated QStyle enum values
Change-Id: I7eba336017844c06b2976df53d440e167abd7894
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
2020-04-16 16:53:18 +02:00
Volker Hilsheimer
fe4a5a27e0 Remove deprecated members from dialog classes
And a few cleanups of out-dated comments and dead code.

Change-Id: I59c6b9129a21b8953626cb63c3ebbf9b6c49a657
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2020-04-16 11:05:28 +02:00
Volker Hilsheimer
f728429335 Remove deprecated QWizard member
Change-Id: If6a0125ab9eba5f1b5040adb2e087003b45f5b3d
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2020-04-16 11:05:28 +02:00
Johan Klokkhammer Helsing
73f3f501f3 Move versioned OpenGL functions from QtGui to QtOpenGL
The context—which lives in QtGui—now knows nothing about versioned functions.

This changes the public API for getting version functions for a context.

[ChangeLog][QtGui][OpenGL] QOpenGLContext::versionFunctions() has been removed.
QOpenGLVersionFunctionsFactory::get() from the QtOpenGL module should be used
instead.

Previously one would call

    context->versionFunctions<QOpenGLFunctions_4_0_Core>();

Which now becomes

    QOpenGLVersionFunctionsFactory::get<QOpenGLFunctions_4_0_Core>(context);

The rest of the API should be identical.

Since glgen no longer compiles, and the links to its input (gl.spec and gl.tm)
are dead, I've edited the previously generated files manually. If glgen is
fixed, it should be quite easy to make it generate the new way.

Task-number: QTBUG-74409
Change-Id: I800527e0af16a79005b276eeb74417770193c62f
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
2020-04-16 07:14:51 +02:00
Lars Knoll
ca635c659c Run those autotests with cmake
They seem to work just fine.

Change-Id: I8cf3e682e158c67367d76fe68f5829df67d1e449
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2020-04-15 18:55:52 +01:00
Lars Knoll
bc726ed5d9 Compile fixes for clang10
Fix some warnings that are flagged as errors on clang10.

Change-Id: I906634c8b2bd94db42d74a7f3d10efb086e373cc
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2020-04-15 19:55:06 +02:00
Lars Knoll
e80544ebca Port QNetworkProxy over to use QRegularExpression
The windows and macOS implementations where still using QRegExp
in one place.

Change-Id: Iaf6c6ead10f7f061ff0edce889abe18751b9d308
Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
2020-04-15 19:54:09 +02:00
Leander Beernaert
30f69f7ff6 CMake: Add library mapping for xcb-fixes
Change-Id: Ida893674fa0782446acdac4ee5dfec4849d4605f
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2020-04-15 16:25:19 +02:00
Leander Beernaert
812cc76b02 CMake: Update pro2cmake and friend to convert QtVirtualkeyboard
Expand $$MODULE_BASE_DIR to ${QT_BUILD_DIR}.

Add library mappings for Hunspell.

Add test mappings for QtVirtualKeyboard regarding 3rdparty Hunspell and
T9Write.

Change-Id: Ief007456d0471cbcf9a03d819291edec5f63680f
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2020-04-15 14:15:52 +00:00
Giuseppe D'Angelo
bb0a616260 QObject: overhaul narrowing detection
Use P0608's trick to detect convertibility without narrowing;
and now that we can depend on C++17, use its features.

First, this moves the burden of detecting a narrowing conversion on
the compiler, rather than us maintaining a complicated series
of checks. Of course, this exposes

* bugs in compilers (e.g. GCC < 9 thinks that float->bool is not
  narrowing;

* behavior still not (widely) implemented (pointer to bool
  conversions are narrowing, P1957);

* interesting compiler choices, e.g. GCC 9 thinks that unscoped
  enumerations are non-narrowing convertible to a datatype big
  enum to contain all the _enumerators_, even if the underlying
  type of the enum (and/or its sizeof()) is wider than the target
  datatype.

Second, it allows to detect conversions that have a narrowing
conversion as an intermediate step. Given a type like

  struct Bad { operator double() const; };

then an object of type Bad is implictly convertible to a type
like int via a narrowing conversion. Therefore, a connection
is possible between a signal carrying a Bad and a slot accepting
an int. We can now detect and block this.

Tests regarding scoped enumerations have been dropped,
for the simple reason that a scoped enumeration is not
implictly convertible to an integral type, so we don't have
that detection (it would constantly fail). Scoped enumerations
do not take part in narrowing conversions anyhow, cf. [dcl.init.list].

[ChangeLog][QtCore][QObject] The detection of narrowing conversions
when calling QObject::connect() when
QT_NO_NARROWING_CONVERSIONS_IN_CONNECT now takes also
into account user-defined implicit conversions that undergo
through a narrowing conversion.

Change-Id: Ie09d59203fe6283378b36dfbc54de1d58098ef51
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2020-04-15 15:20:45 +02:00
Lars Knoll
76e54a2e15 Extend the QRegExp->QRegularExpression porting doc
Mention that . matches newlines in QRegExp, but not by
default in QRegularExpression.

Change-Id: I9663fe30c7b7e068d673aa8d51884f6828e0ee59
Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
2020-04-15 14:39:29 +02:00
Lars Knoll
1b65098a20 Move the QRegExp porting docs into the QRegExp class documentation
It used to live in QRegularExpression, but as QRegExp gets removed from
Qt Core, the better place for it is to live in the QRegExp docs.

Also marked QRegExp as deprecated in the docs.

Change-Id: Id5b0e3040e4d46f5d806022b58fbd5b5efd58911
Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
2020-04-15 14:39:24 +02:00
Lars Knoll
b6145bfcc5 Remove two leftover references to QRegExp in the docs
Change-Id: I7e025d6a03827addb61740649a77dd74f7416962
Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
2020-04-15 14:39:19 +02:00
Lars Knoll
dd152c8404 Remove QRegExp based functionality from QObject
QRegExp is going away for Qt6.

Change-Id: I04d6331379dc769394b160d976eb9f21fe649a22
Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
2020-04-15 14:38:54 +02:00
Lars Knoll
eb349930ee Remove QRegExp support from QSortFilterProxyModel
Map setFilterWildcard() and setFilterFixedString() to now use
QRegularExpression.

Change-Id: I2dff2015234decb2badfd306975dcff8553cdd7f
Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
2020-04-15 14:38:40 +02:00
Lars Knoll
48794f5057 Port example over to QRegularExpression
Change-Id: I1e15bfa0a2973aabcad78f3eba4bb4903f8f3f6f
Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
2020-04-15 14:38:23 +02:00
Lars Knoll
52d91508fd Convert the example to use QRegularExpression
Change-Id: I7a4259ac43e59a8f50ee1c5072a3da5b977d8bfe
Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
Reviewed-by: Samuel Gaist <samuel.gaist@idiap.ch>
2020-04-15 14:38:17 +02:00
Lars Knoll
dba00c4a3b Don't anchor wildcard patterns twice
wildcardToRegularExpression anchors the pattern by default.

Change-Id: Ic58e09aa526a7e35803703fa5f7582a250927008
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@gmx.de>
2020-04-15 14:38:10 +02:00
Lars Knoll
cb1000ea02 Add WildcardConversionOptions to QRegularExpression
There are cases, where the conversion from a wildcard pattern to
a regular expression should not lead to an anchored pattern. Allow
this, but adding an optional second argument to
wildcardToRegularExpression, that allows tuning the conversion.

Change-Id: Ida7a32d65ee49bf58d5f8d9906c0a0cd8954a02a
Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
2020-04-15 14:38:05 +02:00
Lars Knoll
4b37abc0c9 Port qfilesystemengine_win.cpp to QRegularExpression
QRegExp is going away in Qt 6.

Change-Id: I282a444b9fdf1c834dcf90d7fd6743781b94643c
Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
2020-04-15 14:37:48 +02:00
Lars Knoll
23b14237f8 Port androidtestrunner to QRegularExpression
Change-Id: If135b29996b7036d65472a1b5fa4817cd7907aba
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
2020-04-15 14:37:35 +02:00
Alexandru Croitor
e835a6853b CMake: Fix $ORIGIN rpaths to work when passed on the command line
The CMAKE_INSTALL_RPATH cache var had the PATH type, which made
CMake transform the value into an absolute path, getting rid of the
$ORIGIN value.

Fix that by changing the cache var type to STRING.

Also clean up the all-caps commands, add a usage example and print
the install RPATH.

Change-Id: Ibf40cfde4283369ddfcf52609143799cc8e47d68
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2020-04-15 11:43:02 +02:00
Karsten Heimrich
786b48878f Improve Map|Map-Reduce and Filter|Filter-Reduce implementation
* support lambda expressions
* remove the need to specify result_type
* use std::invoke to apply map|filter function
* remove usage of FunctionWrapper* and createFunctionWrapper

Task-number: QTBUG-33735
Task-number: QTBUG-82646
Change-Id: Ibcbe4278f0742c29182bd506081db0abb516f85f
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Sona Kurazyan <sona.kurazyan@qt.io>
2020-04-14 19:06:27 +02:00
Vitaly Fanaskov
678b9f78a5 QTaskBuilder::spawn: add an overload that doesn't return a future object
Fixes: QTBUG-83175
Change-Id: Idf85e47a2732742884272200d5c753805eaa640b
Reviewed-by: Sona Kurazyan <sona.kurazyan@qt.io>
2020-04-14 17:44:13 +02:00
Leander Beernaert
c028cbccc2 CMake: Enable Moc for 3rdparty libraries
This is required to support QtVirtualKeyboard's third party OpenWnn
library.

Change-Id: I64b6a2b6b6b0259bea5aa249a8c901def31f916c
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2020-04-14 17:00:06 +02:00
Shawn Rutledge
310c5d8c55 Remove size assert in QMultiHash::take()
It doesn't exist in every instantiation of the template; this becomes
evident when attempting to build QQuickListView:

error: 'using Chain = struct QHashPrivate::MultiNodeChain<FxViewItem*>'
  {aka 'struct QHashPrivate::MultiNodeChain<FxViewItem*>'} has no member named 'size'

Change-Id: I24748c15f3995083eec06d86a3c0dced2209c303
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2020-04-14 14:15:59 +02:00
Leander Beernaert
a77cd07b24 CMake: pro2cmake expand variables for qt_add_resource()
Change-Id: Ida1196645dabcb0c3aee210d9bc5ee5632a9ccc5
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2020-04-14 13:19:23 +02:00
Shawn Rutledge
f38d5e563f Fix qConstexprNextPowerOfTwo(qint64) to return quint64
It doesn't make sense to lose precision, and that's a fatal warning
when used on a 32-bit platform:
implicit conversion loses integer precision: 'quint64' (aka 'unsigned long long')
  to 'quint32' (aka 'unsigned int') [-Werror,-Wshorten-64-to-32]

Also fix coding style.

Amends 7ef3826497

Change-Id: I2c8f51883d74f0c6dc1b5faefe7b3ace1d9c15b9
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2020-04-13 21:52:52 +02:00
Lars Knoll
466a424514 Fix example documentation to not mention QRegExp anymore
Change-Id: I2761d8efef31a3b890de9cab78589f1d6c03f62d
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
2020-04-13 09:40:54 +02:00
Lars Knoll
ea6c69bd6a Port test over to use QRegularExpression
Change-Id: I7f69fbbdb9e327059cd978b0989eee2c75c5a24b
Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
2020-04-13 09:40:38 +02:00
Lars Knoll
e174c2f7d7 Port tracedef to QRegularExpression
Change-Id: I38bbf36719c99d4fda102eca375011c38792dd4a
Reviewed-by: Rafael Roquetto <rafael@roquetto.com>
2020-04-13 09:40:26 +02:00
Lars Knoll
5b10b57c45 Port androiddeployqt from QRegExp to QRegularExpression
As a drive-by, also fix spelling of architecture.

Change-Id: Ibeaa6b611ddbb75b9492deb5d97a64ed8b030c3a
Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
2020-04-13 09:40:16 +02:00
Lars Knoll
33752a9bd3 Include QRegularExpression in the bootstrap library
This allows us to use regular expressions in bootstrapped tools
such as moc and tracegen.

Change-Id: I4310dd15bf26651aac6ab30c884e025ca06b3099
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2020-04-13 09:40:09 +02:00
Qt Forward Merge Bot
ce1d4d3628 Merge "Merge remote-tracking branch 'origin/5.15' into dev" 2020-04-11 15:04:45 +02:00
Qt Forward Merge Bot
58a4289800 Merge remote-tracking branch 'origin/5.15' into dev
Conflicts:
	tests/auto/network/socket/platformsocketengine/platformsocketengine.pri

Change-Id: I22daf269a8f28f80630b5f521b91637531156404
2020-04-11 14:59:13 +02:00
Martin Koller
ce672e1c9b avoid compile warning when using clang++ with -Wshorten-64-to-32
Change-Id: I78a6cd84ac5b8c250d9569d864a7e38269b85e10
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2020-04-11 09:42:37 +01:00
Shawn Rutledge
1ec350e35f Stop using obsolete TouchPoint rect accessors in tests and examples
Followup to cf4a8b12fa
68916fede4 and
3c159957f8.

Task-number: QTBUG-83403
Change-Id: Ieaf418860c565dbe883384e7f296a829fbfa1e33
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2020-04-10 13:54:43 +00:00
Volker Hilsheimer
033d01bd6e QApplication: remove obsolete globalStrut functionality
Change-Id: If56873f86f5291264cac720f8db7dbd4db756f49
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
2020-04-10 13:59:30 +02:00
Friedemann Kleint
c0873b7832 Fix a few size_t / int conversion warnings
Change the hash function of QTypeRevision and QtFontFallbacksCacheKey
to use size_t and add a few casts.

Change-Id: I89a8fc617abbe8b0c67529ec41795691c99b0574
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2020-04-10 11:30:17 +02:00
Andre de la Rocha
4c4693cf96 Windows: Provide a way to switch between WinTab and Windows Ink at run-time
This change adds the setWinTabEnabled() function to Qt Platform Headers,
which allows an application to set at run-time whether the WinTab API will
be used for tablet input instead of the native Windows Ink API.

[ChangeLog][Windows] The setWinTabEnabled() function added to Qt Platform
Headers now allows an application to set at run-time whether the WinTab API
will be used for tablet input instead of the native Windows Ink API.

Fixes: QTBUG-83218
Change-Id: I51d3c7316baeda136763cf37c2f54295905450ec
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
2020-04-10 01:52:35 +02:00
Mikhail Svetkin
ae57e4fba5 cmake: Add library mapping for QtHttpServer
Change-Id: I3e12f164f7f6891c60c0d9da700b888850021e53
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2020-04-09 20:11:31 +02:00