Directly writing to the underlying property storage has the potential of
breaking all kinds of internal invariants. As we return QBindable in
the public interface, we should not grant callers access to the
internals of the object.
Pick-to: 6.2 6.1
Change-Id: I737ff293b9d921b7de861da5ae23356c17690b78
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
Reviewed-by: Andreas Buhr <andreas.buhr@qt.io>
Set the correct value to the _qt_config_module_name property at the
internal module creating step instead of appending _private suffix when
generating .pri files.
Amends 425ff34aa1
Pick-to: 6.2
Fixes: QTBUG-94568
Change-Id: I6fa8089358bc638668e313c98c3aee680bf7ec2a
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
We dont really need those after functions definitions.
Change-Id: I41f010a223977c55d4b7271ac3ebdc1bb9047b09
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Needed for qtdeclarative so we can filter out which object library
should go into which export set, because qt_internal_add_qml_module
can create both a backing library export set and a plugin export set.
The plugin initializer object lib should go to the plugin export set.
Pick-to: 6.2
Task-number: QTBUG-92933
Change-Id: I0fce131eff75a0b3090ac0fbb2a12ecfcba5e38d
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
This is needed for a change in qtdeclarative to allow building the
Q_IMPORT_PLUGIN-containing object library initializer of a qml plugin.
Show an error if the qml plugin has no class name, it's needed for
plugin initialization so it's mandatory to have a class name.
Show an error if a class name is not found when computing the import
macro for a plugin (both for a regular qt plugin and a qml plugin).
When querying for the class name of a target, query both a Qt6::
prefixed target as well as a non-prefixed one, with the Qt one
taking precedence.
This is to allow querying the class name of user project created qml
plugins.
Currently regular qt user plugins don't use the object library
initializer approach. This will likely be revisited in the future.
Pick-to: 6.2
Task-number: QTBUG-92933
Change-Id: I46417471a7d8b49651e6821f7b28e7a9d44c2557
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
We didn't do it in Qt 5 times and it was accidentally done for Qt 6.
There's no reason to generate them, the .pri files are only meant to
be used for regular plugins so a project can do QTPLUGINS += foo.
That mechanism is not needed for qml plugins which use
qmlimportscanner instead.
Furthermore the pri contents didn't contain a class name, so they
couldn't be used anyway.
Pick-to: 6.2
Change-Id: I6299fda21ece0f693a817ab558b45aa46b97e5ee
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
Repos should have migrated by now and the function should not be
advertised as a public one.
Pick-to: 6.2
Task-number: QTBUG-88763
Change-Id: Ica5bc55670a17a28c0022f78c126a3a8a8ffdeb5
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
For now, it's not meant to be called manually. It's called in
qt_add_executable automatically for iOS.
Amends 4d838dae5a
Pick-to: 6.2
Task-number: QTBUG-88763
Change-Id: I90dfcf86f53a3c8e48a813435f7400db232b21f4
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
Due to capacity() reporting the size of all allocated space, this is
somewhat inconsistent with what QVector::capacity() in Qt5 provided,
due to Q6List being double-ended. So let's document this better
Task-number: QTBUG-92941
Pick-to: 6.2
Change-Id: Iba46389121e721a8d21f0344b154f41c2c245867
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
msvc2019 emits:
warning C4244: 'argument': conversion from 'qsizetype' to 'int',
possible loss of data
Change-Id: I286c0d453f69654ba58f071aee28e557b9f9058d
Pick-to: 6.1 6.2
Reviewed-by: Jan Arve Sæther <jan-arve.saether@qt.io>
Avoid multiple re-reads of xml files, for example in dolphin,
which displays MIME type comments as file types.
Change-Id: Ia124930e2a1fdc99d8a4d160f2288a00f55e0e8e
Reviewed-by: David Faure <david.faure@kdab.com>
A misunderstanding seems to have caused several files to be compiled
with extra runtime arch options.
We need to disable multi-target functions though, because it doesn't
work with clang-cl headers.
Task-number: QTBUG-88081
Task-number: QTBUG-88434
Pick-to: 6.2
Change-Id: Ic5829540f9007428c80f9a7bd46af35540745ccd
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
QSet is internally implemented by a QHash. Therefore the change in
reference stability affects QSet, too.
Pick-to: 6.1 6.2
Change-Id: If1879d5a027211bca0beeff16ffbc77f2f4fce26
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Mention change of behavior introduced by 89f7a2759c in the porting
documentation.
Change-Id: I3c282362f5852cc7768e6655fc7b3901d68f2b10
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
It's only Qt::MiddleButton in Qt 6.
Pick-to: 6.1 6.2
Change-Id: Ia68bad910c617993e30e3ed1e117192469ec50eb
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
When a signal/slot connection is broken, it gets added to the
sender's list of "orphaned connections", to clean up later.
This cleanup happens when the sender gets destroyed or as soon as
it emits any signal.
This may cause soft memory leaks in case receivers get destroyed,
and the sender is a long living object and doesn't emit signals
for a while (e.g. QThread).
For some reason, an explicit disconnection cleans up the list
(either by using the QMetaObject::Connection object, or in case
of string-based connect, using a string-based disconnect). This
raises lots of doubts about why having this list in the first
place.
Fix the soft-leak by cleaning up the orphaned connection list when
destroying a receiver.
Note: I still believe that we shouldn't have any "orphaned"
connection list, and rather cleanup on disconnect/deletion
(otherwise, emitting a signal may cause a CPU spike because it
triggers a cleanup). If we allow for any "impredictability" during
signal activation we're just admitting that signals/slots aren't
suitable for e.g. low-latency codepaths. That's why I'm not marking
the problem as fixed.
Original-patch-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
Task-number: QTBUG-88248
Task-number: QTBUG-87774
Pick-to: 6.2 6.1 5.15
Change-Id: Id25f67a45dff49f740132a44d36e88740eb12070
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
This does not fix all data races that we have in the system yet.
One major issue is the virtual disconnectNotify(), that can be
called from any thread and thus is inherently problematic, as it
can collide with the object getting destroyed at the same time
in another thread.
Pick-to: 6.2 6.1 5.15
Task-number: QTBUG-88248
Change-Id: I9d841eb363b7e4f0de1657aeb8f5340d0fd55190
Reviewed-by: Andrei Golubev <andrei.golubev@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
This function is/will be used in a few places where we already have a
lock. Temporarily unlocking and relocking invites all kinds of troubles.
By adding a flag we can instead tell the function that we already hold
the lock.
Pick-to: 6.2 6.1 5.15
Change-Id: Ibca089de61133661d5cd75290f2a55c22c5d013c
Reviewed-by: Andrei Golubev <andrei.golubev@qt.io>
Copying a QOrderedMutexLocker is questionable, and would currenly easily
lead to UB. Therefore we delete the copy ctor and copy assignment
operator, and implement well-behaving move operators.
In addition, provide an explicit dismiss method for cases where we don't
want the locker to unlock the mutexes, as they have been manually
unlocked (this could have been implemented previoulsy by using the copy
assignment operator).
Pick-to: 6.2 6.1 5.15
Change-Id: If2a888710e1c74277b28fd3e2939ab26fff0c7ae
Reviewed-by: Andrei Golubev <andrei.golubev@qt.io>
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Change-Id: I278516f527990b3c4477436a82695e68b5f6a713
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
Remove target specific flags from static_link_order.
Move the check to the common config.tests folder.
Amends 5fb99e3860
Pick-to: 6.2
Task-number: QTBUG-93002
Task-number: QTBUG-94528
Change-Id: I1368075ec6bd1e743b2b89fd93143df38a278ec2
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Only depend on the ${project}_src and ${project}_tools targets.
This might exclude some non-obivous target dependencies, but we can
adjust that if needed.
This reduces the build.ninja file of qtbase + qtsvg form 341MB
to 41MB when configuring with tests and examples, as well as reduces
the processing time of calling ninja.
Amends d97fd7af2b
Pick-to: 6.2
Change-Id: I2860d8ae89728f33f6b73fede1335cd6d6290f78
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
It was suppressed unconditionally (albeit in different places and with
different levels of obviousness) almost everywhere, due to inability
to set the system locale in use by the implementation. Several
test-cases used ISO-8859-1 encoding on Q_OS_MAC, where the tests were
all suppressed anyway. A block of no_NO tests was #if 0'd out; and
should, in any case, have been nb_NO. Tests of any locale but en_US
were skipped on Q_OS_WIN because we can't set the locale (but
including the tests of en_US tacitly assumed that's the system
locale). If setlocale() failed, for ICU or DARWIN, the test was
skipped; but we might as well check for this in the _data() to save
repetition.
The test was laboriously going through the sign cases; relocate the
QString::compare() test's sign() function so that we can use it here,
too, and simply QCOMPARE() signs. Introduce a TransientLocale class,
copied from tst_QLocale, to take care of setting and restoring the
locale using setlocale(). Change the locale name to a QByteArray so
that we save having to convert it to one in order to pass it to
setlocale(). Since that changed every _data() row, reformat those rows
in the process - most of them were long lines.
On the systems where we can't set the locale used by the function
being tested, condition each block of tests in the _data() on whether
LC_COLLATE looks like the locale to be tested, and report how a
determined developer at least can (by repeatedly running the test with
different locales set) test all the cases; and we'll attempt the ones
that we can, when one of the relevant locales is in use. If that
leaves us with no tests we can do, QSKIP() in the _data() to avoid an
assert failure for "Test data requested, but no testdata available."
Change-Id: I75709fda8827dcbe74f80c4136042054da6fcb13
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
For user projects we run the static link order check once
'find_package(Qt6 ...)' is called.
If linker can resolve circular dependencies between static libraries
and object files we set the _qt_link_order_matters property of the
Qt::Platform target. This indicates the use of finalizers is not
required and we may rely on CMake-base propagation of resource
libraries and resource object files.
If linker could not resolve circular dependencies depending on
the _qt_resource_objects_finalizer_mode value:
- Finalizer will be called and collected resource objects will be
linked to the target directly.
- Finalizer will be omitted and resource objects will be linked
using the target_sources function implicitly. This only
propagates resource one level up if consumer links the static
library PUBLICly, but all symbols will be resolved correctly
since object files are placed in the beginning of the linker line.
In the CMake version 3.21 we expect that CMake will take care about
the order of the resource object files in a linker line, it's
expected that all object files are located at the beginning of the
linker line.
TODO: Need to confirm that the CMake 3.21 meets the expectations.
Amends 4e901a2f99
Pick-to: 6.2
Task-number: QTBUG-93002
Task-number: QTBUG-94528
Change-Id: Ia68976df8182d3d3007b90c475c1e3928a305339
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
The kludge previously implemented for handling dates outside the
supported time_t range, by asking for a corresponding date in a year
in the range, had a comment remarking that this is broken due to the
wrong day of the week and, consequently, the placement of DST
transitions, e.g. those scheduled by the last Sunday of a month,
happening on different dates in the year asked about and the in-range
year passed to the system time_t functions.
This can be handled by selecting a year in the time_t range which has
the same pattern days of the week (and length of the year, i.e
leap-ness). That may (particularly for leap years) need to select a
year far from the end of the range (and there may be a change to the
zone's rules between the selected year and the end).
Change-Id: Ia353b2cc7b7d266b7abf80e37cac61544ce95c2d
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
System V semaphores are not supported in sandboxed applications,
so when Qt is configured with App Store compliance, or the user
requests POSIX IPC explicitly, we use that instead.
https://developer.apple.com/library/archive/documentation/Security/Conceptual/AppSandboxDesignGuide/AppSandboxInDepth/AppSandboxInDepth.html#//apple_ref/doc/uid/TP40011183-CH3-SW24
As the shared memory name limit on Apple platforms is very low,
we have to skip the existing logic for naming, and instead use
a truncated hash of the key. This should still be fine for
avoiding any collisions in practice.
An explicit check for the ENAMETOOLONG error has been added to
catch any cases where they key goes beyond the allowed length.
Sandboxed applications also have an extra requirement that the
key must include an application group identifier. This requirement
has been pushed up to the user and documented, as we don't have
enough information in Qt to know which identifier to use.
Both tst_QSystemSemaphore and tst_QSharedMemory work as before
with both sandboxed and non-sandboxed applications, after removing
some assumptions in tst_QSharedMemory about System V behavior.
Fixes: QTBUG-91130
Change-Id: Iaf1edb36a5d84d69e42ec31471a48d112faa8c6a
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
The documentation says that if we "pass a URL to the main
executable of a bundle, the bundle as a whole is generally
recognized.". By passing the executable instead of the
bundle we include command line applications that don't
have a app bundle folder (but have an embedded Info.plist).
Pick-to: 6.2 6.1 5.15
Change-Id: I3a2f145c1ec6e16607e9c04baf08678d5dea0b81
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Abort the system move/resise at XCB_INPUT_TOUCH_END.
Limit the behavior only on supported platforms, such as KDE and
OpenBox.
Change-Id: I53c86979ca56f4de8c5cf2807f781abdad6987b2
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
We can't get mouse release event from master pointers after
QXcbWindow::doStartSystemMoveResize() which calls xcb_ungrab_pointer(),
it looks like most X11 WMs work as that.
So we try to get mouse release event from slave pointers.
Based on https://specifications.freedesktop.org/wm-spec/1.4/ar01s04.html
, we need to send _NET_WM_MOVERESIZE_CANCEL when we get mouse release
event.
Task-number: QTBUG-91077
Change-Id: I01e74a01c87b381ee7cd6f20d51a1fa61c0e98fc
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Consumers can now check the "debug" feature to determine whether Qt was
built in the "Debug" configuration.
Pick-to: 6.2 6.1
Change-Id: I225125d38ded508e9792a730ce421b33bceacddf
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Amends 16f927a4f1.
At the time the original change was written, QStringTokenizer
had not been integrated, yet.
Change-Id: I83c31d816199bc48c4baea855d13cbf9eda9aaa2
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
PAGESETUPDLG's hDevMode reports the page size and orientation selection
of the user, so read that data to get accurate results.
Otherwise, the page size of a landscape page wouldn't match any known
page format, and we'd end up with a custom size that would not be valid
for the preview, breaking the preview UI's orientation state.
Reuse the helper from QPageSize to map Windows page size ID to our own
enum.
Fixes: QTBUG-93764
Pick-to: 6.2 6.1 5.15
Change-Id: Ib9a848619e3ba8780264ad76ed43c4fffae6b07f
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Andy Shaw <andy.shaw@qt.io>
Since there is no header then the cells appear with no actual border so
it can look a bit strange without it. This ensures that the border is
at least shown when there is no header to represent it if the style hint
is turned on. This gives an option for those who want it to have it
turned on.
Fixes: QTBUG-85523
Change-Id: Ib94874bddddd31738fbcd41c6f77a2e0fa2ef443
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
CMake 3.21 introduced a new IMPORTED_TARGETS directory property which
we can use to promote all imported targets within a scope to be
global.
This would cover transitive non-Qt imported targets which the Qt build
system does not know about and is thus a more complete solution
compared to promoting only Qt targets.
Run a finalizer at the end of the directory scope where
find_package(Qt6) is called to promote all imported targets within
that scope to global (when requested).
The old promotion method is disabled when the CMake version is new
enough.
Pick-to: 6.2
Task-number: QTBUG-92878
Task-number: QTBUG-94528
Change-Id: I533a3bd4186eba652f878ddd72c76118c2fd8bae
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
User projects can set the QT_PROMOTE_TO_GLOBAL_TARGETS variable to
true so that the various imported targets created by find_package(Qt6)
are promoted to global targets.
This would allow a project to find Qt packages in a subdirectory scope
while using those Qt targets from a different scope.
E.g. it fixes errors like
CMake Error at CMakeLists.txt:5 (target_link_libraries):
Error evaluating generator expression:
$<TARGET_OBJECTS:Qt6::Widgets_resources_1>
Objects of target "Qt6::Widgets_resources_1" referenced but no such
target exists.
when trying to use a static Qt from a sibling scope.
Various 3rd party dependency targets (like Atomic or ZLIB) are not
made global due to limitations in CMake, but as long as those targets
are not mentioned directly, it shouldn't cause issues.
The targets are made global in the generated
QtFooAdditionalTargetInfo.cmake file.
To ensure that resource object libraries promoted, the generation
of the file has to be done at the end of the defining scope
where qt_internal_export_additional_targets_file is called,
which is achieved with a deferred finalizer.
Replaced all occurrences of target promotion with a helper function
which allows tracing of all promoted targets by specifying
--log-level=debug to CMake.
Pick-to: 6.2
Fixes: QTBUG-92878
Change-Id: Ic4ec03b0bc383d7e591a58c520c3974fbea746d2
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
The iOS port creates one QIOSViewController per connected
screen. And each view controller listens for changes to
the application state. The problem is that we never
disconnect this connection again. So if a screen is removed, and
the corresponing view controller is deallocated, the
connection is still kept alive. This will cause crashes to
occur when the signal emits, since the slot will then be accessing
deleted memory.
Fixes: QTBUG-76948
Pick-to: 6.2 6.1 5.15
Change-Id: I758e51af9297cd62de193aae825f4475a2c7c3e5
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Makes it able to catch the last bug of saturating color values above a
certain value.
Change-Id: Ib2a3918623a1defe2981efe61cf8118e019e9d4b
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
This reverts commit 03eb44394e.
Reason for revert: This breaks the dependecy update round in dev now. The revert can be reverted again after
1) Full dependency round is succeed in 'dev'
2) Android extras submodule has been removed from qt5.git#dev (7aa41d22fa485f212aebbef500ea91921c7bc38b)
3)qtmultimedia has been ported to use new api instead of this old one
4) Full dependency round with all above is succeed in 'dev'
Change-Id: I23241d2a90307074ecfc9573d2b58baba1874cfc
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
Fixes build issue "no instance of overloaded function "qHash" matches
the argument list" on INTEGRITY
Pick-to: 6.2
Change-Id: Ia1273587840d55199846dc64d487d194f9a4d565
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
Fix various C4244 warnings with the MSVC compiler for 64 bit
Proposed upstream fix:
https://github.com/mity/md4c/pull/162 for an upstream fix,
Pick-to: 6.1 6.2
Change-Id: I2ac1c17febb4fb269ac7244458f4cd90ce8b8e49
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>