Results 1 to 4 of 4

Thread: Qt with vertical scroll

  1. #1
    Join Date
    Nov 2013
    Posts
    12
    Thanks
    1
    Qt products
    Qt5
    Platforms
    Windows

    Default Qt with vertical scroll

    hello,

    I am new to QT and trying my hand in tableview. I have huge data but want to show 1-10 in a table and want to use scroll bar when items will get added up. My question is .. is there any way that i can get to know that from which index to which index i am currently seeing in my table.
    Basically I want to know how do i make a view of my table dynamic to fetch and display dynamic data.

    Kindly suggest me ..


    Thanks ...

  2. #2
    Join Date
    Jan 2006
    Location
    Graz, Austria
    Posts
    8,403
    Thanks
    37
    Thanked 1,543 Times in 1,494 Posts
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: Qt with vertical scroll

    The easiest way if if you know the amount of items before hand.
    In this case you can just implement a table model and let rowCount() return that number. Qt's table view will only retrieve that it needs for displaying.

    Cheers,
    _

  3. #3
    Join Date
    Nov 2013
    Posts
    12
    Thanks
    1
    Qt products
    Qt5
    Platforms
    Windows

    Default Re: Qt with vertical scroll

    Thank you !!!

    It means that we have to maintain a table internally, which will keep the mapping between a view and the data.

    Thanks...

  4. #4
    Join Date
    Jan 2006
    Location
    Graz, Austria
    Posts
    8,403
    Thanks
    37
    Thanked 1,543 Times in 1,494 Posts
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: Qt with vertical scroll

    Depending on your data it might be possible to further optimize this using canFetchMore() and fetchMore(), but of course also more complex.

    Cheers,
    _

Similar Threads

  1. Replies: 1
    Last Post: 16th December 2013, 20:30
  2. MAC ONLY- Vertical Scroll problem with QTableWidget
    By user_mail07 in forum Qt Programming
    Replies: 2
    Last Post: 26th March 2013, 10:42
  3. How to disable vertical scroll bar in QTableWidget
    By grsandeep85 in forum Qt Programming
    Replies: 2
    Last Post: 14th October 2009, 11:07
  4. vertical scroll bar in Qt box.
    By rajveer in forum Qt Programming
    Replies: 1
    Last Post: 22nd October 2008, 07:41
  5. Vertical Scroll Bar - Style Sheet
    By vishesh in forum Qt Programming
    Replies: 2
    Last Post: 18th September 2007, 19:03

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.