After the change for QTBUG-89145 the parent was not set to 0 when the
item was not attached to a model.
Pick-to: 6.6 6.5 6.2
Fixes: QTBUG-117900
Task-number: QTBUG-89145
Change-Id: I421e775130b03ce3eb2dd1dd05370e7391af087b
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Otherwise, for example fillRect() will fail silently.
Most operations already had the warning, but some were missing it.
Pick-to: 6.6
Change-Id: I1ef6bf880d5b0722baadcf0ced68a968f0b1a070
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
Reviewed-by: David Faure <david.faure@kdab.com>
This reduces the size of the header. I renamed the arguments for fill()
because "size" would shadow a member function.
Change-Id: I85b3fc2dd45c4693be13fffd1795b706b92e0965
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
Reviewed-by: Ahmad Samir <a.samirh78@gmail.com>
This variable supposedly holds a list of environment variables that will
be set by the Qt app, however, if a user needs to set an env variable,
it can be already done either in C++:
qputenv(key, value);
Or in Java via (the same method that Qt plugin use):
android.system.Os.setenv(key, value, override);
Thus, such field just makes things more confusing overall only.
Task-number: QTBUG-115017
Task-number: QTBUG-114593
Change-Id: I14856ed0720bfa2605da9c7d51173703df52bc58
Reviewed-by: Tinja Paavoseppä <tinja.paavoseppa@qt.io>
Instead of having to set a field of the class QtActivity to set extra
app parameters (i.e. passed when calling main()), make it doable via
a new API call appendApplicationParameters(). Note that this is
equivalent to setting the manifest metadata "android.app.arguments".
Providing a dedicated method for this makes it cleaner and is the
expected way.
Task-number: QTBUG-115017
Task-number: QTBUG-114593
Change-Id: I407cb68e57fa9a1be24586e42cb947f9c7f4037e
Reviewed-by: Tinja Paavoseppä <tinja.paavoseppa@qt.io>
Currently the default theme is looked for using reflection in the
android.R package to get an id and then it's set. This is not needed
if we set the theme directly in the user's QtActivity which would have
access to that id directly pre-deployment.
To make setting a theme more in line with Android, retreat to using
setTheme() call directly for user projects instead of having to maintain
some internal field to store the theme name and have the user set that
if they want a different theme for their app.
Also, the Android plugin seems to set an env var for QT_ANDROID_THEME
with that default theme's name and that's used in QAndroidPlatformTheme
to check a theme specific extracted theme style.json, however, the Java
side doesn't seem to ever write to such a path, making this approach
totally redundant. For that reason, this code path is now removed.
Fixes: QTBUG-114075
Task-number: QTBUG-115017
Task-number: QTBUG-114593
Change-Id: I9ab3c025626aac2c09bc19eb7d846eca14a45070
Reviewed-by: Tinja Paavoseppä <tinja.paavoseppa@qt.io>
The delegate classes shouldn't be used outside of the Activity/Service
classes, since they're practically private implementation, so don't use
them anywhere outside Activity/Service.
Since Qt Android apps still mainly support having one QtActivity/
QtService, QtNative heavily uses those objects to do various operations.
For that reason, we still need to use the delegate there. The aim is
to change that in future patches and do the operations where they make
more sense for example directly under QtActivityBase/QtActivityDelegate
or Service counterpart.
The QtServiceDelegate is used no where and have no special
implementation, so it's removed here.
Task-number: QTBUG-118077
Change-Id: I5e106318169be19fec8163e8e500ee573af0e1bc
Reviewed-by: Tinja Paavoseppä <tinja.paavoseppa@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
It's not immediately clear why setApplicationDisplayMetrics()
is called from within QtNative.startApplication() while it's also
called by QtLayout.onSizeChanged(), it seems to be a redundant call
when starting the native Qt app because QtLayout takes care of it
already.
Task-number: QTBUG-115016
Task-number: QTBUG-118077
Change-Id: I54e8af6356226ca5f1b849ef323be9659b9db663
Reviewed-by: Tinja Paavoseppä <tinja.paavoseppa@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
The flags were not set to the system UI with Android APIs.
Amends 58c7249ee8.
Task-number: QTBUG-118077
Change-Id: I30fb5272bdb5d7a3a3a82708b9a1604753fc4e6c
Reviewed-by: Tinja Paavoseppä <tinja.paavoseppa@qt.io>
stdext is deprecated, slated for removal.
The macros were used to work around a compiler warning generated
when using the 3-arg overload of certain STL algorithms even when
the 4-arg version (added in C++14) was not available.
These deprecation warnings seem to have been discontinued as of
MSVC++ 14.15 _MSC_VER == 1915 (Visual Studio 2017 version 15.8)
so making the macros no-ops from VS 2022 17.8 onward is not expected
to trigger these warnings again.
Pick-to: 6.6 6.5 6.2 5.15
Fixes: QTBUG-118993
Change-Id: I2c3b69d46d13f6fcccf0ffce186b984b7758f287
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
The nameMatch() function has an implicit precondition that neither
argument is nullptr: it immediately dereferences both arguments.
Prevent the crash by checking for name == nullptr early, before
passing to nameMatch().
Add tests for null and empty.
As a drive-by, make variables in the test const (needed for the
QByteArray to avoid detaching, peer pressure for the others).
Amends a639bcda1e.
Pick-to: 6.6 6.5 6.2
Change-Id: I4a30f6c130310eb701ba7c7251168294489c34db
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
As per the documentation: A message box displays a primary
text to alert the user to a situation, an informative text to
further explain the situation, and an optional detailed text to provide
even more data if the user requests it.
The AppKit NSAlert doesn't provide such a "detailed" section, and our
code just added this "even more data" detailed text to the primary text.
This breaks the UI when the detailed text is very long, perhaps a
complete log output with dozens or even hundreds of lines of text.
Since NSAlert doesn't provide a "details" space, fall-back to the non-
native message box if detailed text is provided.
[ChangeLog][QtWidgets][QMessageBox] On Apple platforms, the native
message box is no longer used when detailed text is set.
Pick-to: 6.6 6.5
Fixes: QTBUG-118992
Change-Id: I6f4764ceb8f8e57d641c0b0660223a9c26f5bd26
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
If an application has two windows, and the user tries to do multi-touch
gestures with different fingers in each window at the same time, we want
the touchpoint IDs to be unique. m_nextTouchId was a per-window variable
before; the result was that the QEventPoint delivered to the second
window was replacing values (including QEventPointPrivate::window)
in the persistent QEventPoint that was still being held in the first
window; then when the release of the first point occurred,
QGuiApplicationPrivate::processTouchEvent() saw its destination window
pointer as null because the second touchpoint had already been released.
QEventPoint::id is of type int, with negative values being invalid.
nextTouchId is of type quint16 so that it will always be positive, and
we can let it eventually overflow (wrap back to 0) rather than resetting
it to 0 after each touch gesture. The only requirement is that the IDs
need to be unique and positive (and typically they are sequential: that
makes debug output easier to understand).
Task-number: QTBUG-118909
Change-Id: Ia0f1edc9a5e2b362028bed4418fed228814cddb6
Pick-to: 6.5 6.6
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
When the per-abi external projects are built, specifying a dynamic
path in QT_ANDROID_EXTRA_LIBS based on CMAKE_ANDROID_ARCH_ABI would
not propagate that value back to the main project's deployment json
file.
While the actual library files would be copied into the apk, they
would not be loaded because the generated libs.xml file would be
missing per-abi entries in the 'bundled_libs' array (except for the
main abi).
Document that project developers should explicitly specify all the
libraries in the property.
androiddeployqt then takes care to filter out unsupported architecture
libraries in each abi build dir, but it will still copy all of them
into the final apk, as well as list all the architectures in libs.xml.
A proper fix would be to generate additional files with information
from each per-abi external project, that would then be read by
androiddeployqt (basically merge specific target property info from
each sub-project).
Hopefully this can be done without introducing new API.
Pick-to: 6.5 6.6
Fixes: QTBUG-117206
Task-number: QTBUG-118838
Change-Id: I181a170cffdb49b0b0d455d997cfae90ada312f0
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
Use pmf-style connections instead old string-based ones.
Change-Id: Idab3a9d60e7cddcd2076476a21dbb1b5d2e4189c
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Even a tab was hidden it could be accessed with the key navigation or
a scroll event which lead to painting artifacts.
Pick-to: 6.6 6.5 5.15
Fixes: QTBUG-101219
Task-number: QTBUG-63038
Change-Id: I58be694eef5f86cccecbe528891a39a4acdda15f
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
The two destcolors and the buffer are all already premultiplied. This
would double premultiply them.
Pick-to: 6.6 6.5 6.2
Change-Id: I235bee616d8e0033b87c6f96464f0926af7bd29a
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
Amends 339323b999
Capturing a function argument (or any local variable)
by address is a bad idea.
Fixes: QTBUG-118912
Fixes: QTBUG-118986
Change-Id: I521d319a37f7acd6c66732f5f7d3cf1be4d49029
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Ahmad Samir <a.samirh78@gmail.com>
By default, QPrinter::setPageLayout correctly rejects a layout that
specifies margins outside the printable area. However, when the layout
specifies fullpage mode, that check should be skipped, since then one
should be allowed to target the unprintable area, by definition.
Fixes: QTBUG-118580
Pick-to: 6.6 6.5
Change-Id: I8bd93d11aefee0344725ac51c2490d029657f483
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
We can not thread mono image formats as the bit access isn't atomic.
Pick-to: 6.6 6.5
Fixes: QTBUG-117494
Change-Id: Ica8e08fc3da73983f6b4da2a133f5e715fd0d787
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
The unplug() and startDrag() functions of QMainWindowLayout and
QDockWidget used a boolean argument specifying whether a single dock
widget or a group of dock widgets should be unplugged. The argument
defaulted to true.
That has lead to inconsistent unplug operations, broken item_lists and
crashes, especially when the methods were called without an argument.
To improve code readability, replace bool trap with a meaningful
enum. Remove default arguments, in order to force explicit calls.
This patch does not change behavior, it is just carved out to
facilitate reviews.
Task-number: QTBUG-118578
Task-number: QTBUG-118579
Pick-to: 6.6 6.5
Change-Id: I50341b055f0bb76c2797b2fb1126a10de1fee7dd
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
This is also highlighted by Android Studio Manifest editor.
Change-Id: If159405b0fceeb955e26f3916dd0e96b6ca76003
Reviewed-by: Tinja Paavoseppä <tinja.paavoseppa@qt.io>
If we use 'this' as context it might still try to invoke
the timer after we have left the function, leading to
stack-use-after-return.
To avoid doing an in-depth dive if it's okay to use mainWindow as the
context or not, I just added a new local QObject.
Amends 9ff40b59da
Pick-to: 6.6 6.5
Change-Id: I2c3bdc1eb06731d9c38979610303876c2748fb73
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
It's generated by clangd, when used for example from vscode.
Pick-to: 6.6
Change-Id: Iac65face9634c869eaf94881edff82471a33742a
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
GCC 13 has been complaining that QBitArray could be accessing past the
end of an array (specifically, the 1-element array QByteArray::_empty).
That's caused by the 'QByteArray::data() const' being:
#if QT5_NULL_STRINGS == 1
return d.data() ? d.data() : &_empty;
#else
return d.data();
#endif
A way to avoid this is to use operator[], which doesn't attempt to hide
null pointers (it has an assertion).
This is accomplished by writing nicer, more readable code, which is a
nice benefit.
Fixes: QTBUG-118631
Pick-to: 6.6
Change-Id: I85b3fc2dd45c4693be13fffd179579615a6ac98d
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Keep the variable where it belongs, it's not used anywhere else.
Task-number: QTBUG-115017
Change-Id: Ia421eb0cd3f57be3601754f1df11e64f0267fa5d
Reviewed-by: Tinja Paavoseppä <tinja.paavoseppa@qt.io>
Amends 0f3dbd6dc7.
JNI was calling notifyLocationChange(I)V method but it doesn't exist,
instead it was named notifyAccessibilityLocationChange(I)V.
Task-number: QTBUG-118077
Change-Id: Icc29d4aad97e730af7165d5e057d228bee9c8976
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Current versions of OpenSSL 3 don't support Keccak hashes as these are
going to be introduced with OpenSSL 3.2 so we should rather fallback to
the non-OpenSSL implementation instead of using SHA3.
Fixes: QTBUG-118814
Pick-to: 6.5 6.6
Change-Id: Iedeb81cd76d43d920fc10e1efdac261bc12a394c
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Remove obsolete parent_window_limits_moves_of_children test of moving
child window in parent. Child windows no longer have decorations,
therefore they cannot be dragged by a title bar.
Fix child_window_activation test, which now uses correct coordinates
to probe for stacked windows.
Change-Id: If5ddd8d4486673a961572de7c57df72c3cea9350
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
The QMenu pop-up used with a QToolButton could unexpectedly move to the
primary screen if it was too big to fit on the owning widget's screen.
The cause of the issue is that QMenu is a top-level window, and can not
infer its screen from any parents. Its positioning is therefore done
using heuristics in QToolButton. These heuristics attempt to calculate a
best guess point relative to the screen that contains the QToolButton.
If these heuristics result in a point that is outside all screens, the
QMenu's own screen takes precedence, and this is always the primary
screen. This way, the QMenu ends up at the calculated position, but
relative to the wrong screen.
This patch works around this issue by ensuring that the first estimate
for the pop-up position is always within the same screen as the
QToolButton. The danger with this workaround is that the menu may end up
in an inconvenient location. This does, however, seem to be handled by
subsequent adjustments in QMenuPrivate::popup.
Fixes: QTBUG-118695
Pick-to: 6.6 6.5
Change-Id: Ibb4a1c82e827c57bbb0798a6c6f5eecb6d639c62
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
We now call setDefaultSectionSize with the new default section size.
This clamps the value to min/max section size and it will resize
affected sections.
Pick-to: 6.5 6.6
Fixes: QTBUG-116013
Change-Id: I39849aca8d0672629ce0b3ca244038c27e045d4b
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
The call Win32 API PrintDlgEx needs in the PRINTDLGEX struct a valid
window handle for hwndOwner to show up. In case there is no window
created, as seen in the example, the call to PrintDlgEx fails with
COM error code E_HANDLE. Using the Desktop HWND, in case of no valid
app HWND creates a valid call to PrintDlgEx with showing up the dialog.
Pick-to: 6.6
Fixes: QTBUG-118899
Change-Id: Ie7009c8e6e8285a0b6312e310b3d065c532f9e17
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
This feature is to be used when testing Qt in Coin (our continuous
integration platform). The command line option --output-junit is
supported in CMake 3.21 or greater. However we have one particular
configuration that tests with CMake 3.16, so we exclude that one.
We have already configured the individual tests to print detailed
results in their own XML files, using QTest's functionality. But then,
when a qt test process crashes, it leaves behind a half-baked XML
file, or no file at all.
CTest on the contrary knows nothing about the internals of a Qt test,
and only cares about the process exit code. Even if a test crashes, it
catches that and reports it as a failure.
We enable this functionality here to use in addition to what QTest's
XML files provide, in order to collect more complete information on
test results.
Pick-to: 6.6 6.5
Task-number: QTQAINFRA-5146
Change-Id: I226203f93413689f5767a4d01ea1852b453ebf31
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Reviewed-by: Toni Saario <toni.saario@qt.io>
It's no more defined in opensslv.h, try to use OPENSSL_SHLIB_VERSION
instead.
Pick-to: 6.6 6.5
Fixes: QTBUG-116295
Change-Id: Ie465f4147e0ec95897bd8d35f71241884bf64b4e
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
It is outdated and it was discussed that it would be removed in favor
of other options.
Change-Id: If2468c84d8ca8197587577ae3d72aeb96c822c5f
Reviewed-by: Dimitrios Apostolou <jimis@qt.io>
Reviewed-by: Jukka Jokiniva <jukka.jokiniva@qt.io>
The problem with non-legacy mode is that the backend uses the same
filename for the system semaphore file and for the shared memory file.
What happens is that when we try to call attach(), a semaphore is
created. Later in attach() we set unix_key, because ftok() returns
a valid handle (it uses the file which was created for semaphore).
After that, an attempt to actually attach to a shared memory fails, but
no clean-up is done.
So, a later call to create() sees that unix_key is already valid, but
it cannot properly clean it, because it does not actually refer to
any shared memory.
Fix it by cleaning up unix_key and nativeKeyFile if shmget() call in
attach() fails.
Pick-to: 6.6
Change-Id: Ibccc3ac307d8b2e07e1b9b24b55f97a859a03131
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
...not only in the tessellation-related ones (that are skipped
with D3D).
The checked-in .qsb file is generated with a patched shadertools
that fixes a bug regarding readonly storage buffers and HLSL.
Change-Id: Iafbad4e81875d7b4f877435b9b1e6078019d52ac
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
Applicable to D3D11 only, although the flag is general enough that
other backends could use it if it made sense for them.
This allows Qt Quick to state that warnings about QRhi::create()
failures that lead to retrying with a different set of flags
(PreferSoftwareRenderer to get to use the WARP software rasterizer)
should be suppressed and turned to regular categorized debug prints.
Other users, e.g. an application directly working with QRhi may not
want this. A create() failure must be complemented by an unconditional
qWarning since normally that is pretty serious error. Hence the opt-in
flag.
Task-number: QTBUG-117926
Change-Id: I808bd1670b631e2068b566ab08589e1783f62ca5
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
Add features and floating flag to QDockWidget debugging.
Debug dockwidget parents of a group window.
Task-number: QTBUG-118578
Task-number: QTBUG-118579
Pick-to: 6.6
Change-Id: If2a6caacf5d02f9018c2a3073fdbc1de39bce1ee
Reviewed-by: Santhosh Kumar <santhosh.kumar.selvaraj@qt.io>
Reviewed-by: Keith Kyzivat <keith.kyzivat@qt.io>
Tslib doesn't give button and movements events separately, so send
the first event with pressure as MouseButtonPress, subsequent events
as MouseMove and event without pressure as MouseButtonRelease.
Pick-to: 6.6 6.5 6.2
Fixes: QTBUG-111952
Fixes: QTBUG-113307
Change-Id: I7ed6e37936887e11affb254d2fca74c79b6a43b9
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>