The comparison between nullptr and QWeakPointer was just bogus
and ill-formed. The INTEGRITY compiler catches that even if
nothing tries to use the comparison. It is an ill-formed, no
diagnostic required case of a function template never being
able to produce a valid specialization. And while we're at
it, this patch makes the result of comparing a nullptr to
a QWeakPointer or vice versa the same as asking .isNull() from
the weak pointer, because it seems mind-boggling if those
are not the same operation.
Task-number: QTBUG-93093
Change-Id: I0cc80e795c9af2be1b76de05157aa458ef260f2e
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
QHighDpiScaling has two init/update functions:
- initHighDpiScaling(): called once during QGuiApplication construction
- updateHighDpiScaling(): called whenever (relevant) screen configuration changes
Currently the calls to updateHighDpiScaling() are made from
multiple places including platform code. Simplify by calling
it from two locations:
- QWindowSystemInterface::handleScreenAdded()
- QGuiApplicationPrivate::processScreenLogicalDotsPerInchChange()
Replace comment about early calls to qt_defaultDpi with a
test which calls qt_defaultDpiX/Y with no screens attached.
(Looking at the qt_defaultDpiX() implementation, it is unlikely
that there will be a problem as long as updateHighDpiScaling()
is called before QGuiApplication::primaryScreen() starts returning
a non-null value.)
Change-Id: I447db42894617495843a5cb531a1322b000fed62
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
In Qt Quick we now need to keep track of which QQDeliveryAgent is
responsible when a point is grabbed, either passively or exclusively.
When we re-deliver to that grabber, we need to do it via the same agent,
so that the same scene transform is used, and the grabber will see the
event in the correct coordinate system. It's easier to track this
mapping here instead of in a separate map in Qt Quick.
Pick-to: 6.1
Task-number: QTBUG-92944
Change-Id: I69f769c694d0da24885cdf4087e5032022bff629
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
This is one of the more complicated ports. The target object
was represented by two variables in the past: A raw pointer and a
QPointer. The QPointer is checked in some cases to check whether
the target object still exists.
This patch introduces a targetObjectDestroyed() slot and connects
it to the destroyed(QObject*) signal of the target object.
In this slot, the animation is stopped. The checks become
obsolete thereby and it is sufficient to represent the target
Object in one raw pointer.
This raw pointer becomes a bindable property.
Fixes: QTBUG-92992
Change-Id: I7e2ddb5d8aed007400fe74bea1becf7bdfbf2563
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Sona Kurazyan <sona.kurazyan@qt.io>
Cast size_t return from std::vector explicitly to int to silence compiler
warnings.
Change-Id: I0c425b3cec7feec0712e1173ab7e60b28695d6d7
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Windows wants ISO C++ _fileno and _unlink instead of posix fileno and
unlink. For fileno we have the QT_FILENO macro in qplatformdefs.h, so use
it. For unlink we don't have a macro in Qt, so declare one in the test.
Change-Id: I56c5c3fb4e500769c744132c46107816f89bb2c3
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
QHash, which is included in the bootstrap library, uses qCpuFeatures()
as part of the implementation of qHashBits(), when the __ARM_FEATURE_CRYPTO
is available, so we need to ensure the definition of that function is
also included.
Change-Id: I3eeb3685335120a4861c397ab9c82540bcfcd17c
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Move the project prelude to
examples/widgets/tools/plugandpaint/CMakeLists.txt
to mark it as the entry point of the example project.
Remove the project prelude from all its subdirectories, because the
subdirs are not supposed to be built separately.
Remove the wrong code that pro2cmake generated for the application's
project file. That merely tried to link the basictools static plugin.
Move common initialization code (CMAKE_AUTO*, INSTALL_EXAMPLESDIR) to
the top-level plugandpaint project file.
Remove superfluous CMAKE_INCLUDE_CURRENT_DIR.
Set the output directory of the extrafilters plugin to the application's
build directory such that the app can find the plugin without having to
install the example.
Skip regeneration in those files, to avoid scattering the project files
with special case markers.
Fixes: QTBUG-87449
Fixes: QTBUG-91066
Change-Id: I3ceb08f5fcda1ffea3c35cee8580f7b5e4ecfc1f
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Introduce the function that appends the specified properties of the
one target to the another. It's possible to copy the standard
property set that affects a compilation only or pass some specific
properties that need to copy. You may also control the visibily of
properties that need to copy by passing the PRIVATE_ONLY or
INTERFACE_ONLY option.
The function is used to compile the resource targets with the same
property set as the main target. Also link the Qt::Platform interface
library to collect platform specific properties.
Pick-to: 6.1
Change-Id: I727fd0a4bc52c4f5128f28ce796d7a5f3005bb30
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
It's necessary to have versioned alias of the Platform target to use
versioned target in the installable cmake files.
Pick-to: 6.1
Change-Id: I79286e1c0642068bdfa5d24c1087ee0c39e48f1a
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
And adjust configure.json files that were stale
Amends d385158d52
Change-Id: I851838a12c3773a6e8119ebc7f1de941ae7fe224
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
It's not clear now whether trackpad gestures on Windows will need to be
so different than on macOS; however, any reasonable int value can be
stored in a qreal, and in Qt Quick we like to use floating-point numbers
for all "real" values and measurements. So since we need to add more
storage, and quint64 m_intValue has never been used, we now replace it
with a QVector2D, which should have the same size. The intended use
is that PanNativeGesture will include a displacement, probably in
pixels, by which the viewport or some target item should be panned or
moved. The naming of deltas() is flexible enough to support any gesture
with some incremental 2D valuators, though, just as value() has
gesture-dependent semantics.
fingerCount() will be useful for Qt Quick pointer handlers to filter
out events that have the wrong number of fingers, e.g. to require that
either a 3-finger pan gesture or 3 individual touchpoints are required
to activate DragHandler { minimumPointCount: 3 } (assuming we implement
pan gesture support in DragHandler).
Fixes: QTBUG-92179
Task-number: QTBUG-92098
Change-Id: I5462aea9047beed6e99075294a62011edd8a59f5
Reviewed-by: Povilas Kanapickas <povilas@radix.lt>
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
The property 'model' is ported to a bindable property.
The properties hasSelection, selection, selectedIndexes,
and currentIndex are left for later patches.
Task-number: QTBUG-85520
Change-Id: Ia424ce99fc80c3d807c634c21d161a3ad94b27d2
Reviewed-by: Sona Kurazyan <sona.kurazyan@qt.io>
Those tests don't fail anymore and show in CI as BPASS, so we
can safely, hopefully, unblock them
Task-number: QTBUG-87429
Fixes: QTBUG-68974
Fixes: QTBUG-69166
Fixes: QTBUG-87403
Fixes: QTBUG-87411
Fixes: QTBUG-69083
Fixes: QTBUG-69084
Fixes: QTBUG-87426
Pick-to: 6.1
Change-Id: I831b955116c0f465319b9c5fc726dd98804d1c00
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
This patchset adds the bits needed for manual tests to work standalone.
Amends ebaa1c15a101579d9296336491e36c63b979f18d
Pick-to: 6.1
Task-number: QTCREATORBUG-25389
Change-Id: Ifc70391bda2a3eea3c7492a58353a703cdc3114c
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
We now generate metatypes by default and every instance of GENERATE_METATYPES now causes a warning.
Change-Id: I83a124de3f3bb1fc770cfae0eed955c03e95b310
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
Change-Id: I25897ec093aca38081745eff329ec3d042bc02c5
Reviewed-by: David Faure <david.faure@kdab.com>
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
Since these tests do not actually use the filename in the loops, add
macros to declare them unused.
Change-Id: I3362e0478ac6802b37f54f90ca377aa462570d8c
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Previously, an apparent POSIX rule would be saved and any defects in
it would only be discovered when trying to use it to generate
transitions. Instead, check that it has the right form during the
initial parsing of its data.
In the process, since checking for DST in the process is trivial,
implement a long-standing TODO to cache hasDaylightTime()'s
answer. The array it scanned was in any case being scanned during
construction, so detecting DST in init()'s scan is trivial; and its
failure to check the POSIX rule mean it failed to notice when zones
entirely specified by a POSIX rule have DST.
Adapt a test using a POSIX-only rule to verify it does know the zone
has DST; it did not, before this change.
Change-Id: I690c013d3331600f7348dae61c35d41e5599da70
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
The description necessarily has fake transitions at start and end of
the year, potentially outside the year. These transitions should not
be reported by QTzTimeZonePrivate as transitions, although its data()
must find a "transition" whose data it can use (as in the permanent
standard time case, which could potentially be represented the same
way, although there's a saner way to do so, that the code already
handles) to report the zone's properties.
In the process, fix (and make more straightforward) the convoluted
decision-making code that was deciding which transitions to include in
the returned list. It was assuming invalidMSecs() would be set as the
atMSecsSinceEpoch of a transition, although this is computed in a way
that makes that value most unlikely, even when the result is invalid.
It also rather confusingly mixed < 0 tests as tests for overflow with
the one < 0 test that's about ignoring DST before 1970. Also added
comments to clarify some of what's going on there.
Expanded a recently-added test of a permanent DST zone to verify this
now works correctly.
Change-Id: Ia8d98f433fb1e479dba5479220a62196c30f0244
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
There are two formats for such fields: one with a J prefix on a number
in the range 1 to 365, the other with no prefix and a range from 0 to
365. The code mistakenly treated the latter as if its range were from
1 to 366. The J-form doesn't count Feb 29th, so March always starts on
day 60; the code tried to take that into account, but adjusted in the
wrong direction (and this mislead me, in a recent partial fix, into a
fence-post error).
Add a test-case based on the Africa/Casablanca POSIX rule seen on RHEL
8.2, which tripped over the off-by-one error without a J prefix. This
incidentally also tests the J case.
Change-Id: I692ca511e5c960f91a6c21073d3b2f037f5e445f
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
The fact that KernedAdvances does not work correctly on a majority
of fonts is confusing. So we warn users that this is the case and
point them to the correct function to use instead.
Task-number: QTBUG-92930
Change-Id: I70f4b09ea1050fceabbff25a9c91008d1754f772
Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
This increases link time significantly; instead set
"-g4" or the new "-gsource-map" only if source maps
are enabled.
Change-Id: Ibe2d438d48e9ae2fce5f79d4e8a9f17c01cf2485
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
The topic existed for QRegExp but is not relevant in QRegularExpression.
Pick-to: 6.1
Change-Id: Ife9d42b5b03163cfefff19725409a3feac1cddb2
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
It usually fails the test with "corrupted size vs. prev_size" message
coming from malloc() or some other memory allocation routine (which
signals about memory corruption probably)
Task-number: QTBUG-93176
Change-Id: I5e34971267c52c63cda2489bef5b09bed739f532
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
(cherry picked from commit 6d52d86b999088ec07e58c14197bddda043ef0aa)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
The major part is stability tests for QList operations,
Also added std::shared_ptr to the Custom type. shared_ptr
accesses the memory which does not directly belong to
QList, so using it inside a passed-to-qlist type is
beneficial (e.g. ASan could catch extra issues)
Basic prepend-aware cases added to QString/QBA tests
Task-number: QTBUG-93019
Change-Id: I50e742bdf10ea9de2de66539a7dbb9abc4352f82
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
(cherry picked from commit adb41bbe00b2b853d4dd26cd9ee77ae5ed541576)
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Drop the "move left if pos <= size / 2" path in favor of reference
stability of insert and emplace operations
Leave the insert(0, ...) and emplace(0, ...) as special cases for
prepend optimization as invalidating [begin, end()) practically means
that we can reallocate behind the scenes
Doing this also simplifies the code a bit
Task-number: QTBUG-93019
Change-Id: I7c248f96d687e94a6a38f81ade901619ff2b4733
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
(cherry picked from commit 5e76c2acff2c70f2893306b16aeba230f3d6114a)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Because leaving the pointer untouched is a much more expected behavior
The tests for this (and not only) logic can be found in the following commit
Change-Id: Iec9eec9bbce04c9fd90cb6be9627c135cd989b7f
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
(cherry picked from commit 38bba2a87c6c5c2b8100870add6d0d7ad559e669)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Test the relocation logic through the QADP::relocate() method which
basically calls q_relocate_overlap_n inside and then ensures that
the data pointers are in good state
Running these locally in fact revealed a bug in the implementation,
so these tests are definitely good to have
Task-number: QTBUG-93019
Change-Id: I353ed46a31c5c77cd0c5fcacd3dfce46e5cf3e67
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
(cherry picked from commit 65d0f6829cc124f6d0d4003a17bedcb74dddf33b)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Use the data moves to readjust the free space in the QList,
which ultimately fixes the out-of-memory issues caused by
cases like:
forever {
list.prepend(list.back());
list.removeLast();
}
Task-number: QTBUG-91801
Task-number: QTBUG-91360
Task-number: QTBUG-93019
Change-Id: Iacff69cbf36b8b5b176bb2663df635ec972c875c
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
(cherry picked from commit a0253f5f0249024580050e4ec22d50cb139ef8d9)
We already used it in QString and QBA. And implicitly in QADP (see
parent commit). Might as well move to a common location and reuse
Change-Id: I694f0f1dbd109f17c134f64b3f3dc28d19556c88
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
(cherry picked from commit 10b46e7f0faecc42a94cc2e25ad3edd08ae28083)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Added branching to plugandpaint example to get correct library
architecture to the build
Fixes: QTBUG-56322
Pick-to: 5.15
Change-Id: I4d0eb4e24681642991d08c3dd2bad73d10caf962
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
When configuring a Qt module with qt-configure-module, we want to use
the same CMake generator that was used for building qtbase.
That generator is encoded in qt-cmake-private. But qt-configure-module
overrides the generator after trying to detect what generator should be
used. That auto-detection is only useful for qtbase-builds and top-level
builds. Turn it off for repo builds other than qtbase.
Pick-to: 6.1
Fixes: QTBUG-91405
Change-Id: I07efb4afb51ba69d2f5467d272118fa51637ab54
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
This is the counterpart of the qmake variable
ANDROID_TARGET_SDK_VERSION.
Pick-to: 6.1
Task-number: QTBUG-86033
Change-Id: Idd64ee06eb94826430e6be5d9d878631db67c949
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
This is the counterpart to the qmake variable ANDROID_MIN_SDK_VERSION.
Pick-to: 6.1
Task-number: QTBUG-86033
Change-Id: I4e1434a794f3a8345f9b4e045ab4366d486221af
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
Those are the CMake counterparts of the qmake variables
ANDROID_VERSION_{NAME|CODE}.
Pick-to: 6.1
Task-number: QTBUG-86033
Change-Id: I57534ff04db0c78871fe7ba81bedaf377422054b
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
It's important for conan CI builds where the correct installation
location of Qt should be used when configuring standalone tests.
Task-number: QTBUG-93037
Change-Id: I2465a439aea6826dedfb3217d1c909ad639d4ac0
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
qtbase/src/corelib/kernel/qsharedmemory_p.h:62:33: error:
unknown type name 'QString'; did you mean 'XXXX::QString'?
int createUnixKeyFile(const QString &fileName);
^~~~~~~
XXXX::QString
Pick-to: 5.15 6.0 6.1
Change-Id: I455526503f059efc2f496b159b4cb098385dda00
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
Add override to addPaths and removePaths in kqueue filesystem watcher
Fixes build break in developer-build with gcc 10 on *BSD
Pick-to: 6.1
Change-Id: I7d91251d6bcb1614bb9f21c319abc9c2df681cda
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>