Bug 414679 - plymouth-kcm-5.17.3 w/ Qt 5.14.0_beta3: kcm.cpp:54:41: error: no matching function for call to ‘qmlRegisterType<KCMPlymouth>()’
Summary: plymouth-kcm-5.17.3 w/ Qt 5.14.0_beta3: kcm.cpp:54:41: error: no matching fun...
Status: RESOLVED FIXED
Alias: None
Product: systemsettings
Classification: Applications
Component: kcm_plymouth (other bugs)
Version First Reported In: 5.17.3
Platform: Gentoo Packages Linux
: NOR normal
Target Milestone: ---
Assignee: Plasma Bugs List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2019-11-30 05:04 UTC by Peter Levine
Modified: 2019-12-26 20:19 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed/Implemented In: 5.17.5
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Peter Levine 2019-11-30 05:04:04 UTC
Building plymouth-kcm-5.17.3 against Qt 5.14.0_beta3 fails with:


> ../plymouth-kcm-5.17.3/src/kcm.cpp: In constructor 'KCMPlymouth::KCMPlymouth(QObject*, const QVariantList&)':
> ../plymouth-kcm-5.17.3/src/kcm.cpp:54:41: error: no matching function for call to 'qmlRegisterType<QStandardItemModel>()'
>    54 |     qmlRegisterType<QStandardItemModel>();
>       |                                         ^
> In file included from /usr/include/qt5/QtQml/QtQml:9,
>                  from /usr/include/KF5/KDeclarative/kquickaddons/configmodule.h:34,
>                  from /usr/include/KF5/KDeclarative/KQuickAddons/ConfigModule:1,
>                  from ../plymouth-kcm-5.17.3/src/kcm.h:28,
>                  from ../plymouth-kcm-5.17.3/src/kcm.cpp:21:
> /usr/include/qt5/QtQml/qqml.h:291:5: note: candidate: 'int qmlRegisterType(const char*, int, int, const char*) [with T = QStandardItemModel]'
>   291 | int qmlRegisterType(const char *uri, int versionMajor, int versionMinor, const char *qmlName)
>       |     ^~~~~~~~~~~~~~~
> /usr/include/qt5/QtQml/qqml.h:291:5: note:   candidate expects 4 arguments, 0 provided
> /usr/include/qt5/QtQml/qqml.h:322:5: note: candidate: 'template<class T, int metaObjectRevision> int qmlRegisterType(const char*, int, int, const char*)'
>   322 | int qmlRegisterType(const char *uri, int versionMajor, int versionMinor, const char *qmlName)
>       |     ^~~~~~~~~~~~~~~
> /usr/include/qt5/QtQml/qqml.h:322:5: note:   template argument deduction/substitution failed:
> ../plymouth-kcm-5.17.3/src/kcm.cpp:54:41: note:   candidate expects 4 arguments, 0 provided
>    54 |     qmlRegisterType<QStandardItemModel>();
>       |                                         ^

From https://doc-snapshots.qt.io/qt5-5.14/qqmlengine-obsolete.html:

> int qmlRegisterType()
> 
> This function is obsolete. It is provided to keep old source code working. We strongly advise against using it in new code.
> This is an overloaded function.
> Do not use this function. For anonymous type registrations, use qmlRegisterAnonymousType(), and make sure to provide a URI and a major version.


Operating System: Gentoo Linux 
KDE Plasma Version: 5.17.3
KDE Frameworks Version: 5.64.0
Qt Version: 5.14.0
Kernel Version: 5.4.0-gentoo
OS Type: 64-bit
Processors: 8 Intel Core i7-7700HQ CPU @ 2.80GHz
Memory: 31.1 GiB of RAM

Also reported downstream at https://bugs.gentoo.org/700480
Comment 1 Nate Graham 2019-12-26 20:18:50 UTC
Git commit 92ffa670f0e51ed949c34fd14c7773a4ad2d0946 by Nate Graham, on behalf of Peter Levine.
Committed on 26/12/2019 at 20:16.
Pushed by ngraham into branch 'Plasma/5.17'.

Don't use qmlRegisterType with QT-5.14

Summary:
Building Plymouth-kcm-5.17.3 against Qt 5.14.0_beta3 fails to build.

I don't have much experience with QT/KDE programming but these
changes are sufficient to fix the build error on my end.

Reviewers: jriddell, #plasma, davidedmundson

Reviewed By: #plasma, davidedmundson

Subscribers: zzag, davidedmundson, asturmlechner, plasma-devel

Tags: #plasma

Differential Revision: https://phabricator.kde.org/D25624

M  +6    -0    src/kcm.cpp

https://commits.kde.org/plymouth-kcm/92ffa670f0e51ed949c34fd14c7773a4ad2d0946