BibleTime
|
Model that represents the entire text of a given module. More...
#include <btmoduletextmodel.h>
Public Member Functions | |
BtModuleTextModel (QObject *parent=nullptr) | |
int | columnCount (const QModelIndex &parent=QModelIndex()) const override |
QVariant | data (const QModelIndex &index, int role=Qt::DisplayRole) const override |
int | firstEntryIndex () const noexcept |
CSwordKey * | indexToKey (int index, int moduleNum) const |
QString | indexToKeyName (int index) const |
int | indexToVerse (int index) const |
CSwordVerseKey | indexToVerseKey (int index) const |
CSwordVerseKey | indexToVerseKey (int index, CSwordModuleInfo const &module) const |
int | keyToIndex (CSwordKey const &key) const |
void | reloadModules () |
QHash< int, QByteArray > | roleNames () const override |
int | rowCount (const QModelIndex &parent=QModelIndex()) const override |
virtual bool | setData (const QModelIndex &index, const QVariant &value, int role=Qt::EditRole) override |
void | setFindState (std::optional< FindState > findState) |
void | setHighlightWords (const QString &highlightWords, bool caseSensitive) |
void | setModules (const QStringList &modules) |
void | setOptions (DisplayOptions const &displayOptions, FilterOptions const &filterOptions) |
int | verseKeyToIndex (const CSwordVerseKey &key) const |
Private Member Functions | |
QString | bookData (const QModelIndex &index, int role=Qt::DisplayRole) const |
CSwordTreeKey | indexToBookKey (int index) const |
bool | isBible () const |
bool | isBook () const |
bool | isCommentary () const |
bool | isLexicon () const |
bool | isSelected (int index) const |
QString | lexiconData (const QModelIndex &index, int role=Qt::DisplayRole) const |
QString | verseData (const QModelIndex &index, int role=Qt::DisplayRole) const |
Private Attributes | |
Rendering::CDisplayRendering | m_displayRendering |
std::optional< FindState > | m_findState |
int | m_firstEntry |
QString | m_highlightWords |
int | m_maxEntries |
BtConstModuleList | m_moduleInfoList |
QStringList | m_modules |
Model that represents the entire text of a given module.
It is used by a QML ListView to view a small portion of the available module text. Only the portions of the module that are currently displayed and some just above or below this, are instantiated.
Definition at line 105 of file btmoduletextmodel.h.
BtModuleTextModel::BtModuleTextModel | ( | QObject * | parent = nullptr | ) |
|
private |
returns text string for each model index
|
override |
Reimplemented from QAbstractItemModel.
|
override |
Reimplemented from QAbstractItemModel.
Referenced by BtQmlInterface::findText(), BtQmlInterface::openEditor(), and BtQmlInterface::rawText().
|
inlinenoexcept |
Get index offset of first entry of module
Definition at line 136 of file btmoduletextmodel.h.
References m_firstEntry.
Referenced by BtQmlInterface::scrollToSwordKey().
|
private |
CSwordKey * BtModuleTextModel::indexToKey | ( | int | index, |
int | moduleNum | ||
) | const |
Convert index(row) into CSwordVerseKey.
Referenced by BtCopyByReferencesDialog::BtCopyByReferencesDialog(), and BtQmlInterface::getMouseClickedKey().
QString BtModuleTextModel::indexToKeyName | ( | int | index | ) | const |
Get reference name from index(row).
Referenced by BtQmlInterface::changeReference(), BtQmlInterface::copyRange(), BtQmlInterface::dragHandler(), and BtQmlInterface::openEditor().
int BtModuleTextModel::indexToVerse | ( | int | index | ) | const |
Convert index(row) into verse.
Referenced by BtQmlInterface::indexToVerse().
CSwordVerseKey BtModuleTextModel::indexToVerseKey | ( | int | index | ) | const |
Convert index(row) into CSwordVerseKey.
CSwordVerseKey BtModuleTextModel::indexToVerseKey | ( | int | index, |
CSwordModuleInfo const & | module | ||
) | const |
Convert index(row) into CSwordVerseKey.
|
private |
|
private |
|
private |
|
private |
|
private |
int BtModuleTextModel::keyToIndex | ( | CSwordKey const & | key | ) | const |
Convert CSwordKey into index.
Referenced by BtCopyByReferencesDialog::BtCopyByReferencesDialog(), and BtQmlInterface::scrollToSwordKey().
|
private |
void BtModuleTextModel::reloadModules | ( | ) |
Load module pointers from module names
|
override |
Used by model to get the roleNames and corresponding role numbers.
|
override |
Reimplemented from QAbstractItemModel.
Referenced by BtQmlInterface::findText().
|
overridevirtual |
Reimplemented from QAbstractItemModel.
Referenced by BtQmlInterface::setRawText().
void BtModuleTextModel::setFindState | ( | std::optional< FindState > | findState | ) |
Set the state of the currently found word functionality
Referenced by BtQmlInterface::findText(), and BtQmlInterface::setHighlightWords().
void BtModuleTextModel::setHighlightWords | ( | const QString & | highlightWords, |
bool | caseSensitive | ||
) |
Set the color of word that are highlighted
Referenced by BtQmlInterface::setHighlightWords().
void BtModuleTextModel::setModules | ( | const QStringList & | modules | ) |
Specifies one or more module names for use by the model
Referenced by BtQmlInterface::setModules().
void BtModuleTextModel::setOptions | ( | DisplayOptions const & | displayOptions, |
FilterOptions const & | filterOptions | ||
) |
Set the display and filter options used for rendering module text.
|
private |
int BtModuleTextModel::verseKeyToIndex | ( | const CSwordVerseKey & | key | ) | const |
Convert CSwordVerseKey into index(row).
Referenced by BtQmlInterface::getCurrentModelIndex().
|
private |
Definition at line 192 of file btmoduletextmodel.h.
|
private |
Definition at line 193 of file btmoduletextmodel.h.
|
private |
Definition at line 190 of file btmoduletextmodel.h.
Referenced by firstEntryIndex().
|
private |
Definition at line 188 of file btmoduletextmodel.h.
|
private |
Definition at line 191 of file btmoduletextmodel.h.
|
private |
Definition at line 186 of file btmoduletextmodel.h.
|
private |
Definition at line 187 of file btmoduletextmodel.h.