8#include <QtCore/qdebug.h>
9#include <QtCore/qdir.h>
10#include <QtCore/qfileinfo.h>
11#include <QtCore/qset.h>
12#if QT_CONFIG(settings)
13#include <QtCore/qsettings.h>
15#include <QtCore/qstandardpaths.h>
21 m_values[
name] = defaultValue;
24bool QQmlToolingSettings::read(
const QString &settingsFilePath)
26#if QT_CONFIG(settings)
30 if (m_currentSettingsPath == settingsFilePath)
38 m_currentSettingsPath = settingsFilePath;
48#if QT_CONFIG(settings)
59 qWarning() <<
"Failed to write default settings to" <<
path
64 qInfo() <<
"Wrote default settings to" <<
path;
73#if QT_CONFIG(settings)
79 const QString settingsFileName = u
".%1.ini"_s.
arg(m_toolName);
81 while (
dir.exists() &&
dir.isReadable()) {
84 if (m_seenDirectories.
contains(dirPath)) {
85 const QString cachedIniPath = m_seenDirectories[dirPath];
89 return read(cachedIniPath);
94 const QString iniFile =
dir.absoluteFilePath(settingsFileName);
98 m_seenDirectories[
dir] = iniFile;
109 for (
const QString &
dir : std::as_const(dirs))
110 m_seenDirectories[
dir] = iniFile;
117 for (
const QString &
dir : std::as_const(dirs))
\inmodule QtCore \reentrant
QString absoluteFilePath() const
Returns an absolute path including the file name.
bool isDir() const
Returns true if this object points to a directory or to a symbolic link to a directory.
QDir dir() const
Returns the path of the object's parent directory as a QDir object.
bool exists() const
Returns true if the file exists; otherwise returns false.
const_iterator constEnd() const noexcept
Returns a const \l{STL-style iterators}{STL-style iterator} pointing to the imaginary item after the ...
const_iterator constBegin() const noexcept
Returns a const \l{STL-style iterators}{STL-style iterator} pointing to the first item in the hash.
bool contains(const Key &key) const noexcept
Returns true if the hash contains an item with the key; otherwise returns false.
T value(const Key &key) const noexcept
void setValue(QAnyStringView key, const QVariant &value)
Sets the value of setting key to value.
void sync()
Writes any unsaved changes to permanent storage, and reloads any settings that have been changed in t...
Status status() const
Returns a status code indicating the first error that was met by QSettings, or QSettings::NoError if ...
static QString locate(StandardLocation type, const QString &fileName, LocateOptions options=LocateFile)
\macro QT_RESTRICTED_CAST_FROM_ASCII
QString arg(qlonglong a, int fieldwidth=0, int base=10, QChar fillChar=u' ') const
bool isEmpty() const
Returns true if the string has no characters; otherwise returns false.
QString toString() const
Returns the variant as a QString if the variant has a userType() including, but not limited to:
bool canConvert(QMetaType targetType) const
QSet< QString >::iterator it
EGLOutputLayerEXT EGLint EGLAttrib value
[5]
GLsizei const GLchar *const * path
static void allKeys(HKEY parentHandle, const QString &rSubKey, NameSet *result, REGSAM access=0)
QSettings settings("MySoft", "Star Runner")
[0]
char * toString(const MyType &t)
[31]