Results 1 to 8 of 8

Thread: Force geometry update of hidden widget

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #3
    Join Date
    May 2008
    Posts
    5
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Force geometry update of hidden widget

    I have a QMenu with an embedded widget (provided by a QWidgetAction). The content of the embedded widget is updated between showings of the menu which could cause the size of the embedded widget to change.

    It appears to me that when the menu tries to calculate its new size for the next show the widget's layout has not been updated to reflect the new required size because the updates are applied while the widget was not visible. The widget's sizeHint is not updated until it is actually shown, too late to influence the size of the menu. Consequently, the menu uses the stale size of the widget, and the size of the menu is always lagging behind the size of the widget by one update cycle.

    I was thinking if I could force the widget to update its layout (really its sizeHint) prior to being shown, the QMenu could obtain the correct sizeHint from the widget.
    Last edited by stburton; 8th December 2009 at 22:48.

Similar Threads

  1. QDockWidget inside another widget in the center?
    By Antebios in forum Qt Programming
    Replies: 1
    Last Post: 16th February 2010, 07:06
  2. Replies: 2
    Last Post: 21st October 2009, 08:13
  3. update widget from separate thread
    By method in forum Qt Programming
    Replies: 5
    Last Post: 10th July 2009, 14:33
  4. Resize widget force layout resizing
    By ^NyAw^ in forum Qt Programming
    Replies: 17
    Last Post: 11th February 2009, 11:27
  5. closing dialog in hidden main Widget
    By Lele in forum Qt Programming
    Replies: 3
    Last Post: 6th December 2006, 10:35

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.