Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Mobile and Embedded
  4. [Qt 5.4][Android]QtAndroidExtras and QPointer problem
Forum Updated to NodeBB v4.3 + New Features

[Qt 5.4][Android]QtAndroidExtras and QPointer problem

Scheduled Pinned Locked Moved Mobile and Embedded
1 Posts 1 Posters 666 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • K Offline
    K Offline
    kolegs
    wrote on last edited by
    #1

    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?

    1 Reply Last reply
    0

    • Login

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Get Qt Extensions
    • Unsolved