mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-04-27 07:48:01 -07:00
qt 5.15 compatibility (#4027)
This commit is contained in:
parent
0f0e0193c1
commit
7fa1936d0f
27 changed files with 101 additions and 39 deletions
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue