CoordinateSystemToolbarSection.h 970 B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  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 <QObject>
  11. #endif
  12. class EditorWindow;
  13. class QComboBox;
  14. class QCheckBox;
  15. class QToolBar;
  16. class CoordinateSystemToolbarSection
  17. : public QObject
  18. {
  19. Q_OBJECT
  20. public:
  21. explicit CoordinateSystemToolbarSection(QToolBar* parent, bool addSeparator);
  22. void SetIsEnabled(bool enabled);
  23. void SetCurrentIndex(int index);
  24. void SetSnapToGridIsChecked(bool checked);
  25. private slots:
  26. //! Triggered by keyboard shortcuts.
  27. //@{
  28. void HandleCoordinateSystemCycle();
  29. void HandleSnapToGridToggle();
  30. //@}
  31. private:
  32. int CycleSelectedItem();
  33. void UpdateCanvasSnapEnabled();
  34. EditorWindow* m_editorWindow;
  35. QComboBox* m_combobox;
  36. QCheckBox* m_snapCheckbox;
  37. };