Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-140653

setData unexpectedly called for view whose delegateModelAccess property is set to DelegateModel.ReadWrite

XMLWordPrintable

      untitled14.zip enforces a rule where the UI can only set a model role's to false. In the real project, "foo" indicates whether an item in a model has been newly added, and only the backend can determine that, hence the check that it's only ever set to false in setData. The user can hover over items in the view to mark them as no longer "new" (which results in setData being called with false).

      This works when not using delegateModelAccess, but when using it, setData is called with true upon component completion of the view:

      1  UserModel::setData(QModelIndex const&, QVariant c usermodel.cpp                     55   0x10000a0b0
      2  QQmlDMAbstractItemModelData::setValue(int, QVaria qqmldmabstractitemmodeldata.cpp   234  0x100849ee8
      3  QQmlDMAbstractItemModelData::metaCall(QMetaObject qqmldmabstractitemmodeldata.cpp   46   0x100849af4
      4  VDMAbstractItemModelDataType::metaCall(QObject *, qqmldmabstractitemmodeldata_p.h   223  0x1007fbee8
      5  void QQmlPropertyData::doMetacall<(QMetaObject::C qqmlpropertydata_p.h              395  0x104ba5ca8
      6  QQmlPropertyData::writeProperty(QObject *, void * qqmlpropertydata_p.h              415  0x104ba5b9c
      7  QQmlPropertyPrivate::write(QObject *, QQmlPropert qqmlproperty.cpp                  1703 0x104d45560
      8  QQmlPropertyPrivate::writeValueProperty(QObject * qqmlproperty.cpp                  1327 0x104d44d7c
      9  QQmlPropertyToUnbindablePropertyBinding::update(Q qqmlpropertytopropertybinding.cpp 111  0x104d75ca0
      10 QQmlPropertyToUnbindablePropertyBinding::setEnabl qqmlpropertytopropertybinding.cpp 79   0x104d75ae0
      11 QQmlPropertyPrivate::setBinding(QQmlAbstractBindi qqmlproperty.cpp                  994  0x104d42dd8
      12 QQmlAnyBinding::installOn(QQmlProperty const&, QQ qqmlanybinding_p.h                251  0x100815cb8
      13 QQDMIncubationTask::initializeRequiredProperties( qqmldelegatemodel.cpp             1027 0x1008156b8
      14 QQmlDelegateModelPrivate::setInitialState(QQDMInc qqmldelegatemodel.cpp             1213 0x100817140
      15 QQDMIncubationTask::setInitialState(QObject *)    qqmldelegatemodel.cpp             1202 0x1008170f0
      16 QQmlIncubatorPrivate::incubate(QQmlInstantiationI qqmlincubator.cpp                 323  0x104c873fc
      17 QQmlEnginePrivate::incubate(QQmlIncubator&, QQmlR qqmlincubator.cpp                 53   0x104c86a08
      18 QQmlComponentPrivate::incubateObject(QQmlIncubato qqmlcomponent.cpp                 1666 0x104bf584c
      19 QQmlDelegateModelPrivate::object(QQmlListComposit qqmldelegatemodel.cpp             1326 0x1008179b0
      20 QQmlDelegateModel::object(int, QQmlIncubator::Inc qqmldelegatemodel.cpp             1370 0x100818074
      21 QQuickItemViewPrivate::createItem(int, QQmlIncuba qquickitemview.cpp                2500 0x102032c28
      22 QQuickItemViewPrivate::updateCurrent(int)         qquickitemview.cpp                1796 0x10202a4a8
      23 QQuickItemView::componentComplete()               qquickitemview.cpp                1593 0x10203182c
      24 QQmlObjectCreator::finalize(QQmlInstantiationInte qqmlobjectcreator.cpp             1617 0x104cf5b10
      25 QQmlComponentPrivate::complete(QQmlEnginePrivate  qqmlcomponent.cpp                 1226 0x104bf1598
      26 QQmlComponentPrivate::completeCreate()            qqmlcomponent.cpp                 1344 0x104beeca0
      27 QQmlComponent::completeCreate()                   qqmlcomponent.cpp                 1310 0x104bf3974
      28 QQmlComponentPrivate::createWithProperties(QObjec qqmlcomponent.cpp                 998  0x104bf1390
      29 QQmlComponent::create(QQmlContext *)              qqmlcomponent.cpp                 938  0x104bf119c
      30 QQmlApplicationEnginePrivate::finishLoad(QQmlComp qqmlapplicationengine.cpp         158  0x104bae7e8
      31 QQmlApplicationEnginePrivate::ensureLoadingFinish qqmlapplicationengine.cpp         185  0x104bae1c4
      32 QQmlApplicationEnginePrivate::startLoad(QAnyStrin qqmlapplicationengine.cpp         144  0x104bae51c
      33 QQmlApplicationEngine::loadFromModule(QAnyStringV qqmlapplicationengine.cpp         415  0x104baf16c
      34 main                                              main.cpp                          15   0x100006344
      

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

            qtqmlteam Qt Qml Team User
            mitch_curtis Mitch Curtis
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved:

                There are no open Gerrit changes