Qt Forum

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Unsolved

    Update: Forum Guidelines & Code of Conduct


    Qt World Summit: Early-Bird Tickets

    Chicken and Egg problem with Qt's QWidgets

    General and Desktop
    2
    2
    1527
    Loading More Posts
    • 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
      ronM71 last edited by

      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 Reply Quote 0
      • L
        loladiro last edited by

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

        1 Reply Last reply Reply Quote 0
        • First post
          Last post