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 <[email protected]>
Reviewed-by: Ulf Hermann <[email protected]>
@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 19 committers have signed the CLA.

❌ Dmitrii Akshintsev
❌ eskilblomfeldt
❌ Dami-star
❌ samishalayel
❌ alpqr
❌ dorisverria1
❌ mitchcurtis
❌ AhmadSamir
❌ andreaseliasson
❌ ulfhermannqt
❌ iCristalrope
❌ vohi
❌ torarnv
❌ alcazaco
❌ marcmutz
❌ FriedemannKleint
❌ aavit
❌ Inkane
❌ ec1oud


Dmitrii Akshintsev 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 <[email protected]>
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 <[email protected]>
(cherry picked from commit f8742ca)
Reviewed-by: Qt Cherry-pick Bot <[email protected]>
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 <[email protected]>
(cherry picked from commit f8742ca)
Reviewed-by: Qt Cherry-pick Bot <[email protected]>
(cherry picked from commit cc726a4)
Nick Shaforostov and others added 25 commits November 13, 2025 15:21
Pick-to: 6.10
Change-Id: I2667210311de7ee41db1d90fff71d4d4bb388ee2
Reviewed-by: Shawn Rutledge <[email protected]>
Reviewed-by: Oliver Eftevaag <[email protected]>
Move the code out of populateInstance to improve readability. Do not
try to unify the three similarily shaped loops to keep a readable diff,
and to avoid potential mistakes during refactoring.

Change-Id: Ia85652c14f794ec04764904fe6f04bf662ac08c4
Reviewed-by: Ulf Hermann <[email protected]>
Change-Id: Ic2cb96f32d586cde7e0ce6e11671aa5061ed1010
Reviewed-by: Qt Submodule Update Bot <[email protected]>
Qt Quick Controls lacked the ability for setting a default button in a
dialog button box. This is something that we support in QtWidgets, and
it makes sense to allow dialogs with a DialogButtonBox set as the footer
to decide if a particular button should be default, and have focus when
the dialog is opened.

With this patch, we're introducing two different ways for selecting a
default button.
The first is the usage of the DialogButtonBox::defaultButton property,
which works like this:

```
DialogButtonBox {
    defaultButton: Button {
        text: qsTr("Ok")
    }
    Button {
        text: qsTr("Cancel")
    }
}

```
In the snippet above, the Button that is set as default should both be
highlighted, and be the sub focus item of the DialogButtonBox.

However, since the standardButtons property can be used to dynamically
create buttons on the fly, we also needed an alternative way for picking
a default button.

In cases where standardButtons is being used to create buttons in the
DialogButtonBox, the new defaultStandardButton property can be used:

```
DialogButtonBox {
    standardButtons: DialogButtonBox.Yes | DialogButtonBox.No
    defaultStandardButton: DialogButtonBox.Yes
}
```

Something worth noting, is that the DialogButtonBox's contentItem is
typically a ListView. ListView have the ItemIsFocusScope flag set,
meaning that we need to give focus to both the ListView, and the default
Button.

In addition, the FontDialog and ColorDialog will now make the Ok button
default, and give it focus when the dialogs are opened.
The FileDialog and FolderDialog will continue to give the ListView
focus, since that's IMO more user friendly. The MessageDialog will need
new API to take full advantage of this new feature, which will be
introduced later.

[ChangeLog][DialogButtonBox] The DialogButtonBox now has two new
properties, defaultButton and defaultStandardButton. When one of these
properties are being used, a button set as default will be highlighted
and receive activeFocus whenever the DialogButtonBox gets focus. If
a DialogButtonBox is assigned as a Dialog's footer, it will also get
focus when the Dialog is opened. This means that a Dialog with a
DialogButtonBox as its footer, will give focus to a default button when
opened. If both of these properties are unset, the first button with the
AcceptRole will get focus, but it will not be highlighted.

Fixes: QTBUG-58246
Fixes: QTBUG-139352
Change-Id: Ic083410184dd63e0e790694f782a7a98c1dc8b6e
Reviewed-by: Mitch Curtis <[email protected]>
The usage is incorrect with invalid QML syntax, this patch fixes the
issue.

Fixes: QTBUG-141913
Pick-to: 6.10
Change-Id: I39dd9141a7058a8948e40718d8d75821aea8e0f0
Reviewed-by: Santhosh Kumar <[email protected]>
Change-Id: I06db4c17289be0cda9551d523d772111a526937a
Reviewed-by: Qt Submodule Update Bot <[email protected]>
QPointF comparisons are likely to fail if there is rounding in some
branch of the code but not in others, or due to high-dpi conversion.
Whole-pixel comparison is close enough. Amends
f5140d6

Change-Id: I192f720318142b1bcb5e46f77a250bc89e75d1e4
Reviewed-by: Richard Moe Gustavsen <[email protected]>
If an item with a HoverHandler with cursorShape moves under the mouse
cursor, flushFrameSynchronousEvents() should cause the cursor to change
shape, along with hovering the item. Amends
cd7c5f9

Task-number: QTBUG-53987
Change-Id: I0fc3b093ac5377fd81205c6f50498bd8f817aa51
Reviewed-by: Richard Moe Gustavsen <[email protected]>
Pick-to: 6.10
Change-Id: Ie2d73970be8ca81c1dc755a8684f8067c83f56bc
Reviewed-by: Richard Moe Gustavsen <[email protected]>
Task-number: QTBUG-141543
Pick-to: 6.10
Change-Id: I72690a203d429a033160cc52c40c815de22356a9
Reviewed-by: Mats Honkamaa <[email protected]>
Add tests to check that Android software keyboard
performs as expected with various scenarios, such as:

	- Portrait mode
	- Landsape mode
	- Multi-window mode
	- Split-screen mode
	- CJK languages
	- Microsoft Swiftkey keyboard

There are also three different Textfields
that all have different configurations. To consider the
test completed succesfully, all of the listed
scenarios need to be completed with each of the Textfields.

Task-number: QTBUG-140933
Change-Id: Id9e82d6ca189b5f6761b47d672ee032913610bf6
Reviewed-by: Assam Boudjelthia <[email protected]>
Use _qt_internal_collect_qml_import_paths() to collect import paths for
qmlls, qmllint and qmlimportscanner.
_qt_internal_collect_qml_import_paths was previously only used to
collect import paths for qmlimportscanner.

Adapt _qt_internal_collect_qml_import_paths to add the special qmllint
import path, and remove the duplicate code for qmllint and qmlls's
import path.

Fixes QTBUG-141242 where the path of the QML module is not in the import
path of qmlls when the QML module path is a subfolder of the build
folder.

Pick-to: 6.10
Fixes: QTBUG-141242
Fixes: QTBUG-141555
Change-Id: I9fa2cc091ca08be6df9da5d6cf4794c08d3dd0ce
Reviewed-by: Alexandru Croitor <[email protected]>
Iterate over all aliases that directly or indirectly points to the
required property, and check whether it is in the root file scope. If it
is in the root scope, than the required property can be satisfied by
setting the alias, and we shouldn't warn about unsatisfied required
properties int the QML component itself. Instead, we warn at the
place where the QML component is instantiated if the alias is not set.

Pick-to: 6.10
Task-number: QTBUG-141086
Change-Id: I9237d0afd2e427558ebc2b5cbc97beb5248ec6a3
Reviewed-by: Ulf Hermann <[email protected]>
Reviewed-by: Olivier De Cannière <[email protected]>
It seems that the QML debugger framework cleanup does not happen
correctly when QApplication is leaked. Instead of running into the asserts
of QQmlDebugServerImpl::removeService and ~QObject (during destruction
of QQuickProfilerAdapter), warn the user with qFatal() about the
possible leak of QApplication.

Task-number: QTBUG-139131
Change-Id: If0497b3d4de4a1dec1bf968760d9fa79eb24683e
Reviewed-by: Ulf Hermann <[email protected]>
Qt Code should use file based includes.

Change-Id: I19a5b583c0df9c2c418c322ee1221afa1517f77b
Reviewed-by: Fabian Kosmale <[email protected]>
The message is markdown, so actually use bullet points to show a list of
import paths. Previously, the single newlines got removed by Markdown
renderers (Markdown requires two newlines to render a newline) which
makes the list hard to read because all import paths were on the same
line.

Amends 299c449.

Task-number: QTBUG-140915
Change-Id: I39fd4ddb653ba93bf92705788f51d378321015e4
Reviewed-by: Ulf Hermann <[email protected]>
Task-number: QTBUG-142016
Change-Id: I50e435bd6343fddcee26973467b3029555c2f983
Reviewed-by: Richard Moe Gustavsen <[email protected]>
…rrelevant

If a QEventPoint is clearly outside an item _and_ the bounds of all its
children, or is simply outside the bounds of an item that clips its children,
we can stop recursion, for purposes of QPointerEvent delivery, finding which
items/handlers are hovered, or which could control the cursor shape.

effectivelyClipsEventHandlingChildren() is also recursive, but at least
the result gets cached.

Task-number: QTBUG-140340
Task-number: QTBUG-115179
Change-Id: I085e38964de6993fa82ad3bd1256868125fde090
Reviewed-by: Richard Moe Gustavsen <[email protected]>
Pick-to: 6.10 6.8
Change-Id: Idc096a96c3c6895b09a97b6ef2d644d8b0454b60
Reviewed-by: Eskil Abrahamsen Blomfeldt <[email protected]>
When running with Liquid Glass, a TextField/NSTextField
have a more rounded appearance. As such, this patch will
tweak the focus frame radius accordingly.

Pick-to: 6.10 6.9 6.8 6.5
Change-Id: I7918e4de5ca71aea2b5c080e58341bb4fa53c147
Reviewed-by: Timur Pocheptsov <[email protected]>
Styles need a way to set the default icon color for controls. Until
now, that was done like this:

    icon.color: "tomato"

    contentItem: IconLabel {
        icon: control.icon
    }

This breaks the use case of e.g. an Action that sets its own
icon.color, because the icon property of the control always takes
precedence (see 146bc95).

This patch adds a defaultIconColor property to IconLabel, which allows
styles to specify a color without overriding any potential action's
icon:

    contentItem: IconLabel {
        icon: control.icon
        defaultIconColor: "tomato
    }

If icon.color was explicitly set, it is used instead.

This does mean that overriding the contentItem will result in the
icon color being lost, but that is already the case for style
customizations in general.

All controls that set icon.color and using IconLabel to display their
icon are affected and are therefore adapted: Button, CheckDelegate,
DelayButton, ItemDelegate, MenuBarItem, MenuItem, RadioDelegate,
RoundButton, SwipeDelegate, SwitchDelegate, TabButton, ToolButton.

Add FlowPane to the shared folder of the baseline test and use it in
the tests that we touch. This fixes two issues:
- Using Pane as the background fixes text being invisible for some
styles.
- Using Flow provides the most space-efficient layouting of items now
that we have more than would fit in the old layout.

Task-number: QTBUG-87459
Change-Id: I455ce7202a46b7cfa7545650574e48ad72796675
Reviewed-by: Oliver Eftevaag <[email protected]>
In QQuickAbstractButtonPrivate::updateEffectiveIcon we need to
resolve the icon's color so that QQuickIconLabel knows which of
defaultIconColor and icon.color should win.

In both QQuickAbstractButtonPrivate::updateEffectiveIcon and
QQuickAction::setIcon, we need to unconditionally set the icon
and be more strict about when we return early.

This fixes the case where setting "transparent" as the icon color
wouldn't result in the original image's colors being used, but
would instead result in the style's default icon color:

    Button {
        text: "Original icon color"
        icon.source: "heart.svg"
        icon.color: "transparent"
    }

    Button {
        text: "Original icon color (action)"
        action: Action {
            icon.source: "heart.svg"
            icon.color: "transparent"
        }
    }

Task-number: QTBUG-87459
Change-Id: Ic490e3b37a8174b8c034b84a1ad551a78088e44d
Reviewed-by: Richard Moe Gustavsen <[email protected]>
The error was:

ld: open() failed, errno=21

Use similar CMake commands as e.g. the textrendering manual test.

Amends dd31db7.

Pick-to: 6.8 6.10
Change-Id: I7dac1567fd2e4269516f7d6c7db5812be3646e6d
Reviewed-by: Oliver Eftevaag <[email protected]>
Otherwise they use the implicit size of the image.

Pick-to: 6.8 6.10
Change-Id: I29a57bd9339574e7107a5fe471f2d246d7f97b86
Reviewed-by: Oliver Eftevaag <[email protected]>
Otherwise the text sits right against the icon, which is ugly.

Pick-to: 6.8 6.10
Change-Id: Id20e7633c43183d9209b90893095940f2a7ffc59
Reviewed-by: Oliver Eftevaag <[email protected]>
Alexey Zerkin and others added 30 commits December 6, 2025 19:05
Set the same width, height, fillColor, strokeColor and strokeWidth
values for rectangle, star, ellipse and regular polygon shapes

Task-number: QTBUG-142450
Change-Id: I1920d22e80944ee4f220b927b4c1fcbbe2bb077a
Reviewed-by: Henning Gründl <[email protected]>
- Reference the structured value type page.
- Fix errors in snippet and text.

Change-Id: I16eeb0f8c2d9d9d3f36ea0d0fe34087b7330a9c4
Reviewed-by: Ulf Hermann <[email protected]>
Reviewed-by: Mitch Curtis <[email protected]>
Re-write in such a way that there's room for other backend languages
to be included on the page.

* Re-write introductory section about separating UI logic from
  business logic, replacing C++ references with the more general
  "strongly typed language".

* Keep section "Exposing Data from C++ to QML" as it's still valuable.

Fixes: QTBUG-142007
Pick-to: 6.10
Change-Id: Icb94d354ad3b2bf913c202e74174aee7c31036b4
Reviewed-by: Alexei Cazacov <[email protected]>
We've added a version to the hash.

Fixes: QTBUG-142529
Pick-to: 6.11
Change-Id: Idba7608708db938c3cf958e98bb6ea0ea3bd7bdc
Reviewed-by: Olivier De Cannière <[email protected]>
Q_{ENUM,FLAG} does what Q_{ENUMS,FLAGS} did plus declaring two friend
functions, so the behavior should be the same.

For enums that are declared as flags (with Q_DECLARE_FLAGS(Es, E)), use
Q_FLAG(Es) which will register each enum value with the meta-object
system.

Q_FLAGS usage in tests/auto/qml/qmlcppcodegen/data/enumproblems.h is
testing Q_FLAGS itself.

Q_ENUMS/Q_FLAGS have been deprecated since at least Qt 6.

Pick-to: 6.11 6.10 6.8 6.5
Change-Id: Id21b6e3205a786b3a5fa04bd09dfee2a6c1c2a86
Reviewed-by: Ulf Hermann <[email protected]>
Avoid positioning items at fractional positions and then testing with a
QContextMenuEvent at 0, 0 relative to the item: it may be outside the
item by a fraction of a pixel and fail to "hit" during delivery.

Pick-to: 6.11
Change-Id: I0f1f98a7ae88a23356026d2c6c7eeb4bf2a72a92
Reviewed-by: Mitch Curtis <[email protected]>
Pick-to: 6.11 6.10 6.9
Change-Id: I3da95e29f642224067307a64450b80154c10cb82
Reviewed-by: Volker Hilsheimer <[email protected]>
The equivalent test is run on Lottie without developer build set,
so it should be fine to do this. The condition here was just
cargo culted from other CMakeLists and is not needed.

Pick-to: 6.10 6.11
Change-Id: Ib05c586b6ca8481eee312afbae7f003f51a389ce
Reviewed-by: Hatem ElKharashy <[email protected]>
The examples that demonstrate hybrid UI approaches lack proper
descriptions. This commit restructures and enhances the descriptions
for these.

Task-number: QTBUG-134102
Pick-to: 6.11 6.10
Change-Id: I5cf604fee932024cbe73347696e19f9c6e22d5b7
Reviewed-by: Alexei Cazacov <[email protected]>
Way too much is going on in these functions to have them as
inlines. Presumably, op== "looked" simple (but QHash equality is
anything but...), and qHash() was inline because of the defaulted seed
argument. Use overloading instead.

The type doesn't seem to be used outside its own module, so there's no
need to export the out-of-line functions.

Amends d226e24.

Pick-to: 6.11 6.10 6.8 6.5
Change-Id: Ib9641001a590fd1482ec463afd48003b7759e2f8
Reviewed-by: Ulf Hermann <[email protected]>
Source string is used as object name in output, so we sanitize
it to make sure it does not contain illegal characters. SVG already
mandates a limited character set here, but rather than trust the
parser we sanitize before passing to the generator like the Lottie
visitor does.

Fixes: QTBUG-142556
Pick-to: 6.8 6.10 6.11
Change-Id: I0684e726ab69a0735dcb5f91369b090d58a90b7b
Reviewed-by: Eirik Aavitsland <[email protected]>
Loading SVG files that use font families with quotes will produce
invalid output that does not parse correctly. When outputting the
font family, we have to escape the quotes first. In addition,
any character in the font family has to be valid HTML when we
output it into a style tag.

Pick-to: 6.8 6.10 6.11
Change-Id: If25b3cfd3a537d7f7c8c65045deece1ad02b43c3
Reviewed-by: Eirik Aavitsland <[email protected]>
We used to bind several of the colors in the Fallback style
the palette. This turns out to be not such a good idea. The
reason is that the palette differs across platforms, which
means that a style created on e.g macOS can end up looking
completly different when running on Ubuntu.

While this might be wanted sometimes, more often it has the
potential to come as a surprise at a late stage during
development, and contributes to a "write once, debug everywhere"
scenario.

This patch will therefore change this. We now choose to follow
the Basic style approach, and "hard-code" the colors in the
Fallback style to be the same on all platforms. This gives
developers a stable platform to build their own styles on top
of.

It's still fully possible to bind all colors in their own
style to the palette, if they want a more dynamic style that
respects the platform palette.

Task-number: QTBUG-130067
Pick-to: 6.11
Change-Id: Ibeeedacb35b5a4c68c827b66baf0298a42b2948a
Reviewed-by: Doris Verria <[email protected]>
When QQuickRenderControl is used for multi-threaded rendering
with a GLES backend, a warning "Attempting to create QWindow-based
QOffscreenSurface outside the gui thread. Expect failures." may be
emitted. This warning occurs when an QOffscreenSurface is created even
though the QQuickWindow already has a custom RHI (Rendering Hardware
Interface) graphics device explicitly configured.

Creating an additional offscreen surface in this specific context
is redundant and can lead to the aforementioned warning, especially
given the multi-threaded nature. This change introduces a check to
detect if the QQuickWindow is already utilizing a custom RHI graphics
device. If a custom RHI device is present, the creation of the general
QOffscreenSurface is skipped. This prevents the warning and potential
resource conflicts, ensuring QQuickRenderControl operates correctly when
an RHI-specific graphics device is already in use, without unnecessary
surface allocations.

Pick-to: 6.11
Change-Id: I343dff445ad320ab120c71764d756126bf0ce133
Reviewed-by: Laszlo Agocs <[email protected]>
The Accessibility Insights for Windows requires focusable controls to
have a name. Ensure that those controls that don't get one by default,
also have a name.

Task-number: QTBUG-141669
Pick-to: 6.11 6.10 6.8
Change-Id: I6d19bffd24d7ac5b1b93fe4eaa003cefede09b13
Reviewed-by: Morten Johan Sørvig <[email protected]>
Avoids converting QUrl -> QString -> QUrl.

Pick-to: 6.11
Change-Id: I80ddd4b5c7e25679eda4f235fe2a367afd7901f8
Reviewed-by: Ulf Hermann <[email protected]>
Amends 023cad2.

Task-number: QTBUG-142189
Change-Id: I4aac13fb790578ea69fb856e41ffc265f2330a01
Reviewed-by: Mitch Curtis <[email protected]>
The generated QML does not need access to the VectorImage's context,
since it is self-contained.

Pick-to: 6.10 6.11
Change-Id: I61b12aaf5c3abcfe4c21057a28f46f9d85c2054a
Reviewed-by: Eirik Aavitsland <[email protected]>
Fixes: QTBUG-141045
Pick-to: 6.11 6.10
Change-Id: Ieb8882f4f07c0893095481e7f9104069cf92a389
Reviewed-by: Ulf Hermann <[email protected]>
When we call createQmlObject, a completely new compilation unit is
created. If an object is stil in use, that compilation is obviously
needed. However, if code is using createQmlObject repeatedly with the
same URL, there's a good chance that the object was only temporarily
needed.
To avoid unbounded memory usage in that case, we call
trimCompilationUnitsForUrl, to remove the no longer needed CUs.

Note that this does not help if the URL is also changing dynamically,
but we don't want to trim all caches, including ones the user might
actually want to hold on. To handle such cases, we should rather
1. integrate the trimming logic with the gc
2. give it a separate, configurable "high water mark"
3. Use some proper caching system for CUs, e.g. LRU
That is however out of scope for this commit.

Pick-to: 6.11 6.10 6.8
Fixes: QTBUG-142555
Change-Id: I7ebb63abd9bb99531b6b6b2cf1f98b35b1e652e2
Reviewed-by: Ulf Hermann <[email protected]>
Amends a783420.

Task-number: QTBUG-141530
Task-number: QTBUG-115140
Pick-to: 6.11
Change-Id: Iab7c6bf19e1180b9a146ceb6d0b25b5234613ca9
Reviewed-by: Alexey Zerkin <[email protected]>
Reviewed-by: Joerg Bornemann <[email protected]>
Tst_palette::comboBoxPopupWithThemDefault fails on its first run
because tst_palette:comboBoxPopup sets a theme beforehand. It always
passes on its second run, as no theme as been fixed yet.

Change the order of the two tests ensuring that
comboBoxPopupWithThemDefault is passing on its first run.

This is a workaround to prevent the theme being fixed before the test.

Change-Id: I902f6b0cff9f35305cb5534d1318395677fa2748
Reviewed-by: Axel Spoerl <[email protected]>
As it stood, if you e.g did:

control.background.shadow.visible: true
control.hovered.background.shadow.visible: false

Then the shadow would stay visible also when the control
was hovered. The reason was because the shadow was already
created in the normal state, and toggling visiblity after
that point had no effect.

This patch will fix this, so that we hide the shadow if
its visibility is set to false after first having been
created. We refrain from destroying it again, since doing so
has a higher cost, and most likely, the hiding of
the shadow is just temporarily.

Task-number: QTBUG-130067
Pick-to: 6.11
Change-Id: Ib107b11b7f7fa638d7ac439348b9ccb75bf1bb1a
Reviewed-by: Doris Verria <[email protected]>
When the application wrote a new value to a property in the style, we
used to emit a property changed signal for that property from every
StyleKitReader (control) in the application. We did this because we
could not easily know which controls would be affected by such a write
because of property propagation. This could therefore be very slow.

But now that we have more functionallity in StyleKit available, such
as being able to resolve a controls base types, we can now improve on
this logic.

Therefore, this patch will ensure that we instead only emit changes
from the StyleKitReaders of the same type (or a base type) as the
control written to in the style. The result is that a write from the
app, such as:

StyleKit.style.groupBox.background.radius = value

will cause an update only for groupBoxes, skipping all other controls.
This is clearly faster.

Task-number: QTBUG-130067
Pick-to: 6.11
Change-Id: I6432db93f282b8155d9270a57206f0d558b801a8
Reviewed-by: Doris Verria <[email protected]>
Nothing was ever removed from the cache, so in case of e.g. an
animated gradient, a large number of texture objects would be created
and not released, and memory would quickly fill up.

Fix by changing the caching implementation with a set maximum number
of cached gradient textures.

This introduces a soft limit on the supported number of simultaneously
displayed different gradients in the application. If exceeded, some
objects will show wrong gradient colors. Although unlikely to be
reached, the limit is documented and configurable by environment
variable.

As a driveby, improve the gradient cache key qHash() implementation a
bit, presumably giving better spread for the QCache.

Fixes: QTBUG-142208
Fixes: QTBUG-136553
Pick-to: 6.11 6.10 6.8 6.5
Change-Id: Ie104f27031572e1c392c0a8ef79d09f4a2ba5a8e
Reviewed-by: Laszlo Agocs <[email protected]>
You shouldn't use type assertions to create value types. That was a
terrible idea. We can document the interaction with the 'new' operator
now, though.

Task-number: QTBUG-124662
Pick-to: 6.11 6.10 6.8
Change-Id: I94dbf47cfd72ef20a2d4758450634708590f8fec
Reviewed-by: Fabian Kosmale <[email protected]>
Reviewed-by: Elias Steurer <[email protected]>
console.exception() unironically throws an exception if you call it
without arguments. Otherwise it's almost the same as console.error()
but prints a stack trace in addition.

Pick-to: 6.11 6.10 6.8
Fixes: QTBUG-119460
Change-Id: I99cc1c009310059d7bd5bbd8308436b832f41da7
Reviewed-by: Fabian Kosmale <[email protected]>
We need to consider the original type of the value in order to see what
we can do with it and we need to convert it (back) to string where
necessary.

Pick-to: 6.11 6.10
Fixes: QTBUG-142550
Change-Id: Ic0eb2c7a22636cfb2d97297421b911555bd32bb1
Reviewed-by: Fabian Kosmale <[email protected]>
Reviewed-by: Sami Shalayel <[email protected]>
Pick-to: 6.11
Change-Id: I88b25f6fa2e98fefb3f0e353804ba997e4709290
Reviewed-by: Henning Gründl <[email protected]>
The macro was renamed in commit 03baf08d2bb99bf234d5e051691a57937fa935d7
in qtbase.

Pick-to: 6.11 6.10 6.8
Change-Id: Ia3d2d10671ef71423947ea548c0b29dc62359495
Reviewed-by: Marc Mutz <[email protected]>
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.