ctkQtResourcesTreeModel.h 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. /*=============================================================================
  2. Library: CTK
  3. Copyright (c) 2010 German Cancer Research Center,
  4. Division of Medical and Biological Informatics
  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 CTKQTRESOURCESTREEMODEL_H
  16. #define CTKQTRESOURCESTREEMODEL_H
  17. #include <QAbstractItemModel>
  18. #include <QDir>
  19. class ctkQtResourceTreeItem;
  20. class ctkQtResourcesTreeModel : public QAbstractItemModel
  21. {
  22. public:
  23. ctkQtResourcesTreeModel(QObject* parent = 0);
  24. ~ctkQtResourcesTreeModel();
  25. QVariant data(const QModelIndex &index, int role) const;
  26. Qt::ItemFlags flags(const QModelIndex &index) const;
  27. QVariant headerData(int section, Qt::Orientation orientation,
  28. int role = Qt::DisplayRole) const;
  29. QModelIndex index(int row, int column,
  30. const QModelIndex &parent = QModelIndex()) const;
  31. QModelIndex parent(const QModelIndex &index) const;
  32. int rowCount(const QModelIndex &parent = QModelIndex()) const;
  33. int columnCount(const QModelIndex &parent = QModelIndex()) const;
  34. private:
  35. ctkQtResourceTreeItem* rootItem;
  36. };
  37. #endif // CTKQTRESOURCESTREEMODEL_H