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. Chicken and Egg problem with Qt's QWidgets
Forum Updated to NodeBB v4.3 + New Features

Chicken and Egg problem with Qt's QWidgets

Scheduled Pinned Locked Moved General and Desktop
2 Posts 2 Posters 1.7k 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.
  • R Offline
    R Offline
    ronM71
    wrote on last edited by
    #1

    I have a *.ui definition I'm loading and running. A certain sub-widget there has the rectangle of (x=0,y=88,w=400,h=200). When i instantiate the QWidget class based on the *.ui, and show() it-- everything is fine.

    I need to be able to get this rectangle BEFORE I show the widget.

    when I just instantiate the class, the geometry object always returns (0,0,100,30). only after I "show()" the widget, I'll get the correct geometry. I may be able to use the sizeHint for this sub-widget, but what about the "hint-X" or "hint-Y"? how do I get to my (x=0,y=88,w=400,h=200) BEFORE showing the widget? This is critical for one of my applications (this is a 3rd party component requirement, it cannot change).

    1 Reply Last reply
    0
    • L Offline
      L Offline
      loladiro
      wrote on last edited by
      #2

      Maybe calling "adjustSize":http://doc.qt.nokia.com/4.7/qwidget.html#adjustSize on your main widget could help you.

      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