Difference between revisions of "Word Wrap of Text in QLabel"

From Qt Wiki
Jump to: navigation, search
 
Line 1: Line 1:
'''English''' [[Word Wrap of Text in QLabel Bulgarian|Български]]
+
[[Category:snippets]]
  
=Word Wrap of Text in QLabel=
+
'''English''' [[Word_Wrap_of_Text_in_QLabel_Bulgarian|Български]]
  
Text content in [http://doc.qt.nokia.com/latest/qlabel.html QLabel] ''[doc.qt.nokia.com]'' can wrap lines along word boundaries with the [http://doc.qt.nokia.com/latest/qlabel.html#wordWrap-prop wordWrap property] ''[doc.qt.nokia.com]''. By default, word wrap is disabled. To enable it use setWordWrap():
+
= Word Wrap of Text in QLabel =
  
===Categories:===
+
Text content in "QLabel":http://doc.qt.nokia.com/latest/qlabel.html can wrap lines along word boundaries with the "wordWrap property":http://doc.qt.nokia.com/latest/qlabel.html#wordWrap-prop. By default, word wrap is disabled. To enable it use setWordWrap():
  
* [[:Category:snippets|snippets]]
+
<code><br />QLabel *pLabel = new QLabel(this);<br />pLabel-&gt;setText(&quot;first line\nsecond line\nthird line\n&amp;quot;);<br />pLabel-&gt;setWordWrap(true);

Revision as of 09:35, 24 February 2015


English Български

Word Wrap of Text in QLabel

Text content in "QLabel&quot;:http://doc.qt.nokia.com/latest/qlabel.html can wrap lines along word boundaries with the "wordWrap property&quot;:http://doc.qt.nokia.com/latest/qlabel.html#wordWrap-prop. By default, word wrap is disabled. To enable it use setWordWrap():


QLabel *pLabel = new QLabel(this);
pLabel->setText("first line\nsecond line\nthird line\n&quot;);
pLabel->setWordWrap(true);