Ejemplo n.º 1
0
//We reimplement this method to add automatic change of the grid size
void GofunIconView::arrangeItemsInGrid(bool update)
{
	int b_height, b_width = 0;
	
	QIconViewItem* item = firstItem();
	while(item)
	{
		//if(item->height() > b_height) //Outcommented because we currently don't need
		//	b_height = item->height(); //it anyways, but maybe in a later implementation
		if(item->width() > b_width)
			b_width = item->width();
		item = item->nextItem();
	}
	
	if(gridX() != b_width && b_width)
		setGridX(b_width);
	//if(gridY() != b_width && b_height) //FIXME: If we uncomment this we end up with
	//	setGridY(b_height); //an endless loop and bugs all the way. Not of high priority thought.
	
	QIconView::arrangeItemsInGrid(update);
}