diff --git a/cockatrice/src/abstractcarditem.h b/cockatrice/src/abstractcarditem.h index 24f10fe1..5367ab5b 100644 --- a/cockatrice/src/abstractcarditem.h +++ b/cockatrice/src/abstractcarditem.h @@ -49,7 +49,10 @@ public: { return Type; } - AbstractCardItem(const QString &_name = QString(), Player *_owner = 0, int _id = -1, QGraphicsItem *parent = 0); + AbstractCardItem(const QString &_name = QString(), + Player *_owner = nullptr, + int _id = -1, + QGraphicsItem *parent = nullptr); ~AbstractCardItem(); QRectF boundingRect() const; QSizeF getTranslatedSize(QPainter *painter) const; diff --git a/cockatrice/src/abstractclient.h b/cockatrice/src/abstractclient.h index ae49de22..307da1f4 100644 --- a/cockatrice/src/abstractclient.h +++ b/cockatrice/src/abstractclient.h @@ -95,7 +95,7 @@ protected: virtual void sendCommandContainer(const CommandContainer &cont) = 0; public: - AbstractClient(QObject *parent = 0); + AbstractClient(QObject *parent = nullptr); ~AbstractClient(); ClientStatus getStatus() const diff --git a/cockatrice/src/abstractcounter.cpp b/cockatrice/src/abstractcounter.cpp index 2054b3c1..d1f9880f 100644 --- a/cockatrice/src/abstractcounter.cpp +++ b/cockatrice/src/abstractcounter.cpp @@ -19,10 +19,11 @@ AbstractCounter::AbstractCounter(Player *_player, bool _shownInCounterArea, int _value, bool _useNameForShortcut, - QGraphicsItem *parent) + QGraphicsItem *parent, + QWidget *_game) : QGraphicsItem(parent), player(_player), id(_id), name(_name), value(_value), useNameForShortcut(_useNameForShortcut), hovered(false), aDec(nullptr), aInc(nullptr), dialogSemaphore(false), - deleteAfterDialog(false), shownInCounterArea(_shownInCounterArea) + deleteAfterDialog(false), shownInCounterArea(_shownInCounterArea), game(_game) { setAcceptHoverEvents(true); @@ -163,7 +164,7 @@ void AbstractCounter::incrementCounter() void AbstractCounter::setCounter() { dialogSemaphore = true; - AbstractCounterDialog dialog(name, QString::number(value)); + AbstractCounterDialog dialog(name, QString::number(value), game); const int ok = dialog.exec(); if (deleteAfterDialog) { @@ -184,7 +185,8 @@ void AbstractCounter::setCounter() player->sendGameCommand(cmd); } -AbstractCounterDialog::AbstractCounterDialog(const QString &name, const QString &value) : QInputDialog(nullptr) +AbstractCounterDialog::AbstractCounterDialog(const QString &name, const QString &value, QWidget *parent) + : QInputDialog(parent) { setWindowTitle(tr("Set counter")); setLabelText(tr("New value for counter '%1':").arg(name)); diff --git a/cockatrice/src/abstractcounter.h b/cockatrice/src/abstractcounter.h index 0cc723f4..0160a99e 100644 --- a/cockatrice/src/abstractcounter.h +++ b/cockatrice/src/abstractcounter.h @@ -32,6 +32,7 @@ private: bool dialogSemaphore, deleteAfterDialog; bool shownInCounterArea; bool shortcutActive; + QWidget *game; private slots: void refreshShortcuts(); @@ -45,7 +46,8 @@ public: bool _shownInCounterArea, int _value, bool _useNameForShortcut = false, - QGraphicsItem *parent = nullptr); + QGraphicsItem *parent = nullptr, + QWidget *game = nullptr); ~AbstractCounter() override; void retranslateUi(); @@ -81,7 +83,7 @@ class AbstractCounterDialog : public QInputDialog { Q_OBJECT public: - AbstractCounterDialog(const QString &name, const QString &value); + AbstractCounterDialog(const QString &name, const QString &value, QWidget *parent = nullptr); protected: bool eventFilter(QObject *obj, QEvent *event); diff --git a/cockatrice/src/abstractgraphicsitem.h b/cockatrice/src/abstractgraphicsitem.h index c9a71916..8fef7bb7 100644 --- a/cockatrice/src/abstractgraphicsitem.h +++ b/cockatrice/src/abstractgraphicsitem.h @@ -21,7 +21,7 @@ protected: void paintNumberEllipse(int number, int radius, const QColor &color, int position, int count, QPainter *painter); public: - AbstractGraphicsItem(QGraphicsItem *parent = 0) : QObject(), QGraphicsItem(parent) + AbstractGraphicsItem(QGraphicsItem *parent = nullptr) : QObject(), QGraphicsItem(parent) { } }; diff --git a/cockatrice/src/arrowtarget.h b/cockatrice/src/arrowtarget.h index 3bf69986..741fda83 100644 --- a/cockatrice/src/arrowtarget.h +++ b/cockatrice/src/arrowtarget.h @@ -18,7 +18,7 @@ private: QList arrowsFrom, arrowsTo; public: - ArrowTarget(Player *_owner, QGraphicsItem *parent = 0); + ArrowTarget(Player *_owner, QGraphicsItem *parent = nullptr); ~ArrowTarget(); Player *getOwner() const diff --git a/cockatrice/src/cardinfopicture.h b/cockatrice/src/cardinfopicture.h index 6a415f45..39b59deb 100644 --- a/cockatrice/src/cardinfopicture.h +++ b/cockatrice/src/cardinfopicture.h @@ -17,7 +17,7 @@ private: bool pixmapDirty; public: - CardInfoPicture(QWidget *parent = 0); + CardInfoPicture(QWidget *parent = nullptr); protected: void resizeEvent(QResizeEvent *event); diff --git a/cockatrice/src/carditem.h b/cockatrice/src/carditem.h index 700d205b..57992958 100644 --- a/cockatrice/src/carditem.h +++ b/cockatrice/src/carditem.h @@ -52,7 +52,7 @@ public: const QString &_name = QString(), int _cardid = -1, bool revealedCard = false, - QGraphicsItem *parent = 0); + QGraphicsItem *parent = nullptr); ~CardItem(); void retranslateUi(); CardZone *getZone() const diff --git a/cockatrice/src/cardzone.h b/cockatrice/src/cardzone.h index 0a80ebf6..4484a1b0 100644 --- a/cockatrice/src/cardzone.h +++ b/cockatrice/src/cardzone.h @@ -52,7 +52,7 @@ public: bool _hasCardAttr, bool _isShufflable, bool _contentsKnown, - QGraphicsItem *parent = 0, + QGraphicsItem *parent = nullptr, bool _isView = false); ~CardZone(); void retranslateUi(); diff --git a/cockatrice/src/chatview/chatview.h b/cockatrice/src/chatview/chatview.h index eff71a37..e78b837e 100644 --- a/cockatrice/src/chatview/chatview.h +++ b/cockatrice/src/chatview/chatview.h @@ -73,7 +73,7 @@ public: const UserlistProxy *_userlistProxy, TabGame *_game, bool _showTimestamps, - QWidget *parent = 0); + QWidget *parent = nullptr); void retranslateUi(); void appendHtml(const QString &html); void virtual appendHtmlServerMessage(const QString &html, diff --git a/cockatrice/src/counter_general.cpp b/cockatrice/src/counter_general.cpp index 0bf11347..1c57e9e5 100644 --- a/cockatrice/src/counter_general.cpp +++ b/cockatrice/src/counter_general.cpp @@ -10,8 +10,10 @@ GeneralCounter::GeneralCounter(Player *_player, int _radius, int _value, bool useNameForShortcut, - QGraphicsItem *parent) - : AbstractCounter(_player, _id, _name, true, _value, useNameForShortcut, parent), color(_color), radius(_radius) + QGraphicsItem *parent, + QWidget *game) + : AbstractCounter(_player, _id, _name, true, _value, useNameForShortcut, parent, game), color(_color), + radius(_radius) { setCacheMode(DeviceCoordinateCache); } diff --git a/cockatrice/src/counter_general.h b/cockatrice/src/counter_general.h index 5e14b18f..409c97fe 100644 --- a/cockatrice/src/counter_general.h +++ b/cockatrice/src/counter_general.h @@ -18,7 +18,8 @@ public: int _radius, int _value, bool useNameForShortcut = false, - QGraphicsItem *parent = 0); + QGraphicsItem *parent = nullptr, + QWidget *game = nullptr); QRectF boundingRect() const; void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget); }; diff --git a/cockatrice/src/deckstats_interface.h b/cockatrice/src/deckstats_interface.h index 03fa9f7f..34d87509 100644 --- a/cockatrice/src/deckstats_interface.h +++ b/cockatrice/src/deckstats_interface.h @@ -30,7 +30,7 @@ private slots: void getAnalyzeRequestData(DeckList *deck, QByteArray *data); public: - DeckStatsInterface(CardDatabase &_cardDatabase, QObject *parent = 0); + DeckStatsInterface(CardDatabase &_cardDatabase, QObject *parent = nullptr); void analyzeDeck(DeckList *deck); }; diff --git a/cockatrice/src/deckview.h b/cockatrice/src/deckview.h index 8e81c9c0..5066c87f 100644 --- a/cockatrice/src/deckview.h +++ b/cockatrice/src/deckview.h @@ -24,7 +24,9 @@ private: DeckViewCardDragItem *dragItem; public: - DeckViewCard(const QString &_name = QString(), const QString &_originZone = QString(), QGraphicsItem *parent = 0); + DeckViewCard(const QString &_name = QString(), + const QString &_originZone = QString(), + QGraphicsItem *parent = nullptr); ~DeckViewCard(); void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget); const QString &getOriginZone() const @@ -110,7 +112,7 @@ private: void rebuildTree(); public: - DeckViewScene(QObject *parent = 0); + DeckViewScene(QObject *parent = nullptr); ~DeckViewScene(); void setLocked(bool _locked) { @@ -147,7 +149,7 @@ signals: void sideboardPlanChanged(); public: - DeckView(QWidget *parent = 0); + DeckView(QWidget *parent = nullptr); void setDeck(const DeckList &_deck); void setLocked(bool _locked) { diff --git a/cockatrice/src/dlg_create_token.h b/cockatrice/src/dlg_create_token.h index 824139dc..3ffb2f66 100644 --- a/cockatrice/src/dlg_create_token.h +++ b/cockatrice/src/dlg_create_token.h @@ -21,7 +21,7 @@ class DlgCreateToken : public QDialog { Q_OBJECT public: - DlgCreateToken(const QStringList &_predefinedTokens, QWidget *parent = 0); + DlgCreateToken(const QStringList &_predefinedTokens, QWidget *parent = nullptr); QString getName() const; QString getColor() const; QString getPT() const; diff --git a/cockatrice/src/dlg_creategame.h b/cockatrice/src/dlg_creategame.h index 13992d6e..08b9c8df 100644 --- a/cockatrice/src/dlg_creategame.h +++ b/cockatrice/src/dlg_creategame.h @@ -20,8 +20,8 @@ class DlgCreateGame : public QDialog { Q_OBJECT public: - DlgCreateGame(TabRoom *_room, const QMap &_gameTypes, QWidget *parent = 0); - DlgCreateGame(const ServerInfo_Game &game, const QMap &_gameTypes, QWidget *parent = 0); + DlgCreateGame(TabRoom *_room, const QMap &_gameTypes, QWidget *parent = nullptr); + DlgCreateGame(const ServerInfo_Game &game, const QMap &_gameTypes, QWidget *parent = nullptr); private slots: void actOK(); void actReset(); diff --git a/cockatrice/src/dlg_edit_avatar.h b/cockatrice/src/dlg_edit_avatar.h index ef033e5a..7530a2c2 100644 --- a/cockatrice/src/dlg_edit_avatar.h +++ b/cockatrice/src/dlg_edit_avatar.h @@ -13,7 +13,7 @@ class DlgEditAvatar : public QDialog { Q_OBJECT public: - DlgEditAvatar(QWidget *parent = 0); + DlgEditAvatar(QWidget *parent = nullptr); QByteArray getImage(); private slots: void actOk(); diff --git a/cockatrice/src/dlg_edit_password.h b/cockatrice/src/dlg_edit_password.h index 6c45e0eb..4fab9c8c 100644 --- a/cockatrice/src/dlg_edit_password.h +++ b/cockatrice/src/dlg_edit_password.h @@ -13,7 +13,7 @@ class DlgEditPassword : public QDialog { Q_OBJECT public: - DlgEditPassword(QWidget *parent = 0); + DlgEditPassword(QWidget *parent = nullptr); QString getOldPassword() const { return oldPasswordEdit->text(); diff --git a/cockatrice/src/dlg_edit_user.h b/cockatrice/src/dlg_edit_user.h index 49da4b30..77744dd1 100644 --- a/cockatrice/src/dlg_edit_user.h +++ b/cockatrice/src/dlg_edit_user.h @@ -13,7 +13,7 @@ class DlgEditUser : public QDialog { Q_OBJECT public: - DlgEditUser(QWidget *parent = 0, + DlgEditUser(QWidget *parent = nullptr, QString email = QString(), QString country = QString(), QString realName = QString()); diff --git a/cockatrice/src/dlg_filter_games.h b/cockatrice/src/dlg_filter_games.h index 30ca528a..f494a9ca 100644 --- a/cockatrice/src/dlg_filter_games.h +++ b/cockatrice/src/dlg_filter_games.h @@ -35,7 +35,7 @@ private slots: public: DlgFilterGames(const QMap &_allGameTypes, const GamesProxyModel *_gamesProxyModel, - QWidget *parent = 0); + QWidget *parent = nullptr); bool getUnavailableGamesVisible() const; void setUnavailableGamesVisible(bool _unavailableGamesVisible); diff --git a/cockatrice/src/dlg_forgotpasswordchallenge.h b/cockatrice/src/dlg_forgotpasswordchallenge.h index 8631b08c..ca8867ce 100644 --- a/cockatrice/src/dlg_forgotpasswordchallenge.h +++ b/cockatrice/src/dlg_forgotpasswordchallenge.h @@ -13,7 +13,7 @@ class DlgForgotPasswordChallenge : public QDialog { Q_OBJECT public: - DlgForgotPasswordChallenge(QWidget *parent = 0); + DlgForgotPasswordChallenge(QWidget *parent = nullptr); QString getHost() const { return hostEdit->text(); diff --git a/cockatrice/src/dlg_forgotpasswordrequest.h b/cockatrice/src/dlg_forgotpasswordrequest.h index 00698498..e796ae2f 100644 --- a/cockatrice/src/dlg_forgotpasswordrequest.h +++ b/cockatrice/src/dlg_forgotpasswordrequest.h @@ -13,7 +13,7 @@ class DlgForgotPasswordRequest : public QDialog { Q_OBJECT public: - DlgForgotPasswordRequest(QWidget *parent = 0); + DlgForgotPasswordRequest(QWidget *parent = nullptr); QString getHost() const { return hostEdit->text(); diff --git a/cockatrice/src/dlg_forgotpasswordreset.h b/cockatrice/src/dlg_forgotpasswordreset.h index de1c9b74..4963e08a 100644 --- a/cockatrice/src/dlg_forgotpasswordreset.h +++ b/cockatrice/src/dlg_forgotpasswordreset.h @@ -13,7 +13,7 @@ class DlgForgotPasswordReset : public QDialog { Q_OBJECT public: - DlgForgotPasswordReset(QWidget *parent = 0); + DlgForgotPasswordReset(QWidget *parent = nullptr); QString getHost() const { return hostEdit->text(); diff --git a/cockatrice/src/dlg_load_remote_deck.h b/cockatrice/src/dlg_load_remote_deck.h index 8979d00a..61dcd7a6 100644 --- a/cockatrice/src/dlg_load_remote_deck.h +++ b/cockatrice/src/dlg_load_remote_deck.h @@ -20,7 +20,7 @@ private slots: void currentItemChanged(const QModelIndex ¤t, const QModelIndex &previous); public: - DlgLoadRemoteDeck(AbstractClient *_client, QWidget *parent = 0); + DlgLoadRemoteDeck(AbstractClient *_client, QWidget *parent = nullptr); int getDeckId() const; }; diff --git a/cockatrice/src/dlg_register.h b/cockatrice/src/dlg_register.h index b2bc579c..59bf7c6f 100644 --- a/cockatrice/src/dlg_register.h +++ b/cockatrice/src/dlg_register.h @@ -13,7 +13,7 @@ class DlgRegister : public QDialog { Q_OBJECT public: - DlgRegister(QWidget *parent = 0); + DlgRegister(QWidget *parent = nullptr); QString getHost() const { return hostEdit->text(); diff --git a/cockatrice/src/filterbuilder.h b/cockatrice/src/filterbuilder.h index 2b6ed3b6..375d4e91 100644 --- a/cockatrice/src/filterbuilder.h +++ b/cockatrice/src/filterbuilder.h @@ -21,7 +21,7 @@ private: void destroyFilter(); public: - FilterBuilder(QWidget *parent = 0); + FilterBuilder(QWidget *parent = nullptr); ~FilterBuilder(); signals: diff --git a/cockatrice/src/filtertreemodel.h b/cockatrice/src/filtertreemodel.h index a70c8036..83271f49 100644 --- a/cockatrice/src/filtertreemodel.h +++ b/cockatrice/src/filtertreemodel.h @@ -27,7 +27,7 @@ private: QModelIndex nodeIndex(const FilterTreeNode *node, int row, int column) const; public: - FilterTreeModel(QObject *parent = 0); + FilterTreeModel(QObject *parent = nullptr); ~FilterTreeModel(); FilterTree *filterTree() const { diff --git a/cockatrice/src/gamescene.h b/cockatrice/src/gamescene.h index c5016e1d..7b80b8b6 100644 --- a/cockatrice/src/gamescene.h +++ b/cockatrice/src/gamescene.h @@ -33,7 +33,7 @@ private: void updateHover(const QPointF &scenePos); public: - GameScene(PhasesToolbar *_phasesToolbar, QObject *parent = 0); + GameScene(PhasesToolbar *_phasesToolbar, QObject *parent = nullptr); ~GameScene(); void retranslateUi(); void processViewSizeChange(const QSize &newSize); diff --git a/cockatrice/src/gameselector.h b/cockatrice/src/gameselector.h index 2fc0e335..beb92763 100644 --- a/cockatrice/src/gameselector.h +++ b/cockatrice/src/gameselector.h @@ -47,7 +47,7 @@ public: const QMap &_gameTypes, const bool restoresettings, const bool showfilters, - QWidget *parent = 0); + QWidget *parent = nullptr); void retranslateUi(); void processGameInfo(const ServerInfo_Game &info); }; diff --git a/cockatrice/src/gamesmodel.h b/cockatrice/src/gamesmodel.h index 68351170..b5dcb331 100644 --- a/cockatrice/src/gamesmodel.h +++ b/cockatrice/src/gamesmodel.h @@ -24,7 +24,7 @@ private: public: static const int SORT_ROLE = Qt::UserRole + 1; - GamesModel(const QMap &_rooms, const QMap &_gameTypes, QObject *parent = 0); + GamesModel(const QMap &_rooms, const QMap &_gameTypes, QObject *parent = nullptr); int rowCount(const QModelIndex &parent = QModelIndex()) const { return parent.isValid() ? 0 : gameList.size(); @@ -75,7 +75,7 @@ private: static const int DEFAULT_MAX_PLAYERS_MAX = 99; public: - GamesProxyModel(QObject *parent = 0, bool _ownUserIsRegistered = false); + GamesProxyModel(QObject *parent = nullptr, bool _ownUserIsRegistered = false); bool getShowBuddiesOnlyGames() const { diff --git a/cockatrice/src/gameview.h b/cockatrice/src/gameview.h index a3bae139..e1ca517b 100644 --- a/cockatrice/src/gameview.h +++ b/cockatrice/src/gameview.h @@ -24,7 +24,7 @@ public slots: void updateSceneRect(const QRectF &rect); public: - GameView(QGraphicsScene *scene, QWidget *parent = 0); + GameView(QGraphicsScene *scene, QWidget *parent = nullptr); }; #endif diff --git a/cockatrice/src/handcounter.h b/cockatrice/src/handcounter.h index b4e8b5a7..c0833fc2 100644 --- a/cockatrice/src/handcounter.h +++ b/cockatrice/src/handcounter.h @@ -29,7 +29,7 @@ public: { return Type; } - HandCounter(QGraphicsItem *parent = 0); + HandCounter(QGraphicsItem *parent = nullptr); ~HandCounter(); QRectF boundingRect() const; void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget); diff --git a/cockatrice/src/handzone.h b/cockatrice/src/handzone.h index 0e69970a..24fdc36f 100644 --- a/cockatrice/src/handzone.h +++ b/cockatrice/src/handzone.h @@ -14,7 +14,7 @@ public slots: void updateOrientation(); public: - HandZone(Player *_p, bool _contentsKnown, int _zoneHeight, QGraphicsItem *parent = 0); + HandZone(Player *_p, bool _contentsKnown, int _zoneHeight, QGraphicsItem *parent = nullptr); void handleDropEvent(const QList &dragItems, CardZone *startZone, const QPoint &dropPoint); QRectF boundingRect() const; void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget); diff --git a/cockatrice/src/lineeditcompleter.h b/cockatrice/src/lineeditcompleter.h index cd020b68..fd8e2e34 100644 --- a/cockatrice/src/lineeditcompleter.h +++ b/cockatrice/src/lineeditcompleter.h @@ -20,7 +20,7 @@ protected: void focusOutEvent(QFocusEvent *e); public: - explicit LineEditCompleter(QWidget *parent = 0); + explicit LineEditCompleter(QWidget *parent = nullptr); void setCompleter(QCompleter *); void setCompletionList(QStringList); }; diff --git a/cockatrice/src/localclient.h b/cockatrice/src/localclient.h index b546695f..9418c37b 100644 --- a/cockatrice/src/localclient.h +++ b/cockatrice/src/localclient.h @@ -12,7 +12,10 @@ private: LocalServerInterface *lsi; public: - LocalClient(LocalServerInterface *_lsi, const QString &_playerName, const QString &_clientId, QObject *parent = 0); + LocalClient(LocalServerInterface *_lsi, + const QString &_playerName, + const QString &_clientId, + QObject *parent = nullptr); ~LocalClient(); void sendCommandContainer(const CommandContainer &cont); diff --git a/cockatrice/src/localserver.h b/cockatrice/src/localserver.h index bf7b5a79..7b62dcbe 100644 --- a/cockatrice/src/localserver.h +++ b/cockatrice/src/localserver.h @@ -10,7 +10,7 @@ class LocalServer : public Server { Q_OBJECT public: - LocalServer(QObject *parent = 0); + LocalServer(QObject *parent = nullptr); ~LocalServer(); LocalServerInterface *newConnection(); diff --git a/cockatrice/src/pilezone.h b/cockatrice/src/pilezone.h index b5ba971e..37b15c7f 100644 --- a/cockatrice/src/pilezone.h +++ b/cockatrice/src/pilezone.h @@ -13,7 +13,11 @@ private slots: } public: - PileZone(Player *_p, const QString &_name, bool _isShufflable, bool _contentsKnown, QGraphicsItem *parent = 0); + PileZone(Player *_p, + const QString &_name, + bool _isShufflable, + bool _contentsKnown, + QGraphicsItem *parent = nullptr); QRectF boundingRect() const; void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget); void reorganizeCards(); diff --git a/cockatrice/src/player.cpp b/cockatrice/src/player.cpp index 4c21bcde..3313b8aa 100644 --- a/cockatrice/src/player.cpp +++ b/cockatrice/src/player.cpp @@ -106,7 +106,7 @@ Player::Player(const ServerInfo_User &info, int _id, bool _local, bool _judge, T playerArea = new PlayerArea(this); - playerTarget = new PlayerTarget(this, playerArea); + playerTarget = new PlayerTarget(this, playerArea, game); qreal avatarMargin = (counterAreaWidth + CARD_HEIGHT + 15 - playerTarget->boundingRect().width()) / 2.0; playerTarget->setPos(QPointF(avatarMargin, avatarMargin)); @@ -553,7 +553,7 @@ void Player::playerListActionTriggered() } else if (menu == mRevealTopCard) { int decksize = zones.value("deck")->getCards().size(); bool ok; - int number = QInputDialog::getInt(nullptr, tr("Reveal top cards of library"), + int number = QInputDialog::getInt(game, tr("Reveal top cards of library"), tr("Number of cards: (max. %1)").arg(decksize), defaultNumberTopCards, 1, decksize, 1, &ok); if (ok) { @@ -706,8 +706,9 @@ void Player::retranslateUi() createPredefinedTokenMenu->setTitle(tr("Cr&eate predefined token")); QMapIterator counterIterator(counters); - while (counterIterator.hasNext()) + while (counterIterator.hasNext()) { counterIterator.next().value()->retranslateUi(); + } aCardMenu->setText(tr("C&ard")); @@ -932,7 +933,7 @@ void Player::actViewLibrary() void Player::actViewTopCards() { bool ok; - int number = QInputDialog::getInt(nullptr, tr("View top cards of library"), tr("Number of cards:"), + int number = QInputDialog::getInt(game, tr("View top cards of library"), tr("Number of cards:"), defaultNumberTopCards, 1, 2000000000, 1, &ok); if (ok) { defaultNumberTopCards = number; @@ -1001,7 +1002,7 @@ void Player::actMulligan() void Player::actDrawCards() { - int number = QInputDialog::getInt(nullptr, tr("Draw cards"), tr("Number:")); + int number = QInputDialog::getInt(game, tr("Draw cards"), tr("Number:")); if (number) { Command_DrawCards cmd; cmd.set_number(static_cast(number)); @@ -1050,7 +1051,7 @@ void Player::actMoveTopCardToExile() void Player::actMoveTopCardsToGrave() { - int number = QInputDialog::getInt(nullptr, tr("Move top cards to grave"), tr("Number:")); + int number = QInputDialog::getInt(game, tr("Move top cards to grave"), tr("Number:")); if (!number) { return; } @@ -1076,7 +1077,7 @@ void Player::actMoveTopCardsToGrave() void Player::actMoveTopCardsToExile() { - int number = QInputDialog::getInt(nullptr, tr("Move top cards to exile"), tr("Number:")); + int number = QInputDialog::getInt(game, tr("Move top cards to exile"), tr("Number:")); if (!number) { return; } @@ -1155,8 +1156,7 @@ void Player::actUntapAll() void Player::actRollDie() { bool ok; - int sides = QInputDialog::getInt(static_cast(parent()), tr("Roll die"), tr("Number of sides:"), 20, 2, - 1000, 1, &ok); + int sides = QInputDialog::getInt(game, tr("Roll die"), tr("Number of sides:"), 20, 2, 1000, 1, &ok); if (ok) { Command_RollDie cmd; cmd.set_sides(static_cast(sides)); @@ -1166,7 +1166,7 @@ void Player::actRollDie() void Player::actCreateToken() { - DlgCreateToken dlg(predefinedTokens); + DlgCreateToken dlg(predefinedTokens, game); if (!dlg.exec()) { return; } @@ -1329,8 +1329,8 @@ bool Player::createRelatedFromRelation(const CardItem *sourceCard, const CardRel if (cardRelation->getIsVariable()) { bool ok; dialogSemaphore = true; - int count = QInputDialog::getInt(nullptr, tr("Create tokens"), tr("Number:"), cardRelation->getDefaultCount(), - 1, MAX_TOKENS_PER_DIALOG, 1, &ok); + int count = QInputDialog::getInt(game, tr("Create tokens"), tr("Number:"), cardRelation->getDefaultCount(), 1, + MAX_TOKENS_PER_DIALOG, 1, &ok); dialogSemaphore = false; if (!ok) { return false; @@ -1586,8 +1586,9 @@ void Player::eventCreateCounter(const Event_CreateCounter &event) void Player::eventSetCounter(const Event_SetCounter &event) { AbstractCounter *ctr = counters.value(event.counter_id(), 0); - if (!ctr) + if (!ctr) { return; + } int oldValue = ctr->getValue(); ctr->setValue(event.value()); emit logSetCounter(this, ctr->getName(), event.value(), oldValue); @@ -2146,7 +2147,7 @@ AbstractCounter *Player::addCounter(int counterId, const QString &name, QColor c if (name == "life") { ctr = playerTarget->addCounter(counterId, name, value); } else { - ctr = new GeneralCounter(this, counterId, name, color, radius, value, true, this); + ctr = new GeneralCounter(this, counterId, name, color, radius, value, true, this, game); } counters.insert(counterId, ctr); if (countersMenu && ctr->getMenu()) { @@ -2346,7 +2347,7 @@ bool Player::clearCardsToDelete() void Player::actMoveCardXCardsFromTop() { bool ok; - int number = QInputDialog::getInt(nullptr, tr("Place card X cards from top of library"), + int number = QInputDialog::getInt(game, tr("Place card X cards from top of library"), tr("How many cards from the top of the deck should this card be placed:"), defaultNumberTopCardsToPlaceBelow, 1, 2000000000, 1, &ok); number--; @@ -2861,7 +2862,7 @@ void Player::actCardCounterTrigger() auto *card = static_cast(scene()->selectedItems().first()); oldValue = card->getCounters().value(counterId, 0); } - int number = QInputDialog::getInt(nullptr, tr("Set counters"), tr("Number:"), oldValue, 0, + int number = QInputDialog::getInt(game, tr("Set counters"), tr("Number:"), oldValue, 0, MAX_COUNTERS_ON_CARD, 1, &ok); dialogSemaphore = false; if (clearCardsToDelete() || !ok) { diff --git a/cockatrice/src/playerlistwidget.cpp b/cockatrice/src/playerlistwidget.cpp index 2415343c..da539108 100644 --- a/cockatrice/src/playerlistwidget.cpp +++ b/cockatrice/src/playerlistwidget.cpp @@ -69,8 +69,9 @@ PlayerListWidget::PlayerListWidget(TabSupervisor *_tabSupervisor, userContextMenu = new UserContextMenu(tabSupervisor, this, game); connect(userContextMenu, SIGNAL(openMessageDialog(QString, bool)), this, SIGNAL(openMessageDialog(QString, bool))); - } else - userContextMenu = 0; + } else { + userContextMenu = nullptr; + } setMinimumHeight(40); setIconSize(QSize(20, 15)); diff --git a/cockatrice/src/playerlistwidget.h b/cockatrice/src/playerlistwidget.h index a9c37c63..6cc63385 100644 --- a/cockatrice/src/playerlistwidget.h +++ b/cockatrice/src/playerlistwidget.h @@ -43,7 +43,7 @@ signals: void openMessageDialog(const QString &userName, bool focus); public: - PlayerListWidget(TabSupervisor *_tabSupervisor, AbstractClient *_client, TabGame *_game, QWidget *parent = 0); + PlayerListWidget(TabSupervisor *_tabSupervisor, AbstractClient *_client, TabGame *_game, QWidget *parent = nullptr); void retranslateUi(); void addPlayer(const ServerInfo_PlayerProperties &player); void removePlayer(int playerId); diff --git a/cockatrice/src/playertarget.cpp b/cockatrice/src/playertarget.cpp index 434f57ab..6fb14f09 100644 --- a/cockatrice/src/playertarget.cpp +++ b/cockatrice/src/playertarget.cpp @@ -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())); diff --git a/cockatrice/src/playertarget.h b/cockatrice/src/playertarget.h index eb7ca07f..5dc5a272 100644 --- a/cockatrice/src/playertarget.h +++ b/cockatrice/src/playertarget.h @@ -12,7 +12,12 @@ class PlayerCounter : public AbstractCounter { Q_OBJECT public: - PlayerCounter(Player *_player, int _id, const QString &_name, int _value, QGraphicsItem *parent = 0); + PlayerCounter(Player *_player, + int _id, + const QString &_name, + int _value, + QGraphicsItem *parent = nullptr, + QWidget *game = nullptr); QRectF boundingRect() const; void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget); }; @@ -23,6 +28,7 @@ class PlayerTarget : public ArrowTarget private: QPixmap fullPixmap; PlayerCounter *playerCounter; + QWidget *game; public slots: void counterDeleted(); @@ -36,7 +42,7 @@ public: return Type; } - PlayerTarget(Player *_player = 0, QGraphicsItem *parentItem = 0); + PlayerTarget(Player *_player = nullptr, QGraphicsItem *parentItem = nullptr, QWidget *_game = nullptr); ~PlayerTarget(); QRectF boundingRect() const; void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget); diff --git a/cockatrice/src/remotedecklist_treewidget.h b/cockatrice/src/remotedecklist_treewidget.h index d880ef1a..dae77b0d 100644 --- a/cockatrice/src/remotedecklist_treewidget.h +++ b/cockatrice/src/remotedecklist_treewidget.h @@ -23,7 +23,7 @@ public: QString name; public: - Node(const QString &_name, DirectoryNode *_parent = 0) : parent(_parent), name(_name) + Node(const QString &_name, DirectoryNode *_parent = nullptr) : parent(_parent), name(_name) { } virtual ~Node(){}; @@ -39,7 +39,7 @@ public: class DirectoryNode : public Node, public QList { public: - DirectoryNode(const QString &_name = QString(), DirectoryNode *_parent = 0); + DirectoryNode(const QString &_name = QString(), DirectoryNode *_parent = nullptr); ~DirectoryNode(); void clearTree(); QString getPath() const; @@ -53,7 +53,7 @@ public: QDateTime uploadTime; public: - FileNode(const QString &_name, int _id, const QDateTime &_uploadTime, DirectoryNode *_parent = 0) + FileNode(const QString &_name, int _id, const QDateTime &_uploadTime, DirectoryNode *_parent = nullptr) : Node(_name, _parent), id(_id), uploadTime(_uploadTime) { } @@ -87,7 +87,7 @@ private slots: void deckListFinished(const Response &r); public: - RemoteDeckList_TreeModel(AbstractClient *_client, QObject *parent = 0); + RemoteDeckList_TreeModel(AbstractClient *_client, QObject *parent = nullptr); ~RemoteDeckList_TreeModel(); int rowCount(const QModelIndex &parent = QModelIndex()) const; int columnCount(const QModelIndex & /*parent*/ = QModelIndex()) const; @@ -115,7 +115,7 @@ private: QSortFilterProxyModel *proxyModel; public: - RemoteDeckList_TreeWidget(AbstractClient *_client, QWidget *parent = 0); + RemoteDeckList_TreeWidget(AbstractClient *_client, QWidget *parent = nullptr); RemoteDeckList_TreeModel::Node *getNode(const QModelIndex &ind) const; RemoteDeckList_TreeModel::Node *getCurrentItem() const; RemoteDeckList_TreeModel::DirectoryNode *getNodeByPath(const QString &path) const; diff --git a/cockatrice/src/remotereplaylist_treewidget.h b/cockatrice/src/remotereplaylist_treewidget.h index 635ade10..240626a6 100644 --- a/cockatrice/src/remotereplaylist_treewidget.h +++ b/cockatrice/src/remotereplaylist_treewidget.h @@ -81,7 +81,7 @@ private slots: void replayListFinished(const Response &r); public: - RemoteReplayList_TreeModel(AbstractClient *_client, QObject *parent = 0); + RemoteReplayList_TreeModel(AbstractClient *_client, QObject *parent = nullptr); ~RemoteReplayList_TreeModel(); int rowCount(const QModelIndex &parent = QModelIndex()) const; int columnCount(const QModelIndex & /*parent*/ = QModelIndex()) const @@ -109,7 +109,7 @@ private: ServerInfo_Replay const *getNode(const QModelIndex &ind) const; public: - RemoteReplayList_TreeWidget(AbstractClient *_client, QWidget *parent = 0); + RemoteReplayList_TreeWidget(AbstractClient *_client, QWidget *parent = nullptr); ServerInfo_Replay const *getCurrentReplay() const; ServerInfo_ReplayMatch const *getCurrentReplayMatch() const; void refreshTree(); diff --git a/cockatrice/src/selectzone.h b/cockatrice/src/selectzone.h index aa59ad30..2ac924dc 100644 --- a/cockatrice/src/selectzone.h +++ b/cockatrice/src/selectzone.h @@ -20,7 +20,7 @@ public: bool _hasCardAttr, bool _isShufflable, bool _contentsKnown, - QGraphicsItem *parent = 0, + QGraphicsItem *parent = nullptr, bool isView = false); }; diff --git a/cockatrice/src/setsmodel.h b/cockatrice/src/setsmodel.h index 470ef031..d8659a9b 100644 --- a/cockatrice/src/setsmodel.h +++ b/cockatrice/src/setsmodel.h @@ -55,7 +55,7 @@ public: SortRole = Qt::UserRole }; - SetsModel(CardDatabase *_db, QObject *parent = 0); + SetsModel(CardDatabase *_db, QObject *parent = nullptr); ~SetsModel(); int rowCount(const QModelIndex &parent = QModelIndex()) const; int columnCount(const QModelIndex &parent = QModelIndex()) const diff --git a/cockatrice/src/soundengine.h b/cockatrice/src/soundengine.h index d2f969c8..726c583f 100644 --- a/cockatrice/src/soundengine.h +++ b/cockatrice/src/soundengine.h @@ -15,7 +15,7 @@ class SoundEngine : public QObject { Q_OBJECT public: - SoundEngine(QObject *parent = 0); + SoundEngine(QObject *parent = nullptr); ~SoundEngine(); void playSound(QString fileName); QStringMap &getAvailableThemes(); diff --git a/cockatrice/src/stackzone.h b/cockatrice/src/stackzone.h index 1d47782d..5d83ef59 100644 --- a/cockatrice/src/stackzone.h +++ b/cockatrice/src/stackzone.h @@ -12,7 +12,7 @@ private slots: void updateBg(); public: - StackZone(Player *_p, int _zoneHeight, QGraphicsItem *parent = 0); + StackZone(Player *_p, int _zoneHeight, QGraphicsItem *parent = nullptr); void handleDropEvent(const QList &dragItems, CardZone *startZone, const QPoint &dropPoint); QRectF boundingRect() const; void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget); diff --git a/cockatrice/src/tab.h b/cockatrice/src/tab.h index a67b55be..53af3f40 100644 --- a/cockatrice/src/tab.h +++ b/cockatrice/src/tab.h @@ -31,7 +31,7 @@ private: QList tabMenus; public: - Tab(TabSupervisor *_tabSupervisor, QWidget *parent = 0); + Tab(TabSupervisor *_tabSupervisor, QWidget *parent = nullptr); const QList &getTabMenus() const { return tabMenus; diff --git a/cockatrice/src/tab_admin.h b/cockatrice/src/tab_admin.h index dd2c47b2..1ff3581a 100644 --- a/cockatrice/src/tab_admin.h +++ b/cockatrice/src/tab_admin.h @@ -19,7 +19,7 @@ private: QSpinBox *minutesEdit; public: - ShutdownDialog(QWidget *parent = 0); + ShutdownDialog(QWidget *parent = nullptr); QString getReason() const; int getMinutes() const; }; @@ -45,7 +45,7 @@ private slots: void actLock(); public: - TabAdmin(TabSupervisor *_tabSupervisor, AbstractClient *_client, bool _fullAdmin, QWidget *parent = 0); + TabAdmin(TabSupervisor *_tabSupervisor, AbstractClient *_client, bool _fullAdmin, QWidget *parent = nullptr); void retranslateUi(); QString getTabText() const { diff --git a/cockatrice/src/tab_deck_editor.cpp b/cockatrice/src/tab_deck_editor.cpp index b1b35cd1..79a2d73e 100644 --- a/cockatrice/src/tab_deck_editor.cpp +++ b/cockatrice/src/tab_deck_editor.cpp @@ -836,7 +836,7 @@ void TabDeckEditor::actLoadDeckFromClipboard() if (!confirmClose()) return; - DlgLoadDeckFromClipboard dlg; + DlgLoadDeckFromClipboard dlg(this); if (!dlg.exec()) return; diff --git a/cockatrice/src/tab_game.cpp b/cockatrice/src/tab_game.cpp index fec4beb3..02e85d92 100644 --- a/cockatrice/src/tab_game.cpp +++ b/cockatrice/src/tab_game.cpp @@ -264,7 +264,7 @@ void DeckViewContainer::loadLocalDeck() void DeckViewContainer::loadRemoteDeck() { - DlgLoadRemoteDeck dlg(parentGame->getClientForPlayer(playerId)); + DlgLoadRemoteDeck dlg(parentGame->getClientForPlayer(playerId), this); if (dlg.exec()) { Command_DeckSelect cmd; cmd.set_deck_id(dlg.getDeckId()); @@ -621,7 +621,7 @@ bool TabGame::isSpectator() void TabGame::actGameInfo() { - DlgCreateGame dlg(gameInfo, roomGameTypes); + DlgCreateGame dlg(gameInfo, roomGameTypes, this); dlg.exec(); } diff --git a/cockatrice/src/tab_game.h b/cockatrice/src/tab_game.h index 36c7c856..4543c145 100644 --- a/cockatrice/src/tab_game.h +++ b/cockatrice/src/tab_game.h @@ -69,7 +69,7 @@ signals: void stateChanged(); public: - ToggleButton(QWidget *parent = 0); + ToggleButton(QWidget *parent = nullptr); bool getState() const { return state; diff --git a/cockatrice/src/tab_logs.h b/cockatrice/src/tab_logs.h index 33063821..aacf99c6 100644 --- a/cockatrice/src/tab_logs.h +++ b/cockatrice/src/tab_logs.h @@ -52,7 +52,7 @@ private slots: void restartLayout(); public: - TabLog(TabSupervisor *_tabSupervisor, AbstractClient *_client, QWidget *parent = 0); + TabLog(TabSupervisor *_tabSupervisor, AbstractClient *_client, QWidget *parent = nullptr); ~TabLog(); void retranslateUi(); QString getTabText() const diff --git a/cockatrice/src/tab_server.h b/cockatrice/src/tab_server.h index e7cbdf6c..d0f55614 100644 --- a/cockatrice/src/tab_server.h +++ b/cockatrice/src/tab_server.h @@ -33,7 +33,7 @@ signals: void joinRoomRequest(int, bool setCurrent); public: - RoomSelector(AbstractClient *_client, QWidget *parent = 0); + RoomSelector(AbstractClient *_client, QWidget *parent = nullptr); void retranslateUi(); }; @@ -54,7 +54,7 @@ private: bool shouldEmitUpdate = false; public: - TabServer(TabSupervisor *_tabSupervisor, AbstractClient *_client, QWidget *parent = 0); + TabServer(TabSupervisor *_tabSupervisor, AbstractClient *_client, QWidget *parent = nullptr); void retranslateUi(); QString getTabText() const { diff --git a/cockatrice/src/tab_supervisor.h b/cockatrice/src/tab_supervisor.h index 10b1e69f..44bee8e2 100644 --- a/cockatrice/src/tab_supervisor.h +++ b/cockatrice/src/tab_supervisor.h @@ -43,7 +43,7 @@ class CloseButton : public QAbstractButton { Q_OBJECT public: - CloseButton(QWidget *parent = 0); + CloseButton(QWidget *parent = nullptr); QSize sizeHint() const; inline QSize minimumSizeHint() const { @@ -81,7 +81,7 @@ private: bool isLocalGame; public: - TabSupervisor(AbstractClient *_client, QWidget *parent = 0); + TabSupervisor(AbstractClient *_client, QWidget *parent = nullptr); ~TabSupervisor(); void retranslateUi(); void start(const ServerInfo_User &userInfo); diff --git a/cockatrice/src/tab_userlists.h b/cockatrice/src/tab_userlists.h index ceb10e27..08295755 100644 --- a/cockatrice/src/tab_userlists.h +++ b/cockatrice/src/tab_userlists.h @@ -49,7 +49,7 @@ public: TabUserLists(TabSupervisor *_tabSupervisor, AbstractClient *_client, const ServerInfo_User &userInfo, - QWidget *parent = 0); + QWidget *parent = nullptr); void retranslateUi(); QString getTabText() const { diff --git a/cockatrice/src/tablezone.h b/cockatrice/src/tablezone.h index 65a1217d..aced9c43 100644 --- a/cockatrice/src/tablezone.h +++ b/cockatrice/src/tablezone.h @@ -98,7 +98,7 @@ public: @param _p the Player @param parent defaults to null */ - TableZone(Player *_p, QGraphicsItem *parent = 0); + TableZone(Player *_p, QGraphicsItem *parent = nullptr); /** @return a QRectF of the TableZone bounding box. diff --git a/cockatrice/src/tappedout_interface.h b/cockatrice/src/tappedout_interface.h index a73a7728..2ac59ee8 100644 --- a/cockatrice/src/tappedout_interface.h +++ b/cockatrice/src/tappedout_interface.h @@ -29,7 +29,7 @@ private slots: void getAnalyzeRequestData(DeckList *deck, QByteArray *data); public: - TappedOutInterface(CardDatabase &_cardDatabase, QObject *parent = 0); + TappedOutInterface(CardDatabase &_cardDatabase, QObject *parent = nullptr); void analyzeDeck(DeckList *deck); }; diff --git a/cockatrice/src/thememanager.h b/cockatrice/src/thememanager.h index 3fcc1d9b..461ff6b9 100644 --- a/cockatrice/src/thememanager.h +++ b/cockatrice/src/thememanager.h @@ -16,7 +16,7 @@ class ThemeManager : public QObject { Q_OBJECT public: - ThemeManager(QObject *parent = 0); + ThemeManager(QObject *parent = nullptr); private: QBrush handBgBrush, stackBgBrush, tableBgBrush, playerBgBrush; diff --git a/cockatrice/src/user_context_menu.cpp b/cockatrice/src/user_context_menu.cpp index c5a45e17..370e309d 100644 --- a/cockatrice/src/user_context_menu.cpp +++ b/cockatrice/src/user_context_menu.cpp @@ -90,10 +90,12 @@ void UserContextMenu::gamesOfUserReceived(const Response &resp, const CommandCon gameTypeMap.insert(roomInfo.room_id(), tempMap); } - GameSelector *selector = new GameSelector(client, tabSupervisor, 0, roomMap, gameTypeMap, false, false); + GameSelector *selector = new GameSelector(client, tabSupervisor, nullptr, roomMap, gameTypeMap, false, false); + selector->setParent(static_cast(parent()), Qt::Window); const int gameListSize = response.game_list_size(); - for (int i = 0; i < gameListSize; ++i) + for (int i = 0; i < gameListSize; ++i) { selector->processGameInfo(response.game_list(i)); + } selector->setWindowTitle(tr("%1's games").arg(QString::fromStdString(cmd.user_name()))); selector->setMinimumWidth(800); diff --git a/cockatrice/src/userinfobox.h b/cockatrice/src/userinfobox.h index 6d93b69d..6f0f8df0 100644 --- a/cockatrice/src/userinfobox.h +++ b/cockatrice/src/userinfobox.h @@ -20,7 +20,7 @@ private: QPushButton editButton, passwordButton, avatarButton; public: - UserInfoBox(AbstractClient *_client, bool editable, QWidget *parent = 0, Qt::WindowFlags flags = 0); + UserInfoBox(AbstractClient *_client, bool editable, QWidget *parent = nullptr, Qt::WindowFlags flags = 0); void retranslateUi(); private slots: void processResponse(const Response &r); diff --git a/cockatrice/src/userlist.h b/cockatrice/src/userlist.h index d4a2a398..05d65064 100644 --- a/cockatrice/src/userlist.h +++ b/cockatrice/src/userlist.h @@ -37,7 +37,7 @@ private slots: void enableTemporaryEdits(bool enabled); public: - BanDialog(const ServerInfo_User &info, QWidget *parent = 0); + BanDialog(const ServerInfo_User &info, QWidget *parent = nullptr); QString getBanName() const; QString getBanIP() const; QString getBanId() const; @@ -58,7 +58,7 @@ private slots: void okClicked(); public: - WarningDialog(const QString userName, const QString clientID, QWidget *parent = 0); + WarningDialog(const QString userName, const QString clientID, QWidget *parent = nullptr); QString getName() const; QString getWarnID() const; QString getReason() const; @@ -122,7 +122,7 @@ signals: void removeIgnore(const QString &userName); public: - UserList(TabSupervisor *_tabSupervisor, AbstractClient *_client, UserListType _type, QWidget *parent = 0); + UserList(TabSupervisor *_tabSupervisor, AbstractClient *_client, UserListType _type, QWidget *parent = nullptr); void retranslateUi(); void processUserInfo(const ServerInfo_User &user, bool online); bool deleteUser(const QString &userName); diff --git a/cockatrice/src/window_main.cpp b/cockatrice/src/window_main.cpp index 4ba1366a..c366222b 100644 --- a/cockatrice/src/window_main.cpp +++ b/cockatrice/src/window_main.cpp @@ -322,7 +322,7 @@ void MainWindow::actTips() delete tip; tip = nullptr; } - tip = new DlgTipOfTheDay(); + tip = new DlgTipOfTheDay(this); if (tip->successfulInit) { tip->show(); } @@ -1268,14 +1268,13 @@ int MainWindow::getNextCustomSetPrefix(QDir dataDir) void MainWindow::actManageSets() { - wndSets = new WndSets; - wndSets->setWindowModality(Qt::WindowModal); + wndSets = new WndSets(this); wndSets->show(); } void MainWindow::actEditTokens() { - DlgEditTokens dlg; + DlgEditTokens dlg(this); dlg.exec(); db->saveCustomTokensToFile(); } diff --git a/cockatrice/src/window_sets.h b/cockatrice/src/window_sets.h index 1013bc43..5f95ae1c 100644 --- a/cockatrice/src/window_sets.h +++ b/cockatrice/src/window_sets.h @@ -49,7 +49,7 @@ private: }; public: - WndSets(QWidget *parent = 0); + WndSets(QWidget *parent = nullptr); ~WndSets(); protected: diff --git a/cockatrice/src/zoneviewzone.h b/cockatrice/src/zoneviewzone.h index c9394adf..e25b1542 100644 --- a/cockatrice/src/zoneviewzone.h +++ b/cockatrice/src/zoneviewzone.h @@ -28,7 +28,7 @@ public: int _numberCards = -1, bool _revealZone = false, bool _writeableRevealZone = false, - QGraphicsItem *parent = 0); + QGraphicsItem *parent = nullptr); ~ZoneViewZone(); QRectF boundingRect() const; void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget);