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
Post a Comment