AnchorPresetsWidget.h 759 B

123456789101112131415161718192021222324252627282930313233343536373839
  1. /*
  2. * Copyright (c) Contributors to the Open 3D Engine Project.
  3. * For complete copyright and license terms please see the LICENSE at the root of this distribution.
  4. *
  5. * SPDX-License-Identifier: Apache-2.0 OR MIT
  6. *
  7. */
  8. #pragma once
  9. #if !defined(Q_MOC_RUN)
  10. #include <QWidget>
  11. #endif
  12. class PresetButton;
  13. class AnchorPresetsWidget
  14. : public QWidget
  15. {
  16. Q_OBJECT
  17. public:
  18. using PresetChanger = std::function<void(int presetIndex)>;
  19. AnchorPresetsWidget(int defaultPresetIndex,
  20. PresetChanger presetChanger,
  21. QWidget* parent = nullptr);
  22. void SetPresetSelection(int presetIndex);
  23. void SetPresetButtonEnabledAt(int presetIndex, bool enabled);
  24. private:
  25. int m_presetIndex;
  26. std::vector<PresetButton*> m_buttons;
  27. };