punesemu / puNES

Qt-based Nintendo Entertaiment System emulator and NSF/NSF2/NSFe Music Player (Linux, FreeBSD, OpenBSD and Windows)
GNU General Public License v2.0
656 stars 42 forks source link

Fix compatibility with Qt 6.7.1 #403

Closed OPNA2608 closed 5 months ago

OPNA2608 commented 5 months ago

Upstream QTBUG-105023 fix made it mandatory that arguments to QObject::findChild[ren] calls must be Q_OBJECTs.

Fixes FTBFS with Qt 6.7.1:

[ 89%] Building CXX object src/CMakeFiles/punes.dir/gui/dlgStdPad.cpp.o
In file included from /nix/store/ikqvl8jq0d7vlp25d9zlbh44m4hljahc-qtbase-6.7.1/include/QtCore/qiodevice.h:10,
                 from /nix/store/ikqvl8jq0d7vlp25d9zlbh44m4hljahc-qtbase-6.7.1/include/QtCore/qbuffer.h:7,
                 from /nix/store/ikqvl8jq0d7vlp25d9zlbh44m4hljahc-qtbase-6.7.1/include/QtCore/QBuffer:1,
                 from /build/source/src/gui/dlgStdPad.cpp:19:
/nix/store/ikqvl8jq0d7vlp25d9zlbh44m4hljahc-qtbase-6.7.1/include/QtCore/qobject.h: In instantiation of 'T QObject::findChild(QAnyStringView, Qt::FindChildOptions) const [with T = pixmapButton*; Qt::FindChildOptions = QFlags<Qt::FindChildOption>]':
/build/source/src/gui/dlgStdPad.cpp:99:35:   required from here
/nix/store/ikqvl8jq0d7vlp25d9zlbh44m4hljahc-qtbase-6.7.1/include/QtCore/qobject.h:151:62: error: static assertion failed: No Q_OBJECT in the class passed to QObject::findChild
  151 |         static_assert(QtPrivate::HasQ_OBJECT_Macro<ObjType>::Value,
      |                                                              ^~~~~
/nix/store/ikqvl8jq0d7vlp25d9zlbh44m4hljahc-qtbase-6.7.1/include/QtCore/qobject.h:151:62: note: 'QtPrivate::HasQ_OBJECT_Macro<pixmapButton>::Value' evaluates to false
make[2]: *** [src/CMakeFiles/punes.dir/build.make:7505: src/CMakeFiles/punes.dir/gui/dlgStdPad.cpp.o] Error 1
punesemu commented 5 months ago

Thanks so much for the patch. I'm away from home for a few days but I'll come back over the weekend and take a look at your request.