最近在做一个Qt的小项目,因为是新手所以走了很多弯路,想实现点击控件显示提示信息,但是提示信息却没有出现在该出现的位置,后来去查它的参数说明发现:
void QToolTip::showText(const QPoint & pos, const QString & text, QWidget * w, const QRect & rect)
Shows text as a tool tip, with the global position pos as the point of interest.
原来它的第一个参数需要是全局坐标。。。而我传入的一直是相对坐标。。。。。。