PDA

View Full Version : How to get the position of a QMdiSubWindow



doberkofler
6th November 2009, 12:34
I'm using a main window and create QMdiSubWindow windows in its QMdiArea.
I cannot see how to retrieve the current geometry (position relative to the main window).
When using frameGeometry() the position is always y=30 and x=4 that seems to be position of the client area in the window.
What am I doing wrong?

yogeshgokul
6th November 2009, 13:03
You can also try:

mdiArea->activeSubWindow()->pos();

doberkofler
6th November 2009, 18:35
Thank you very much for your help. This does work but Ido not to understand what is going on here under the hood.
1) Why would using "mdiArea->activeSubWindow()->pos()" work and "this->pos()" in the subwindow not?
2) Why does "this->pos()" work on a "regular" window work and on an Mdi subwindow not?
3) In the meantime I'm also struggling with the problem that my overwritten "moveEvent(QMoveEvent*)" method in the Mdi subwindow does not seem to get invoked when changing the position of the window.