diff --git a/cockatrice/CMakeLists.txt b/cockatrice/CMakeLists.txt index c88e3b12c..8ace2e4f0 100644 --- a/cockatrice/CMakeLists.txt +++ b/cockatrice/CMakeLists.txt @@ -692,7 +692,7 @@ if(WIN32) # Windows (including 64bit) # Install the runtime of every linked module explicitly. An unused DLL costs a # few hundred kilobytes; a missing one is what stops the client starting after # an update, and it stays invisible until then. - foreach(_qt_module IN LISTS QT_MODULES_COCKATRICE) + foreach(_qt_module IN LISTS COCKATRICE_QT_MODULES) get_target_property(_qt_module_type ${_qt_module} TYPE) if(_qt_module_type STREQUAL "SHARED_LIBRARY") install(FILES "$" DESTINATION ./) diff --git a/cockatrice/src/game_graphics/board/abstract_card_drag_item.cpp b/cockatrice/src/game_graphics/board/abstract_card_drag_item.cpp index d3355b84b..2f43591ac 100644 --- a/cockatrice/src/game_graphics/board/abstract_card_drag_item.cpp +++ b/cockatrice/src/game_graphics/board/abstract_card_drag_item.cpp @@ -14,7 +14,7 @@ const QColor GHOST_MASK = QColor(255, 255, 255, 50); AbstractCardDragItem::AbstractCardDragItem(AbstractCardItem *_item, const QPointF &_hotSpot, AbstractCardDragItem *parentDrag) - : QGraphicsObject(), item(_item), hotSpot(_hotSpot) + : QGraphicsItem(), item(_item), hotSpot(_hotSpot) { if (parentDrag) { parentDrag->addChildDrag(this); diff --git a/cockatrice/src/game_graphics/board/abstract_card_drag_item.h b/cockatrice/src/game_graphics/board/abstract_card_drag_item.h index d9727e6ec..ae19c7289 100644 --- a/cockatrice/src/game_graphics/board/abstract_card_drag_item.h +++ b/cockatrice/src/game_graphics/board/abstract_card_drag_item.h @@ -13,7 +13,7 @@ class QGraphicsScene; class CardZone; class CardInfo; -class AbstractCardDragItem : public QGraphicsObject +class AbstractCardDragItem : public QObject, public QGraphicsItem { Q_OBJECT protected: diff --git a/cockatrice/src/game_graphics/board/abstract_counter.cpp b/cockatrice/src/game_graphics/board/abstract_counter.cpp index 3010cdab9..4ba04804f 100644 --- a/cockatrice/src/game_graphics/board/abstract_counter.cpp +++ b/cockatrice/src/game_graphics/board/abstract_counter.cpp @@ -23,7 +23,7 @@ AbstractCounter::AbstractCounter(CounterState *state, bool _shownInCounterArea, bool _useNameForShortcut, QGraphicsItem *parent) - : QGraphicsObject(parent), player(_player), id(state->getId()), name(state->getName()), value(state->getValue()), + : QGraphicsItem(parent), player(_player), id(state->getId()), name(state->getName()), value(state->getValue()), color(state->getColor()), radius(state->getRadius()), useNameForShortcut(_useNameForShortcut), shownInCounterArea(_shownInCounterArea) { diff --git a/cockatrice/src/game_graphics/board/abstract_counter.h b/cockatrice/src/game_graphics/board/abstract_counter.h index bdaeb3a9c..37d071ec0 100644 --- a/cockatrice/src/game_graphics/board/abstract_counter.h +++ b/cockatrice/src/game_graphics/board/abstract_counter.h @@ -20,7 +20,7 @@ class QKeyEvent; class QMenu; class QString; -class AbstractCounter : public QGraphicsObject, public AbstractPlayerComponent +class AbstractCounter : public QObject, public QGraphicsItem, public AbstractPlayerComponent { Q_OBJECT diff --git a/cockatrice/src/game_graphics/board/arrow_item.cpp b/cockatrice/src/game_graphics/board/arrow_item.cpp index c31bd75aa..664d44ecc 100644 --- a/cockatrice/src/game_graphics/board/arrow_item.cpp +++ b/cockatrice/src/game_graphics/board/arrow_item.cpp @@ -42,7 +42,7 @@ qreal easeOutCubic(qreal t) } // namespace ArrowItem::ArrowItem(QSharedPointer _data, ArrowTarget *_startItem, ArrowTarget *_targetItem) - : QGraphicsObject(), data(std::move(_data)), startItem(_startItem), targetItem(_targetItem) + : data(std::move(_data)), startItem(_startItem), targetItem(_targetItem) { setZValue(ZValues::ARROWS); diff --git a/cockatrice/src/game_graphics/board/arrow_item.h b/cockatrice/src/game_graphics/board/arrow_item.h index 7cbc2399a..67e350f35 100644 --- a/cockatrice/src/game_graphics/board/arrow_item.h +++ b/cockatrice/src/game_graphics/board/arrow_item.h @@ -16,7 +16,7 @@ class CardItem; class QGraphicsSceneMouseEvent; class PlayerLogic; -class ArrowItem : public QGraphicsObject, public IAnimatedItem +class ArrowItem : public QObject, public QGraphicsItem, public IAnimatedItem { Q_OBJECT signals: diff --git a/cockatrice/src/game_graphics/phases_toolbar.cpp b/cockatrice/src/game_graphics/phases_toolbar.cpp index 21c4c2c29..3361f9d55 100644 --- a/cockatrice/src/game_graphics/phases_toolbar.cpp +++ b/cockatrice/src/game_graphics/phases_toolbar.cpp @@ -14,8 +14,8 @@ #include PhaseButton::PhaseButton(const QString &_name, QGraphicsItem *parent, QAction *_doubleClickAction, bool _highlightable) - : QGraphicsObject(parent), name(_name), active(false), highlightable(_highlightable), activeAnimationCounter(0), - doubleClickAction(_doubleClickAction), width(50) + : QObject(), QGraphicsItem(parent), name(_name), active(false), highlightable(_highlightable), + activeAnimationCounter(0), doubleClickAction(_doubleClickAction), width(50) { if (highlightable) { activeAnimationTimer = new QTimer(this); @@ -108,7 +108,7 @@ void PhaseButton::triggerDoubleClickAction() } PhasesToolbar::PhasesToolbar(QGraphicsItem *parent) - : QGraphicsObject(parent), width(100), height(100), ySpacing(1), symbolSize(8) + : QGraphicsItem(parent), width(100), height(100), ySpacing(1), symbolSize(8) { auto *aUntapAll = new QAction(this); connect(aUntapAll, &QAction::triggered, this, &PhasesToolbar::actUntapAll); diff --git a/cockatrice/src/game_graphics/phases_toolbar.h b/cockatrice/src/game_graphics/phases_toolbar.h index 5f59bd851..64b7c100c 100644 --- a/cockatrice/src/game_graphics/phases_toolbar.h +++ b/cockatrice/src/game_graphics/phases_toolbar.h @@ -24,7 +24,7 @@ class Message; class PlayerLogic; class GameCommand; -class PhaseButton : public QGraphicsObject +class PhaseButton : public QObject, public QGraphicsItem { Q_OBJECT private: @@ -61,7 +61,7 @@ protected: void mouseDoubleClickEvent(QGraphicsSceneMouseEvent *event) override; }; -class PhasesToolbar : public QGraphicsObject +class PhasesToolbar : public QObject, public QGraphicsItem { Q_OBJECT private: diff --git a/cockatrice/src/game_graphics/player/player_area.cpp b/cockatrice/src/game_graphics/player/player_area.cpp index f1a66d08a..86b8c2d1b 100644 --- a/cockatrice/src/game_graphics/player/player_area.cpp +++ b/cockatrice/src/game_graphics/player/player_area.cpp @@ -4,7 +4,7 @@ #include -PlayerArea::PlayerArea(QGraphicsItem *parentItem) : QGraphicsObject(parentItem) +PlayerArea::PlayerArea(QGraphicsItem *parentItem) : QObject(), QGraphicsItem(parentItem) { setCacheMode(DeviceCoordinateCache); connect(themeManager, &ThemeManager::themeChanged, this, &PlayerArea::updateBg); diff --git a/cockatrice/src/game_graphics/player/player_area.h b/cockatrice/src/game_graphics/player/player_area.h index 68ae21fd3..f453c2ab9 100644 --- a/cockatrice/src/game_graphics/player/player_area.h +++ b/cockatrice/src/game_graphics/player/player_area.h @@ -13,7 +13,7 @@ /** * The entire graphical area belonging to a single player. */ -class PlayerArea : public QGraphicsObject +class PlayerArea : public QObject, public QGraphicsItem { Q_OBJECT private: diff --git a/cockatrice/src/game_graphics/zones/view_zone.h b/cockatrice/src/game_graphics/zones/view_zone.h index 9dfa00ce2..51ec22e8c 100644 --- a/cockatrice/src/game_graphics/zones/view_zone.h +++ b/cockatrice/src/game_graphics/zones/view_zone.h @@ -34,7 +34,6 @@ class QGraphicsSceneWheelEvent; class ZoneViewZone : public SelectZone, public QGraphicsLayoutItem { Q_OBJECT - Q_INTERFACES(QGraphicsLayoutItem) private: static constexpr int HORIZONTAL_PADDING = 12; static constexpr int VERTICAL_PADDING = 5; diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index d8acb5436..bb8e93703 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -205,7 +205,7 @@ target_link_libraries( ) if(WITH_CLIENT) - target_link_libraries(single_instance_manager_test Threads::Threads ${GTEST_BOTH_LIBRARIES} ${QT_MODULES_TEST}) + target_link_libraries(single_instance_manager_test Threads::Threads ${GTEST_BOTH_LIBRARIES} ${TEST_QT_MODULES}) endif() add_subdirectory(card_zone_algorithms) diff --git a/tests/picture_loader_benchmark/CMakeLists.txt b/tests/picture_loader_benchmark/CMakeLists.txt index bdbaf18a2..a3b75fe88 100644 --- a/tests/picture_loader_benchmark/CMakeLists.txt +++ b/tests/picture_loader_benchmark/CMakeLists.txt @@ -22,5 +22,5 @@ target_link_libraries( libcockatrice_interfaces libcockatrice_utility Threads::Threads - ${QT_MODULES_TEST} + ${TEST_QT_MODULES} ) diff --git a/tests/theme_migration/CMakeLists.txt b/tests/theme_migration/CMakeLists.txt index 90c0db057..ac202210e 100644 --- a/tests/theme_migration/CMakeLists.txt +++ b/tests/theme_migration/CMakeLists.txt @@ -20,7 +20,7 @@ target_link_libraries( libcockatrice_protocol Threads::Threads ${GTEST_BOTH_LIBRARIES} - ${QT_MODULES_TEST} + ${TEST_QT_MODULES} ) add_test(NAME theme_migration_test COMMAND theme_migration_test)