30 lines
576 B
C++
30 lines
576 B
C++
#pragma once
|
|
|
|
#include <QSettings>
|
|
#include <QString>
|
|
|
|
class AppSettings
|
|
{
|
|
public:
|
|
static AppSettings& instance();
|
|
|
|
// 数据路径
|
|
QString dataFolder() const;
|
|
void setDataFolder(const QString& path);
|
|
|
|
QString fileName() const;
|
|
void setFileName(const QString& path);
|
|
// 在此处添加更多参数的 getter/setter ...
|
|
|
|
private:
|
|
AppSettings();
|
|
AppSettings(const AppSettings&) = delete;
|
|
AppSettings& operator=(const AppSettings&) = delete;
|
|
|
|
QSettings m_settings;
|
|
|
|
// 默认值
|
|
static const QString kDefaultDataFolder;
|
|
static const QString kDefaultFileName;
|
|
};
|