https://bugs.kde.org/show_bug.cgi?id=456289

Yue Liu <m...@outlook.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |m...@outlook.com

--- Comment #57 from Yue Liu <m...@outlook.com> ---
I just ran into Qt6 compilation issue as well. I'm compiling digikam master
HEAD against the latest kf6-qt6 packages from kde-neon/unstable. This is after
KF6 has branched so not sure if that requires changes on digikam side.

I had to replace all the `KF5` names in cmake files to `KF6`, not sure if this
is really needed, or an ECM packaging issue in kde-neon, or I just forgot to
install some KF5 compatibility packages.

Then found I have to add additional Qt libraries such as `StateMachine` and
`Core5Compat`.

Then need to replace "I18N_NOOP2" with "kxi18nc"

Then ran into multiple compilation errors related to ambiguous type
conversions:

```

/home/yue/dev/digikam/git/core/libs/widgets/text/dplaintextedit.cpp: In member
function 'virtual void Digikam::DPlainTextEdit::keyPressEvent(QKeyEvent*)':
/home/yue/dev/digikam/git/core/libs/widgets/text/dplaintextedit.cpp:229:17:
error: conversion from 'int' to 'QChar' is ambiguous
  229 |             if (key == d->ignoredMask[i])
      |                 ^~~
In file included from /usr/include/x86_64-linux-gnu/qt6/QtCore/qstring.h:14,
                 from /usr/include/x86_64-linux-gnu/qt6/QtCore/QString:1,
                 from
/home/yue/dev/digikam/git/core/libs/widgets/text/dtextedit.h:20,
                 from
/home/yue/dev/digikam/git/core/libs/widgets/text/dtextedit_p.h:18,
                 from
/home/yue/dev/digikam/git/core/libs/widgets/text/dplaintextedit.cpp:15:


/home/yue/dev/digikam/git/core/libs/widgets/text/dplaintextedit.cpp:238:17:
error: conversion from 'int' to 'QChar' is ambiguous
  238 |             if (key != d->acceptedMask[i])
      |                 ^~~
In file included from /usr/include/x86_64-linux-gnu/qt6/QtCore/qstring.h:14,
                 from /usr/include/x86_64-linux-gnu/qt6/QtCore/QString:1,
                 from
/home/yue/dev/digikam/git/core/libs/widgets/text/dtextedit.h:20,
                 from
/home/yue/dev/digikam/git/core/libs/widgets/text/dtextedit_p.h:18,
                 from
/home/yue/dev/digikam/git/core/libs/widgets/text/dplaintextedit.cpp:15:


/home/yue/dev/digikam/git/core/libs/widgets/text/localizeselector.cpp:332:32:
error: conversion from 'Digikam::DOnlineTranslator::TranslationError' to
'QChar' is ambiguous
  332 |         error = trengine->error();
      |                 ~~~~~~~~~~~~~~~^~
In file included from /usr/include/x86_64-linux-gnu/qt6/QtCore/qstring.h:14,
                 from /usr/include/x86_64-linux-gnu/qt6/QtCore/qobject.h:11,
                 from /usr/include/x86_64-linux-gnu/qt6/QtWidgets/qwidget.h:9,
                 from /usr/include/x86_64-linux-gnu/qt6/QtWidgets/QWidget:1,
                 from
/home/yue/dev/digikam/git/core/libs/widgets/text/localizeselector.h:20,
                 from
/home/yue/dev/digikam/git/core/libs/widgets/text/localizeselector.cpp:15:
```

If digikam was compiled with Qt6 successfully with a previous Qt6 and previous
KF5-qt6 build, I don't think these compilation errors need to be fixed right
now, there must be some compatibility flag to allow the old code to compile.
I'm I missing anything from the CMAKE configuration?

I'm setting this environment variable to find ECM packaged in kde-neon:
```
ECM_DIR=/usr/kf6/share/ECM
```
and using this Cmake config:
```
cmake -G "Ninja" .. \
      -DCMAKE_BUILD_TYPE=RelWithDebInfo \
      -DCMAKE_INSTALL_PREFIX=../usr \
      -DBUILD_TESTING=ON \
      -DBUILD_WITH_CCACHE=ON \
      -DBUILD_WITH_QT6=ON \
      -DDIGIKAMSC_COMPILE_PO=OFF \
      -DDIGIKAMSC_COMPILE_DIGIKAM=ON \
      -DENABLE_KFILEMETADATASUPPORT=OFF \
      -DENABLE_AKONADICONTACTSUPPORT=OFF \
      -DENABLE_MYSQLSUPPORT=OFF \
      -DENABLE_INTERNALMYSQL=OFF \
      -DENABLE_MEDIAPLAYER=OFF \
      -DENABLE_DBUS=ON \
      -DENABLE_APPSTYLES=ON \
      -DENABLE_QWEBENGINE=ON \
      -DQT_MAJOR_VERSION=6

```

-- 
You are receiving this mail because:
You are watching all bug changes.

Reply via email to