add a bunch of parents to dialogs (#3658)

* add a bunch of parents to dialogs

works on #3651

* use game as parent instead

* add more parents

* fix create token dialog modality

* add parent to game information window

* replace a bunch of nullptrs with the magic of sed

* add parent to tip of the day and counters

* reorder game ptr

* set parent for life counter

* clangify
This commit is contained in:
ebbit1q 2019-03-26 19:54:47 +01:00 committed by Zach H
parent 7072f24103
commit c874f201c3
66 changed files with 144 additions and 111 deletions

View file

@ -10,8 +10,13 @@
#include "round.h"
#endif /* _WIN32 */
PlayerCounter::PlayerCounter(Player *_player, int _id, const QString &_name, int _value, QGraphicsItem *parent)
: AbstractCounter(_player, _id, _name, false, _value, false, parent)
PlayerCounter::PlayerCounter(Player *_player,
int _id,
const QString &_name,
int _value,
QGraphicsItem *parent,
QWidget *game)
: AbstractCounter(_player, _id, _name, false, _value, false, parent, game)
{
}
@ -48,8 +53,8 @@ void PlayerCounter::paint(QPainter *painter, const QStyleOptionGraphicsItem * /*
painter->drawText(translatedRect, Qt::AlignCenter, QString::number(value));
}
PlayerTarget::PlayerTarget(Player *_owner, QGraphicsItem *parentItem)
: ArrowTarget(_owner, parentItem), playerCounter(0)
PlayerTarget::PlayerTarget(Player *_owner, QGraphicsItem *parentItem, QWidget *_game)
: ArrowTarget(_owner, parentItem), playerCounter(0), game(_game)
{
setCacheMode(DeviceCoordinateCache);
@ -150,7 +155,7 @@ AbstractCounter *PlayerTarget::addCounter(int _counterId, const QString &_name,
playerCounter->delCounter();
}
playerCounter = new PlayerCounter(owner, _counterId, _name, _value, this);
playerCounter = new PlayerCounter(owner, _counterId, _name, _value, this, game);
playerCounter->setPos(boundingRect().width() - playerCounter->boundingRect().width(),
boundingRect().height() - playerCounter->boundingRect().height());
connect(playerCounter, SIGNAL(destroyed()), this, SLOT(counterDeleted()));