QML TableView on iOS works with Qt 5.5.0 and does not work with Qt 5.5.1



  • Hello together,

    I am facing an issue where a QML TableView works on iPad if I compile with Qt 5.5.0 and it does not work with 5.5.1.

    5.5.0:
    iOS:
    With 5.5.0, I can enter new values in the TableView and the new values (both numbers and strings) get accepted, stored and displayed.
    Both debug and release version work ok.

    Desktop:
    On desktop everything works, but I do get the following output:
    FocusFrame_QMLTYPE_22 QVariant(Invalid) QRect(0,0 0x0)
    ScrollBar_QMLTYPE_15_QML_20 QVariant(Invalid) QRect(0,0 0x0)

    5.5.1:
    iOS:
    With 5.5.1, I can enter new values and they are show up in the table right after accepting them, but they are not stored and the table cell goes back to the original value when pressing on another table cell.

    Desktop:
    Works ok, same errors as desktop 5.5.0.

    I have tried different iPads (iPad Air 1 and iPad Mini 1) and different iOS versions ( iOS 8 and iOS9), always with the same result.

    Does anybody have an idea what could be going on here ?

    Thanks Thomas

    Code:
    The following code is a simple test code I have cut out of my application.
    Just create a new Qt Quick project in Qt Creator and then replace the main.qml code with the following code.

    import QtQuick 2.5
    import QtQuick.Window 2.2
    import QtQuick.Controls 1.4
    
    ApplicationWindow {
        visible: true
        width: 538
        height: 360
    
    
        ListModel {
            id: largeModel
            Component.onCompleted: {
                for (var i=0 ; i< 50 ; ++i)
                    largeModel.append({"name":"Person "+i , "age": Math.round(Math.random()*100), "gender": Math.random()>0.5 ? "Male" : "Female"})
            }
        }
    
    
        Item {
            anchors.fill: parent
    
            Component {
                id: editableDelegate
                Item {
    
                    Text {
                        width: parent.width
                        anchors.margins: 15
                        anchors.left: parent.left
                        anchors.verticalCenter: parent.verticalCenter
                        elide: styleData.elideMode
                        text: styleData.value !== undefined ? styleData.value : ""
                        color: styleData.textColor
                        visible: !styleData.selected
                    }
    
                    Loader {
                        id: loaderEditor
                        anchors.fill: parent
                        anchors.margins: 15
                        anchors.verticalCenter: parent.verticalCenter
                        Connections {
                            target: loaderEditor.item
                            onAccepted: {
                                if (typeof styleData.value === 'number')
                                    largeModel.setProperty(styleData.row, styleData.role, Number(parseFloat(loaderEditor.item.text).toFixed(0)))
                                else
                                    largeModel.setProperty(styleData.row, styleData.role, loaderEditor.item.text)
    
                                console.log("styleData.value", styleData.value)
                            }
                        }
    
                        sourceComponent: styleData.selected ? editor : null
    
                        Component {
                            id: editor
                            TextInput {
                                id: textinput
    
                                color: styleData.textColor
                                text: styleData.value
                                MouseArea {
                                    id: mouseArea
                                    anchors.fill: parent
                                    hoverEnabled: true
                                    onClicked: textinput.forceActiveFocus()
                                }
                            }
                        }
                    }
                }
            }
    
            TableView {
                model: largeModel
                anchors.margins: 12
                anchors.fill:parent
    
                TableViewColumn {
                    role: "name"
                    title: "Name"
                    width: 120
                }
               TableViewColumn {
                   role: "age"
                   title: "Age"
                   width: 120
               }
                TableViewColumn {
                    role: "gender"
                    title: "Gender"
                    width: 120
                }
    
    
                itemDelegate: {
                    return editableDelegate;
                }
            }
        }
    }
    
    

  • Lifetime Qt Champion

    Hi and welcome to devnet,

    Can you test that with the 5.6.0 Beat ? If it's still not work correctly, you should go on the bug report system to see if it's something known, if not please consider opening a new report providing your sample codes and findings.



  • @SGaist
    I have tried my app with the Beta of Qt 5.6, but unfortunately my code does not compile and stops with this error:

    Undefined symbols for architecture armv7:
      "_main", referenced from:
          user_main_trampoline() in libqios_debug.a(qioseventdispatcher.o)
         (maybe you meant: _jinit_c_main_controller, _jinit_d_main_controller , __Z20qt_mainwindow_layoutPK11QMainWindow , _qt_main_wrapper )
    ld: symbol(s) not found for architecture armv7
    clang: error: linker command failed with exit code 1 (use -v to see invocation)
    

    The error has been discussed here: https://bugreports.qt.io/browse/QTBUG-49886
    The Qt code needs patches.

    I then tried to build the new 5.6.0 branch from git. I can build an use 5.6 for clang (mac desktop), but I did not succeed to build Qt 5.6 for iOS.

    So I do not know if the problem has been fixed in Qt 5.6.

    BR, Thomas


  • Lifetime Qt Champion

    From the bug report, it's been fixed for the release candidate.

    What error did you get when building Qt for iOS ?



  • Hi, I finally got the latest 5.6.0 baseline compiled for iOS and can confirm that 5.6.0 does not show this tableview error.

    Thanks for your help, well appreciated !!

    BR,
    Thomas


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.