Scanframe Modular Application 0.1.0
Loading...
Searching...
No Matches
ModuleConfiguration.h
Go to the documentation of this file.
1#pragma once
2#include <QDialog>
3#include <QSettings>
4#include <QWidget>
5#include <misc/global.h>
6
7namespace sf
8{
9
10class _MISC_CLASS ModuleConfiguration final : public QObject
11{
12 Q_OBJECT
13
14 public:
18 // ReSharper disable once CppFunctionIsNotImplemented
19 Q_SIGNAL void libraryLoaded(bool startup);
20
26 explicit ModuleConfiguration(QSettings* settings, QObject* parent = nullptr);
27
32
37 void openDialog(QWidget* parent = nullptr);
38
44 typedef QMap<QString, QString> ModuleListType;
45
50 [[nodiscard]] ModuleListType getList() const;
51
56 size_t load(bool startup);
57
61 void save(const ModuleListType& list);
62
66 QString getModuleDir();
67
71 [[nodiscard]] inline QSettings* getSettings();
72
73 private:
77 QDialog* _dialog;
81 QSettings* _settings;
82};
83
85{
86 return _settings;
87}
88
89}// namespace sf
Definition ModuleConfiguration.h:11
QMap< QString, QString > ModuleListType
Mapped array for passing module library files. The key is the (relative) path to the dynamic library ...
Definition ModuleConfiguration.h:44
ModuleConfiguration(QSettings *settings, QObject *parent=nullptr)
Constructor.
QSettings * getSettings()
Gets the module library directory.
Definition ModuleConfiguration.h:84
void save(const ModuleListType &list)
Saves the module configuration to the settings.
size_t load(bool startup)
Loads the module configuration from the settings.
QString getModuleDir()
Gets the module library directory.
Q_SIGNAL void libraryLoaded(bool startup)
Signal emitted when library is loaded.
ModuleListType getList() const
Gets the configured modules in a list.
~ModuleConfiguration() override
Virtual Destructor.
void openDialog(QWidget *parent=nullptr)
Opens a dialog for module configuration.
#define _MISC_CLASS
Definition misc/global.h:40
Definition Application.h:10