Results 1 to 3 of 3

Thread: How to disable vertical scroll bar in QTableWidget

  1. #1
    Join Date
    Jul 2009
    Location
    Bangalore
    Posts
    68
    Thanked 1 Time in 1 Post
    Qt products
    Qt3 Qt4 Qt/Embedded
    Platforms
    Unix/X11

    Default How to disable vertical scroll bar in QTableWidget

    Hi All,

    I am using QTableWidget i have set 200 rows and 4 columns now i need to disable the vertical scroll bar how to proceed with this. Any snippet will be advantage.
    Thanks & Regards
    Sandeep G.R.

  2. #2
    Join Date
    Aug 2008
    Location
    Ukraine, Krivoy Rog
    Posts
    1,963
    Thanked 370 Times in 336 Posts
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: How to disable vertical scroll bar in QTableWidget

    if you need to disable then use something like this:
    Qt Code:
    1. QTableWidget *table = new QTableWidget(this);
    2. ....
    3. table->verticalScrollBar()->setDisabled(true);
    4. ....
    To copy to clipboard, switch view to plain text mode 
    if you need to hide it then use something like this:
    Qt Code:
    1. QTableWidget *table = new QTableWidget(this);
    2. ....
    3. table->setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
    4. ....
    To copy to clipboard, switch view to plain text mode 
    Qt Assistant -- rocks!
    please, use tags [CODE] & [/CODE].

  3. The following user says thank you to spirit for this useful post:

    sonulohani (8th March 2013)

  4. #3
    Join Date
    Jul 2009
    Location
    Bangalore
    Posts
    68
    Thanked 1 Time in 1 Post
    Qt products
    Qt3 Qt4 Qt/Embedded
    Platforms
    Unix/X11

    Default Re: How to disable vertical scroll bar in QTableWidget

    Thanks its working fine.
    Thanks & Regards
    Sandeep G.R.

Similar Threads

  1. QListView with conditional vertical automatic scroll
    By jmesquita in forum Qt Programming
    Replies: 2
    Last Post: 1st August 2009, 04:09
  2. Disable or lock a QTableWidget
    By grub87 in forum Qt Programming
    Replies: 12
    Last Post: 16th July 2009, 18:27
  3. vertical scroll bar in Qt box.
    By rajveer in forum Qt Programming
    Replies: 1
    Last Post: 22nd October 2008, 08:41
  4. QTableWidget: Disable 'snapping' to rows and columns?
    By PolyVox in forum Qt Programming
    Replies: 2
    Last Post: 8th October 2008, 21:04
  5. Vertical Scroll Bar - Style Sheet
    By vishesh in forum Qt Programming
    Replies: 2
    Last Post: 18th September 2007, 20: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.