Overwriting a previously set EventCallback may lead to subtle,
hard-to-detect errors. Since it constitutes a programming error, assert
on such attempts to detect potential event handling problems.
Change-Id: I9d3647cbd0a1733741d16681cdad150c85848f97
Reviewed-by: Lorn Potter <lorn.potter@gmail.com>
Make QLibraryPrivate::load_sys() return false on static
wasm builds.
Emscripten does not support dlopen() in this configuration;
calling it will abort the program. By returning false
we give QLibrary users an opportunity to handle the
error.
Task-number: QTBUG-109076
Pick-to: 6.5
Change-Id: I32d1fde04cc54d1622e0743712b6372b023aa006
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Reviewed-by: Mikołaj Boc <Mikolaj.Boc@qt.io>
The qdoc file now quotes from that main.cpp file, so this
means the help information only needs to be maintained in
main.cpp.
Fixes: QTBUG-109178
Pick-to: 6.5
Change-Id: I5bb633f66d92c36593ec6b0aaf9cacd57d4ce352
Reviewed-by: Rami Potinkara <rami.potinkara@qt.io>
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
Fractional mouse movements may be reported on hi-dpi. Floating point
event fields help us perform correct calculations in line with the
web platform.
Change-Id: Ic0c457db408c2bf28179ffcfdb032cde64ca8bbd
Reviewed-by: Lorn Potter <lorn.potter@gmail.com>
Reviewed-by: Aleksandr Reviakin <aleksandr.reviakin@qt.io>
Return the file engine impl of QFileInfo::completeBaseName() and
QDir::absolutePath() and QFileInfo::fileName() (based on
QAbstractFileEngine::BaseName) if the file engine impl is valid.
Amends f77668ffec.
Pick-to: 6.5 6.4 6.2 5.15
Task-number: QTBUG-98974
Change-Id: I28a8c75a6f25e30012b0791c12dbde51bfe8f62c
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
When pressing the copy key the view tried to access the model's data for
the currentIndex() without checking whether the index is valid. This
resulted in debug output to the console, and might break models that
didn't check incoming indexes for validity (or asserted validity).
Fix this by checking whether the currentIndex() is valid before reading
the model's data for that index.
Fixes: QTBUG-106569
Pick-to: 6.5 6.4 6.2 5.15
Change-Id: Ide75fbdfdbd1451ab6d48f07b22136553c5b2468
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
QPlatformTheme::removeMnemonics() removes any match to /\s*\(&[^&]\)/
from the text it is given (a menu entry). It transpires that
translators are apt to use the full-width parentheses (compatible with
some far-eastern scripts) instead of the plain ASCII ones. This leads
to their translated mnemonics don't match the same pattern unless we
treat the full-width parentheses as a match for the ASCII ones;
consequently, they don't get removed, which this function exists to
do. So teach it to recognize the full-width versions, too.
In the process, break out the pattern-matching (aside from the leading
space) to a lambda to make it easier to read and document.
Fixes: QTBUG-110829
Pick-to: 6.5 6.4 6.2 5.15
Change-Id: I7335d0bd8dbba66e1fe58fc3eec93caaaf6ec140
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
If a slot connected to a QMenu-action destroys the QMenu, then
we must not touch data members in subsequent code, and instead return
immediately.
We cannot use QBoolBlocker here, as that would reset the data
member of QMenuPrivate even when trying to return early.
Fixes: QTBUG-106718
Pick-to: 6.5 6.4 6.2
Change-Id: I6b5ea471b1bf1f9864e1384382100f8f6c01346f
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
Added the qml-deploy-dir option, which deploys imported qml files to
the directory passed as an argument. If no option is given, a "qml"
directory is created, and files are deployed there.
[ChangeLog][QtTools][Windeployqt] Windeployqt's default behavior is
now to deploy qml imports to a "qml" directory inside the deploy
directory, rather than directly to the deploy directory.
Task-number: QTBUG-99516
Pick-to: 6.5
Change-Id: I49262a38c4a42ef20b05b603f5eb5393fe9cc218
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
Based on discussions in the 6.5 API review, where we concluded that
'appearance' is too general. Instead, we follow the CSS standard
and use the term 'color scheme'.
Pick-to: 6.5
Change-Id: I8ceaf4138ecadff5ccd962480e8e5beb39b556ec
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
Reviewed-by: Jonas Kvinge <jonas@jkvinge.net>
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
Recently removed to qtenvironmentvariables_p.h, so #included that
while qtdeclarative adjusted its one client's #include.
Change-Id: I4ed8f69f009996d6a2856e2f4e0bb861a104931c
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
There is a mix between screen device pixel ratio. Currently we store the
property on a per-window basis, but the change notifications are still
on a per screen basis which can fall apart on edge cases.
On wayland we are getting per window DPR changes without as useful
screen change events so it's important to fix. It also has potential to
clean up the Windows backend in the future where the backend is
currently papering over the two concepts.
This patch introduces two new events:
A QWindowSystemInterface to trigger a window DPR change
independently of a screen change.
An event to notify windows the new DPR rather than needing to track
signals on the screen. This happens either when the window dpr changes
or implicitly through a screen change. This can deprecate an existing
event ScreenChangeInternal so the value is reused and renamed for
clarity.
Change-Id: I637a07fd4520ba3184ccc2c987c29d8d23a65ad3
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Child windows can't be e.g. fullscreen independently
of their parent window. They should probably be allowed
to take the WindowActive state though, so let that
one trough.
Pick-to: 6.5
Change-Id: I857029f680d2fb274ba38705f6b687be45f46761
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
Few tweaks:
- Remove extra closing parenthesis
- Use absolute paths as the exists() checks & other plist path
uses are relative to the permissions.prf location
- Use the plist path with PlistBuddy instead of the variable
from .pro file
Pick-to: 6.5
Change-Id: I27c7f1e7044a55ff7fbd78ef1dd79c92b17e8018
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
The latter needs the value_type to be default-constructible, which
shouldn't be required to clear() a container.
Use std::destroy_n() instead.
[ChangeLog][QtCore][QVarLengthArray] clear() no longer requires the
value_type to be default-constructible.
Pick-to: 6.5 6.4 6.2 5.15
Change-Id: I806de8f3826b50c0bd38156892c3afeb15f13ac9
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
MYSQL_TYPE_JSON was introduced in MySQL 5.7.9 but our documentation
states that we still support 5.6 so we have to define this value by
ourself for the older versions.
Pick-to: 5.15 6.2 6.4 6.5
Fixes: QTBUG-109832
Change-Id: I935edb14495d162ed58109610946b2805d37bbc4
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
[ChangeLog][QtSql] Added the ability to specify the MySQL/MariaDB
connection type using the "MYSQL_OPT_PROTOCOL" connection string
option. In case the connection type is "MEMORY" for shared memory,
applications can specify the shared memory segment name using the
"MYSQL_SHARED_MEMORY_BASE_NAME" option.
Fixes: QTBUG-2551
Change-Id: I91e0981994c045fb74478d0e765e2ec24eefeece
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
On macOS, key combinations with the Return key do not get delivered
through NSView::keyDown, but they are seen by the
QCocoaNSMenu::menuHasKeyEquivalent override. We already use that
override to check whether any menu item uses a matching shortcut, and
give Qt's focus object a chance to override the shortcut. The key
mapper used the NSNewlineCharacter '\n' for Qt::Key_Return.
However, the character we get from macOS for the return key is the
NSCarriageReturnCharacter character, '\r'. This makes the lookup
fail, and shortcut overrides are not delivered for shortcuts using
Qt::Key_Return.
To fix this, map Qt::Key_Return to NSCarriageReturnCharacter. The
inverse mapping maps both NSCarriageReturnCharacter and
NSNewlineCharacter to Qt::Key_Return, and there are no other users
of this function in Qt.
Pick-to: 6.5 6.4
Fixes: QTBUG-107526
Change-Id: I716190adf3cd94697e2b3ad1afc25b95d8ebde25
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
dfb4697e4a made a change to selection
behavior that resulted in a regression where clicking on an item view
but not on an item would cause the current item to get unselected.
Changes the behavior to not update in this case.
Added a new test that specifially checks for this scenario and ensures
that the current item is still selected, even after the user clicks on
empty area.
Fixes: QTBUG-105870
Pick-to: 6.2 6.4 6.5
Change-Id: I191c3878819b99897083039fba0ab43908da5429
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
qtbase/src/dbus/qdbus_symbols.cpp:18:17: error: ‘Qt’ has not been declared
18 | using namespace Qt::StringLiterals;
| ^~
Change-Id: Iaa5f1947bb832706b69e954103761193509644d5
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Painting wide lines and filling would be clipped to cliprect (by
default, the device rect) only if the bounding rect coordinates
exceeded QT_RASTER_COORD_LIMIT. In Qt 6, that limit was raised from
2^15 to 2^23, so a lot of time could be spent on rasterizing elements
that would anyway be outside the rendering area.
Fix by instead clipping whenever the path to be painted overshoots the
cliprect by a significant margin. At this point, the path is already
flattened to straight lines, so clipping is quick and precise. Testing
indicates that this solution improves performance a lot when large
portions of the elements to be painted fall outside the cliprect,
while not causing significant performance hits otherwise.
As a side effect, it is then no longer necessary to test the bounding
rect explicitly against QT_RASTER_COORD_LIMIT, since we already make
sure that the clip rect we check against is within that limit.
Fixes: QTBUG-110595
Pick-to: 6.5 6.4 6.2
Change-Id: Iaf1afbb481c2d7059405f334278796ad46f5bcb6
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
This leads to unwanted side issues such as building and running third
party component tests. The option should be enabled explicitly by
user instead.
Fixes: QTBUG-111091
Change-Id: I8942db2bd089ad2a39a70627bfce8314b101ecb8
Reviewed-by: Kai Köhne <kai.koehne@qt.io>
Reviewed-by: Amir Masoud Abdol <amir.abdol@qt.io>
I don't begin to understand the semantics of the trackers here, but
whatever they are, they break with the fallback std::swap() 3-moves
implementation and lose track of alive objects, so provide an ADL swap
that does the right thing.
Amends dd58ddd5d9 (I think).
Pick-to: 6.5 6.4 6.2 5.15
Change-Id: I1cd49c95dca2d103a26c2c7ac0a896929135a6c8
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Cleanup the generated message regarding the configuration summary. Also
moved the flushing into the helper function.
Pick-to: 6.5
Change-Id: I45728ac5b43613f002b6d5b07b9ad037416c4fff
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
Apparently, more and more librt functionality are being moved to glibc
these days, e.g., clock_gettime, clock_getres, clock_settime,
clock_getcpuclockid, clock_nanosleep. As Thiago mentioned, in face,
all librt functions are moving into glibc, but unlike the clock_*
functions that I can see are ported from 2.17+, I cannot find out when
and what functions are already ported. So, here, I added a second test
which tries to explicitly look for shm_* functions, if they are there,
as well as the clock_* function, then we are more confident that we
actually have a useful the libRt in the system.
Also, making the FEATURE_posix_SHM depends on UNIX.
Pick-to: 6.5
Fixes: QTBUG-111049
Change-Id: I08b7f4656ecd9313b552fb05ca7096f5b987b95a
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Aggregate the names of the same value enumerators. The values can also
be hexadecimal so handle them also.
Pick-to: 6.5
Change-Id: I89693d7e3b8f6c051b298401dcbe8a9f5c0a38aa
Reviewed-by: Antti Määttä <antti.maatta@qt.io>
Reviewed-by: Tomi Korpipää <tomi.korpipaa@qt.io>
- Check if trace location is writable
- Call fclose only if file is opened
- Convert metadata to QByteArray in one place.
- Add constraint to array operator.
Pick-to: 6.5
Change-Id: Id01998fe8e754dab7a4b7d8ce1361ac822d01390
Reviewed-by: Antti Määttä <antti.maatta@qt.io>
Somewhere between libmysql 8.0.18 and 8.0.27, the MYSQL_TIME structure
gained an additional member which increased the struct size by 4 bytes.
This makes an internal check for the correct size of the structi go fail.
Since it can now happen that the plugin is linked against a new libmysql
and used with an old and the other way round, duplicate the old
MYSQL_TIME struct to use this in our code
Pick-to: 6.4 6.5
Fixes: QTBUG-110967
Change-Id: I5bc631179a0a1be47a5966954e757f27a72f1592
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
MSSql Server sometimes returns SQL_SS_TIME2 instead SQL_TIME. Since this
value is non-standard, we have to define it by ourself.
Pick-to: 5.15 6.2 6.4 6.5
Fixes: QTBUG-109206
Change-Id: I40a4b32590d877ebfdc4b2f1d9080d8cdb2ae7a5
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
A RAII wrapper around Qt::{begin,end}PropertyUpdateGroup().
[ChangeLog][QtCore][QScopedPropertyUpdateGroup] New RAII class
wrapping Qt::beginPropertyUpdateGroup() and
Qt::endPropertyUpdateGroup().
Fixes: QTBUG-110710
Change-Id: If2619e9584dd9d57985d63e3babca75421499ab9
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
These can be removed now that the modules use tracepointgen tool.
Pick-to: 6.5
Change-Id: I265e019f99e1ccc557a284ff53b110073066e530
Reviewed-by: Janne Koskinen <janne.p.koskinen@qt.io>
Reviewed-by: Hatem ElKharashy <hatem.elkharashy@qt.io>
Reviewed-by: Tomi Korpipää <tomi.korpipaa@qt.io>
Pick-to: 6.5
Change-Id: I300ecb9d25f0ecb7208c643704adf66bdf0a4b56
Reviewed-by: Antti Määttä <antti.maatta@qt.io>
Reviewed-by: Janne Koskinen <janne.p.koskinen@qt.io>
Reviewed-by: Tomi Korpipää <tomi.korpipaa@qt.io>
This fixes the metadata generation when cross compiling. The metadata
needs to be generated based on the type info of the target. Currently
the metadata is generated in the tool based on the host type info.
Task-number: QTBUG-110270
Pick-to: 6.5
Change-Id: Ibcdcbd690620afc532d6007cf036229342bdcc31
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Handle cleanup of the CTF plugin correctly. The cleanup causes recursive
trace event so the plugin needs to handle this.
Pick-to: 6.5
Change-Id: Id6f4c6efe95e51332a8be97fecdf7886ba173e43
Reviewed-by: Tomi Korpipää <tomi.korpipaa@qt.io>
Reviewed-by: Hatem ElKharashy <hatem.elkharashy@qt.io>
qtbase/src/widgets/styles/qstylesheetstyle.cpp: In function ‘quint64 extendedPseudoClass(const QWidget*)’:
qtbase/src/widgets/styles/qstylesheetstyle.cpp:2577:1: warning: control reaches end of non-void function [-Wreturn-type]
2577 | }
Pick-to: 6.5
Change-Id: Id53d637d43a8d530a7bdfbd7d5b823162d1399b5
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Disable xcb touchpad gesture when gestures is not available
Pick-to: 6.5
Change-Id: Idd2fec38646fad4cbda20ab1e560949c8e8844ff
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
The "Private Use Area" are subsets of Unicode which are not
considered regular characters, but reserved for fonts to provide
custom glyphs.
If these were used and the main font did not have support for them,
we would look them up in other fonts and sometimes display an
arbitrary selection of glyphs, based on whatever existed on the
platform. This is unexpected and different from how native apps
work on Windows, for instance.
[ChangeLog][QtGui][Text] Font merging (automatic assignment of
alternative fonts) is no longer applied for characters in the
Private Use Areas of Unicode.
Pick-to: 6.5
Fixes: QTBUG-110502
Change-Id: Id2c63786aafda59bf170e0d7263eb78a391fe46d
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Some platforms do not work with forward declarations, mainly android.
Pick-to: 6.5
Change-Id: Ie34a30ecb8554d77c1bea4b65a752d63ba819af9
Reviewed-by: Janne Koskinen <janne.p.koskinen@qt.io>
Reviewed-by: Hatem ElKharashy <hatem.elkharashy@qt.io>
Reviewed-by: Tomi Korpipää <tomi.korpipaa@qt.io>