BibleTime
Public Member Functions | Private Attributes | List of all members
BookshelfModel::CategoryItem Class Reference

#include <categoryitem.h>

Inheritance diagram for BookshelfModel::CategoryItem:

Public Member Functions

CSwordModuleInfo::Category category () const
 
 CategoryItem (CSwordModuleInfo const &module)
 
QVariant data (int role=Qt::DisplayRole) const override
 Returns data for this item. More...
 
bool fitFor (CSwordModuleInfo const &module) const override
 Returns whether this item is fit to contain the given module. More...
 
bool operator< (const Item &other) const override
 Comparsion operator used sorting child items. More...
 
- Public Member Functions inherited from BookshelfModel::GroupItem< Item::ITEM_CATEGORY >
 GroupItem ()
 
- Public Member Functions inherited from BookshelfModel::Item
Qt::CheckState checkState () const
 Returns the check state of this item. More...
 
int childIndex () const
 Returns the index of this item under its parent. More...
 
QList< Item * > & children ()
 Returns the list of child items of this node. More...
 
template<class T >
TgetGroupItem (CSwordModuleInfo &module, int &outIndex)
 
int indexFor (Item const &newItem)
 Returns the position for where the given child item would be inserted. More...
 
void insertChild (int index, Item *newItem)
 Inserts the given item as a child at the given index. More...
 
 Item (Type type)
 
Itemparent () const
 Returns a pointer to the parent item of this item. More...
 
void setCheckState (const Qt::CheckState state)
 Sets the check state of this item. More...
 
Type type () const
 Returns the type of this item. More...
 
virtual ~Item ()
 

Private Attributes

CSwordModuleInfo::Category const m_category
 

Additional Inherited Members

- Public Types inherited from BookshelfModel::Item
enum  Type {
  ITEM_ROOT = 0 , ITEM_CATEGORY = 1 , ITEM_LANGUAGE = 2 , ITEM_MODULE = 3 ,
  ITEM_INDEXING = 4
}
 
- Static Public Member Functions inherited from BookshelfModel::GroupItem< Item::ITEM_CATEGORY >
static Item::Type staticItemType ()
 

Detailed Description

Definition at line 24 of file categoryitem.h.

Constructor & Destructor Documentation

◆ CategoryItem()

BookshelfModel::CategoryItem::CategoryItem ( CSwordModuleInfo const &  module)
inline

Definition at line 28 of file categoryitem.h.

Member Function Documentation

◆ category()

CSwordModuleInfo::Category BookshelfModel::CategoryItem::category ( ) const
inline

Definition at line 31 of file categoryitem.h.

References m_category.

◆ data()

QVariant BookshelfModel::CategoryItem::data ( int  role = Qt::DisplayRole) const
overridevirtual

Returns data for this item.

Reimplemented from BookshelfModel::Item.

Definition at line 22 of file categoryitem.cpp.

References CSwordModuleInfo::categoryIcon(), CSwordModuleInfo::categoryName(), BookshelfModel::Item::data(), and m_category.

◆ fitFor()

bool BookshelfModel::CategoryItem::fitFor ( CSwordModuleInfo const &  module) const
inlineoverridevirtual

Returns whether this item is fit to contain the given module.

Parameters
[in]moduleThe module to check with.
Return values
trueIf this item is a group and can contain the given module.
falseThis item is not a group or is a wrong group.

Implements BookshelfModel::Item.

Definition at line 35 of file categoryitem.h.

References CSwordModuleInfo::category(), and m_category.

◆ operator<()

bool BookshelfModel::CategoryItem::operator< ( const Item other) const
overridevirtual

Comparsion operator used sorting child items.

Reimplemented from BookshelfModel::Item.

Definition at line 37 of file categoryitem.cpp.

References BookshelfModel::Item::ITEM_CATEGORY, m_category, BookshelfModel::Item::type(), and CSwordModuleInfo::UnknownCategory.

Member Data Documentation

◆ m_category

CSwordModuleInfo::Category const BookshelfModel::CategoryItem::m_category
private

Definition at line 42 of file categoryitem.h.

Referenced by category(), data(), fitFor(), and operator<().


The documentation for this class was generated from the following files: