- virtual bool aboutToSave();
-
- public slots:
- virtual void save() = 0;
- virtual void load() = 0;
- virtual void defaults() = 0;
-
- protected slots:
- //! Calling this slot is equivalent to calling changeState(true).
- void changed();
-
- protected:
- //! This should be called whenever the widget state changes from unchanged to change or the other way round.
- void changeState(bool hasChanged = true);
-
- signals:
- //! Emitted whenever the widget state changes.
- void changed(bool hasChanged);
+ inline virtual bool hasDefaults() const { return false; }
+
+ //! Check if there are changes in the page, compared to the state saved in permanent storage.
+ inline bool hasChanged() const { return _changed; }
+
+ //! Called immediately before save() is called.
+ /** Derived classes should return false if saving is not possible (e.g. the current settings are invalid).
+ * \return false, if the SettingsPage cannot be saved in its current state.
+ */
+ inline virtual bool aboutToSave() { return true; }
+
+public slots:
+ //! Save settings to permanent storage.
+ virtual void save() = 0;
+
+ //! Load settings from permanent storage, overriding any changes the user might have made in the dialog.
+ virtual void load() = 0;