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. can i draw Text in QGraphicsItem in order to make QGraphicsItem look like QLable?
Forum Updated to NodeBB v4.3 + New Features

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

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

    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
    0
    • M Offline
      M Offline
      mcosta
      wrote on last edited by
      #2

      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
      0
      • O Offline
        O Offline
        opengpu2
        wrote on last edited by
        #3

        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
        0
        • M Offline
          M Offline
          mcosta
          wrote on last edited by
          #4

          @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
          0

          • Login

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