Results 1 to 5 of 5

Thread: QScrollArea scroll bars wrong size

  1. #1
    Join Date
    Jun 2010
    Posts
    26
    Qt products
    Qt3 Qt4 Qt/Embedded
    Platforms
    MacOS X Unix/X11 Windows

    Default QScrollArea scroll bars wrong size

    I am drawing some data in a widget added to a QScrollArea. I scale the data/widget depending on the available size: if the size is too small then I won't scale and that is when I want scroll bars to appear so that the user can scroll to view all the data.

    I subclassed QScrollArea so that it emits a signal after a resizeEvent. On receiving the signal the child widget gets the size of it's parent to calculate the scale to use and then resizes itself. This works quite well with one problem: when I resize the application window, the scroll bars don't always update to reflect the change in size of the QScrollArea relative to the content.

    How can I tell the QScrollArea it should recalculate the size of the handles on the scroll bars ? Or is there a way to inform it that the content has changed size ?

  2. #2
    Join Date
    Oct 2010
    Location
    Berlin, Germany
    Posts
    358
    Thanks
    18
    Thanked 68 Times in 66 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: QScrollArea scroll bars wrong size


  3. #3
    Join Date
    Jun 2010
    Posts
    26
    Qt products
    Qt3 Qt4 Qt/Embedded
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: QScrollArea scroll bars wrong size

    Quote Originally Posted by FelixB View Post
    Can you explain what you mean in more detail ?

  4. #4
    Join Date
    Oct 2010
    Location
    Berlin, Germany
    Posts
    358
    Thanks
    18
    Thanked 68 Times in 66 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: QScrollArea scroll bars wrong size

    sorry, forget it. I didn't read your text properly...

  5. #5
    Join Date
    Jun 2010
    Posts
    26
    Qt products
    Qt3 Qt4 Qt/Embedded
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: QScrollArea scroll bars wrong size

    When I resize the widget, I'm now calling QWidget::updateGeometry and it seems to work as expected.

Similar Threads

  1. scroll bars are not appearing
    By Cruz in forum Qt Programming
    Replies: 4
    Last Post: 10th September 2010, 17:26
  2. QScrollArea size of scroll bar is not getting changed
    By jthacker in forum Qt for Embedded and Mobile
    Replies: 4
    Last Post: 7th September 2010, 09:54
  3. scroll bars in QTabWidget--i don't want them
    By jhowland in forum Qt Programming
    Replies: 1
    Last Post: 29th May 2010, 08:12
  4. QScrollArea mouse events is taken by scroll bars
    By babu198649 in forum Qt Programming
    Replies: 1
    Last Post: 26th November 2007, 09:41
  5. QScrollArea's Scroll Bars
    By ToddAtWSU in forum Qt Programming
    Replies: 5
    Last Post: 19th September 2006, 13:27

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.