• I am testing version 5.2 and 5.3 and have noticed no difference what operating system are you using and Q_OS_ANDROID Q_OS_LINUX.

    this is the code I've tried.

    @QStringList myOpenFile;
    QString mypath = QDir::currentPath();
    #ifdef Q_OS_WIN32
    myOpenFile << mypath+"/myfiles/oth/file.txt";
    #ifdef Q_OS_LINUX
    myOpenFile << mypath+"/myfiles/oth/file.txt";
    #ifdef Q_OS_ANDROID
    myOpenFile << "/mnt/sdcard/myfiles/oth/file.txt";
    using qDebug obtain two outputs:

    qDebug() << myOpenFile;


    This error only happens on android.

  • Android itself some kind of Linux so you'll see the output of Q_OS_LINUX and Q_OS_ANDROID under Android while you'll see single output under Windows or Linux

  • Try to use:
    [code]#if defined(Q_OS_ANDROID)
    qDebug() << "ANDROID";
    #elif defined(Q_OS_LINUX)
    qDebug() << "LINUX";
    #elif defined(Q_OS_WIN32)
    qDebug() << "WIN32";

Log in to reply

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