Kel Solaar
11th May 2010, 21:08
Hello,
I would like to know how the QListWidget setup in iconMode is doing to elide the text under the icon in order to do the same with a QListView.
I have setup a QListView and a QListWidget, a QStandardItemModel is used to feed the QListView.
Here a screen of the widgets, the top one being the QListView, the bottom one being the QListWidget :
http://kelsolaar.hdrlabs.com/sIBL_GUI/Support/Pictures/sIBL_GUI_ListViewVsListWidget.jpg
as you can see the QListWidget is eliding the texts nicely.
Now here is a test using the setUniformItemSizes method of the QListView :
http://kelsolaar.hdrlabs.com/sIBL_GUI/Support/Pictures/sIBL_GUI_ListViewVsListWidget_UniformSize.jpg
Better but not really perfect.
KS
I would like to know how the QListWidget setup in iconMode is doing to elide the text under the icon in order to do the same with a QListView.
I have setup a QListView and a QListWidget, a QStandardItemModel is used to feed the QListView.
Here a screen of the widgets, the top one being the QListView, the bottom one being the QListWidget :
http://kelsolaar.hdrlabs.com/sIBL_GUI/Support/Pictures/sIBL_GUI_ListViewVsListWidget.jpg
as you can see the QListWidget is eliding the texts nicely.
Now here is a test using the setUniformItemSizes method of the QListView :
http://kelsolaar.hdrlabs.com/sIBL_GUI/Support/Pictures/sIBL_GUI_ListViewVsListWidget_UniformSize.jpg
Better but not really perfect.
KS