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. Combobox not closing when delegate of the listview goes out of scope
Forum Updated to NodeBB v4.3 + New Features

Combobox not closing when delegate of the listview goes out of scope

Scheduled Pinned Locked Moved Unsolved QML and Qt Quick
3 Posts 2 Posters 319 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.
  • R_ramR Offline
    R_ramR Offline
    R_ram
    wrote on last edited by R_ram
    #1

    Hi all,

    I have made a delegate for listview that contains Combobox. If I opened the Combobox and scrolls the listview the Combobox popup is moving with the delegate position that's ok. But when the delegate goes out of the listview area Combobox popup continues to moves even out of the listview area.

    How to close the Combobox when the corresponding delegate goes out of the listview area.

    Thanks in advance...

    Out of scope view
    Screenshot from 2020-04-05 19-45-42.png

    ===================================================================

    Normal view
    Screenshot from 2020-04-05 19-45-28.png

    1 Reply Last reply
    0
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi,

      What version of Qt are you using.?
      On what OS ?
      Can you provide a minimal compilable example that shows that behaviour ?

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      R_ramR 1 Reply Last reply
      0
      • SGaistS SGaist

        Hi,

        What version of Qt are you using.?
        On what OS ?
        Can you provide a minimal compilable example that shows that behaviour ?

        R_ramR Offline
        R_ramR Offline
        R_ram
        wrote on last edited by
        #3

        @SGaist My environment details and I have added the code here

        OS - Ubuntu 18.04
        Qt version - 5.9.6

        import QtQuick 2.9
        import QtQuick.Window 2.2
        import QtQuick.Controls 2.2
        
        Window {
            visible: true
            width: 640
            height: 480
            title: qsTr("Hello World")
        
            Column {
                spacing: 0
                anchors.fill: parent
                Item {
                    width: parent.width
                    height: parent.height * 0.4
                    Image {
                        anchors.fill: parent
                        anchors.margins: 10
                        source: "https://lh4.googleusercontent.com/proxy/cITVCAj9KJ5Hfwd5iuNDhzdB2pSrMQv2rzTl-vvg23he2qdCisZBG-MzV35y_r2zijC9X4QOpda9eHzr_hA"
                    }
                }
                ListView {
                    width: parent.width
                    height: parent.height * 0.6
                    model: 10
                    spacing: 5
                    clip: true
                    highlightRangeMode: ListView.StrictlyEnforceRange
                    delegate: Rectangle {
                        width: parent.width
                        height: 50
                        color: index % 2 == 0 ? "lightsteelblue" : "steelblue"
                        Row {
                            spacing: 25
                            anchors.centerIn: parent
                            Label {
                                text: qsTr("%1").arg(index)
                                anchors.verticalCenter: parent.verticalCenter
                            }
                            ComboBox {
                                anchors.verticalCenter: parent.verticalCenter
                                model: ["a", "b", "c"]
                            }
                        }
                    }
                }
            }
        }
        
        
        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