Pregunta

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.

¿Fue útil?

Solución

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.

Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top