Commit Graph

56933 Commits

Author SHA1 Message Date
Heikki Halmet
bb674adb25 BLACKLIST tst_qfont for Ubuntu 22.04
Pick-to: 6.4 6.3 6.2 5.15
Task-number: QTBUG-84248
Change-Id: I2978cd2a6ed07bb6fc5769b174d0a897dfa3566d
Reviewed-by: Tony Sarajärvi <tony.sarajarvi@qt.io>
2022-06-20 17:06:20 +00:00
Allan Sandfeld Jensen
0bd2876275 Avoid misleading bindingStatus
Set it to nullptr on clear, and deal with possibly null bindingStatus.

Task-number: QTBUG-101177
Task-number: QTBUG-102403
Pick-to: 6.4
Change-Id: I66cb4d505a4f7b377dc90b45ac13834fca19d399
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2022-06-20 19:06:20 +02:00
Heikki Halmet
903bde19a4 BLACKLIST: tst_QGlyphRun::mixedScripts for Ubuntu 22.04
Pick-to: 6.4 6.3 6.2 5.15
Task-number: QTBUG-68860
Change-Id: I79c085c7321e0bee78e8cb31daa8c7992d3a3ec6
Reviewed-by: Tony Sarajärvi <tony.sarajarvi@qt.io>
2022-06-20 20:06:20 +03:00
Heikki Halmet
a3c43394bb BLACKLIST tst_QApplication::sendEventsOnProcessEvents for Ubuntu 22.04
Pick-to: 6.4 6.3 6.2 5.15
Task-number: QTBUG-87137
Change-Id: Ib09382af7504f5ee078d23cc021c1b0faf051e23
Reviewed-by: Tony Sarajärvi <tony.sarajarvi@qt.io>
2022-06-20 20:06:20 +03:00
Heikki Halmet
5aca1fe1d0 BLACKLIST tst_QMenuBar::check_menuPosition for Ubuntu 22.04
Pick-to: 6.4 6.3 6.2 5.15
Task-number: QTBUG-68865
Change-Id: I1eda9789a30737104c6e97de583a9f3022ae0bf6
Reviewed-by: Tony Sarajärvi <tony.sarajarvi@qt.io>
2022-06-20 20:06:20 +03:00
Ilya Fedin
c3e624eb50 Port QXlibEglIntegration::getCompatibleVisualId to xcb
In combination with EGL_EXT_platform_xcb support, this allows xcb_egl
to be used without xlib. Without EGL_EXT_platform_xcb support, this
still reduces amount of code using xlib.

Pick-to: 6.4
Change-Id: I29e2b29f7ef8ea34320887f62697f84232b86fba
Reviewed-by: Liang Qi <liang.qi@qt.io>
2022-06-20 15:53:33 +00:00
Giuseppe D'Angelo
1c106b37c7 QXdgDesktopPortalFileDialog: fix C++20 build
In a lambda, capturing of `*this` by reference via `=` is deprecated,
and breaks the build. Capture everything needed instead.

Amends fb981a0954.

Change-Id: I5d3d192e71662b96154cb5979898277bd0720a90
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2022-06-20 17:53:33 +02:00
Giuseppe D'Angelo
a7203a8920 QWindow: fix C++20 build
In a lambda, capturing of `*this` by reference via `=` is deprecated,
and breaks the build. Capture everything needed instead.

Amends e7477e8934.

Change-Id: Ibdbf51cb7a5ec54004b14b719dfd44e86d6f0893
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2022-06-20 17:53:33 +02:00
Louis du Verdier
d7068eaad7 Fix tst_AndroidAssets, broken by recent changes on assets load speed
Recent changes on load speed of individual assets made
AndroidAbstractFileEngine use a cache for basic information in order
to avoid to have to open assets every time a QFileInfo is created,
which was very expensive for older phones.

However, size() method was forgotten and continued to expect that the
asset would be opened first, and therefore QFileInfo().size() would
always return -1.

This change fixes this by caching as well the information about the
size of the asset, and also reverts a part in open() to close() first
in case asset would already be opened, in order to keep previous
behavior (even if this did not cause any known issue).

Fixes: QTBUG-104412
Pick-to: 6.4 6.3 6.2 5.15
Change-Id: I992f31b8f9e14dfec44cec78d0c1a2a3e18bdb7f
Reviewed-by: Jani Heikkinen <jani.heikkinen@qt.io>
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2022-06-20 16:18:34 +02:00
Laszlo Papp
4679d16db8 QAbstractItemDelegate: Remove a duplicate doc entry
Pick-to: 6.4 6.3 6.2
Change-Id: I02887e6bf5892b4697af2aabcd1f1335e15b4f06
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2022-06-20 14:08:35 +00:00
Volker Hilsheimer
145bfe6054 Document QJniObject::construct
Added for 6.4. Not extremely useful as long as the macros that allow
the declaration of new class and type strings also being documented.

Pick-to: 6.4
Change-Id: I9ee466fdd0aaccec1e627ceb313b5a5c17e3f3fa
Reviewed-by: BogDan Vatra <bogdan@kdab.com>
2022-06-20 16:08:35 +02:00
Volker Hilsheimer
e0a729dfd2 Make the new setCurrentId the writer for the respective property
Amends 2140edaaab.

Pick-to: 6.4
Change-Id: Idc1ace4229b8706d9b44f1727105cc9aaab1a86d
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2022-06-20 16:08:35 +02:00
Richard Moe Gustavsen
20a40035fa QTableView: set correct clip on QPainter when using spans
As it stood, QTableView would sometimes show drawing
artifacts when sections (rows or columns) where
rearranged, in combination with spans.

The reason is that the current code would go through the
currently visible cells in the viewport to check if any of
them where affected by a span. But the stored spans (in
QSpanCollection) is kept in sync with the column layout in
the model, and doesn't know anything about the rearranged
columns in the view. But a column with spans that is moved
to the left of the viewport can affect the painting of
the viewport as well, and needs to be taken into consideration.
For that reason, the current solution that uses
QSpanCollection::spanAt(x, y), will in that case fail.

Since it seems sensible that QSpanCollection is kept in sync with
the model (it makes model changes that affect spans easier to
handle), this patch will not change QSpanCollection. Instead, it
will iterate through all the spans (which is assumed to normally be
a limited size), convert them to the column layout of the view
(visual instead of logical), and find the ones that overlap.
Overlapping spans will, like before, be added as clip rects
to the QPainter.

Fixes: QTBUG-91896
Pick-to: 6.4 6.3 6.2
Change-Id: Iabe20df13cbd41a68f1104d3d9e24b89c4b88913
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2022-06-20 14:03:26 +02:00
Fabian Kosmale
c15714191c tst_qthread: Fix compilation under ubsan
We missed the terminating ";" in the QSKIP lines.
Amends ea4d6b987a

Pick-to: 6.3 6.4
Change-Id: Ibda43b8a84230c243dbcc74e157f4c3f8ef3891d
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2022-06-20 12:12:07 +02:00
Yuhang Zhao
7225ed749d QOperatingSystemVersion: Add new Windows version
And also update some docs to provide more detailed info.

Pick-to: 6.4
Change-Id: I7b51fcb6613399cb4f1dd5d75cf3168df195577b
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2022-06-20 16:29:29 +08:00
Thiago Macieira
23bf260f10 Fix improper moc includes inside the Qt namespace
Pick-to: 6.3 6.4
Change-Id: Id0fb9ab0089845ee8843fffd16fa1b1413fd0d41
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2022-06-19 21:32:48 -07:00
Volker Hilsheimer
ea4d6b987a Skip tests that terminate threads under ASAN
Thread termination might prevent stack unwinding, which then
generates ASAN errors such as

ERROR: AddressSanitizer: stack-buffer-underflow on address
0x7f3c1d7858b0 at pc 0x7f3c243d8918 bp 0x7f3c1d7857f0 sp 0x7f3c1d7857e8

Skip such tests so that we can enable blocking CI runs under ASAN.

Fixes: QTBUG-104421
Pick-to: 6.4 6.3
Change-Id: I169235a12190e3f72525cddfe1a44a4bee19eca1
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
2022-06-19 12:16:00 +02:00
Yuhang Zhao
797a493f50 Network: make Public Suffix List constexpr
Upstream PR: https://github.com/rockdaboot/libpsl/pull/182

The repo owner denied the PR because the library only
produces C89-compatible code and constexpr is a C++ feature.

Pick-to: 6.4
Task-number: QTBUG-100485
Change-Id: I9e01705b27022a636a98ac67b19169677d7c7652
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2022-06-19 16:27:16 +08:00
Yuhang Zhao
11e6e9bccd CMake: Mark chosen C++ standard as required for building Qt
Change-Id: I7d3187e74251059c7536f3e34d8c87f54c673146
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2022-06-19 14:45:07 +08:00
Yuhang Zhao
1e71071c92 Windows QPA: Fix indention
It seems this block of code was originally copied from elsewhere
so the original indention is preserved.

Pick-to: 6.4
Change-Id: I53ab8e58b4304dfc768bd6472255a6c2d0471d5e
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2022-06-19 10:29:56 +08:00
Fabian Kosmale
122270d6be Long live the ICU-based QStringConverter interface!
This adds support for additional codecs to QStringConverter when ICU is
available.

We store the converter in the state (d[0]), and its canonical name in
d[1]. We need the name there, as in the clear function we close the
UConverter, and set the pointer to null. Consequently, the actual
conversion functions might need to re-open the converter again. The
advantage of this approach is that clear is used in the destructor of
State, and with this approach we properly clean up the state.
There is however a disadvantage: The clear function was so far also used
for resetting the state when QStringConverter::resetState . Discarding
the whole Uconverter for that is however rather costly. For that reason
we modify resetState to call a new function, State::reset. For existing
converters, it behaves the same as clear; for the ICU based converter,
we call the more efficient ucnv_reset. Code compiled against Qt 6.4 can
benefit from this more efficient version; code compiled against older Qt
versions will continue to work, as the conversion functions can just
recretate the converter from the name.
We can distinguish between ICU and non-ICU converters by checking if the
UsesIcu flag is set.

QStringConverter::name is changed to return the name stored in d[1]. The
interface of the ICU converter has a dummy name, so code using the old
name function from QT < 6.4 still returns something, namely a message
asking the user to recompile.
The function is moved out of line, as we need to check for the private
ICU feature, and want to avoid having that check in the public header.

As the QStringConverter ctor taking a name now can allocate memory, it
can no longer be noexcept. Removing the noexceptness is safe, as it was
only added after Qt 6.3.

Note that we cannot extend the API consuming or returning Encoding, as
we use Encoding values to index into an array of converter interfaces in
inline API.

Further API to support getting an ICU converter for HTML will be added
in a future commit.

Currently, the code depending on ICU is enabled at compile time if ICU
is found. However, in the future it could be moved into a plugin to
avoid a hard dependency on ICU in Core.

[ChangeLog][Corelib][Text] QStringConverter and API using it now
supports more text codecs if Qt is compiled with ICU support.

Fixes: QTBUG-103375
Change-Id: I7afb92fc68ef994179ebc7a3aa73beebb1386204
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2022-06-19 00:41:12 +02:00
Tor Arne Vestbø
d350373133 Windows: Replace lcQpaWindows logging with lcQpaScreen in screen code
Pick-to: 6.4
Change-Id: I1d2fd586aac1163aa449f813ce3b7244c6ebaee0
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
2022-06-18 21:08:08 +02:00
Tor Arne Vestbø
fa0b2ef81c Windows: Decouple screen change monitoring from top level QWindows
The WM_DISPLAYCHANGE message it sent when displays are added, removed,
or update their properties such as the scale/DPI.

We were processing this message as part of QWindowsContext::windowsProc(),
which meant that we would only react to display changes if there was a
QWindow on screen. Just creating a QGuiApplication was insufficient to
pick up changes to screens after startup.

In addition, despite being documented to post messages to child windows,
WM_DISPLAYCHANGE only ends up in top level windows. Presumably it's the
top level window's responsibility to post the message to child windows.
As a result, if a QWindow was a native child window of a foreign window,
such as in audio plugins being hosted in a DAW, we would again fail to
pick up display changes.

We solve both these cases by decoupling the WM_DISPLAYCHANGE handling
from QWindowsContext::windowsProc(), by creating a dedicated window
for listening to WM_DISPLAYCHANGE. This is similar to how we already
handle tray icons, power notifications, clipboard, etc -- the only
difference being that since purely HWND_MESSAGE windows do not
receive WM_DISPLAYCHANGE it's an actual invisible WS_TILED window.

This also lets us remove the workaround for QTBUG-79248, which was
doing screen updates in response to WM_DPICHANGED when detecting
that there were no QWindows.

Task-number: QTBUG-103383
Task-number: QTBUG-79248
Fixes: QTBUG-102343
Pick-to: 6.4
Change-Id: I905d8253069ec339b193edf05c052d21361ca3e9
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2022-06-18 21:08:02 +02:00
Marcel Kummer
e457aeec38 QBoxLayout: Add assertion that catches out of bounds insertion indices
As of Qt6, QList will assert that an insertion index is in range of
existing values. QBoxLayout interprets negative indices as "append at
the end". That part is covered.
Indices larger than the number of items in the layout would trigger the
assertion in QList, but after the insert method had returned. That would
make it hard to debug. This change asserts the index range before
inserting, thus making it easier to spot the problem.

Fixes: QTBUG-103775
Change-Id: Ida099f785263fe8a5c8a1d0a48c4ff87713549b4
Pick-to: 6.2 6.3 6.4
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2022-06-18 21:07:51 +02:00
Thiago Macieira
f23d83c43e qmetatype.h: remove #undef for something that was never #define'd
Pick-to: 6.3 6.4
Change-Id: Id0fb9ab0089845ee8843fffd16f976868e3ab448
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2022-06-18 08:44:06 -07:00
Thiago Macieira
4c1b1f2ad8 QMetaType: use explicit load/store operations on QBasicAtomicInt
QBasicAtomicInt::operator int() does loadAcquire() and operator=() does
storeRelease().

Pick-to: 6.2 6.3 6.4
Change-Id: Id0fb9ab0089845ee8843fffd16f9a1ece6823777
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2022-06-18 08:43:53 -07:00
Lorn Potter
ff0c7dfc6e wasm: Fix up namespacing in wasm platform plugin
Pick-to: 6.4
Change-Id: I2fdbb6688b252743578dfcd58f9259eb5ac3cca8
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
2022-06-18 09:16:55 +10:00
Lorn Potter
87c2a401da wasm: fix unicode input
also remove duplicated function call to get Qt key for event

Pick-to: 6.3 6.4
Fixes: QTBUG-78826
Change-Id: Ibaf0dd3eb428b65280ed1f840a4849b44f2868e0
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
2022-06-18 05:50:25 +10:00
Alexandru Croitor
81b5395aef CMake: Android: Fix 'qmldir file not found at' warnings
androiddepployqt calls qmlimportscanner to find qml modules.

Due to an issue in a generator expression, CMake did not write out the
android default qml output directory to the deployment json file,
which in turn means that qmlimportscanner did not get that
information.
When the scanner scanned the sources, it found some relative imports
but couldn't find relevant qmldir files because they were in an
android-specific directory.

This caused warnings like 'qmldir file not found at /some/path'
repeatedly.

Fix the generator expression to use $<COMMA> instead of , so that the
genex condition is evaluated successfully and the extra qml import
paths are passed along to qmlimportscanner.

Amends 76665f2a72

Pick-to: 6.4
Fixes: QTBUG-102595
Change-Id: Ia74c3c80f12d05b0a9cd0978df1a58bb5582198a
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
2022-06-17 20:59:22 +02:00
Alexandru Croitor
20dd4a43f0 CMake: Fix Xcode common dependency issues for other_files IDE target
A generated file can be added to a resource target, which in turn
adds it to the other_files target. With the Xcode generator, this can
lead to errors like

 The custom command generating foo.txt is attached to multiple
 targets:
      foo_other_files
      foo_resources_1
 but none of these is a common dependency of the other(s).  This is
      not allowed by the Xcode "new build system".

Neither of the targets depend on each other because logically
they shouldn't depend on each other.
And yet XCode wants that each generated file is attached only to one
target, which will be a common dependency for the other targets.

Make sure _qt_internal_expose_source_file_to_ide extracts and uses
that common target dependency just like
qt_add_resources -> _qt_internal_process_resource already does.

One case of a common target dependency is the _lrelease target
in qttools which was added in 5b0e765ab0dddba86662925cb44aeac748a286b7

Another case is in qt_add_shaders in qtshadertools.

I expect we might encounter other cases where we need to introduce a
common driving target.

Pick-to: 6.2 6.3 6.4
Task-number: QTBUG-103723
Change-Id: Ideff023718a6ce109a4b3eefa01bffa79d1c6a3e
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
2022-06-17 20:59:22 +02:00
Volker Hilsheimer
fa814fcfea Provide overload for Qt::AlignmentFlags in item widget items
Amends 53ee4c8b1f, which deprecated
QListWidgetItem::setTextAlignment(int) etc and provided a typesafe
Qt::Alignment overload instead. However, Qt::AlignLeft by itself is of
type Qt::AlignmentFlag, it only becomes a Qt::Alignment when or'ed
with another alignment flag. So the deprecated int-overload was taken
by the compiler, resulting in a deprecation warning.

Add a Qt::AlignmentFlag overload in addition, and document it as
\internal since it is just a C++ technicality that we need both.

Pick-to: 6.4
Change-Id: Ide97eed7f6d1f89a5f955b2ed45167e771bd8c81
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
2022-06-17 20:59:22 +02:00
Axel Spoerl
99c8ffb9f2 Update window state in QWindowsWindow and QXcbWindow geometry setters
When QWidget::resize() is called on a maximized or minimized QWidget,
the window state of the widget and the corresponding QWindow is not
updated (i.e. remains maximized or minimized).

This patch updates the window state to Qt:WindowNoState when
setGeometry() is called in QWindowsWindow or QXcbWindow.

A test is added in tst_QWidget.

Fixes: QTBUG-104201
Pick-to: 6.4
Change-Id: I07491fb9293d13509573fc403750da0a50f6a785
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2022-06-17 18:59:22 +00:00
JiDe Zhang
8790da8988 xcb: Get some style hints from xsettings
According to
https://www.freedesktop.org/wiki/Specifications/XSettingsRegistry/.
Added support for Net/CursorBlinkTime Net/DoubleClickTime
Net/DoubleClickDistance Net/DndDragThreshold.

Change-Id: Ief208736ed2938792d935bfd730fefdd745394b6
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2022-06-18 02:59:22 +08:00
Ivan Solovev
2ed54dedf3 QMainWindow: fix restoreState() for toolbars
Restoring the toolbar state of a QMainWindow could not update
QWidgetPrivate::widgetItem for the QToolBar, because at that point it
was still holding the pointer to the widgetItem of the previous state.
Later on, when the new state was successfully applied, the previous
state was deleted, and the corresponding widgetItem was reset to
nullptr.

This patch explicitly resets the QToolBar's widgetItem while updating
the state, so that it is later correctly updated while creating a
new QWidgetItemV2.

Fixes: QTBUG-102395
Pick-to: 6.4 6.3 6.2 5.15
Change-Id: I17613d62423edcc0faf85ecb0a714865a50d87e8
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2022-06-17 20:59:21 +02:00
Volker Hilsheimer
b2fb14b7ba macOS: set print dialog up with page attributes when no printer is installed
When the print dialog is opened without a printer installed, then the
printer's output format is PDF rather than native. In this case, we need
to set the NSPrintInfo with some page atttributes explicitly, and not
default to the application-wide NSPrintInfo.sharedPrintInfo. Otherwise,
the print dialog will show the wrong page size and orientation, and the
printer will not have the previously set values when the dialog returns.

The dialog always shows the wrong values for the page margins (only
available through the presets dialog), but the printer's values are not
overridden. Also, the print range is taken care of correctly by the code
further down in this function, irrespective of the printer's output
format.

Note: this cannot be unit tested as we need to open the native print
dialog on a system without printer installed, and compare the values we
set on the printer before opening the dialog with the values after the
dialog was successfully finished via PDF->Save as PDF.

Fixes: QTBUG-100188
Pick-to: 6.4 6.3 6.2
Change-Id: I8f1561e054f6a867b131111845c9b061778e4eb0
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
2022-06-17 19:06:10 +02:00
Marcel Kummer
29176bf2f8 QBoxLayout: Pull out handling for negative insertion indices
This snippet occurs in every insert function further down. Let's pull
it out in preparation for adding an assertion that the index is in
range, which would also need to be added to every insert function.

Fixes: QTBUG-103775
Change-Id: I419f57434f860df4c947853ac307826994f0198b
Pick-to: 6.2 6.3 6.4
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2022-06-17 18:29:11 +02:00
Janne Juntunen
a2cb9ae8cc QFont: remove support for comma split setFamily()
In the documentation it is said that from Qt 6.2 onwards setFamily()
only sets a single family but so far this hasn't been the case.

Fixes: QTBUG-102768
Pick-to: 6.4
Change-Id: I2a5037ea1385cb8c6644d1e256b89e167c590967
Reviewed-by: Andy Shaw <andy.shaw@qt.io>
2022-06-17 19:02:24 +03:00
Alexey Edelev
4d7ba44e4d Add missing argument to list(APPEND in __qt_internal_get_tool_imported_location
Amends f9e48854af

Pick-to: 6.4
Change-Id: Iea525c70cca9873c0f3d96967af6cd95d57cac9b
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2022-06-17 18:02:24 +02:00
Edward Welbourne
80f8e380db Remove a misleading sentence from QDomDocument::setContent() doc
QXmlReader has been replaced by QXmlStreamReader and, either way,
there is currently no way to over-ride the purging of space-only
nodes.

Task-number: QTBUG-103753
Pick-to: 6.4 6.3 6.2
Change-Id: I7bae72d81f1b2503f93c691081137b4f60eeadda
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Sona Kurazyan <sona.kurazyan@qt.io>
2022-06-17 10:34:58 +02:00
Edward Welbourne
cfcbf38f76 Teach qmake about digit-grouping apostrophes in numeric literals
It was previously understanding them as character literal delimiters,
with unfortunate consequences if a numeric literal contained an odd
number of them. Recognize that an apostrophe with a digit on each side
of it isn't the opening quote of a character literal (unless the digit
before it is preceded by a u). Extend the findMocs test to trigger the
bug, prior to the fix; verified it passes with the fix.

Fixes: QTBUG-98845
Change-Id: I5db3ac59aaeade7c2d6c1fb680ba97261ec0e8a9
Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
2022-06-17 00:05:53 +02:00
Morten Sørvig
077eddb3e1 Windows QPA: Update screen on child window DPI change
Windows does not send WM_DPICHANGED to child windows, which means
that the normal DPI change handling code does not run for QWindows
which are embedded in a foreign, non-Qt, window.

Add code which handles WM_DPICHANGED_AFTERPARENT. This event is
sent to all child windows, but not the top-level window. Call
checkForScreenChanged() here, similar to what the WM_DPICHANGED code
does.

This commit does not add code to resize the child window, since
it is uncertain if this is the responsibility of the window which
receives WM_DPICHANGED, or of each child window.

Done-with: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Pick-to: 6.4
Task-number: QTBUG-103383
Change-Id: Icf85dd0afa806609dbbe0ffc36efbc5127962c39
Reviewed-by: <stefan.wastl@native-instruments.de>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2022-06-16 23:01:04 +02:00
Cristian Adam
7037f4620f Doc: Document how to treat qt_add_big_resources args as source files
The arguments to qt_add_big_resources are not known to CMake as source
files.

They need to be added explicitly to a CMake target in order for Qt Creator
to treat them as source files and in the case of a qrc file to expand
the contents in the project view.

Fixes: QTBUG-104320
Pick-to: 6.4 6.3
Change-Id: Iea755d998e8f9814a82983272731b0c654f80644
Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
2022-06-16 21:01:04 +00:00
Dimitrios Apostolou
b152c3b50d sanitizer-testrunner: enforce line buffering
Under coin-agent, the stdout/err are not a tty, so flushing needs to be
forced.

Change-Id: I06de43328a4f4d1c17df7188f31b5f7bc63e3335
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2022-06-16 21:04:48 +02:00
Dimitrios Apostolou
1ab354b245 qt-testrunner: Commit forgotten README file
Pick-to: 6.4 6.3 6.2
Change-Id: Ie307b95947a6910bd65bb22ecf938fae9de22f9d
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2022-06-16 21:04:48 +02:00
Ivan Solovev
662184ac68 QComboBox: emit currentIndexChanged() and currentTextChanged() when the model is cleared
QComboBox uses QPersistentModelIndex to store the current index of the
underlying model. When the model is cleared, that index is automatically
invalidated, so calling QComboBoxPrivate::setCurrentIndex(QModelIndex())
does not result in signals being emitted, because we do not detect the
index change.

This patch uses indexBeforeChange to detect such situation and emit all
necessary signals.

Fixes: QTBUG-103007
Pick-to: 6.4 6.3 6.2
Change-Id: I29326830a30a17900839e8d1737a08bd940081ea
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2022-06-16 19:29:36 +02:00
Laszlo Agocs
e4961afed2 Work around lavapipe bug in tst_qvulkan
Work around https://gitlab.freedesktop.org/mesa/mesa/-/issues/5875 by
treating the driver as broken when both the driver and device UUIDs
are all zeroes.

Fixes: QTBUG-104231
Pick-to: 6.4 6.3 6.2
Change-Id: Ibf7973361d472ebb1cb433bc61b50b2828f75c6b
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
2022-06-16 17:29:36 +00:00
Volker Hilsheimer
79a11470f3 Accessibility: don't emit focus change when reason is window activation
If a window becomes active, then the accessibility system gets informed
about that already. Qt puts focus on the focus child of the activated
window afterwards, and if this emits another accessibility event, then
accessibility clients like Windows Narrator will stop reading the
activated window, and instead read about the focused widget.

This makes dialogs like message boxes poorly accessible.

Accessibility clients already know that a window became active, and can
query Qt about the focused child within that window.

Amend test case.

Fixes: QTBUG-101585
Pick-to: 6.4 6.3 6.2
Change-Id: I2d6bff7c415a6f29c4a4f7f4e4be38079fb976ca
Reviewed-by: Jan Arve Sæther <jan-arve.saether@qt.io>
2022-06-16 19:29:36 +02:00
Volker Hilsheimer
56d6a36020 Implement a dedicated QAccessibleInterface for QMessageBox
QMessageBox has text values that an accessible client should be able to
read directly without having to navigate through the text labels.

Add test coverage.

Windows Narrator is inconsistent in reading the contents of a message
box. It might skip them completely, even though the text property is
read through the interface.

Task-number: QTBUG-101585
Change-Id: I639c2210a627733c093743790c6a6b83f4bb80d0
Reviewed-by: Jan Arve Sæther <jan-arve.saether@qt.io>
2022-06-16 19:29:36 +02:00
Lorn Potter
4d25429746 wasm: fix some coding style
- shorten a couple extra long lines
 - add space between functions

Pick-to: 6.4
Change-Id: I14ad7448372ba50f4b0299535c4261a5bbf415b7
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
2022-06-16 17:29:35 +00:00
Alexandru Croitor
b3e3b12489 CMake: Warn when using CMake 3.21.1
Changing a C++ source file can trigger rebuilds of a lot of other
source files that might include AUTOGEN'ed headers or sources.

See https://gitlab.kitware.com/cmake/cmake/-/issues/22531 for some
details. Fixed in CMake 3.21.2.
There are still files that are rebuilt even in 3.21.2, but it's less,
and it returns to the status quo of how it was in 3.21.0 or earlier
versions.

Pick-to: 6.2 6.3 6.4
Task-number: QTBUG-104352
Change-Id: Ie1c991d52df48442d4134e4ed22a8137a3c993c8
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
2022-06-16 19:29:35 +02:00