Results 1 to 5 of 5

Thread: QML: ScrollView with GridView inside: adjust cell to available space (scroll?)

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Jan 2006
    Location
    Graz, Austria
    Posts
    8,416
    Thanks
    37
    Thanked 1,544 Times in 1,494 Posts
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: QML: ScrollView with GridView inside: adjust cell to available space (scroll?)

    What if you change the width of the gridview instead

    Qt Code:
    1. GridView {
    2. width: parent.width - (scrollBarVisible ? iScrollWidth : 0)
    3. iSizeThumb: width / 3
    4. }
    To copy to clipboard, switch view to plain text mode 

  2. #2
    Join Date
    Apr 2013
    Posts
    61
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: QML: ScrollView with GridView inside: adjust cell to available space (scroll?)

    It seems to hang (not always) when scroll must appear (maybe a loop resizing?)...

    Qt Code:
    1. GridView {
    2. ...
    3. property bool scrollBarVisible: contentHeight > height
    4. width: parent.width - (scrollBarVisible ? scrollView.iScrollWidth : 0)
    5. property int iSizeThumb: width / 3
    6.  
    7. cellWidth: iSizeThumb; cellHeight: iSizeThumb
    8. delegate: Item {
    9. width: grid.cellWidth; height: grid.cellHeight
    10. Rectangle { color: colorR; anchors.fill: parent; anchors.margins: 2}
    11. }
    12. }
    To copy to clipboard, switch view to plain text mode 

Similar Threads

  1. Replies: 7
    Last Post: 24th June 2016, 10:52
  2. Replies: 9
    Last Post: 2nd July 2014, 11:21
  3. Replies: 7
    Last Post: 9th September 2013, 08:31
  4. Replies: 6
    Last Post: 7th November 2010, 14:17
  5. Long text inside a table cell
    By TheKing in forum Qwt
    Replies: 0
    Last Post: 15th December 2009, 20:35

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
  •  
Qt is a trademark of The Qt Company.