PDA

View Full Version : Align to the center QListWidgetItems in QListWidget



ouekah
22nd February 2010, 21:14
Hi,

I've got some icons in a QListWidget that I would like to center. I tried with "setViewMode(QListView::IconMode) but unfortunately the items are laid out using LeftToRight flow. And I would like the items to be laid out using TopToBottom flow like in QListView::ListMode and centered in the QListWidget.

Is there any way to achieve that ?

ecanela
23rd February 2010, 00:31
ry to use the function QListView::setFlow()


MyListWidget->setFlow(QListView::TopToBottom);

ouekah
23rd February 2010, 07:52
Yep I tried that naturally but the resulting display is not the same. The text that was below an icon would be on its right which is not what I want...:(

As I said, I would like the items to be laid out using TopToBottom flow like in QListView::ListMode and centered in the QListWidget. But without using QListView::ListMode...