← Back to team overview

touch-packages team mailing list archive

[Bug 1493882] Re: selectMode property isn't obeyed on ListItem if set at component creation

 

Actually you can do that on the ListView's level, using
ViewItems.selectMode property, no need a Component.onCompleted
implementation.

** Changed in: ubuntu-ui-toolkit (Ubuntu)
     Assignee: (unassigned) => Zsombor Egri (zsombi)

** Changed in: ubuntu-ui-toolkit (Ubuntu)
   Importance: Undecided => Low

-- 
You received this bug notification because you are a member of Ubuntu
Touch seeded packages, which is subscribed to ubuntu-ui-toolkit in
Ubuntu.
https://bugs.launchpad.net/bugs/1493882

Title:
  selectMode property isn't obeyed on ListItem if set at component
  creation

Status in ubuntu-ui-toolkit package in Ubuntu:
  New

Bug description:
  Steps to reproduce

  1) Run the following QML:

  import QtQuick 2.4
  import Ubuntu.Components 1.3

  MainView {
      Page {
          ListView {
              anchors.fill: parent
              model: 5
              delegate: ListItem {
                  selectMode: true
                  Label {
                      anchors.centerIn: parent
                      text: index
                  }
              }
          }
      }
  }

  Expected outcome

   ListView should be in selection mode

  Actual outcome

   ListView isn't in selection mode


  This can be worked around by setting the property after the component
  is complete:

  import QtQuick 2.4
  import Ubuntu.Components 1.3

  MainView {
      Page {
          ListView {
              anchors.fill: parent
              model: 5
              delegate: ListItem {
                  Label {
                      anchors.centerIn: parent
                      text: index
                  }
                  Component.onCompleted: {
                      selectMode = true
                  }
              }
          }
      }
  }

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/ubuntu-ui-toolkit/+bug/1493882/+subscriptions


References