Results 1 to 6 of 6

Thread: QLabel and QLCDNumber

  1. #1
    Join Date
    Jan 2006
    Posts
    976
    Thanks
    53
    Qt products
    Qt3
    Platforms
    Windows

    Question QLabel and QLCDNumber

    Hi, I have 2 prolems.
    I have designed a label from desinger with a text eg. "cancel". Noew I'd like rotate it to vertical position. Is it possible? it's better make this also:
    Qt Code:
    1. C
    2. A
    3. N
    4. C
    5. E
    6. L
    To copy to clipboard, switch view to plain text mode 
    Furthermore: I need to have a lcdnumber that shows real values (eg 5.5). How?
    Thanks
    Regards

  2. #2
    Join Date
    Jan 2006
    Location
    Ukraine,Lviv
    Posts
    454
    Thanks
    9
    Thanked 27 Times in 27 Posts
    Qt products
    Qt3
    Platforms
    Unix/X11 Windows

    Default Re: QLabel and QLCDNumber

    1) You can create this lable in Qt Designer (call edit text window and put there needed words through Enter)
    2)void QLCDNumber::display ( double num ) [slot]
    Last edited by zlatko; 16th March 2006 at 17:57.
    a life without programming is like an empty bottle

  3. #3
    Join Date
    Jan 2006
    Posts
    976
    Thanks
    53
    Qt products
    Qt3
    Platforms
    Windows

    Default Re: QLabel and QLCDNumber

    This code said incompatible argoument
    Qt Code:
    1. connect( slider1, SIGNAL(valueChanged(int)), SLOT (display(double) ));
    To copy to clipboard, switch view to plain text mode 
    Is there a fast way to resolve it?
    Is possible rotate a QLabel?
    Thanks
    Regards

  4. #4
    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: QLabel and QLCDNumber

    Quote Originally Posted by mickey
    I have designed a label from desinger with a text eg. "cancel". Noew I'd like rotate it to vertical position. Is it possible?
    As zlatko said, edit the content of the label in designer and insert a line break after each letter.

    Or if you want to create it in code:
    Qt Code:
    1. QLabel label("C\na\nn\nc\ne\nl");
    To copy to clipboard, switch view to plain text mode 

    Quote Originally Posted by mickey
    This code said incompatible argoument
    Qt Code:
    1. connect( slider1, SIGNAL(valueChanged(int)), SLOT (display(double) ));
    To copy to clipboard, switch view to plain text mode 
    Parameter types must match. int does not match double

  5. #5
    Join Date
    Jan 2006
    Posts
    976
    Thanks
    53
    Qt products
    Qt3
    Platforms
    Windows

    Default Re: QLabel and QLCDNumber

    Quote Originally Posted by jpn
    As zlatko said, edit the content of the label in designer and insert a line break after each letter.

    Or if you want to create it in code:
    Qt Code:
    1. QLabel label("C\na\nn\nc\ne\nl");
    To copy to clipboard, switch view to plain text mode 
    I undestand this; but this above is different to rotate of 90 grades the label "Cancel"....
    Isn't there a way to rotate qlabel? Thanks
    Regards

  6. #6
    Join Date
    Jan 2006
    Location
    Ukraine,Lviv
    Posts
    454
    Thanks
    9
    Thanked 27 Times in 27 Posts
    Qt products
    Qt3
    Platforms
    Unix/X11 Windows

    Default Re: QLabel and QLCDNumber

    I'm not sure but you can try reinplement drawContenst for your label and use QPainter::rotate
    a life without programming is like an empty bottle

Similar Threads

  1. Getting the value from a spinbox
    By X-man in forum Newbie
    Replies: 14
    Last Post: 28th September 2007, 02:27

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.