ctkXnatTreeItem_p.h 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. /*=============================================================================
  2. Library: XNAT/Core
  3. Copyright (c) University College London,
  4. Centre for Medical Image Computing
  5. Licensed under the Apache License, Version 2.0 (the "License");
  6. you may not use this file except in compliance with the License.
  7. You may obtain a copy of the License at
  8. http://www.apache.org/licenses/LICENSE-2.0
  9. Unless required by applicable law or agreed to in writing, software
  10. distributed under the License is distributed on an "AS IS" BASIS,
  11. WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  12. See the License for the specific language governing permissions and
  13. limitations under the License.
  14. =============================================================================*/
  15. #ifndef ctkXnatTreeItem_h
  16. #define ctkXnatTreeItem_h
  17. #include "ctkXnatObject.h"
  18. #include <QList>
  19. #include <QVariant>
  20. class ctkXnatTreeItem
  21. {
  22. public:
  23. explicit ctkXnatTreeItem();
  24. explicit ctkXnatTreeItem(ctkXnatObject* xnatObject, ctkXnatTreeItem* parentItem = 0);
  25. virtual ~ctkXnatTreeItem();
  26. ctkXnatObject* xnatObject() const;
  27. void appendChild(ctkXnatTreeItem* child);
  28. void removeChildren();
  29. ctkXnatTreeItem* child(int row);
  30. int childCount() const;
  31. int columnCount() const;
  32. QVariant data(int column) const;
  33. int row() const;
  34. ctkXnatTreeItem* parent();
  35. void remove(const ctkXnatObject* xnatObject);
  36. private:
  37. ctkXnatObject* m_XnatObject;
  38. ctkXnatTreeItem* m_ParentItem;
  39. QList<ctkXnatTreeItem*> m_ChildItems;
  40. };
  41. #endif