I want to use QListWidget to display my content. But some of the content is quite long and I want to make the text continue on a second row instead of showing a horizontal scrollbar.

I use Qt Creator and I can't seem to find any options in the design view.

有帮助吗?

解决方案

Enable word wrapping by calling

void    setWordWrap ( bool on )

and set text elide mode to Qt::ElideNone

void    setTextElideMode ( Qt::TextElideMode mode )

Also you may check that you didn't set too small maximum height for your items in the list.

P.S. Because you wrote about horizontal scrollbar, you definitely want to have multiline text in item, but not the item on multiple rows.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top