Esempio n. 1
0
void GameMenu::updateCardsArea(QList<HandCard*> cards) {
    cs->setSceneRect(0, 0, ui->items->width(), ui->items->height());
    QList<QGraphicsItem*> ims = cs->items();
    for (int i = 0; i < ims.size(); i++) {
        cs->removeItem(ims[i]);
    }

    if (cards.size() == 0)
        return;

    for (int i = 0; i < cards.size(); i++) {
        cs->addItem(cards[i]);
    }

    resizeItems();
}
Esempio n. 2
0
/*!
 * This function sets the icon size we should use to draw the items in our
 * list.
 *
 * \param s Our new icon size.
 */
void CSIconListWidget::setIconSize(const QSize &s)
{
	icons = s;
	QListView::setIconSize(s);
	resizeItems();
}
Esempio n. 3
0
/*!
 * This function sets the amount of spacing we should have between items in the
 * list.
 *
 * \param s Our new spacing.
 */
void CSIconListWidget::setSpacing(int s)
{
	spc = s;
	QListView::setSpacing(s);
	resizeItems();
}
Esempio n. 4
0
/*!
 * We override our superclass's resize event, so we can make sure the items in
 * our list are all going to be sized correctly.
 *
 * \param e The event we are handling.
 */
void CSIconListWidget::resizeEvent(QResizeEvent *e)
{
	resizeItems();
	e->accept();
}