Qt World Summit: Register Today!

QFileDialog does not honor QCoreApplication settings

  • Hello,

    I created a QtGui application via QtCreator template.
    I added this in the main.cpp:

    and this in MainWindows constructor:
    QString hello = "Hello, world!";
    settings.setValue("Welcome", hello);
    hello = "";
    hello = settings.value("Welcome").toString();
    qDebug() << hello; // this prints "Hello, world!"
    this writes the settings to
    when running the app (I'm on mac)

    when adding a FileDialog via
    QString tempFilePath = QFileDialog::getOpenFileName(this);
    running the app and closing the file dialog, I have a new settings file at:
    where FileProblem is the Targets name. The content is the last accessed directory with the key
    I think this is the wrong behavior. Shouldn't the key be appended to the existing preferences?

    I'm on OS X, 10.7.1, running the last SDK 1.1.3. I know, that this OS is not supported, but I don't think that this is different on other platforms. Sorry but don't have a SnowLeopard machine around.


  • You should open an issue on the "bug tracker:"http://bugreports.qt.nokia.com/, this way you ensure that the developers are aware of the problem. If you can provide a complete example, it's more likely that the issue is fixed quickly :-)

    Please report back the issue id here, so that others can look for the progress.

  • Created a bugreport as suggested. Link here:


  • Thank's - I voted for it, may it raise the priority a bit :-)

Log in to reply