Results 1 to 10 of 10

Thread: Rotate QLabel

  1. #1
    Join Date
    Apr 2006
    Location
    Cologne
    Posts
    2
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Rotate QLabel

    Hi Folks,

    i want to show several IP-Adresses in a GUI. I use QLabels for this.
    Some of them should be rotated 90°, how can I achieve this, didn´t found somethin like label-rotate(90);

    Is there a chance to do this ?

    Kind regards
    -shader76-


    _____________________________
    -Visual Studio.Net 2003 & QT4.1

  2. #2
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    6,264
    Thanks
    36
    Thanked 1,519 Times in 1,389 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows Symbian S60 Maemo/MeeGo

    Default Re: Rotate QLabel

    Reimplement QLabel:aintEvent and use QPainter::rotate().
    J-P Nurmi

  3. #3
    Join Date
    Apr 2006
    Location
    Cologne
    Posts
    2
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Rotate QLabel

    aintEvent ? DO you have an example for this ?

    I´m still a noobie

  4. #4
    Join Date
    Jan 2006
    Location
    Catalonia
    Posts
    266
    Thanks
    44
    Thanked 2 Times in 2 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Rotate QLabel

    You could insert '\n' char between every number in the IP address too...

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

    Default Re: Rotate QLabel

    Quote Originally Posted by jpn
    Reimplement QLabel:aintEvent and use QPainter::rotate().

    shader76:

    the smiley was placed in there by the message window which converted
    : p
    into a smiley. It just means "QLabel:: paintEvent".

    To get it to display properly, I added a space between the ":" and the "p" which should not be there in code. If I didn't add that space, all you'd see is another smiley!

    Best,
    Jay

  6. #6
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    5,372
    Thanks
    28
    Thanked 976 Times in 912 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Rotate QLabel

    Quote Originally Posted by jayw710
    To get it to display properly, I added a space between the ":" and the "p" which should not be there in code. If I didn't add that space, all you'd see is another smiley!
    There should be a "Disable smilies in text" checkbox in "Additiona Options" below the editor.

  7. #7
    Join Date
    Jul 2007
    Posts
    166
    Thanks
    25
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Rotate QLabel

    Hi,
    I didn't get any answer for this thread. Please help

  8. #8
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    6,264
    Thanks
    36
    Thanked 1,519 Times in 1,389 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows Symbian S60 Maemo/MeeGo

    Default Re: Rotate QLabel

    Try QxtLabel
    J-P Nurmi

  9. #9
    Join Date
    Jan 2006
    Location
    Munich, Germany
    Posts
    4,714
    Thanks
    21
    Thanked 418 Times in 411 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default Re: Rotate QLabel

    off topic:
    hey jpn, cool lib!!
    I didn't know about it until now!
    You should put it in your signature or something
    If I only knew about it before... (QxtSpanSlider comes to mind for example)

    Great work, once I have some time, I'll try and contribute too.
    ==========================signature=============== ==================
    S.O.L.I.D principles (use them!):
    https://en.wikipedia.org/wiki/SOLID_...iented_design)

    Do you write clean code? - if you are TDD'ing then maybe, if not, your not writing clean code.

  10. #10
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    6,264
    Thanks
    36
    Thanked 1,519 Times in 1,389 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows Symbian S60 Maemo/MeeGo

    Default Re: Rotate QLabel

    Thanks

    PS. Contributions are very welcome. The best way to get in touch with us is to visit #qxt on freenode (the channel might be somewhat dead during xmas time, though..)
    J-P Nurmi

Similar Threads

  1. Trouble with QLabel
    By dany_MB in forum Newbie
    Replies: 3
    Last Post: 14th August 2009, 08:21
  2. Replies: 2
    Last Post: 20th January 2009, 07:13
  3. Replies: 3
    Last Post: 17th July 2008, 07:43
  4. QLabel ScaledContents ignored by style sheet?
    By WinchellChung in forum Newbie
    Replies: 3
    Last Post: 27th February 2008, 14:50
  5. QLabel size policy
    By Caius Aérobus in forum Qt Programming
    Replies: 3
    Last Post: 7th December 2007, 17:57

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.