Scanframe Modular Application 0.1.0
Loading...
Searching...
No Matches
ApplicationSettings.h
Go to the documentation of this file.
1#pragma once
2#include "qt_utils.h"
3#include <QFileInfo>
4#include <QFileSystemWatcher>
5#include <QSettings>
6#include <QTreeView>
7
8namespace sf
9{
10
17class _MISC_CLASS ApplicationSettings final : public QObject
18{
19 Q_OBJECT
20
21 public:
25 explicit ApplicationSettings(QObject* parent = nullptr);
26
31
37 void setFilepath(const QString& filepath, bool watch = false);
38
45 QSettings* getNewSettings(QObject* parent = nullptr) const;
46
50 QSettings getSettings(QObject* parent = nullptr) const;
51
55 [[nodiscard]] const QFileInfo& fileInfo() const;
56
60 const QIcon& getIcon() const;
61
67
68 private Q_SLOTS:
72 void onFileChance(const QString& file);
73
74 private:
75 struct Private;
76 Private* _p;
77};
78
79}// namespace sf
Keeps the application up-to-date with changes in the settings file.
Definition ApplicationSettings.h:18
QSettings getSettings(QObject *parent=nullptr) const
Gets a QSettings instance using the set file path.
const QIcon & getIcon() const
Gets the application icon.
~ApplicationSettings() override
Destructor.
void setFilepath(const QString &filepath, bool watch=false)
Sets the fileInfo using the filepath.
QSettings * getNewSettings(QObject *parent=nullptr) const
Gets a new QSettings instance using the set file path. The when no parent is given the object should ...
static ApplicationSettings & global()
Gets the application settings reference to the global app settings when created.
const QFileInfo & fileInfo() const
Gets the fileInfo on the set file path.
ApplicationSettings(QObject *parent=nullptr)
Qt Constructor.
#define _MISC_CLASS
Definition misc/global.h:40
Definition Application.h:10