Results 1 to 4 of 4

Thread: How do I determine if a QTableWidget's scrollbar is visible?

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Aug 2007
    Posts
    5
    Thanks
    1
    Thanked 1 Time in 1 Post

    Default How do I determine if a QTableWidget's scrollbar is visible?

    How do I determine if my vertical scrollbar is going to be displayed at the time I'm setting up my dialog? In Qt3 MyTable->verticalScrollBar()->isHidden() always worked for me. I've tried isEnabled(), isHidden() and isVisible() but they seem to return the same thing regardless of how many items are in the table. The scroll bar policy is set to as needed. I imagine isVisible would work after the dialog is displayed but that is too late.

    Also does anyone know which of the following lines is the preferable way to determine the scroll bar width? They both seem to work on my dev machine.
    int ScrollBarWidth1 = ui.MyTable->verticalScrollBar()->sizeHint().width();
    int ScrollBarWidth2 = style()->pixelMetric(QStyle::PM_ScrollBarExtent);

    Thanks!
    Last edited by fuzzywuzzy01; 28th August 2007 at 00:45.

Similar Threads

  1. GraphicsView/GraphicsScene: scrollbar policy Qt::ScrollBarAsNeeded
    By Pieter from Belgium in forum Qt Programming
    Replies: 4
    Last Post: 21st March 2007, 13:15
  2. about scrollbar style
    By qtopiahooo in forum Qt Programming
    Replies: 1
    Last Post: 25th January 2007, 13:34
  3. QTableWidget issues
    By Djony in forum Qt Programming
    Replies: 42
    Last Post: 19th December 2006, 23:27
  4. QTableWidget editing question
    By Trasmeister in forum Qt Programming
    Replies: 1
    Last Post: 20th September 2006, 18:46
  5. Replies: 6
    Last Post: 5th March 2006, 21:05

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.