PDA

View Full Version : QLabel and QLCDNumber



mickey
16th March 2006, 16:48
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:


C
A
N
C
E
L
Furthermore: I need to have a lcdnumber that shows real values (eg 5.5). How?
Thanks

zlatko
16th March 2006, 16:55
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]

mickey
16th March 2006, 18:28
This code said incompatible argoument


connect( slider1, SIGNAL(valueChanged(int)), SLOT (display(double) ));
Is there a fast way to resolve it?
Is possible rotate a QLabel?
Thanks

jpn
16th March 2006, 18:48
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:


QLabel label("C\na\nn\nc\ne\nl");



This code said incompatible argoument


connect( slider1, SIGNAL(valueChanged(int)), SLOT (display(double) ));

Parameter types must match. int does not match double :)

mickey
16th March 2006, 22:02
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:


QLabel label("C\na\nn\nc\ne\nl");


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

zlatko
17th March 2006, 08:12
I'm not sure but you can try reinplement drawContenst for your label and use QPainter::rotate