hi, when I click on qglwiget I need put cursor at middle of widget; this isn't working!
Is this ok? thanks
Qt Code:
//paintGL of myWidget classTo copy to clipboard, switch view to plain text mode
hi, when I click on qglwiget I need put cursor at middle of widget; this isn't working!
Is this ok? thanks
Qt Code:
//paintGL of myWidget classTo copy to clipboard, switch view to plain text mode
Regards
Unfortunately, not.Originally Posted by mickey
Qt docs say:
But you use coordinates relative to the parent widget:void QCursor::setPos ( int x, int y ) [static]
Moves the cursor (hot spot) to the global screen position (x, y).
You can call QWidget::mapToGlobal() to translate widget coordinates to global screen coordinates.
(it would work if the widget was a top level widget).int QWidget::x () const
Returns the x coordinate of the widget relative to its parent including any window frame. See the "x" property for details.
This should work:Qt Code:
To copy to clipboard, switch view to plain text mode
Bookmarks