Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

Retrieving text messages from inbox



  • tried a lot to display list of all message in my inbox , below is code i have tried with ..
    @import Qt 4.7
    import com.nokia.symbian 1.0
    import QtMobility.messaging 1.1

    Window {
    id: root
    ListView {
    id: list
    anchors.fill: parent
    model: MessageModel {
    sortBy: MessageModel.Timestamp
    sortOrder: MessageModel.DescendingOrder
    }
    delegate: listDelegate
    }
    Component {
    id: listDelegate

              Item {
                  id: listItem
    
                  // The texts to display
                  Column {
                      anchors {
                          left:  listItem.paddingItem.left
                          top: listItem.paddingItem.top
                          bottom: listItem.paddingItem.bottom
                          right: checkbox.left
                      }
    
                      Text { id: subjText; text: subject; font.pixelSize: 13; x: 3 }
                                   Text {
                                       text: sender; color: "gray"; font.pixelSize: 9
                                       x: 3; width: parent.width-100;
                                       anchors.top: subjText.bottom; anchors.topMargin: 3
                                       elide: Text.ElideRight
                                   }
                                   Text {
                                       text: date; color: "gray"; font.pixelSize: 9
                                       anchors.right: parent.right
                                       anchors.top: subjText.bottom; anchors.topMargin: 3
                                   }
                  }
    
        
    
    
    
    
    
                 }
    

    }
    }@
    nothing appears on window screen..



  • Could it be that listItem needs a size? Try to use the column's size as the listItems size, remove the anchors.


Log in to reply