Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Native Development

Reply
Highlighted
New Developer
Posts: 19
Registered: ‎02-17-2013
My Device: Z30
My Carrier: Telekom Germany

Error while trying to port QT code

Hi,

 

I've found a module for WebDav implementation for QT (see here) and I want to port it to BB10.

 

Unfortunately I'm struggling here because the compiler gives this error:

o-g/.moc/moc_webdav.cpp: In static member function 'static void QWebdav::qt_static_metacall(QObject*, QMetaObject::Call, int, void**)':

o-g/.moc/moc_webdav.cpp:54:48: error: cannot convert from base 'QObject' to derived type 'QWebdav' via virtual base 'QHttp'

As I understand the moc_* files are generated by momentics.

 

This is the block of the moc file that causes the error:

void QWebdav::qt_static_metacall(QObject *_o, QMetaObject::Call _c, int _id, void **_a)
{
    if (_c == QMetaObject::InvokeMetaMethod) {
        Q_ASSERT(staticMetaObject.cast(_o));
        QWebdav *_t = static_cast <QWebdav *>(_o);
        switch (_id) {
        case 0: _t->listInfo((*reinterpret_cast< const QWebdavUrlInfo(*)>(_a[1]))); break;
        case 1: _t->readyRead((*reinterpret_cast< const QHttpResponseHeader(*)>(_a[1]))); break;
        case 2: _t->requestFinished((*reinterpret_cast< int(*)>(_a[1])),(*reinterpret_cast< bool(*)>(_a[2]))); break;
        case 3: _t->responseHeaderReceived((*reinterpret_cast< const QHttpResponseHeader(*)>(_a[1]))); break;
        default: ;
        }
    }
}

 Where this is the line of trouble:

QWebdav *_t = static_cast <QWebdav *>(_o);

 

Any idea how to fix that?

 

Developer
Posts: 161
Registered: ‎01-03-2013
My Device: n/a
My Carrier: n/a

Re: Error while trying to port QT code

Well, the problem probably comes from the fact that QHttp is deprecated. You should use QNetworkAccessManager for any network request (that includes http requests).

Regards.

If my answer has been useful to you, please, click the button