assert m_control error if ListView is scrolled
-
Hi,
I'm pretty new to QML and maybe I'm just doing something stupid. I already searched the web about this problem, but without any success. If I create a clipping listView with scrollbar, I get an Popup error like this:
This is a snippet of my QML code
import QtQuick 2.15 import QtQuick.Window 2.15 import QtQuick.Controls 2.12 import QtQuick.Layouts 1.12 Window { width: 500 height: 300 visible: true title: qsTr("Hello World") ListModel { id: testmodel ListElement { caption: "name is" value: "Kermit the frog" ftype: "Muppet" } ListElement { caption: "name is" value: "Kermit the frog" ftype: "Muppet" } ListElement { caption: "name is" value: "Kermit the frog" ftype: "Muppet" } ListElement { caption: "name is" value: "Kermit the frog" ftype: "Muppet" } ListElement { caption: "name is" value: "Kermit the frog" ftype: "Muppet" } ListElement { caption: "name is" value: "Kermit the frog" ftype: "Muppet" } ListElement { caption: "name is" value: "Kermit the frog" ftype: "Muppet" } ListElement { caption: "name is" value: "Kermit the frog" ftype: "Muppet" } ListElement { caption: "name is" value: "Kermit the frog" ftype: "Muppet" } ListElement { caption: "name is" value: "Kermit the frog" ftype: "Muppet" } ListElement { caption: "name is" value: "Kermit the frog" ftype: "Muppet" } ListElement { caption: "name is" value: "Kermit the frog" ftype: "Muppet" } ListElement { caption: "name is" value: "Kermit the frog" ftype: "Muppet" } ListElement { caption: "name is" value: "Kermit the frog" ftype: "Muppet" } } GroupBox { anchors.fill: parent ListView { id: listView anchors.fill: parent clip: true ScrollBar.vertical: ScrollBar {} model: testmodel delegate: GroupBox { height: 40 width: 500 RowLayout{ anchors.fill: parent Text { Layout.fillWidth: true text: caption } Text { Layout.fillWidth: true text: value } Text { Layout.fillWidth: true text: ftype } } } } } }
I'm using the QT 6.1.2 MSVC2019 64 bit Desktop Kit.
The error occures as soon, as the height of the delegates is higher as the view port of the list view. When I delete some of the entries, the error is not at startup but if I start to scroll.
EDIT: meanwhile I was able to strip down the problem using a dummy project. This is a single qml file, that invokes the error message immeadiately after startup. I replace my original snippet with this code now.
-
@Guido-Marko-Print
Is it okay to answer my own posts? I hope so. I found out, that the I can circumvent the problem by choosing another style. The problem arises only when the native style is used. I came to this by reading the error message several times. So, this seems to be a bug in the nativestyle. Has somebody experienced something similar?Should I file a bug and how to do so?
-
@Guido-Marko-Print said in assert m_control error if ListView is scrolled:
Is it okay to answer my own posts?
Of course it is :-)
You also can file a bug in Qt bug tracker.