Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Tooltip fall asleep delay for QGraphicsItem

Tooltip fall asleep delay for QGraphicsItem

Scheduled Pinned Locked Moved Solved General and Desktop
2 Posts 1 Posters 582 Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • L Offline
    L Offline
    Lachrymology
    wrote on last edited by Lachrymology
    #1

    Hi all,

    the current behaviour for Qt 5.11.2 when moving the mouse cursor over a QGraphicsItem with a tooltip is, that the tooltip is only shown for some seconds.

    I want to remove this "fall asleep" behaviour. The tooltip should hide itself like on a normal QLabel, when the mouse leaves the object.

    I tried to solve it over the setStyle method for the QGraphicsScene:

    class MyStyle : public QProxyStyle
    {
    public:
        int styleHint(StyleHint hint, const QStyleOption *option = nullptr, const QWidget *widget = nullptr, QStyleHintReturn *returnData = nullptr) const override {
            if (hint == SH_ToolTip_FallAsleepDelay)
                return -1; //0 and 30000 doesn't work either
            return QProxyStyle::styleHint(hint, option, widget, returnData);
        }
    };
    

    I tried to override the helpEvent of QGraphicsScene to show the tooltips on my own, but the tooltip event is forwarded to the internal "tooltip-show-method" before the helpEvent is called.

    Does anyone have another idea how to prevent the fall asleep behaviour?

    1 Reply Last reply
    0
    • L Offline
      L Offline
      Lachrymology
      wrote on last edited by
      #2

      I had an own implementation of showing the Tooltips in hoverEnter .. now I'm using the default tooltip method and this one works like expected.

      1 Reply Last reply
      1

      • Login

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • Users
      • Groups
      • Search
      • Get Qt Extensions
      • Unsolved