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. How to display QGraphicsTextItem vertically in Qt?

How to display QGraphicsTextItem vertically in Qt?

Scheduled Pinned Locked Moved Unsolved General and Desktop
1 Posts 1 Posters 184 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.
  • T Offline
    T Offline
    tushu
    wrote on last edited by
    #1

    I have a QGraphicsView with various logic gates. Every logic gate have pins and pins have names. To display pin names, I have used class which is derived from QGraphicsTextItem.

    Stack.png

    In 1st diagram, we can see pin names as E, GND and SRC. As all the pins location are very near to each other, so I tried to display them vertically.

    In 2nd diagram, with the help of setRotation(-90) from QraphicsTextItem. I rotated them anticlocke wise.

    In 3rd diagram, I just changed their x and y location.

    Now we can see that, final pin name E's location is far from it's pin. But GND and SRC are properly placed near to their pin location.
    If I changed E's y co-ordinates, then other pins y location also changes ( which I do not want)

    So can I adjust pin name E near to it's pin location without changing other pins x and y locations ?

    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