TCBEase is-a BezierEase, but overrides value(). It only performs additional
checks and then calls the base class' implementation, but it feels wrong,
like a bug waiting to manifest itself, that slicing should occur on cloning
a TCBEase.
Fix by adding the missing reimplmentation.
Change-Id: I2524f51fec1850ff36ed706bc79e9592734d8680
Reviewed-by: Jan Arve Sæther <jan-arve.saether@qt.io>
Amends e89fbd8c3a.
- While QString::data() never returns nullptr, QStringView::data()
may, which makes calling QStringView{}.toWCharArray() UB on Windows
(since memcpy's 2nd argument must never be nullptr, even if the size
is zero). Fix by protecting the memcpy call.
- QStringView, by design, does not use out-of-line member functions,
because calling these forces the QStringView object onto the stack.
Fix by making inline.
Also use the more efficient qToStringViewIgnoringNull(), as the result
does not depend on QString::isNull() (no characters are written
either way), and add a missing article to the function's docs.
Change-Id: I5d6b31361522812b0db8303b93c43d4b9ed11933
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Now that all our supported compilers know char16_t, we no longer need
QStringViewLiteral, whose only purpose in life was to turn u"" into
L"" for MSVC < 2015.
Change-Id: I25a094fe7992d9d5dbeb4a524d9e99e043dcb8ce
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
This will make it possible to return it from functions in an owner,
as exemplified in the QFileInfoPrivate ctor, unlike QScopedPointer,
which lacks move special member functions.
Change-Id: I179ffa4f656e1b83c23e0f67d1542834460ff382
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Use std::next, which will transparently loop over ++it instead of
calling op+, whenever the time has come to do so.
Change-Id: Icee38bd96894488cf53c1596cd611c61cc68ace8
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
The test instantiated and deleted a model in each test which is
wasteful since not all tests use it. Remove it and introduce per-test
variables instead.
Task-number: QTBUG-76493
Change-Id: I1684ea5b8eac7b52bb99e830f723693c51e8b9a5
Reviewed-by: Christian Ehrlicher <ch.ehrlicher@gmx.de>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
This amends commit 1d8c9978fa in which I
perpetrated this typo.
Change-Id: Iccfc14aff7c4f3976b92919c8e8dc4b7906642ae
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
- Use nullptr
- Instantiate test helpers on the stack or use QScopedPointer
- Remove C-style casts of enumerations/flags, use meta types
- Port to Qt 5 connection syntax
- Fix static method invocation
- Use initializer lists for QStringList
- Introduce a logging category for all debug output
- Streamline code
- Refactor cleanup() to operate on QFileInfoList which is faster
and streamline
- Remove unused variables
Task-number: QTBUG-76493
Change-Id: I3a033af7c9ec4dac3149d2016104daad07797a4f
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@qt.io>
This reverts commit df2b76046d.
The patches causes high cpu load and it looks like vsync is done
by newer NVIDIA drivers out of the box without such a implementation.
Change-Id: I41c9cfcf1bbdf7da9b764394e4442768084e9a35
Fixes: QTBUG-74866
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
It was using if/else with extraneous braces, where simple ternary operators will do.
It was doing a StringView content check clumsily when mid() and startsWith() suffice.
Change-Id: I693f29ce5b425d53469d2c756fe27459f36470e9
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
QScopedPointer is scheduled for deprecation, and can't decide whether
it wants to be a scoped, or a unique pointer.
The use of a unique_ptr members requires that the destructor be
out-of-line, since the payload classes are only forward-declared in
the header file.
Change-Id: Id0dcdde52cb3adc30d3051d2eed1d24c76154921
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
There were many. Reflowed some documentation to 80 columns, split all
code lines that exceeded 100 columns. Revised the splitting in a few
cases that were inelegant or conflicted with our coding style. Added
braces to some bodies of split control lines.
Change-Id: I56eb9632f6399f0db1293477966f7d553f196a5b
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
It's a bit cheesy solution, but works as I've noticed first on
QSlider's with a ticks direction 'both'. Works because we were
already using numberOfTickMarks property to trigger a special
behavior for HIG non-compliant widgets. Works for our case too
- we trigger a geometry update.
Fixes: QTBUG-76811
Change-Id: I2cbf00d42d98e78519b281d138a2f74227ef5449
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Use the standard tool instead of self-made stuff that cannot decide whether
it wants to be a scoped pointer (why take()?) or a movable one (why no move
special member functions?).
Take advantage of C++11 local structs for pulling the custom deleter into
the scope where its only user is located, too.
Change-Id: I7e097a59edef9adc8455504ae94b8df0f8b9e5d2
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Now that we have QStringView::arg(), we can use it to implement a
similarly flexible QString::arg(). It's not as straight-forward as in
QStringView, though: QString has existing arg() overloads that all
become worse matches with the introduction of the new,
perfectly-forwarding overload.
So in order to allow calling of the other arg() functions, first
constrain the new arg() function to arguments that are convertible to
QString, QStringView, or QLatin1String, and then delegate to the
QStringView version. To stay compatible with the previous overloads,
which accepted anything that implicitly converts to QString (in
particular, QStringBuilder expressions), add a new overload of
qStringLikeToView, taking const QString &. This benefits the existing
QStringView and QLatin1View versions, too.
[ChangeLog][QtCore][QString] QString::arg(QString, ..., QString) can
now be called with more than nine arguments, as well as with
QStringViews.
Change-Id: I1e717a1bc696346808bcae45dc47762a492c8714
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
QNetworkAccessManager::connectToHostEncrypted()/connectToHost()
creates 'fake' requests with pseudo-schemes 'preconnect-https'/
'preconnect-http'. QHttp2ProtocolHandler should handle this
requests in a special way - reporting them immediately as
finished (so that QNAM emits finished as it does in case of
HTTP/1.1) and not trying to send anything.
We also have to properly cache the connection - 'https' or
'http' scheme is too generic - it allows (unfortunately)
mixing H2/HTTP/1.1 in a single connection in case an attribute
was missing on a request, which is wrong.
h2c is more complicated, since it needs a real request
to negotiate the protocol switch to H2, with the current
QNetworkHttpConnection(Channel)'s design it's not possible
without large changes (aka regressions and new bugs introduced).
Auto-test extended.
Fixes: QTBUG-77082
Change-Id: I03467673a620c89784c2d36521020dc9d08aced7
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Winrt does device independent scaling by default so that overwriting
pixelDensity for QWinrtScreen will break the use case of setting
Qt::AA_EnableHighDpiScaling. That mode is basically always active on
winrt.
Task-number: QTBUG-76363
Change-Id: Ib522201850d17757be4a80aa819c3f1245ca7147
Reviewed-by: Maurice Kalinowski <maurice.kalinowski@qt.io>
Reviewed-by: André de la Rocha <andre.rocha@qt.io>
This commit re-applies commit f8efe8e0c9,
which was lost in the recent tools → text changes.
Change-Id: I03ce35fcb89840e5607776d67578fb75b66f6eb2
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
Take color space into account when comparing images, and fix gamma
comparison that was trying to be too accurate.
Change-Id: I3674653abb21b66aaacb557addc4afb4ee75cfdd
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
Deprecated APIs of sql lib are used only in tests. This change
makes sure, that the tests build and pass with those deprecated APIs
removed or disabled, by:
- Making the parts of the tests testing the deprecated APIs to be
compiled conditionally, only when the corresponding methods are
enabled.
- If the test-case tests only the deprecated API, but not the
corresponding replacement, added tests for the replacement.
Task-number: QTBUG-76541
Change-Id: I93ed6ff92c7aa7af2c106b1a9d92d3704c7d9105
Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
Added QApplicationPrivate::keypadNavigationEnabled() as a
replacement of deprecated QApplication::keypadNavigationEnabled(),
for the internal usage.
Task-number: QTBUG-76491
Change-Id: I75f4c628b72d86b5e428e7e285a786d23abbf3f2
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Deprecated APIs of network lib are used only in tests. This change
makes sure, that the tests build and pass with those deprecated APIs
removed or disabled, by:
- Making the parts of the tests testing the deprecated APIs to be
compiled conditionally, only when the corresponding methods are
enabled.
- If the test-case tests only the deprecated API, but not the
corresponding replacement, added tests for the replacement.
Task-number: QTBUG-76541
Change-Id: I78c4913155007fd1d0df2c38e1b9a8b80066adeb
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
It turns out that Qt3D has uses of x() and y() in a header, which is
an error rather than just a warning. So we need more time to do
a qt5.git submodule update, then fix Qt3D. Amends
7d29807296
Change-Id: Ibead628e7094316bb17d5924f6c6f75dbda5826b
Reviewed-by: Liang Qi <liang.qi@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Imports were expanded in the list of commands every time they were
evaluated. This meant any test with imports ran slower and slower the
more iterations it got through.
Fixed by creating a new PaintCommands object every time and living with
initialization of it being part of the benchmark results.
Change-Id: Ib53a3a25f1393437452bc5aede04ccb63e8715a6
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
Emscripten has changed the key code to include the string 'Digit'
on numerals. We use this to detect and translate any Dead keys that
may be pressed.
Fixes: QTBUG-77041
Change-Id: I054e98a6cf66390b1154f25fe385e5b12840851f
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
It was somewhat incorrect in a few places.
Some of these should be moved to QOpenGLFunctions/Extensions later.
Change-Id: Ibc7a6409f16ddf1ad71230671dcad558dac1b86f
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Beta version of Xcode 11 changes the format of the json object
returned by simctl and used to detect running simulators.
While multiple versions of Xcode can coexist on the same system,
they share the same simulator infrastructure so installing
Xcode 11 Beta affects projects using previous versions.
Change-Id: Icf06a794aa5ba3624163ace2ce827c0ecf97c38c
Reviewed-by: Frank Osterfeld <frank.osterfeld@kdab.com>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Also optimized the existing QL1S overload of non-const operator[](), and
applied Extract Method refactoring to the other existing QL1S overloads.
[ChangeLog][QtCore][QJsonObject] Added insert(), remove(), and take()
overloads taking QLatin1String.
Change-Id: I5e737cf2d7d9ffb325d6981db1e4a6a9f093657b
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Anton Kudryavtsev <antkudr@mail.ru>
[ChangeLog][QtCore][JSON] Added overloads of functions taking key
strings as QStringView; in QJsonObject, QJsonValue and QJsonDocument.
Change-Id: I78b40aba8200003acfae257ff06f5f15737005e7
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Anton Kudryavtsev <antkudr@mail.ru>
Refactored parts of insert() into a new private method insertAt(), which
can also be called by operator[]() to avoid a redundant key lookup.
This is in preparation for overloading QJsonObject's non-const methods
on QLatin1String.
As a bonus, this also avoids a redundant key lookup in
QJsonValueRef::operator=().
Change-Id: Ic481981d838e50bc55fb8e7844536749781899ce
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
Reviewed-by: Anton Kudryavtsev <antkudr@mail.ru>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Explicitly setting the application font and palette will actually
persist the current state of the application font and palette to
the widget, and it will stop reacting to system style changes.
Change-Id: Ib856fe86cd3edb618b7ee5819d6c6c892c61fd1d
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
QObjects are not even reentrant, but this class must be thread-safe,
so it's always ... icky ... to have to analyze a "thread-safe
QObject", because for all intents and purposes, that's an oxymoron.
The QObject-ness isn't even used, except for defining a private slot,
connected to QCoreApplication::destroyed(). That slot just calls
waitForDone() on QThreadPool, which is a QObject itself, so use it
as the context object for the signal-slot connection, using a lambda
as slot.
So, strip the class of it's base class, convert the private slot to a
lambda and connect to that. Finally, remove the moveToThread() call,
because this new class can be destroyed from any thread, not just the
main one.
Change-Id: I0e33983aa7afd0ad621ece4afd10d9e4adad38c1
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
It conflicts with 'requires' keyword.
Fixes: QTBUG-77093
Change-Id: I85e8f530dd1e2bf9a31906dd6c5123b947235b01
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
When successfully finishing a parse, it's reasonable to expect that the
QIODevice was advanced to the end of the input data.
[ChangeLog][QtCore][QCborStreamReader] Fixed a bug that caused the
QIODevice that the data was being read from not to show the entire CBOR
message as consumed. This allows the user to consume data that may
follow the CBOR payload.
Fixes: QTBUG-77076
Change-Id: I1024ee42da0c4323953afffd15b23f5d8fcc6f50
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: BogDan Vatra <bogdan@kdab.com>
Unfortunately, we can't, yet, change QAbstractFileEngine::create() to
return a unique_ptr. But we should do it in Qt 6.
Change-Id: If18ff766bce73ecd4143274ac9f9a5a7b9d5912c
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>