This is a continuation of commit 5c9d671bfb.
[ChangeLog][QtCore][QStandardPaths] Improved conformance to the
Freedesktop basedir spec by ignoring any relative paths in XDG_*
environment variables.
Fixes: QTBUG-58043
Change-Id: I7c34143ced97d6d3de6ecbf13bccf9e935462d1e
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Otherwise the finalizers won't know which libraries we're linking to.
Pick-to: 6.5
Change-Id: I886c46443b7289d6e2c7d824767ed5e34a0a1fbf
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
We already have the necessary machinery in qnetworkproxy_darwin.cpp
Pick-to: 6.5
Change-Id: I01d99c825ed794f1ff5ba229e64f9963b819228c
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Move types to QtPrivate, fixing errors like:
error: QCalendarWidgetPrivate’ has a field
QCalendarWidgetPrivate::m_model whose type uses the anonymous namespace [-Werror=subobject-linkage]
The error appears in CMake Unity (Jumbo) builds apparently
due to multiple anonymous namespaces per file.
Task-number: QTBUG-109394
Pick-to: 6.5
Change-Id: Id678af4db5633b1b2267425c7751f1312935d5d5
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
Reviewed-by: Jan Arve Sæther <jan-arve.saether@qt.io>
The test function used only the left button to test mouse event
propagation.
This patch adds the right and middle buttons to the test data.
Task-number: QTBUG-110055
Pick-to: 6.5 6.4
Change-Id: I02683168216843919e889987a8b0e8a0f1592d3a
Reviewed-by: Doris Verria <doris.verria@qt.io>
It causes clashes in CMake Unity (Jumbo) builds.
Change the function to be Q_AUTOTEST_EXPORT'ed helpers.
Pick-to: 6.5
Task-number: QTBUG-109394
Initial-patch-by: Amir Masoud Abdol <amir.abdol@qt.io>
Change-Id: I2e4032e07e1c39432cae1eb2dfff94be33846c09
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
QAnimationGroup, QAnimationGroupPrivate uses now qsizetype instead of the int.
Task-number: QTBUG-103530
Pick-to: 6.5
Change-Id: I96053a609bc4fad32adce5616eef1af9a86f4e27
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
The QByteArray is assumed to contain an SQLTCHAR string (so, either
UTF-8, UTF-16 or UTF-32-encoded). Only in the UTF-8 case would the
size of the byte array be the same as the size of the SQLTCHAR string
in codepoints, yet the size in bytes is what the code passed to the
QVLA<SQLTCHAR> append() call, causing it to read past the QByteArray
buffer in the UTF-16 and UTF-32 cases.
Fix by properly calculating the string size from the size-in-bytes and
then memcpy()ing into the QVLA. We use memcpy() and not
QVLA::append(T*, n) because the QByteArray buffer need not be aligned
on an alignof(SQLTCHAR) boundary (certainly not since it gained the
prepend "optimization").
Pick-to: 6.5 6.4 6.2 5.15
Change-Id: If3838c3dee89e6aca65541242642315b8e1fa6b4
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
memcmp and openssl callbacks are somewhat of a red flag, so use
CRYPTO_memcmp for the sake of looks.
Done-with: Maximilian Blochberger
Change-Id: I38d038ed96830cfd54c6f5cd684f80bee8d42899
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
This flag is properly supported everywhere it is defined. There's no need
to retry any more.
Change-Id: I12a088d1ae424825abd3fffd171d6ad10d18247e
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
It makes far more sense here, because we can also avoid the need to save
the old key file name.
Change-Id: I12a088d1ae424825abd3fffd171dfaa5dca8a36e
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
When the match finds a surrogate pair as the first true Unicode character,
then we need to skip both code units of the pair in order to restart the
search. PCRE2 does not allow us to search for individual UTF-16 code
units.
That actually means that counting "." gives us the count of Unicode
characters.
Fixes: QTBUG-110586
Pick-to: 5.15 6.2 6.4 6.5
Change-Id: I194d0a32c94148f398e6fffd173d5b5be8137e19
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
This method correctly ignores relative paths (as per the XDG basedir
spec), but checking the list of dirs is empty should be moved to after
splitting the env var, because even if the env var is not empty, if the
paths in it are all relative the resulting list will be empty.
Drive-by change: Split some code to a static helper, which will be
used in xdgConfigDirs() too.
Change-Id: If894751ba68b24ccc214f9a4bb2099be3f0e4349
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Move the helper from qsystemsemaphore.cpp to q20memory.h
to prevent clashes in CMake Unity (Jumbo) builds.
Pick-to: 6.5
Task-number: QTBUG-109394
Change-Id: Id0127af1f0d51c87a5887090cc90ab232eff8093
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
QStringView::toULongLong() only works with US-ASCII, so:
- Always convert the text to parse to Latin1
- Use qstrntoull and make ParsedInt a typedef of
QSimpleParsedNumber<qulonglong>
The QStringView overload delegates to the QL1SV after converting the
string to latin1.
Change-Id: Iff7ac2c0afe6a180ca1b46a09ef0750e9b882c4d
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
It demonstrates timerEvent() and some QFontMetrics
There are other examples that demonstrates this
Pick-to: 6.5
Change-Id: I4ad6f30c8ef93c995f980545ed88ab13b9aa9c7d
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Add missing white space to moc output and list all the values of
QMetaObject::Call in the internal documentation.
Change-Id: I57d0c5b88bfaee4ca3f2d4604564751b6d0cbe51
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
The "interface" define in windows.h causes clashes with
variables named "interface". It cannot be undef'ed
since the winsock headers also uses it.
Pick-to: 6.5
Task-number: QTBUG-109394
Change-Id: Id2daedfd6c57aae39a1fdfe92482f17884b68ef5
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
One can figure out that something needs to exist in order to be a
file, I guess, but the documentation carefully avoided mentioning
it. So mention it.
Change-Id: I5094d6cb88ce2e58f48d8978c9b858d19d209f92
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Original libjpeg's handler has output_message call.
As Qt doesn't have it, it logs non-fatal error, but skips the fatal ones
which are likely more important to be logged than the non-fatal ones.
Pick-to: 6.5
Change-Id: Iebb94db4d56705322e7569445d240ca4a7ed8f4a
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
I think it was there because of of the QChar array allocated on the
heap (to store a copy of the "after" string when it's part of 'this'
string) and the subsequent ::free() call; instead split some code to a
static helper, and store the copy in a QVarLengthArray; the latter has
SSO, so it'll only heap-allocate if needed, and will take care of
deleting the data.
Remove now unused textCopy() method.
Change-Id: Iaf29d19ebd40d24948f0859d80f45e4c16e5bbce
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
This simplifies the code as a QVLA's size isn't limited to 1024.
Also it allows the code to allocate a big enough buffer to hold the
result, i.e. no reallocations.
insert_helper() takes care of storing a copy of "after" if it points
into "this" string; and "before" pointing into "this" isn't an issue
since we collected the indices before starting the replacement.
Change-Id: I612948187226439349118e65e9525ded2b387da0
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
It can happen the same key has different Latin symbols on different
layouts: for example, "`" symbol on English layout, no symbol ("^" dead
key) on German and ";" symbol on Czech and Hebrew layouts. This creates
a problem as these keys will produce different shortcuts depending on
what layout is currently active.
This patch makes keys generate the same shortcuts corresponding to the
first Latin layout configured in the system, independently of layout
actually active.
For example, when having settings like:
setxkbmap -model pc105 -layout "us,de" -option "grp:alt_shift_toggle"
After Alt+Shift, the layout changes to de from us. But Ctrl+"^" still
generates Ctrl+` shortcut which is from the first(or default) layout.
[ChangeLog][QtGui][QXkbCommon] make keys produce the same shortcuts
independently of current layout
Fixes: QTBUG-108761
Change-Id: Id204a1609ca731f9c56ed3d32847ca18b94be4a0
Reviewed-by: Liang Qi <liang.qi@qt.io>
Reviewed-by: Andrey Butirsky <butirsky@gmail.com>
We only support Qt 5.15 since a while, so the detailed information in
which Qt 5 version a particular class, function, or enum was introduced
is becoming less and less relevant.
Pick-to: 6.5
Change-Id: I39bd579f23abc0ac84879e9bd22e6a97651ef7c3
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
The macro decode() in qurlquery.cpp clashes with the static helper
function decode() in qurlrecode.cpp. The macro encode() in
qurlquery.cpp clashes with QStringEncoder::encode().
Macro CBOR_ENCODER_WRITER_CONTROL is defined with various values
in 3rdparty/tinycbor and qcborstreamwriter.cpp.
Pick-to: 6.5
Task-number: QTBUG-109394
Change-Id: I8fdf696863e5b1e6fb0c5607b2dd5b46427b9104
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Use names that give some clue to the meanings of variables and
constants. Provide some commentary to help the reader. Extract some
functions and constants shared by the Roman-based calendars into a new
namespace in qcalendarmath_p.h
Purge some unnecessary headers in the process.
Change-Id: I6fce18dc29a645f5a6e80ddfea4fd28dd6ecfe73
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
This saves duplicate computations and incidentally now fixes some
overflow issues. In the process, simplify some calendrical
calculations.
Fixes: QTBUG-109845
Change-Id: Iee331803e8281bbf822a001722a6faa3e66f6322
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
Internally it was using the start of March 4801 BCE and then adjusting
the year by 4800; instead, use the start of March 1 BCE and save those
adjustments. This incidentally aligns better with the Milankovic
calendar's calculations.
Change-Id: Ic64b4e1d4f65bbf1973a77f830e68f05f7949f4d
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Before I embark on some cleanup in the calendrical calculations, move
julianFromParts() to alongside partsFromJulian() - they're the static
methods used to bypass virtuals internally - and pull out a duplicated
comment from them to put before both.
Move julianDayToDate() to sit with its fellow virtual shim, each
calling one of the above, dateToJulianDay().
Change-Id: I581c08bae4c921c4a5cd48eebb66d46035d7d046
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
For a value in the partial interval just before the type's minimum,
multiplying the qDiv() result back up by the factor overflows; so take
care to adjust the values away from the bound. Introduce qDivMod() to
take care of that; in due course, we can also use it where both
quotient and remainder are wanted.
Done-With: Thiago Macieira <thiago.macieira@intel.com>
Change-Id: I541dae559f4f13ddec5b14376d3e22790b78311a
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Some of the fields and functions are not used now. Remove those.
Change-Id: I9313eee37374d82de2a1982a54843a70c58af426
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
Mention addRow() as well as newRow(), even though the example only
uses the latter. Link the best-practice section to the fuller story.
Fixed a minor grammar glitch in the manual while I was about it.
Pick-to: 6.5
Change-Id: Ib1c52cd8d2b6a04ea944d24d9d26c901b6cdf4e7
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>