Results 1 to 9 of 9

Thread: repeater polish() loop on ios

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Oct 2014
    Posts
    104
    Thanks
    16
    Thanked 1 Time in 1 Post
    Qt products
    Qt5
    Platforms
    Unix/X11 Windows

    Default repeater polish() loop on ios

    Hi Qt Masters,

    I am having error polish() loop in iOS when binding image source using repeater.
    However no such error appeared when building it in Android.
    When I tried debugging (putting logs), found out that the repeater populates the image row twice then loop error, which made me conclude that the error is due to repeater population.
    I can't find any error in the code which triggers the display of the image row twice or more.
    Is there a way to limit the repeater to populate only once on first display?
    Except when there is mouse interaction because new image source will be displayed.
    Thanks in advance.

    Qt Code:
    1. Item
    2. {
    3. id: root
    4.  
    5. property int currLevel: 1
    6. property bool disabled: currLevel <= 0
    7.  
    8. Layout.fillWidth: true
    9.  
    10. implicitHeight: row.implicitHeight
    11. implicitWidth: row.implicitWidth
    12.  
    13. Row {
    14. id: row
    15. anchors.fill: parent
    16.  
    17. Repeater
    18. {
    19. id:repeater
    20.  
    21. model: 10
    22.  
    23. Image {
    24. id: img
    25.  
    26. function urlForState(disabled, hover, active) {
    27. if(disabled && active) return "img-disabled.png"
    28. if(disabled) return "img-off.png"
    29.  
    30. if (active) {
    31. if (hover) return "img-on-over.png"
    32. return "img-on.png"
    33. } else {
    34. if (hover) return "img-off-over.png"
    35. return "img-off.png"
    36. }
    37. }
    38.  
    39. width: row.width/model
    40. fillMode: Image.PreserveAspectFit
    41.  
    42. source: urlForState(root.disabled, mouseArea.pressed, root.currLevel > index)
    43. }
    44. }
    45. }
    46.  
    47. MouseArea
    48. {
    49. id: mouseArea
    50.  
    51. anchors.fill: parent
    52.  
    53. hoverEnabled: true
    54. }
    55. }
    To copy to clipboard, switch view to plain text mode 
    Last edited by joko; 10th March 2015 at 14:27.

Similar Threads

  1. PropertyChanges on repeater elements
    By joko in forum Qt Quick
    Replies: 4
    Last Post: 15th October 2014, 11:36
  2. Performance Issue When Using Repeater
    By alizadeh91 in forum Qt Quick
    Replies: 7
    Last Post: 24th July 2012, 14:04
  3. QTranslator and polish signs
    By damon_1990 in forum Newbie
    Replies: 0
    Last Post: 11th December 2011, 22:04
  4. Replies: 4
    Last Post: 6th August 2011, 01:40
  5. Replacing polish diacritics in the string
    By kornicameister in forum Qt Programming
    Replies: 3
    Last Post: 8th February 2011, 15:54

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.