update deprecated methods in qt5.14 and protobuf 3.4 (#3906)

This commit is contained in:
ebbit1q 2020-03-17 01:41:41 +01:00 committed by GitHub
parent 361833e023
commit a80c756dcb
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
11 changed files with 74 additions and 37 deletions

View file

@ -73,7 +73,7 @@ void StackZone::handleDropEvent(const QList<CardDragItem *> &dragItems,
void StackZone::reorganizeCards()
{
if (!cards.isEmpty()) {
QList<ArrowItem *> arrowsToUpdate;
QSet<ArrowItem *> arrowsToUpdate;
const int cardCount = cards.size();
qreal totalWidth = boundingRect().width();
@ -95,12 +95,16 @@ void StackZone::reorganizeCards()
c->setPos(x, ((qreal)i) * cardHeight + (totalHeight - cardCount * cardHeight) / 2);
c->setRealZValue(i);
arrowsToUpdate.append(c->getArrowsFrom());
arrowsToUpdate.append(c->getArrowsTo());
for (ArrowItem *item : c->getArrowsFrom()) {
arrowsToUpdate.insert(item);
}
for (ArrowItem *item : c->getArrowsTo()) {
arrowsToUpdate.insert(item);
}
}
for (ArrowItem *item : arrowsToUpdate) {
item->updatePath();
}
QSetIterator<ArrowItem *> arrowIterator(QSet<ArrowItem *>::fromList(arrowsToUpdate));
while (arrowIterator.hasNext())
arrowIterator.next()->updatePath();
}
update();
}