×

Discussion Board

Results 1 to 8 of 8
  1. #1
    Registered User
    Join Date
    Dec 2011
    Posts
    30

    qml listviewModel

    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
    Join Date
    Jun 2008
    Location
    Noida,India
    Posts
    4,025

    Re: qml listviewModel

    Are you saying something like this:

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

  3. #3
    Registered User
    Join Date
    Dec 2011
    Posts
    30

    Re: qml listviewModel

    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
    Super Contributor
    Join Date
    Jun 2006
    Location
    India
    Posts
    3,037

    Re: qml listviewModel

    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";}
    }
    ]
    Use [URL="http://qt.nokia.com/products/qt-quick/"]Qt-Quick[/URL] to make your application UI more attractive.

    [URL="http://store.ovi.com/content/271896"]http://store.ovi.com/content/271896[/URL] | [URL="http://store.ovi.com/content/276199"]http://store.ovi.com/content/276199[/URL] |[URL="http://store.ovi.com/content/276202"] http://store.ovi.com/content/276202[/URL] | [URL="http://store.ovi.com/content/280827"]http://store.ovi.com/content/280827[/URL]

  5. #5
    Nokia Developer Champion
    Join Date
    Jun 2008
    Location
    Noida,India
    Posts
    4,025

    Re: qml listviewModel

    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
    Join Date
    Dec 2011
    Posts
    30

    Re: qml listviewModel

    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
    Join Date
    Jun 2008
    Location
    Noida,India
    Posts
    4,025

    Re: qml listviewModel

    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
    Join Date
    Dec 2011
    Posts
    30

    Re: qml listviewModel

    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
  •  
×