EditorPreferencesTreeWidgetItem.h 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  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 <QTreeWidgetItem>
  10. #include <QPixmap>
  11. struct IPreferencesPage;
  12. namespace AzToolsFramework
  13. {
  14. class ReflectedPropertyEditor;
  15. }
  16. class EditorPreferencesTreeWidgetItem
  17. : public QTreeWidgetItem
  18. {
  19. public:
  20. enum CustomType
  21. {
  22. EditorPreferencesPage = QTreeWidgetItem::UserType
  23. };
  24. EditorPreferencesTreeWidgetItem(IPreferencesPage* page, const QPixmap& selectedImage, QPixmap& unselectedImage);
  25. EditorPreferencesTreeWidgetItem(IPreferencesPage* page, const QIcon& icon);
  26. ~EditorPreferencesTreeWidgetItem();
  27. void Filter(const QString& filter);
  28. void UpdateEditorFilter(AzToolsFramework::ReflectedPropertyEditor* editor, const QString& filter);
  29. IPreferencesPage* GetPreferencesPage() const;
  30. private:
  31. void Setup(IPreferencesPage* page);
  32. IPreferencesPage* m_preferencesPage;
  33. QPixmap m_selectedImage;
  34. QPixmap m_unselectedImage;
  35. QStringList m_propertyNames;
  36. bool m_entirePageMatchesFilter;
  37. };