Commit Graph

16804 Commits (112e554cbf787fa6b093354d75889f520307c33e)

Author SHA1 Message Date
Christian Ehrlicher f6fdd91941 Tests/QWidget: fix hoverPosition test for openSUSE
On some xcb platforms the xcb_configure_notify_event_t is sent after the
window is fully exposed which leads to a wrong position for
QWidget::mapToGlobal(). In this case this results in a wrong position
for QCursor::setPos() which lets the test fail.
Fix it by waiting for a move event with a position != 0,0 before calling
mapToParent/Global().

Pick-to: 6.7 6.5 6.2
Fixes: QTBUG-123998
Change-Id: Ic5e989c4497ccf3ed720a521f9d7e73632b4b1fc
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
2024-05-16 22:18:53 +02:00
Michał Łoś 062c538781 Exclude VxWorks from qstorageinfo tests
VxWorks doesn't have implementation of QStorageInfo and uses stub.
Remove tests of it from building and running, since these can't work.

Pick-to: 6.7
Task-number: QTBUG-115777
Change-Id: Idd63d20c2dda1ae09838a7d371ae5b713180cb96
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2024-05-16 21:36:03 +02:00
Mårten Nordheim 68ceb847d6 QNetworkReply: Add a separate test for self-contained tests
Nothing there should rely on the network testing server.
Part of this will also be testing the local/unix domain socket support.

Task-number: QTBUG-102855
Change-Id: Icf3b0bd9370ec62e003862caf4cd3ed38d875bac
Reviewed-by: Mate Barany <mate.barany@qt.io>
2024-05-16 19:40:03 +02:00
Edward Welbourne bd01008bca Decouple the TZ and ICU backends for timezone data
The TZ backend was instantiating an ICU backend to look up display
names, which entailed locking of the lazy-evaluated ICU
member. Instead, break out how ICU looks up display names into the new
timezone_locale feature's code, so that it can be shared between the
two backends. Linux thus only needs to build one backend.

Task-number: QTBUG-115158
Change-Id: I37ebc9a30f1c0ab6fd32d45dffa9f21355fb868d
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2024-05-16 16:51:15 +02:00
Assam Boudjelthia fbb35cdb0b Android:CMake: Add QT_ANDROID_PACKAGE_NAME property
Allow setting the package name directly from CMake properties.
If the package name is not set manually under AndroidManifest.xml
nor build.gradle, then the value set by this property is used.
The value is passed to build.gradle as "namespace" which is the
way to set the package name after AGP 7.4 instead of
AndroidManifest.xml "package" attribute.

Task-number: QTBUG-106907
Change-Id: I94bd73c294d751eabfd96c0a10a6b3ff270d8137
Reviewed-by: Tinja Paavoseppä <tinja.paavoseppa@qt.io>
2024-05-16 16:40:55 +03:00
Kai Köhne 5e699c2a8b Replace 'Qt Designer' and 'Qt Widgets Designer' in code
Use new term in examples, code comments, error messages and and mime types.

Task-number: QTBUG-122253
Change-Id: I355452d6eb02a7a0ffbb20acf82ddb8ebbfa4837
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
2024-05-16 13:04:41 +01:00
Michał Łoś 7678edebba Limit size of large files test for VxWorks
VxWorks doesn't allow mapping file beyond EOF, adjust tests to encompass
that.

Additionally, for testing on VxWorks we use use builtin /tmp which is a
RAM disk (in case of VxWorks-supported imx.6 bord which have 1GB of
RAM), set max size of tested large file to 256MB, 28 bits.

Pick-to: 6.7
Task-number: QTBUG-115777
Change-Id: I73cbe112331b7cb95d80bb44b792578a1eb88a07
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2024-05-16 14:04:41 +02:00
Łukasz Matysiak 88cb405514 Make tst_QFileInfo::setFileTimes more robust
There are some systems that do not support millisecond resolution in
timestamps.

An example of such system is VxWorks.

POSIX2008 demands that `stat` contains an `st_mtim` field of type `timespec`.
That field holds modification time with a nanosecond resolution.

VxWorks reports _POSIX_VERSION as 200112.
The `stat` struct does not contain `st_mtim`, but rather an `st_mtime` which
holds a `time_t` which contains seconds.
This leads to setFileTimes failing, because the test tries to
save the current datetime as the modification time of a file, but the ms
part is cut off.

Fix the problem by checking if the timestamp read back from the
filesystem contains milliseconds and only check it if it's not zero.

Pick-to: 6.7
Task-number: QTBUG-115777
Change-Id: I8c8a3b1c8e97955f13f059bcebf66d1b5af174fe
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2024-05-16 08:51:53 +02:00
Kirikaze Chiyuki 4431ffa8b9 Fix separator in QLocale::uiLanguages()
Since commit 91e70f23 introduced separator to uiLanguages(), the system
locale id still does not respect the separator parameter and hardcodes
dash as separator. Fixing this should make the format consistent.

Pick-to: 6.7
Change-Id: I1ab8edfa49117bdc9c4353228e73c2d1e5becffc
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Moody Liu <mooodyhunter@outlook.com>
2024-05-16 01:57:04 +08:00
Marc Mutz bf96c45f94 QDesktopServices: clean up pre-Qt-6.6 code
Remove the code that was already commented out by
37a25fce94 for Qt versions ≥ 6.6.

Pick-to: 6.7
Change-Id: I40a3e974430add17b52307781d092bd4f58c0c35
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Reviewed-by: Juha Vuolle <juha.vuolle@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2024-05-15 18:22:39 +02:00
Łukasz Matysiak 7fad4df8df Fix tst_QFileSysteMWatcher::basicTest on VxWorks
POSIX2008 demands that `stat` contains an `st_mtim` field of type `timespec`.
That field holds modification time with a nanosecond resolution.

VxWorks reports _POSIX_VERSION as 200112.
The `stat` struct does not contain `st_mtim`, but rather an `st_mtime` which
holds a `time_t` which contains seconds.

Because of that, when the test creates and modifies a file within one
second, the polling watcher does not detect any changes.

Fix the problem by postponing the watcher by 1s.

Pick-to: 6.7
Task-number: QTBUG-115777
Change-Id: Idfc1d7b2e111967a42c93c0adaffaa7d28ee20a7
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2024-05-15 18:22:39 +02:00
Hatem ElKharashy 20521c3163 Support SVG specific stroke styling properties
SVG has special properties for stroke styling. Those are usually
supported by different browsers, because SVG documents can be
used inside HTML files. This kind of styling is already supported
by QPen and all need to be done is some plumbing to save and
retrieve those values in QTextDocument when it is stored as HTML.

Change-Id: I291efab5483ac5e852d117e762e203257c64b47f
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
2024-05-14 21:48:12 +03:00
Thiago Macieira fd36609064 QUrl: distinguish empty and null host/authority
We do that for the other components of the URL, to distinguish a present
host or authority that happens to be empty from an absent one. We
already had partial support for this because QUrl does distinguish
between foo:/ and foo:///.

Change-Id: Ie30a3caf09ef4176bb36fffd17cddc20c47bb1a6
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2024-05-14 11:00:11 -07:00
Ivan Solovev 3ca9877f8c QSizeF: add qFuzzyCompare and qFuzzyIsNull overloads
[ChangeLog][QtCore][QSizeF] Added qFuzzyCompare and qFuzzyIsNull
overloads for QSizeF

Drop the custom qFuzzyCompare() implementation from
tst_qgraphicsgridlayout.cpp

Task-number: QTBUG-120308
Change-Id: I32d11c1c81d0503914a8168b5e960a8c6ce943d9
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2024-05-14 14:33:21 +02:00
Tatiana Borisova c2826805de QSize(F): use comparison helper macros
Also explicitly add QSizeF vs QSize comparison. Previously such
comparison was implicitly converting QSize to QSizeF, and doing the
fuzzy comparison. We have to keep the old behavior to avoid
breaking user code, so use fuzzy comparison in the new operators
as well.

As a drive-by: put all the hidden friends in the private section.

Done-with: Ivan Solovev <ivan.solovev@qt.io>
Task-number: QTBUG-120308
Change-Id: Ia52adc97c557e475b19f5c16f9dd8c992637280e
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
Reviewed-by: Tatiana Borisova <tatiana.borisova@qt.io>
2024-05-14 14:33:21 +02:00
Mårten Nordheim 6f2ef2eacb QDecompressHelper: update the benchmark
After the zip bomb checks were added the benchmark was not
adjusted.

Also move the QByteArray creation outside the loop, to not include
the time it takes to make a heap allocation.

Pick-to: 6.7 6.5
Change-Id: Ia958d497dd27fc61e0084b6f5c11d76886bb24c4
Reviewed-by: Mate Barany <mate.barany@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2024-05-14 12:33:21 +00:00
Tatiana Borisova ed71387d1c QtPrivate::ResultIteratorBase: use modernize comparisons
Replace class operators operator==(), operator!=() of
QtPrivate::ResultIteratorBase to friend method comparesEqual() and
Q_DECLARE_EQUALITY_COMPARABLE macro.

Use QT_CORE_REMOVED_SINCE and removed_api.cpp to get rid of
current comparison methods and replace them with a friend.

Task-number: QTBUG-120304
Change-Id: Ib9a50a400df86d1dc034d2a0cfee804109a2b93f
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
2024-05-14 00:32:35 +02:00
Tatiana Borisova 199e1a1091 QElapsedTimer: use new comparison helper macros
Replace public friend operators operator==(), operator!=(),
of QElapsedTimer to the friend method comparesEqual().

Add compareThreeWay() for the <=> operator.

Save friend bool Q_CORE_EXPORT operator<() method and
add defined(__cpp_lib_three_way_comparison) condition for the C++20
spaceship operator.

Task-number: QTBUG-120304
Change-Id: I575865403f4e333578ff174e8e6879e8925d4b09
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
2024-05-14 00:32:34 +02:00
Volodymyr Zibarov 4585cacaa9 Add way to override when to show context menu
Add Qt::ContextMenuTrigger enum used with
QStyleHints::setContextMenuTrigger() to override default platform
behavior when to trigger context menu event.
The default is to show context menu on mouse press on
UNIX systems and on mouse release on Windows.

Give developer a possibility to override platform default behavior
to make cross platform application that behaves the same way on all
platforms

Task-number: QTBUG-93486
Change-Id: Ic832d3d8a7c355a8adb46868fff9cfd19988cf3c
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2024-05-13 22:32:34 +00:00
Mårten Nordheim 3d59a0f7c7 Fix moc include for tst_qcomparehelpers
The Q_OBJECT is in the header so it should use the moc_*.cpp form.

Change-Id: I1aa91d9fd0013d7270d551326334ed4ee35f3c64
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2024-05-13 15:25:50 +02:00
Mårten Nordheim 0a8cbcc507 tst_qcomobject: Reduce size of Qt-namespace
It is including the full test, which we normally don't do, and
additionally included the main and the moc-include.

Change-Id: I651d71848f070a9d0fd62e56ebd204f4c1ae232c
Reviewed-by: Jøger Hansegård <joger.hansegard@qt.io>
2024-05-13 15:25:36 +02:00
Joerg Bornemann 61c55795c1 CMake: Remove mention of tests/auto/other/atwrapper
This test was removed in commit
eee4167a90.

Change-Id: Id42634450242a0658bac603d7973b8f1e0e5b6c0
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2024-05-11 18:32:29 +02:00
Thiago Macieira ed6d1fa71a QDBusSignature: accept empty strings as valid
QDBusSignature holds a D-Bus value of type SIGNATURE, which is zero or
more signatures, not one or more. This changes the default constructor
to create a valid signature, which we denote by not being a null
QString. That means we need to use something other than the default
constructor in our tests for attempting to pass invalid signatures.

[ChangeLog][QtDBus][QDBusSignature] Fixed a bug that caused the class
not to accept an empty string as a valid D-Bus SIGNATURE value.

Fixes: QTBUG-124919
Pick-to: 6.5 6.7
Change-Id: I262c3499666e4f4fbcfbfffd17cb3793dcf2eae3
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2024-05-10 13:17:20 -07:00
Tatiana Borisova 5a0faa9198 QMetaType: use modern comparisons
Internal QPropertyBindingPrivatePtr, QArgumentType classes
also have been updated;

Replace class operators operator==(), operator!=() of
QRegularExpression to friend method comparesEqual() and
Q_DECLARE_EQUALITY_COMPARABLE macro.

Task-number: QTBUG-120304
Change-Id: I010617cbcb8bd6afb7c21ee4345398648821f72c
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
2024-05-10 21:54:54 +02:00
Ivan Solovev a4341827ac QEasingCurve: use comparison helper macros
Like with the QLine(F) case, we have to use QT_CORE_REMOVED_SINCE to
remove the old member operators, but also need to guard the new friend
functions with !(QT_CORE_REMOVED_SINCE), because QEasingCurve is also
one of the core types, and on Windows the metatype interface for it is
instantiated in removed_api.cpp.

Task-number: QTBUG-120308
Change-Id: I1bd66f7230afd3eba868d05fd496ab13a0331178
Reviewed-by: Tatiana Borisova <tatiana.borisova@qt.io>
2024-05-10 16:31:28 +02:00
Ivan Solovev 473d06970d QMarginsF: add qFuzzyCompare and qFuzzyIsNull overloads
[ChangeLog][QtCore][QMarginsF] Added qFuzzyCompare and qFuzzyIsNull
overloads for QMarginsF

Task-number: QTBUG-120308
Change-Id: I7c1ceaa9ba544458738b71bf326395eef59e7a54
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2024-05-10 15:33:40 +02:00
Ivan Solovev eb178d3e51 QMargins(F): use comparison helper macros
Also explicitly add QMarginsF vs QMargins comparison. Previously such
comparison was implicitly converting QMargins to QMarginsF, and doing the
fuzzy comparison. We have to keep the old behavior to avoid
breaking user code, so use fuzzy comparison in the new operators
as well.

Task-number: QTBUG-120308
Change-Id: Ic82f64078cd991859b851f24aa7017ef0b91a4e1
Reviewed-by: Tatiana Borisova <tatiana.borisova@qt.io>
2024-05-10 15:33:40 +02:00
Ivan Solovev 8a54d25a46 Fix QMarginsF::operator==() for zero margins
The (in)equality operators for QMarginsF are documented to use fuzzy
comparison. However, the implementation unconditionally used
qFuzzyCompare which is incorrect for the case of 0 margins.
Update the implementation to use a combination of qFuzzyIsNull and
qFuzzyCompare, like it's done for QPointF.

[ChangeLog][QtCore][QMarginsF] Fixed a bug when equality comparison
returned incorrect results if one of the margins was zero.

Task-number: QTBUG-120308
Change-Id: I6e785fe8b523f6aa5f5317fb75877fdbf4e086c2
Reviewed-by: Tatiana Borisova <tatiana.borisova@qt.io>
2024-05-10 15:33:40 +02:00
Ivan Solovev 9d4e1b9f8d QRectF: add qFuzzyCompare and qFuzzyIsNull overloads
[ChangeLog][QtCore][QRectF] Added qFuzzyCompare and qFuzzyIsNull
overloads for QRectF

Task-number: QTBUG-120308
Change-Id: Ie2eee0a28b902bdfeb91be45a164be659aef1a20
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2024-05-10 15:33:40 +02:00
Ivan Solovev 30bf163355 QRect(F): use comparison helper macros
Also explicitly add QRectF vs QRect comparison. Previously such
comparison was implicitly converting QRect to QRectF, and doing the
fuzzy comparison.
The new operators are directly calling operator==(QPointF, QPoint),
which also does the fuzzy comparison, so the old behavior is preserved.

As a drive-by: move the operators into the private section.

Task-number: QTBUG-120308
Change-Id: I9b96ed4266e6a6c02a52c8cfff6ec1b2d036a7ca
Reviewed-by: Tatiana Borisova <tatiana.borisova@qt.io>
2024-05-10 15:33:40 +02:00
Ivan Solovev 9bedf8a53c QLineF: add qFuzzyCompare and qFuzzyIsNull overloads
[ChangeLog][QtCore][QLineF] Added qFuzzyCompare and qFuzzyIsNull
overloads for QLineF

Task-number: QTBUG-120308
Change-Id: I3d032f47851d886adce95ac72109fde169892688
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2024-05-10 15:33:40 +02:00
Ivan Solovev 7072030d93 Fix QLineF::isNull behavior when handling zero points
QLineF::isNull was using qFuzzyCompare on the x and y components of its
points, which was not working correctly if some of the components was
equal to zero. The correct approach is to use qFuzzyIsNull togeter with
qFuzzyCompare. This approach is already implemented in qFuzzyCompare()
overload for QPointF, so just use it.

Add unit-tests for QLine(F)::isNull.

[ChangeLog][QtCore][QLineF] Fixed a bug when QLineF::isNull() returned
incorrect result if the start or end point contained a zero component.

Change-Id: I3cfe6406b1299de32fe82b1fcbfb0416f0eaac15
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2024-05-10 15:33:40 +02:00
Ivan Solovev 2a847dd93b QLine(F): use comparison helper macros
Also explicitly add QLineF vs QLine comparison. Previously such
comparison was implicitly converting QLine to QLineF, and doing the
fuzzy comparison.
The new operators are directly calling operator==(QPointF, QPoint),
which also does the fuzzy comparison, so the old behavior is preserved.

Remove the old relational operators using QT_CORE_REMOVED_SINCE, but
also wrap the new operators in !defined(QT_CORE_REMOVED_SINCE).
That is required, because on Windows the instantiation of
QMetaTypeInterface<QLine(F)> happens in removed_api.cpp (as both
qline.h and qmetatype.h are already included there). If we just add
removed member operators into removed_api.cpp, the metatype interface
will not be able to create an equals() function, because of the
ambiguity in equality operators (member vs friend). That's why we have
to exclude the new friend operators from removed_api.cpp.

Done-with: Fabian Kosmale <fabian.kosmale@qt.io>
Task-number: QTBUG-120308
Change-Id: Ibbf5ec077f69c75da0d36a8be5596acd0fcd44d0
Reviewed-by: Tatiana Borisova <tatiana.borisova@qt.io>
2024-05-10 15:33:39 +02:00
Ivan Solovev fa0d77e290 Add qFuzzyCompare() and qFuzzyIsNull() overloads for QPointF
Use the new qFuzzyCompare() overload in op==(QPointF, QPointF).

[ChangeLog][QtCore][QPointF] Added qFuzzyCompare() and qFuzzyIsNull()
overloads for QPointF.

Task-number: QTBUG-120308
Change-Id: I522164acb65432bf55c58b55575f25535d27e27a
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2024-05-10 15:33:39 +02:00
Ivan Solovev d999e64692 QPoint(F): use comparison helper macros
Explicitly add QPointF vs QPoint comparison. Previously such
comparison was implicitly converting QPoint to QPointF, and
doing the fuzzy comparison. We have to keep the old behavior to
avoid breaking user code, so explicitly use fuzzy comparison in
the new operators.

As a drive-by: move the friend functions into the private section,
so that they are actually hidden friends.

Task-number: QTBUG-120308
Change-Id: I471a890b8332455e8b2dc1b99e5fba4ada168a30
Reviewed-by: Tatiana Borisova <tatiana.borisova@qt.io>
2024-05-10 15:33:39 +02:00
Piotr Wierciński 9907ef0d64 wasm: Allow fetching from background thread
Allow network request from background thread by proxing it to main
thread if needed.
Introduce "fetchHelper" which is stored on heap and owns
"outgoingData" which must be valid during entire fetch operation.
It is also used for synchronization between thread that has
scheduled fetch operation and the one that is executing it.
Enable the test that was skipped before fix.

Fixes: QTBUG-124111
Change-Id: Ifafa4c40fa435122639fa861a61fbf96340a7747
Reviewed-by: Piotr Wierciński <piotr.wiercinski@qt.io>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
Reviewed-by: Jøger Hansegård <joger.hansegard@qt.io>
2024-05-10 09:55:19 +00:00
Jari Helaakoski 0ae44ccc6f Improve test compilation setup with QtLite configuration
Functional fix will come later via separate tasks.

Task-number: QTBUG-122999
Change-Id: Ib805740c87ff21cea5a186add71cc594ab4d4df1
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2024-05-10 09:04:44 +00:00
Ari Parkkila 552c408b22 ptests: Change qdbusconnection to search testdata from parent path
The qdbusconnection_spyhook test includes qdbusconnection which uses
QFINDTESTDATA to find qdbusconnection.conf, but TESTDATA search path is
not valid when qdbusconnection_spyhook is installed via packaging.
Because the qdbusconnection and qdbusconnection_spyhook tests have
common parent folder use it as base for TESTDATA search.

Task-number: QTBUG-118680
Change-Id: I6657ddb0e650d49f214c5651ee8bcf8ca03db4e2
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2024-05-10 11:27:51 +03:00
Volker Hilsheimer 95d4e6baba ColorScheme: make QStyleHints::colorScheme writable for applications
Applications can request the color scheme to be either explicitly light
or dark, or to follow the system default by setting the scheme to
Qt::ColorScheme::Unknown.

Setting the color scheme will make the request to the QPlatformTheme
implementation, which can then use the appropriate implementation to
set the application's appearance so that both palette and window
decoration follow the requested color scheme. This should trigger
theme change and palette change events. A change to the effective
scheme should then call back into QStyleHintsPrivate::updateColorScheme,
which will emit the changed signal for the property.

Implement this for macOS (Cocoa), iOS, Android, and Windows.

On macOS, we have to use deprecated AppKit APIs; the replacements for
those APIs are not suitable for this use case. On iOS, the setting is
for each UIWindow, which we can update or initialize based on an
explicitly requested scheme.

On Android we can piggy-back on the logic added when dark theme support
was introduced in b4a9bb1f6a.

On Windows, we have to fake a dark palette if the dark scheme is
requested on a light system, as there is no API to read a dark palette.
However, we also have to ignore any application preference if a high-
contrast accessibility theme is selected by the user (we report the
color scheme as unknown; there are both light and dark high-contrast
themes), and read the system palette using the GetSysColor API, which
is used for light mode. And we need to initialize windows with the
correct frame if the application explicitly overrides the system color
scheme.

Add an auto-test to the QApplication test, as that gives us the most
coverage to confirm that QStyleHints emits the changed signal, and that
Theme- and PaletteChange events are received by the toplevel widget
when the color scheme actually changes. This test has to be skipped
on platforms where we cannot set the color scheme programmatically.

Add the option to explicitly select the color scheme to the widget
gallery example, and default it to dark mode.

Fixes: QTBUG-124490
Change-Id: I7302993c0121284bf9d3b72e3149c6abbe6bd261
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2024-05-10 01:15:12 +02:00
Thiago Macieira a6d26ef64b tst_QDnsLookup: add debugging information with the query time
Change-Id: I455fe22ef4ad4b2f9b01fffd17c805aa76d2b314
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2024-05-08 21:13:49 -07:00
Thiago Macieira 4503dabfbd QDnsLookup: add support for TLSA records
[ChangeLog][QtNetwork][QDnsLookup] Added support for querying records of
type TLSA, which are useful in DNS-based Authentication of Named
Entities (DANE).

Change-Id: I455fe22ef4ad4b2f9b01fffd17c723aa6ab7f278
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2024-05-08 21:13:47 -07:00
Thiago Macieira 503fd60988 QDnsLookup: add the ability to tell if the reply was authenticated
This is implemented for DNS-over-TLS and for the native Unix resolver,
because I can find no way to get the state of the reply on Windows with
the WinDNS.h API.

Change-Id: I455fe22ef4ad4b2f9b01fffd17c7bc022ded2363
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2024-05-08 21:13:45 -07:00
Thiago Macieira f2f00b2a46 QDnsLookup: implement DNS-over-TLS
For the libresolv (Unix) implementation, we already had the packet
prepared by res_nmkquery(). This commit moves the res_nsend() to a
separate function so QDnsLookupRunnable::query() can be more concise.

On the Windows side, this commit creates a separate function for the DoT
case, because we now need to use two other functions from WinDNS so we
can create a query and parse the reply.

The rest is just QSslSocket.

Change-Id: I455fe22ef4ad4b2f9b01fffd17c805a3cb0466eb
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2024-05-09 04:13:44 +00:00
Thiago Macieira 9724b039ca QDnsLookup: add initial support for DNS-over-TLS (DoT)
This is just an empty shell for now. The implementation will come in the
next commit.

[ChangeLog][QtNetwork][QDnsLookup] The class now supports DNS-over-TLS
and some other DNSSEC experimental features, on some platforms. Use
QDnsLookup::isProtocolSupported to know if the protocol is supported on
a given platform.

Change-Id: I455fe22ef4ad4b2f9b01fffd17c7e034dee75533
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2024-05-08 21:13:43 -07:00
Ahmad Samir 9a61bc5dfc QStaticLatin1StringMatcher: add indexIn(QStringView)
... mirroring the same change in QLatin1StringMatcher.

Task-number: QTBUG-117054
Change-Id: I8d1f4ed01ee75a51e3d99a165dbb35ae7dae5886
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
2024-05-08 22:05:35 +02:00
Tatiana Borisova ec88e63f2a QFuture::const_iterator: use modernize comparisons
Replace class operators operator==(), operator!=() of
QFuture::const_iterator: to friend method comparesEqual() and
Q_DECLARE_EQUALITY_COMPARABLE macro.

Task-number: QTBUG-120304
Change-Id: Ifa264b83f4d5623db99820847ab9a800cca99be2
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
2024-05-08 22:05:35 +02:00
Christian Ehrlicher 5ea2481556 QWidget: fix render() in RTL mode
Rendering a widget to a paintdevice via QWidget::render() did not pass
the LayoutDirection mode of the widget to the paintdevice which lead to
wrong rendering of text.
This is especially visible with the windows 11 style which does not draw
some widgets directly on the screen but through a QGraphicsEffect on a
QImage.

Pick-to: 6.7 6.5 6.2
Fixes: QTBUG-124931
Change-Id: If2cfa326d2ca45c42e203a4ae91fd857afa5c69c
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
Reviewed-by: Wladimir Leuschner <wladimir.leuschner@qt.io>
2024-05-08 19:58:17 +02:00
Tor Arne Vestbø 6c36e21bec iOS: Always call setParent during QIOSWindow construction
We rely on setParent for parenting top level windows into our desktop
manager view, so we can't condition the call on having a parent window,
like we do on other platforms.

This was a regression from 988039729f.

Fixes: QTBUG-125142
Pick-to: 6.7
Change-Id: I2884d77db09cba5371ccd77eabda7ce38c0292de
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
2024-05-08 19:51:25 +02:00
Ahmad Samir c878a51509 QLatin1StringMatcher: add indexIn(QStringView) overload
Drive-by changes, remove a redundant typedef.

[ChangeLog][QtCore][QLatin1StringMatcher] Added indexIn(QStringView)
overload.

Task-number: QTBUG-117054
Change-Id: I5a8426cb0f9d9111f086015902ffe2185a267c86
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Øystein Heskestad <oystein.heskestad@qt.io>
2024-05-08 19:22:46 +02:00
Frédéric Lefebvre a0759dd420 tst_QApplication::focusWidget() remove setActiveWindow() child section
2f6fe3a268 as made calls to
QApplicationPrivate::setActiveWindow() redundant.

Remove redundant calls.

Task-number: QTBUG-121488
Change-Id: Ib3b39f4bd51c87eeeebe329ada163f24390f6bc3
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
2024-05-08 13:37:47 +02:00