SettingDialog.h 753 B

1234567891011121314151617181920212223242526272829303132333435363738
  1. #pragma once
  2. #include <QDialog>
  3. #include <QSettings>
  4. #include "ui_SettingDialog.h"
  5. #include <QAbstractButton>
  6. /**
  7. * A dialog to change the Setting for the main program.
  8. */
  9. class SettingDialog : public QDialog
  10. {
  11. Q_OBJECT
  12. public:
  13. SettingDialog(QSettings* settings, QWidget *parent = Q_NULLPTR);
  14. ~SettingDialog();
  15. private:
  16. Ui::SettingDialog ui;
  17. QSettings* settings;
  18. /**
  19. * Apply the settings and close the SettingDialog afterwords.
  20. */
  21. void acceptButtonClicked();
  22. /**
  23. * Save the changes from the dialog to the actual settings.
  24. */
  25. void apply();
  26. public slots:
  27. /**
  28. * Handle the button clicked in the SettingDialog.
  29. * @param button the Button returned from the Signal.
  30. */
  31. void dialogButtonHandler(QAbstractButton* button);
  32. };