BibleTime
Signals | Public Member Functions | Private Attributes | List of all members
CKeyChooserWidget Class Reference

#include <ckeychooserwidget.h>

Inheritance diagram for CKeyChooserWidget:

Signals

void changed (int index)
 
void focusOut (int index)
 

Public Member Functions

 CKeyChooserWidget (int count=0, QWidget *parent=nullptr)
 
 CKeyChooserWidget (QStringList *list=nullptr, QWidget *parent=nullptr)
 
QComboBoxcomboBox () const
 
void init ()
 
void reset (const int count, int index, bool do_emit)
 
void reset (const QStringList &list, int index, bool do_emit)
 
void reset (const QStringList *list, int index, bool do_emit)
 
bool setItem (const QString &item)
 
void setToolTips (const QString &comboTip, const QString &nextEntry, const QString &scrollButton, const QString &previousEntry)
 

Private Attributes

CKCComboBoxm_comboBox
 
bool m_isResetting
 
QStringList m_list
 
QHBoxLayout * m_mainLayout
 
QString m_oldKey
 
CScrollerWidgetSetm_scroller
 
bool updatelock
 

Detailed Description

This class implements the KeyCooser Widget, which consists of a QComboBox, two normal ref @QToolButton and a enhanced CScrollButton

Author
The BibleTime team

Definition at line 60 of file ckeychooserwidget.h.

Constructor & Destructor Documentation

◆ CKeyChooserWidget() [1/2]

CKeyChooserWidget::CKeyChooserWidget ( QStringList *  list = nullptr,
QWidget parent = nullptr 
)

Definition at line 104 of file ckeychooserwidget.cpp.

References init(), m_list, and reset().

◆ CKeyChooserWidget() [2/2]

CKeyChooserWidget::CKeyChooserWidget ( int  count = 0,
QWidget parent = nullptr 
)

Definition at line 94 of file ckeychooserwidget.cpp.

References init(), m_list, and reset().

Member Function Documentation

◆ changed

void CKeyChooserWidget::changed ( int  index)
signal

Is emitted if the widget changed, but only if it is not locked or being reset

Parameters
thecurrent ComboBox index

Referenced by CLexiconKeyChooser::CLexiconKeyChooser(), init(), reset(), and CBookKeyChooser::setModules().

◆ comboBox()

QComboBox& CKeyChooserWidget::comboBox ( ) const
inline

Return the combobox of this key chooser widget.

Definition at line 109 of file ckeychooserwidget.h.

References BT_ASSERT, and m_comboBox.

Referenced by CLexiconKeyChooser::CLexiconKeyChooser(), CBookKeyChooser::keyChooserChanged(), CBookKeyChooser::setModules(), and CLexiconKeyChooser::updateKey().

◆ focusOut

void CKeyChooserWidget::focusOut ( int  index)
signal

Is emitted if the widget was left with a focus out event.

Parameters
indexThe new index of the ComboBox

Referenced by CLexiconKeyChooser::CLexiconKeyChooser(), and CBookKeyChooser::setModules().

◆ init()

void CKeyChooserWidget::init ( )

Initializes this widget. We need this function because we have more than one constructor.

Definition at line 175 of file ckeychooserwidget.cpp.

References BT_ASSERT, BT_CONNECT, CScrollerWidgetSet::change(), changed(), if(), m_comboBox, m_mainLayout, m_oldKey, m_scroller, CScrollerWidgetSet::scroller_pressed(), CScrollerWidgetSet::scroller_released(), and updatelock.

Referenced by CKeyChooserWidget().

◆ reset() [1/3]

void CKeyChooserWidget::reset ( const int  count,
int  index,
bool  do_emit 
)

This function does clear the combobox, then fill in the StringList, set the ComboBox' current item to index and if do_emit is true, it will emit changed

Parameters
listthe stringlist to be inserted
indexthe index that the combobox is to jump to
do_emitshould we emit changed(int)
Todo:
CHECK

Definition at line 114 of file ckeychooserwidget.cpp.

References m_list.

Referenced by CKeyChooserWidget(), CLexiconKeyChooser::refreshContent(), reset(), CBookKeyChooser::setKey(), and CBookKeyChooser::setupCombo().

◆ reset() [2/3]

void CKeyChooserWidget::reset ( const QStringList &  list,
int  index,
bool  do_emit 
)

Definition at line 127 of file ckeychooserwidget.cpp.

References m_list, and reset().

◆ reset() [3/3]

void CKeyChooserWidget::reset ( const QStringList *  list,
int  index,
bool  do_emit 
)

Definition at line 138 of file ckeychooserwidget.cpp.

References changed(), m_comboBox, m_isResetting, and m_oldKey.

◆ setItem()

bool CKeyChooserWidget::setItem ( const QString &  item)

Sets the current item to the one with the given text

Definition at line 282 of file ckeychooserwidget.cpp.

References m_comboBox.

◆ setToolTips()

void CKeyChooserWidget::setToolTips ( const QString &  comboTip,
const QString &  nextEntryTip,
const QString &  scrollButtonTip,
const QString &  previousEntryTip 
)

Sets the tooltips for the given entries using the parameters as text.

Definition at line 272 of file ckeychooserwidget.cpp.

References m_comboBox, m_scroller, and CScrollerWidgetSet::setToolTips().

Referenced by CLexiconKeyChooser::CLexiconKeyChooser().

Member Data Documentation

◆ m_comboBox

CKCComboBox* CKeyChooserWidget::m_comboBox
private

Members should never be public!!

Definition at line 138 of file ckeychooserwidget.h.

Referenced by comboBox(), init(), reset(), setItem(), and setToolTips().

◆ m_isResetting

bool CKeyChooserWidget::m_isResetting
private

indicates wheter we are resetting at the moment

Definition at line 145 of file ckeychooserwidget.h.

Referenced by reset().

◆ m_list

QStringList CKeyChooserWidget::m_list
private

Definition at line 132 of file ckeychooserwidget.h.

Referenced by CKeyChooserWidget(), and reset().

◆ m_mainLayout

QHBoxLayout* CKeyChooserWidget::m_mainLayout
private

Definition at line 139 of file ckeychooserwidget.h.

Referenced by init().

◆ m_oldKey

QString CKeyChooserWidget::m_oldKey
private

Definition at line 147 of file ckeychooserwidget.h.

Referenced by init(), and reset().

◆ m_scroller

CScrollerWidgetSet* CKeyChooserWidget::m_scroller
private

Definition at line 140 of file ckeychooserwidget.h.

Referenced by init(), and setToolTips().

◆ updatelock

bool CKeyChooserWidget::updatelock
private

Definition at line 133 of file ckeychooserwidget.h.

Referenced by init().


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