chore: add getOrRegisterSetting function

Signed-off-by: Trial97 <alexandru.tripon97@gmail.com>
This commit is contained in:
Trial97
2025-04-10 22:49:29 +03:00
parent 564f120c22
commit 5af06dec85
9 changed files with 23 additions and 28 deletions

View File

@ -103,6 +103,16 @@ class SettingsObject : public QObject {
*/
std::shared_ptr<Setting> getSetting(const QString& id) const;
/*!
* \brief Gets the setting with the given ID.
* \brief if is not registered yet it does that
* \param id The ID of the setting to get.
* \return A pointer to the setting with the given ID.
* Returns null if there is no setting with the given ID.
* \sa operator []()
*/
std::shared_ptr<Setting> getOrRegisterSetting(const QString& id, QVariant defVal = QVariant());
/*!
* \brief Gets the value of the setting with the given ID.
* \param id The ID of the setting to get.