Fix build with Qt 5.14
ClosedPublic

Authored by arojas on Dec 21 2019, 1:09 PM.

Details

Reviewers
None
Group Reviewers
Digikam
Commits
R482:72651c36d900: Fix build with Qt 5.14
Summary

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
    |                        ^~~~~~~~~~~
Test Plan

Builds with Qt 5.14

Diff Detail

Repository
R482 digiKam
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
arojas requested review of this revision.Dec 21 2019, 1:09 PM
arojas created this revision.

Changes are fine for me, but i'm sure that other entries in whole digiKam source code needs this kind of fix.

Best

Gilles Caulier

arojas updated this revision to Diff 71944.Dec 21 2019, 1:25 PM

Just this patch was enough for me to fix the ibuild (not sure why), but I've made the same change everywhere else for consistency.

Thanks Antonio.

Feel free to commit this changes in git/master.

Gilles

This revision was not accepted when it landed; it landed in state Needs Review.Dec 21 2019, 1:49 PM
This revision was automatically updated to reflect the committed changes.