Windows are not always fullscreen: e.g. the widget gallery example main
window isn't maximized, and a popup window may open anywhere on the
screen. So we always needed to offset by the window position. But it's
better to use QPlatformWindow::mapFromGlobal() since we are working with
native coordinates here.
Pick-to: 6.2 6.5 6.6
Fixes: QTBUG-109025
Change-Id: Id3d139fad610bbbc67a394599570a309196ae64c
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
The factory cache registration functionality should belong to the
cppwinrt feature, so guard it with appropriate QT_FEATURE_ guard.
Change-Id: Icbadaa7ffb32a4e47fe3bbab90c37303fd787344
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Previously, windeployqt would recurse into subdirectories when copying
QML modules, even if those subdirectories were a nested QML module that
was not needed for deployment.
Since most QML modules are nested in the QtQuick and QtQml modules, the
old code effectively always copied *all* QML modules.
This patch adds guards that prevent recursing into subdirectories if
those subdirectories represent QML modules.
These nested modules will still be deployed, but only if referenced from
the QML application (as determined by qmlimportscanner).
Fixes: QTBUG-117459
Pick-to: 6.6
Change-Id: I4c0dfc15956ff40a0e8caec3fa334df10cc92ccd
Reviewed-by: Timothée Keller <timothee.keller@qt.io>
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
The ACTION_POINTER_UP is used when a non-primary pointer (touch, mouse
stylus, eraser) goes up. Without handling this action in these
cases, the table event remains in 'down' state (misses the
QEvent::TabletRelease) and as a consequence when it is next put on the
screen, eg. a line will be drawn to the new position (in case of a drawing
application).
In addition use getActionMasked() to get the action; non-masked
events would contain the index of the pointer too, and wouldn't
match with ACTION_POINTER_UP whose numeric value is 6. Rather the
actions would be in the lines of:
261, // ACTION_POINTER_DOWN(1), 6 with getActionMasked()
517, // ACTION_POINTER_DOWN(2), 6 with getActionMasked()
And so on.
Pick-to: 6.6 6.5
Fixes: QTBUG-86297
Change-Id: I1b50ca4d19b611aec8a5c280ed0521e2f11797b0
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
This reverts commit 530d092eae.
Reason for revert: Moving transient children as a whole is too broad, and forces unrelated windows to have their position completely dependent on a transient parent.
Fixes: QTBUG-117779
Pick-to: 6.6 6.5
Change-Id: I01312e26e95c8144c392eca33aec41f54aaa40b0
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
We don't use va_list and don't have variadic functions in this file.
[ChangeLog][Potentially Source-Incompatible Changes] The header
qbytearray.h no longer includes the header stdarg.h.
Change-Id: I8f3ce163ccc5408cac39fffd178c7fb49d12b739
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
The local qreal to string conversion would fail and produce
unsyntactic output if the integer part exceeded the range of an
unsigned int. Introduce check for that, and fall back to just output a
0 value instead in such cases.
Testing indicates that there is no point in supporting values beyond
4G, as pdf readers do not seem to accept higher values anyway.
As a driveby, also extend the check to catch all non-finite real
values, not only nan.
As a second driveby, simplify the splitting of a qreal into integer
and fraction parts by just using the std library function for that.
Fixes: QTBUG-117740
Pick-to: 6.6 6.5
Change-Id: I247b0612bd565fb2e6f47a182e74f19b8bb0d683
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
.data() in both classes has a null pointer check so it will return non-
null even if the object is storing a null pointer, for compatibility
with Qt 5 (controlled by QT5_NULL_STRINGS). We don't need this in
first()/last()/sliced()/chopped(), so we can skip the test and pass
whatever pointer it is directly to the class constructor. Both of them
handle null pointers creating an isNull() object.
This is a minor performance optimization and interestingly makes these
functions now retain isNull() with the result. I'm not adding test for
that as I don't want to hardcode that they will do so.
Change-Id: Ifeb6206a9fa04424964bfffd17888d14ec8244ec
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
The palette mapping table (as read from gtk widget) maintained in
QGtk3Storage misses information of QPalette::Button and
QPalette::ButtonText role for QPalette::Disabled color group. This
cause disabled button widget to be rendered with incorrect palette
(such as in dark color scheme, light palette had been used).
This patch fixes this issue by extending palette mapping in
QGtk3Storage for disabled color group of button role.
Fixes: QTBUG-113486
Pick-to: 6.6.0 6.6 6.5
Change-Id: Ied4b2650c92cc1cda58be69257945991013b276f
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
Remove or replace links to examples that were removed or moved under
manual tests.
Replace code snippets that were quoting the now-missing examples.
Fix documentation of QSet::removeIf().
Fix typo in documentation macro: Unknown command '\examplecateogry'.
Add qtopengl, qtshadertools dependencies to Qt Widgets documentation
project to enable correct linking to those topics.
Mark all documentation sets in qtbase as free of warnings.
Pick-to: 6.6 6.5
Change-Id: I058cd5f2063aa933ea310bceff906f05422a7cb2
Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
Mention the modules using it instead of claiming it is not used
in Qt.
Pick-to: 6.6 6.5
Change-Id: I8c9490dfd89444509961c73eeff2f8584e0c5df4
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
Include moc must be outside the namespace.
Pick-to: 6.6 6.5
Change-Id: Ibdd539b5fdd8ab4aeb0019bcbb62d5702c310065
Reviewed-by: Antti Määttä <antti.maatta@qt.io>
Since it hides QFile's overloads this was not supported for
QTemporaryFile.
[ChangeLog][QtCore][QTemporaryFile] Added support for passing
std::filesystem::path to rename and createNativeFile.
Change-Id: I909ff1d5b9c586824c9901d7dad278dfad09ffc3
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Destructing the QWindowsScreenManager might result in a
WM_DISPLAYCHANGE, at which point our QWindowsContext instance
is likely gone. We need to guard against that.
Fixes: QTBUG-117473
Pick-to: 6.6 6.5
Change-Id: If32941c5c11231f7c27e9dde54f4315f18da1100
Reviewed-by: Wladimir Leuschner <wladimir.leuschner@qt.io>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Reviewed-by: Timothée Keller <timothee.keller@qt.io>
We were already doing this for a key combination without modifiers,
but now we do the same for e.g. Control+Unknown. This matches the
behavior we have for QKeySequencePrivate::decodeString(), where
we return Qt::Key_Unknown if we can't resolve the key, even if
we have resolved some valid modifiers, e.g. "Meta+Trolls" as in
the tst_QKeySequence::parseString() test.
Change-Id: I238e29276e6ce356ae60c67585739587fa388f07
Reviewed-by: Liang Qi <liang.qi@qt.io>
Being explicit about whether we're dealing with QKeyCombination or
a plain Qt::Key helps understand the code.
Keys are still stored as ints though.
Change-Id: I2cb7bf2c5fabcecbd4dd3e99ba6240fb1910dcc7
Reviewed-by: Liang Qi <liang.qi@qt.io>
The functionality is available in QKeySequencepPrivate still, if needed.
Change-Id: Iefa2e5b31a550fd2a419d2aee028ce4c1ddfb7a2
Reviewed-by: Liang Qi <liang.qi@qt.io>
Fix capitalization of setIncludesSubDomains(). While a it,
make the links explicit, so that qdoc generates warnings if they fail.
Pick-to: 6.5 6.6
Change-Id: I74542c288083ec58f866a616da32bd40fcb3f40a
Reviewed-by: Andreas Eliasson <andreas.eliasson@qt.io>
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
clang-cl can correctly handle runtimeobject.lib for quite some time
already, no need to special case for it anymore.
Change-Id: I87aa98134ad847808b3129c5629ccf8fa1dce253
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
According to clang-cl documentation [1], when we need to pass
parameters to the clang driver, we need to add the "/clang:"
or "-Xclang" prefix to the parameter.
[1] https://clang.llvm.org/docs/UsersManual.html#the-clang-option
Change-Id: I2b96942a12fbdf70773c732c021e8ad5173e9311
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
The loop doesn't change the member container while iterating over it,
but handleReparent() is called from eventFilter() and changeEvent(), so
take a copy to iterate over.
Task-number: QTBUG-115803
Change-Id: I58ff5bddf99f07a46348b7802432e0899b3170df
Reviewed-by: Christian Ehrlicher <ch.ehrlicher@gmx.de>
The m_edges container isn't changed after it's initialized in the
constructor (in a later commit I'll make this container const, so as to
keep this commit backport-able), and it isn't changed by the loop. Port
all loops over m_edges to ranged-for.
Remove "#undef QT_NO_FOREACH" from the source file, as that was the only
usage of foreach in it. And remove that source file from NO_PCH_SOURCES.
Pick-to: 6.6 6.5
Task-number: QTBUG-115803
Change-Id: I9cfc0c95865cbc7415dbecc82388c64c65ded4be
Reviewed-by: Christian Ehrlicher <ch.ehrlicher@gmx.de>
clang-cl share many parameters with MSVC, but it makes the CMake code
complex. We temporarily remove the clang-cl compat code paths from the
MSVC code and they will be brought back in a central place in a separate patch.
Change-Id: I28b93c04d65e9a5133d61c7fbbdc5c83cc8cc37e
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
clang-cl can't recognize the "-Ob3" parameter and it causes tons
warnings when compiling, just remove it if we are using clang-cl.
Change-Id: If50dccef15f771fc956eed218e97645d78d59073
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
This piece of code may be some old workaround, but anyway Qt doesn't
need it anymore. Removing them doesn't cause any compilation errors
or even warnings. We should not keep any workaround if they are not
needed anymore.
Change-Id: Ieae8c2b005fa5e556c838d78d839d498101f28ff
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
I added this flag but only explained what it is in the original
commit message, it may confuse future code readers without some
inline comments. So add some comments to avoid such issue.
Change-Id: I6a3c0f53c2bc58646cc70e45cacb1d0e40656c0a
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
This fixes a regression compared to Qt5. In Qt5 absoluteFilePath()
unconditionally searched for all files in extra prefix dirs and the Qt
install prefix, in particular also the -android-dependencies.xml files.
After the changes in Qt6 up to now however those files are only searched
in the Qt install prefix. This broke external libraries also making
use of the -android-dependencies.xml mechanism, such as some KDE
frameworks.
Pick-to: 6.5 6.6
Change-Id: Ic53aab50c70f853f3b1d621d6de6edb3df223905
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
We know what engine we're using, so don't go the long way around via
QFileInfo and QFSFileEngine to get back to QFileSystemEngine in order to
calculate an absolute and clean path.
Since we're doing that, we may as well use QFileSystemEntry's ability to
give us the file name portion of this absolute path without having to go
via QFileInfo and QDir again. We just need to make sure that a dir name
isn't ending in a slash: absoluteName() would remove that for us, but
only if the entry isn't already absolute and clean.
Change-Id: I9d43e5b91eb142d6945cfffd17871389d359e750
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Added moveToTrashDuplicateName() to see what happens if you attempt to
trash two files with the same exact full path. Both files should get
independently moved to the trash bin and not clobber each other.
Added moveToTrashXdgSafety() to test that QFileSystemEngine will
properly skip over an unsafe $root/.Trash directory, as required by the
XDG specification. I think the specification should also make security
requirements on $root/.Trash-$uid too, but that's for another change.
Pick-to: 6.6
Change-Id: I9d43e5b91eb142d6945cfffd1786cd60e4244c7c
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
qnativesocketengine_win.cpp: don't check if timeout is < 0, because
remainingTimeAsDuration() doesn't return negative values.
All the changes done in one go, not function by function, as that causes
the least churn. You can think of them as a couple of very similar
changes repeated various times.
Drive-by change: replace `forever {` with `for (;;)`
Task-number: QTBUG-113518
Change-Id: Ie9f20031bf0d4ff19e5b2da5034822ba61f9cbc3
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
We usually compile without exceptions, so the try..catch is a noop.
So, if the `new` fails we would crash (or get UB) anyway. Instead
of that, use the nothrow version of `new` and check the result.
Pick-to: 6.6 6.5
Change-Id: I1902b717c70afcc44c1f3237370aae346262452a
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
Use a stack buffer instead of a QByteArray to hold the 16 bytes for
the QUuid serialisation, replacing toRfc4122() with toBytes() and a
memcpy().
As drive-bys, drop the needless cast from char* to uchar*
(qToLittleEndian() has void* arguments, so char* is fine) and drop {}
around single-line if body.
Pick-to: 6.6
Change-Id: I6ffabcf07fc9a730a782e20e113999a0dcf15067
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
It contains no implementation. Proof: it includes no headers.
Pick-to: 6.6 6.5
Change-Id: I64b42ce799eec05a0faff2021e2b60460695e192
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
The Q_DECL_{IMPORT,EXPORT} macros change with the configuration, so the
lack of our configuration this ended up producing inconsistent builds.
Amends 43ec3d8d01.
Pick-to: 6.6
Change-Id: Ifeb6206a9fa04424964bfffd17892394d19e648f
Reviewed-by: Ahmad Samir <a.samirh78@gmail.com>
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
When a dock widget is closed while floating, it still reports being
floating even though the QWidget::windowHandle()->isVisible() returns
false. This is documented behavior and will not be changed.
c153066baa relied on the isFloating() to
return false, if the dock widget is closed. When the window title was
changed by setWindowTitle(), the change was overridden by reading the
old value from the window handle.
=> Amend the patch and add a windowHandle()->isVisible() as a condition.
In c153066baa, an autotest for the title
propagation (QTBUG-113591) was added to floatingTabs().
=> Harden the setWindowTitle() test function. Move the tests related to
QTBUG-113591 and QTBUG-117764 to this function.
Fixes: QTBUG-117764
Pick-to: 6.6 6.5
Change-Id: Id37a9a22d4d13abad4ea55c74ea4e834bdb2bfab
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
Reviewed-by: Christian Ehrlicher <ch.ehrlicher@gmx.de>
Qt a11y(ATSPI) support only depends on DBus and ATSPI, it should
also work fine on Wayland when xcb was disabled.
Task-number: QTBUG-117535
Pick-to: 6.6 6.5
Change-Id: Ibd7ebb32b94de1888920f0fe2b85ae3bd4d2c77a
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>