21 #ifndef PREFERENCEWIDGETINTERFACE_H 22 #define PREFERENCEWIDGETINTERFACE_H 24 #include "Gui/Utils/GuiClass.h" 25 #include "Gui/Utils/Widgets/Widget.h" 26 #include "Utils/Pimpl.h" 52 virtual ~
Base()
override;
61 void setInitialized();
65 template<
typename W,
typename UiClass>
74 (*ui)->setupUi(widget);
78 widget->languageChanged();
114 void closeEvent(QCloseEvent* e) override;
129 virtual QAction*
action() final;
182 #endif // PREFERENCEWIDGETINTERFACE_H virtual bool commit()=0
This method is called, when OK or apply is pressed. So all settings should be written there.
Base(const QString &identifier)
Standard constructor.
virtual void revert()=0
This method is called, when cancel is clicked. So the gui should be re-initialized when this method i...
QString identifier() const
return the unique identifier
virtual bool isUiInitialized() const final
checks if ui has already been initialized.
virtual void initUi()=0
call setup_parent(this) here. initialize compoenents and connections here. After calling setup_parent...
void translationAction()
Sets the new translated action name.
virtual void languageChanged() override final
automatically called when language has changed. When overriding this method. Overriding this method s...
virtual QString actionName() const =0
has to be implemented and should return the translated action text
virtual QString errorString() const
A closer description of the error.
void showEvent(QShowEvent *e) override
shows the widget and automatically calls init_ui()
virtual void retranslate()=0
call the Qt retranslateUi method here
virtual bool hasError() const
indicates if there was an error on the settings page like an invalid expression or combination of set...
Abstract Interface you should use when creating a preferences item.
Definition: PreferenceWidget.h:40
virtual QAction * action() final
get action with translated text
void setupParent(W *widget, UiClass **ui)
Sets up the Preference dialog. After this method, the dialog is "ready to use" This method should be ...
Definition: PreferenceWidget.h:71