While touching code, use CaseInsensitive compare more to avoid needless tmp allocation
Change-Id: I4fe8496133925887df6879b48c730c36f486fa9c
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Exclude qdbusconnectionmanager.cpp which includes qt_windows.h,
clashing with the "interface" parameter name in qdbusinterface.h.
Task-number: QTBUG-115352
Pick-to: 6.6 6.5
Change-Id: Id41910857cb203ec5a1b784fa171eeb189ca4eca
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
This patch provides the actual implementation to detect binding loops
in property setters.
These test will help to catch all the existing binding loops that were
introduced when migrating to new bindable properties.
The logic of the new tests is taken from
tst_QObject::objectNameBinding(), but generalized to be applicable to
all bindable properties.
The original code from tst_QObject can now be removed.
The patch effectively reverts f791570b86
because a lambda returning a nullptr now means that the binding loop
test should be skipped, which is not a good default behavior.
Now when all the existing bindable properties are fixed, it's fine to
give a compilation error when adding new tests, if the class is not
default-constructible.
Task-number: QTBUG-116345
Pick-to: 6.6 6.5
Change-Id: I059d444d4bb023c050a22e5b1974565e4f581b5c
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
After the introduction of QInputDevice class the returned
QPointingDevice object from QTest::createTouchDevice()
call is no longer automatically deleted when the
QCoreApplication is deleted. Moreover, this function does
not really go thorough qpa but simply registers the device with
QWindowSystemInterface::registerInputDevice() (which is
actually also used from qpa plugins when new device is plugged)
Pick-to: 6.6 6.5
Change-Id: I3a0400288d76b7c95659d6b6ea260eff3233ebf1
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
When building for 32bit platforms (e.g. Android armv7a), then printing
qsizetype value using printf's %lld format generates a warning because
qsizetype is just an int. This breaks the build, and can't be fixed
by using another placeholder without producing a warning on 64bit
builds. So fix it by casting the qsizetype always to 64bit signed int.
Change-Id: Ie7c0fa8b3a0fe6366ce6fd5b2947f42a3e67c381
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
Emit log output and return false immediately if we fail to get both the
Activity and the Service objects. Standardize the registerNative methods
to return bool and take a QJniEnvironment, and adjust the macros
accordingly.
Simplify the startup routine to use QJniEnvironment.
Change-Id: I11be35426520dc803f5a07bbb495e908592f254e
Reviewed-by: Tinja Paavoseppä <tinja.paavoseppa@qt.io>
This further helps reduce the creation of temporary QJniEnivronment
instances (with allocated d-pointer) for cases where we simply need to
get the JNIEnv for the current thread.
Change-Id: I2eda238124be51c755d8910de9dbc9ca8eb92288
Reviewed-by: Tinja Paavoseppä <tinja.paavoseppa@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
Reviewed-by: Petri Virkkunen <petri.virkkunen@qt.io>
On Android, `long` has the width of the system, while `jlong` is always
64 bit. If we support `long` as a signature type equivalent to `jlong`,
then it becomes possible to write code that fails to compile, or in the
worst case crashes at runtime, on a 32bit system.
Instead, support quint64, which is always the same size as jlong.
Change-Id: I60432ec7411e697b5f6e1f153216ceee0af7e0f1
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
Reviewing and improving the docs for QWidget is part of the objectives
for the 2023 Q4 OKRs.
Most of the work in this patch is fixing grammatical errors and typos.
It is tempting to move much, if not all, of the Detailed Description content from the QWidget class reference page (qwidget.cpp) into its own overview/explanation page, which would be more in line with the diátaxis framework. But I think that should be a different patch.
Fixes: QTBUG-117758
Pick-to: 6.6 6.5 6.2 5.15
Change-Id: Ibb3f367c4677f7e6615bc0cd39d0ffe921862cb9
Reviewed-by: Safiyyah Moosa <safiyyah.moosa@qt.io>
Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
The purpose of this commit is to improve the QCombobox documentation.
The following updates were made:
- The Combobox image was udated with a better quality image.
- The brief was updated to make it more understandable.
- The detailed description was updated with subsection titles.
- Full stops were added to the sentences that were missing them.
Fixes: QTBUG-117748
Pick-to: 6.5 6.6
Change-Id: I417a720299ac0eb2be3f080f2fc0f76a27242423
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
Mirror what other platforms such as Windows or xcb do.
Those all unconditionally upgrade a non-alpha format such as RGB32 to
something like ARGB32_Premultiplied (or whatever
qt_maybeAlphaVersionWithSameDepth returns).
Without this, there is a discrepancy between macOS and the other
platforms when using QOpenGLWidget or QQuickWidget (which trigger
the usage of QRhiBackingStore).
For example, attempting to have semi-transparent raster widget content
over the RHI-based widgets will render incorrectly. This is visible in
6.7 (dev) with the cuberhiwidget example as well: the red
semi-transparent overlay is rendered incorrectly on macOS since
QRhiBackingStore sticking with a QImage of RGB32 has far-reaching
consequences.
Upgrading to an alpha format is also required by the "hole punching"
mechanism the texture-based widget system relies on, although there is
a suspicion that that just happens to look correct with RGB32 as well
since there is an alpha channel technically with that format, and alpha
writes may not be masked out, depending on painting internals, ending
up with RGBA content in practice.
But in other cases, like in the report and the one mentioned above
this clearly breaks down.
Fixes: QTBUG-118553
Pick-to: 6.6 6.5
Change-Id: I4b5b7a4f720377d64903e948b866f8d1c443a2d2
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
...instead of hardcoding a format such as ARGB32_Pre. A subclass may
override format() after all.
A few lines below there is the same check in fact, but this time
with hasAlphaChannel(). To be consistent, switch over to
hasAlphaChannel() in the first case as well.
Pick-to: 6.6 6.5
Change-Id: I7a5653863a72f8a0df98da66290f6d17e548b0a8
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Some plugin types are pulled in by default by certain modules.
Give users the option to add/skip plugins and/or their types.
[ChangeLog][Tools][Windeployqt] Windeployqt now has options that allow for custom plugin deployment. Users can include or exclude them, either individually, or by type.
Fixes: QTBUG-117910
Pick-to: 6.6
Change-Id: I85235783dcd814396f184912269cd5976717b2dd
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
- Show warning messages for malformed keys string
- Use QBAV instead of QL1SV, some methods in the public API may get
QU8SV overloads in later commits
- Extend unittests; also rename the unittest, it's really testing
key(s)ToValue()
Change-Id: Iec944ef4c2c5d18ab038cb933e954cf50c912523
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
By using QBAV instead of dealing with const char*; now it's clearer it's
doing the equivalent of parse_scope() does (albeit without explicit malloc()
and strrchr() calls).
Change parse_scope() to take a QBAV to keep the code consistent (new
public method overloads will take a QUtf8String in later commits).
Change-Id: I9cb0d7d45fd5f7689010c0684a094e6e98be1d74
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
As mentioned in comments, file(COPY causes rebuilding of the file every
time the project is re-configured, so, we replace it with configure_file
to avoid that.
Amend 1dcc14f2d0
Task-number: QTBUG-118191
Change-Id: I893b36fa26168f460f3ab1320a3194561c66e5df
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Since commit d3526c16, the example is just named 'Secure Socket Client'.
Change-Id: Iba15a04aa8c6ab3cd7e933903154575c15a5a81b
Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
As a fallback before picking the dummy backend.
[ChangeLog][QtNetwork][QNetworkInformation]
QNetworkInformation::defaultBackend() will now load any available
backend with Reachability support if the default ones are not available.
If none are available it will create a backend that always returns the
default values for each property.
Change-Id: I40889eeb51929e81f77ec2d84999932b095baf0b
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
The addButton(StandardButton) and button(StandardButton) APIs return
a QAbstractButton, that the user can in theory modify to their heart's
content. This causes problems when the native dialog backend is not
aware of these modifications.
We documented this limitation in e9a1c5321, but it turns out to be
more common than we first though. In particular, a typical case is
modifying the text of the button.
We now try to detect if the button has a non-standard text, and if
so turn it into a custom button when passing it on to the native
backend. From the point of view of QMessageBox it's still a standard
button, and will be reported as such in the result of exec().
To make this work the QMessageDialogOptions::CustomButton needs to
learn about custom button identifiers, so we can pass the original
standard button though.
This moves us closer to a world where the QMessageDialogOptions
represent both standard buttons and custom buttons using the same
structure, which is what we want anyways, so that we e.g. respect
the added order of standard buttons with the same role.
Pick-to: 6.5 6.6
Change-Id: Ifb7f7bd537fe71293f14ef6a006999e350bd0b52
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
Disable QGraphicsFrameCapture for the no-thread (and
no-process) configuration.
Change-Id: I7767098efff78338a763ff192512d484cd300c1d
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
That's "null passed to a callee that requires a non-null argument".
Pass EMSCRIPTEN_EVENT_TARGET_WINDOW instead of NULL to
emscripten_set_wheel_callback. The function is never called
here, so it does not matter which non-null value it
gets.
Pick-to: 6.6
Change-Id: I10187a222513820158a938bf05cde60f489956f1
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
The patch set 8dbc482489 extends support in calculating margins when ExtendsContentIntoTitleBar() is used. But this affects existing QWizard that sets custom margins through Aero style. This is because, the custom margins set by Aero style excludes top margin (titleBarSizeDp()) and excluding it once again cause slicing in the client window area.
This patch set fixes it by considering top margin only when system margins is used in windows.
Fixes: QTBUG-117428
Pick-to: 6.6 6.5
Change-Id: I6d6eefc691f26474257b58304dac169fba20b5e1
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Timothée Keller <timothee.keller@qt.io>
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
This is a simple backend based on navigator.languages,
which gives us a prioritized list of languages in the
form '["en-US", "zh-CN", "ja-JP"]'.
Use this to implement QSystemLocale::query() for UILanguages
and QSystemLocale::fallbackLocale().
Register an event handler for the native QWindow:languagechange
event in the QSystemLocale constructor. This event handler
stays active for the lifetime of the QSystemLocale object.
Task-number: QTBUG-116613
Change-Id: Ibd176748377e891b63a3f1d57605af0c2a49edb3
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
It relies on moving the mouse, which is likely related to this
failing in CI.
Pick-to: 6.6 6.5 6.2
Change-Id: Ib4a3ba7a9e874c9c2ef2d6d16143adf072e47588
Reviewed-by: Jøger Hansegård <joger.hansegard@qt.io>
Reviewed-by: Artem Dyomin <artem.dyomin@qt.io>
Use std::find_if with const iterators to avoid unconditional detach
Change-Id: Ibc9d05586a1926fefba5c6fd73c5b15ee815cd6d
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Check cheap conditions first.
Use string view types more
Don't insert in the middle of list, just append and then sort
Change-Id: I1ad7c3459eab45b2289bfe044314eec7130d8153
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
The win32 API doesn't give us much choice. _Some_ code pages have
support for returning some error if we pass a specific flag, but not
all of them.
Anyway, since the code pages might not support all that UTF-16 provides,
we can't reasonably make it error out on characters that cannot be
converted.
So, the most reasonable thing we can handle is a unpaired high surrogate
at the end of a string, assume that the rest of the string was fine, and
that the low surrogate will be provided in the next call.
Pick-to: 6.6 6.5
Fixes: QTBUG-118185
Task-number: QTBUG-105105
Change-Id: I1f193c9d8e04bec769d885d32440c759d9dff0c2
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
To match convertToUnicode, we use a local array as a temporary
buffer, then if any growth is needed we work directly with a QBA.
As a drive-by: explicitly cast to int where we pass int
Pick-to: 6.6 6.5
Task-number: QTBUG-105105
Task-number: QTBUG-118185
Change-Id: I1efff318eea41d87d558599d737b64107af4ae17
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
We don't use the value, and the docs[0] say that we get the best
performance if we don't pass the argument.
[0] https://learn.microsoft.com/en-us/windows/win32/api/stringapiset/nf-stringapiset-widechartomultibyte#remarks
See table
Pick-to: 6.6 6.5
Task-number: QTBUG-118185
Task-number: QTBUG-105105
Change-Id: I3eb5e023a936fe3def5169e3fb492a62708bbf44
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
So we don't have to do this multiple times when calling the function.
Pick-to: 6.6 6.5
Task-number: QTBUG-118185
Task-number: QTBUG-105105
Change-Id: Ifa72eedd5f71365618ec6b67fa3047f90f4eb541
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Both to store and to restore.
Without this a 3 or more octet sequence would cause errors or wrong
output. This can be seen with GB 18030.
Pick-to: 6.6 6.5
Fixes: QTBUG-118318
Task-number: QTBUG-105105
Change-Id: Id1f7f5f2fba4633b9f888add2186f4d8d21b7293
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
A few code pages do not support this flag[0]. It's also deprecated[1]
and is what Windows prefers to generate by default. So let's drop it.
[0] https://learn.microsoft.com/en-us/windows/win32/api/stringapiset/nf-stringapiset-multibytetowidechar
See note at the end for the dwFlags parameter.
[1] It's mentioned in the header files, but not online...
Pick-to: 6.6 6.5
Task-number: QTBUG-118185
Task-number: QTBUG-105105
Change-Id: I798c387170c73a953be874de139868543b2d775e
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Instead of having separate variables for the state, that we then
store back at the end, let's just make state-handing explicit, making
the logic around it easier to follow.
We now output Replacement Characters, if we try to decode stateless and
have an invalid sequence at the end. Otherwise we fall back to
convertToUnicodeCharByChar as before.
Pick-to: 6.6 6.5
Task-number: QTBUG-118318
Task-number: QTBUG-105105
Change-Id: Ifea64bc241113f468b69cad16fc3cc97a6ebe646
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Not reproducible locally. Possible permissions issue in CI.
Pick-to: 6.6 6.5 6.2
Change-Id: Ibf2255da71aaa882a2d154db6523e1af27264d4c
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
It was already blacklisted for macOS 13, and has also been blacklisted
on macOS many times in the past.
See also a9005a70d5.
Pick-to: 6.6 6.5 6.2
Change-Id: I9dc87ef409dd1fcc0f47d5e776927e8912ab40e0
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
Add method stdSysDaysToJulianDay(), which implements the conversion
from std::chrono::sys_days to Julian Day in a constexpr and noexcept
manner. Use it in the fromStdSysDays() method instead of addDays(),
and also in all constructors from std::chrono types.
This allows all constructors to be constexpr and noexcept.
Simplify toStdSysDays() so that it could also be constexpr and
noexcept.
Add compile-time roundtrip tests between QDate and std::chrono types.
Fixes: QTBUG-118221
Change-Id: Id35a669430162f1932ad8d28b553af2fd7f5c6de
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>