Skip to content

Conversation

@rjcamatos
Copy link

If there are 2 or more methods with the same name but reciving diferent arguments the QJSEngine Pickup the First One declared.

Example:
methodxyz(string)
methodxyz(objptr*)

It picks up the first one passing as argument a string and not the one that i was expecting an object as it was send.

qtprojectorg pushed a commit that referenced this pull request Dec 8, 2023
Using std::binary_search has the requirement that the passed
range fulfils ordering requirements, which was not the case
for the cppKeywords array here.

As the QString doc says [1]:

> QStrings can be compared using overloaded operators such as operator<(),
> operator<=(), operator==(), operator>=(), and so on. Note that
> the comparison is based exclusively on the numeric Unicode
> values of the characters. It is very fast, but is not what a
> human would expect; (...)

Therefore, sort the array accordingly and add an assert to
ensure it will remain sorted.

Fixes an crash/assert when building qtdeclarative with
CXXFLAGS='-D_GLIBCXX_DEBUG':

    /usr/include/c++/13/bits/stl_algo.h:2243:
    In function:
        bool std::binary_search(_FIter, _FIter, const _Tp&) [with _FIter = const
        QString*; _Tp = QStringView]

    Error: elements in iterator range [first, last) are not partitioned by the
    value __val.

    Objects involved in the operation:
        iterator "first" @ 0x7ffc4a2c4f18 {
          type = QString const* (constant iterator);
        }
        iterator "last" @ 0x7ffc4a2c4f10 {
          type = QString const* (constant iterator);
        }
    Aborted (core dumped)
    ninja: build stopped: subcommand failed.

GDB backtrace:

    Program terminated with signal SIGABRT, Aborted.
    #0  __pthread_kill_implementation (threadid=<optimized out>, signo=signo@entry=6, no_tid=no_tid@entry=0) at ./nptl/pthread_kill.c:44
    44      ./nptl/pthread_kill.c: No such file or directory.
    (gdb) bt
    #0  __pthread_kill_implementation (threadid=<optimized out>, signo=signo@entry=6, no_tid=no_tid@entry=0) at ./nptl/pthread_kill.c:44
    #1  0x00007f307e0a815f in __pthread_kill_internal (signo=6, threadid=<optimized out>) at ./nptl/pthread_kill.c:78
    #2  0x00007f307e05a472 in __GI_raise (sig=sig@entry=6) at ../sysdeps/posix/raise.c:26
    #3  0x00007f307e0444b2 in __GI_abort () at ./stdlib/abort.c:79
    #4  0x00007f307e2a300d in ?? () from /lib/x86_64-linux-gnu/libstdc++.so.6
    #5  0x00005639ff90471d in std::binary_search<QString const*, QStringView> (__first=0x5639ffa1a9c0 <QmltcVisitor::checkForNamingCollisionsWithCpp(QDeferredSharedPointer<QQmlJSScope const> const&)::cppKeywords>,
        __last=0x5639ffa1b2c0 <guard variable for QmltcVisitor::checkForNamingCollisionsWithCpp(QDeferredSharedPointer<QQmlJSScope const> const&)::cppKeywords>, __val=...) at /usr/include/c++/13/bits/stl_algo.h:2243
    #6  0x00005639ff8fb837 in operator() (__closure=0x7ffc4a2c52bf, word=...) at /home/michi/development/git/qt5/qtdeclarative/tools/qmltc/qmltcvisitor.cpp:764
    #7  0x00005639ff8fb89e in operator() (__closure=0x7ffc4a2c52a0, name=..., errorPrefix=...) at /home/michi/development/git/qt5/qtdeclarative/tools/qmltc/qmltcvisitor.cpp:768
    #8  0x00005639ff8fc99b in QmltcVisitor::checkForNamingCollisionsWithCpp (this=0x7ffc4a2c6070, type=...) at /home/michi/development/git/qt5/qtdeclarative/tools/qmltc/qmltcvisitor.cpp:787
    #9  0x00005639ff8f9dea in QmltcVisitor::endVisit (this=0x7ffc4a2c6070, program=0x563a002e0628) at /home/michi/development/git/qt5/qtdeclarative/tools/qmltc/qmltcvisitor.cpp:341
    #10 0x00007f307f6636fa in QQmlJS::AST::UiProgram::accept0 (this=0x563a002e0628, visitor=0x7ffc4a2c6070) at /home/michi/development/git/qt5/qtdeclarative/src/qml/parser/qqmljsast.cpp:1193
    #11 0x00007f3080159b8f in QQmlJS::AST::Node::accept (this=0x563a002e0628, visitor=0x7ffc4a2c6070)
        at /home/michi/development/git/qt5/qtbase/include/QtQml/6.7.0/QtQml/private/../../../../../../qtdeclarative/src/qml/parser/qqmljsast_p.h:272
    #12 0x00007f3080212f4b in QQmlJSTypeResolver::init (this=0x7ffc4a2c5b50, visitor=0x7ffc4a2c6070, program=0x563a002e0628) at /home/michi/development/git/qt5/qtdeclarative/src/qmlcompiler/qqmljstyperesolver.cpp:173
    #13 0x00005639ff8f0bd3 in QmltcTypeResolver::init (this=0x7ffc4a2c5b50, visitor=0x7ffc4a2c6070, program=0x563a002e0628) at /home/michi/development/git/qt5/qtdeclarative/tools/qmltc/qmltctyperesolver.cpp:19
    #14 0x00005639ff8c02d4 in main (argc=23, argv=0x7ffc4a2c7a68) at /home/michi/development/git/qt5/qtdeclarative/tools/qmltc/main.cpp:269

[1] https://doc.qt.io/qt-6/qstring.html#comparing-strings

Change-Id: I82ebbcdca4ab90155b935f9af24b3a3821134563
Reviewed-by: Sami Shalayel <sami.shalayel@qt.io>
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
@cla-assistant
Copy link

cla-assistant bot commented Nov 15, 2024

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you all sign our Contributor License Agreement before we can accept your contribution.
0 out of 16 committers have signed the CLA.

❌ Richard Moe Gustavsen
❌ jaheikk
❌ timblechmann
❌ dilekakcaay
❌ ulfhermannqt
❌ eskilblomfeldt
❌ mitchcurtis
❌ qtrampe
❌ dorisverria1
❌ Morteza-Jamshidi
❌ Inkane
❌ alcazaco
❌ aavit
❌ ec1oud
❌ samishalayel
❌ FriedemannKleint


Richard Moe Gustavsen seems not to be a GitHub user. You need a GitHub account to be able to sign the CLA. If you have already a GitHub account, please add the email address used for this commit to your account.
You have signed the CLA already but the status is still pending? Let us recheck it.

qtprojectorg pushed a commit that referenced this pull request Sep 9, 2025
Use dimmer as a context object rather than the test itself, which
outlives it.

The backtrace was:

    FAIL!  : tst_QQuickPopup::Basic::fadeDimmer(modal) The computed value is expected to be greater than the baseline, but is not
       Computed (opacityChangeCount): 2
       Baseline (2)                 : 2
       Loc: [/Users/mitch/dev/qt-dev2/qtdeclarative/tests/auto/quickcontrols/qquickpopup/tst_qquickpopup.cpp(2629)]
    =================================================================
    ==68826==ERROR: AddressSanitizer: stack-use-after-scope on address 0x00016b7f7140 at pc 0x000104743c68 bp 0x00016b7ecfd0 sp 0x00016b7ecfc8
    READ of size 4 at 0x00016b7f7140 thread T0
        #0 0x000104743c64 in tst_QQuickPopup::fadeDimmer()::$_0::operator()() const tst_qquickpopup.cpp:2625
        #1 0x000104743bc0 in QtPrivate::FunctorCall<std::__1::integer_sequence<unsigned long>, QtPrivate::List<>, void, tst_QQuickPopup::fadeDimmer()::$_0>::call(tst_QQuickPopup::fadeDimmer()::$_0&, void**)::'lambda'()::operator()() const qobjectdefs_impl.h:116
        #2 0x000104743b64 in void QtPrivate::FunctorCallBase::call_internal<void, QtPrivate::FunctorCall<std::__1::integer_sequence<unsigned long>, QtPrivate::List<>, void, tst_QQuickPopup::fadeDimmer()::$_0>::call(tst_QQuickPopup::fadeDimmer()::$_0&, void**)::'lambda'()>(void**, QtPrivate::FunctorCall<std::__1::integer_sequence<unsigned long>, QtPrivate::List<>, void, tst_QQuickPopup::fadeDimmer()::$_0>::call(tst_QQuickPopup::fadeDimmer()::$_0&, void**)::'lambda'()&&) qobjectdefs_impl.h:65
        #3 0x000104743ab4 in QtPrivate::FunctorCall<std::__1::integer_sequence<unsigned long>, QtPrivate::List<>, void, tst_QQuickPopup::fadeDimmer()::$_0>::call(tst_QQuickPopup::fadeDimmer()::$_0&, void**) qobjectdefs_impl.h:115
        #4 0x000104743930 in void QtPrivate::FunctorCallable<tst_QQuickPopup::fadeDimmer()::$_0>::call<QtPrivate::List<>, void>(tst_QQuickPopup::fadeDimmer()::$_0&, void*, void**) qobjectdefs_impl.h:337
        #5 0x000104743848 in QtPrivate::QCallableObject<tst_QQuickPopup::fadeDimmer()::$_0, QtPrivate::List<>, void>::impl(int, QtPrivate::QSlotObjectBase*, QObject*, void**, bool*) qobjectdefs_impl.h:547
        #6 0x00011694273c in QtPrivate::QSlotObjectBase::call(QObject*, void**) qobjectdefs_impl.h:461
        #7 0x000116e49454 in void doActivate<false>(QObject*, int, void**) qobject.cpp:4284
        #8 0x000116e467a0 in QMetaObject::activate(QObject*, QMetaObject const*, int, void**) qobject.cpp:4344
        #9 0x00010c1462d4 in QQuickItem::opacityChanged() moc_qquickitem.cpp:1019
        #10 0x00010c1461c8 in QQuickItem::setOpacity(double) qquickitem.cpp:6517
        #11 0x00010c168638 in QQuickItem::qt_static_metacall(QObject*, QMetaObject::Call, int, void**) moc_qquickitem.cpp:850
        #12 0x000113847100 in QQmlPropertyData::writeProperty(QObject*, void*, QFlags<QQmlPropertyData::WriteFlag>) const qqmlpropertydata_p.h:413
        #13 0x000113c33468 in QQmlPropertyPrivate::write(QObject*, QQmlPropertyData const&, QVariant const&, QQmlRefPointer<QQmlContextData> const&, QFlags<QQmlPropertyData::WriteFlag>) qqmlproperty.cpp:1668
        #14 0x000113c32638 in QQmlPropertyPrivate::writeValueProperty(QObject*, QQmlPropertyData const&, QQmlPropertyData const&, QVariant const&, QQmlRefPointer<QQmlContextData> const&, QFlags<QQmlPropertyData::WriteFlag>) qqmlproperty.cpp:1326
        #15 0x000113c32390 in QQmlPropertyPrivate::writeValueProperty(QVariant const&, QFlags<QQmlPropertyData::WriteFlag>) qqmlproperty.cpp:1270
        #16 0x000113c391b4 in QQmlPropertyPrivate::write(QQmlProperty const&, QVariant const&, QFlags<QQmlPropertyData::WriteFlag>) qqmlproperty.cpp:1947
        #17 0x00010c9949ac in QQuickAnimationPropertyUpdater::setValue(double) qquickanimation.cpp:2740
        #18 0x00010c992444 in QQuickBulkValueAnimator::updateCurrentTime(int) qquickanimation.cpp:2069
        #19 0x000114345428 in QAbstractAnimationJob::setCurrentTime(int) qabstractanimationjob.cpp:481
        #20 0x000114349c3c in QAbstractAnimationJob::setState(QAbstractAnimationJob::State) qabstractanimationjob.cpp:367
        #21 0x00011434bc34 in QAbstractAnimationJob::start() qabstractanimationjob.cpp:514
        #22 0x00010c9ff568 in QQuickBehavior::write(QVariant const&) qquickbehavior.cpp:419
        #23 0x00010c9ff88c in non-virtual thunk to QQuickBehavior::write(QVariant const&) qquickbehavior.cpp
        #24 0x000113f53b7c in QQmlInterceptorMetaObject::doIntercept(QMetaObject::Call, int, void**) qqmlvmemetaobject.cpp:392
        #25 0x000113f532e4 in QQmlInterceptorMetaObject::intercept(QMetaObject::Call, int, void**) qqmlvmemetaobject_p.h:153
        #26 0x000113f59788 in QQmlVMEMetaObject::metaCall(QObject*, QMetaObject::Call, int, void**) qqmlvmemetaobject.cpp:750
        #27 0x0001138474d0 in void QQmlPropertyData::doMetacall<(QMetaObject::Call)2>(QObject*, int, void**) const qqmlpropertydata_p.h:395
        #28 0x000113847128 in QQmlPropertyData::writeProperty(QObject*, void*, QFlags<QQmlPropertyData::WriteFlag>) const qqmlpropertydata_p.h:415
        #29 0x000113c33468 in QQmlPropertyPrivate::write(QObject*, QQmlPropertyData const&, QVariant const&, QQmlRefPointer<QQmlContextData> const&, QFlags<QQmlPropertyData::WriteFlag>) qqmlproperty.cpp:1668
        #30 0x000113c32638 in QQmlPropertyPrivate::writeValueProperty(QObject*, QQmlPropertyData const&, QQmlPropertyData const&, QVariant const&, QQmlRefPointer<QQmlContextData> const&, QFlags<QQmlPropertyData::WriteFlag>) qqmlproperty.cpp:1326
        #31 0x000113c32390 in QQmlPropertyPrivate::writeValueProperty(QVariant const&, QFlags<QQmlPropertyData::WriteFlag>) qqmlproperty.cpp:1270
        #32 0x000113c391b4 in QQmlPropertyPrivate::write(QQmlProperty const&, QVariant const&, QFlags<QQmlPropertyData::WriteFlag>) qqmlproperty.cpp:1947
        #33 0x000113c38f84 in QQmlProperty::write(QVariant const&) const qqmlproperty.cpp:1863
        #34 0x000113c39358 in QQmlProperty::write(QObject*, QString const&, QVariant const&) qqmlproperty.cpp:1880
        #35 0x000107c1db04 in QQuickPopupPrivate::hideDimmer() qquickpopup.cpp:1290
        #36 0x000107c16a68 in QQuickPopupPrivate::prepareExitTransition() qquickpopup.cpp:821
        #37 0x000107c1e038 in QQuickPopupTransitionManager::transitionExit() qquickpopup.cpp:1326
        #38 0x000107c23fd4 in QQuickPopup::setVisible(bool) qquickpopup.cpp:2496
        #39 0x000107c104d8 in QQuickPopup::close() qquickpopup.cpp:1408
        #40 0x000107c1ba80 in QQuickPopup::setParentItem(QQuickItem*) qquickpopup.cpp:2180
        #41 0x000107c1b324 in QQuickPopupPrivate::itemDestroyed(QQuickItem*) qquickpopup.cpp:1063
        #42 0x000107c1bb8c in non-virtual thunk to QQuickPopupPrivate::itemDestroyed(QQuickItem*) qquickpopup.cpp
        #43 0x00010c117f70 in void QQuickItemPrivate::notifyChangeListeners<void (QQuickItemChangeListener::*)(QQuickItem*), QQuickItem*>(QFlags<QQuickItemPrivate::ChangeType>, void (QQuickItemChangeListener::*&&)(QQuickItem*), QQuickItem*&&) qquickitem_p.h:413
        #44 0x00010c113d7c in QQuickItem::~QQuickItem() qquickitem.cpp:2420
        #45 0x00010c50e3e8 in QQuickRootItem::~QQuickRootItem() qquickwindow_p.h:62
        #46 0x00010c4ed840 in QQuickRootItem::~QQuickRootItem() qquickwindow_p.h:62
        #47 0x00010c4ed86c in QQuickRootItem::~QQuickRootItem() qquickwindow_p.h:62
        #48 0x00010c4da1c0 in QQuickWindow::~QQuickWindow() qquickwindow.cpp:1197
        #49 0x00010c531f34 in QQuickWindowQmlImpl::~QQuickWindowQmlImpl() qquickwindowmodule.cpp:73
        #50 0x00010cf2d4f4 in QQmlPrivate::QQmlElement<QQuickWindowQmlImpl>::~QQmlElement() qqmlprivate.h:104
        #51 0x00010cf2d3e0 in QQmlPrivate::QQmlElement<QQuickWindowQmlImpl>::~QQmlElement() qqmlprivate.h:102
        #52 0x00010cf2d40c in QQmlPrivate::QQmlElement<QQuickWindowQmlImpl>::~QQmlElement() qqmlprivate.h:102
        #53 0x00010472efa8 in QScopedPointerDeleter<QObject>::cleanup(QObject*) qscopedpointer.h:24
        #54 0x00010472eefc in QScopedPointer<QObject, QScopedPointerDeleter<QObject>>::~QScopedPointer() qscopedpointer.h:81
        #55 0x00010466f0e8 in QScopedPointer<QObject, QScopedPointerDeleter<QObject>>::~QScopedPointer() qscopedpointer.h:79
        #56 0x00010471246c in QQuickVisualTestUtils::QQuickApplicationHelper::~QQuickApplicationHelper() visualtestutils_p.h:192
        #57 0x00010468ff88 in QQuickVisualTestUtils::QQuickApplicationHelper::~QQuickApplicationHelper() visualtestutils_p.h:192
        #58 0x0001046a953c in tst_QQuickPopup::fadeDimmer() tst_qquickpopup.cpp:2635
        [...]

Amends ef8bde8.

Pick-to: 6.8 6.9 6.10
Change-Id: Ie5c49b7d9ecd3c74f822590d296062b516563391
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
qtprojectorg pushed a commit that referenced this pull request Sep 12, 2025
Use dimmer as a context object rather than the test itself, which
outlives it.

The backtrace was:

    FAIL!  : tst_QQuickPopup::Basic::fadeDimmer(modal) The computed value is expected to be greater than the baseline, but is not
       Computed (opacityChangeCount): 2
       Baseline (2)                 : 2
       Loc: [/Users/mitch/dev/qt-dev2/qtdeclarative/tests/auto/quickcontrols/qquickpopup/tst_qquickpopup.cpp(2629)]
    =================================================================
    ==68826==ERROR: AddressSanitizer: stack-use-after-scope on address 0x00016b7f7140 at pc 0x000104743c68 bp 0x00016b7ecfd0 sp 0x00016b7ecfc8
    READ of size 4 at 0x00016b7f7140 thread T0
        #0 0x000104743c64 in tst_QQuickPopup::fadeDimmer()::$_0::operator()() const tst_qquickpopup.cpp:2625
        #1 0x000104743bc0 in QtPrivate::FunctorCall<std::__1::integer_sequence<unsigned long>, QtPrivate::List<>, void, tst_QQuickPopup::fadeDimmer()::$_0>::call(tst_QQuickPopup::fadeDimmer()::$_0&, void**)::'lambda'()::operator()() const qobjectdefs_impl.h:116
        #2 0x000104743b64 in void QtPrivate::FunctorCallBase::call_internal<void, QtPrivate::FunctorCall<std::__1::integer_sequence<unsigned long>, QtPrivate::List<>, void, tst_QQuickPopup::fadeDimmer()::$_0>::call(tst_QQuickPopup::fadeDimmer()::$_0&, void**)::'lambda'()>(void**, QtPrivate::FunctorCall<std::__1::integer_sequence<unsigned long>, QtPrivate::List<>, void, tst_QQuickPopup::fadeDimmer()::$_0>::call(tst_QQuickPopup::fadeDimmer()::$_0&, void**)::'lambda'()&&) qobjectdefs_impl.h:65
        #3 0x000104743ab4 in QtPrivate::FunctorCall<std::__1::integer_sequence<unsigned long>, QtPrivate::List<>, void, tst_QQuickPopup::fadeDimmer()::$_0>::call(tst_QQuickPopup::fadeDimmer()::$_0&, void**) qobjectdefs_impl.h:115
        #4 0x000104743930 in void QtPrivate::FunctorCallable<tst_QQuickPopup::fadeDimmer()::$_0>::call<QtPrivate::List<>, void>(tst_QQuickPopup::fadeDimmer()::$_0&, void*, void**) qobjectdefs_impl.h:337
        #5 0x000104743848 in QtPrivate::QCallableObject<tst_QQuickPopup::fadeDimmer()::$_0, QtPrivate::List<>, void>::impl(int, QtPrivate::QSlotObjectBase*, QObject*, void**, bool*) qobjectdefs_impl.h:547
        #6 0x00011694273c in QtPrivate::QSlotObjectBase::call(QObject*, void**) qobjectdefs_impl.h:461
        #7 0x000116e49454 in void doActivate<false>(QObject*, int, void**) qobject.cpp:4284
        #8 0x000116e467a0 in QMetaObject::activate(QObject*, QMetaObject const*, int, void**) qobject.cpp:4344
        #9 0x00010c1462d4 in QQuickItem::opacityChanged() moc_qquickitem.cpp:1019
        #10 0x00010c1461c8 in QQuickItem::setOpacity(double) qquickitem.cpp:6517
        #11 0x00010c168638 in QQuickItem::qt_static_metacall(QObject*, QMetaObject::Call, int, void**) moc_qquickitem.cpp:850
        #12 0x000113847100 in QQmlPropertyData::writeProperty(QObject*, void*, QFlags<QQmlPropertyData::WriteFlag>) const qqmlpropertydata_p.h:413
        #13 0x000113c33468 in QQmlPropertyPrivate::write(QObject*, QQmlPropertyData const&, QVariant const&, QQmlRefPointer<QQmlContextData> const&, QFlags<QQmlPropertyData::WriteFlag>) qqmlproperty.cpp:1668
        #14 0x000113c32638 in QQmlPropertyPrivate::writeValueProperty(QObject*, QQmlPropertyData const&, QQmlPropertyData const&, QVariant const&, QQmlRefPointer<QQmlContextData> const&, QFlags<QQmlPropertyData::WriteFlag>) qqmlproperty.cpp:1326
        #15 0x000113c32390 in QQmlPropertyPrivate::writeValueProperty(QVariant const&, QFlags<QQmlPropertyData::WriteFlag>) qqmlproperty.cpp:1270
        #16 0x000113c391b4 in QQmlPropertyPrivate::write(QQmlProperty const&, QVariant const&, QFlags<QQmlPropertyData::WriteFlag>) qqmlproperty.cpp:1947
        #17 0x00010c9949ac in QQuickAnimationPropertyUpdater::setValue(double) qquickanimation.cpp:2740
        #18 0x00010c992444 in QQuickBulkValueAnimator::updateCurrentTime(int) qquickanimation.cpp:2069
        #19 0x000114345428 in QAbstractAnimationJob::setCurrentTime(int) qabstractanimationjob.cpp:481
        #20 0x000114349c3c in QAbstractAnimationJob::setState(QAbstractAnimationJob::State) qabstractanimationjob.cpp:367
        #21 0x00011434bc34 in QAbstractAnimationJob::start() qabstractanimationjob.cpp:514
        #22 0x00010c9ff568 in QQuickBehavior::write(QVariant const&) qquickbehavior.cpp:419
        #23 0x00010c9ff88c in non-virtual thunk to QQuickBehavior::write(QVariant const&) qquickbehavior.cpp
        #24 0x000113f53b7c in QQmlInterceptorMetaObject::doIntercept(QMetaObject::Call, int, void**) qqmlvmemetaobject.cpp:392
        #25 0x000113f532e4 in QQmlInterceptorMetaObject::intercept(QMetaObject::Call, int, void**) qqmlvmemetaobject_p.h:153
        #26 0x000113f59788 in QQmlVMEMetaObject::metaCall(QObject*, QMetaObject::Call, int, void**) qqmlvmemetaobject.cpp:750
        #27 0x0001138474d0 in void QQmlPropertyData::doMetacall<(QMetaObject::Call)2>(QObject*, int, void**) const qqmlpropertydata_p.h:395
        #28 0x000113847128 in QQmlPropertyData::writeProperty(QObject*, void*, QFlags<QQmlPropertyData::WriteFlag>) const qqmlpropertydata_p.h:415
        #29 0x000113c33468 in QQmlPropertyPrivate::write(QObject*, QQmlPropertyData const&, QVariant const&, QQmlRefPointer<QQmlContextData> const&, QFlags<QQmlPropertyData::WriteFlag>) qqmlproperty.cpp:1668
        #30 0x000113c32638 in QQmlPropertyPrivate::writeValueProperty(QObject*, QQmlPropertyData const&, QQmlPropertyData const&, QVariant const&, QQmlRefPointer<QQmlContextData> const&, QFlags<QQmlPropertyData::WriteFlag>) qqmlproperty.cpp:1326
        #31 0x000113c32390 in QQmlPropertyPrivate::writeValueProperty(QVariant const&, QFlags<QQmlPropertyData::WriteFlag>) qqmlproperty.cpp:1270
        #32 0x000113c391b4 in QQmlPropertyPrivate::write(QQmlProperty const&, QVariant const&, QFlags<QQmlPropertyData::WriteFlag>) qqmlproperty.cpp:1947
        #33 0x000113c38f84 in QQmlProperty::write(QVariant const&) const qqmlproperty.cpp:1863
        #34 0x000113c39358 in QQmlProperty::write(QObject*, QString const&, QVariant const&) qqmlproperty.cpp:1880
        #35 0x000107c1db04 in QQuickPopupPrivate::hideDimmer() qquickpopup.cpp:1290
        #36 0x000107c16a68 in QQuickPopupPrivate::prepareExitTransition() qquickpopup.cpp:821
        #37 0x000107c1e038 in QQuickPopupTransitionManager::transitionExit() qquickpopup.cpp:1326
        #38 0x000107c23fd4 in QQuickPopup::setVisible(bool) qquickpopup.cpp:2496
        #39 0x000107c104d8 in QQuickPopup::close() qquickpopup.cpp:1408
        #40 0x000107c1ba80 in QQuickPopup::setParentItem(QQuickItem*) qquickpopup.cpp:2180
        #41 0x000107c1b324 in QQuickPopupPrivate::itemDestroyed(QQuickItem*) qquickpopup.cpp:1063
        #42 0x000107c1bb8c in non-virtual thunk to QQuickPopupPrivate::itemDestroyed(QQuickItem*) qquickpopup.cpp
        #43 0x00010c117f70 in void QQuickItemPrivate::notifyChangeListeners<void (QQuickItemChangeListener::*)(QQuickItem*), QQuickItem*>(QFlags<QQuickItemPrivate::ChangeType>, void (QQuickItemChangeListener::*&&)(QQuickItem*), QQuickItem*&&) qquickitem_p.h:413
        #44 0x00010c113d7c in QQuickItem::~QQuickItem() qquickitem.cpp:2420
        #45 0x00010c50e3e8 in QQuickRootItem::~QQuickRootItem() qquickwindow_p.h:62
        #46 0x00010c4ed840 in QQuickRootItem::~QQuickRootItem() qquickwindow_p.h:62
        #47 0x00010c4ed86c in QQuickRootItem::~QQuickRootItem() qquickwindow_p.h:62
        #48 0x00010c4da1c0 in QQuickWindow::~QQuickWindow() qquickwindow.cpp:1197
        #49 0x00010c531f34 in QQuickWindowQmlImpl::~QQuickWindowQmlImpl() qquickwindowmodule.cpp:73
        #50 0x00010cf2d4f4 in QQmlPrivate::QQmlElement<QQuickWindowQmlImpl>::~QQmlElement() qqmlprivate.h:104
        #51 0x00010cf2d3e0 in QQmlPrivate::QQmlElement<QQuickWindowQmlImpl>::~QQmlElement() qqmlprivate.h:102
        #52 0x00010cf2d40c in QQmlPrivate::QQmlElement<QQuickWindowQmlImpl>::~QQmlElement() qqmlprivate.h:102
        #53 0x00010472efa8 in QScopedPointerDeleter<QObject>::cleanup(QObject*) qscopedpointer.h:24
        #54 0x00010472eefc in QScopedPointer<QObject, QScopedPointerDeleter<QObject>>::~QScopedPointer() qscopedpointer.h:81
        #55 0x00010466f0e8 in QScopedPointer<QObject, QScopedPointerDeleter<QObject>>::~QScopedPointer() qscopedpointer.h:79
        #56 0x00010471246c in QQuickVisualTestUtils::QQuickApplicationHelper::~QQuickApplicationHelper() visualtestutils_p.h:192
        #57 0x00010468ff88 in QQuickVisualTestUtils::QQuickApplicationHelper::~QQuickApplicationHelper() visualtestutils_p.h:192
        #58 0x0001046a953c in tst_QQuickPopup::fadeDimmer() tst_qquickpopup.cpp:2635
        [...]

Amends ef8bde8.

Pick-to: 6.9 6.8
Change-Id: Ie5c49b7d9ecd3c74f822590d296062b516563391
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit f8742ca)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
qtprojectorg pushed a commit that referenced this pull request Sep 12, 2025
Use dimmer as a context object rather than the test itself, which
outlives it.

The backtrace was:

    FAIL!  : tst_QQuickPopup::Basic::fadeDimmer(modal) The computed value is expected to be greater than the baseline, but is not
       Computed (opacityChangeCount): 2
       Baseline (2)                 : 2
       Loc: [/Users/mitch/dev/qt-dev2/qtdeclarative/tests/auto/quickcontrols/qquickpopup/tst_qquickpopup.cpp(2629)]
    =================================================================
    ==68826==ERROR: AddressSanitizer: stack-use-after-scope on address 0x00016b7f7140 at pc 0x000104743c68 bp 0x00016b7ecfd0 sp 0x00016b7ecfc8
    READ of size 4 at 0x00016b7f7140 thread T0
        #0 0x000104743c64 in tst_QQuickPopup::fadeDimmer()::$_0::operator()() const tst_qquickpopup.cpp:2625
        #1 0x000104743bc0 in QtPrivate::FunctorCall<std::__1::integer_sequence<unsigned long>, QtPrivate::List<>, void, tst_QQuickPopup::fadeDimmer()::$_0>::call(tst_QQuickPopup::fadeDimmer()::$_0&, void**)::'lambda'()::operator()() const qobjectdefs_impl.h:116
        #2 0x000104743b64 in void QtPrivate::FunctorCallBase::call_internal<void, QtPrivate::FunctorCall<std::__1::integer_sequence<unsigned long>, QtPrivate::List<>, void, tst_QQuickPopup::fadeDimmer()::$_0>::call(tst_QQuickPopup::fadeDimmer()::$_0&, void**)::'lambda'()>(void**, QtPrivate::FunctorCall<std::__1::integer_sequence<unsigned long>, QtPrivate::List<>, void, tst_QQuickPopup::fadeDimmer()::$_0>::call(tst_QQuickPopup::fadeDimmer()::$_0&, void**)::'lambda'()&&) qobjectdefs_impl.h:65
        #3 0x000104743ab4 in QtPrivate::FunctorCall<std::__1::integer_sequence<unsigned long>, QtPrivate::List<>, void, tst_QQuickPopup::fadeDimmer()::$_0>::call(tst_QQuickPopup::fadeDimmer()::$_0&, void**) qobjectdefs_impl.h:115
        #4 0x000104743930 in void QtPrivate::FunctorCallable<tst_QQuickPopup::fadeDimmer()::$_0>::call<QtPrivate::List<>, void>(tst_QQuickPopup::fadeDimmer()::$_0&, void*, void**) qobjectdefs_impl.h:337
        #5 0x000104743848 in QtPrivate::QCallableObject<tst_QQuickPopup::fadeDimmer()::$_0, QtPrivate::List<>, void>::impl(int, QtPrivate::QSlotObjectBase*, QObject*, void**, bool*) qobjectdefs_impl.h:547
        #6 0x00011694273c in QtPrivate::QSlotObjectBase::call(QObject*, void**) qobjectdefs_impl.h:461
        #7 0x000116e49454 in void doActivate<false>(QObject*, int, void**) qobject.cpp:4284
        #8 0x000116e467a0 in QMetaObject::activate(QObject*, QMetaObject const*, int, void**) qobject.cpp:4344
        #9 0x00010c1462d4 in QQuickItem::opacityChanged() moc_qquickitem.cpp:1019
        #10 0x00010c1461c8 in QQuickItem::setOpacity(double) qquickitem.cpp:6517
        #11 0x00010c168638 in QQuickItem::qt_static_metacall(QObject*, QMetaObject::Call, int, void**) moc_qquickitem.cpp:850
        #12 0x000113847100 in QQmlPropertyData::writeProperty(QObject*, void*, QFlags<QQmlPropertyData::WriteFlag>) const qqmlpropertydata_p.h:413
        #13 0x000113c33468 in QQmlPropertyPrivate::write(QObject*, QQmlPropertyData const&, QVariant const&, QQmlRefPointer<QQmlContextData> const&, QFlags<QQmlPropertyData::WriteFlag>) qqmlproperty.cpp:1668
        #14 0x000113c32638 in QQmlPropertyPrivate::writeValueProperty(QObject*, QQmlPropertyData const&, QQmlPropertyData const&, QVariant const&, QQmlRefPointer<QQmlContextData> const&, QFlags<QQmlPropertyData::WriteFlag>) qqmlproperty.cpp:1326
        #15 0x000113c32390 in QQmlPropertyPrivate::writeValueProperty(QVariant const&, QFlags<QQmlPropertyData::WriteFlag>) qqmlproperty.cpp:1270
        #16 0x000113c391b4 in QQmlPropertyPrivate::write(QQmlProperty const&, QVariant const&, QFlags<QQmlPropertyData::WriteFlag>) qqmlproperty.cpp:1947
        #17 0x00010c9949ac in QQuickAnimationPropertyUpdater::setValue(double) qquickanimation.cpp:2740
        #18 0x00010c992444 in QQuickBulkValueAnimator::updateCurrentTime(int) qquickanimation.cpp:2069
        #19 0x000114345428 in QAbstractAnimationJob::setCurrentTime(int) qabstractanimationjob.cpp:481
        #20 0x000114349c3c in QAbstractAnimationJob::setState(QAbstractAnimationJob::State) qabstractanimationjob.cpp:367
        #21 0x00011434bc34 in QAbstractAnimationJob::start() qabstractanimationjob.cpp:514
        #22 0x00010c9ff568 in QQuickBehavior::write(QVariant const&) qquickbehavior.cpp:419
        #23 0x00010c9ff88c in non-virtual thunk to QQuickBehavior::write(QVariant const&) qquickbehavior.cpp
        #24 0x000113f53b7c in QQmlInterceptorMetaObject::doIntercept(QMetaObject::Call, int, void**) qqmlvmemetaobject.cpp:392
        #25 0x000113f532e4 in QQmlInterceptorMetaObject::intercept(QMetaObject::Call, int, void**) qqmlvmemetaobject_p.h:153
        #26 0x000113f59788 in QQmlVMEMetaObject::metaCall(QObject*, QMetaObject::Call, int, void**) qqmlvmemetaobject.cpp:750
        #27 0x0001138474d0 in void QQmlPropertyData::doMetacall<(QMetaObject::Call)2>(QObject*, int, void**) const qqmlpropertydata_p.h:395
        #28 0x000113847128 in QQmlPropertyData::writeProperty(QObject*, void*, QFlags<QQmlPropertyData::WriteFlag>) const qqmlpropertydata_p.h:415
        #29 0x000113c33468 in QQmlPropertyPrivate::write(QObject*, QQmlPropertyData const&, QVariant const&, QQmlRefPointer<QQmlContextData> const&, QFlags<QQmlPropertyData::WriteFlag>) qqmlproperty.cpp:1668
        #30 0x000113c32638 in QQmlPropertyPrivate::writeValueProperty(QObject*, QQmlPropertyData const&, QQmlPropertyData const&, QVariant const&, QQmlRefPointer<QQmlContextData> const&, QFlags<QQmlPropertyData::WriteFlag>) qqmlproperty.cpp:1326
        #31 0x000113c32390 in QQmlPropertyPrivate::writeValueProperty(QVariant const&, QFlags<QQmlPropertyData::WriteFlag>) qqmlproperty.cpp:1270
        #32 0x000113c391b4 in QQmlPropertyPrivate::write(QQmlProperty const&, QVariant const&, QFlags<QQmlPropertyData::WriteFlag>) qqmlproperty.cpp:1947
        #33 0x000113c38f84 in QQmlProperty::write(QVariant const&) const qqmlproperty.cpp:1863
        #34 0x000113c39358 in QQmlProperty::write(QObject*, QString const&, QVariant const&) qqmlproperty.cpp:1880
        #35 0x000107c1db04 in QQuickPopupPrivate::hideDimmer() qquickpopup.cpp:1290
        #36 0x000107c16a68 in QQuickPopupPrivate::prepareExitTransition() qquickpopup.cpp:821
        #37 0x000107c1e038 in QQuickPopupTransitionManager::transitionExit() qquickpopup.cpp:1326
        #38 0x000107c23fd4 in QQuickPopup::setVisible(bool) qquickpopup.cpp:2496
        #39 0x000107c104d8 in QQuickPopup::close() qquickpopup.cpp:1408
        #40 0x000107c1ba80 in QQuickPopup::setParentItem(QQuickItem*) qquickpopup.cpp:2180
        #41 0x000107c1b324 in QQuickPopupPrivate::itemDestroyed(QQuickItem*) qquickpopup.cpp:1063
        #42 0x000107c1bb8c in non-virtual thunk to QQuickPopupPrivate::itemDestroyed(QQuickItem*) qquickpopup.cpp
        #43 0x00010c117f70 in void QQuickItemPrivate::notifyChangeListeners<void (QQuickItemChangeListener::*)(QQuickItem*), QQuickItem*>(QFlags<QQuickItemPrivate::ChangeType>, void (QQuickItemChangeListener::*&&)(QQuickItem*), QQuickItem*&&) qquickitem_p.h:413
        #44 0x00010c113d7c in QQuickItem::~QQuickItem() qquickitem.cpp:2420
        #45 0x00010c50e3e8 in QQuickRootItem::~QQuickRootItem() qquickwindow_p.h:62
        #46 0x00010c4ed840 in QQuickRootItem::~QQuickRootItem() qquickwindow_p.h:62
        #47 0x00010c4ed86c in QQuickRootItem::~QQuickRootItem() qquickwindow_p.h:62
        #48 0x00010c4da1c0 in QQuickWindow::~QQuickWindow() qquickwindow.cpp:1197
        #49 0x00010c531f34 in QQuickWindowQmlImpl::~QQuickWindowQmlImpl() qquickwindowmodule.cpp:73
        #50 0x00010cf2d4f4 in QQmlPrivate::QQmlElement<QQuickWindowQmlImpl>::~QQmlElement() qqmlprivate.h:104
        #51 0x00010cf2d3e0 in QQmlPrivate::QQmlElement<QQuickWindowQmlImpl>::~QQmlElement() qqmlprivate.h:102
        #52 0x00010cf2d40c in QQmlPrivate::QQmlElement<QQuickWindowQmlImpl>::~QQmlElement() qqmlprivate.h:102
        #53 0x00010472efa8 in QScopedPointerDeleter<QObject>::cleanup(QObject*) qscopedpointer.h:24
        #54 0x00010472eefc in QScopedPointer<QObject, QScopedPointerDeleter<QObject>>::~QScopedPointer() qscopedpointer.h:81
        #55 0x00010466f0e8 in QScopedPointer<QObject, QScopedPointerDeleter<QObject>>::~QScopedPointer() qscopedpointer.h:79
        #56 0x00010471246c in QQuickVisualTestUtils::QQuickApplicationHelper::~QQuickApplicationHelper() visualtestutils_p.h:192
        #57 0x00010468ff88 in QQuickVisualTestUtils::QQuickApplicationHelper::~QQuickApplicationHelper() visualtestutils_p.h:192
        #58 0x0001046a953c in tst_QQuickPopup::fadeDimmer() tst_qquickpopup.cpp:2635
        [...]

Amends ef8bde8.

Pick-to: 6.8
Change-Id: Ie5c49b7d9ecd3c74f822590d296062b516563391
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit f8742ca)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
(cherry picked from commit cc726a4)
iCristalrope and others added 25 commits November 26, 2025 09:49
Task-number: QTBUG-142186
Pick-to: 6.10
Change-Id: I07228c1ddd9196532886ad3b39751d525c525432
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
We receive the individual press and release events already. Those are
enough to synthesize the double-click. The platform abstraction does not
like to be explicitly told about double-clicks.

Change-Id: Ie8da32de742e601dc99af3afee82d6177d8a7156
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
This is the same functionality we already have in the inspector service.
However, we need it in the preview, too. For such a simple thing you
shouldn't need to instantiate an extra debug service.

The animation speed method in the preview service also doesn't invert
the speed modifier. So, for double animation speed you need to pass 2,
not 0.5.

Fix the test to a, check the animation speed only on new output, rather
than everything the application has printed before and b, actually check
whether the number is in the intended range.

Task-number: QTBUG-141569
Change-Id: Ie7f7b043fb295e7c5da333ab4501059f07f2e3cd
Reviewed-by: Sami Shalayel <sami.shalayel@qt.io>
Reviewed-by: Olivier De Cannière <olivier.decanniere@qt.io>
This variable used to be static and the logic still looks like it expects it
to be so. Static was probably removed in an error. This causes unnecessary
environment variable reading and logs being printed as this function is
being called for every frame.

Change-Id: Id24d9cfecb0f509f92cef47f6a95800ff529259b
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
CalendarModel used previously set from and to values to calculate the
range and thus the count wasn't ever up to date.

Fixes: QTBUG-141883
Pick-to: 6.10 6.8
Change-Id: Id3ef60810d2e8ebfcc060307e6d17cfca379cd78
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
Pick-to: 6.10 6.8 6.5
Change-Id: I810a7137470e0ee96c76819766ede2e9bc643d73
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
We do, in fact, not expect any parsing conflict.

Change-Id: I2df5e27f42dbdd7660eb0383da3c2bb01c6fc84e
Reviewed-by: Sami Shalayel <sami.shalayel@qt.io>
Instead of forcing a re-sign, we remove the signature first, which
makes the operation silent in the success case.

Change-Id: Ic312eacfd87a6eb5795a6bd1fe841b9c37d8359d
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Alternate text (alt text) improves the documentation experience for
screen readers and for other accessibility tools.

Pick-to: 6.9 6.10
Task-number: QTBUG-135120
Change-Id: I975c3de11f893882fb9a27218079f244bd38a622
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
... as a preparation of enabling the flag in headerscheck.

The coerceValue() functions was actually flagged by GCC in a
headerscheck including -Wnrvo, probably because it was instantiated
for some type in inline code. The fromVariant() function was not
flagged automatically, but found by manual inspection.

Because the structure of code, with the pre-existing extra scope,
lends itself naturally to it, wrap the code that doesn't already
return rvalues in an IILE. Outside the lambda, the return is now
RVO'ed, and inside, NRVO'ed.

Manual inspection also found the qjsvalue_cast() overloaded functions,
but I don't readily see a fix for them, so deferring. GCC doesn't warn
for function templates unless instantiated, so for the purposes of
headerscheck, we should be good with the status quo.

Amends 7b29ed6 (coerceValue()) and
d0f4e0c (fromVariant()).

Pick-to: 6.10 6.8 6.5
Task-number: QTBUG-142146
Change-Id: I2aa0ecb5a1cdc975c2ab8dffb9fe333bbeb7bc0f
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
... for <QQmlListProperty<QObject>, QObject *>>.

Like in the primary template, return the same object in each return
statement, fixing GCC -Wnrvo, which we're going to add to
headersclean.

Amends e846864.

Pick-to: 6.10 6.8 6.5
Task-number: QTBUG-142146
Change-Id: I38e9e8374e51d147cdaf4276fa791489117ee4e3
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
Its unused and unreadable.

Task-number: QTBUG-142187
Change-Id: I9425347860ccd5375ad147c999a7ad8404929327
Reviewed-by: Semih Yavuz <semih.yavuz@qt.io>
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
It has only one usage, has one line of code and clutters the already too
full DomItem interface. Replace the only usage with the function code.

Task-number: QTBUG-142187
Change-Id: I38349c1130bb382b344241710be6d71e7426cb94
Reviewed-by: Semih Yavuz <semih.yavuz@qt.io>
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Move the code from dvValueLazy to its only usage. This helps
uncluttering the DomItem interface that has too many of these methods.

Task-number: QTBUG-142187
Change-Id: I31baf9a9ca96c2fa538b3eacd6ff5b2ce64698cd
Reviewed-by: Semih Yavuz <semih.yavuz@qt.io>
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Move the code to its only usage, and remove the method. This helps
unclutter the DomItem interface.

Task-number: QTBUG-142187
Change-Id: I2b07a97eff0e2b6b20c6e2f27dd8138856feb6e5
Reviewed-by: Semih Yavuz <semih.yavuz@qt.io>
Both only have one usage and are one-liners. Move them to their single
usage location. This helps unclutter the DomItem interface.

Task-number: QTBUG-142187
Change-Id: I583cf41cf31584284d16608d8cc1b7f3303a87d6
Reviewed-by: Semih Yavuz <semih.yavuz@qt.io>
DomItem interface is already too cluttered, remove the comment
indicating that yet another dv* method should be added.

Task-number: QTBUG-142187
Change-Id: If4b76c031de663b7231fb7cf938048b51e027201
Reviewed-by: Semih Yavuz <semih.yavuz@qt.io>
Move the code to the single usage of dvWrap, This unclutters the DomItem
interface.

Task-number: QTBUG-142187
Change-Id: I9482f0241330b25075600d62563770d5e6cba8f5
Reviewed-by: Semih Yavuz <semih.yavuz@qt.io>
It has two usages and just calls a constructor. Move the code to their
usages. This helps unclutters DomItem interface.

Task-number: QTBUG-142187
Change-Id: Id602a5e833b42e4b0f60b0b1ddb62a11634bc382
Reviewed-by: Semih Yavuz <semih.yavuz@qt.io>
Change-Id: I9833c9c690b89e57ca511dd2a43e7a979c97367a
Reviewed-by: Andreas Eliasson <andreas.eliasson@qt.io>
QtC has a well-tested diff calculator which works in the core of
DiffEditor plugin. Adapt it in qtdeclarative to be
used as qmlls utility by modernizing a little and removing the
unnecessary api that won't be needed. The first use case will be
shifting highlights based on the calculated differences. Also,
regexp-based highlighting would perform only on the diffed context
rather than the entire source code.

Task-number: QTBUG-140645
Change-Id: I5e88e4c6d77c1432b25eb226f9f5444928b9b156
Reviewed-by: Olivier De Cannière <olivier.decanniere@qt.io>
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Add logic that shifts existing highlight tokens when the document is
modified and becomes invalid. Introduce the applyDiffs helper, which
takes a list of diffs between the current document and the last valid
one.

High-level strategy:

Represent highlights as a map from offset to HighlightToken. Maintain a
cursor into the old document that marks the current insertion point.

For Diff::Equal, advance the cursor by the length of the equal text and
leave all highlights unchanged.

For Diff::Insert, compute insertion metadata and classify each existing
token relative to the cursor.

Tokens before the insertion remain unchanged.

Tokens after the insertion are shifted forward by the inserted length.
If the insertion is on the same line, adjust startColumn. If it contains
newlines, update startLine and recompute startColumn.

Tokens overlapping the insertion are expanded. If the insertion is in
the middle of the token, extend the token until the first whitespace to
avoid merging separate words. If the insertion begins before the token
start, move the token start to the insertion point and adjust length and
line or column values.

After processing all diffs, build the shifted highlight set and swap it
in.

Task-number: QTBUG-140645
Change-Id: Ib0431c702100517e2658a48c8ae7f2ae141dbc8c
Reviewed-by: Olivier De Cannière <olivier.decanniere@qt.io>
Implement deletion handling for semantic highlight tokens so that
tokens remain consistent after text removals. Classify tokens
relative to the deleted range and apply one of:

- keep tokens before the deletion
- shift tokens after the deletion (adjust offset, line, column)
- trim or move overlapping tokens (left/right fragment or drop)

Add helpers for overlap detection, column/line adjustment, and
an updateHighlightsOnDelete routine. Call it from Utils::applyDiffs.

Add unit tests covering single-line and multi-line deletions.

Task-number: QTBUG-140645
Change-Id: I55c1c41dc1bb58435d001a8960089b8b605ab1e9
Reviewed-by: Olivier De Cannière <olivier.decanniere@qt.io>
Task-number: QTBUG-140645
Change-Id: I72d3dbbe88f1902dc6f520cdefbc2577dea531ce
Reviewed-by: Olivier De Cannière <olivier.decanniere@qt.io>
Add a method to grab the owner of a method of a qqmljsscope, in the same
way as ownerOfProperty() does. A later patch will use it to warn about
shadowed methods.

Task-number: QTBUG-141854
Change-Id: I21247151ee3d7d298329d0bdfb2f5e0e1dd51b33
Reviewed-by: Olivier De Cannière <olivier.decanniere@qt.io>
Morteza-Jamshidi and others added 30 commits December 18, 2025 14:08
When backend renderer is software ShaderEffect doesn't render anything,
so we use canvas renderer as a fallback.

Fixes: QTBUG-139362
Change-Id: Id22305ab48d52f9bf2373c88f87cbb10c115999c
Reviewed-by: Oliver Eftevaag <oliver.eftevaag@qt.io>
Its in use, says the profiler, and completely unreadable.
Split the method up in smaller parts.

Task-number: QTBUG-142522
Change-Id: I6e09fd02c8d76fd38855ed2b33d1e5ce101f8e64
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Dmitrii Akshintsev <dmitrii.akshintsev@qt.io>
The current warning is a bit confusing, reword it to make it clearer and
actually actionable.

Task-number: QTBUG-138532
Change-Id: I1862fc9dd68135500a1b64f1440c770a97f47c02
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
It seems we forgot to add Action to the list of allowed types when the
warning was changed to include Action in
7bdeea2.

Pick-to: 6.8 6.10 6.11
Fixes: QTBUG-142549
Change-Id: I52e0ec0110e4d3915f36e3a54843d25b86d21a16
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
Add an if-condition to avoid triggering the assert inside of
qmllint. The runtime does not register this function
declaration and therefore does not trigger the assert.

QTBUG-142091 will make qmllint warn about the invalid function
definition.

Amends 009ef40.

Pick-to: 6.10 6.11
Fixes: QTBUG-142468
Change-Id: I2077908fdc83fd31bdda67a11f0e8a6949a102ae
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
We only need .qmlls.ini files to contain the path to the build folder,
and the cmake-calls option (when used by the user).

Remove the outdated import path, and the documentation directory, from
the .qmlls.ini file: instead, it should be read from the
.qmlls.build.ini (which is found by qmlls with help of the .qmlls.ini
file).

Replace add_custom_command with a file(CONFIGURE), now that we don't
need to execute qtpaths anymore for the .qmlls.ini generation.

Change-Id: I2d5e7b164d68e8e092c4995916025fd04d199f12
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
It seems that we recognize "anchors" from
PropertyChanges {
    anchors.topMargin: 12
}
as an id, which might sometimes not exist. Adapt the highlighting code
to not crash if the id does not exist, and highlight it as unknown so
the user sees that its "bad".

Pick-to: 6.10 6.11
Fixes: QTBUG-142574
Change-Id: I00fcea8bfb3d16a95d40af024c4273dae19ce747
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
In a packaged build, svgtoqml is placed next to a qt.conf file.
This caused it to fail to launch from anywhere except in its local
directory, with an error that it could not find the QPA plugin.

It turns out that this was triggered by trying to query the
available QPA plugins before creating a QGuiApplication. We did
this to avoid forcing the minimal plugin if it is not available,
but other tools that hardcode this plugin does it unconditionally,
so we do the same in svgtoqml.

Pick-to: 6.11
Task-number: QTBUG-142792
Change-Id: I2b7c0aa20c251a8fbf4f2372b8bc5e0802e298b2
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
It seems that Q_UNREACHABLE triggers UB at runtime when hit in a release
build, so remove it and log an error instead. Ignore the invalid part.

Pick-to: 6.11 6.10 6.8
Fixes: QTBUG-142711
Change-Id: I445e46a6964f072a939cd6666c15c8d1ff5a0966
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
On macOS 26, the down indicator in editable ComboBoxes
was drawn with scaling applied, causing it to appear
distorted. In addition, the focus frame was misaligned
for both editable and non-editable ComboBoxes.

This patch ensures that ComboBoxes are drawn with 9-patch
scaling disabled. Previously, enabling 9-patch scaling
caused the down indicator to be scaled together with the
background, resulting in incorrect rendering. The patch
also adjusts margins to properly center the label
and align the focus frame with the control’s frame.

Pick-to: 6.11 6.10 6.8 6.5
Change-Id: I0aafd77dd7ec098589c92fbc161a530a777b1d91
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
Previously, the padding was taken from NativeStyle.Frame,
which effectively returned the margins from QQuickCommonStyle.
These margins only account for the frame border width and
nothing else. As a result, controls appear glued to the edge
of a Frame when using the macOS style, unless the application
explicitly overrides the margins.

This patch therefore hard-codes margins matching those used by
the Fusion style, giving Frame and GroupBox a bit more visual
“air”, similar to the other styles.

Pick-to: 6.11 6.10 6.8 6.5
Change-Id: I6a80530d07a43bcaa6761cf3fc2d8a14e1fd0977
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
The layout margins on macOS 26 was wrong, which meant
a the focus ring on top of it would look really wrong
(if button focus was enabled from system settings).

This patch will adjust the layout rect so that it looks
correct on macOS 26.

Pick-to: 6.11 6.10 6.8 6.5
Change-Id: I828a4a25d3ffa58dd1fc942c25db1dcbb59f7525
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
Adjust the focus ring slightly, so that it fits the TextField
on both macOS 26 and macOS 16.4 (and before).

Pick-to: 6.11 6.10
Change-Id: Iad1d23284f593a90a252bfdf7c5f6f4d79d309a9
Reviewed-by: Dilek Akcay <dilek.akcay@qt.io>
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
The title (content) margins for a button had different margins
at the top compared to the bottom. The result was that the
label didn't end up centered on the button on macOS 26.

This patch will adjust the button title margins so that the
button label ends up centered on macOS 26. It will also
slighly adjust the margins on macOS16.4, and earlier, to make
label (more) centered on those platforms as well.

Pick-to: 6.11 6.10 6.8 6.5
Change-Id: Icd7571202add65ec312787b0aa94fd1bc49ef72a
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
…r a theme change

When macOS changes appearance, we need to inform the
style that the system colors have changed. This patch
will therefore listen for changes to the colorScheme
and do just that.

Since the colors we return should match the effective
appearance, we need to wrap the NSColor calls inside
an NSApp.effectiveAppearance block.

Pick-to: 6.11 6.10 6.8 6.5
Change-Id: I282280909927136b85cd8f46f25892f825c8cb02
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Prevent auto-linking from occurring in places where QDoc will create an
incorrect link.

Pick-to: 6.8 6.10 6.11
Change-Id: I8a031a3545ea3a785e0cbe762e84c179899e694f
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
The qmllint page describes qmllint as a standalone console tool, but
users don't have to run it in terminal. The IDEs display qmllint output
as you type. This functionality is included to the QML Language Server,
which is used in IDEs.

Fixes: QTBUG-139636
Pick-to: 6.11 6.10
Change-Id: Ib46116d341f59ae51a24504062e56ced8553b194
Reviewed-by: Sami Shalayel <sami.shalayel@qt.io>
Change-Id: I728f27668a5c2bdb4a8cd2e5e8384b6b076a1aa0
Reviewed-by: Olivier De Cannière <olivier.decanniere@qt.io>
In theory you could call toString() without providing space for the
return value. We generally check argv[0] before writing to it.

Pick-to: 6.11 6.10 6.8 6.5
Change-Id: I496eca3f428d0f8452a5bc0b1cb8ea78ee3805bb
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Olivier De Cannière <olivier.decanniere@qt.io>
We don't want to detach those containers by iterating.

Change-Id: Ieb33fa37ed8013cd726211dfdabc80af3d238d7e
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Olivier De Cannière <olivier.decanniere@qt.io>
affe09e caused the sidebar's text color
to be the same as the background, making it unusable.

Fix it by creating a binding pattern similar to Button.qml, except that
it should use the same colors as FileDialogDelegate.qml.

While fixing the text color, I also noticed that the background delegate
for sidebar differed from FileDialogDelegate.qml, so lets make a
reusable delegate that is used by both controls.

Pick-to: 6.11
Change-Id: Ic220026c2271bac83fcc84827ffd993dfa793f1c
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
In the SearchField testbench manual test for the macOS style, some
warnings were appearing because the x and y positions of the
indicators are used in this style, but are set to null in certain
test cases. A condition was added to check whether the indicators
are set before accessing their positions, preventing these warnings.

Fixes: QTBUG-141882
Pick-to: 6.11 6.10
Change-Id: I1c7a208ff32e570e384a2c41689cbfbb6d218be6
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
There is actually no guarantee that it's monotonic. Instead, use
QElapsedTimer (we could also use monotonic_clock, but the Qt API is more
convenient, except for the missing chrono return type).

Pick-to: 6.11 6.10
Change-Id: Iccdc988d0ff54dd9403f99d05b2c22fe8459ebe2
Reviewed-by: Olivier De Cannière <olivier.decanniere@qt.io>
QQmlImportInstance::resolveType is meant to resolve a type name to a
type in the import represented by the instance. It should not find the
QQmlType of a type sharing the same name in a different import.

However. to find types defined in C++, it has to use
QQmlMetaType::qmlType. It passes its URI to that function to filter out
unrelated types. However, a directory import without a qmldir will have
an empty URI. QQmlMetaType::qmlType will interpret this as "find the
type in any module", which is obviously not what we want.

Fixes: QTBUG-142407
Pick-to: 6.11 6.10 6.8 6.5
Change-Id: I45bcf1c764d7e7cf9d479283970587a4e6519ce4
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
We don't want clipRect to capture width and height. While technically
that would make sense (after all, the clipRect does change if you modify
width and height), it makes internal usage of the function problematic:
We could end up creating binding loops if it's triggered by the width or
height setter (which is the case with an upcoming change to
transformChanged).

Pick-to: 6.11
Change-Id: I3e19a9687a025e35969d16f300ca2d1b6fc8a624
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
...as well as to the cmake command to run svgtoqml at build time.

Pick-to: 6.11
Change-Id: Ib9c2115f7ac34285cc5c9d67c64e2d2ebbcd738a
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
Pick-to: 6.11
Change-Id: I16d586f1a793206daa00c5a7d14b1fdac33f516d
Reviewed-by: Robert Löhning <robert.loehning@qt.io>
Reviewed-by: Oliver Eftevaag <oliver.eftevaag@qt.io>
…is null

QQuickPopup::componentComplete() will automatically search for a
parentItem in case there's no explicit binding on parent. Since
componentComplete() also calls d->transitionManager.transitionEnter()
in case visible was set to true via the visible property, it would make
sense to simply set the visible member variable to true on a
QQuickMenu::setVisible(true) call, and delay calling transitionEnter()
on the transition manager until componentComplete() is called.

If for whatever reason the parentItem is explicitly set to nullptr after
componentComplete(), we can still prevent the menu from opening. I don't
see any potential issues with having the safeguard in
QQuickPopup::setVisible(), instead of QQuickMenu::setVisible().

Fixes: QTBUG-138193
Pick-to: 6.11 6.10 6.8
Change-Id: I869c81a6dc6977a4c7e1d88e2507ade08b84dabd
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
On WebAssembly, when clicking on a dialogs TitleBar, the dialog would
just close. That's because the event would get forwarded to the dialog
that the title bar belongs to, but since the non-client area is outside
the dialog window, it would close itself.

This behavior was unintended. Fix it by not closing the window if a
non-client area was hit.

Pick-to: 6.11 6.10 6.8
Change-Id: Id54da63e0eee22f9c3b01301762f633c99821255
Reviewed-by: Piotr Wierciński <piotr.wiercinski@qt.io>
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
Reviewed-by: Jan Arve Sæther <jan-arve.saether@qt.io>
Change-Id: Ia3da9ed5c163d9adf760f96471e07cc66297926a
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.