Results 1 to 5 of 5

Thread: QPathView shows an empty entry after incrementCurrentIndex

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1

    Default QPathView shows an empty entry after incrementCurrentIndex

    Hi I am trying to create a path view. Please find below the attached sample code snippet. When ever i try to do an incrementCurrentIndex(), I get a empty field at the begining of the pathview and that empty entry is filled with next element when i do decrementCurrentIndex(). How can i make my pathview behave the same both during incrementCurrentIndex() and decrementCurrentIndex() ?

    Qt Code:
    1. import QtQuick 2.0
    2.  
    3. Item {
    4. width: 180
    5. height: 250
    6. PathView {
    7. id: list
    8. focus: true
    9. preferredHighlightBegin: 2/5
    10. preferredHighlightEnd: 3/5
    11. highlightRangeMode: PathView.ApplyRange
    12. Keys.onUpPressed: decrementCurrentIndex()
    13. Keys.onDownPressed: incrementCurrentIndex()
    14. model: 5
    15. delegate: Rectangle {
    16. id: wrapper
    17. border.width: 1
    18. border.color: "green"
    19. width: 180
    20. height: 40
    21. color: "steelblue"
    22. Text {anchors.centerIn: parent; text: index; font.bold: wrapper.PathView.isCurrentItem?true:false}
    23. }
    24. path: Path {
    25. id: path
    26.  
    27. startX: 90; startY: 20
    28. PathLine { x: 90; y: 40*(5)}
    29. }
    30. }
    31. }
    To copy to clipboard, switch view to plain text mode 
    Last edited by rannamal; 30th November 2016 at 09:40.

Similar Threads

  1. QSqlQueryModel shows empty table with correct headers
    By Charlie42 in forum Qt Programming
    Replies: 1
    Last Post: 3rd May 2021, 07:07
  2. Replies: 0
    Last Post: 29th April 2011, 09:02
  3. Replies: 2
    Last Post: 27th October 2010, 11:23
  4. QComboBox (model based) - provide an empty entry
    By antarctic in forum Qt Programming
    Replies: 0
    Last Post: 21st October 2009, 18:45
  5. Replies: 2
    Last Post: 17th July 2006, 14:52

Tags for this Thread

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
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.