Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

QFileDialog directory only behavior not the same on Win 7 and Win XP



  • Hello,

    I have the following code:


    QString someStringInMyProgram;

    QFileDialog getCalcFilePath( this );
    getCalcFilePath.setFileMode( QFileDialog::Directory );
    getCalcFilePath.setOptions( QFileDialog::ShowDirsOnly );
    getCalcFilePath.setWindowTitle( "blablabla" );

    if( !someStringInMyProgram.isEmpty() )
    {
    getCalcFilePath.setDirectory( someStringInMyProgram );
    }

    if( getCalcFile.exec() == QDialog::Accepted )
    {
    someStringInMyProgram = getCalcFile.selectedFiles()[0];
    }


    Doing this on OSX and Windows 7 yeilds the expected behavior, but when I run the code on Windows XP (we still have some old computers running old software that we can't get rid of right now, please don't tell me to stop using XP), the file dialog actually shows files and expects a file to be selected.

    I will patch my code right now and I will test the Windows version number using GetVersionEx(), but I wanted to see if anyone else had the problem and if it is something I am doing wrong.

    I have found this thread (URL was active at the time of my writing this post) which points to the same issue, but with no answer.

    In any case, thanks in advance for any help.



  • Did you check already on JIRA?
    Also what is the Qt version ?


Log in to reply