[Qt-interest] how to append text in label

Arnold Krille arnold at arnoldarts.de
Thu Mar 12 13:24:04 CET 2009


On Thursday 12 March 2009 10:39:22 Jesús Fernández wrote:
> label->setText(label->text().append("someText"));
> This is the only way.

No, this is not the only way, there is also:

label->setText( label->text() + "someText" );

and

label->setText( QString( "%1 someText" ).arg( label->text() ) );

and probably a million other possibilities. Note the the last version is 
(almost) l10n-ready. But actually I think that some languages might be 
different between "Text" and "Text (validated)", so when l10ning you might see 
some interesting effects...

Have fun,

Arnold
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 197 bytes
Desc: This is a digitally signed message part.
Url : http://lists.qt-project.org/pipermail/qt-interest-old/attachments/20090312/5dbfb3ee/attachment.bin 


More information about the Qt-interest-old mailing list