From 53f394839396edd537785fc40db3090839dd7c04 Mon Sep 17 00:00:00 2001 From: John Fultz Date: Tue, 18 Jul 2023 00:44:06 -0500 Subject: Fix Qt6 MOC compilation on some platforms. That was super painful. It seems that some of the Quackle types that have custom operator==() give fits to the MOC compiler when those types are used as arguments for slots and/or signals (or maybe it's only when they're connected in a certain way...frankly, I never did figure this out precisely to my satisfaction). The compilers provide very little help in resolving this problem. Once I understood the problem, VS22 was giving me just the tiniest morsel, enough that I could hunt down the offending slot/signal (it wasn't even giving me the name of the slot/signal...just the type it was trying to use). I've changed all offending functions to use const pointers to types instead of const references, and this makes Qt happy. I couldn't find any info on the web directly about this, but here's the closest I did find, which suggests that this is related to increased functionality in Qt6 regarding reflection. https://forum.qt.io/topic/141434/ This fixes my VC++22 x86-64 build. Hopefully it fixes all of the others, too. --- quacker/view.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'quacker/view.cpp') diff --git a/quacker/view.cpp b/quacker/view.cpp index 75f3797..2d5bbe2 100644 --- a/quacker/view.cpp +++ b/quacker/view.cpp @@ -42,13 +42,13 @@ void View::grabFocus() { } -void View::positionChanged(const Quackle::GamePosition &position) +void View::positionChanged(const Quackle::GamePosition *position) { for (QList::iterator it = m_subviews.begin(); it != m_subviews.end(); ++it) (*it)->positionChanged(position); } -void View::movesChanged(const Quackle::MoveList &moves) +void View::movesChanged(const Quackle::MoveList *moves) { for (auto& it : m_subviews) it->movesChanged(moves); @@ -59,8 +59,8 @@ void View::connectSubviewSignals() for (auto& it : m_subviews) { connect(it, SIGNAL(statusMessage(const QString &)), this, SIGNAL(statusMessage(const QString &))); - connect(it, SIGNAL(setCandidateMove(const Quackle::Move &, bool *)), this, SIGNAL(setCandidateMove(const Quackle::Move &, bool *))); - connect(it, SIGNAL(removeCandidateMoves(const Quackle::MoveList &)), this, SIGNAL(removeCandidateMoves(const Quackle::MoveList &))); + connect(it, SIGNAL(setCandidateMove(const Quackle::Move *, bool *)), this, SIGNAL(setCandidateMove(const Quackle::Move *, bool *))); + connect(it, SIGNAL(removeCandidateMoves(const Quackle::MoveList *)), this, SIGNAL(removeCandidateMoves(const Quackle::MoveList *))); connect(it, SIGNAL(commit()), this, SIGNAL(commit())); connect(it, SIGNAL(setRack(const Quackle::Rack &)), this, SIGNAL(setRack(const Quackle::Rack &))); } -- cgit v1.2.3