Skip to content

Commit 52ee397

Browse files
committed
COMP: Fix ctkDICOM moc with strict Qt 6.x meta-type checks
Some Qt 6.x versions (e.g. 6.4) require pointer types used in the meta-object system to refer to complete types when generating meta-type information for Q_INVOKABLEs, signals, and slots. `ctkDICOMJobResponseSet` and `ctkDICOMDisplayedFieldGeneratorAbstractRule` are only forward-declared in `ctkDICOMDatabase.h` and `ctkDICOMDisplayedFieldGeneratorRuleFactory.h`, respectively, which causes moc in these stricter Qt versions to treat them as incomplete and fail meta-type checks. Add Q_MOC_INCLUDE entries so moc sees the full definitions without introducing circular includes at the C++ level. This mirrors the workflow fix in e531993 ("COMP: Fix ctkWorkflow moc with strict Qt 6.x meta-type checks", 2025-11-09) while restoring compatibility with stricter Qt 6.x releases and remaining safe for newer versions.
1 parent e531993 commit 52ee397

2 files changed

Lines changed: 8 additions & 0 deletions

File tree

Libs/DICOM/Core/ctkDICOMDatabase.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,10 @@ class ctkDICOMAbstractThumbnailGenerator;
3737
class ctkDICOMDisplayedFieldGenerator;
3838
class ctkDICOMJobResponseSet;
3939

40+
#if (QT_VERSION >= QT_VERSION_CHECK(6, 0, 0))
41+
Q_MOC_INCLUDE("ctkDICOMJobResponseSet.h") // Ensure moc sees ctkDICOMJobResponseSet for meta-type generation (needed for stricter Qt 6.4+)
42+
#endif
43+
4044
/// \ingroup DICOM_Core
4145
///
4246
/// Class handling a database of DICOM objects. So far, an underlying

Libs/DICOM/Core/ctkDICOMDisplayedFieldGeneratorRuleFactory.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,10 @@ class ctkDICOMDatabase;
3131
class ctkDICOMDisplayedFieldGeneratorAbstractRule;
3232
class ctkDICOMDisplayedFieldGeneratorRuleFactoryCleanup;
3333

34+
#if (QT_VERSION >= QT_VERSION_CHECK(6, 0, 0))
35+
Q_MOC_INCLUDE("ctkDICOMDisplayedFieldGeneratorAbstractRule.h") // Ensure moc sees ctkDICOMDisplayedFieldGeneratorAbstractRule for meta-type generation (needed for stricter Qt 6.4+)
36+
#endif
37+
3438
/// \ingroup SlicerRt_QtModules_Segmentations
3539
/// \class ctkDICOMDisplayedFieldGeneratorRuleFactory
3640
/// \brief Singleton class managing displayed field generator rules

0 commit comments

Comments
 (0)