Results 1 to 4 of 4

Thread: How to find best size for QTableWidget?

  1. #1
    Join Date
    May 2008
    Posts
    7
    Thanked 1 Time in 1 Post
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11

    Default How to find best size for QTableWidget?

    Hi,

    I've got the following problem. I have one table (QTableWidget) and I want to find out the best size for this table. With best size I mean this size of the widget that if it is smaller with only one pixel so the scrollbars should appear.
    I tried different ways to get the size of the table but with no particular luck. In some cases the size is small and scrollbars appear, on other cases the size is too big and there is extra space in the widget which is blank.
    Any ideas how to find out this best size ?

    Thanks,
    Plamen

  2. #2
    Join Date
    Mar 2008
    Posts
    25
    Thanks
    1
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: How to find best size for QTableWidget?

    hello,
    have you tried
    QSize size () const
    to get the size of your table (QTableWidget)?

  3. #3
    Join Date
    May 2008
    Posts
    7
    Thanked 1 Time in 1 Post
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11

    Default Re: How to find best size for QTableWidget?

    Yes, I tried. But size() returns the preferred size for the widget ( I think the size which is set with sizeHint() ).
    Since QTableWidget is derivate class of QScrollArea, I think that I need a function which to tell me at what size the scrollbars will appear for the first time and this size should be considered for best size.

  4. #4
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    6,264
    Thanks
    36
    Thanked 1,519 Times in 1,389 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows Symbian S60 Maemo/MeeGo

Similar Threads

  1. QT-wince and QHttp::readAll() trouble....
    By AcerExtensa in forum Qt for Embedded and Mobile
    Replies: 6
    Last Post: 12th June 2008, 09:40
  2. problems installing Qt opensource with msvc2008 support
    By odin1985 in forum Installation and Deployment
    Replies: 6
    Last Post: 24th May 2008, 09:06
  3. QLabel size policy
    By Caius Aérobus in forum Qt Programming
    Replies: 3
    Last Post: 7th December 2007, 17:57
  4. How to find size provided by QScrollView
    By Sarma in forum Qt Programming
    Replies: 1
    Last Post: 7th March 2006, 09:26
  5. Qt 4.1.1 linker warnings
    By Matt Smith in forum Installation and Deployment
    Replies: 0
    Last Post: 26th February 2006, 22:14

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.