UndoDropDown.h 818 B

12345678910111213141516171819202122232425262728293031323334353637
  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 "Undo/IUndoManagerListener.h"
  11. #endif
  12. /// Turns IUndoManagerListener callbacks into signals
  13. class UndoStackStateAdapter
  14. : public QObject
  15. , IUndoManagerListener
  16. {
  17. Q_OBJECT
  18. public:
  19. explicit UndoStackStateAdapter(QObject* parent = nullptr);
  20. ~UndoStackStateAdapter();
  21. void SignalNumUndoRedo(const unsigned int& numUndo, const unsigned int& numRedo)
  22. {
  23. emit UndoAvailable(numUndo);
  24. emit RedoAvailable(numRedo);
  25. }
  26. signals:
  27. void UndoAvailable(quint32 count);
  28. void RedoAvailable(quint32 count);
  29. };