Cleanup the private function names after the change to pmf-style
connections.
Task-number: QTBUG-117698
Change-Id: I38f13fff8312ac1f3f9da6e034f3131de7bd6247
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
Cleanup the private function names after the change to pmf-style
connections.
Task-number: QTBUG-117698
Change-Id: I9a5e178af997bfcfef78f7a3b9b84da6d653186d
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
Cleanup the private function names after the change to pmf-style
connections.
Task-number: QTBUG-117698
Change-Id: I60275b7da6bf5e78562ccfd38a02719cc313eb49
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
Remove the now unused Q_PRIVATE_SLOT() macros for all itemviews classes
after the conversion to the new style-connection syntax.
Task-number: QTBUG-117698
Change-Id: Id4b8077d9f07741cc418a2126843565940701125
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
Replace all connect() calls with pmf-style connection syntax. This also
means that we have to properly disconnect everything in the ctor to not
trigger an assertion in QtPrivate::assertObjectType().
Task-number: QTBUG-117698
Change-Id: Ia0745dc10a917f3af4b448b3156d66bdb5d6ce64
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
Replace all connect() calls with pmf-style connection syntax. This also
means that we have to properly disconnect everything in the ctor to not
trigger an assertion in QtPrivate::assertObjectType().
Task-number: QTBUG-117698
Change-Id: I955bd088e24ada7aa87645d28dc9b201bc67e927
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
Replace all connect() calls with pmf-style connection syntax. This also
means that we have to properly disconnect everything in the ctor to not
trigger an assertion in QtPrivate::assertObjectType().
Task-number: QTBUG-117698
Change-Id: If2c259c3f7737cec736c134c8bc83c4cb14906ba
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
Replace all connect() calls with pmf-style connection syntax. This also
means that we have to properly disconnect everything in the ctor to not
trigger an assertion in QtPrivate::assertObjectType().
Task-number: QTBUG-117698
Change-Id: I2b5bb99c77e6e783a4cd7b0065d2f52a0266d88b
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
Replace all connect() calls with pmf-style connection syntax. This also
means that we have to properly disconnect everything in the ctor to not
trigger an assertion in QtPrivate::assertObjectType().
Task-number: QTBUG-117698
Change-Id: I652c8d6f27b23a7d4467dc39b7c12850f4d25f66
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
Replace all connect() calls with pmf-style connection syntax. This also
means that we have to properly disconnect everything in the ctor to not
trigger an assertion in QtPrivate::assertObjectType().
Task-number: QTBUG-117698
Change-Id: Ic6617b3611a2ce156e9e568c1d07343f649562c4
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
Replace all connect() calls with pmf-style connection syntax. This also
means that we have to properly disconnect everything in the ctor to not
trigger an assertion in QtPrivate::assertObjectType().
Task-number: QTBUG-117698
Change-Id: Ifd6a55080a803b3aba2e35b9679a5194ff3f633c
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
Xdg-desktop-portal will reject any OpenFile request if there is an empty
filter, so if we can't find the mimetype in the mimedatabase we just
use it's "raw name"
Pick-to: 6.6 6.5 5.15
Change-Id: I705ae7523445e5c2ec97a42ee334401bc90adb68
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
As described in QTBUG-27681, we no longer send KeyboardLayoutChange
events in Qt 5 and up. We have QInputMethod::localeChanged, but that
doesn't cover the cases where the input language stays the same, but
the layout is changed.
None of our widgets react to KeyboardLayoutChange these days, but
ideally we should send KeyboardLayoutChange if we can plumb it from
the platforms.
However that plumbing wouldn't live in QKeyMapper, and having it
around as dead code doesn't help, so remove it for now, and track
the work to implement it in QTBUG-27681.
Task-number: QTBUG-27681
Change-Id: I480590550f3bc741b829fb30aa85393b07d5c16f
Reviewed-by: Liang Qi <liang.qi@qt.io>
There is no point in maintaining the keyboardInputLocale and
keyboardInputDirection in the QKeyMapperPrivate, as these
things are handled by QInputContext nowadays. The values
were never updated either, so the base class implementation
of QPlatformInputContext referring to them was confusing.
With those gone, we can remove the entire class.
Subclasses of QPlatformInputContext typically only override
locale(), so we now base the input language direction on the
current locale(), giving dynamic updates of the direction as
well (without the signal, but this will be fixed in a follow
up patch).
Change-Id: I16ae4097eadadd278e60edea3c1101ab90ed7444
Reviewed-by: Liang Qi <liang.qi@qt.io>
They actually can be, so the implementation need not change. Just add
the noexcept tag (which is BC, it's not part of the name mangling on
any compiler).
Silences a bunch of XFAIL in the test (the test is automatically
picking up the change, no need, and no way, to manually remove the
QEXPECT_FAIL).
Change-Id: I24b6ba1248001056de64f341617943e7aea5ae93
Reviewed-by: David Faure <david.faure@kdab.com>
Pointers can only be legitimately compared with less-than (<) if they
point into the same array (or one past the end). This is decidedly not
the case for heap-allocated objects like
QPersistentModelIndexPrivates, so doing it is UB.
Fix by using std::less, which is guaranteed to be a total order, even
for unrelated pointer values.
Pick-to: 6.6 6.5 6.2 5.15
Change-Id: If04341b4b55784e7732782f3ae829f53b0ceab9c
Reviewed-by: David Faure <david.faure@kdab.com>
Execute the cheaper test first, so we loop over the entries more
quickly.
Pick-to: 6.6
Change-Id: I9d43e5b91eb142d6945cfffd178749a12c966739
Reviewed-by: Ahmad Samir <a.samirh78@gmail.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Copying QStrings and QByteArrays is reasonably cheap, but moving is
cheaper.
Pick-to: 6.6
Change-Id: I9d43e5b91eb142d6945cfffd1787498ead687da2
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Ahmad Samir <a.samirh78@gmail.com>
All these where somewhat cheap to copy (QStrings and QByteArrays), but
why copy multiple times at all? Just copy at the end.
Pick-to: 6.6
Change-Id: I9d43e5b91eb142d6945cfffd1787497434632dd4
Reviewed-by: Ahmad Samir <a.samirh78@gmail.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
symlinkTarget() suffices, because if the candidate is not a symlink, it
will return an empty string. Plus, /dev/disks/by-label is a udev-managed
directory, so everything should be a symlink.
This doesn't change the number of statx() calls because QDirIterator
needs some information on file types to decide how to filter and,
unfortunately, that information is missing for symlinks (we know it's a
symlink, but we don't know what it points to). Moreover, due to
QDirIterator's design, we always statx() one entry past the one we
wanted.
Pick-to: 6.6
Change-Id: I9d43e5b91eb142d6945cfffd1786ce1bd3398d1b
Reviewed-by: Ahmad Samir <a.samirh78@gmail.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Otherwise Qt Creator won't index it.
Pick-to: 6.6
Change-Id: I9d43e5b91eb142d6945cfffd1786cda60859226b
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
Reviewed-by: Ahmad Samir <a.samirh78@gmail.com>
It was limited to only the most common platform, Windows.
Change-Id: I1821a5201f85b14f8f43469775af816519724f6b
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Commit baac34de modified the set[Red|Green|Blue|Alpha] function
signatures. Amend the \fn commands to reflect those changes.
Pick-to: 6.6
Change-Id: I947995fc5c80baac111a04272cd848961c22eb73
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
We react to WM_INPUTLANGCHANGE, and handle it by calling
handleInputLanguageChanged on the input context.
As input language is not the same as keyboard layout
(a keyboard layout might change without the input
language changing), let's be accurate about what's
happening.
Change-Id: I8914994a8d46485179741e010d0da5135b023668
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
Reviewed-by: Andrey Butirsky <butirsky@gmail.com>
Replace all connect() calls with pmf-style connection syntax. This also
means that we have to properly disconnect everything in the ctor to not
trigger an assertion in QtPrivate::assertObjectType().
Change-Id: I8f2d64b77849bf5fea01b7f80bbd5d0c0a09c4fa
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
The jbyte type is a signed char, which also promotes to int in variadic
argument functions.
Extend the test case to make sure that we don't get any warnings for
the most relevant parameter types.
Change-Id: I7811e1eebdbc989ab5989eb1a2c502acd0540bc7
Reviewed-by: Juha Vuolle <juha.vuolle@qt.io>
Reviewed-by: Zoltan Gera <zoltan.gera@qt.io>
This reverts commit 5e76a9569e.
The change's stated goal was to make shortcuts "stable",
i.e. work the same, regardless of which keyboard layout
the user has selected.
In doing so, it changed the semantics of shortcut handling
to depend on the order of the keyboard layouts reflected
by XKB, picking the first Latin layout in the list, instead
of prioritizing the currently selected/active keyboard
layout.
This change in semantics is a major behavior change, and
breaks common and valid setups such as having [en,fr] or
[en,de] layouts.
For example, the French layout uses an AZERTY layout,
where the Q and A keys are switched compared to QWERTY.
With the change in place, pressing the physical A key
on a French keyboard, with Control pressed, no longer
selects all text, but instead quits the application,
as the shortcut is interpreted based on the English
layout, which just happens to be first in the list.
Similar issues exist for German layouts, which use
QWERTZ, or more complex layouts such as the Neo layout.
The semantics of prioritizing the order of declared
layouts instead of the active one is inconsistent with
both macOS and Windows, as well as other toolkits on
Linux, including GTK and earlier versions of Qt.
It's also not discoverable by the user that the order
now matters. For example, there is no UX in the Gnome
setting that tells the user to ensure the order matches
their expectations for shortcut handling. And if there
was, this would only apply to Qt apps built with 6.6.0,
creating inconsistent behavior for users.
Worse, the X server is limited to four concurrent keyboard
layouts (groups), so if the user adds more layouts than
that, Gnome will replace the X server's view of layouts
only when switching to a layout beyond the first four.
And in that case, the X server's view of the layouts is
actually starting with the fifth layout declared in the
Gnome preferences. The logic in the reverted patch does
not take this into account, making it confusing for the
user which layout actually takes precedence.
Note that reverting this change does not affect our
fallback logic for layouts that do not produce Latin
symbols for the given key press, such as Greek or Russian.
Those layouts will continue to fall back to a Latin
layout for their QKeyEvent::key().
[ChangeLog][QtGui][X11/Wayland] A change in 6.6.0 that
resulted in keyboard shortcuts not respecting the user's
active layout has been reverted.
Pick-to: 6.6
Task-number: QTBUG-108761
Change-Id: Iec2897cd1541c0c125cc5b1078d0beec12b501c0
Reviewed-by: David Edmundson <davidedmundson@kde.org>
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Gatis Paeglis <gatis.paeglis@qt.io>
Reviewed-by: Liang Qi <liang.qi@qt.io>
`QCoreApplicationPrivate::self` is set to nullptr in `~QCoreApplication`
without any synchronization. So it is not safe to access it from
instances of `QDaemonThread` that may outlive the application instance,
but are using the Qt event system. This patch moves some usages of
`self` behind other checks, so that the QtDBus management thread can
continue workoing without race conditions detected by Thread Sanitizer
while running tst_qdbusconnection.
Change-Id: Iece65e4126a59e3a1a41dfb6a99c84527b8d389c
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
When changing the selected index in a combo box,
also update the current index in the item view's
selection model right away, and don't delay this
until when the combobox popup gets shown in
QComboBox::showPopup.
This is needed to make sure that the selection
is properly exposed to the accessibility layer.
On the accessibility layer, QAccessibleComboBox,
the a11y implementation for the combobox, exposes
the entries in its list child
(s. QAccessibleComboBox::child) and Orca queries
the selected item when the combobox gets focus,
which didn't return the proper results earlier,
resulting in no or the wrong entry getting
announced.
Extend the existing combobox a11y tests
accordingly.
Pick-to: 6.6 6.5
Fixes: QTBUG-117644
Change-Id: Ia26de5eafd229f7686745a2fbe03fc1eb6a713f8
Reviewed-by: Liang Qi <liang.qi@qt.io>
Call QEvent::accept() when a key event has been acted on.
This prevents redundant event delivery and consumption.
Task-number: QTBUG-117644
Pick-to: 6.6 6.5
Change-Id: I069c61c14890577683894f165fd2585ba05c45ff
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
Reviewed-by: Liang Qi <liang.qi@qt.io>
A helper method encasuplating the asserts related to index into the
container and length, modelled after the QVLA::verify().
`pos <= size` is OK because if pos == size, the e.g. sliced()'ed
container is just going to be empty.
Normalize how verify() is used, the first arg is an index and the second
a length.
This method is constexpr even in QString/QByteArray merely for
consistency with similar methods in other string classes (this
necessitates using `d.size` in verify() in QString/QBA because size()
isn't constexpr).
Change-Id: I90e3c56d76c802259297a06d11d46ee342a1daf2
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Implement the missing overload to handle UTF-8 specific data types,
including char8_t (C++20), char, uchar and signed char.
Introduce the helper function 'assign_helper_char8' which handles the
non-contiguous_iterator case. The contiguous_iterator case is already
handled by the QAnyStringView overload.
Include 'qstringconverter.h' at the end of the file, since it can't
be included at the top due to diamond dependency conflicts.
QStringDecoder is an implementation detail we don't want users to
depend on when using assign(it, it). It would be unnatural to not
be able to use a function just because we didn't include an
apparently unrelated header.
[ChangeLog][QtCore][QString] Enabled assign() for UTF-8 data types.
Fixes: QTBUG-114208
Change-Id: Ia39bbb70ca105a6bbf1a131b2533f29a919ff66d
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
For example when Ctrl+Home is sent by virtual keyboard on Wayland.
Pick-to: 6.6 6.5 6.2 5.15
Change-Id: I41f1d2a28c9091efa621d5826a3b9e3e0e481ceb
Reviewed-by: Liang Qi <liang.qi@qt.io>
Since https://gitlab.kitware.com/cmake/cmake/-/merge_requests/8564 is
merged, the timestamp file for {target}_json_file.txt should be updated
for `Cross-Config` builds.
The actual error message before this commit when CMake 3.28 is used:
```
ninja: error: 'src/corelib/Core_autogen/timestamp', needed by 'src/corelib/meta_types/Core_json_file_list.txt', missing and no known rule to make it
```
Pick-to: 6.2 6.5 6.5.3 6.6 6.6.0
Change-Id: Ib544b18b67d2d4722f3801b1f46a0e0e18e59d48
Reviewed-by: Amir Masoud Abdol <amir.abdol@qt.io>
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
I originally wrote dateNormalize() because I expected to need it more,
but it turns out to only be needed for two cases of getting the days
before and after a given one. So rename to adjacentDay(), pass the +1
or -1 step and simplify a little.
In the process, fix a mistake in the winding backwards across a year
boundary, where I'd incremented the year instead of decrementing it.
Change-Id: I1bb0a8323fec7c1caffa7f20879f08d3526ba7ea
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
CodeChecker tells me struct tm and even MkTimeResult are trivially
copyable, so std::move()ing them is fatuous.
Change-Id: Ic7328e588beabfd4a984b2b5e2ed17c065d00f01
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Change the Qt version for future directions of
QCoreApplication::notify() to 7. The required changes were not
done in Qt 6 as planned. Add the code that is implementing those
changes for Qt 7.0.0.
This amends 4fe865ac7a.
[ChangeLog][Future direction notices] In Qt 7,
QCoreApplication::notify() will not be called for events being delivered
to objects outside the main thread. The reason for that is that the main
application object may begin destruction while those threads are still
delivering events, which is undefined behavior. Applications that
currently override notify() and use that function outside the main
thread are advised to find other solutions in the mean time.
Change-Id: I4dd2193092542474962cdcde4921f38b173f2f00
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
This change can be described in the following 2 categories:
1. Support 3 ways to escape identifiers mentioned in SQLite Keywords
In SQLite Keywords (https://sqlite.org/lang_keywords.html), it shows
that there are 3 ways to escape identifiers, i.e., "", [], ``. So, I
have overridden "bool isIdentifierEscaped(const QString &,
IdentifierType)" to support it. In addition, there was a bug of
_q_escapeIdentifier. If there is a field name called length [cm],
which uses square brackets to show units, _q_escapeIdentifier will
not escape it to "length [cm]".
2. Identify identifiers correctly if identifiers have been escaped
There is a bug of QSQLiteDriver::record and
QSQLiteDriver::primaryIndex.
If we input escaped identifiers with separator, let's say
"databaseName"."tableName", both will change the input into
databaseName"."tableName, which is incorrect and causes
qGetTableInfo cannot get the right results. In addition, I overrode
stripDelimiters to strip "databaseName"."tableName" correctly.
There are still some assumptions for isIdentifierEscaped,
escapeIdentifier, and stripDelimiters, but I think this change it better
than what we have now.
1. For isIdentifierEscaped, if identifiers have a dot and the dot is a
separator, it is the users' responsibility to escape the pair of
schema and table name correctly. For example,
"aSchemaName"."aTableName", not "aSchemaName".a"TableName". That's
because we don't know whether the dot is just a dot of the name or a
separator.
2. For escapeIdentifier, if identifiers have a dot and the parts before
and after the dot are not escaped, escapeIdentifier will treat the
dot as part of the table name or field name. The same as the item
above, it is users' responsibility to do it right.
3. For stripDelimiters, the same as above, it is users' responsibility
to do escape if users want to use format schemaName.tableName or
tableName.fieldName.
Change-Id: I9d036a2a96180f8542436188f75a220a0fe58257
Reviewed-by: Po-Hao Su <supohaosu@gmail.com>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Christian Ehrlicher <ch.ehrlicher@gmx.de>
Amends 5743837a26, after which Qt
Positioning and Qt SCXML failed to build as some properties operate on
abstract classes.
Check whether we can instantiate the tested class before trying to do so,
otherwise return a default-constructed unique_ptr.
Pick-to: 6.6 6.5
Change-Id: Ida9d4375197a93438062b1e1473b4a2a22cc7054
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
Previous implementation of qt_safe_ioctl mentioned that vxworks defines
ioctl in a non-standard way.
As of VxWorks 23.03 ioctl is now properly defined so the comment and
check in the code are obsolete.
Task-number: QTBUG-115777
Change-Id: I0fdf614e45063b031e2c998339d6987ba69167ca
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
The warning from the comment was probably caused by our noexcept
detection code. Now that we use std::is_nothrow_swappable, those
warnings should not longer happen.
Remove the warning suppression macros, and the #include that was
necessary for them.
Change-Id: Ib750cb1af4a8da3fb63b16d26ec51a9fb4a93ea1
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Ahmad Samir <a.samirh78@gmail.com>
QtC is unable to find the deployment settigns if target uses custom
OUTPUT_NAME. There is no particular reason for using the target
OUTPUT_NAME property as the base name for android deployment settings.
[ChangeLog][General][Android] The target name is used as a base name of
android deployment settings, but not the OUTPUT_NAME property.
Pick-to: 6.2 6.5 6.6
Fixes: QTBUG-117509
Change-Id: I1ac3b0ad305dc55289bef39c6e946bcf684e772f
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
Now that QtJniTypes::Objects are no longer primitive types that are the
same as a jobject, using those types in registered native functions
breaks. JNI will call those function with a jobject on the function
pointer, and lacking any type safety, the call to the registered
function will proceed with a wrong type of object on the stack.
To fix that, register the native function via a proxy that is a variadic
argument function, and unpack the variadic arguments into a list of
typed arguments, using the types we know the user-code function wants.
Then call the function with a tuple of those types using std::apply,
which gives us type safety and implicit conversion for free.
Add a test that exercises this.
Change-Id: I9f980e55d3d13f8fc16c410dc0d17dbdc200cb47
Reviewed-by: Juha Vuolle <juha.vuolle@qt.io>
Instead of having a type that doesn't behave like a QJniObject, which
includes not holding a proper reference on the Java object, make the
QtJniTypes::Object type a QJniObject subclass that can be specialized
via CRTP to provide type-specific constructor and static functions.
QJniObject doesn't have a virtual destructor, but we subclass it only to
add a typed interface, without adding any additional data members.
Add versions of the static functions from QJniObjects to the
QtJniTypes::Object so that they can be called without explicitly
specifying the type or class name. This includes a constructor and named
constructors.
Constructing such objects means constructing a Java object of the class
the object type represents, as per the Q_DECLARE_JNI_CLASS declaration.
This is not without ambiguity, as constructing a type with a jobject
parameter can mean that a type wrapping an existing jobject should be
created, or that a Java object should be created with the provided
jobject as the parameter to the constructor (e.g. a copy constructor).
This ambiguity is for now inevitable; we need to be able to implicitly
convert jobject to such types. However, named constructors are provided
so that client code can avoid the ambiguity.
To prevent unnecessary default constructed QJniObjects that are then
replaced immediately with a properly constructed object, add a protected
QJniObject constructor that creates an uninitialized object (e.g. with
the d-pointer being nullptr), which we can then assign the constructed
jobject to using the available assignment operator. Add the special
copy and move constructor and assignment operators as explicit members
for clarity, even though the can all be defaulted.
Such QJniObject subclasses can then be transparently passed as arguments
into JNI call functions that expect a jobject representation, with the
QtJniTypes::Traits specialization from the type declaration providing the
correct signature.
QJniObject's API includes a lot of legacy overloads: with variadic
arguments, a explicit signature string, and jclass/jmethodID parameters
that are completely unused within Qt itself. In addition the explicit
"Object" member functions to explicitly call the version that returns a
jobject (and then a QJniObject). All this call-side complexity is taken
care of by the compile-time signature generation, implicit class type,
and template argument deduction. Overloads taking a jclass or jmethod
are not used anywhere in Qt, which is perhaps an indicator that they,
while nice to have, are too hard to use even for ourselves.
For the modern QtJniTypes class instantiations, remove all the overhead
and reduce the API to the small set of functions that are used all over
the place, and that don't require an explicit signature, or class/method
lookup.
This is a source incompatible change, as now QJniTypes::Object is no
longer a primitive type, and no longer binary equivalent to jobject.
However, this is acceptable as the API has so far been undocumented,
and is only used internally in Qt (and changes to adapt are largely
already merged).
Change-Id: I6d14c09c8165652095f30511f04dc17217245bf5
Reviewed-by: Juha Vuolle <juha.vuolle@qt.io>
Move the shared code into a variadic template construct-function of
the private, which can do the rest.
Change-Id: I98a9a93b7c0452cc28769370e6a1499f1728a72d
Reviewed-by: Zoltan Gera <zoltan.gera@qt.io>
Reviewed-by: Juha Vuolle <juha.vuolle@qt.io>
Functions that are not called by any of the inline code don't have to be
in the public header. Move them as static functions into the translation
unit. Remove some useless wrappers in the private, and move the code for
private and static functions together.
Some private helpers have to stay in the ABI as they used to be called
by at least one public inline function up to Qt 6.6. Remove them from
the API using QT_CORE_REMOVED_SINCE.
Change-Id: I7eb7b2ba994dfda9de11e2d090a70842dad17247
Reviewed-by: Juha Vuolle <juha.vuolle@qt.io>
QtAndroidPrivate::findClass first tried the cache, then JNIEnv::FindClass.
Failing that, it tried QJniObject::loadClass which also checked the
cache before falling back to the ClassLoader.
Merge the implementations into QtAndroidPrivate::findClass. Loading a
class now always first tries the cache, then FindClass, then the
ClassLoader. Reduce the overhead from temporary QJniObject creations by
explicitly creating the class string, and avoid printing the exception
in case of failure twice by clearing the exception explicitly after the
first try.
Assert that the function receives a JNIEnv pointer, as any call without
is a programming error (and all call-sites in Qt pass in a valid pointer
anyway, so no need to test otherwise).
With both implementations merged we can centralize the binary encoding
of the class name strings to the single place where it's needed, which
is when calling the ClassLoader::loadClass method. FindClass takes a
fully qualified, slash-separated class name string, so in most cases we
never have to pay any overhead for re-encoding the class name string.
Change-Id: I5a3648763052cebdec69d7d77c503aebdebf5bee
Reviewed-by: Juha Vuolle <juha.vuolle@qt.io>
If we construct the QJniObject from a jobject, then we know the jclass,
but not the class's name. If className is called while the stored name
is empty, get the name of the jclass and updated the stored value.
Change-Id: Ic3332a6da2dac1eb6842f90da1b9264398a43155
Reviewed-by: Juha Vuolle <juha.vuolle@qt.io>
Testing for the binding loops requires a second instance of the
TestedClass. In general case, we cannot guarantee that the TestedClass
is default-constructible, so we introduce a new parameter - a function
that returns an std::unique_ptr holding the properly-constructed
instance of TestedClass. The default implementation simply creates
a unique_ptr using a default constructor, which is good enough for
most cases. The user needs to provide a custom function when
TestedClass has no default constructor (for now such usecase exists
at least in QtScxml and QtPositioning).
This patch introduces new signatures for the helper functions, but does
not actually provide new implementation.
This is an attempt to simplify the CI integration process.
The new arguments have default values, so the existing code will not
be affected.
The idea is that the merge process goes as follows:
* this patch gets merged into qtbase. It should not break leaf modules,
because the new parameters have default values -> existing tests are
unaffected.
* it unblocks all patches to the leaf modules that require the new
parameter for the test helper functions. These patches are also
supposed to fix all the problems with the binding loops.
* once these patches are merged, a follow-up patch to qtbase that
actually extends the test coverage can be merged. As it is supposed
that all problems in the leaf modules are already fixed, merging
this patch should not lead to new problems.
The actual implementation of the new tests is provided in a follow-up
patch.
Task-number: QTBUG-116345
Pick-to: 6.6 6.5
Change-Id: I0dd5c8c60de01aa960d63673b5d7de97950d9490
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
currentCompatProperty should point to the compat property that's
currently being evaluated. As soon as we start evaluating a new compat
property, it's invalid by definition. Temporarily disable it then.
Pick-to: 6.6 6.5 6.2
Fixes: QTBUG-109465
Change-Id: I7baba9350ebf488370a63a71f0f8dbd7516bf578
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
This partially reverts fcb548878b.
qnativesocketengine_unix.cpp:872:40: error: unknown type name
'sockaddr_dl'; did you mean 'sockaddr_in'?
Pick-to: 6.6
Change-Id: Ifeb6206a9fa04424964bfffd178844096ee7741b
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
The converting constructor of QWeakPointer<T> from a QWeakPointer<X>
needs to adjust the X* received by the "source" to a T*.
In case of non-virtual inheritance, this adjustment can be done
statically, by applying an offset to the pointer. In case of virtual
inheritance, we instead need to dereference the pointer (=access the
pointee), get its vtable, and from there find where (=the offset at
which) the T subobject is located.
This latter scenario requires the pointee to be alive throughout this
operation. Since QWeakPointer isn't an owning smart pointer, it's
perfectly possible that the pointee has already been deleted (the
"source" QWeakPointer<X> is dangling) or is being deleted (e.g. from
another thread that has just released the last QSharedPointer). For
this reason the converting constructor of QWeakPointer employs a
protection: it will lock() itself, and extract the raw pointer from the
QSharedPointer so obtained. This ensures that we won't access a dangling
pointer or a pointee about to be deleted.
We can however limit this (relatively expensive) protection only to the
case where there is virtual inheritance. In the other cases we don't
need it. This commit overloads the converting constructor for
QWeakPointer to deal with the two scenarios separately, and only lock()
in case of virtual inheritance.
Change-Id: I7194b90478cf35024e60cff542091308e4131ec2
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
To be used in QWeakPointer.
Change-Id: I5ee9dd0862a0b23d316aaadf5d68bef1ce609e8b
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Pretty sure this is a Clang bug because the promise member that it says
is getting shadowed shouldn't be in scope (`this` isn't being captured).
qfuture_impl.h:538:60: error: declaration shadows a field of 'Continuation<Function, ResultType, ParentResultType>' [-Werror,-Wshadow]
qfuture_impl.h:327:26: note: previous declaration is here
Pick-to: 6.5 6.6
Change-Id: Ifeb6206a9fa04424964bfffd17883e21cfec6d8e
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
The data combined into keys for the various caches is either QByteArray
or plain const char *, so don't blow them up to QString.
Standardize cache-key generation using a fold expression instead of
QString::arg, which then makes use of QStringBuilder.
Change-Id: I12bb104b0d57156358d93deec8ecd37e10b4f864
Reviewed-by: Juha Vuolle <juha.vuolle@qt.io>
Reviewed-by: Zoltan Gera <zoltan.gera@qt.io>
Reviewed-by: Tinja Paavoseppä <tinja.paavoseppa@qt.io>
Both functions are short, and the helper is not reused by other code.
Merge them together so that we can (perhaps later) optimize the repeated
QJniEnvironment construction away.
Change-Id: I168a0620bc4ffbd259ddc3adc6472cfebd11fc5d
Reviewed-by: Tinja Paavoseppä <tinja.paavoseppa@qt.io>
Reviewed-by: Zoltan Gera <zoltan.gera@qt.io>
Reviewed-by: Juha Vuolle <juha.vuolle@qt.io>
Support this both for parameters and return types, in all template
functions for calling methods or accessing fields.
To manage the life-time of the temporary objects, create a local stack
frame in the JVM around the calling function. Popping that implicilty
releases all local refernces, so that we don't have to worry about
doing so explicilty. Adding a local reference to the temporary jstring
objects is then enough for the object to live as long as it's needed.
The LocalFrame RAII-like type needs a QJniEnvironment to push and pop
the frame in the JVM, so we don't need a local QJniEnvironment anymore.
Reduce code duplication a bit as a drive-by, and add test coverage.
Change-Id: I801a1b006eea5af02f57d8bb7cca089508dadd1d
Reviewed-by: Tinja Paavoseppä <tinja.paavoseppa@qt.io>
Those are never used, and removing this causes no problems.
Change-Id: Icae334d2d80197c4a416018e435e588a9c76d843
Reviewed-by: Tinja Paavoseppä <tinja.paavoseppa@qt.io>
Reviewed-by: Zoltan Gera <zoltan.gera@qt.io>
With all submodules ported, we can remove the old template functions
that prevented us from partial specialization for containers.
Change-Id: I78467b6b343b779270e6f49d7db4ac5deb1a0b95
Reviewed-by: Zoltan Gera <zoltan.gera@qt.io>
Reviewed-by: Tinja Paavoseppä <tinja.paavoseppa@qt.io>
Add compile-time testing to make sure that we can declare a JNI
class String that maps to java/lang/String.
Change-Id: I2b68b2b46112e56b279f3fcddc3d71847a005924
Reviewed-by: Petri Virkkunen <petri.virkkunen@qt.io>
Reviewed-by: Zoltan Gera <zoltan.gera@qt.io>
Reviewed-by: Tinja Paavoseppä <tinja.paavoseppa@qt.io>
Move from a manually managed d-pointer to QESDP. This is a long overdue
change (QPen is one of the few classes still with manual management).
At the same time: it's also one of the central classes, and in order
to keep the impact minimal (and binary compatible), I'm not switching to
something more sophisticated.
As a drive-by: drop QPenData, a remnant only used by QPen itself, which
nowadays is simply a typedef for QPenPrivate.
Change-Id: I38834116d7d383f29bb69ff20b0a46dfe951bb53
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
QlistWidgets with sorting enabled do not sort stable. A re-sort is
triggered when any Qt::ItemDataRole is changed and not only when
Qt::DisplayRole is changed. Due to an unstable optimization, the changed
element gets inserted at the beginning of their respective "equivalence
group".
This patch disables the optimization and ensures stable sorting
with std::stable_sort. Sorting is only performed, if the subset of
changed items in the range [begin, end] is not already sorted in the
whole list. For this purpose, it is assumed that the list has already been sorted before begin and after end. This assumption minimizes the subset to check.
Limits / side effect:
The patch focuses on the most common use case, which is a single item being changed. Replacing the optimization by std:stable_sort can potentially slow down the sorting performance of large data sets.
Task-number: QTBUG-113123
Pick-to: 6.5 6.6
Change-Id: Ib2bd08f21422eb7d6aeff7cdd6a91be7114ebcba
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
Following a vmaCreate* it makes sense to test for
VK_ERROR_OUT_OF_DEVICE_MEMORY and print the allocator statistics
in order to give an idea of the application's (video) memory
usage.
For instance when running on a Raspberry Pi 4, this helps to indicate
that the application is just too big for the device, and is more
informative then just a Failed to create image: -2 message.
Pick-to: 6.6 6.5
Change-Id: I666e2358303894efab9d12d2b3a3d98f0bd3a5b6
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
Reviewed-by: Kristoffer Skau <kristoffer.skau@qt.io>
Application deployment must know whether the Qt installation is a
debug_and_release build - or more generally, a multi-config build with a
debug configuration. Store the following information in
QtDeploySupport.cmake that's read at installation time:
- whether Qt was built multi-config with a debug configuration
- the postfix for debug libraries
Task-number: QTBUG-109444
Pick-to: 6.5 6.6
Change-Id: I96a2120ba1a2b03125661cc829498653e37dfb0f
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
When constructing a QWeakPointer<T> from a rvalue QWeakPointer<X>,
even if X* is convertible to T*, actually doing the conversion
requires access to the pointee's vtable in case of virtual inheritance.
For instance:
class Base { virtual ~Base(); };
class Derived : public virtual Base {};
Now given a `Derived *ptr`, then a conversion of `ptr` to `Base *` is
implicit (it's a public base), but the compiler needs to dereference
`ptr` to find out where the Base sub-object is.
This access to the pointee requires protection, because by the time we
attempt the cast the pointee may have already been destroyed, or it's
being destroyed by another thread. Do that by going through a shared
pointer. (This matches the existing code for the converting assignment.)
This requires changing the private assign() method, used by QPointer, to
avoid going through a converting move assignment/construction, because
one can't upgrade a QWeakPointer tracking a QObject to a QSharedPointer.
Given it's the caller's responsibility to guard the lifetime of the
pointee passed into assign(), I can simply build a QWeakPointer<T> and
use ordinary (i.e. non-converting) move assignment instead.
Change-Id: I7743b334d479de7cefa6999395a33df06814c8f1
Pick-to: 6.5 6.6
Fixes: QTBUG-117483
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
When using css the size for the sort indicator is not honored correctly
and therefore the header view text overlaps the sort inidcator.
This patch reduces the available with for the text when (and only when)
there is a sort indicator shown), also for the size hint.
Fixes: QTBUG-115486
Pick-to: 6.6 6.5
Change-Id: Ic865bceaf98cd303490d821ecfb033abb8d6ba2a
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
Fix the code snippets to match the Qt coding style.
Change-Id: Id65d2253e620d217fa3ada7b82e28f4939336543
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
Don't use QMap for parsing. Indroduce local enum and use it with std::array
Change-Id: I60fed6991ac415e4ff3827ae621f2c9b5071dcbe
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
Reuse the existing QList container, but instead of holding
QAbstrictItemModel* now it holds a
struct{model,std::array<Connections>}.
Use std::array since the number of connections is known at compile time.
Drop the _q_ prefix from method names, it was used to mark them as being
used in Q_PRIVATE_SLOT().
This is similar to c609b8dba0, so a
similar performance improvement is expected.
Drive-by change, fix narrowing by using qsizetype instead of int in
a for-loop.
Change-Id: Iac70dcbff0a949c72daa6dae52e3f752c2ee0557
Reviewed-by: David Faure <david.faure@kdab.com>
to avoid needless tmp list
Change-Id: I5f6bc9c3edd17c04e5293feb0aad86cd5ed49695
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
for making url to improve readability
Change-Id: I743f183b64f2ed9c9363ea4fd2bdb8588fd84547
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
- use range based for more
- replace QSL with _s
Change-Id: I81b41d674e5976a62a52955abdb55c1f208a90cd
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
QAbstractItemView installs the delegate as an event filter on the
editor, so the delegate will get the focusOut event (and other
events) before the editor does. QAbstractItemDelegate will then
emit commitData, signaling that the "updated" data should be
written back to the model.
In the case where the editor of a delegate (QAbstractItemDelegate)
is a QSpinBox with keyboardTracking set to false, the value of
the spinbox won't be updated while typing, but only when the
spinbox's text edit focus is lost. In this case, the delegate's
commitData will be emitted before the spinbox has had a chance
to update the value in its handling of the focusOut event.
To fix, make sure to update the value before the data is
committed to the model in the delegate's tryFixup method.
Fixes: QTBUG-116926
Pick-to: 6.5 6.6
Change-Id: I68540964342407d23387e4404a0fe3f00d80eb5f
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
While this platform plugin does not have full multi-screen support,
it at least has the ability to choose the one to use via env.vars.
This currently does not work. What's more, it looks like it chooses
the last display by default, instead of the first.
Fix the display/display-mode logic. This now allows QT_VK_DISPLAY_INDEX
to work correctly, for example on a RPi4 with two screens connected.
Fixes: QTBUG-117416
Change-Id: Ia5ac8fde5827b3a2e1945e8e4f04fb8dd90704e2
Pick-to: 6.6 6.5
Reviewed-by: Christian Strømme <christian.stromme@qt.io>
Reviewed-by: Kristoffer Skau <kristoffer.skau@qt.io>
It is impossible to see otherwise what is going on.
What's worse, it prints the screen geometry (that does not
include the virtual desktop adjustment), which is incredibly
confusing.
Change-Id: Ie67a4d8110a0b5c9cb75e6290f06c857a980d2c8
Pick-to: 6.6
Reviewed-by: Christian Strømme <christian.stromme@qt.io>
Because it's a validation error with old ones, but required
in some cases from 1.3.216 on (MoltenVK). Ridiculous.
Amends 7fbc741d10 and
b018bc6e2d.
Fixes: QTBUG-117412
Pick-to: 6.6 6.5
Change-Id: I9b4cacbe611d4e557ee1c156527142eb919d6b77
Reviewed-by: Christian Strømme <christian.stromme@qt.io>
If a move-to-trash operation failed, e.g. because the file was opened by
another process (or QFile), then the moveToTrash function would still
return true.
MSDN documents the IFileOperation::PerformOperations to return whether
the operation succeeded, but evidently this is only a statement about
the execution of queued up operations, not a statement about any of the
operations' success.
If the operation succeeded is reported by an HRESULT parameter
of the IFileOperationProgressSink::PostDeleteItem implementation,
and we ignored that parameter so far.
Check it via the SUCCEEDED macro, and set a boolean sink variable based
on that, which we can inspect to return the correct value.
Augment the test case by opening those files we create ourselves, and
if that fails (which it will on Windows, but not necessarily on other
platforms), then try again after closing the file. If the first attempt
succeeded, then the source file must also be gone.
Pick-to: 6.6 6.5 6.2 5.15
Fixes: QTBUG-117383
Done-With: Thiago Macieira <thiago.macieira@intel.com>
Change-Id: Icb82a0c9d3b337585dded622d6656e07dee33d84
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
We can't use QFileSystemEngine::fillMetaData() because there's no bit in
QFileSystemMetaData to indicate the sticky flag, so we must make a at
least one stat() or lstat() call ourselves. Given that we need to know
if $root/.Trash is a symlink, that system call must be lstat(). And it
turns out that system call provides everything we need to confirm its
suitability.
This avoids QDir overhead just to manipulate strings.
Pick-to: 6.6
Change-Id: I9d43e5b91eb142d6945cfffd1786c5e54199ecb2
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
d026fad3d9 added converting constructors
for QPointer. This however made converting _assignments_ ambiguous,
introducing a regression for users coming from Qt < 6.6.
This code:
QPointer<Base> base;
QPointer<Derived> derived;
base = derived;
used to convert `derived` to `Derived *` (using the implicit conversion
operator from `QPointer<Derived>` to `Derived *`), and then the
assignment operator for `QPointer<Base>` that took a `Base *`.
The introduction of the conversion constructor in 6.6 makes it possible
to convert `QPointer<Derived>` to `QPointer<Base>`, and then fall back
to the compiler-generated assignment operator for `QPointer<Base>`.
The result is that the code above is now ambiguous and stops compiling.
Fix this by adding a converting assignment operator for QPointer.
I'm only adding the const-lvalue overload because the implementation
requires going through the private QWeakPointer::assign helper. We
cannot copy-assign or move-assign the inner QWeakPointer, as those
assignments require lock()ing the QWeakPointer and that's not possible
on a QObject-tracking QWeakPointer (but cf. QTBUG-117483).
Assigning from a rvalue QPointer would mean calling assign() on
the internal QWeakPointer _and_ clear the incoming QPointer,
and that's strictly worse than the lvalue overload (where we just call
assign()).
Change-Id: I33fb2a22b3d5110284d78e3d7c6cc79a5b73b67b
Pick-to: 6.6 6.6.0
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
QObject::disconnect(connection) already sets connection.d_ptr to
nullptr, and the default constructor only does that:
QMetaObject::Connection::Connection() : d_ptr(nullptr) {}
So calling disconnect() suffices in this case.
Pick-to: 6.6 6.5 6.2
Change-Id: Icd5f9a15c83939eeecd9efb474ac3b38c0f2dfe4
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
To follow latest Play Store requirement.
Pick-to: 6.6.0 6.6 6.5
Fixes: QTBUG-112637
Change-Id: I1ef4f8b639f4b0cc759a2363b7b9b9864b159509
Reviewed-by: Ville Voutilainen <ville.voutilainen@qt.io>
It was used twice, in both cases to create a QFileSystemEntry, so the
two results were equal. Therefore, just use the first result to create
the second.
Pick-to: 6.6
Change-Id: I9d43e5b91eb142d6945cfffd1786d45d20485f40
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
We have other variables whose name start with 'info' in this function,
so infoPath is misleading: it's not the path to infoFile and it isn't
related to the infoFileName. Instead, it's the path to the file being
trashed which will be saved in the info file.
Pick-to: 6.6
Change-Id: I9d43e5b91eb142d6945cfffd1786d358a0e02dfd
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
QDir::mkdir() followed by QFile::setPermissions() is a race condition
because an attacker could enter the directory before we set the
permissions. QDir::mkdir() got an overload with the permissions in 6.3,
but I decided to go a level lower and use QFileSystemEngine directly
here.
Pick-to: 6.5 6.6
Change-Id: I9d43e5b91eb142d6945cfffd1786c338e21c129e
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
The project has been superseded by Qt for WebAssembly and was
never supported in Qt 6.
Pick-to: 6.6 6.5
Change-Id: I36682cfe3ce6adac76a307b0faba97dcb7c655cc
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Android APIs use integer constants like enum values, so they are mapped
to one of the integeral types (jint, jshort, jlong etc) on the C++ side.
Enable C++ code to declare an equivalent enum (scoped or unscoped), and
to use that enum as a type in JNI calls by treating it as the underlying
type in the signature() generator.
Add a helper type trait that maps enums to their underlying type and
other integral types to themselves (we can't use std::underlying_type_t
on a non-enum type). Add tests.
Note: Java Enums are special classes with fields; this change does not
add any special support for those.
Change-Id: Iec430a1553152dcf7a24209aaebbeceb1c6e38a8
Reviewed-by: Petri Virkkunen <petri.virkkunen@qt.io>
Reviewed-by: Zoltan Gera <zoltan.gera@qt.io>
Reviewed-by: Juha Vuolle <juha.vuolle@qt.io>
For some reason mdls fails to resolve the kMDItemVersion for Qt
Creator in some cases, even if the Info.plist has the required
version keys, and the version shows up fine in Finder.
Work around it by manually reading the version from the Info.plist
Fixes: QTBUG-117204
Change-Id: I60d57fb728608e139a4540fabf1006fc2681d0a7
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
If loading the lldbbrige fails, we'll continue on to the next
Qt Creator version if we find one. It makes more sense to report
that we're about to load from a given version, so that any error
messages from lldbbridge are output with that context in place.
Change-Id: Icbab6f7d39333ce76d729fd0769cfdb44f05a2f0
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
When the raster window is resized, we need to resize the backingstore,
and make sure we repaint the entire window. We defer the backingstore
resize to beginPaint, in case multiple resize events come in before
we have a chance to paint, but we can't defer the invalidation of the
paint device window, because QPaintDeviceWindowPrivate::paint() has
already subtracted the paint region from its dirty region at this
point. Invalidating yet again will result in the dirty region of
window not clearing fully until after the final resize, and when
that happens we will also repaint the window with the wrong dirty
region, based on the window's original size.
My moving the window invalidation to the resize event, while keeping
the deferred backingstore resize we avoid this problem.
Pick-to: 6.5 6.6
Change-Id: I44662778f5b1bcd259b20ca86124e6487561ef4f
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
If there is a reason to static_cast to `const QAIM*` then cast away the
const, I failed to see it. QObject::sender() returns a non-co.
Change-Id: Ibf8c8613c3de1584b426269c1ffba94db75d26d6
Reviewed-by: David Faure <david.faure@kdab.com>
The message processing may finish before watcherHelper is
setup. Use locking and an additional check for message
processing completion to avoid the race condition.
Move the code to new function inside QDBusPendingCallPrivate,
close to where the waiting without GUI is done.
Add assertions that check that watcherHelper is not overwritten.
Change-Id: I24e54598135edf293c41b3a80369b0a3b46f775c
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
- Fix punctuation and link errors.
- Make wording more consistent.
Change-Id: I5954a5c3129fdaf524918b2f1c60cc510374c505
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
In member function ‘virtual QDpi QXcbScreen::logicalBaseDpi() const’:
qxcbscreen.h:139:42: note: parameter passing for argument of type
‘std::pair<double, double>’ when C++17 is enabled changed to match C++14 in GCC 10.1
QDpi logicalBaseDpi() const override { return QDpi(96, 96); }
It's not possible to silence this warning/note using pragmas.
Pick-to: 6.6 6.5 6.2
Change-Id: I913a1753ce0c82ac17951faa58b0a88bf1daa4db
Reviewed-by: Ville Voutilainen <ville.voutilainen@qt.io>
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
Fix the use case where the application recreates the
QApplication object while reusing the html container
element. This would cause an error:
Uncaught DOMException: Failed to execute 'attachShadow' on
'Element': Shadow root cannot be created on a host which
already hosts a shadow tree
It looks like there is no way to remove a previously
attached shadow root, which means we can't return the
container element to its initial state if we attach
to the user-provided container element.
Fix this by introducing an intermediate element which
we can remove() in the QWasmScreen destructor.
Pick-to: 6.6 6.5
Change-Id: I929393a498b0440390a3e2c1774a3cac3a5a7e79
Reviewed-by: Piotr Wierciński <piotr.wiercinski@qt.io>
Reviewed-by: Lorn Potter <lorn.potter@gmail.com>
The snippets from the files were used in the QXmlDefaultHandler
documentation that got moved to qt5compat in Qt 6 (commit
79e0374143).
Change-Id: I11f19c8b2c5f693e203925bd2b19cff8d3380580
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
The files generated by syncqt should land not only in module include
directory, but also in framework directory. Before syncqt made two
copies of the generated files one in staging directory and the second
one in module framework directory. This commit moves all logic related
to framework header files to cmake scripts. This is done for both
consistency and simlifying the logic. The whole module .syncqt_staging
directory is copying to the framework library in cmake.
[ChangeLog][Tools][syncqt] '-framework' and '-frameworkIncludeDir'
arguments were removed. The related logic is moved to cmake scripts.
Task-number: QTBUG-116483
Pick-to: 6.6 6.5
Change-Id: If79c5470d2ab51eb7fc083bce6fb01858bed76ba
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
It seems to have fallen prey to the mass-deprecation of <QtAlgorithms>
in Qt 5.2. Since it didn't actually duplicate STL functionality, that
was uncalled-for: Unlike std::swap(), it's ADL-enabled, so the docs
were wrong to suggest replacing it with std::swap instead.
In fact, the tony-table that 5957f245c6
added to qalgorithms.qdoc didn't include qSwap(), yet, qSwap() was
marked as deprecated.
Un-deprecate and expand the discussion to more faithfully represent
its value, without going into the depths of teaching how to swap
correctly in C++ (link to boost.org and cppreference.com for that
instead).
Remove the example that used qSwap() on doubles, which is precisely
_not_ how you should use it.
Amends 5957f245c6c77c98d7e90d614c9fe2cdbfe7e8e6(!).
[ChangeLog][QtCore] Un-deprecated qSwap().
Pick-to: 6.6 6.5 6.2 5.15
Change-Id: I4981005ba71b0d1824f2a46897145255fa66a7ea
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
<QMessageBox> is not a (separately documented) header. QDoc
therefore puts the documentation on a separate proxy page:
https://doc.qt.io/qt-6/qmessagebox-proxy.html
Fix this by actually linking to the type.
This amends 95a3f85a2f, which moved the macro from
QtGlobal to QMessageBox.
Pick-to: 6.5 6.6
Change-Id: Ia2ed3d9fd786732c85d731634ff79afefe42333b
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
Equivalent to get/setStaticField.
Add a test, and tighten up the surrounding test code a bit.
Change-Id: Ic0993c5d6223f4de271cb01baf727459b5167f94
Reviewed-by: Tinja Paavoseppä <tinja.paavoseppa@qt.io>
Reviewed-by: Petri Virkkunen <petri.virkkunen@qt.io>
Reviewed-by: Zoltan Gera <zoltan.gera@qt.io>
Template functions don't permit partial specialization, e.g. we cannot
specialize typeSignature() to return an array signature for any
std::vector or QList type. We need to do that for better array support,
so move those functions as static members into a template class, which
then can be specialized.
Since submodules are both calling and specializing typeSignature and
className as template functions, keep and use those until the porting is
complete.
Change-Id: I74ec957fc41f78046cd9d0f803d8cc9d1e56672b
Reviewed-by: Petri Virkkunen <petri.virkkunen@qt.io>
Reviewed-by: Zoltan Gera <zoltan.gera@qt.io>
Reviewed-by: Tinja Paavoseppä <tinja.paavoseppa@qt.io>
The type lives in the QtJniTypes namespace, which is where types end up
that are declared through the Q_DECLARE_JNI_CLASS/TYPE macros. Having a
String type in that namespace prevents us from declaring the Java String
class as a QtJniTypes type, which is silly.
Perhaps this type becomes obsolete at some point with std::string being
a constexpr type in C++23, but until then we need it. It has no ABI, so
renaming it us safe.
Until submodules are ported, leave a compatibility alias String type,
which also prevents us from declaring a String JNI class in tests until
the alias is removed in a later commit.
Change-Id: I489a40a9b9e94e6495cf54548238438e9220d5c1
Reviewed-by: Zoltan Gera <zoltan.gera@qt.io>
Reviewed-by: Tinja Paavoseppä <tinja.paavoseppa@qt.io>
Reviewed-by: Petri Virkkunen <petri.virkkunen@qt.io>
Amends 4f4a8e75ab, after which
QItemSelectionModel printed a warning when destroying the model.
We reset the selection model in response to the model getting destroyed,
and since the model is already set to be nullptr at this point the
select() function complains about changing the selection with no model
set being a no-op.
Fix this by not calling reset() when the model gets destroyed - the
stored selection and currentIndex are already reset at this point -
and instead only call reset() when a new model is set in initModel.
Fixes: QTBUG-117200
Pick-to: 6.6.0 6.6 6.5 6.2
Change-Id: I12fc6b3fb2f2ff2a34b46988d5f58151123f9976
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
If the QCommandLineOption doesn't have a valueName, the parser won't
read the argument, therefore returning an empty value. If the developers
are calling ::value on the option, they clearly think it's expected to
get a value but won't ever be getting one, so we better warn them about
it.
Change-Id: I434b94c0b817b5d9d137c17f32b92af363f93eb8
Reviewed-by: David Faure <david.faure@kdab.com>
It's been available since C++17, and since we compile the trait
anyway, using it will probably speed up instantiation of qSwap()
(didn't test, just guesstimating).
Change-Id: If77ca71a8021a73edf4864bdd9e5fce517dcabb1
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
The qSwap() function needs std::swap, so include <utility> manually
instead of relying on transitive includes.
Pick-to: 6.6 6.5
Change-Id: If1331e1eabb55542eac7477522a8e906efb5379f
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
Just "QSWAP_H" is a bit meager to be unique. We don't really have a
monopoly on q-prefixed function and header names, there's the C std
function qsort(), e.g...
So use a somewhat more unique name as header guard.
Pick-to: 6.6 6.5
Change-Id: I554fa224afcb6858b752e8044ef3c03dfc69c084
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Ahmad Samir <a.samirh78@gmail.com>
It's now documented in qswap.qdoc.
Amends 9c706e2567.
Pick-to: 6.6 6.5
Change-Id: If6138df419dee165e9f1de4c0a0d68af1dcfaa42
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
Rephrase hard-to-read sentence.
Replace 'integral type; with 'numeric type', as this seems
to be the terminology in the standard:
The type-specifier-seq of an enum-base shall name an integral type
Finally, no need to use \sa for a method that is mentioned right before.
Pick-to: 6.6
Change-Id: I543041e78cc09ccd58182db454880941592c74ae
Reviewed-by: Andreas Eliasson <andreas.eliasson@qt.io>
- Macros provide possibility to use enums in QML via QtNetwork QML module
Task-number: QTBUG-115056
Change-Id: I1ed96a7eb4b12681d16137528307fec6db5b016c
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
Fix shared libraries build error:
undefined symbol: _ZN16QNativeInterface7Private14QWaylandWindowD0Ev
We are declaring QWaylandWindow for all Q_OS_UNIX in
qplatformwindow_p.h, and must include the definition
as well.
Change-Id: I630538af475524659e9a476171994e600f2ec668
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
[ChangeLog][QtWidgets][QDockWidget] A floating dockwidget that doesn't
have the DockWidgetClosable feature flag set can no longer be closed by
a call to QWidget::close or a corresponding keyboard shortcut (such as
Alt+F4).
Fixes: QTBUG-116752
Pick-to: 6.6 6.5
Change-Id: I7859a2eed11f0e4ee013f7f56611e282e9bcae9a
Reviewed-by: Santhosh Kumar <santhosh.kumar.selvaraj@qt.io>
Reviewed-by: Doris Verria <doris.verria@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
[ChangeLog][CMake] Added variable QT_I18N_NATIVE_LANGUAGE to specify the
native language that is used in the source code for translatable
strings.
[ChangeLog][CMake] Added keyword I18N_NATIVE_LANGUAGE to
qt_standard_project_setup to conveniently set QT_I18N_NATIVE_LANGUAGE.
Task-number: QTBUG-115845
Change-Id: I079256507685afe5eccda78beffff819292494bf
Reviewed-by: Amir Masoud Abdol <amir.abdol@qt.io>
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Some graphics drivers do only create a surface with the help of
gbm_surface_create_with_modifiers and others do require to use
gbm_surface_create. So it is needed to probe these.
Change-Id: I9ea657f12f2ea23ec426a378cfd67e297cb2d310
Pick-to: 6.5 6.6
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
The custom matching function was added in 4d4857027db3 with the rationale
that people were mixing up Key_hyphen and Key_Minus all the time, and
tried to solve it by treating the two as one and the same in the match
function.
Unfortunately this doesn't work in practice, as when a keyboard event
comes in we resolve a set of possible key sequences from that, and then
look those up in the list of sorted shortcut sequences. That lookup
is just a binary search, and does not take into account the added
logic of the custom matching function. So the binary search will fail
to find the matching key sequence, and as a result we never get a chance
to call matches() with a potentially malleable key sequence (for example
Qt::Key_Minus when the shortcut is Qt::Key_hyphen or vice versa).
The only case we do hit the matches function is if we by chance happen
to land the binary search iterator on the "unmatched" shortcut, e.g.
Qt::Key_hyphen, but this relies on there not being any other shortcuts
that sort between Qt::Key_Minus and Qt::Key_hyphen.
Task-number: QTBUG-116873
Change-Id: Iaa90991911f32276e29e37e8c7ae87643898bfc9
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
The state machinery of QShortcutMap is complicated enough as it is,
so let's use better variable names. In particular, let's distinguish
the registered shortcuts (QShortcutEntries), from the candidate
QKeySequence sequences that we compute based on the incoming events.
Task-number: QTBUG-116873
Change-Id: I9bd59097e786ecfb9d241c2eb7b871a4bba9b44f
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Since the interface was introduced as \preliminary in commit
9d16d5e224, everything mentioned
as required to make it a publicly documented interface has been
implemented:
1. An a11y bridge for macOS/VoiceOver was implemented in
98e4e992fe
2. An a11y bridge for Windows/UI Automation was implemented in
4f9c66131d
3. An a11y bridge for linux/AT-SPI was implemented in
ece2feee03
4. QAccessibletable implements the interface
(see 092bbc9ad3) and
an implementation in QAccessibleTabBar is pending in
Gerrit
[ChangeLog][QtGui][QAccessibleSelectionInterface] The
QAccessibleSelectionInterface that was added as preliminary in Qt 6.5
is no longer preliminary. Exposing selection to assistive technology
can be achieved by implementing this interface.
Change-Id: Ic6fbc67ada32122da58ce94fa0581a27ecb2ac48
Reviewed-by: Liang Qi <liang.qi@qt.io>
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
When loading the fonts, we go through all the named instances
and register these as subfamilies. In addition to exposing these
variants by style name, we also register them with the according
weights, italic style and stretch. This adds a field to FontFile
to allow piping the instance index through to when we instantiate
the face.
[ChangeLog][Fonts] Added support for selecting named instances in
variable application fonts when using the Freetype backend.
Task-number: QTBUG-108624
Change-Id: I57ef6b4802756dd408c3aae1f8a6c792a89bee6a
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
The logic was a bit convoluted, using a do-while loop when the
base premise still was that we needed a valid iterator, and
hiding the check of a QKeySequence::NoMatch to break out of
the loop far from the match() that produced it.
The tempRes (now match) variable no longer has to live outside
the loop, and the oneKSResult variable has been renamed to
clarify its use.
Task-number: QTBUG-116873
Change-Id: I730e768eae2e9a653bf4e28ceece2fe7277ef45d
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Reviewed-by: Andrey Butirsky <butirsky@gmail.com>
This makes it source compatible with Qt 6.5 by allowing us to change
FastType to something other than float, which we have done for Qt 6.6 on
systems with AVX float16 instructions.
Pick-to: 6.6 6.6.0
Change-Id: I7ebf0c178ba0ff7f04f6788d182a1a000fe31c0c
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
This prevents the use of the one-arg-to-two-arg adapter template which
we'd remove rather sooner than later, because it's causing all sorts of
problems, but probably can't, until Qt 7.
Pick-to: 6.6
Task-number: QTBUG-116074
Change-Id: I5907da0dc8c01b636d16dcc01e9c808ab9a85081
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
There were multiple documented functions with \relates <QtTypeTraits>,
but the header file itself was not documented. QDoc still created a
proxy page for the header, but the information on it was incomplete;
for example, deprecated functions were omitted.
Pick-to: 6.5 6.6
Fixes: QTBUG-116349
Change-Id: Ic4334a43f72bb8a358cee7537a282495e4a046c6
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
The XML stream writer previously added namespace declarations with the
same URL as existing ones, but new names, and renamed the XML elements
to use the new namespaces instead of the existing ones.
[ChangeLog] Fix renamed and duplicated namespaces in QXmlStreamWriter.
Pick-to: 6.5 6.6
Fixes: QTBUG-75456
Change-Id: I90706e067ac9991e9e6cd79ccb2373e4c6210b7b
Done-With: Philip Allgaier <philip.allgaier@bpcompass.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Minor cleanup that enables us to change the actual type in some of the
wrapper functions, so that we can implicitly convert a QString to a
jstring.
Change-Id: I2acc99c656231b302269fae439cf3dd49278f09a
Reviewed-by: Zoltan Gera <zoltan.gera@qt.io>
Reviewed-by: Petri Virkkunen <petri.virkkunen@qt.io>
Reviewed-by: Tinja Paavoseppä <tinja.paavoseppa@qt.io>
Java arrays are always objects, also if they don't contain objects.
Pick-to: 6.6
Change-Id: I376c9cc39445d7d9aaac093e4cd6995c8322ed0d
Reviewed-by: Petri Virkkunen <petri.virkkunen@qt.io>
Reviewed-by: Tinja Paavoseppä <tinja.paavoseppa@qt.io>
Reviewed-by: Zoltan Gera <zoltan.gera@qt.io>
This removes the dependency from QJniObject to QtJniTypes, and allows us
to add more useful helpers to types declared through the macros, as we
can rely on QJniObject being fully declared.
Note: this is all undocumented API, so fine to change even though it
currently lives in a public header.
Change-Id: I07478ecb80ae166d619a09aed6820f680afed31b
Reviewed-by: Tinja Paavoseppä <tinja.paavoseppa@qt.io>
A function not being available if the parameter list doesn't meet the
requirements results in much better error messages than a function not
compiling (somewhere deep in the call tree, potentially) because of it.
Change-Id: If2c320736083a385232cc72f608bc4d61025627c
Reviewed-by: Juha Vuolle <juha.vuolle@qt.io>
Reviewed-by: Petri Virkkunen <petri.virkkunen@qt.io>
Reviewed-by: Zoltan Gera <zoltan.gera@qt.io>
Reviewed-by: Tinja Paavoseppä <tinja.paavoseppa@qt.io>
The QVariant(QMetaType) constructor is a major anti-pattern: unlike
*every* other QVariant's constructor, it doesn't build a QVariant
holding the QMetaType object, but a QVariant of the specified type.
Introduce a named constructor for this use case instead.
In principle, this should lead to a deprecation of the QMetaType
constructor... except that it's used everywhere, so I can't do it at
this time.
Drive-by, improve the documentation of the QVariant(QMetaType)
constructor (since it's basically c&p for the new fromMetaType
function).
[ChangeLog][QtCore][QVariant] Added the QVariant::fromMetaType named
constructor, that builds a QVariant of a given QMetaType.
Change-Id: I4a499526bd0fe98eed0c1a3e91bcfc21efa9e352
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
The class name was wrong.
Task-number: QTBUG-100236
Change-Id: I0ffd163bf59682d8326feefb76a4cd8b7e106105
Reviewed-by: Ahmad Samir <a.samirh78@gmail.com>
Reviewed-by: Øystein Heskestad <oystein.heskestad@qt.io>
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
That we have two macros to declare a C++ type to represent a Java class
is confusing. The TYPE macro as of now allows us to declare array types,
but with QJniArray we won't need that anymore, and can just use Class[]
as the type instead. Changing that will be a follow-up commit; for now,
get rid of TYPE-usages to declare regular classes.
Change-Id: Iea0a9548772ca701148442412cf6ad567583213f
Reviewed-by: Zoltan Gera <zoltan.gera@qt.io>
Reviewed-by: Petri Virkkunen <petri.virkkunen@qt.io>
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
When calling the (old and outdated) variadic argument overloads of
callMethod (as opposed to the variadic template overloads), then we
cannot pass complex types.
That types declared via the Q_DECLARE_JNI_CLASS macro are trivial was an
implementation detail that we shouldn't rely on as long as those types
are not part of the public API. Cast explicitly to jobject so that we
can make those types proper QJniObjects.
Updating this code to use the new variadic template overloads is for a
follow-up commit.
Change-Id: Ia9d610c84de6f989ef957c23401b1cbc64d2d1ef
Reviewed-by: Petri Virkkunen <petri.virkkunen@qt.io>
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
As a drive-by, fix style by adding a whitespace after flow-control
keywords `if constexpr`.
Change-Id: I4e1153edc6f9ee903c7620772c12c411c33e90c6
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
Reviewed-by: Petri Virkkunen <petri.virkkunen@qt.io>
[ChangeLog][CMake] Added variable QT_I18N_LANGUAGES to specify the
languages that are used for i18n in the project.
[ChangeLog][CMake] Added keyword I18N_LANGUAGES to
qt_standard_project_setup to conveniently set QT_I18N_LANGUAGES.
The call
qt_standard_project_setup(I18N_LANGUAGES hi ho)
sets the variable QT_I18N_LANGUAGES.
The target finalizers use this variable to set up CFBundleLocalizations
on Apple platforms.
qt_add_translations will be extended to read QT_I18N_LANGUAGES as well
to determine the names of .ts files if TS_FILES is not given.
Fixes: QTBUG-116716
Change-Id: I76f0753d10efb9c32947d9239e43382c9d85eb51
Reviewed-by: Amir Masoud Abdol <amir.abdol@qt.io>
When adding the D3D12 code path in widgets it seems it was ignored that
the retry-with-WARP logic was present both for D3D11 and 12 in Qt Quick.
For consistency, the same logic must be used. Right now widgets only has
the retry logic for D3D11.
Pick-to: 6.6
Change-Id: I08d5728acfb9a68db7e0a4b0477050f08546ffac
Reviewed-by: Christian Strømme <christian.stromme@qt.io>
The patch adding the function unexpectedly made it into 6.5 before
6.5.3 was forked off. That's nice, as it reduces the number of
releases with a broken implementation, but the documentation and
ChangeLog were written assuming a merge for 6.5.4.
Fix the documentation.
Amends 6da6a17de9.
[ChangeLog][Editorial][QtCore] Delete the old entry for
qHash(qfloat16), keep the one from this commit.
[ChangeLog][QtCore] Fixed qHash(qfloat16) which was broken from 6.5.0
to 6.5.2, inclusive. If you compiled against one of the affected Qt
versions, you need to recompile against either Qt 6.4 or earlier or
6.5.3 or later, because the problematic code is inline.
Pick-to: 6.6 6.6.0 6.5 6.5.3
Task-number: QTBUG-116064
Task-number: QTBUG-116076
Change-Id: If8fa35fb8532cf0bbf2ba0438694d95fd9bd6991
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
This was erroniously removed in a previous change.
Pick-to: 6.6 6.5
Change-Id: Ia62327bea7e3d190503a0eb05217c0f780f4fe9a
Reviewed-by: Antti Määttä <antti.maatta@qt.io>
Amend 543ae6e6a4 and add include
for dev_t. Needed with MUSL.
Change-Id: Ie7a2ac902af6d34307bf7856619eb9617bf3307f
Reviewed-by: Ahmad Samir <a.samirh78@gmail.com>
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
Behaving differently in QQuickWindow vs. a QRhi-based widget
window is not great for WebEngine. The env.var naming is not
the best (QSG prefix) but we already have some precedent for
this (recognizing QSG_INFO in QRhi), and there is no other
choice anyway.
Pick-to: 6.6 6.5 6.6.0 6.5.3
Task-number: QTBUG-116445
Change-Id: Ibfd495cbd1d42502441d6629325bdeb033e813f3
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
The about / aboutQt statics in QMessageBox used a non-native, non-modal
dialog box on all operating systems. This creates a grid layout with
labels for heading, text and icon.
This has two unwanted side-effects on iOS:
- When the screen size is not sufficient to display all text, the text
is not rendered. On an iPhone SE for example, only the Qt icon is visible.
- When the screen height exceeds the minimum requirement, the informative
text is bottom-aligned.
=> Show about(Qt) message boxes in a modal, native dialog.
=> Update documentation.
This partly reverts aafed07dee.
[ChangeLog][iOS] QMessageBox::about(Qt) now shows native, modal dialog.
Fixes: QTBUG-115832
Pick-to: 6.6 6.5 6.2
Change-Id: I4cfbce416e7d2717058bef9a050a85d424b8a03d
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
The state property is read-only, meaning that it can only be modified
from the class internals. At the same time, the public start(), stop(),
pause(), and resume() methods, as well as a private setState() method
can be called from other property setters, thus creating an unwanted
dependency on state.
Fix it by using valueBypassingBindings() when reading the state.
Task-number: QTBUG-116346
Pick-to: 6.6 6.5
Change-Id: I404cd2141ea52b8ffed5edbb4261a535cd329ec2
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
This list is accessed by ~QDBusServerConnection in a user thead.
Task-number: QTBUG-116621
Change-Id: Ic115612b2a0f12fd9f69f38f4662dc36fffbf178
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Also lock before accessing serverObject member, it is cleared
by ~QDBusServer().
Task-number: QTBUG-116621
Change-Id: I14c96e34316a46fe43ecd929e44cd1800ba8b803
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
The solution from commit 3446313c7a didn't
work completely as expected. That commit the QOperatingSystemVersionBase
base class so we could add new static constexpr inline variables to
QOperatingSystemVersion in patch releases. We need a different base
class because you can't have constexpr variables of incomplete types and
the the type isn't complete inside its definition.
However, QOperatingSystemVersion is an exported class and there's an
unexpected interaction between __declspec(dllexport) / dllimport and
inline variables: they're imported from the DLL that exported them. For
Qt 7 we can remove this class's export, but not until then.
This commit adds to the fix by introducing a middle base class, so we
can add the static constexpr inline variables.
Pick-to: 6.6 6.6.0
Change-Id: Ifa1111900d6945ea8e05fffd177e0b696209c7af
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Fix potential nullptr access in
QNetworkConnectionEvents::getNetworkConnectionFromAdapterGuid().
This can happen if for some reason the NetworkListManager instance
failed to be instantiated in QNetworkConnectionEvents constructor.
Fixes: QTBUG-117097
Pick-to: 6.6 6.5
Change-Id: If51ea383e22461a6c3124576c4e1be3f30dde1f6
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
Let's find replaceable chars and then do copy
Change-Id: I2d365626218b0daf2023144dee7e901e8e99adc6
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
This is needed to support passing it to other processes so they can
enable legacy, compatibility mode. Right now, there's no such code, but
I am 90% certain we'll need it soon in 6.6.x, if not for compatibility
changes in the future.
There's a bug in passing a QNativeIpcKey to another process that causes
QSharedMemory to use the wrong QSystemSemaphore for control (a feature
that should never have existed in the first place, but we're 15 years
too late on that). I have not yet investigated a fix for this, but it
will likely involve knowing the original legacy key.
Pick-to: 6.6 6.6.0
Change-Id: Idd5e1bb52be047d7b4fffffd1750b547013cb336
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
So we can add them in the future but cause older versions of Qt to
reject them if they don't know what they are.
Pick-to: 6.6 6.6.0
Change-Id: I512648fd617741199e67fffd1782b85935bb832a
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
The original design was supposed to be small, at a single pointer, but
that never made it through, with the "QString key" member. So the
anonymous union for typeAndFlags overlapping with the extension pointer
was just unnecessary headache.
So separate the two. This means QNativeIpcKey's size increases from 4
pointers to 40 bytes on 64-bit systems and to 24 bytes on 32-bit systems
(so we have 6 unused bytes on both architectures).
Fixes: QTBUG-116821
Pick-to: 6.6 6.6.0
Change-Id: I512648fd617741199e67fffd1782b7d5ba5ddd12
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
There's no need to return QString, only to create the QNativeIpcKey
elsewhere, when nothing uses this intermediary QString (those two
functions aren't used in unit tests any more, since the two "IPC: add
native key support" commits (2c286561bb
and 3ae052d3bb). Since they aren't used in
the tests, we can remove the Q_AUTOTEST_EXPORT macro too and the
unnecessary default argument.
I'll need the ability to return QNativeIpcKey to store the original,
legacy key inside of it.
Pick-to: 6.6 6.6.0
Change-Id: Idd5e1bb52be047d7b4fffffd17506c05e4f61f79
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
When the operation fails we print a warning, but that warning does not
include the error message that prepareHook internally collects but
ignores.
Printing the error is useful for debugging.
Pick-to: 6.6
Change-Id: I946c4781942115a17ffd43a79bff7676b6674be1
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
It doesn't make sense to stream a pointer, but it can happen by
accident because ds << ptr will select the operator<<(bool) overload.
Disable the out-stream operator for pointers by having a better match.
Reading a pointer from a QDataStream doesn't work, as a pointer
can't bind to e.g. a bool non-const reference.
[ChangeLog][QtCore][QDataStream] Streaming of arbitrary pointers
using QDataStream has been disabled. Note that such streaming happened
through the streaming operator for bool.
Change-Id: I4c98a33b52aae85e441f5a096efd404fbbf1e95f
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
On some platforms, like Windows and Linux, calling resize() may
unexpectedly reset window state even when the actual size has not
changed. So, bail out early on QWindow::resize() if new size is the
same.
Task-number: QTBUG-115699
Change-Id: I64ad611044008964b5201951a50f3866e2108b49
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Reviewed-by: Jan Arve Sæther <jan-arve.saether@qt.io>
Also move some docs from asBackendZone() to systemTimeZone(), making
clear that the system zone object is current at the time of creation
and won't be updated if the system is reconfigured. Adapt some tests
to fail and make clear that the system is misconfigured if no valid
system zone is found.
[ChangeLog][QtCore][QTimeZone] If systemTimeZone() is unable to
identify a valid system time zone, it now produces a warning the first
time it encounters the problem.
Task-number: QTBUG-116017
Change-Id: Ia437d8a03ff3cbf2b2cd98e8a8c3aebe50c1ee32
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Amends commit 569dc0de50 to still return
when no zone file is found with the given name, as the code did
before. Attempting to continue past the error was provoking warnings
from QIODevice::read().
Pick-to: 6.6.0 6.6 6.5
Task-number: QTBUG-116017
Change-Id: I0e224a6b30a3f32cd925d87ffba4dcb24f9b8568
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Save some complicated computations using struct tm and (effectively)
time_t used in working out local-time's UTC offset and updating the
local time's representation in terms of seconds (since a nominal local
epoch). GLibc gives us the offset for free, making computation of the
seconds easy.
Use the same extension to catch an opportunity for a seldom-needed
early return in one more case.
When determining a zone's abbreviation, we can use tm_zone as a
short-cut to save some mutex-locking.
Change-Id: Id2958f75c1d49ad4aed8f9c483ec13f4fe3a86c2
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Africa/Monrovia violates that assumption. We can replace the tests
that relied on it with another, but only when we know the offset from
UTC (to come in later commits).
Change-Id: Iccc4f03f4e0e4087530cb5ca0c7d26ee4177d01e
Reviewed-by: Konrad Kujawa <konrad.kujawa@qt.io>
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
Ensure we do know about - and handle - transitions whenever one is
implicated. Make their handling more consistent between platforms
instead of depending on (and in some cases kludging around) quirks of
the underlying time_t functions.
Change-Id: Iefa8dda0d8da78b860e06cee895c9dd268d7a4e5
Reviewed-by: Konrad Kujawa <konrad.kujawa@qt.io>
The signal is not received when emitted from the destructor.
Pick-to: 6.6 6.5
Fixes: PYSIDE-2460
Change-Id: Ic2273c5b9ef1f53bd58615b6982016e646aee326
Reviewed-by: Adrian Herrmann <adrian.herrmann@qt.io>
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
QEDCF::processEvents makes copies of ProcessEventsState, which contains
atomics. The memory ordering semantics when those atomics are used
are not clear at all -- given the lack of comments in the code around
them, and the lack of named operations (e.g. loadAcquire).
In principle, it looks like relaxed ordering could even suffice.
However, I'm not confident in making such a change. For now, avoid a
direct copy (assignment) of the atomics themselves (those operations
are meaningless), and use very conservative semantics when copying
ProcessEventsState.
Change-Id: I8584ff3fe9fef52385bd438235ee823bdbab8a42
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
The command link button was shown in active color even when its disabled
while using windows vista style and the patch
e9cf618a9d further cause regression when
hovered over it.
This patch fixes it by setting color for corresponding color group in
windows vista style.
Pick-to: 6.6 6.5
Change-Id: I9a8f62f8c5895592571978ec7c9abccfc69e64a2
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
UniqueFontData has an atomic refcount internally. I guess this was
deemed necessary because font engines living in different threads may
call refUniqueFont / derefUniqueFont and the refcount has to be thread
safe. Those functions now are mutex protected (as they access the same
map), so we don't also need atomicity for the refcounter.
Change-Id: Ic223a12f4a61b7dcc567b3a5dcbe367eaa916004
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
[0]Qt::InputMethodHints has a flag ImhNoTextHandles that was not
handled. This flag should be considered when QAndroidInputContext is
updating Text handles position.
What is more, this flag can be used to fix the problem with visible
text cursor out of the text object.
[0]https://doc.qt.io/qt-6/qt.html#InputMethodHint-enum
Task-number: QTBUG-115005
Pick-to: 6.6 6.5
Change-Id: Ie50b77d7afbadfebe73f10137f09da9560aea1ba
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
Reviewed-by: Rami Potinkara <rami.potinkara@qt.io>
The documentation refers to it as \a ret, so call it ret rather than
just r.
Pick-to: 6.6 6.5
Fixes: QTBUG-116890
Change-Id: I12d8c3cfd33d5718d88794ca87bff996a27423ee
Reviewed-by: Safiyyah Moosa <safiyyah.moosa@qt.io>
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
whenAll() and whenAny() create a shared context object which is
referenced by the continuation lambda. The refcount of context is only
correctly managed when it is copied non-const to the lambda's
capture list.
Fixes: QTBUG-116731
Pick-to: 6.6 6.6.0
Change-Id: I8e79e1a0dc867f69bbacf1ed873f353a18f6ad38
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
The ipc_posix feature was OFF despite the following test values:
TEST_posix_shm ON
TEST_posix_sem ON
TEST_sysv_shm OFF
TEST_sysv_sem OFF
The 'NOT (TEST_sysv_shm AND TEST_sysv_sem)' part of the condition is not
correctly evaluated. Resolve the parentheses to work around this issue.
Pick-to: 6.6.0 6.6
Fixes: QTBUG-117052
Change-Id: Idac23d207f8dd644d059977ca41b6e32b17b3a49
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
When collecting plugins required for the android application according
to linked targets we should take into account all prefix directories.
But not only the first one. Otherwise the order we use when adding
paths to extraPrefixDirs will affect collecting of the plugins. This
specifically leads to the issue if the user project builds custom Qt
plugins. The plugin directory from user project build tree will be
found first and all plugins from Qt installation directory are
discarded.
Pick-to: 6.6 6.5
Fixes: QTBUG-116920
Change-Id: Id94ebaf5ccd1a279a74b38b59ff535f45230e1b4
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
When loading the font data, we had some unprotected reads. To harden
this, we check everything against the length of the font data
before reading.
[ChangeLog][QtGui][Windows] Fixed a possible crash that could happen
when loading corrupted font data.
Fixes: QTBUG-116773
Pick-to: 5.15 6.2 6.5 6.6 6.6.0
Change-Id: I156df3b8833c9ed785fcc690821a7a74d9a51126
Reviewed-by: Lars Knoll <lars@knoll.priv.no>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
QRawFont::loadFromData can be called from any thread. It calls into
QPlatformFontDatabase::fontEngine. The code path may end up creating a
UniqueFontData and storing it a QWindowsFontDatabase member (a QMap).
Two threads calling loadFromData (on different QRawFont objects)
will therefore race on the mutation of the map.
Add the missing mutex protection.
Change-Id: Ib38c2b3539679c820d997a6548e4b397cbc2bb73
Pick-to: 6.2 6.5 6.6
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
Use the iterator-based API, and avoid a quadruple (!) lookup into a
QMap.
I'm aggressively cherry-picking to avoid merge clashes with an upcoming
fix.
Pick-to: 6.2 6.5 6.6
Change-Id: I05968f4aec9e42f84f909a1103e43ba323a9544f
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Remove the empty destructor. Compiler-generated one is fine.
Change-Id: I1599b84a876ebd7ba22f63c545506feffc7b18bf
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
normally because new depedency of xcb-cursor0 or libxcb-cursor0 is
missing.
Pick-to: 6.6 6.5
Task-number: QTBUG-108796
Change-Id: I040e9c0932bbf1f9026b365ded462c7373b219b5
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
AppKit's built in logic for customizing menu entries, such as adding
text input (emoji, dictation) entries to the Edit menu, happens via
[NSApplication _customizeMainMenu], which is triggered either from
[NSApplication finishedLaunching], or [NSApplication setMainMenu:],
but in the latter case, only if the menu is different.
In our case, we might be re-using the same menu as before, but the
menu now has additional sub menus such as an Edit menu. In that case
we still want AppKit to do its magic, so we need to reset the main
menu temporarily to nil so that AppKit sees the menu as a "new" menu.
Pick-to: 6.6 6.5 6.6.0
Fixes: QTBUG-116903
Change-Id: Ibd9da72fb81b7cd1d707bd350a62d0c93356dbd4
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Compilers that support 128-bit integer types usually don't have
support for 128-bit literals, so provide Q_(U)INT128_C macros and back
them with UDLs. This, of course, only works in C++, so until compilers
provide built-in literals that support C, too, that's all we get.
[ChangeLog][QtCore] Added Q_INT128_C() and Q_UINT128_C() macros to
create qint128 and quint128 literals in a platform-independent way.
Pick-to: 6.6 6.6.0
Fixes: QTBUG-116822
Change-Id: I4be645baf2e007ee1aa1a27f9b5166671806dc49
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
The semantics of copying a ConnectionList are not defined; the type
is copiable by accident. Use a reference to the list instead (like done
in other places in the code).
Change-Id: Ifbc5d3baca992f3eb13e3781378e79ed1feb4e1c
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Disable copy and move for the class because it is polymorphic.
Make the constructor protected because instances of this
class are not supposed to be created directly.
Mark drived classes final.
Change-Id: Ia6f2d640f3642ad4a6ecb3830fba152155e237b3
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Use atomic pointers.
While at it, declare the function type with `using` instead
of a typedef for better readability, do the declaration
locally so that less preprocessor concatenation is needed,
use reinterpret_cast instead of C-style cast.
Change-Id: I5ed0d35b7ddfdd62ef6c12403fe7052019453f34
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
This avoids having direction member uninitialized by mistake. Make the
member variable const as it is never modified.
While at it, make Direction and enum class.
Change-Id: I53814ae9e1d6bcf786433674619145a1ee61e063
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Declare flags as QDBusConnection::ConnectionCapabilities
instead of bare int. Do the same for derived classes
QDBusMarshaller and QDBusDemarshaller. Make the constructors
explicit, replacing useless `inline` where it was used.
Make flags argument default to empty flags.
Change-Id: I6caedde06b2ef41d725f15348ee780d1cc20b355
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
For better readability and ease of modification.
Do the same for derived classes.
Change-Id: I9601f0b280feb5e3d0e71ed4a3405fdd9cca8dd2
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
There was no way to merge removal of properties which is required in
case you want to unset some property on the current selected text in a
text document. For example in case your text has font size set in pixels
and you want to change it to point size, that would be impossible before
this change. With this change you can set the font point size to what
you want and then set font pixel size to QVariant().
This is maybe not the most obvious way to do it but any other way I
could think of would require new api and quite some code duplication.
[ChangeLog][QtGui][Text] QTextFormat now allows setting properties to an
invalid QVariant to allow clearing properties via a merge. This changes
behavior slightly where code iterating over a QTextFormats properties
would never encounter invalid variants, which is now possible if
setProperty with an invalid variant was used instead of using the
clearProperty function to remove properties.
Change-Id: Ie8290088d457bf19d9c4785cfe91ae6a1de572c4
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
Better than two pointer parameters. However it can't be a return
value as we initially thought, it's an in/out parameter, in order to
compare the results in the current directory with those found in earlier
directories.
Change-Id: Ic6137f2627703f8d6930c3f7dd1a1102187eef30
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
This fixes the recently added QEXPECT_FAIL about glob-deleteall
in a local directory (with a binary cache). Before adding a glob match
we ask the more-local (higher-precedence) directories if they have
a glob-deleteall for that mimetype, and skip it then. This "asking"
is a virtual method, implemented for both XML and binary providers.
Change-Id: I6e4baf0120749f3331fd2d9254bea750a322b72d
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Follow up patch to 3c391c159ce0e29a9a654edee45bd64bcde6ccd2.
Pick-to: 6.6
Change-Id: I23235ae8516a53cf09c00b0daedc054df2f0cfa8
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
Change the title.
Remove the first \brief as there are two briefs in the document
so that the new title makes sense with the second brief in
"All Qt Examples" doc page.
Task-number: QTBUG-108860
Pick-to: 6.6 6.5
Change-Id: I1dec2ad107e3f9ff9b4203960ba54ae6d0d8c7b6
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
Reviewed-by: Jaishree Vyas <jaishree.vyas@qt.io>
Change the title.
Remove the first \brief as there are two briefs in the document
so that the new title makes sense with the second brief in
"All Qt Examples" doc page.
Task-number: QTBUG-108859
Pick-to: 6.6 6.5
Change-Id: I8b0370c9a85179e172918231ae48a3c52845bf21
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
Remove "Example" from the title.
Edit the link (title) to the documentation of Mandelbrot in QThread
documentation.
Delete the foreach related sentence as we are trying to port away from
this Qt pseudo-keyword.
Task-number: QTBUG-108861
Pick-to: 6.6 6.5 6.6.0
Change-Id: I6d04f24ac9c1fa1efe30a947c2da2ec7475edc80
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
Since https://gitlab.kitware.com/cmake/cmake/-/merge_requests/8570 introduces AUTOMOC to use depfile with the Makefile generators, the depfile usage can be enabled for them in qtbase.
Change-Id: Ie18460fd2c4703ad75eb88662445ebe961d4e895
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
On Linux / glibc, this overrides the default system location for the
zone info. So check for files there first. Break out a function to
manage the trying of (now three) zoneinfo directories when opening a
file by name relative to there.
Pick-to: 6.6 6.5
Task-number: QTBUG-116017
Change-Id: I1f97107aabd9015c0a5543639870f1d70654ca67
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Add a static runOnMainThread() function to QEventDispatcherWasm
which looks at QT_CONFIG(thread) and calls the correct
qstdweb overload. Then, we don't have to use a #define to
enable or disable the proxyingQueue argument.
Use the <void> version of qstweb::runTaskOnMainThread,
like before the 141f0ca33 change.
Change-Id: Id8324a17c27ffce8db7acf235ad4c9e465790e0b
Reviewed-by: Lorn Potter <lorn.potter@gmail.com>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Reviewed-by: Piotr Wierciński <piotr.wiercinski@qt.io>
Use the _L1 operator from Qt::Literals::StringLiterals
Pick-to: 6.6
Change-Id: I3d8dc0b7219879a1907e67b539e047ae7f7aae87
Reviewed-by: Piotr Wierciński <piotr.wiercinski@qt.io>
Reviewed-by: Mikołaj Boc <Mikolaj.Boc@qt.io>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
If using the ExtendsContentIntoTitleBar() method from the Windows App
SDK, the top margin becomes zero. The current approach does not account
for this, since it relies on the AdjustWindowRectExForDpi function.
Do a manual check after and correct if necessary, by comparing the
window and client sizes.
Fixes: QTBUG-113736
Pick-to: 6.6 6.5
Change-Id: I62e0338b3ff7af47f5525dcccd0f9acfe9691819
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
Reviewed-by: Wladimir Leuschner <wladimir.leuschner@qt.io>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
When the first QEglFSWindow got created for a QWindow, a backing store
was created with it and associated to the new QEglFSWindow. When the
window was hidden on the platform screen, the QEglFSWindow got deleted
and re-created when it was supposed to be shown.
The re-created QEglFSWindow was no longer associated to the backing
store. It was therefore not rendered on the screen.
=> ensure that the backing store is re-associated to the QEglFSWindow,
corrsponding to the QWindow argument passed to flush().
No autotest is added, because the fix is purely visual.
The widgets/menus example can be used to test the functionality
manually (see bug reports).
Fixes: QTBUG-115196
Fixes: QTBUG-116769
Pick-to: 6.6 6.5 6.2
Change-Id: I92ce2e8f7e76bd2d26e713a4d20612d079fb4717
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
Don't create tmp QBA, just append to QString directly
Change-Id: Ib7c469ef7b9b459fbc2df662adbe613c8d74d88a
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Notification of a conditional variable shouldn't be under the locked
mutex, as it may affect extra mutex contentions.
Pick-to: 6.5 6.6
Change-Id: Ie8429eca3f36e9a6e8e5ad2e0337bbf508f5b326
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
A QMimeTypePrivate used to belong to a single provider, which would
provide the complete data for it.
But since the redesign in commit 7a5644d648, each provider
represents is a single mime directory, and the merging happens at the
QMimeDatabase level. So we need a QMimeType[Private] to be just a name
(a "request" for information about this mimetype) and the information
for that mimetype is retrieved on demand by querying the providers
and either stopping at the first one (e.g. for icons) or merging
the data from all of them (e.g. for glob patterns).
The XML provider was using QMimeTypePrivate as data storage,
give it its own struct QMimeTypeXMLData for that purpose instead.
Task-number: QTBUG-116905
Change-Id: Ia0e0d94aa899720dc0b908f40c25317473005af4
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Using ints for the tags is not ideal. There is no type safe
way to do conversions from strings, and how the int corresponds
to the four-byte tag is not clear from the API, so user code
can end up being less readable due to this.
Especially since this type of tag is a data type used several
places in fonts, and we will need them again for implementing
support for variable axes, it's worth giving this an extra
round of polish.
Since it was not addressed in a timely manner and we don't want
this to delay the upcoming release, we mark the API as
preliminary for now, to give ourselves the option of changing it
to something.
Pick-to: 6.6
Fixes: QTBUG-116929
Change-Id: I498478785dcd5ece954151f01f1a017828d6b8b8
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
When painting an image with antialiasing not turned on, round the
target area to closest integers (pixels).
Task-number: QTBUG-116297
Pick-to: 6.6
Change-Id: I64e78a9087ee042aef0ea297c48b5ead36697d10
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
Reviewed-by: Tomi Korpipää <tomi.korpipaa@qt.io>
Since compilers don't provide such macros, do it ourselves.
In order to test these macros, add ad-hoc specializations of
QTest::toString() for qint128 and quint128 locally to the test. Turns
out it's not too hard to write them, so we might move them to a public
header, yet.
Pick-to: 6.6
Change-Id: I1483f3af2ccec6038e1c780649f9ffe413bb59ef
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Check that QIntegerForSize<16> and std::numeric_limits<quint128> work
and that q(u)int128 are available in C mode, too.
Pick-to: 6.6
Change-Id: I44af8282399c78f6e74a8268af53bad64407ca34
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Instead of checking that all the features be present if any of them are
-- which is not an acceptable proposition, because each of them were
productized in at least one processor before -- let's simply insist that
they all be present if AVX2 is. That's what we can guarantee: all AVX2-
capable processors are capable of:
- AVX and earlier SSE (architecturally implied, so not checked)
- BMI1
- BMI2
- F16C
- FMA
- LZCNT
- POPCNT
This restores the original set of features that were checked in commit
ad65bbe4c0 when this was introduced, but
only if AVX2 is set. It also POPCNT, which was introduced with the
Nehalem architecture (which matches x86-64-v2) but aren't implied by
AVX.
GCC's -march=x86-64-v3 implies CRC32, but -march=haswell does not
because there were SKUs lacking CRC32, AES and PCLMULQDQ. This is
probably a bug in GCC.
Fixes: QTBUG-116357
Task-number: QTBUG-111698
Task-number: QTBUG-107072
Pick-to: 6.5 6.6
Change-Id: Ifa1111900d6945ea8e05fffd177e113eaa506dde
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
There were two problems:
- On platforms where QFLOAT16_IS_NATIVE == true, a qHash(qfloat16{})
call has become ambiguous between the three FP qHash() overloads
(float, double, long double), where it was unambiguously calling the
float one in Qt 6.4. This SiC was caused by the replacement of
operator float() by operator __fp16() in
99c7f0419e, which is in Qt 6.5.
- On platforms where QFLOAT16_IS_NATIVE == false, qHash(qfloat16{})
would produce a different value from qHash(float{}), and therefore
Qt 6.4, when the seed was != 0, because the former would go via the
one-arg-to-two-arg qHash adapter while the latter one would
not. Since participating functions are inline, this causes old and
new code to produce different hash values for the same qfloat16,
leading to a BiC possibly corrupting QHash etc.
Fix both by adding an explicit qHash(qfloat16). This function is
inline, so it doesn't add a new symbol to 6.5.x.
[ChangeLog][QtCore] Fixed qHash(qfloat16) which was broken from 6.5.0
to 6.5.3, inclusive. If you compiled against one of the affected Qt
versions, you need to recompile against either Qt 6.4 or earlier or
6.5.4 or later, because the problematic code is inline.
Pick-to: 6.6 6.5
Fixes: QTBUG-116064
Fixes: QTBUG-116076
Change-Id: Id02bc29a6c3ec463352f4bef314c040369081e9b
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Let's find needle and then do detach
While touching code, replace raw loop with algorithm
and add early out: compare before and after args
Change-Id: I22403fd3d6920d941b65e79f44b46e49a9777dc5
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>