Since QToolTip::showText() expects position in global screen coordinates, you can calculate position of tooltip using the QWidget::mapToGlobal():
QToolTip::showText(lineEdit
->mapToGlobal
(QPoint()) + QPoint( lineEdit
->width
(),
0 ),
"string to show");
QToolTip::showText(lineEdit->mapToGlobal(QPoint()) + QPoint( lineEdit->width(),0 ),"string to show");
To copy to clipboard, switch view to plain text mode
widget->mapToGlobal(QPoint()) returns coordinates of the top-left corner of the widget (in screen coordinates), so you can for example translate it to match right corner of the widget ( as above ).
Bookmarks