the qml file dialog caused the problem.couldnt find the reason.
-
FileDialog { id: fileDialog title: "" folder: shortcuts.home selectExisting: true onAccepted: { console.log("You chose: " + fileDialog.fileUrl.toString( )) let t_filename_act = fileDialog.fileUrl.toString() let t_view_path = fileDialog.folder.toString() let t_view_path_t = t_view_path.substr(8, t_view_path.length - 8) let t_view_file = fileDialog.fileUrl.toString().split('/').pop( ).toString() for (var i = 0; i < global_selected_files.length; i++) { console.log("t_view_pathi", global_selected_files[i]) if (global_selected_files[i] === t_filename_act) { return } } let t_linevalue = getShortFilepath(96, t_view_path_t, t_view_file) modelData.append({ "linename": t_linevalue.toString(), "linevalue": t_filename_act.toString() }) global_selected_files.push(t_filename_act) let t_files_count = modelData.count labelTitle.text = global_title + " - " + t_files_count + " FILES" if (global_saved_file === "default_none" || global_saved_file === undefined) { global_saved_file = t_linevalue.toString() labelTips.text = " Saved file into: " + global_saved_file.toString() } } onRejected: { console.log("Canceled") } visible: false }the modelData was used by the
ListView { model: ListModel { id: modelData } }file:///D:/program/qt/5.14.1/msvc2017/qml/QtQuick/Controls/Styles/Desktop/TableViewStyle.qml:109:13: Unable to assign QQmlListModel to QString file:///D:/program/qt/5.14.1/msvc2017/qml/QtQuick/Controls/Styles/Desktop/TableViewStyle.qml:109:13: Unable to assign QQmlListModel to QString file:///D:/program/qt/5.14.1/msvc2017/qml/QtQuick/Controls/Styles/Desktop/TableViewStyle.qml:109:13: Unable to assign QQmlListModel to QString file:///D:/program/qt/5.14.1/msvc2017/qml/QtQuick/Controls/Styles/Desktop/TableViewStyle.qml:109:13: Unable to assign QQmlListModel to QString file:///D:/program/qt/5.14.1/msvc2017/qml/QtQuick/Controls/Styles/Desktop/TableViewStyle.qml:109:13: Unable to assign QQmlListModel to QString file:///D:/program/qt/5.14.1/msvc2017/qml/QtQuick/Controls/Styles/Desktop/TableViewStyle.qml:109:13: Unable to assign QQmlListModel to QString file:///D:/program/qt/5.14.1/msvc2017/qml/QtQuick/Dialogs/DefaultFileDialog.qml:385:29: Unable to assign QQmlListModel to QString file:///D:/program/qt/5.14.1/msvc2017/qml/QtQuick/Dialogs/DefaultFileDialog.qml:385:29: Unable to assign QQmlListModel to QString file:///D:/program/qt/5.14.1/msvc2017/qml/QtQuick/Dialogs/DefaultFileDialog.qml:362:29: Unable to assign QQmlListModel to QString file:///D:/program/qt/5.14.1/msvc2017/qml/QtQuick/Dialogs/DefaultFileDialog.qml:362:29: Unable to assign QQmlListModel to QString file:///D:/program/qt/5.14.1/msvc2017/qml/QtQuick/Dialogs/DefaultFileDialog.qml:362:29: Unable to assign QQmlListModel to QString -
FileDialog { id: fileDialog title: "" folder: shortcuts.home selectExisting: true onAccepted: { console.log("You chose: " + fileDialog.fileUrl.toString( )) let t_filename_act = fileDialog.fileUrl.toString() let t_view_path = fileDialog.folder.toString() let t_view_path_t = t_view_path.substr(8, t_view_path.length - 8) let t_view_file = fileDialog.fileUrl.toString().split('/').pop( ).toString() for (var i = 0; i < global_selected_files.length; i++) { console.log("t_view_pathi", global_selected_files[i]) if (global_selected_files[i] === t_filename_act) { return } } let t_linevalue = getShortFilepath(96, t_view_path_t, t_view_file) modelData.append({ "linename": t_linevalue.toString(), "linevalue": t_filename_act.toString() }) global_selected_files.push(t_filename_act) let t_files_count = modelData.count labelTitle.text = global_title + " - " + t_files_count + " FILES" if (global_saved_file === "default_none" || global_saved_file === undefined) { global_saved_file = t_linevalue.toString() labelTips.text = " Saved file into: " + global_saved_file.toString() } } onRejected: { console.log("Canceled") } visible: false }the modelData was used by the
ListView { model: ListModel { id: modelData } }file:///D:/program/qt/5.14.1/msvc2017/qml/QtQuick/Controls/Styles/Desktop/TableViewStyle.qml:109:13: Unable to assign QQmlListModel to QString file:///D:/program/qt/5.14.1/msvc2017/qml/QtQuick/Controls/Styles/Desktop/TableViewStyle.qml:109:13: Unable to assign QQmlListModel to QString file:///D:/program/qt/5.14.1/msvc2017/qml/QtQuick/Controls/Styles/Desktop/TableViewStyle.qml:109:13: Unable to assign QQmlListModel to QString file:///D:/program/qt/5.14.1/msvc2017/qml/QtQuick/Controls/Styles/Desktop/TableViewStyle.qml:109:13: Unable to assign QQmlListModel to QString file:///D:/program/qt/5.14.1/msvc2017/qml/QtQuick/Controls/Styles/Desktop/TableViewStyle.qml:109:13: Unable to assign QQmlListModel to QString file:///D:/program/qt/5.14.1/msvc2017/qml/QtQuick/Controls/Styles/Desktop/TableViewStyle.qml:109:13: Unable to assign QQmlListModel to QString file:///D:/program/qt/5.14.1/msvc2017/qml/QtQuick/Dialogs/DefaultFileDialog.qml:385:29: Unable to assign QQmlListModel to QString file:///D:/program/qt/5.14.1/msvc2017/qml/QtQuick/Dialogs/DefaultFileDialog.qml:385:29: Unable to assign QQmlListModel to QString file:///D:/program/qt/5.14.1/msvc2017/qml/QtQuick/Dialogs/DefaultFileDialog.qml:362:29: Unable to assign QQmlListModel to QString file:///D:/program/qt/5.14.1/msvc2017/qml/QtQuick/Dialogs/DefaultFileDialog.qml:362:29: Unable to assign QQmlListModel to QString file:///D:/program/qt/5.14.1/msvc2017/qml/QtQuick/Dialogs/DefaultFileDialog.qml:362:29: Unable to assign QQmlListModel to QString@nicker-player said in the qml file dialog caused the problem.couldnt find the reason.:
file:///D:/program/qt/5.14.1/msvc2017/qml/QtQuick/Controls/Styles/Desktop/TableViewStyle.qml:109:13
So what is in this line?
-
@nicker-player said in the qml file dialog caused the problem.couldnt find the reason.:
file:///D:/program/qt/5.14.1/msvc2017/qml/QtQuick/Controls/Styles/Desktop/TableViewStyle.qml:109:13
So what is in this line?
property Component itemDelegate: Item { height: Math.max(16, label.implicitHeight) property int implicitWidth: label.implicitWidth + 16 Text { id: label objectName: "label" width: parent.width font: __styleitem.font anchors.left: parent.left anchors.right: parent.right anchors.leftMargin: styleData.hasOwnProperty("depth") && styleData.column === 0 ? 0 : horizontalAlignment === Text.AlignRight ? 1 : 8 anchors.rightMargin: (styleData.hasOwnProperty("depth") && styleData.column === 0) || horizontalAlignment !== Text.AlignRight ? 1 : 8 horizontalAlignment: styleData.textAlignment anchors.verticalCenter: parent.verticalCenter elide: styleData.elideMode text: styleData.value !== undefined ? styleData.value : "" // here it is ! color: styleData.textColor renderType: Text.NativeRendering } } -
property Component itemDelegate: Item { height: Math.max(16, label.implicitHeight) property int implicitWidth: label.implicitWidth + 16 Text { id: label objectName: "label" width: parent.width font: __styleitem.font anchors.left: parent.left anchors.right: parent.right anchors.leftMargin: styleData.hasOwnProperty("depth") && styleData.column === 0 ? 0 : horizontalAlignment === Text.AlignRight ? 1 : 8 anchors.rightMargin: (styleData.hasOwnProperty("depth") && styleData.column === 0) || horizontalAlignment !== Text.AlignRight ? 1 : 8 horizontalAlignment: styleData.textAlignment anchors.verticalCenter: parent.verticalCenter elide: styleData.elideMode text: styleData.value !== undefined ? styleData.value : "" // here it is ! color: styleData.textColor renderType: Text.NativeRendering } }@nicker-player
@jsulm asked you what line is:file:///D:/program/qt/5.14.1/msvc2017/qml/QtQuick/Controls/Styles/Desktop/TableViewStyle.qml:109:13
So he is expecting you to tell him which is line #109. If you just paste the whole delegate how can we know which is line #109? Please think about providing the necessary information to help others help you.
-

Ive just marked the line109text: styleData.value !== undefined ? styleData.value : ""
-

Ive just marked the line109text: styleData.value !== undefined ? styleData.value : ""
@nicker-player
by the way when i was used the icon from the qrc path it also give me a tip whats belowQPainter::begin: Paint device returned engine == 0, type: 2 QWidget::render: Cannot render with an inactive painter QPainter::begin: Paint device returned engine == 0, type: 3 QPainter::setCompositionMode: Painter not active QPainter::end: Painter not active, aborted QPainter::begin: Paint device returned engine == 0, type: 3 ASSERT: "img.format() == QImage::Format_ARGB32_Premultiplied || img.format() == QImage::Format_RGB32 || img.format() == QImage::Format_Indexed8 || img.format() == QImage::Format_Grayscale8" in file effects\qpixmapfilter.cpp, line 705 QBackingStore::endPaint() called with active painter; did you forget to destroy it or call QPainter::end() on it? -

Ive just marked the line109text: styleData.value !== undefined ? styleData.value : ""
@nicker-player
I see that now, I did not notice it (if it was there) when I posted originally.I know nothing about QML, but
file:///D:/program/qt/5.14.1/msvc2017/qml/QtQuick/Controls/Styles/Desktop/TableViewStyle.qml:109:13: Unable to assign QQmlListModel to QString
looks to me like
styleData.valueis an actualQQmlListModel? Which obviously cannot be converted to a string. So, however you do it in QML, what it is the bound value (or its type) in whatever cell in your table?