Results 1 to 3 of 3

Thread: rotated labels

  1. #1
    Join Date
    Feb 2006
    Posts
    26
    Thanks
    5
    Thanked 1 Time in 1 Post
    Qt products
    Qt3
    Platforms
    MacOS X Windows

    Default rotated labels

    I searched around but didn't find any solutions. Is there a way to have a label vertical (rotated ccw by 90 degrees)?

    Thanks!
    Jay

  2. #2
    Join Date
    Jan 2006
    Location
    La Spezia,Italy
    Posts
    77
    Thanks
    9
    Thanked 5 Times in 5 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: rotated labels

    Hi,concerning a frameless label, I usually draw it with a QPainter.
    Qt Code:
    1. paint.rotate(-90);
    2. paint.drawText(QRectF(/*dimensions*/),Qt::AlignCenter,"text");
    To copy to clipboard, switch view to plain text mode 

  3. #3
    Join Date
    Feb 2006
    Posts
    26
    Thanks
    5
    Thanked 1 Time in 1 Post
    Qt products
    Qt3
    Platforms
    MacOS X Windows

    Default Re: rotated labels

    Quote Originally Posted by vratojr
    Hi,concerning a frameless label, I usually draw it with a QPainter.
    Qt Code:
    1. paint.rotate(-90);
    2. paint.drawText(QRectF(/*dimensions*/),Qt::AlignCenter,"text");
    To copy to clipboard, switch view to plain text mode 
    Yeah, I didn't want to have to subclass and worry about the rotation, translation and then all the formatting changes etc.

    thanks though,
    Jay

Similar Threads

  1. Relocating axis labels
    By malcom2073 in forum Qwt
    Replies: 0
    Last Post: 9th May 2008, 13:01
  2. Tick Labels for Slider
    By jcraig in forum Qt Tools
    Replies: 2
    Last Post: 9th August 2007, 17:21
  3. QSlider with a custom set of labels for the tick marks?
    By whitefurrows in forum Qt Programming
    Replies: 3
    Last Post: 5th August 2007, 16:05
  4. setting QTreeWidget vertical labels
    By hyling in forum Qt Programming
    Replies: 2
    Last Post: 10th January 2007, 18:53
  5. Replies: 1
    Last Post: 23rd August 2006, 18:02

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.