QAudioControlTreeWidget.h 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  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 <ACETypes.h>
  10. #include <ATLControlsModel.h>
  11. #include <QTreeWidget>
  12. #include <QTreeView>
  13. #include <QDropEvent>
  14. #include <QStandardItem>
  15. #include <QMimeData>
  16. #include <QSortFilterProxyModel>
  17. namespace AudioControls
  18. {
  19. class CATLControl;
  20. class CATLControlsModel;
  21. }
  22. //-----------------------------------------------------------------------------------------------//
  23. class QFolderItem
  24. : public QStandardItem
  25. {
  26. public:
  27. explicit QFolderItem(const QString& sName);
  28. };
  29. //-----------------------------------------------------------------------------------------------//
  30. class QAudioControlItem
  31. : public QStandardItem
  32. {
  33. public:
  34. QAudioControlItem(const QString& sName, AudioControls::CATLControl* pControl);
  35. };
  36. //-----------------------------------------------------------------------------------------------//
  37. class QAudioControlSortProxy
  38. : public QSortFilterProxyModel
  39. {
  40. public:
  41. explicit QAudioControlSortProxy(QObject* pParent = 0);
  42. bool setData(const QModelIndex& index, const QVariant& value, int role /* = Qt::EditRole */) override;
  43. QStandardItem* GetStandardItemFromIndex(const QModelIndex& index);
  44. protected:
  45. bool lessThan(const QModelIndex& left, const QModelIndex& right) const override;
  46. };
  47. //-----------------------------------------------------------------------------------------------//
  48. class QAudioControlsTreeView
  49. : public QTreeView
  50. {
  51. public:
  52. explicit QAudioControlsTreeView(QWidget* pParent = 0);
  53. void scrollTo(const QModelIndex& index, ScrollHint hint = QAbstractItemView::EnsureVisible) override;
  54. bool IsEditing();
  55. };