The 'using namespace Magick;' line causes a conflict between ImageMagick's WarningType and Qt's one with Qt 5.14, so move it after the Qt imports.
In file included from /usr/include/qt/QtCore/qstring.h:50,
from /usr/include/qt/QtCore/qobject.h:47, from /usr/include/qt/QtCore/qiodevice.h:45, from /usr/include/qt/QtCore/qfiledevice.h:43, from /usr/include/qt/QtCore/qfile.h:44, from /usr/include/qt/QtCore/QFile:1, from /build/digikam/src/digikam/core/app/main/main.cpp:45:
/usr/include/qt/QtCore/qbytearray.h: In member function ‘QByteRef::operator char() const’:
/usr/include/qt/QtCore/qbytearray.h:564:14: error: reference to ‘WarningType’ is ambiguous
564 | warn(WarningType::OutOfRange, EmittingClass::QByteRef); | ^~~~~~~~~~~
In file included from /usr/include/ImageMagick-7/Magick++/Image.h:18,
from /usr/include/ImageMagick-7/Magick++.h:12, from /build/digikam/src/digikam/core/app/main/main.cpp:35:
/usr/include/ImageMagick-7/Magick++/Exception.h:381:24: note: candidates are: ‘class Magick::WarningType’
381 | class MagickPPExport WarningType: public Warning | ^~~~~~~~~~~