can QWidget::mapToGlobal work when the widget is not visible ? I dont find anything on the manual . If it cannot Why ?
can QWidget::mapToGlobal work when the widget is not visible ? I dont find anything
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
I’ve just written a small program that calls
QWidget::mapToGlobal( QPoint( 0,0 ) )on a hidden widget. What I found was that the position I got varied, depending on whether the widget had already been displayed on screen before I queried its position.The QWidget::mapToGlobal() documentation says:
Reading that, it does seem logical that if the widget is not visible, it cannot possibly have a guaranteed global position on the screen.
The actual result you get from calling the method seems to depend on the position the widget was last displayed at, if any. So it seems unwise to depend on this behaviour being stable across current or future versions of Qt.