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. QML icon, text and button in listView, look like mosaic on Windows
Forum Updated to NodeBB v4.3 + New Features

QML icon, text and button in listView, look like mosaic on Windows

Scheduled Pinned Locked Moved Unsolved QML and Qt Quick
1 Posts 1 Posters 110 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.
  • Y Offline
    Y Offline
    Yanli Zhao
    wrote 25 days ago last edited by
    #1

    Hi,
    I am showing a custom listModel via qml. It's not complex. The only special thing, might be that the height might be 0 or regular height based on the visibility property. Things work well on Mac desktop. However it looks like mosaic on windows after press some button in the delegate. It will be normal again after hoverOn. It looks like below:
    Screenshot 2025-05-20 at 12.25.44.png
    Code:

    Rectangle {
        id: root
        color: colorScheme.panelBackground()
        width: WIDTH + HALF_PADDING
    
        ListView {
            id: listview
            orientation: Qt.Vertical
            anchors.fill: parent
            model: listModel
    
            delegate: Rectangle {
                height: showInList ? row.height + PADDING : 0
                width: WIDTH
                visible: showInList
                Row {
                    id: row
                    Image {
                        id: leftIcon
                        source: type == "Group" ? "qrc:/group.svg" : "qrc:/other.svg"
                    }
                    Column {
                        spacing: SPACING
                        Text {
                            text: "ID:" + id
                            color: colorScheme.activeContent()
                        }
                        Text {
                            text: "Name:" + name
                            color: colorScheme.activeContent()
                        }
                        Row {
                            StudioControls.Button {
                                icon.source: "qrc:/focus.svg"
                                text: focused ? "Unfocus" : "Focus"
                                onClicked: !focused ? root.requestToFocus(id, type) : root.requestToUnfocus(id, type)
                            }
                            StudioControls.Button {
                                icon.source: "qrc:/import.svg"
                                text: "Import"
                                enabled: importedUuid.length === 0
                                onClicked: root.requestToLoad(id, type)
                            }
                        }
                    }
                }
            }
        }
    }
    
    1 Reply Last reply
    0

    1/1

    20 May 2025, 11:26

    • Login

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