Results 1 to 6 of 6

Thread: QML scrollable row element

  1. #1
    Join Date
    Apr 2014
    Posts
    116
    Qt products
    Qt5
    Platforms
    MacOS X
    Thanks
    8

    Default QML scrollable row element

    Hi,

    again I am completely stuck here. I would like to create column with two rows. The first row I kind of a title row and shall stay at the top. The second "row" contains a ListView with logs. I would like to have this ListView scrollable but I am just not getting it right.
    This is my structure:
    Qt Code:
    1. SilicaFlickable {
    2. Column {
    3. Row { // Title }
    4. Flickable {
    5. width: page.width
    6. height: column.height - titleRow.height
    7. flickableDirection: Flickable.VerticalFlick
    8.  
    9. VerticalScrollDecorator {}
    10. clip: true
    11.  
    12. ListView {}
    13. }
    14. }
    15. }
    To copy to clipboard, switch view to plain text mode 

    The ListView is scrolling now but as soon as I leave it it scrolles back to it initial state. How can I prevent that or how can I do this better?

    Thanks

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,373
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Thanks
    3
    Thanked 5,019 Times in 4,795 Posts
    Wiki edits
    10

    Default Re: QML scrollable row element

    What is the purpose of a Flickable element you declare in line #4?

    A column with two rows where one is a title row and the other is a list view looks more or less like this:

    javascript Code:
    1. Column {
    2. anchors.fill: parent // or whetever
    3. Item { id: title /* ... */ }
    4. ListView { id: view }
    5. }
    To copy to clipboard, switch view to plain text mode 
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  3. #3
    Join Date
    Apr 2014
    Posts
    116
    Qt products
    Qt5
    Platforms
    MacOS X
    Thanks
    8

    Default Re: QML scrollable row element

    Hi,

    the Flickable is the container I wanted to be scrollable. But I does not behave as I hope. I will try your structure.

    Thanks

  4. #4
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,373
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Thanks
    3
    Thanked 5,019 Times in 4,795 Posts
    Wiki edits
    10

    Default Re: QML scrollable row element

    What is there to scroll?
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  5. #5
    Join Date
    Apr 2014
    Posts
    116
    Qt products
    Qt5
    Platforms
    MacOS X
    Thanks
    8

    Default Re: QML scrollable row element

    The ListView contains several lines.

    I finally fixed by attaching the ListView to the bottom of the column and assigning a specific hight. Then the SilicaListView will automatically scroll when the list is too long.

  6. #6
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,373
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Thanks
    3
    Thanked 5,019 Times in 4,795 Posts
    Wiki edits
    10

    Default Re: QML scrollable row element

    Quote Originally Posted by KeineAhnung View Post
    The ListView contains several lines.
    ListView is already scrollable.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


Similar Threads

  1. Replies: 9
    Last Post: 23rd April 2012, 13:53
  2. Scrollable QLayout
    By Luc4 in forum Qt Programming
    Replies: 5
    Last Post: 2nd August 2010, 14:49
  3. Scrollable Panel
    By qtoptus in forum Qt Programming
    Replies: 1
    Last Post: 5th May 2010, 10:07
  4. QWidget Scrollable
    By prasenjit in forum Newbie
    Replies: 1
    Last Post: 21st November 2009, 09:04
  5. QStackedWidget scrollable
    By mattia in forum Qt Tools
    Replies: 1
    Last Post: 19th April 2008, 09:02

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.