How to remove the time delay before a QToolTip is displayed?

前端 未结 1 2043
闹比i
闹比i 2020-12-15 18:42

I have a custom QGraphicsItem with a QToolTip. When hovering with the mouse on them the tool tip shows fine, but there is a small delay before the

相关标签:
1条回答
  • In the documentation for QWidget::mouseMoveEvent(QMouseEvent*) you can read the following description:

    If you want to show a tooltip immediately, while the mouse is moving (e.g., to get the mouse coordinates with QMouseEvent::pos() and show them as a tooltip), you must first enable mouse tracking as described above. Then, to ensure that the tooltip is updated immediately, you must call QToolTip::showText() instead of setToolTip() in your implementation of mouseMoveEvent().

    But instead of using the mouseMoveEvent, you could also use the QWidget::enterEvent(QEvent*).

    0 讨论(0)
提交回复
热议问题