6#include <QtCore/qdebug.h>
7#include <QtCore/qdir.h>
8#include <QtCore/qfileinfo.h>
9#include <QtCore/qset.h>
10#if QT_CONFIG(settings)
11#include <QtCore/qsettings.h>
13#include <QtCore/qstandardpaths.h>
20 m_values[
name] = defaultValue;
24bool QQmlToolingSettings::read(
const QString &settingsFilePath)
26#if QT_CONFIG(settings)
30 if (m_currentSettingsPath == settingsFilePath)
38 m_currentSettingsPath = settingsFilePath;
49#if QT_CONFIG(settings)
60 qWarning() <<
"Failed to write default settings to" <<
path
65 qInfo() <<
"Wrote default settings to" <<
path;
74#if QT_CONFIG(settings)
80 const QString settingsFileName = u
".%1.ini"_s.
arg(m_toolName);
82 while (
dir.exists() &&
dir.isReadable()) {
85 if (m_seenDirectories.
contains(dirPath)) {
86 const QString cachedIniPath = m_seenDirectories[dirPath];
87 if (cachedIniPath.isEmpty())
90 return read(cachedIniPath);
95 const QString iniFile =
dir.absoluteFilePath(settingsFileName);
99 m_seenDirectories[
dir] = iniFile;
108 !iniFile.isEmpty()) {
110 for (
const QString &
dir : std::as_const(dirs))
111 m_seenDirectories[
dir] = iniFile;
118 for (
const QString &
dir : std::as_const(dirs))
QString absoluteFilePath() const
bool isDir() const
Returns true if this object points to a directory or to a symbolic link to a directory.
QDir dir() const
Returns a QDir object representing the path of the parent directory of the file system entry that thi...
bool exists() const
Returns true if the file system entry this QFileInfo refers to 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
bool isEmpty() const noexcept
Returns true if the string has no characters; otherwise returns false.
QString arg(qlonglong a, int fieldwidth=0, int base=10, QChar fillChar=u' ') const
bool isValid() const
Returns true if the storage type of this variant is not QMetaType::UnknownType; otherwise returns fal...
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]