Keeps the application up-to-date with changes in the settings file.
More...
#include <ApplicationSettings.h>
|
| ApplicationSettings (QObject *parent=nullptr) |
| Constructor.
|
|
| ~ApplicationSettings () override |
| Destructor.
|
|
void | setFilepath (const QString &filepath, bool watch=false) |
| Sets the fileInfo using the filepath.
|
|
QSettings | getSettings () const |
| Gets a QSettings instance using the set file path.
|
|
const QFileInfo & | fileInfo () const |
| Gets the fileInfo.
|
|
void | restoreWindowRect (const QString &win_name, QWidget *window) const |
| Sets the window position and size from the settings file onto the passed widget.
|
|
void | saveWindowRect (const QString &win_name, QWidget *window) const |
| Sets the window position and size from the settings file onto the passed widget.
|
|
void | restoreTreeViewColumns (const QString &name, const QTreeView *tv) const |
| Restores column widths of a QTreeView,.
|
|
void | saveTreeViewColumns (const QString &name, const QTreeView *tv) const |
| Saves column widths of a QTreeView,.
|
|
Keeps the application up-to-date with changes in the settings file.
Sets the styling and the color from an ini file. Used to quickly create test applications.
◆ ApplicationSettings()
sf::ApplicationSettings::ApplicationSettings |
( |
QObject * |
parent = nullptr | ) |
|
|
explicit |
◆ ~ApplicationSettings()
sf::ApplicationSettings::~ApplicationSettings |
( |
| ) |
|
|
override |
◆ fileInfo()
const QFileInfo & sf::ApplicationSettings::fileInfo |
( |
| ) |
const |
◆ getSettings()
QSettings sf::ApplicationSettings::getSettings |
( |
| ) |
const |
Gets a QSettings instance using the set file path.
◆ global()
Gets the application settings reference to the global app settings when created.
- Exceptions
-
std::runtime_error | When the global instance does not exist. |
◆ restoreTreeViewColumns()
void sf::ApplicationSettings::restoreTreeViewColumns |
( |
const QString & |
name, |
|
|
const QTreeView * |
tv |
|
) |
| const |
Restores column widths of a QTreeView,.
- Parameters
-
name | Name of the treeview. |
tv | Pointer to the tree view. |
◆ restoreWindowRect()
void sf::ApplicationSettings::restoreWindowRect |
( |
const QString & |
win_name, |
|
|
QWidget * |
window |
|
) |
| const |
Sets the window position and size from the settings file onto the passed widget.
- Parameters
-
win_name | Name of the window. |
window | Window widget. |
◆ saveTreeViewColumns()
void sf::ApplicationSettings::saveTreeViewColumns |
( |
const QString & |
name, |
|
|
const QTreeView * |
tv |
|
) |
| const |
Saves column widths of a QTreeView,.
- Parameters
-
name | Name of the treeview. |
tv | Pointer to the tree view. |
◆ saveWindowRect()
void sf::ApplicationSettings::saveWindowRect |
( |
const QString & |
win_name, |
|
|
QWidget * |
window |
|
) |
| const |
Sets the window position and size from the settings file onto the passed widget.
- Parameters
-
win_name | Name of the window. |
window | Window widget. |
◆ setFilepath()
void sf::ApplicationSettings::setFilepath |
( |
const QString & |
filepath, |
|
|
bool |
watch = false |
|
) |
| |
Sets the fileInfo using the filepath.
- Parameters
-
filepath | Path to the ini-file. |
watch | Tell it to be watched for external changes. |
The documentation for this class was generated from the following file: