Details
-
Suggestion
-
Resolution: Fixed
-
P2: Important
-
None
-
6.5
-
None
Description
$ cd ~/dev/qt6/qtbase $ git grep QSettings | grep QtProject examples/network/torrent/mainwindow.cpp: QSettings settings("QtProject", "Torrent"); examples/network/torrent/mainwindow.cpp: QSettings settings("QtProject", "Torrent"); qmake/property.cpp: settings = new QSettings(QSettings::UserScope, "QtProject", "QMake"); src/corelib/doc/snippets/resource-system/mainwindow.cpp: QSettings settings("QtProject", "Application Example"); src/corelib/doc/snippets/resource-system/mainwindow.cpp: QSettings settings("QtProject", "Application Example"); src/gui/kernel/qplatformdialoghelper.cpp: const QSettings settings(QSettings::UserScope, QStringLiteral("QtProject")); src/gui/kernel/qplatformdialoghelper.cpp: QSettings settings(QSettings::UserScope, QStringLiteral("QtProject")); src/network/socket/qlocalserver_tcp.cpp: QSettings settings("QtProject"_L1, "Qt"_L1); src/network/socket/qlocalserver_tcp.cpp: QSettings settings("QtProject"_L1, "Qt"_L1); src/network/socket/qlocalserver_tcp.cpp: QSettings settings("QtProject"_L1, "Qt"_L1); src/network/socket/qlocalsocket_tcp.cpp: QSettings settings("QtProject"_L1, "Qt"_L1); src/plugins/platformthemes/gtk3/qgtk3interface.cpp: QSettings settings(QSettings::UserScope, QLatin1String("QtProject")); src/plugins/platformthemes/gtk3/qgtk3interface.cpp: QSettings settings(QSettings::UserScope, QLatin1String("QtProject")); src/widgets/dialogs/qfiledialog.cpp: QSettings settings(QSettings::UserScope, u"QtProject"_s); src/widgets/dialogs/qfiledialog.cpp: QSettings settings(QSettings::UserScope, u"QtProject"_s); src/widgets/dialogs/qfiledialog.cpp: const QSettings settings(QSettings::UserScope, u"QtProject"_s); src/widgets/dialogs/qfiledialog.cpp: const QSettings settings(QSettings::UserScope, u"QtProject"_s); tests/auto/corelib/io/qsettings/tst_qsettings.cpp: QSettings settings("QtProject", "tst_qsettings"); tests/auto/corelib/io/qsettings/tst_qsettings.cpp: QSettings settings("QtProject", "tst_qsettings"); tests/auto/corelib/io/qsettings/tst_qsettings.cpp: QSettings settings("QtProject", "tst_qsettings"); tests/auto/corelib/io/qsettings/tst_qsettings.cpp: QSettings settings("QtProject", "tst_qsettings"); tests/auto/corelib/io/qsettings/tst_qsettings.cpp: QSettings settings("QtProject", "tst_qsettings"); tests/auto/corelib/io/qsettings/tst_qsettings.cpp: QSettings settings("QtProject", "tst_qsettings"); tests/auto/widgets/dialogs/qfiledialog/tst_qfiledialog.cpp: QSettings settings(QSettings::UserScope, QLatin1String("QtProject")); tests/auto/widgets/dialogs/qfiledialog2/tst_qfiledialog2.cpp: QSettings settings(QSettings::UserScope, QLatin1String("QtProject")); tests/auto/widgets/dialogs/qfiledialog2/tst_qfiledialog2.cpp: QSettings settings(QSettings::UserScope, "QtProject"); tests/auto/widgets/dialogs/qfiledialog2/tst_qfiledialog2.cpp: QSettings settings(QSettings::UserScope, "QtProject"); tests/manual/lance/widgets.h: QSettings settings("QtProject", "lance"); tests/manual/lance/widgets.h: QSettings settings("QtProject", "lance");
So it looks like the pattern is still that all common Qt settings go into QSettings(QSettings::UserScope, u"QtProject"_s) but tests and examples use other application names. But this is one exception; is there any particular reason? Maybe this state is considered too ephemeral to save in the same config file with the other stuff? (But if it's so ephemeral, why not use a tmp file?)
The docs don't specifically mention that it saves any settings either, BTW.
(BTW this conf file is what became of Trolltech.conf, as it turns out: for example here https://codereview.qt-project.org/c/qt/qtbase/+/9575 is one of the patches that moved it, and this code is still in place in QPlatformDialogHelpers. I followed the pattern in https://codereview.qt-project.org/c/qt/qtbase/+/110659 and that is also still in place.)