some (but not all) compatibility changes for qt 4.6

This commit is contained in:
Max-Wilhelm Bruker 2009-12-02 22:48:19 +01:00
parent f4c52b8178
commit fb61b442ca
3 changed files with 24 additions and 22 deletions

View file

@ -31,9 +31,7 @@ void HandZone::paint(QPainter *painter, const QStyleOptionGraphicsItem */*option
void HandZone::reorganizeCards() void HandZone::reorganizeCards()
{ {
if (cards.isEmpty()) if (!cards.isEmpty()) {
return;
const int cardCount = cards.size(); const int cardCount = cards.size();
qreal totalWidth = boundingRect().width(); qreal totalWidth = boundingRect().width();
qreal totalHeight = boundingRect().height(); qreal totalHeight = boundingRect().height();
@ -54,6 +52,8 @@ void HandZone::reorganizeCards()
c->setPos(x, ((qreal) i) * cardHeight + (totalHeight - cardCount * cardHeight) / 2); c->setPos(x, ((qreal) i) * cardHeight + (totalHeight - cardCount * cardHeight) / 2);
c->setZValue(i); c->setZValue(i);
} }
}
update();
} }
void HandZone::addCardImpl(CardItem *card, int x, int /*y*/) void HandZone::addCardImpl(CardItem *card, int x, int /*y*/)

View file

@ -73,6 +73,7 @@ void TableZone::handleDropEventByGrid(int cardId, CardZone *startZone, const QPo
void TableZone::reorganizeCards() void TableZone::reorganizeCards()
{ {
update();
} }
void TableZone::toggleTapped() void TableZone::toggleTapped()

View file

@ -127,6 +127,7 @@ void ZoneViewZone::removeCard(int position)
void ZoneViewZone::setGeometry(const QRectF &rect) void ZoneViewZone::setGeometry(const QRectF &rect)
{ {
prepareGeometryChange();
setPos(rect.topLeft()); setPos(rect.topLeft());
height = rect.height(); height = rect.height();
reorganizeCards(); reorganizeCards();