PDA

View Full Version : how to append text in label



wagmare
12th March 2009, 09:28
hi friends,
is it possible to append some text in QLable()
we are using label->setText("someText");
the label->text() is already having the text "role"

now if user click one button say "valid" button .. i have to append the text "validated" to "role" so
the label->text() will have text "role validated"
i try label->append() but says
error: ‘class QLabel’ has no member named ‘append’

how can i append a text in .cpp file .. please help ...

mazurekwrc
12th March 2009, 09:32
QString temp = label->text();
temp.apend( " validated" );
label->setText( temp );

spirit
12th March 2009, 09:32
try this


...
label->setText(label->text() + " some other text");
...

wagmare
12th March 2009, 11:06
thanks to both mr.mazurekwrc and spirit