Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Qt for Python
  4. How do I dynamically display an image when I have a python backend?
Qt 6.11 is out! See what's new in the release blog

How do I dynamically display an image when I have a python backend?

Scheduled Pinned Locked Moved Unsolved Qt for Python
1 Posts 1 Posters 250 Views
  • 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.
  • T Offline
    T Offline
    TheWhaler
    wrote on last edited by
    #1

    main.qml

    Connections {
            target: backend
    
            function onGetVideoThumbnail(thumbnail_url) {
                  ttext.source = thumbnail_url
            }
        }
    
    GridView {
            id: gridView
            anchors.fill: parent
            anchors.rightMargin: 10
            anchors.leftMargin: 10
            anchors.bottomMargin: 10
            anchors.topMargin: 10
            model: ListModel {
                Component.onCompleted: {
                    for (var i = 0; i < 4; i++) {
                        append(createListElement());
                    }
                }
    
                function createListElement() {
                    return {
                        name: "Green",
                        colorCode: "green"
                    };
                }
            }
            cellWidth: 100
            delegate: Item {
                x: 5
                height: 50
                Column {
                    Text {
                        id: ttext
                        text: "H"
                        color: "#ffffff"
                    }
    
                    spacing: 5
                }
            }
            cellHeight: 70
        }
    

    My script is able to send and array of image url to the backend but I'm unable to assign the array of image to dynamically display the image. How do I do this?

    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