Results 1 to 2 of 2

Thread: dropdown list in qml

  1. #1
    Join Date
    May 2011
    Posts
    120
    Thanks
    33
    Qt products
    Qt4
    Platforms
    Windows

    Default dropdown list in qml

    hai

    My goal is to create a dropdown list in qml. There are some drop downs which are aligned vertically(like

    News
    Sports
    Entertainment
    )
    when we click the arrow button on the right side of each of these, TV channel lists corresponding to each category will enlist.can i do it using list element and ListView

    i coded like this
    Qt Code:
    1. main.qml
    2. import QtQuick 1.1
    3.  
    4.  
    5. Rectangle {
    6. width: 400;height: 300
    7. Component {
    8. id: highlight
    9. Rectangle {
    10. id:backImage
    11. width: 400; height: 30
    12. color: "#b5b8b7"; radius: 25
    13. Rectangle {
    14. anchors.centerIn:backImage
    15. width: 375; height: 25
    16. color: "#cfd5d4"; radius: 20
    17. y: list.currentItem.y
    18. Behavior on y {
    19. SpringAnimation {
    20. spring: 3
    21. damping: 0.2
    22. }
    23. }
    24. }
    25. }
    26. }
    27.  
    28. ListView {
    29. id: list
    30. width: 180; height: 200
    31.  
    32. model: List{}
    33. delegate: Text { text: name }
    34.  
    35. highlight: highlight
    36. highlightFollowsCurrentItem: false
    37. focus: true
    38.  
    39. }
    40. }
    41.  
    42. List.qml
    43.  
    44.  
    45. import QtQuick 1.1
    46.  
    47.  
    48. ListModel {
    49. id: feeds
    50. ListElement { name: "news";}
    51. }
    To copy to clipboard, switch view to plain text mode 

  2. #2
    Join Date
    Nov 2011
    Location
    coimbatore
    Posts
    80
    Thanks
    1
    Thanked 5 Times in 5 Posts
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Unix/X11

    Default Re: dropdown list in qml

    hai vinayaka i am ganesh from chennai .....i have small doubt ....can u contact with me....my email is:ganeshamazon10@gmail.com ....

Similar Threads

  1. dropdown list in qt
    By vinayaka in forum Qt Programming
    Replies: 1
    Last Post: 24th February 2012, 09:05
  2. Replies: 0
    Last Post: 25th July 2011, 14:11
  3. Add a dropdown menu to QListWidgetItem
    By plan_rich in forum Newbie
    Replies: 2
    Last Post: 7th September 2010, 16:17
  4. Dropdown menu?
    By rakkar in forum Newbie
    Replies: 1
    Last Post: 9th September 2009, 17:13
  5. DropDown combo box
    By Tavit in forum Qt Programming
    Replies: 3
    Last Post: 3rd May 2008, 08:40

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Qt is a trademark of The Qt Company.