[PyQt] How to call the non-template version of qmlRegisterType

B. B. thebbzoo at gmail.com
Wed Nov 12 16:12:21 GMT 2014


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'


Best Regards

Brian
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.riverbankcomputing.com/pipermail/pyqt/attachments/20141112/a2e53b72/attachment.html>


More information about the PyQt mailing list