qt-interest@trolltech.com
[Top] [All Lists]

Re: QIconView icons arrangement

Subject: Re: QIconView icons arrangement
From: Pawel Stolowski
Date: Sat, 26 Mar 2005 22:51:13 +0100
Pawel Stolowski wrote:

> Does anyone know how to rearrange icons when QIconsView' orientation
> changes?
> [...]
> 
> So, I'd like to have logic like this (width, height reffer to QIconView's
> view & height):
> 
> if (width > height) //horizontal orientation
> {
>   put icons in as many columns as necessary (horizontal scrollbar),
>   create minimum number of rows (avoid vertical scrollbar)
> }
> else // height >= width, vertical orientation
> {
>   put icons in as many rows as necessary (vertical scrollbar),
>   create minimum number of columns (avoid horizontal scrollbar)
Well, that was simple... In case someone would need it - just do:

iconview->setArrangement(o == Qt::Horizontal ? QIconView::TopToBottom :   
QIconView::LeftToRight);

in parent dock window, in response to orientationChanged(...) signal.

Pawel

-- 
_________________________________
[ http://linux.bydg.org/~yogin/ ]
[       My Linux Projects       ]

--
List archive and information: http://lists.trolltech.com/qt-interest/

<Prev in Thread] Current Thread [Next in Thread>