qt 5.15 compatibility (#4027)

This commit is contained in:
ebbit1q 2020-06-19 16:50:09 +02:00 committed by GitHub
parent 0f0e0193c1
commit 7fa1936d0f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
27 changed files with 101 additions and 39 deletions

View file

@ -84,15 +84,15 @@ ZoneViewWidget::ZoneViewWidget(Player *_player,
scrollBar->setSingleStep(20);
scrollBar->setPageStep(200);
connect(scrollBar, SIGNAL(valueChanged(int)), this, SLOT(handleScrollBarChange(int)));
QGraphicsProxyWidget *scrollBarProxy = new QGraphicsProxyWidget;
scrollBarProxy = new ScrollableGraphicsProxyWidget;
scrollBarProxy->setWidget(scrollBar);
zoneHBox->addItem(scrollBarProxy);
vbox->addItem(zoneHBox);
zone = new ZoneViewZone(player, _origZone, numberCards, _revealZone, _writeableRevealZone, zoneContainer);
connect(zone, SIGNAL(wheelEventReceived(QGraphicsSceneWheelEvent *)), this,
SLOT(handleWheelEvent(QGraphicsSceneWheelEvent *)));
connect(zone, SIGNAL(wheelEventReceived(QGraphicsSceneWheelEvent *)), scrollBarProxy,
SLOT(recieveWheelEvent(QGraphicsSceneWheelEvent *)));
// numberCard is the num of cards we want to reveal from an area. Ex: scry the top 3 cards.
// If the number is < 0 then it means that we can make the area sorted and we dont care about the order.
@ -192,12 +192,6 @@ void ZoneViewWidget::resizeToZoneContents()
layout()->invalidate();
}
void ZoneViewWidget::handleWheelEvent(QGraphicsSceneWheelEvent *event)
{
QWheelEvent wheelEvent(QPoint(), event->delta(), event->buttons(), event->modifiers(), event->orientation());
scrollBar->event(&wheelEvent);
}
void ZoneViewWidget::handleScrollBarChange(int value)
{
zone->setY(-value);