BibleTime
Public Slots | Public Member Functions | Private Slots | Private Member Functions | Private Attributes | List of all members
CBookTreeChooser Class Referencefinal

#include <cbooktreechooser.h>

Inheritance diagram for CBookTreeChooser:

Public Slots

void doShow ()
 
void updateKey (CSwordKey *) final override
 
- Public Slots inherited from CKeyChooser
void handleHistoryMoved (QString const &newKey)
 
virtual void updateKey (CSwordKey *key)=0
 

Public Member Functions

 CBookTreeChooser (BtConstModuleList const &modules, CSwordKey *key=nullptr, QWidget *parent=nullptr)
 
CSwordKeykey () final override
 
void refreshContent () final override
 
void setKey (CSwordKey *key) final override
 
void setModules (BtConstModuleList const &modules, bool refresh=true) final override
 

Private Slots

void itemActivated (QTreeWidgetItem *item)
 

Private Member Functions

void addKeyChildren (CSwordTreeKey *key, QTreeWidgetItem *item)
 
void adjustFont ()
 
void setupTree ()
 Creates the first level of the tree structure. More...
 

Private Attributes

CSwordTreeKeym_key
 
QList< CSwordBookModuleInfo const * > m_modules
 
QTreeWidgetm_treeView
 

Additional Inherited Members

- Signals inherited from CKeyChooser
void keyChanged (CSwordKey *newKey)
 
- Static Public Member Functions inherited from CKeyChooser
static CKeyChoosercreateInstance (const BtConstModuleList &modules, CSwordKey *key, QWidget *parent)
 
- Protected Member Functions inherited from CKeyChooser
 CKeyChooser (QWidget *parent=nullptr)
 

Detailed Description

Definition at line 30 of file cbooktreechooser.h.

Constructor & Destructor Documentation

◆ CBookTreeChooser()

CBookTreeChooser::CBookTreeChooser ( BtConstModuleList const &  modules,
CSwordKey key = nullptr,
QWidget parent = nullptr 
)

Member Function Documentation

◆ addKeyChildren()

void CBookTreeChooser::addKeyChildren ( CSwordTreeKey key,
QTreeWidgetItem *  item 
)
private

Populates tree widget with items.

Definition at line 171 of file cbooktreechooser.cpp.

References CSwordKey::key(), and key().

Referenced by setupTree().

◆ adjustFont()

void CBookTreeChooser::adjustFont ( )
private

From ckeychooser.

Definition at line 113 of file cbooktreechooser.cpp.

References btConfig(), m_modules, and m_treeView.

Referenced by CBookTreeChooser(), and setModules().

◆ doShow

void CBookTreeChooser::doShow ( )
slot

Reimplementation to handle tree creation on show.

Definition at line 147 of file cbooktreechooser.cpp.

References m_treeView, and setupTree().

Referenced by CBookReadWindow::treeToggled().

◆ itemActivated

void CBookTreeChooser::itemActivated ( QTreeWidgetItem *  item)
privateslot
Todo:
itemActivated is called too many times. As tested in GDB, the function

Slot for signal when item is selected by user.

Definition at line 132 of file cbooktreechooser.cpp.

References CKeyChooser::keyChanged(), m_key, and CSwordTreeKey::setKey().

Referenced by CBookTreeChooser().

◆ key()

CSwordKey* CBookTreeChooser::key ( )
inlinefinaloverridevirtual
Returns
the current CKey.

Implements CKeyChooser.

Definition at line 44 of file cbooktreechooser.h.

References m_key.

Referenced by addKeyChildren(), CBookTreeChooser(), setKey(), and updateKey().

◆ refreshContent()

void CBookTreeChooser::refreshContent ( )
finaloverridevirtual

Refreshes the content. Inherited from ckeychooser.

Implements CKeyChooser.

Definition at line 120 of file cbooktreechooser.cpp.

References m_key, and updateKey().

◆ setKey()

void CBookTreeChooser::setKey ( CSwordKey newKey)
finaloverridevirtual

Sets a new key to this keychooser. Inherited from ckeychooser.

Implements CKeyChooser.

Definition at line 66 of file cbooktreechooser.cpp.

References CSwordTreeKey::key(), key(), m_key, and m_treeView.

Referenced by CBookTreeChooser(), setupTree(), and updateKey().

◆ setModules()

void CBookTreeChooser::setModules ( BtConstModuleList const &  modules,
bool  refresh = true 
)
finaloverridevirtual

Sets the module of this keychooser and refreshes the comboboxes

Implements CKeyChooser.

Definition at line 88 of file cbooktreechooser.cpp.

References adjustFont(), m_key, m_modules, CSwordTreeKey::offset(), CSwordTreeKey::setOffset(), and setupTree().

Referenced by CBookTreeChooser(), and CBookReadWindow::modulesChanged().

◆ setupTree()

void CBookTreeChooser::setupTree ( )
private

Creates the first level of the tree structure.

Creates the tree structure in the view.

Definition at line 158 of file cbooktreechooser.cpp.

References addKeyChildren(), m_key, m_treeView, CSwordTreeKey::offset(), CSwordTreeKey::positionToRoot(), setKey(), and CSwordTreeKey::setOffset().

Referenced by doShow(), and setModules().

◆ updateKey

void CBookTreeChooser::updateKey ( CSwordKey key)
finaloverrideslot

Inherited from ckeychooser

Definition at line 142 of file cbooktreechooser.cpp.

References key(), and setKey().

Referenced by CBookReadWindow::initConnections(), and refreshContent().

Member Data Documentation

◆ m_key

CSwordTreeKey* CBookTreeChooser::m_key
private

◆ m_modules

QList<CSwordBookModuleInfo const *> CBookTreeChooser::m_modules
private

Definition at line 65 of file cbooktreechooser.h.

Referenced by adjustFont(), CBookTreeChooser(), and setModules().

◆ m_treeView

QTreeWidget* CBookTreeChooser::m_treeView
private

Definition at line 67 of file cbooktreechooser.h.

Referenced by adjustFont(), CBookTreeChooser(), doShow(), setKey(), and setupTree().


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