CommandCanvasSizeToolbarIndex.h 920 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  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. #include <QUndoCommand>
  10. class CommandCanvasSizeToolbarIndex
  11. : public QUndoCommand
  12. {
  13. public:
  14. void undo() override;
  15. void redo() override;
  16. int id() const override;
  17. bool mergeWith(const QUndoCommand* other) override;
  18. static void Push(UndoStack* stack,
  19. CanvasSizeToolbarSection* canvasSizeToolbar,
  20. int from,
  21. int to);
  22. private:
  23. CommandCanvasSizeToolbarIndex(UndoStack* stack,
  24. CanvasSizeToolbarSection* canvasSizeToolbar,
  25. int from,
  26. int to);
  27. void UpdateText();
  28. void SetIndex(int index) const;
  29. UndoStack* m_stack;
  30. CanvasSizeToolbarSection* m_canvasSizeToolbar;
  31. int m_from;
  32. int m_to;
  33. };