Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. How to force layouts to recompute under Qt 3
Forum Updated to NodeBB v4.3 + New Features

How to force layouts to recompute under Qt 3

Scheduled Pinned Locked Moved General and Desktop
2 Posts 2 Posters 1.8k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • N Offline
    N Offline
    ngnedin
    wrote on last edited by
    #1

    Folks,

    I wonder if someone could help me with the following question. I have an application with a large GUI, with many separate pages filled with widgets that are combined into a hierarchy of QTabWidgets. For efficiency reason, I would like to postpone constructing some of the widgets just before a user opens a relevant page. Right now I create them just before the show() call in an overloaded show() function. With Qt4 it works just fine (the window size adjusts automatically to accommodate newly created widgets), but with Qt3 the layouts for the whole application are not being redone - if the new widget does not fit on the existing window space, it gets cut off rather than for the whole application window to expand to maintain the proper layouts. I would like to maintain Qt3 compatibility for a while, since it is still used widely on Linux.

    I wonder if anyone knows how to force layouts under Qt3 to recompute? I tried many things with no avail, including calling invalidate() and activate() on all layouts in the application.

    Many thanks for any advice.

    1 Reply Last reply
    0
    • G Offline
      G Offline
      goetz
      wrote on last edited by
      #2

      If I remember correctly, something of a combination of calling update() or adjustSize() on the widget and/or calling invalidate() on the toplevel layout of the widget triggers a recalculation of the needed size.

      http://www.catb.org/~esr/faqs/smart-questions.html

      1 Reply Last reply
      0

      • Login

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • Users
      • Groups
      • Search
      • Get Qt Extensions
      • Unsolved