This amends commit 394788c68e (its
ChangeLog applies to this commit too). That fixed sorting of UTF8-to-
UTF16, but when adding more unit tests, I've discovered that some UTF-16
strings also sorted incorrectly. There were two problems:
First, we were assuming that we could rely on the UTF-16 length as a
proxy for the UTF-8 one, but that's not true for some cases:
* both 1-, 2- and 3-codepoint UTF-8 sequences are 1 codepoint
in UTF-16, so some strings would have identical UTF-16 length
* 4-codepoint UTF-8 sequences shrink to 2-codepoint UTF-16 ones
(2:1) but 3-codepoint UTF-8 sequences shrink to 1 (3:1), so
some strings would be longer in UTF-16 but shorter in UTF-8.
Second, QtPrivate::compareStrings performs UTF-16 codepoint comparisons
not Unicode character ones, so surrogate pairs were sorting before
U+E000 to U+FFFF.
To fix all of this, we need to decode the UTF-16 string into UTF-32 and
calculate the length of that in UTF-8 to be sure we have the sorting
order right.
Since this is a slight behavior change with a performance penalty, I am
choosing to backport only to 6.7. The penalty mostly does not apply to
6.8 due to commit 61556627f2.
Pick-to: 6.7
Change-Id: If1bf59ecbe014b569ba1fffd17c4c4ddcc874aac
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
If we don't need to sort, then we can use QtPrivate::equalStrings() to
get a few cycles of performance per string comparison.
Change-Id: I5f663c2f9f4149af84fefffd17c03d9b52ca696e
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
Previously when PPK_Orientation property was set, updateMetrics() was
called before doReinit() and updateMetrics() used physical dimensions
of the DC initialized with previous orientation, which resulted in
miscalculation of m_paintRectPixels, origin_x and origin_y variables.
This bug manifested itself as all sorts of weird behavior, such as
unexpected margins when changing paper size and printing beyond paper
margins.
Pick-to: 6.7 6.5
Change-Id: I2d0e104bee11165e3541e7f3119b29edd4b882c8
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
Currently the icon used by document-properties is a gear icon, on
Windows, the actual icon used by explorer's context menu for the
properties menu option is the wrench icon. This patch change the icon to
the wrench icon.
Fixes: QTBUG-124085
Pick-to: 6.7
Change-Id: Ife49ad64d23b73b7676bc39330887e2cb320dcf9
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
[ChangeLog][QtGui][QColorSpace] Support for CMYK color spaces has been
added.
Change-Id: I2c684dbeee8b97fc90ca4e2a892349a7fa465d06
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
qinputcontrol refused to accept the character since
text part of key was empty
This caused the tabkey to always switch focus instead
Fixes: QTBUG-12423
Change-Id: I9ea7f02831cc88479b4e15d25eac278547f6f711
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
New comparison macros are used for following classes:
- QCborMap::Iterator
- QCborMap::ConstIterator
Replace public operators operator==(), operator!=(), operator!<(), etc
of classes to friend methods comparesEqual(), compareThreeWay();
Use *_helper methods to have an access to protected members of
QCborValueConstRef class from friend functions.
Task-number: QTBUG-120300
Change-Id: I71b6febaf3f31ea7ba668d91c375b0a7b6827d21
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
New comparison macros are used for following classes:
- QJsonObject::iterator
- QJsonObject::const_iterator
Replace public operators operator==(), operator!=(), operator!<(), etc
of classes to friend methods comparesEqual(), compareThreeWay();
Use *_helper methods to have an access to protected members of
QCborValueConstRef class from friend functions.
Task-number: QTBUG-120300
Change-Id: I308e2c0a549ff186c1d6339b38e989b80dc388a3
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
The original change was introduced to fix performance regression due to
the increased value of QT_RASTER_COORD_LIMIT. The optimization was done
by clipping anything outside the device rect plus a small margin.
However, setting the margin to a small value caused a regression, where the
rasterization became slightly different from the previous implementation.
Fixes: QTBUG-123054
Pick-to: 6.7 6.5 6.2
Change-Id: Ic4fddea89cd5f6e5760dc4a91b1f2f59527e8e5c
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
It will return the minimumSize of the underlying QWindow.
The container can then be put inside QLayouts without risking to be
shrunk to a smaller size than the QWindow::minimumSize.
Whenever the QWindow::minimumWidth or QWindow::minimumHeight changes, we call QWindowContainer::updateGeometry(), which will make the layout re-query QWindowContainer::minimumSizeHint() again.
Task-number: QTBUG-121798
Change-Id: Ib7ece7d9d75f2e4964ca9042d8d8b95ce3b17739
Reviewed-by: Doris Verria <doris.verria@qt.io>
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
Axivion (SV61) points out based on Qt-RuleOfThree the lack of copy and
move constructors and operators.
We don't need them, so tell the compiler not to create them.
As a drive-by change mark the constructor as explicit and not
discardable.
Task-number: QTBUG-122619
Pick-to: 6.7 6.5
Change-Id: I466f5cedea427608b434b71fda0d1e50619b9b20
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
It is mentioned in the porting docs, and in the class description
of the _iterators_, but none of those are really natural places to
look for the behavior of the container.
So, let's add a general note/warning to the functions in question.
Fixes: QTBUG-124195
Pick-to: 6.7
Change-Id: Ic95e56f166df2c8067232dfb6b9cb5b05d6a4361
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
With our previous setup we would CloseHandle the file handle and then
MoveFileEx the file to the final destination. This opens up the
opportunity for other processes to open the file in the meantime and
cause the MoveFileEx to fail.
With SetFileInformationByHandle we can, without closing the handle,
rename the file to the final destination.
Fixes: QTBUG-122208
Pick-to: 6.7
Change-Id: Id3c8e0b5703da280c84e466ed88287e99788d077
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
qOverload was used only for ambiguous signals and slots with no
arguments. Connections to ambiguous slots made in widget designer's
signal/slot editor, lead to an unresolved ambiguity when compiling
the generated code in ui_xxx.h. One example is QLabel::setNum(), which
can either take a double or an int.
Always using qOverload is not an alternative, because signatures are
normalised. E.g. const QString & / QString can't be distinguished.
Add a map with all ambiguous signals and slots to customwidgetsinfo.cpp.
Hardcode the map, because uic lives in QtCore and can't access meta
objects of gui/widget classes.
Use this map in isAmbiguousSignal() and add isAmbiguousSlot().
Change OverloadUse enum into an enum class in language.cpp. Change
enum values to reflect the new condition for slots to use qOverload.
Rename existing enum values and remove default argument in
language::formatMemberFnPtr() to improve code readability.
Apply const T& syntax for all types starting with Q, except QSize and
QPoint.
Revert 94c16517b3, which was a hack
forcing for QLCDNumber::display() to a string based connection.
Add a new baseline to tst_uic, to test the above.
Fixes: QTBUG-93413
Task-number: QTBUG-124241
Pick-to: 6.7 6.6 6.5 6.2
Change-Id: I49ccc1688cfc08970cce3e56adf18e5ac49a77e1
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
There are cases where overriding AddRef, Release, and/or QueryInterface
and adding additional functionality besides commonly required might be
beneficial.
Change-Id: I4407960164edf0441d1d054356f74abba6becbe7
Reviewed-by: Jøger Hansegård <joger.hansegard@qt.io>
Use the categorized logger qt.sql.mimer
Change-Id: I1b0d149a1a6317eec3b821dee99d952ef1000c28
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
Reviewed-by: Fredrik Ålund <fredrik.alund@mimer.com>
To avoid usage errors like fixed with
7e5a0b54f0
Pick-to: 6.7
Change-Id: I33af9721a04e80541c027fa6da8630070a5957ac
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
On android documentation orientation changes are sent via
onConfigurationChanged callback. Previous implementation
based orientation detection to onSizeChanged callback.
That callback is not called when orientation turns 180 degrees.
i.e. between landscape and inverted landscape.
This fix adds detection to on onConfigurationChanged to catch
those cases.
Fixes: QTBUG-118887
Fixes: QTBUG-118236
Pick-to: 6.7 6.5
Change-Id: Ie2f81798de97e460de839f7ebfde9a9efa25909f
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
Instead of having users traverse a ProxyModel hierarchy to
get to a QFileSystemModel to use the fileInfo(QModelIndex)
function, just let it be available with the roles.
Change-Id: I285347d1d85b4c6253fcb893737aa629a56e27fd
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
Reviewed-by: Ahmad Samir <a.samirh78@gmail.com>
Should make the profile a valid ICCv4 profile now.
Change-Id: Ifb8649b588117a4357e1f801c9b0202202ce9a38
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
It was overlooked in testing, but it would emit a signal for new
incoming stream even if the server was just replying with HEADERS on a
stream the client had initiated. Or vice-versa.
Pick-to: 6.7
Change-Id: Ie7b3a45729a78106da1d8c058e15705cc7dcc53b
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
Axivion (SV403 and SV404) points out, based on rule of three,
the lack of destructors for ConstIterator and Iterator.
So add them.
Task-number: QTBUG-122619
Pick-to: 6.7 6.5
Change-Id: I4d4abf9be8be529492bf13069052ae4a8d8a90de
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
The struct members were not described. Add something for each in the
docs.
Pick-to: 6.7
Change-Id: I75d0a5a6efee4d7b4a415b5282a9e44950ed3894
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
The QCborValue(QL1S) constructor checks if the parameter is ASCII.
If it's not, it converts it to a QString and stores as such.
However, the QString is checked *again* for being ASCII. We know
it isn't -- skip this recheck.
Change-Id: I7a4776759b2b14aab955cffebde6e3b64f8ed1d1
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
This creates aliased glyphs using the DirectWrite engine when
requested.
Note: There was previously a fallback to GDI to support aliased
text, which ignored the hinting settings. This patch also removes
that fallback.
[ChangeLog][Windows] Support QFont::NoAntialias with the DirectWrite
font engine.
Pick-to: 6.5 6.6 6.7
Fixes: QTBUG-97645
Change-Id: I587f56ace468cfdd57debe7bc8492a96587a4e05
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
Fill with the "window" color of the palette as passed in through
the style option, which takes care of active vs inactive color
selection.
The title bar of a docked dockwidget is a bit lighter than the
main window title and unified toolbar background, but identical
to the color of the title of an undocked dock widget. This is now
the case for both dark mode and light modes.
Also remove the gradient fill from the status bar, just fill it
with the window brush.
Remove the now unused helper functions for the title bar
gradient.
Fixes: QTBUG-92855
Pick-to: 6.7
Change-Id: Ia04c630201b288c0107567d3f459f66129693c82
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
In commit 9da8d67b3b a recreation of the
ComboBox Container was introduced, since QWindows11Style depends on
WA_TranslucentBackground flag, whereas the other styles don't set this
flag. This leads to the destruction of user supplied views we don't own.
Fixes: QTBUG-124191
Pick-to: 6.7
Change-Id: I4a693f612ddc299696b9de0d87c94d88c04d9b39
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
QCommonStyle sets the font for a selected header section to bold.
This overrides the font weight a calling style might already have set,
e.g. when a style sheet is applied to explicitly set a weight for a
checked header section:
QHeaderView::section:checked {
font-size: 20px
font-weight: normal
}
Since setting the weight on a font sets the respective resolve-mask
bit, we can avoid overwriting a weight that is already set explicitly.
Add baseline test coverage using a QTableWidget.
Fixes: QTBUG-122180
Pick-to: 6.7 6.5
Change-Id: I8c6279ad2fd8c5718ebea26e27c64ae823625748
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
Use a solid fill with the "button" color of the palette also for active
title bars, which is then the same color as the frame, and gives the
window a consistent look in both dark and light mode.
Fixes: QTBUG-123162
Pick-to: 6.7
Change-Id: Iac26fdb1518ffe4f8255e01bedf7329be40ac258
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
If QToolButton::mouseReleaseEvent triggers its deletion then it
will crash when dereferencing its d pointer.
qabstractbutton.cpp already uses QPointer guards in many places but
qtoolbutton.cpp was missing this one.
While deleteLater() is still our recommendation, we shouldn't crash.
It's not always obvious what led to the button's destruction,
as the chain of indirections can be long.
Change-Id: I4a33447fa4e90953370277eb57a161398ded9a9c
Pick-to: 6.7
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
.. by playing it safe and taking the QVariant by copy
Pick-to: 6.7 6.5
Change-Id: I24e0507a912388b7fb17e838a22e8d4c449bcf5b
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Split out some helpers to write the theme code with path fallback
checking for the enum case (identified by a fully qualified icon) or
the old XDG/filename case.
Task-number: QTBUG-121823
Pick-to: 6.7
Change-Id: If2755483ab899f04e372cf95443f7e03970f6e7f
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
QLayout::widgetEvent() returned early, when the layout was disabled.
That suppressed ChildRemoved events and lead to a crash, when the
layout was enabled again.
Don't return early on ChildRemoved events.
Add an autotest in tst_layout::removeWidget().
Fixes: QTBUG-124151
Pick-to: 6.7 6.5 6.2
Change-Id: Ib0a0bb73978d9fc2c9777d300cf38a8c4496b702
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Reviewed-by: Chris René Lerner <chris.lerner@qt.io>
When a system tray icon on Windows wasn't visible (hidden behind the ^
icon in the task bar) our previous implementation gave different
results on Windows 10 and Windows 11.
On Windows 10 the geometry returned the geometry of the ^ icon itself
while we returned a geometry outside of the screen geometry on Windows
11 (that was what the Windows API gave us).
We work around this problem by using version specific hacks to be able
to check for the visibility of the system tray icon itself. If the icon
is hidden we just return QRect().
[ChangeLog][Windows] The geometry of a hidden QSystemTrayIcon was
unified over different Windows versions. It will always return QRect()
now.
Change-Id: Iee7dea184936a13a9221df9c421400ba304a4c38
Reviewed-by: Miguel Costa <miguel.costa@qt.io>
There are many APIs in Wayland that require a surface role to be
assigned (e.g. XDG Toplevel) before they can be used, where
the surfaceCreated() signal is too early.
Change-Id: I400a6279f21554267259f812a2efb33451b4709b
Reviewed-by: Vlad Zahorodnii <vlad.zahorodnii@kde.org>
Currently the drawing of CE_ItemViewItem is propagated to QWindowsStyle,
which leads to ignoring alternating rows in ItemViews. Propagating the
drawing to baseStyle honors the set base style.
Fixes: QTBUG-123632
Pick-to: 6.7 6.6 6.5
Change-Id: I656ee1c44029abf7233551303d469d38b6c848e3
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
forkfd_qt.cpp was originally created so we could use the Qt atomic
classes back when we couldn't rely on C11. We now can, so that primary
reason is gone. We only need it now to set NDEBUG, which the Qt build
doesn't set by default, and _GNU_SOURCE to match forkfd.c itself (GCC
and Clang define it by default in C++ mode because libstdc++ apparently
needs that).
Amends 993db5a122 and thus avoids a new
Clang 18 warning about using VLAs in C++ code:
forkfd_linux.c:160:50: error: variable length arrays in C++ are a Clang extension [-Werror,-Wvla-cxx-extension]
Pick-to: 6.7 6.6
Change-Id: I5f663c2f9f4149af84fefffd17bed82d39be4d78
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@gmx.de>
Reviewed-by: Liang Qi <liang.qi@qt.io>
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
This header uses std::forward_iterator_tag, which requires including
the <iterator> header.
This fixes building with libc++ with
_LIBCPP_REMOVE_TRANSITIVE_INCLUDES enabled.
Pick-to: 6.7 6.5 6.2
Change-Id: Id2ce97e158c87dab1efe30e54a93f0bc9351de5a
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
New comparison macros are used for following classes:
- QCborArray::Iterator
- QCborArray::ConstIterator
Replace public operators operator==(), operator!=(), operator!<(), etc
of classes to friend methods comparesEqual(), compareThreeWay();
Use *_helper methods to have an access to protected members of
QCborValueRef class from friend functions.
Task-number: QTBUG-120300
Change-Id: Ie8ffef3e2278dfbf2bf0b32c30a7bf98d99fd1c3
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
[ChangeLog][QtGui][libinput] The environment variable
QT_QPA_LIBINPUT_TOUCH_MATRIX now can be set with a string of 6
space-separated numbers to set the touchscreen transformation matrix.
See docs for libinput_device_config_calibration_set_matrix()
Fixes: QTBUG-68698
Change-Id: I72ba94e1ee6d39d31d1689ce6ce85fa8e676ff13
Reviewed-by: Dominik Holland <dominik.holland@qt.io>
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
Xcode expects the base SDK to always be the device SDK, so we can't
pass CMAKE_OSX_SYSROOT on directly.
We use the Xcode SUPPORTED_PLATFORMS setting to inform Xcode about
which targets we can actually build and run for.
Change-Id: Ib46e81e946bc89f62d1e700422b37166c3d55009
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>