BibleTime
categoryitem.h
Go to the documentation of this file.
1 /*********
2 *
3 * In the name of the Father, and of the Son, and of the Holy Spirit.
4 *
5 * This file is part of BibleTime's source code, https://bibletime.info/
6 *
7 * Copyright 1999-2021 by the BibleTime developers.
8 * The BibleTime source code is licensed under the GNU General Public License
9 * version 2.0.
10 *
11 **********/
12 
13 #pragma once
14 
15 #include "item.h"
16 
17 #include <Qt>
18 #include <QVariant>
19 #include "../drivers/cswordmoduleinfo.h"
20 
21 
22 namespace BookshelfModel {
23 
24 class CategoryItem: public GroupItem<Item::ITEM_CATEGORY> {
25 
26 public: // methods:
27 
29  : m_category(module.category()) {}
30 
32 
33  QVariant data(int role = Qt::DisplayRole) const override;
34 
35  bool fitFor(CSwordModuleInfo const & module) const override
36  { return module.category() == m_category; }
37 
38  bool operator<(const Item & other) const override;
39 
40 private: // fields:
41 
43 
44 };
45 
46 } // namespace BookshelfModel
CSwordModuleInfo::Category const m_category
Definition: categoryitem.h:42
bool fitFor(CSwordModuleInfo const &module) const override
Returns whether this item is fit to contain the given module.
Definition: categoryitem.h:35
CategoryItem(CSwordModuleInfo const &module)
Definition: categoryitem.h:28
bool operator<(const Item &other) const override
Comparsion operator used sorting child items.
CSwordModuleInfo::Category category() const
Definition: categoryitem.h:31
QVariant data(int role=Qt::DisplayRole) const override
Returns data for this item.
CSwordModuleInfo::Category category() const