Discussion Board

Results 1 to 8 of 8
  1. #1
    Registered User mazeemanwar's Avatar
    Join Date
    Dec 2011
    Posts
    30
    can anyone tell me how can i select(highlited) an item on click in listviewmodel

    ref how can i use highlightFollowsCurrentItem.....etc

  2. #2
    Nokia Developer Champion vineet.jain's Avatar
    Join Date
    Jun 2008
    Location
    Noida,India
    Posts
    3,858
    Are you saying something like this:

    http://kunalmaemo.blogspot.com/2011/...legate-in.html

  3. #3
    Registered User mazeemanwar's Avatar
    Join Date
    Dec 2011
    Posts
    30
    thank sir replying i want same like this but in this code as mention "Please note that in above code, highlight only moves when you click button or you use keyboard arrow key.

    but in my case i want simply onclicked listview item should be highlited no button there will b .i want for nokia n950
    thanks advance

  4. #4
    Nokia Developer Champion kkrish's Avatar
    Join Date
    Jun 2006
    Location
    India
    Posts
    3,029
    You can define a state in delegate and can change the color.
    e.g.
    MouseArea {
    id: mouseArea
    anchors.fill: parent
    onClicked: {
    }
    }

    states: [
    State {
    name: "selected"
    when: mouseArea.pressed
    PropertyChanges {target: delegateRectangle; color: "red";}
    }
    ]

  5. #5
    Nokia Developer Champion vineet.jain's Avatar
    Join Date
    Jun 2008
    Location
    Noida,India
    Posts
    3,858
    Well there the button means the circular icon which in different color on extreme right of listitem.You can put the highlight code in the MouseArea for listitem:


    MouseArea {
    id: itemMouseArea
    anchors.fill: parent
    onClicked:
    {
    //highlight code
    }
    }

  6. #6
    Registered User mazeemanwar's Avatar
    Join Date
    Dec 2011
    Posts
    30
    sir vineet i tried this ...but the problem is it highted all the clicked item ..but i want only one ..other will b on their original color
    thanxk plz dont mind i m v new in qml

  7. #7
    Nokia Developer Champion vineet.jain's Avatar
    Join Date
    Jun 2008
    Location
    Noida,India
    Posts
    3,858
    The mouse area should be within the Row/column inside which the listitem is defined, for e.g. :

    Code:
    Row {
                    id: topLayout
                    x: somevalue; y: somevalue; height: somevalue; width: parent.width
                
                        Text {
                            id: textid
    }
    MouseArea {
    }
    }

  8. #8
    Registered User mazeemanwar's Avatar
    Join Date
    Dec 2011
    Posts
    30
    thank u sir i have done thankx a lot
    at the end your first link help my

    http://kunalmaemo.blogspot.com/2011/...legate-in.html
    :P

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Nokia Developer aims to help you create apps and publish them so you can connect with users around the world.

京ICP备05048969号  © Copyright Nokia 2013 All rights reserved