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 explicit Base(
const QString& identifier);
55 QString identifier()
const;
58 void set_initialized();
62 template<
typename W,
typename UiClass>
71 (*ui)->setupUi(widget);
75 widget->language_changed();
124 virtual QAction*
action() final;
162 virtual
bool has_error() const;
163 virtual QString error_string() const;
168 #endif // PREFERENCEWIDGETINTERFACE_H virtual bool commit()=0
This method is called, when OK or apply is pressed. So all settings should be written there...
virtual QString action_name() const =0
has to be implemented and should return the translated action text
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...
virtual bool is_ui_initialized() const final
checks if ui has already been initialized.
virtual void language_changed() override final
automatically called when language has changed. When overriding this method. Overriding this method s...
Definition: GUI_PreferenceDialog.h:28
void showEvent(QShowEvent *e) override
shows the widget and automatically calls init_ui()
virtual void retranslate_ui()=0
call the Qt retranslateUi method here
void translate_action()
Sets the new translated action name.
Abstract Interface you should use when creating a preferences item.
Definition: PreferenceWidget.h:41
void setup_parent(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:68
virtual QAction * action() final
get action with translated text
virtual void init_ui()=0
call setup_parent(this) here. initialize compoenents and connections here. After calling setup_parent...