Also adjust pro2cmake to use the new qt_add_executable name
instead of add_qt_gui_executable.
No compatibility functions provided this time, so we'll need to follow
through all repos and regenerate all examples.
Two reasons for not providing compaitibility functions:
1) We don't intend add_qt_gui_executable to be public API
2) A previous case with qtquickcontrols2 and qttools pointed out that
making top-level builds work with cross-compatibility API is not
simple. So just go ahead and regenerate everything.
Task-number: QTBUG-87661
Change-Id: I2f228827b786ae03bf7e1bf3908ea02a8794ed52
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
"QFontDialog::accepted" was emitted before setting "selectedFont" to current font. So when calling "QFontDialog::selectedFont()" in slot of signal "QFontDialog::accepted",it does not return actual selected font.
Fixes: QTBUG-87483
Pick-to: 5.15
Change-Id: Ic9303e3df73ddd876fc78a0038f9379dbdf1853c
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
The QRE classes are not ready for move construction. They would
need to deal with the possibility of a null-dpointer, and they
currently don't; this clashes with the policy of having
moved-from classes in valid-but-unspecified state.
This reverts commit 733ab10961.
Change-Id: I36720dc9d0bf754a980eba373e37abf725cea174
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
For QRegularExpressionMatchIterator there is actually one code
path that modifies the object itself. Avoid spurious calls to
detach() in there by making the detach explicit, and streamline
the rest of the code around it.
QRegularExpressionMatch only has a const API so it "doesn't care",
but port it for consistency.
Change-Id: I26881b3af9ae75082dd39462115869b1a9ee1339
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
This is useful in cases like error handling when you need to print the
name of the lock file.
Change-Id: Ife4901ed53ae81d19e68cce7f1c173ef3745d56f
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
We now require C++17 and thus C++11 features or standard headers
should no longer be conditional.
Change-Id: I6b72306e809f71ec77acf7ffb97e2ed2ccd96e9d
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
If the maxSize argument is 0 (the default), QIODevice::readLine will
allocate a QByteArray with the size of the next chunk of data, which
may be quite large. Before returning, it then resizes the byte array
to the actual size that was read.
But since change 6b884d2aa1, QByteArray::resize() does no
longer shrink the capacity. This means that the returned QByteArray
keeps it's maximum size as allocated memory. This can lead to
excessive memory consumption, especially if the returned QByteArray's
are stored for further processing in the client code.
Fix this by explicitly calling QByteArray::squeeze() before returning.
[ChangeLog][QtCore][QIODevice] Fixes a regression in Qt 5.15 causing
QByteArray's that are returned by QIODevice::readLine() to
consume large amounts of memory.
Fixes: QTBUG-87010
Pick-to: 5.15
Change-Id: I1f95fc4098849e900680fc945238bfeda881022c
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
The most common uses of QRandomGenerator are getting 32- and 64-bit
quantities, either through the generate() and generate64() functions or
by ones that call those, like bounded() or generateDouble(). So optimize
for those with the same entry point by returning one 64-bit value from
the _fillRange() function. Further optimize by not requiring a buffer
for those two cases, which required us to replace the (begin, end)
parameters with (begin, count).
Change-Id: I3eb349b832c14610895efffd16356859eecd5397
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
It was used as exported symbol for the implementation of
QByteArrayList::indexOf. Since then, the implementation has
been changed, and this code is unused.
Change-Id: I468d05507b6b520cf5bfa4bc567a3d67c43b9a32
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Silence the warning, and test event delivery in addition.
Change-Id: I59c49a2ac70ecd32429116b76643700a7ad5ce3e
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Replace the hand-rolled refcount management with QESDP.
Since the class has a default-constructed / moved-from state
where the d-pointer can be nullptr, add a in-class detach() that
ensures a private object.
Change-Id: Id81431fa60132dbc0eed45bb60b38d4f7d73833f
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
The only thing we need to modify at runtime is the typeId and that can
be mutable. This way we can have a constexpr ctor for QMetaType which
hopefully makes the importing and exporting of related symbols less
fickle.
On Windows we cannot make QMetaTypeForType constexpr as that leads to
mysterious errors in other places. Until we figure out why that is, we
just leave this class as non-constexpr.
This reveals that qcoreapplication.h and qvariant.h are using QDebug
without including it. We now get template instantiation errors. Include
qdebug.h to avoid that.
Change-Id: If1bf0437ada52459c59c6fa45bab3d22dfb0bc92
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Otherwise they are not available to the tests. This is exposed by making
the metatype interfaces constexpr.
Change-Id: I1b3214f339985f2f8ffaf0640cf51e41e92198d0
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
The namespace and overviews are in the qtdoc repository.
Docs for individual interfaces should live with their platform.
Change-Id: Iba5fd7e9ebc4f1f634ec9dc3ec125ce88a1312ba
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
After detaching, the current QMutableEventPoint obviously doesn't
reference old QMutableEventPointPrivate anymore. Deref it, so that we
do not leak memory.
Change-Id: I3b59667603d41f452eead9a2db13e1d005f622ec
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
Do not print warnings for the configure arguments -commercial,
-opensource and -confirm-license. We're not removing the arguments yet
to keep existing build scripts working.
Fixes: QTBUG-86096
Change-Id: Ieb63e2f2b81c022e8559cde6c3e0be0b8ce655ca
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
If we require a value, then we need a dtor, too. This is not always the
case. For example QSessionManager has a private dtor, leading to
failures.
Change-Id: I3f715848ff5c63b2ea2773c17bced21e7a814ca9
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Ammends 27499d25fb
The value used to create the PCHs for _WIN32_WINNT is 0x601, and
qwindowspointerhandler.cpp requires for MinGW 0x603. Since the
precompile header value cannot be undefined while compiling the
source file, it's better not to use the PCH for this particular
source file.
Change-Id: I2dc10fa11f0a796c2d21d8880e32e911359f1602
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Having the qrc files at configure time allows qmlimportscanner to
scan them when invoked with -qrcFiles argument.
The traceability part is done via _qt_generated_qrc_files property.
Task-number: QTBUG-85994
Change-Id: I75c252a987cd1c1f49ba73ec9d100edc73c23486
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
The use-case is relevant for other platforms as well.
Now that Qt has a module system we can also replace a lot of the
hand crafted logic for linking with simpler constructs.
Change-Id: Ib6853aaf81bfea79c31f2de741d65b4b56f23ef6
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Avoid creating a a d pointer for recursive mutexes.
Change-Id: I28af15a416ee17de346e2ea5b1442279d9d3e159
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
These classes should not inherit from each other
anymore in Qt 6. The reason is that this makes
the 95% case of using a non-recursive mutex
much slower than it has to be.
This way, QMutex can now inline the fast path
and be pretty much as fast as QBasicMutex is
in Qt 5. They actually use the same code paths
now. The main difference is that QMutex allows
calling tryLock() with a timeout, which that
is not allowed for QBasicMutex.
[ChangeLog][QtCore][QMutex] QMutex does not support
recursive locking anymore. Use QRecursiveMutex for that
purpose. QRecursiveMutex does not inherit QMutex anymore
in Qt 6.
Change-Id: I10f9bab6269a9181a2e9f534fb72ce65bc76d989
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Since we're going to split QMutex and QRecursiveMutex into
separate classes, make sure QMutexLocker is prepared for that.
Change-Id: Id5e9a955d1db7c8ee663dd3811ad6448dad0aeae
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Ensure that we show a cursor directly after a client connects.
Fixes: QTBUG-85006
Pick-to: 5.15
Change-Id: Icb604beb1b0ca2e7efa42ac01c2aac0a3e002865
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
On some platforms, tablet events do not have a time stamp.
Task-number: QTBUG-46412
Change-Id: I3cc820b1edaaf55511c000fefb805f5a3a7872a6
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
In a macOS environment, Clang throws a number of compiler warnings
about loop variables when building qtbase.
See task for more info about the environment.
This changes a handful of loop variables,
like QJsonValue references into QJsonValueRefs.
Task-number: QTBUG-87216
Pick-to: 5.15
Change-Id: I26006efd7c75c2d56ebc7f7efb4c9bdcabe92e8b
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
The return value can be ignored here, so make intention clear.
Change-Id: I116869c47039b159db96f133b5850a2215873c2f
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@gmx.de>
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
QEventPoints are equal when all data values are equal, the
refcount is ignored.
Change-Id: I6ef70faf0b12129eaa22bfc1f0a45bab2422d421
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
The code only existed to avoid the auto-generated
Q_IMPORT_PLUGIN(QIOSIntegrationPlugin), but nowadays
with bitcode enabled the code is not used, plus we end
up with this auto-generated file for other plugins anyways.
Change-Id: I91c8c88f4e825caab7d7d5250edaba8c57cb7374
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
When compiling in RelWithDebInfo configuration with g++-10.2,
it complains:
qtbase/src/gui/painting/qdatabuffer_p.h:71:36: error: argument 1 range
[18446744065119617024, 18446744073709551612] exceeds maximum object size
9223372036854775807 [-Werror=alloc-size-larger-than=]
This patch disables this warning in this place.
Pick-to: 5.15
Change-Id: Id3154ce80a1921671031828aaa7144214adad5dd
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
The test helpers are used both in the qtconcurrentmap tests and in the
qtconcurrentfilter tests. In the future, they should also be used
in generated tests. This patch moves the function out of the
qtconcurrentmap folder as it is not specific to 'map'.
Change-Id: Ie79a7ae3040a7eab7364a3aabf934158c7527b5a
Reviewed-by: Sona Kurazyan <sona.kurazyan@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Tests the move semantics of QImage in Qt6.
Change-Id: Ia4d95f0b88ca7dde0daf85a0f53049b42b5be1a5
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
Some of them have a different (hopefully better) name now.
Some are marked as Technical Preview.
Some are renamed to be internal.
Marking add_qt_gui_executable as TP with the intention to un-TP it
after we rename it and change its behavior as discussed in the API
review meeting.
Additional changes to add_qt_gui_executable and qt6_add_resources have
been filed as separate tasks that will be worked on separately.
See comments on PS1 for details.
Task-number: QTBUG-86827
Change-Id: I56a84a1943b0902bb807310dc620eb381824e8dd
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
For iterators that return a value, don't use reference in ranged for,
and cast numeric literal to correct size type for QCOMPARE.
Change-Id: Idfd09dbc2ef3ab1bf025c7859ea6e2e9572bc9a1
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
When configuring an example like
widgets/tools/plugandpaint/plugins/basictools outside of a Qt build,
the configuration fails because it tries to call the internal function
instead of the public one.
This was needed some time ago to facilitate moving from qt_add_plugin
to qt_internal_add_plugin, so some compatibility code was added.
But we've now migrated to qt_internal_add_plugin across most repos,
so we should remove the compatibility code to allow examples to
configure successfully.
Amends 6fbeef4c6b
Fixes: QTBUG-86858
Change-Id: Ib15f50351a8742c44d7a8be84be4e576cb48bddb
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
The makefile generated by qmake when building an iOS example tries to
execute the mkspecs/features/uikit/devices.py python script to find
a simulator ID.
When installing the mkspecs, we didn't preserve the source file
permissions which means that the executable bit was stripped.
This causes the makefile to call xcodebuild with an invalid simulator
id due to not being able to execute the python script.
Make sure to install the mkspecs directories preserving the source
file permissions.
Fixes: QTBUG-87639
Change-Id: Iaa33b740c93187155025891104e8a21c6e7c98c8
Reviewed-by: Cristian Adam <cristian.adam@qt.io>