Sunday, 8 September 2013

Get QWidget absolute position

Get QWidget absolute position

I want to get the absolute x and y coordinates of a frame control. I know
that there is a QWidget::mapToGlobal function that should give me these
coordinates - but it always returns the relative points.
My code is:
int y = ui->frame->mapToGlobal(ui->frame->window()->pos()).y();
Can anyone please help me to understand what I am doing wrong?

No comments:

Post a Comment