Qt Forum

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Unsolved

    can i draw Text in QGraphicsItem in order to make QGraphicsItem look like QLable?

    General and Desktop
    2
    4
    868
    Loading More Posts
    • 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.
    • O
      opengpu2 last edited by

      can i draw Text in QGraphicsItem in order to make QGraphicsItem look like QLable?
      i want to make QGraphicsItem enable to show (1)Text, (2)Image, (3)OpenGL/Direct3D scene.
      is QGraphicsItem a good way to do this?
      if not, which ui control should i use?
      thank you

      1 Reply Last reply Reply Quote 0
      • M
        mcosta last edited by

        You could use QGraphicsProxyWidget to embed a QWidget into your scene

        Once your problem is solved don't forget to:

        • Mark the thread as SOLVED using the Topic Tool menu
        • Vote up the answer(s) that helped you to solve the issue

        You can embed images using (http://imgur.com/) or (http://postimage.org/)

        1 Reply Last reply Reply Quote 0
        • O
          opengpu2 last edited by

          thankyou , i used it, i know it can embed any widget into the QGraphicsView.
          but i don't whether it is the best way to do this.

          1 Reply Last reply Reply Quote 0
          • M
            mcosta last edited by

            @opengpu2 said:

            but i don't whether it is the best way to do this.

            You can create your custom GraphicsItem (for example composed by a rectangle and a Text Items)

            Once your problem is solved don't forget to:

            • Mark the thread as SOLVED using the Topic Tool menu
            • Vote up the answer(s) that helped you to solve the issue

            You can embed images using (http://imgur.com/) or (http://postimage.org/)

            1 Reply Last reply Reply Quote 0
            • First post
              Last post