[Qt-interest] Prevent word-wrap between text and image in QLabel
Jugdish
jugdizh at gmail.com
Fri Nov 20 18:57:29 CET 2009
Is there an easy way to prevent an image and its neighboring text from
breaking on lines in a QLabel that has wordWrap enabled?
For example, consider this label:
QLabel *label = new QLabel(this);
label->setWordWrap(true);
label->setText("<img src=\":/icon.png\">item1, <img
src=\":/icon.png\">item2, <img src=\"icon.png\">item3");
I would like the lines to wrap only where there is a space in the text and
not in between an item and its icon. I have tried various HTML things like
using <nobr></nobr> tags, or <span style='white-space:pre'></span> but this
has no effect. Any ideas?
Thanks
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.qt-project.org/pipermail/qt-interest-old/attachments/20091120/fbc42445/attachment.html
More information about the Qt-interest-old
mailing list