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;
Abstract Interface you should use when creating a preferences item.
Definition: PreferenceWidget.h:42
virtual QAction * action() final
get action with translated text
QString identifier() const
return the unique identifier
virtual void revert()=0
This method is called, when cancel is clicked. So the gui should be re-initialized when this method i...
void translationAction()
Sets the new translated action name.
Base(const QString &identifier)
Standard constructor.
virtual void initUi()=0
call setup_parent(this) here. initialize compoenents and connections here. After calling setup_parent...
virtual bool hasError() const
indicates if there was an error on the settings page like an invalid expression or combination of set...
virtual bool isUiInitialized() const final
checks if ui has already been initialized.
virtual void languageChanged() override final
automatically called when language has changed. When overriding this method. Overriding this method s...
virtual QString errorString() const
A closer description of the error.
virtual QString actionName() const =0
has to be implemented and should return the translated action 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
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 commit()=0
This method is called, when OK or apply is pressed. So all settings should be written there.