Important: Please read the Qt Code of Conduct -

ListView is not getting updated properly.

  • I have one QML screen where I have ListView in it.
    I am updating this list view from the JavaScript code, I am updating image and text of Elements in the list view, But list view is not displaying the updated images and text in the ListView.

    Also there is problem with the screens that have multiple Rectangles in it,
    I am enabling/disabling Visibility of the Rectangle to display the desired set of widgets/components, But when i set the visibility true for the particulate the rectangle it displays background color of the parent rectangle, as it should display it's own background color.

    I think QT is not refreshing/redrawing the entire screen.
    I tried to resolve this issue using Z index and Opacity but no luck.
    Is there any function in QML to refresh/redraw the display, so that changes made to widgets will get displayed.


  • Code, please.

  • @// main.cpp
    void main(int argc, char*[] argv)
    QApplication app(argc, argv);

    QDeclarativeView view;


    id: mainRect
    width: 1000
    height: 700
    color: "#ffggff"
    z: 1000

        id: Rect1;
        width: 200;
        anchors.left: parent.left;;
        anchors.bottom: parent.bottom;
        color: "#ff00ff";
        z: 1100;
            id: listModel;
            id: listView;
            id: textView;
            text: "This Is Test"
            anchors.bottom: Rect1.bottom;


    this is the test code.

    Also for "Text" widget it displays the background color of the text as background color of it's parents->parent.
    If i hit Tab key on the keyboard then every thing gets to normal state. is it so that on Tab key QML is refreshing/redrawing the UI.

Log in to reply