-
Bug
-
Resolution: Unresolved
-
P1: Critical
-
6.10
-
None
ListModel { id: fullTabsModel ListElement { icon: 'iso/Crop' source:"qrc:/settings/CropsComponent.qml"; active: true } ListElement { icon: 'iso/OperatorManual' source:"qrc:/settings/CombineAssistanceComponent.qml"; active: true } ListElement { icon: 'iso/ServiceIndicator' source:"../statistic/MaintenanceComponent.qml"; active: true } ListElement { icon: 'icons/Setting' source:""; active: true submenu: [ ListElement { icon: 'icons/DataTime' source:"qrc:/settings/DateTimeComponent.qml"; active: true }, ListElement { icon: 'icons/DisplayBrightness' source:"qrc:/settings/ScreenSettingsDialog.qml"; active: true }, ListElement { icon: 'icons/SoundMenu' source:"qrc:/settings/SoundSettingsDialog.qml"; active: true }, ListElement { icon: 'icons/NotificationConfiguration' source:"qrc:/settings/NotificationConfigurationComponent.qml"; active: true }, ListElement { icon: 'icons/Languages' source:"qrc:/settings/LanguageSettingsDialog.qml"; active: true }, ListElement { icon: 'icons/Password' source:"qrc:/settings/PasswordSettingsDialog.qml"; active: true func : function(){} } ] }
This is about function decl. Anyway it doesnt have to be a crash...
// for now we do not provide a context object; data from the ListElement must be passed to the function
QV4::ScopedContext context(scope, QV4::QmlContext::create(v4->rootContext(), QQmlContextData::get(qmlContext(model->m_modelCache)), nullptr));
QV4::ScopedFunctionObject function(scope, QV4::FunctionObject::createScriptFunction(context, compilationUnit->runtimeFunctions[id]));
I suppose the context model for nested elements that are nested in an array, for example, will be nullptr, the code above does not handle this case in any way. For other types, it's not important to have a null contextual model, but for some reason it's still important for a function. I assumed that the semantics of such a function are not context-related, but they can be, it's not clear to me exactly, even from the documentation, maybe I missed something.
I think this is really a bug, since it should at least not fall , depending on architectural goals, either passing nullptr instead of trying to take context for functions that are contextually free , or still passing the necessary context there, for example, the parent model.
- relates to
-
QTBUG-80041 Error assigning a function declaration to a ListElement role
-
- Reported
-