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>
Reimplement the virtual function QIconEngine::isNull() for
QPixmapIconEngine. This lets QIcon::isNull() return true when no pixmaps
are loaded during QIcon::addFile() e.g. due to a wrong filename.
Pick-to: 6.6 6.5
Fixes: QTBUG-118667
Change-Id: I29f2c492e55b60638507fa398ef7af76f4e9ff48
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
QWidgetWindow::handleMouseEvent() passed a QPoint to QMouseEvent which
might result in a wrong result on high-dpi displays. Since the incoming
event has a correct QPointF coordinate, use this for the QMouseEvent
Pick-to: 6.6
Fixes: QTBUG-106262
Change-Id: Idbfdab19220cb06aa0a28eef4e6ab4cab1035d97
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
QCheckBox::checkStateChanged() was emitted with msvc even though the
check state was not changed due to a faulty comparison.
Amends: 37b47ebf94
Pick-to: 6.6
Fixes: QTBUG-118716
Task-number: QTBUG-104688
Change-Id: Iafeabeb9214f6c7510ea4ed87fabb7dc0ba175a6
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Assume the related GCC version is fixed.
Fixes: QTBUG-118851
Change-Id: I0160440c5e8a0341ec5bc2ab9ea6fed9a2325bba
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
... and update the unittest accordingly.
Compared to the 2.3 release there 2 fixes in freedesktop.org.xml,
due to issues discovered when running tst_qmimedatabase:
* Give higher priority to the more specific image/apng magic
https://gitlab.freedesktop.org/xdg/shared-mime-info/-/merge_requests/262
* Lower priority for text/x-mpsub's magic
https://gitlab.freedesktop.org/xdg/shared-mime-info/-/merge_requests/263
Task-number: QTBUG-118616
Change-Id: I56053b343619a8a711af28e6490c160d13169734
Reviewed-by: Liang Qi <liang.qi@qt.io>
Reviewed-by: Ahmad Samir <a.samirh78@gmail.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Now that the top-level build calls qt_internal_qt_configure_end
itself, we don't need to call it in qt_print_build_instructions.
Pick-to: 6.6
Change-Id: I906ee7bc1aed3b597049b5996a41dd298175343c
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
The attach() -> create() sequence was not covered by unit-tests in
qtbase, but this approach is used inside QSharedImageLoader.
It turns out that 02c42b26e1 broke this
usecase for legacy mode, and the create() triggered an assertion
in QSharedMemorySystemV::updateNativeKeyFile(). Fix it by clearing
the nativeKeyFile if ftok() call in QSharedMemorySystemV::handle()
fails().
Add unit-tests for the attach() -> create() scenario.
These tests revealed that this scenario fails also in non-legacy mode
for SystemV, so add QEXPECT_FAIL for these cases for now. This will
be addressed in a separate patch.
Pick-to: 6.6
Change-Id: If133fa56c82eba902374dc48d2757046b3d40baf
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Surely, sizeof() returns the number of bytes, so we need to multiply
by CHAR_BIT if we want to compare with the number of bits.
This commit amends c4f7dba81e
Task-number: QTBUG-118221
Change-Id: I2cca75bfed7f0554f6cffd22cc06475ffc9c6e43
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
Fixes the complication issue since the typedef was used as class member.
Replace the typedef with using statement.
Fixes: QTBUG-118627
Pick-to: 6.6 6.5
Change-Id: Ie3d341fb8f18a7341d018f51947127ace941a620
Reviewed-by: James McDonnell <jmcdonnell@blackberry.com>
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>