Because of the addition of the operator T*(), the expression "it + N"
where N was not exactly qsizetype but any other integer type was a
compilation failure because of ambiguous overload resolution.
With GCC it's apparently a warning:
warning: ISO C++ says that these are ambiguous, even though the worst conversion for the first is better than the worst conversion for the second:
note: candidate 1: ‘QList<T>::iterator QList<T>::iterator::operator+(qsizetype) const [with T = char; qsizetype = long long int]’
note: candidate 2: ‘operator+(char*, ptrdiff_t {aka long int})’ (built-in)
With Clang, it's an error:
error: use of overloaded operator '+' is ambiguous (with operand types 'QList<int>::const_iterator' and 'ptrdiff_t' (aka 'long'))
note: candidate function
inline const_iterator operator+(qsizetype j) const { return const_iterator(i+j); }
note: built-in candidate operator+(const int *, long)
Pick-to: 6.2
Fixes: QTBUG-96128
Change-Id: Ie72b0dd0fbe84d2caae0fffd16a06f23dd56b060
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
And don't set non-default large value in QNetworkRequest's constructor.
Some servers consider those values as 'flow control error'.
Pick-to: 6.2
Fixes: QTBUG-97384
Change-Id: I801b7c83fe7e7392a02ba653c36dfa8a22c21d1e
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
The macro takes only one parameter, sentences must be wrapped in {}.
Pick-to: 6.2
Fixes: QTBUG-97441
Change-Id: I7177548a32a67d720c2b551d16c09d898b0fda51
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
On macOS, it is possible to right-click-open a context menu for a window
that is not active. This does not activate the window.
When then clicking into the window to activate it, the popup is closed,
but only after the WindowActivate events has been sent. This blocks the
event delivery, as QApplication (since commit 78264f333e)
interpreted activation changes while popups are open to be just delayed
focus events. The UI ends up in a broken state where focus cannot be set
on the widgets in the window.
To fix this, don't ignore such activation events on macOS. As a drive-by,
give the variables more meaningful names.
Note: We cannot call closeAllPopups before delivering WindowActivate,
as that would close the popup before the mouse event is delivered, making
it impossible to select any of the actions from the menu.
Ideally, clicking into a popup of an otherwise inactive application would
not activate that application (that is the default behavior for native
macOS applications), but that's out of scope for this patch.
Fixes: QTBUG-78750
Task-number: QTBUG-69710
Task-number: QTBUG-66513
Pick-to: 6.2
Change-Id: I6344370ae7be31630e37514e04918b2d6cb8b69a
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
The test passes, the functionality is implemented in QCocoaWindow.
Task-number: QTBUG-8857
Pick-to: 6.2
Change-Id: I2f4b3a39cec1aaaf4351753b590f35e280503461
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
The documentation snippets name the result of dotProduct()
"lengthSquared", but it is just a coincidence, not the property of dot
product of two different points. Just name the result `dotProduct`
without claiming any properties.
Also fix the type of the result in the QPointF case.
Fixes: QTBUG-94979
Change-Id: I4c337dd8335953489eac86c07a219c0a2d232369
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
When using the Freetype font database, we would ignore the
typographical width of loaded fonts, which could make it
impossible to select certain fonts in a family.
[ChangeLog][Freetype] Fixed a bug where fonts of different
width within the same family would be unselectable if the
Freetype font database (no-fontconfig configuration) was in
use.
Pick-to: 5.15 6.2
Fixes: QTBUG-89640
Change-Id: Ic9c17a7c3cc14eb7e942b05d6b21b7c1602816cf
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
Retaining texture upload commands comes at a price, because it
means we also retain the backing storage, which could e.g. be
fullscreen buffers for applications on Wayland. These would
eventually be overwritten, but just clearing the array between
frames is also fine because the data is never reused and the
array is a QVarLengthArray anyway so it already has a lot of
reserved space.
Pick-to: 6.2
Change-Id: I7389487be67b671830787e30e1468c303b7ac5c2
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
On low-end hardware without fast framebuffer clears one can
significantly reduce the fill rate by disabling framebuffer clears
(provided, as it's usually the case, that the application has content
filling the entire framebuffer).
Add a couple of environment variables to do so, one to disable all
clears and one to disable only color clears (in case the surface is
requested without a depth buffer). Note that disabling all clears
on a surface *with* a depth buffer still requires
QSG_NO_DEPTH_BUFFER to be set, otherwise QtQuick is going to assume
that there is a clean usable depth buffer.
Change-Id: I96ad0a3d28dd0ab65cc960fb7cb2e0a8b6f35628
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
Accidentally broken in 4b899a29fa
Change-Id: I8ff52153c3549fcda4ebd178cc4fc1ea9538be86
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
Reviewed-by: Elvis Lee <kwangwoong.lee@lge.com>
I forgot
Fixes: QTBUG-97409
Change-Id: I5ee94b2cc4c70b6408bb9bb9368c6876f3179783
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
- when there is no intersection between the current selection and the
spans collection, get ranges for all cells, just as if no span exists
- when there is an intersection between the current selection and the
spans collection, get separate ranges for each cell (as before)
This fixes the regular case of selecting multiple non-spanned cells
after some cells are merged (get a single range for all cells instead of
separate range for each cell). However, when selecting together a group
of spanned and non-spanned cells, you still get a separate range for
each cell. But this is normal behavior in similar applications; for
example in LibreOffice, you cannot select and merge spanned and
non-spanned cells: an error dialog tells you that it's not allowed.
Done-with: Christos Kokkinidis
Pick-to: 6.2
Fixes: QTBUG-255
Change-Id: Ic38f9a064a1f499825e7f750668013fc2dc564ba
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Add operators as hidden friends, add test case to make sure that
basic value-type operations are possible with this type.
Task-number: QTBUG-255
Change-Id: I7fbf453aa16084c0b2a0079487cacb4e092ff664
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
Less clunky due to having better constexpr support, plus fold
expressions.
Change-Id: I3eb1bd30e0124f89a052fffd16a6bc73ba79ec19
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
It's not used anywhere. It's been a legacy since 5.0 anyway.
Pick-to: 6.2
Change-Id: I2bbf422288924c198645fffd16a9740444c7f13b
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
They return a pointer to the actual header, skipping the magic string.
This is done in preparation for the header located in an ELF note, which
won't have the magic.
Change-Id: I3eb1bd30e0124f89a052fffd16a8229bec2ad588
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
The .qtmetadata section is already suppressed for static plugins, but we
carried this unnecessary magic string. For library file formats where we
don't have a scanner (Windows COFF PE), a library that linked multiple
static plugins could end up with multiple metadata found.
We can't suppress the header because the version of moc could be
different to the version of Qt, so we need to read the header version
too. Right now, the version isn't output by moc (all the logic is in
qplugin.h), but this could change again in the future. In any case, 4
extra bytes are not a big deal, so the header stays.
Change-Id: I3eb1bd30e0124f89a052fffd16a82088d8303081
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
The .pri files for public Qt modules were missing run_depends entries.
Those entries are used by qmake when linking plugins of a static Qt
build. In shared builds, run_depends entries are used to decide whether
to add the -rpath-link argument to the linker. In that matter,
run_depends entries serve a similar purpose as CMake's
IMPORTED_LINK_DEPENDENT_LIBRARIES.
In Qt5, run_depends entries consist of the qmake values QT_PRIVATE and
QT_FOR_PRIVATE.
QT_PRIVATE contains the Qt modules that are privately linked to the
public module, and QT_FOR_PRIVATE are the dependencies of the private
module. That loosely translates to LINK_LIBRARIES of the public module
and INTERFACE_LINK_LIBRARIES of the private module.
Private modules whose public counterparts are already public
dependencies don't have to be added to run_depends.
Pick-to: 6.2
Fixes: QTBUG-84310
Change-Id: If7025c98ea462a2d5a143202df3d98d88e4fee08
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Looks like it was copied from QUtf16::convertFromUnicode(), but for the
UTF-32 case that is not correct. UTF-16 to UTF-32 conversions can change
the length of the string due to surrogates.
There are unit test tests for creating and parsing UTF-32 headers, and
for detecting content as UTF-32, but there aren't any for UTF-32
conversions. I don't have time to add a full test for that.
Fixes: QTBUG-97122
Pick-to: 6.2 6.1
Change-Id: Ic17a33f599b844d8ab5dfffd16ab2c4cb6b0547d
Reviewed-by: Ievgenii Meshcheriakov <ievgenii.meshcheriakov@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
This allows Qt Quick Controls to detect if a dark theme is in use,
and if so, use a dark theme of the current style (if available).
Fixes: QTBUG-93955
Pick-to: 6.2
Change-Id: I15fc8a2271acf9ba27232359056d5a681d4cffca
Reviewed-by: Dmitry Shachnev <mitya57@gmail.com>
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
Leaving it set to 0 will cause mktime() to interpret other fields as
in standard time, potentially "correcting" them and tm_isdst to
represent the equivalent moment in daylight-saving time. Set it to -1
to tell mktime() to let the system work out whether the time is
standard or daylight-saving.
Change-Id: Id33d4cb0afdb14f236ca5ce04cf605610a30d712
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
It's available on MinGW, so not limited to MSVC; and the MinGW
localtime() and localtime_r() fail in some cases where it works.
Use the generic name rather than _localtime64_s(), since localtime_s()
now just calls it; and, in any case, we were assuming time_t is
__time64_t when calling it.
Change-Id: I316cc5b1a3e19cd6725555042dfaba3124a25a03
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
The skip-reason only cites Qt/X11. Convert the #ifdef into a platform
name check instead. The test also fails with the offscreen plugin, so
skip it for that as well.
Pick-to: 6.2
Change-Id: I49607b89f4b32359e81e1d9aadff2c3e03035c53
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
QDialog overrides setVisible to set focus on the default push button, or
(if there is no such button), make the first autoDefault push button the
default button. QDialog also explicitly sends a FocusIn event to the
focus widget in the dialog.
All this should not be done if the dialog does not become active after
getting shown, which will be prevented if the WA_ShowWithoutActivating
attribute is set.
Add a test case.
Fixes: QTBUG-8857
Pick-to: 6.2
Change-Id: If47021a4721a280ba45e95b43d0424cdacd9b4ea
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
The need for this union has disappeared at some point during refactoring
It does confuse MemorySanitizer, though, so it's good to remove it.
Change-Id: I5f5050adba302bf96db96d5f303d2a25630543ce
Fixes: QTBUG-97109
Reviewed-by: Ievgenii Meshcheriakov <ievgenii.meshcheriakov@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>