QListView icon size and align
Hi all,
I'm working on a content browser, I have a QListView sets to icon mode.
That works fine but the problem is how changes the item size ?
Another problem is items are not aligned, a solution exists ?
Thanks for the help
[SOLVED] :
Code:
m_DetailTree
->setMovement
( QListView::Static );
m_DetailTree
->setGridSize
( QSize( 60,
60 ) );
[PROBLEM] :
That align but the size of the item in the grid cell doesn't take all the cell space, it's fixed size, a solution exist ?
I tried :
Code:
m_DetailTree
->setGridSize
( QSize( 80,
80 ) );
m_DetailTree
->setIconSize
( QSize( 80,
80 ) );
m_DetailTree->setUniformItemSizes( true );
setIconSize has no effect, maybe a bug of Qt.
Re: QListView icon size and align
If an icon is smaller than the set icon size then it is not upscaled. Use a larger icon.
Re: QListView icon size and align
Ok, then a last question about that : Is it better to have large icon for icon view and downscale for the tree or have two icons ?
Re: QListView icon size and align
QIcon can hold more than one size of an icon and Qt mechanisms can ask QIcon for a pixmap with a given size thus it is better to have two pixmaps stored in one QIcon that will choose the pixmap for you.
Re: QListView icon size and align
Is it possible to find an icon filepath from stylesheet or that demand a custom parser ?
Re: QListView icon size and align
There is no interface for accessing the stylesheet. It is an opaque string, if you want it parsed, you have to do it yourself.