BibleTime
moduleitem.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 
20 
22 class CSwordModuleInfo;
23 
24 namespace BookshelfModel {
25 
26 class ModuleItem: public Item {
27 
28 public: // methods:
29 
31  BtBookshelfTreeModel & parentModel)
32  : Item(ITEM_MODULE)
33  , m_moduleInfo(module)
34  , m_parentModel(parentModel) {}
35 
36  /**
37  Reimplementation of Item::data() which dispatches all
38  requests to the parent model (BtBookshelfTreeModel).
39  */
40  QVariant data(int role = Qt::DisplayRole) const override;
41 
43 
44  bool fitFor(CSwordModuleInfo const &) const override { return false; }
45 
46 private: // fields:
47 
50 
51 };
52 
53 } // namespace BookshelfModel
CSwordModuleInfo & m_moduleInfo
Definition: moduleitem.h:48
ModuleItem(CSwordModuleInfo &module, BtBookshelfTreeModel &parentModel)
Definition: moduleitem.h:30
QVariant data(int role=Qt::DisplayRole) const override
Definition: moduleitem.cpp:20
bool fitFor(CSwordModuleInfo const &) const override
Returns whether this item is fit to contain the given module.
Definition: moduleitem.h:44
CSwordModuleInfo & moduleInfo() const
Definition: moduleitem.h:42
BtBookshelfTreeModel & m_parentModel
Definition: moduleitem.h:49