[prev in list] [next in list] [prev in thread] [next in thread]
List: pykde
Subject: Re: [PyQt] How to call the non-template version of qmlRegisterType
From: Phil Thompson <phil () riverbankcomputing ! com>
Date: 2014-11-16 17:30:59
Message-ID: 1804850f0d62ab3a0e44727944bb2efa () riverbankcomputing ! com
[Download RAW message or body]
On 12/11/2014 4:12 pm, B. B. wrote:
> Hello,
>
> Looking in the docs and the c++ sources, there should be a non template
> version of the
> qmlRegisterType ...
>
> inline int qmlRegisterType(const QUrl &url, const char *uri, int
> versionMajor, int versionMinor, const char *qmlName)
> {
> if (url.isRelative()) {
> // User input check must go here, because
> QQmlPrivate::qmlregister is also used internally for composite types
> qWarning("qmlRegisterType requires absolute URLs.");
> return 0;
>
>
> along with 3 template versions...
>
> template<typename T>
> int qmlRegisterType()
> {
> QML_GETTYPENAMES
> QQmlPrivate::RegisterType type = {
> 0,
>
>
> template<typename T>
> int qmlRegisterType(const char *uri, int versionMajor, int
> versionMinor, const char *qmlName)
> {
> QML_GETTYPENAMES
> QQmlPrivate::RegisterType type = {
>
>
> template<typename T, int metaObjectRevision>
> int qmlRegisterType(const char *uri, int versionMajor, int
> versionMinor, const char *qmlName)
> {
> QML_GETTYPENAMES
> QQmlPrivate::RegisterType type = {
> 1,
>
>
> I have not so much experience with pyqt, so I guess there is a calling
> convention I have misssed???
>
> I would never claim it is not exposed to python yet.. :-)...
>
>
> I am using the sources PyQt-gpl-5.4-snapshot-837edec02d98.
>
> The error written to the console when I call try calling it, is :
>
> TypeError: arguments did not match any overloaded call:
> qmlRegisterType(type, type attachedProperties=0): argument 1 has
> unexpected type 'QUrl'
> qmlRegisterType(type, str, int, int, str, type attachedProperties=0):
> argument 1 has unexpected type 'QUrl'
> qmlRegisterType(type, int, str, int, int, str, type
> attachedProperties=0): argument 1 has unexpected type 'QUrl'
It was missing - should be tonight's snapshot.
Thanks,
Phil
_______________________________________________
PyQt mailing list PyQt@riverbankcomputing.com
http://www.riverbankcomputing.com/mailman/listinfo/pyqt
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic