Results 1 to 3 of 3

Thread: QTableView Vertical Scrollbar

  1. #1
    Join Date
    Dec 2016
    Posts
    37
    Qt products
    Qt5
    Platforms
    Windows

    Default QTableView Vertical Scrollbar

    Hello all.

    I'm using a QTableView within a QWidget window.
    The table shows up fine but it does not have a vertical scroll bar so
    the bottom part of it gets cut off.

    How do I enable the vertical scroll bar?

    I'm using 5.7.

    Thank you.

    N

  2. #2
    Join Date
    Mar 2011
    Location
    Coimbatore,TamilNadu,India
    Posts
    382
    Thanks
    10
    Thanked 13 Times in 12 Posts
    Qt products
    Qt3 Qt4 Qt/Embedded
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: QTableView Vertical Scrollbar

    Have you tried this??
    Qt Code:
    1. setVerticalScrollBarPolicy( Qt::ScrollBarAlwaysOn );
    To copy to clipboard, switch view to plain text mode 
    or You can try with QTableWidget instead.
    Last edited by Gokulnathvc; 13th September 2017 at 04:54. Reason: updated contents

  3. #3
    Join Date
    Jan 2008
    Location
    Alameda, CA, USA
    Posts
    5,230
    Thanks
    302
    Thanked 864 Times in 851 Posts
    Qt products
    Qt5
    Platforms
    Windows

    Default Re: QTableView Vertical Scrollbar

    I'm using a QTableView within a QWidget window.
    Have you put this table view inside of a layout on your widget? If you have simply placed it on the widget without the layout, then there is nothing to manage its size and it won't get the information needed to automatically display the scroll bars when it is sized to be smaller than its contents.

    The "solution" suggested by Gokulnathvc won't actually work if the table view is not in a layout. Yes, the scrollbar will always be visible, but the bottom of the table will still be cut off.
    <=== The Great Pumpkin says ===>
    Please use CODE tags when posting source code so it is more readable. Click "Go Advanced" and then the "#" icon to insert the tags. Paste your code between them.

Similar Threads

  1. Replies: 0
    Last Post: 2nd November 2011, 06:53
  2. Replies: 0
    Last Post: 1st November 2011, 12:30
  3. How to address to vertical scrollbar, which appears in QWebView?
    By fromRussiaWithLove in forum Qt Programming
    Replies: 1
    Last Post: 30th August 2011, 02:04
  4. Resize a vertical an horizontal scrollbar.
    By IRON_MAN in forum Qt Programming
    Replies: 3
    Last Post: 19th April 2010, 15:45
  5. vertical scrollbar width
    By drkbkr in forum Qt Programming
    Replies: 25
    Last Post: 31st May 2008, 07:09

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.