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. Newbie question on ElasticNodes example

Newbie question on ElasticNodes example

Scheduled Pinned Locked Moved General and Desktop
4 Posts 2 Posters 1.3k Views 1 Watching
  • 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.
  • F Offline
    F Offline
    fireking
    wrote on last edited by
    #1

    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!

    1 Reply Last reply
    0
    • S Offline
      S Offline
      Santosh Reddy
      wrote on last edited by
      #2

      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

      SS

      1 Reply Last reply
      0
      • F Offline
        F Offline
        fireking
        wrote on last edited by
        #3

        Thanks.

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

        1 Reply Last reply
        0
        • S Offline
          S Offline
          Santosh Reddy
          wrote on last edited by
          #4

          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.

          SS

          1 Reply Last reply
          0

          • Login

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