position - Converting mouse coordinates to label coordinates in Qt -


i'm in trouble such issue: need select area rect on label, i'm using qrubberband this, there 1 problem: need know coordinates of current rect on label, i'm in trouble it, because mouseevent->pos() give coordinates starts top left corner on mainwindow border, i've rotate standard coords on label (from top left bottom left corner, paint them usually).
anybody knows how can translation?

qpoint mappedpos = mylabel->mapfromparent(mywindow, mouseevent->pos()); 

also, qtransform provides number of map() functions should able point in rotated coordinates well.

see:

qwidget::mapfromparent()

qtransform::map()


Comments

Popular posts from this blog

jquery - How can I dynamically add a browser tab? -

node.js - Getting the socket id,user id pair of a logged in user(s) -

keyboard - C++ GetAsyncKeyState alternative -