[Qt 5.4][Android]QtAndroidExtras and QPointer problem



  • Hey,

    I got a problem with QtAndroidExtras and QPointer, the thing is I got some QPointer<QObject> and it works perfectly, the problem is when I include QtAndroidExtras library. It somehow overrides QPointer operator== and operator!=

    Simple code to show the problem:
    @#include <QApplication>
    #include <QQmlApplicationEngine>
    #include <QPointer>
    #include <QDebug>
    #include <QtAndroidExtras>

    int main(int argc, char *argv[])
    {
    QApplication app(argc, argv);

    QPointer<QObject> pointer;
    if(pointer == NULL) //ERROR HERE
        qDebug() << "TEST";
    
    QQmlApplicationEngine engine;
    engine.load(QUrl(QStringLiteral("qrc:/main.qml")));
    
    return app.exec&#40;&#41;;
    

    }@

    and thats the error I got
    @/home/qwe/testAdnroidExtras/main.cpp:12: błąd: ambiguous overload for 'operator==' (operand types are 'QPointer<QObject>' and 'int')
    if(pointer == NULL) //ERROR HERE
    ^@

    It leads to qandroidjniobject.h line 194, where operator== is defined.
    Anyone knows the solution?
    Is it a bug and I should report this?


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.