Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-86459

Visibility is changed automatically when use DelegateChooser and DelegateChoice

    XMLWordPrintable

Details

    • Bug
    • Resolution: Invalid
    • Not Evaluated
    • None
    • 5.15.1
    • None
    • Linux/X11

    Description

      I would like to implement switchable cell view in TableView using DelegateChooser and DelegateChoice

       

      Switch is done by set visible property of each item but not work normally

      As below code,

      1. Add new row and click a cell -> row 0 will be changed to Rectangle with blue color
      2. Add new row, several times
      3. row 0 Rectangle is changed back to Text and another row's cell is changed to blue color(a row is random)
      4. There is no log for onVisibleChanged when randomly changed

       

                  DelegateChoice {
                      column: 0 
                      Rectangle {
                          border.width: 1
                          border.color: "#d7d7d7"
                          implicitWidth: 120
                          implicitHeight: 35                    
                          Rectangle {
                              id: colorBox
                              color: 'blue' 
                              anchors.fill: parent
                              visible: false
                              onVisibleChanged: {
                                  console.log('rectangle visible changed', row)
                              }
                          }
                          Text {
                              id: plainText
                              verticalAlignment: Text.AlignVCenter
                              horizontalAlignment: Text.AlignHCenter
                              text: display 
                              anchors.fill: parent
                          }                    
                          MouseArea {
                              anchors.fill: parent
                              onClicked: {
                                  console.log('onClicked')
                                  colorBox.visible = true
                                  plainText.visible = false
                              }
                          }
                      }
                  }
      
      

       

       

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            richard Richard Moe Gustavsen
            nnnlife Yongwoo Park
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes