Word Wrap of Text in QLabel/bg: Difference between revisions

From Qt Wiki
Jump to navigation Jump to search
No edit summary
(No difference)

Revision as of 07:20, 24 February 2015


Български English

Опаковане на думи от текст с QLabel

Текстът в "QLabel":http://doc.qt.nokia.com/latest/qlabel.html може да опакова редове около ограничения за думи чрез "свойството wordWrap":http://doc.qt.nokia.com/latest/qlabel.html#wordWrap-prop. По подразбиране опаковането да думи е изключено. За да го включите използвайте setWordWrap():


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