c++ - QToolTip shows up in the wrong cordinates -


i have qcustomplot , show qtooltip on mouseover component. here using. slot.

void customplot::displayplotvalue(qmouseevent* val) {      qtooltip::showtext(val->pos(), "a tool tip"); } 

however tool tip aappears in wrong cordinates (its infact out of form has component) . suggestion on might doing wrong ?

use qwidget::maptoglobal map coordinates relative widget global coordinates, relative whole screen:

qtooltip::showtext(widget->maptoglobal(val->pos()), "a tool tip"); 

where widget qwidget.


Comments

Popular posts from this blog

css - Which browser returns the correct result for getBoundingClientRect of an SVG element? -

gcc - Calling fftR4() in c from assembly -

Function that returns a formatted array in VBA -