If the style changes while a popup is open (or about to close),
the popup will change style as well before it's hidden. And
this can result in the popup window briefly ending up smaller
than what it needs to be, in order to fit all the menu items.
In that case, it will show 'up' and 'down' widgets in the
menu that auto scrolls it when hovered. And all this can
happen for a split second while the menu is about to close
(as a result of the user clicking on a menu item).
A bug happens because of this if you click on the last menu
item in the list, and this causes the style to change. In
that case, the 'down' widget will end up directly underneath
the mouse for a split second, which will trigger an auto-scroll
timer to start. This timer will trigger a bit later, after
the popup has been hidden, and scroll the list view a bit down.
The result is that the next time you open the popup, it ends up
at the wrong place on the screen in a failed attempt to center
the current index on top of the combobox.
This patch will make sure that we always scroll the list view
to the top before we start calculating where the popup should
be placed on the screen. Otherwise the geometry ends up wrong
since the popup will anyway be resized (if possible) to fit
all the menu items before it's shown and should therefore not
take scrolling into account.
Pick-to: 6.6 6.5
Fixes: QTBUG-113765
Change-Id: I61b5b832904de471c2303fc67325feec322b1449
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
Like commit 91f6460aff which added support
for Windows. This API is documented and has apparently been present in
FreeBSD for a long while.
The DragonflyBSD API is very similar, but I don't have one to confirm
that I've coded correctly. OpenBSD and NetBSD may have similar APIs, but
I haven't even researched them. We're open to contributions, though.
Change-Id: I63b988479db546dabffcfffd1766bc431fed614b
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
This allows us to use absolute times on Linux (today) and FreeBSD
(soon), plus simplifies both QMutex and QSemaphore.
Change-Id: I63b988479db546dabffcfffd17675a182aa528fa
Reviewed-by: Ahmad Samir <a.samirh78@gmail.com>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Makes it cleaner when I add more OSes.
Change-Id: I63b988479db546dabffcfffd1766bee2e6370b94
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Ahmad Samir <a.samirh78@gmail.com>
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Setting parents for WASM platform windows is now supported. This means
that windows now reside in a hierarchical window tree, with the screen
and individual windows being nodes (QWasmWindowTreeNode), each
maintaining their own child window stack.
The divs backing windows are properly reparented in response to Qt
window parent changes, so that the html structure reflects what is
happening in Qt.
Change-Id: I55c91d90caf58714342dcd747043967ebfdf96bb
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
QDoc allows code-expanding macros to be defined so that the user can
abstract away common code in a simple to use command.
Furthermore, macros allows for a different expansion based on the
currently generated format so that format-specific requirements can be
satisfied when required.
When format specific expansions are provided, QDoc considers the
resulting text as if it should be generated verbatim.
The "\raisedaster" macro is used to generate an superscript asterisk.
The macro is provided for both HTML and DocBook.
As the macro has format-specific expansions, the expanded code will be
read verbatim.
Nonetheless, while the HTML expansion expands to actual HTML, the
DocBook expansion expands to an equivalent QDoc code, which will not be
generated correctly.
To avoid the issue, the DocBook version of "\raisedaster" is modified so
that it produces the correct DocBook code.
Change-Id: I3a37838bda885af42f8d93b86ec08126d7146ff9
Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
QDoc allows code-expanding macros to be defined so that the user can
abstract away common code in a simple to use command.
Furthermore, macros allows for a different expansion based on the
currently generated format so that format-specific requirements can be
satisfied when required.
Due to a certain bug in QDoc, when generating the DocBook format, QDoc
would expand an HTML specific macro definition when a DocBook specific
one was not provided.
As this bug is now being fixed, the DocBook format will lose some of the
output that it was previously generating.
For example, the "\beginqdoc" and "\endqdoc" macros are defined, for
HTML, to expand to the beginning of block-comment text, "/*!" and ending
of block-comment text, "*/".
To avoid losing the usage of "\beginqdoc" and "\endqdoc`" when
generating DocBook, an equivalent expansion of the macro is now provided
for the DocBook format.
Change-Id: I45fb54f1f56077771c091323a69fd63e09a910eb
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
By default QDoc writes filePath attributes for each entry in the
.index file it generates. The attribute value is an absolute path
that's only relevant or useful for debugging purposes.
Pick-to: 6.6 6.5
Change-Id: I3bc646104af74b67c74350912359cf65ac252992
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
QDoc allows code-expanding macros to be defined so that the user can
abstract away common code in a simple to use command.
Furthermore, macros allows for a different expansion based on the
currently generated format so that format-specific requirements can be
satisfied when required.
Due to a certain bug in QDoc, when generating the DocBook format, QDoc
would expand an HTML specific macro definition when a DocBook specific
one was not provided.
As this bug is now being fixed, the DocBook format will lose some of the
output that it was previously generating.
For example, the "\youtube" macro is defined, for HTML, so that a
youtube video can be embedded by reference.
To avoid losing the usage of "\youtube" when generating DocBook, an
equivalent version expansion of the macro is now provided for the
DocBook format.
Change-Id: Id74155f2c30b80b5f4490f8451cd8d00535806d6
Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
QHeaderView::mouseMoveEvent started autoscroll without propagating the
event's mouse position to QAbstractItemViewPrivate::draggedPosition.
This data member always containing QPoint() has lead to right drags not
causing an autoscroll at all. Left drags with a scroll offset just
kept scrolling until the offset was 0.
The missing propagation has been added.
As a drive by, dead code has been removed and the local variable pos
has been constified.
Fixes: QTBUG-113573
Pick-to: 6.6 6.5
Change-Id: I7b194dfc71abea6f2bbaaae18270c80eb15afb4d
Reviewed-by: Oliver Eftevaag <oliver.eftevaag@qt.io>
Fix the argument prefix that is used in the cmake_parse_arguments call.
Pick-to: 6.5 6.6
Change-Id: Ie02bdf7d2769ce084b0d173c1e8152ca6fc4fe53
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
Most of the QWS (Qt Windowing System) classes from
the Qt 4 times are cleaned up in Qt 6. Any existing
QWS API documentation should be marked \internal.
Pick-to: 6.2 6.5 6.6
Task-number: QTBUG-35605
Change-Id: I24201406114feaf8af21403b09375a2ee9a4709e
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
It's really showing how to request a resource and act on its becoming
available. The use of XML to do so is incidental; the use of
networking is central.
Pick-to: 6.6 6.5
Task-number: QTBUG-111228
Change-Id: Ibcf438c7ef3b2464ddfa8b96a79fb15523e4a468
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
We should not export non-polymorophic classes wholesale. Only export
the non-inline functions instead.
There are no implicitly-declared special member functions in this
class that could cause problems, so we don't need to delay until Qt 7.
Pick-to: 6.6
Change-Id: I204d703498bf42465ea122d1f31c443ea439bd6e
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
I don't know why the compilers didn't shout here, but what _should_
have happened is:
- qSwap<quint64>() gets instantiated
- the unqualified swap() call inside gets resolved to std::swap()
- std::swap() is not constexpr in C++17, so qSwap<quint64>() silently
gets its constexpr dropped
- error, due to the use of non-constexpr function qSwap() in constexpr
function bswap()
There's no way through the function that doesn't hit the qSwap(), so
that is also not the explanation. And, indeed, replacing qSwap() with
std::swap() gets me the expected error...
Before compilers get the idea, rewrite the code to not require
swapping.
Amends 686c02224c.
Pick-to: 6.6
Change-Id: Ie1364bb2fd148bf995a8ffd321f77a6021176928
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
GCC 11 complains:
qprocess_unix.cpp:672:12: error: ‘char* strncpy(char*, const char*, size_t)’ specified bound 508 equals destination size [-Werror=stringop-truncation]
672 | strncpy(error.function, description, sizeof(error.function));
| ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
And it's correct: if description is longer than
sizeof(error.function), then error.function will not be
NUL-terminated.
While a quick check suggests that the user of the field performs a
qstrnlen(), thus avoiding falling off the unterminated end of
error.function, it's safer to always NUL-terminate. A single added
qDebug() << error.function would already be UB.
Fix by using _q_strncpy(), which is also more efficient, as it doesn't
write 0.5KiB of NULs in the likely case that description is short.
Amends 90bc0ad41f.
Change-Id: If5c2cb80fc4a3c92b8e78b680a635045bb14a30d
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Apparently it is not enabled since the TLS backends became plugins,
which is unfortunate I wrote code in here that assumed it was.
Change-Id: I765435ce7d2c6fafa452d0453c705c27ff477be6
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
It's a RAII class, and RAII classes should be marked [[nodiscard]] at
the class as well as the ctor level.
Pick-to: 6.6
Task-number: QTBUG-104164
Change-Id: Ie88023ba7c57dad7c2116c1c19a80b908b3a9f4d
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Having the generic qt_itemFired: as action would result in the whole
submenu tree closing if an item with a sub-menu was clicked on. This
is not how native applications behave. They respond by immediately
opening the submenu, or do nothing if the menu is already open.
By using submenuAction: as the selector we achieve the same behavior.
A complication here is that for some reason we defer associating the
submenu NSMenu to an NSMenuItem until QCocoaMenu::setAttachedItem(),
instead of doing it in QCocoaMenuItem::setMenu(), or even as part of
QCocoaMenuItem::sync().
As a result, AppKit's NSMenuValidation logic will conclude that the
item does neither have a submenu, nor a valid target/selector combo
to be validated, and will explicitly disable the item. This can be
debugged by passing -NSTrackMenuValidation YES to the application.
To work around this we explicitly enable the item once we have set
a valid submenu for the item.
Pick-to: 6.5 6.6
Fixes: QTBUG-114199
Change-Id: I7178e7687066b3fe082454c512ec9c7eab3bded4
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Declaring it as an explicit dependency should hopefully make
the compilers order the object-files to be linked in the
correct order.
Task-number: QTBUG-114243
Pick-to: 6.6 6.5
Change-Id: I723fee468e58786f66d1bba50bc4086beb50adb1
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
The idea is to store a concatenable in a QStringBuilder object by value
or by reference, depending on how it was originally passed into the
concatenation operator. So if it was passed by r-value, we treat it as
a temporary object and hold it by value (and use move-semantic if
available), otherwise we hold it by reference (as before).
To achieve this we first change concatenation operators '%' and '+'
to take their arguments by universal reference. Next we instantiate
QStringBuilder object with deduced types of the arguments, which will
be a "value type" or a "reference type" according to "universal
reference deduction rules".
Further we use perfect forwarding to pass arguments to QStringBuilder's
constructor. Thus arguments, initially passed by r-value reference
and which are move-constructible, will be "moved" to corresponding
QStringBuilder member variables.
So, to summarize:
1. Arguments passed by l-value reference - stored in QStringBuilder
object by reference (as before).
2. Temporary objects passed by r-value reference - stored in
QStringBuilder object by value. If a type is move-constructible
(QSting, QByteArray, etc), the object will be "moved" accordingly.
Special thanks to Giuseppe D'Angelo for the tests.
Fixes: QTBUG-99291
Fixes: QTBUG-87603
Fixes: QTBUG-47066
Task-number: QTBUG-74873
Task-number: QTBUG-103090
Task-number: QTBUG-104354
Change-Id: I64f417be0de0815ec5ae7e35a1cc6cef6d887933
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Vladimir Belyavsky <belyavskyv@gmail.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
In case the current GTK3 theme has no monospace font defined, a
monospace font requested by a Qt application can trigger a GTK warning
"Theme parsing error: <data>:1:0: Expected a valid selector".
The warning is triggered by Qt requesting "{font-family: monospace;}".
In this case:
=> ensure fallback to GTK standard monospace font
=> request "* {font-family: monospace;}" to avoid the warning
Task-number: QTBUG-112896
Pick-to: 6.6 6.5
Change-Id: I24a8da62908af9b153245f53026af60e63a600d7
Reviewed-by: Oliver Eftevaag <oliver.eftevaag@qt.io>
As Eddy pointed out in review, the existing overload API docs says using
this method is discouraged; but adding a QDeadlineTimer overload is more
about preventing overflow, as it can handle qint64 or
chrono::milliseconds.
So it's either add this new overload or change the existing one to take
a qint64.
[ChangeLog][QtCore][QCoreApplication] Added processEvents() overload
that takes a QDeadlineTimer.
Task-number: QTBUG-110059
Change-Id: I02f938ee8243c09e493bd88ed496b862d87910f7
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
It's a RAII class, and RAII classes should be marked [[nodiscard]] at
the class as well as the ctor level.
Pick-to: 6.6
Task-number: QTBUG-104164
Change-Id: I77260dc00d51d62ed1064e13f566d04e88d28ef9
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
It's a RAII class, and RAII classes should be marked [[nodiscard]] at
the class as well as the ctor level.
Pick-to: 6.6
Task-number: QTBUG-104164
Change-Id: Ie877e261cfe602410d9d9bb3acc658d0bb7c4e72
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
If flags use CMake scopes that propagate them to user libraries, it may
lead to an issue, if user projects are built using different compiler.
We need to guard these flags to make sure that they only will apply to
respective compilers.
Pick-to: 6.5 6.6
Change-Id: I0fd5847447bd8373e8e07f64dae11f27f48c915d
Reviewed-by: Alexandru Croitor (OOO) <alexandru.croitor@qt.io>
Reviewed-by: Amir Masoud Abdol <amir.abdol@qt.io>
This is a left-over from when setFamilies() and setFamily() were
setting two different properties, for compatibility reasons.
There is no longer a special step for the singular family, and the
sentence is also a bit obfuscated, so we just remove it.
Pick-to: 6.2 6.5 6.6
Change-Id: Ia3c244d41f550a5062de8de63053770258dcacba
Reviewed-by: Andy Shaw <andy.shaw@qt.io>
After 140ca89a3c commit, the path of the
QSettings default file location changed. That caused the problem with
updating the app (old settings file is not used anymore). That is why we
should still use old (.config) directory for QSettings file if the file
exists.
Pick-to: 6.2 6.5 6.6
Fixes: QTBUG-109405
Fixes: QTBUG-109369
Change-Id: I8ce53e0a80e4c2d16802b27b000ab3fbed198628
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
Fixes GCC 11 C++17 unity-build (didn't investigate which one is the
problem) error:
qsemaphore.cpp:275:7: error: ‘QSemaphorePrivate’ has a base ‘{anonymous}::QtSemaphorePrivate::Layout1’ whose type uses the anonymous namespace [-Werror=subobject-linkage]
275 | class QSemaphorePrivate : public QtSemaphorePrivate::Members
| ^~~~~~~~~~~~~~~~~
Amends fbc491230f.
Change-Id: I3b95a35822ec62aabd4c310b02bf58679bb9651f
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
currentTextChanged is emitted when the current index changes
and the current text doesn't.
This can be the case, if
- old and new index have identical text values
- an item is removed below the current index
[ChangeLog][Widgets][QComboBox] emit currentTextChanged only,
if currentText changes.
Add a corresponding test in tst_QComboBox::currentText().
Fixes: QTBUG-113717
Pick-to: 6.6
Change-Id: I847874f0792b29a2841e50bb82d06ad496fb02c3
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
- Use modern string literals (use QStringLiteral instead of
QLatin1StringView for strings that go into the DOM API).
- Use mime types in the file dialog handling
- Streamline code
- Remove mentions of SAX
- Use per class includes
- Do not use QObject::tr()
- Use the configure system instead of QT_NO... defines
- Fix some doc text typos
Complements 3dd3268ded.
Pick-to: 6.6 6.5
Task-number: QTBUG-111974
Change-Id: If0dc7b61e729d0a71f37743efc9b82e285d3f451
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
- Use mime types in the file dialog handling
- Use per class includes
- Use the configure system instead of QT_NO... defines
Pick-to: 6.6 6.5
Task-number: QTBUG-111228
Change-Id: Iea915604e89d3005270f0eb83eca882855589a44
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Regression after 585150e3d9.
Pick-to: 6.5 6.6
Change-Id: Ie728904736dd41fb8dfa6ecc9f843beea95b4604
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Clang's macro deprecation pragma was introduced in Clang 14,
shipped with Xcode 14.0.
We can't version check Q_CC_CLANG here, as qcompilerdetection.h
hasn't been included at this point. Nor would it have helped much,
as we would have had to do so for each individual define we wanted
to deprecate, since mentioning an undefined define in the deprecation
pragma is an error. And we can't wrap the pragma in another macro
that conditionally expands to _Pragma either, as the input argument
is a define that needs to be passed on as is, without expanding it.
So the simplest way to support < Xcode 14 is just to silence
the unknown pragma warning.
Pick-to: 6.6
Change-Id: Icf95042e6186deb212cd1793eb12ba32206ce34b
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
There is a chance that an unused variable warning will be treated as an
error, and in that case, this check will fail, and as a result FindEGL
will fail.
Pick-to: 6.2 6.5 6.6
Fixes: QTBUG-114431
Change-Id: Iaac49589144dbe4172ec58c6705a9f899c25f01f
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
They existed because INTEGRITY hadn't yet been updated to the C++11
Standard Library, with a minor for broken MinGW cross-compilation builds
that forgot to enable gthreads support in libstdc++. The former appears
to have been since fixed and the latter is a massive toolchain
configuration mistake.
Change-Id: I63b988479db546dabffcfffd1766b55132371f9b
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
The example seems incomplete, is undocumented (and unused in shippets,
in spite of tags being present), and generally full of comments that
give the impression that this is for manual testing rather than showing
best practices.
Pick-to: 6.5 6.6
Change-Id: Ie615420e493cc6bb461c5d9ff8d4ae82bb3591db
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
The code is mostly an implementation of a model based on QStorageInfo,
shown in an otherwise uninteresting tree view.
Pick-to: 6.5 6.6
Change-Id: Id6ce70d71ddc9bcd6e82a9ee12f5e1af159eac7a
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
The relevant bits are a two-line snippet.
Pick-to: 6.6 6.5
Change-Id: Id1731e5bc6585b1d1fd684817b39d19ad0a8a9cc
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>