The group page for Qt core classes related to I/O include classes from
other modules. Remove these classes from the group; it may confuse
the reader.
Fixes: QTBUG-110020
Pick-to: 6.5 6.4 6.2 5.15
Change-Id: If7df85523ce6b3aa09605bd89d9899ce308d2671
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
It's possible that the window has the WS_THICKFRAME flag but the
Qt::FramelessWindowHint is enabled at the same time. That usually
indicates the user is customizing the window, but it will also
confuse QPA's current logic. We can make the logic more roboust
by reading the Qt window flags as well.
Pick-to: 6.5 6.4
Change-Id: I9894e312a92ef7f5fc0aa93974f216b67fe2cf29
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
Qt6's minimum supported platform is Win10 1809, so it should be quite
safe to use DPI_AWARENESS_CONTEXT APIs because they were introduced
in Win10 1607.
This patch removes the use of the PROCESS_DPI_AWARENESS APIs because
they are old (introduced in Win8.1) and most importantly, they can't
handle the new PMv2 and GdiScaled awareness mode.
This refactor also fixed a bug: previously Qt is using GetProcessDpiAwareness()
to get the dpi awareness mode of the current process, however, that API can't
return PMv2, which means even if we are in PMv2 mode, it will still return PMv1
(I've confirmed that locally), and thus Qt is mishandling such cases.
Eg: when judging whether to enable non-client area dpi scaling or not.
Change-Id: I8a8946ba63c863f8c19c27998af2bac97db37ec7
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
Break the long sentence to improve the logic readability a bit.
Pick-to: 6.5
Change-Id: I3d0227e616a3c47e14ae7b5cfe4b47a39d778e5e
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
Remove comment about lttng not relevant to ctf backend.
Pick-to: 6.5
Change-Id: I4d4432b1075a27d024db38a3cdd7807a1e94e7ec
Reviewed-by: Tomi Korpipää <tomi.korpipaa@qt.io>
This reverts commit cebcb7991a.
Reason for revert: We need to enable BIC tests again
Pick-to: 6.5
Change-Id: Ibabe2c50547972d040d933a1027833426b018e81
Reviewed-by: Ville Voutilainen <ville.voutilainen@qt.io>
Input events have a timestamp. When dispatching an event through QPA, a
platform plugin can either provide it, or QPA will use an internal
QElapsedTimer to provide a timestamp.
Windows input messages do come with a timestamp already, so we can use
that instead of the QPA.
The two methods are not equivalent.
For instance: for various reasons, Qt does not honor Windows' "double
clicked" message, but uses the delta between two mouse events to
establish if the second click is actually a double click.
Now suppose that the user double clicks on a widget. On the first click,
the application does something that freezes it for a bit (e.g. some
heavy repainting or whatever). Does the second click register as a
double click or not?
* If we're using Qt's own timer, the answer is NO; the event is pulled
from the WM queue after the freeze, given a timestamp far away from
the last click, and so it will be deemed another single click
* If we use the OS' timestamps, then the second click will be seen as
"close" to the first click, and correctly registered as second click.
This reasoning can be extended to many other QPA events, but looks like
the APIs for some are missing (e.g. enter events), so I'm not tackling
them here.
Task-number: QTBUG-109833
Change-Id: I149361a844feac86cafa885c109a1903b1e49545
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Yuhang Zhao <yuhangzhao@deepin.org>
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
A minimal change here would've been just to use value initialization
instead of default initialization. But just go for the kill -- stop
using QScopedPointer.
Change-Id: Ie427a44d13987c2b4a2c881c350df04e935df9d8
Reviewed-by: Yuhang Zhao <yuhangzhao@deepin.org>
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
This is similar to Q_COMPILER_MANGLES_RETURN_TYPE, except that the
other such compiler, SunPro CC, at least by my cursory reading of
https://archive.org/download/SunWorkshopVol5No1/Sun%20WorkShop%E2%84%A2%20for%20Solaris%202.x%20Volume%205%20Number%201.iso/SPROmrcpl%2Freloc%2FSUNWspro%2FSC4.2%2FREADMEs%2Fmangling.ps
doesn't appear to mangle the access specifier. So it's only MSVC. It's
still better to have a properly-named macro for this than to work with
Q_CC_MSVC and, hopefully, an explanatory code comment.
May come in handy to maintain BC when we find the need to change an
access specifier in the future. The original use-case, in QtPositioning,
was fixed differently. If nothing else, let's have it to raise awareness
of the issue.
Pick-to: 6.5
Change-Id: Ia8b789d2713ec19487a21c6bb0a12cf285e6ba83
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
This gets rid of 50% of the casts required to call the function, and
removes the last QtCore QStringView(ushort*) user.
As a drive-by, replace an (allowed, but) fishy &str[0] with
str.data(), the mutable overload of which has been available since
C++17.
Task-number: QTBUG-110403
Change-Id: Iad494025b61c53d991e59cc73198bb014a422a93
Reviewed-by: Ahmad Samir <a.samirh78@gmail.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
The batcher does not currently work properly with non-qtbase
submodules. Disable them temporarily so that at least the
tests in qtbase are batched. Do this from qtbase so that changes
to each and every submodule are not necessary.
Also, maintain a list of tests that were thus skipped. On any
qt cmake internal function call that refers to such a target,
identify the target as skipped and make the call a no-op.
Fixes: QTBUG-109785
Change-Id: Ib0aa5d39eee8315ffd4ac62f6d1f44fe9bbf7a2f
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
More cores allow faster building and reduces variance when cache
is cold.
Task-number: COIN-1001
Change-Id: Idc08f19b788dcf2483342b8ae2c76b663eba537b
Reviewed-by: Simo Fält <simo.falt@qt.io>
Says Clang 15:
tst_qurlquery.cpp:193:11: warning: explicitly moving variable of type 'QUrlQuery' to itself [-Wself-move]
moved = std::move(moved);
~~~~~ ^ ~~~~~
It's amazing how little it takes to throw this warning off guards:
just use an alising reference instead of the same variable. Makes you
wonder whether the time spent on detecting such trivialities in the
compiler is really well spent.
Amends fc8dad2f10.
Pick-to: 6.5
Task-number: QTBUG-109842
Change-Id: I165af2a786aa0ba28b8dcd039a500f3494bc29a9
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Align the wheel event handling with other events - move the handler to
wasm window and create a C++ wrapper class for the js wheel event.
Fixes: QTBUG-109622
Change-Id: I915e502de7c0784ec9a6745a90ddcda062e91b2b
Reviewed-by: Mikołaj Boc <Mikolaj.Boc@qt.io>
Reviewed-by: Lorn Potter <lorn.potter@gmail.com>
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
Instead of the System V one. An important difference is that
QSharedMemory does not clean after itself.
Updated the configure summary output to include this information.
Drive-by update to sorting order and I removed cpp-winrt from the
listing because there's a warning at the end if it is not set.
Change-Id: I12a088d1ae424825abd3fffd171e0eadcfd33426
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
The MinGW-provided winpthreads has <semaphore.h> and the necessary
functions, though the source seems to implement sem_open() as an
unconditional
errno = ENOSYS;
return SEM_FAIL;
But in case they actually implement it, we enable support.
Change-Id: I3d74c753055744deb8acfffd1723e982d05651b5
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
If a previous test in the same process or previously leaked a shared
memory or semaphore handle, tests could fail and cascade down. They
could also interfere with one another. So prevent this issue by
assigning a monotonically-increasing identifier per test function or row
tested and improving how we clean up those we did create.
This shows we need the API to explicitly clean up.
Change-Id: I12a088d1ae424825abd3fffd171db61d6b68a411
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
It's hard to maintain it with multiple backends and I don't see the need
for it.
Change-Id: I12a088d1ae424825abd3fffd171d7bf6bbdf9a99
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
And we particularly want to avoid calling with Create twice.
Change-Id: I12a088d1ae424825abd3fffd171d6ab1fb87221f
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
And deprecate the non-native key support API. Qt 7 may not even store
the old, non-native key.
Documentation in a new commit, when the dust settles.
Drive-by updates to the tst_QSharedMemory::attach row names, to fix
grammar and remove spaces and apostrophe.
Change-Id: I12a088d1ae424825abd3fffd171d3025c77f94d2
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
And deprecate the non-native key support API. Qt 7 may not even store
the old, non-native Qt.
Documentation in a new commit, when the dust settles.
Change-Id: I12a088d1ae424825abd3fffd171d2b549eeed040
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Apple sandboxes restrict use of the System V / XSI IPC mechanisms. It's
currently the only restriction we check for. Attempting to use them will
result in SIGSYS delivered to the application, so we shouldn't try.
Linux system call filtration can do the same. In fact, systemd's
SystemCallFilter= options do default to SIGSYS too and it has an @ipc
group that could be used to block SysV. However, the same group blocks
the creation of pipes, so it's not in much use.
Change-Id: I12a088d1ae424825abd3fffd171d79f7cd5b2b9d
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
This is the new implementation of how to make platform-safe native keys,
for which no past compatibility is required nor promised. Unlike when we
started in Qt 4.4, it doesn't look there are many restrictions in names
anyway.
Important differences are:
* POSIX RT: no restrictions, we prepend the necessary '/'
* System V/XSI: no restrictions, it's just a file path anyway;
we pass absolute paths unchanged; otherwise we prepend RuntimeLocation
* Windows: no restrictions, but we do recognize Global\ and Local\
kernel objects without munging them
The use of the RuntimeLocation may cause a warning on Unix systems
(other than Apple ones and Android) if $XDG_RUNTIME_DIR isn't set.
We do enforce the Apple 30-character limit here, otherwise you get
ENAMETOOLONG.
Change-Id: I12a088d1ae424825abd3fffd171d3a0e09e06361
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
The implementation only has #if now for Apple compatibility; otherwise,
we're relying on the QNativeIpcKey::Type parameter, because I intend to
allow Unix systems to support both POSIX realtime and System V / XSI
shared memory and semaphores.
Most of the uses of QtIpcCommon::isIpcSupported() will be constant
expressions because they don't depend on the ipcType.
Change-Id: I12a088d1ae424825abd3fffd171d38dfb6b5de74
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Common to both QSharedMemory and QSystemSemaphore, this will hold the
native key and will replace the concept of non-native key in those
classes.
Change-Id: Id8d5e3999fe94b03acc1fffd171c03197aea6016
Reviewed-by: Nicholas Bennett <nicholas.bennett@qt.io>
It's much easier to tell what happened.
Change-Id: I12a088d1ae424825abd3fffd171dbeb58c46fd6d
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
In QSystemSemaphore (QSharedMemory already has it).
When running tst_QSharedMemory::useTooMuchMemory on 64-bit Linux with
POSIX IPC, we run out of file descriptors before we run out of memory.
Change-Id: I12a088d1ae424825abd3fffd171d6f34c002b5a1
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
It's just the setUnixErrorString() functions.
Change-Id: I12a088d1ae424825abd3fffd171d2880ebaf49c7
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Into separate classes. This temporarily compiles QSharedMemoryPosix
on most Unix systems despite defaulting to SystemV.
Change-Id: I12a088d1ae424825abd3fffd171d25efdee8d2de
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Into separate classes. This temporarily compiles QSystemSemaphorePosix
on most Unix systems despite defaulting to SystemV.
Change-Id: I12a088d1ae424825abd3fffd171d23191fbb6db3
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
The two features are independent of one another. This also exports them
to qtcore-config_p.h, but leaves the QT_POSIX_IPC macro from
qtcore-config.h alone. Those four are also included on Windows builds,
so we won't need to #if them out of Windows.
Change-Id: I12a088d1ae424825abd3fffd171d1f0ae8e8f469
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
This removes the second portion of the #if mess of shared code between
QSharedMemory and QSystemSemaphore for SystemV.
Change-Id: Id8d5e3999fe94b03acc1fffd171c073c2873206e
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
So we don't have to mess around with #ifs to support the build.
Drive-by replace with unlink() some calls to QFile::remove(), which
create a QFSFileEngine, to call QFSFileEngine::remove, which calls
QFileSystemEngine::removeFile. Since we've just created the file with
qt_safe_open(), we may as well use the low-level Unix function to remove
too.
Change-Id: Id8d5e3999fe94b03acc1fffd171c06c7efc0b0f0
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
It's not a lot of files, but it's actually more in the same dir than
mime/ does right now. I'm about to add two more files, though I'll also
merge a few more later.
Change-Id: Id8d5e3999fe94b03acc1fffd171bfe2ea36a35a7
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
QWidgetTextControlPrivate::mouseReleaseEvent() has early returns
implemented, e.g. when link has been right clicked or no selection
anchor has been found. These early returns, however, still consume
the event.
This leads to events getting lost instead of getting propagated:
As an example, a QLabel with rich text uses QWidgetTextControl. While
it propagates mouse press events back to its parent, mouse release
events get lost. A QLabel with plain text propagates both events
back correctly.
This patch adds QEvent::ignore() to the early return.
Since no test class exists for QWidgetTextControl, it adds a test in
tst_QLabel.
Fixes: QTBUG-110055
Pick-to: 6.5 6.4
Change-Id: I950f8c3f135793b01c59832835bb429db2282169
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
The code is now unused as svg graphics have been introduced for
window decorations.
Change-Id: Iefe4543af2483fd9ff3eb6ce15b9905620927a9b
Reviewed-by: Lorn Potter <lorn.potter@gmail.com>
As we are now processing the arguments with
cmake_parse_arguments(PARSE_ARGV, we don't need to pass the escape
characters anymore.
Task-number: QTBUG-99238
Change-Id: Iea9cda4fe0ae56043cc4d7db29ce53d9d737d645
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
AUTOUIC doesn't handle relative paths to .ui files in parent
directories when using Ninja Multi-Config.
The designer tool in qttools has such a ui file. This leads to the
following error when trying to build qttools together with examples as
ExternalProjects and Ninja Multi-Config:
ninja: error: 'src/designer/src/designer/designer_autogen/
include_Debug/ui_preferencesdialog.h', needed by
'src/designer/src/designer/designer_autogen:Debug',
missing and no known rule to make it
Until cmake is fixed, we can work around the issue by not adding
designer as a dependency when building EP examples, because no example
tries to use the app.
We can't exclude all apps from example dependencies because some
modules use qt_internal_add_app for tools as well, which are called
from public CMake API and also examples.
An example of this is qtapplicationmanager.
Given that we can't exclude all apps, introduce a function to
allow skipping single targets when building EP examples.
This will allow excluding designer specifically.
The examples will now depend on a new ${repo}_src_for_examples target
rather than ${repo}_src, which will exclude skipped targets.
Task-number: QTBUG-90820
Task-number: QTBUG-96232
Task-number: QTBUG-110369
Change-Id: I2f900253bbf7bac917f2293ef604ab3ea8f298e1
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
Drop events are now handled in the wasm window element, which allows
the browser to select the drop target automatically. This also fixes
the case where drop data transfer finishes reading when a window
has already been closed and destroyed - the cancellation flag is now
owned by window so it gets invalidated as soon as window is gone.
The code has also been structured with a new DragEvent passthrough.
Fixes: QTBUG-109581
Change-Id: Ie3eb7446e2181fd540517f39397e8b35f111d009
Reviewed-by: Mikołaj Boc <Mikolaj.Boc@qt.io>
These methods don't seem to be used by anyone now, but not sure
how it was before, so to not run into any BiC issues, just add
a comment to remove them in Qt 7.
Change-Id: Ie30a3d2adcbbb7530d9cf72f03b78ecfa06e426c
Reviewed-by: Ville Voutilainen <ville.voutilainen@qt.io>
The 'WITH OIDS' was deprecated some time ago and removed with
PostgreSQL 12 so we have to adjust our test table creations. Don't know
why it was used in the first place at all.
Pick-to: 6.2 6.4 6.5
Change-Id: I6e18ac01e64368b1dd64e02bcb75fa70e05467a3
Reviewed-by: Dimitrios Apostolou <jimis@qt.io>
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
The growBy() function takes the _increment_ of the size(), so needs to
add size() to increment for the call to realloc().
Add a test which hangs (vanilla build) or explodes (valgrind build)
without the fix.
Amends 26b227e128.
Done-with: Eirik Aavitsland <eirik.aavitsland@qt.io>
Pick-to: 6.5 6.4
Fixes: QTBUG-110412
Change-Id: I7ea91342fdcb779825c88013a3f86ba6d90ef530
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>