Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

Newbie question on ElasticNodes example



  • Node hover text clipping problem:

    I was using hoverEnterEvent and hoverLeaveEvent to allow a string of text to be displayed over a node.

    In Node::paint I've tried variants of drawText like...

    painter->drawText( 0,-5, context );

    to display a QString context above the node, the string is constrained to the Rect of the Node.

    How do I give the string (variable length) a different display Rect than it's associated Node?

    All help welcome!



  • The hover text string has be drawn on a widget of it's own. You need to have two widgets

    1. The node widget
      and
    2. The hover text widget


  • Thanks.

    And can I use the Node relative scene coordinates to locate the text widget somehow?



  • by the those are items (technically speaking not widgets)

    bq. And can I use the Node relative scene coordinates to locate the text widget somehow?

    If you have the hover text item as a child item of the node item, then yes that is how you would do.


Log in to reply