frameGeometry vs Geometry
I read a few post about this and somehow I'm still not clear on how i get the frame size of my main window.
in this exemple, geometry and frameGeometry only have 1 of difference. I get the same result if i query after the window is painted
Code:
QRect myrect
= this
->geometry
();
QRect frameRect
= this
->frameGeometry
();
ultimately i want to be able to move my child widget only within the frame of my main window
thanks
Re: frameGeometry vs Geometry
The child's coordinates are always inside the parent, starting witn 0/0 in the top left corner.
Why do you want to move the child manually?
Cheers,
_
Re: frameGeometry vs Geometry
to animate the child windows
the documentation seems pretty clear:
"Excluding the window frame: geometry(), width(), height(), rect(), and size().
Note that the distinction only matters for decorated top-level widgets. "
however i cant get this kind of result
Re: frameGeometry vs Geometry
If it is not a top level window I would just ignore frameGeometry().
The rectange returned by geometry() should be the same values that x(), y(), width() and height() return
Cheers,
_
Re: frameGeometry vs Geometry
after a few hours of playing around, I manage to make it work, problem is it has to be done after the mainwindow is painted, with a timer i used the following code
Code:
void MainWindow::timer()
{
QRect myrec
= myview
->geometry
();
QRect myrec2
= myview
->frameGeometry
();
int y1 = myrec.y();
int x1 = myrec.x();
int x2 = myrec2.x();
int y2 = myrec2.y();
mydialog->move(x1-x2,y1-y2);
}