Add missing implicit size checks of tags by passing the already checked
explicitly given size forward.
Also adds my fuzzing test for the ICC parser as it is security critical,
by being used by multiple image formats.
Change-Id: Ieb632ccb78f9b445a276959ffbd66fa04a7a5b45
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
Clean up QSortFilterProxyModel by using const refs instead copies and
range-based for loops instead plain loops
Change-Id: Ic1250f33e7c311a9e1d3c19cc5dc7a9578423e74
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
... in an attempt to get qt5 integration going.
Change-Id: I22dd6ff2cb9a6d11620878c432905bd07292220b
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Leftover from the migration to QColor as color clear value.
Change-Id: Ibf49d65234a1e14d53035b46249753a5929ca22b
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
The Quick render loops do SkipPresent occasionally, and it all seemed
to work with the threaded one because we lack an autorelease pool on
the SG render thread. (to be corrected separately) The basic one ended
up crashing sometimes, however. Holding on to the drawable is incorrect.
Fixes: QTBUG-76953
Change-Id: I0d0ec6d09aa209d2c848d7a9dbd9b15916fe23ab
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
...by notifying QVulkanInstance about the present. With the xcb platform
this then gets turned into updating the sync request counter.
Change-Id: Iecfb6d10ead3befcb24c19433d4712ed73a84bb4
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
...because
- it calls the properly camel-cased member function buildArgs(bool),
which is slightly confusing
- it returns buildArgs(true) plus input and output
We also let it return only the arguments, excluding the qmake
executable. This is consistent with the function's name and saves us a
string replacement stunt at one call site.
Change-Id: I8bea65900bd51962962e4cfd425ffbc26e3a52fe
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Remove usage of the 'if (0 && ...)' pattern that was presumably used
to temporarily disable code paths. The disabling of the two code paths
was introduced in 356a677b386648710efc4db9a8a1b4a975f95c48 (old
internal history, 2004) and
0326e3511928d90329152b9b0493da76e9caa442 (old internal history, 2006).
It can be deduced that it's pretty safe to remove both.
Change-Id: I88aee65b1286701241b5b80fbac0c65cd99ecd5e
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
We have contentsMargins() and textMargins() methods since 4.6 which
are much more efficient and easier to use.
[ChangeLog][QtWidgets][QLineEdit] The getTextMargins() member function
has been deprecated in favor of textMargins().
[ChangeLog][QtWidgets][QWidget] The getContentsMargins() member
function has been deprecated in favor of contentsMargins().
Change-Id: Ifdb890af6198fc682b94701786c67a5b945a4b4c
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Instead of creating an explicit QEasingCurve object in each
switched-over case, extract the conversion between the enums
involved into a helper and just call setEasingCurve() with
the result (implicitly converted to QEasingCurve).
Saves 0.5KiB in text size on optimized AMD64 Linux GCC 9.1
builds.
Change-Id: I81b5d7199d9dd99ba3735c910a50e371e0b99838
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
A default: case label turns off compiler warnings for missing
enumeration values, which we'd like to have, so remove it.
Change-Id: I96247a7fc46e91a29591a907e52841a90df62f10
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Replace the four ints xTextMargin with one QMargins member, and the
effectiveXTextMargin() function with effectiveTextMargins(). The
left and right effective margins were always used together, so this
in no case leads to extra work, compared to separate functions.
Change-Id: I46d061919ffac297142213ccb4033caa0288b554
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Commit 8010e906d3 accidentally ended up
removing the removal-on-undefined-insertion check by calling insertAt
instead of insert, which had it. This patch moves the check back into
setValueAt.
Change-Id: Ic381e284d3da37e31c4eb29f79dfab9c55c2e3e9
Fixes: QTBUG-77204
Reviewed-by: Liang Qi <liang.qi@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
On Windows, create a file containing include paths for QDoc in
cases where number of include paths exceed 30. Based on how moc
does this.
Task-number: QTBUG-68259
Change-Id: I0d03fab4b809174cb6b48c36ee9f8880ff294ff4
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
Reviewed-by: Martin Smith <martin.smith@qt.io>
Instead, use (void)x; directly.
The current use of Q_UNUSED(x); generates warnings for an
empty statement the expansion of Q_UNUSED contains a semicolon
already.
Emitting Q_UNUSED(x) without the extra semicolon would be
an option, too, but as the future of Q_UNUSED's embedded
semicolon seems unclear right now, avoid its use altogether.
The change affects only generated code that's barely ever
read by a human, so the overall utility of "improved readability"
of Q_UNUSED in that place is questionable anyway.
Change-Id: I332527ed7c202f779bd82290517837e3ecf09a08
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
This reverts commit eea99e1e8f.
The call to FcFreeTypeQuery() takes over 300 ms for
NotoSansCJK-Regular.ttc and friends, so in the current state,
this change cannot be used. I am not sure why these file
in particular takes so long, but it might be because it is
large (around 19MB) or because it is a font collection.
The original fix was intended to be a smaller performance
optimization, but it has added over 2 seconds startup time to
simple applications showing Chinese text, so we revert it
for now and it can be resubmitted later when the problems
have been ironed out.
Task-number: QTBUG-77108
Change-Id: Ibb2ef799573d7effd1595d788939fe33d82cc923
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
- Fix else after return/break
- Fix use of int as boolean literal
- Use range-based for in some cases
- Avoid copies by using const-ref
- Remove unnecessary null-check before delete
Task-number: QTBUG-69413
Change-Id: I69f46e6deaa55ef70a8b3a61e6539c79a64aaa23
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Now that all supported compilers support char16_t, we don't need the
storage_type == wchar_t hack for MSVC anymore.
Remove it. Adapt docs.
Change-Id: I55df6c8a9fa5a9c7e6f53ba89f3850956b369061
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Ville Voutilainen <ville.voutilainen@qt.io>
The code parses a file, looking for XDG_*_DIR entries and stores each
one's key and raw value in a QHash. After parsing, it, however, looked
up exactly once, by a key it could have known all along.
So, move the key computation before the opening of the file, and look
for the correct key directly, consciously striving to continue to
find, as the old code implicitly did, the last entry, since man 5
user-dirs.dirs explains:
> The format of user-dirs.dirs is designed to allow direct sourcing of
> this file in shell scripts.
Which means last one wins.
Port to QStringView API of QRegularExpression, too.
Change-Id: Ie92b689b5b9221df918c67b96f2f6a09827e7b1e
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Reviewed-by: David Faure <david.faure@kdab.com>
Amends 83de6d0ce5.
The interface of png_set_iCCP() changed source-incompatibly from 1.4
to 1.5. #ifdef on the version as is done elsewhere in the code. Drop a
no-op C cast.
Also add PNG_iCCP_SUPPORTED around the new code, as that check is used
elsewhere in the code.
Change-Id: Ie203bd9eebea5697f426fa3e95591f86346b2685
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
This is part of the migration of qtbase from QRexExp to
QRegularExpression.
Task-number: QTBUG-72587
Change-Id: Id82e103d4076fed63c871385b2b0f21c04735d00
Reviewed-by: Andy Shaw <andy.shaw@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
QSlider rendering is currently broken as the context used to render it
is not properly translated. This patch fixes that.
Fixes: QTBUG-72970
Change-Id: I30896ceee1f37f6dfcf01a342d10af3bb279ac8a
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
Without treating -force_load as an option with an argument, we end up
leaving stray -force_loads in the linker line, resulting in build
failures when the following option is a random library then treated
as a file path.
Task-number: QTBUG-66091
Change-Id: I352c50ab67e32ef6b2b5c6a4f90455b20034e207
Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
The linker doesn't support -framworkFoo, so neither should we. The correct
syntax is -framework Foo.
Change-Id: I3f39ffc067871ce058542bf0068274b35f7b51f6
Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
QApplicationPrivate::focus_widget became a dangling pointer
in the following scenario:
A widget first gets focus and later on gets a focus proxy.
QApplicationPrivate::focus_widget was still pointing to the initial widget.
Upon destruction, QWidget::hasFocus() [which follows to the focus proxy
and then compares with focus_widget] was therefore false for both
widgets. So QWidget::clearFocus() didn't call
QApplicationPrivate::setFocusWidget(0) for either of them. As a
result, focus_widget remained set, and became dangling.
In real life, this happened with a QWebEngineView, which the application
gave focus to upon creation. At that time it doesn't have a focus proxy
yet. That happens later, in QWebEngineViewPrivate::widgetChanged.
https://bugs.kde.org/show_bug.cgi?id=381793
Change-Id: Ifee610bb76a2d4d2797b98ece9bffe5fffe3c6a6
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
This is basically a backport from weston:
75487c2560
It states that:
- preserving the existing CRTC -> encoder -> connector routing will
make the startup faster
- the existing routing may be set according to some device limitations
Since the QtWayland implementation appears to be based off an old
version of weston (maybe pre-2.0), this patch might look different from
the latest weston implementation. But the idea stays the same.
FWIW, this works around the issue I've seen on Renesas R-Car E3 (aka
Ebisu) board. Without this patch, VGA1+HDMI1 setup would fail because
the device reported possible_crtcs=1 (meaning {crtcs[0]}) for the second
screen "HDMI1", but the crtcs[0] was already taken by the first screen
"VGA1".
No usable crtc/encoder pair for connector "HDMI1"
With this patch, the crtcs[1] is paired with "VGA1" (as it is the
existing routing), so the crtcs[0] can be allocated for "HDMI1".
Change-Id: Ibd304a8b5efbe4a8aa94b2c5697fe2b399386280
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
QImage comparison has always ignored differences in
metadata. Introducing colorspace comparison can break backwards
compatibility, as not all image formats or handlers have colorspace
capability.
This partially reverts commit
733ca2230c.
Fixes: QTBUG-77205
Change-Id: I1d525a9727e84502624cd118f503eec7be306c99
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
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>
The Surface Pen eraser button generates Meta+F18/19/20 keystrokes, but
when it is not touching the screen the Fn WM_KEYDOWN message is eaten
and only a Fn WM_KEYUP message with the previous state as "not pressed"
is generated, which would be ignored. With this patch we detect this
case and synthesize the expected key events to allow the button to be
used in applications.
Fixes: QTBUG-77153
Change-Id: I075f5cbb903cb36c9ec241ee1bb31d436b725e3a
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
The same logic is needed for QWinRTFileEngine. To be able to reuse the
code, it was moved out of the class.
Task-number: QTBUG-77095
Change-Id: If52b2fc8a0f3056d32fc693775565a1c3803b7d4
Reviewed-by: André de la Rocha <andre.rocha@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Fixes: QTBUG-77095
Change-Id: I45b38fab779518c49b22077c493d8640572d40d9
Reviewed-by: André de la Rocha <andre.rocha@qt.io>
Reviewed-by: Maurice Kalinowski <maurice.kalinowski@qt.io>
This change allows using custom flags for ar. For instance, it is
now possible to create a thin archive by setting QMAKE_LIB += -T.
This uses and extends commit d92c25b1b4
which served a similar purpose for the linker.
Change-Id: Ie1d6a0b957dc4809957726de00911c8d91647fab
Reviewed-by: Jörg Bornemann <joerg.bornemann@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>
Passes locally, and there is no reason why it shoulnd't. Use IPv6
addresses for Google and Cloudflare DNS servers, and as with the IPv4
tests, rely on Python and (as a fallback) nslookup to produce the
reference.
Change-Id: I584f8ae9bc89c66a1f59d7b1e7493d0ed8033e8a
Fixes: QTBUG-22287
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
Fixes: QTBUG-77132
Change-Id: Ic0410297a2215f1b7b656966cbe84b925706532f
Reviewed-by: André de la Rocha <andre.rocha@qt.io>
Reviewed-by: Maurice Kalinowski <maurice.kalinowski@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>