Problems with Open-Source Downloads read and

How QWidget::geometry work? I'm really confuse.

  • QMainWindow // base
    -->QWidget // central widget (myWidget)
    ---->QTextEdit // child of myWidget (myTextEdit)
    ------> QDialog // child of myTextEdit (myDialog)

    Now I want to move myDialog to center of myTextEdit by using QWidget::geometry
    but geometry of myTextEdit never return a current geometry.

    myTextEdit has 400 x 200, when call it's always return 200 x 100. What?
    I want current geometry not a current size. I try to myTextEdit.updateGeometry
    before calling but still does not work.
    How to properly update myTextEdit's geometry?

    (I'm not using the Designer, all layout and widgets create in constructor of QMainWindow)

  • Well everything is correct. When you call you got center coordinates inside myTextEdit. You can map coordinates and then use it "mapToGlobal":

Log in to reply