Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. QML and Qt Quick
  4. ListView is not getting updated properly.
Forum Updated to NodeBB v4.3 + New Features

ListView is not getting updated properly.

Scheduled Pinned Locked Moved QML and Qt Quick
3 Posts 2 Posters 1.9k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • A Offline
    A Offline
    at_pradeep
    wrote on last edited by
    #1

    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.

    Thanks.

    1 Reply Last reply
    0
    • K Offline
      K Offline
      Kxyu
      wrote on last edited by
      #2

      Code, please.

      1 Reply Last reply
      0
      • A Offline
        A Offline
        at_pradeep
        wrote on last edited by
        #3

        @// main.cpp
        void main(int argc, char*[] argv)
        {
        QApplication::setGraphicsSystem("raster");
        QApplication app(argc, argv);

        QDeclarativeView view;
        view.setSource(QUrl::fromLocalFile("Test.qml"));
        
        view.setResizeMode(QDeclarativeView::SizeRootObjectToView);
        
        view.showFullScreen();
        app.exec();
        

        }

        //Test.qml
        Rectangle
        {
        id: mainRect
        width: 1000
        height: 700
        color: "#ffggff"
        z: 1000

        Rectangle
        {
            id: Rect1;
            width: 200;
            anchors.left: parent.left;
            anchors.top: parent.top;
            anchors.bottom: parent.bottom;
        
            color: "#ff00ff";
            z: 1100;
        
            ListModel
            {
                id: listModel;
                ....
            }
        
            ListView    
            {
                id: listView;
                ...
            }
        
            Text    
            {
                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.

        1 Reply Last reply
        0

        • Login

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • Users
        • Groups
        • Search
        • Get Qt Extensions
        • Unsolved