BibleTime
|
#include <ckeychooserwidget.h>
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) | |
QComboBox & | comboBox () 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 | |
CKCComboBox * | m_comboBox |
bool | m_isResetting |
QStringList | m_list |
QHBoxLayout * | m_mainLayout |
QString | m_oldKey |
CScrollerWidgetSet * | m_scroller |
bool | updatelock |
This class implements the KeyCooser Widget, which consists of a QComboBox, two normal ref @QToolButton and a enhanced CScrollButton
Definition at line 60 of file ckeychooserwidget.h.
CKeyChooserWidget::CKeyChooserWidget | ( | QStringList * | list = nullptr , |
QWidget * | parent = nullptr |
||
) |
Definition at line 104 of file ckeychooserwidget.cpp.
CKeyChooserWidget::CKeyChooserWidget | ( | int | count = 0 , |
QWidget * | parent = nullptr |
||
) |
Definition at line 94 of file ckeychooserwidget.cpp.
|
signal |
Is emitted if the widget changed, but only if it is not locked or being reset
the | current ComboBox index |
Referenced by CLexiconKeyChooser::CLexiconKeyChooser(), init(), reset(), and CBookKeyChooser::setModules().
|
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().
|
signal |
Is emitted if the widget was left with a focus out event.
index | The new index of the ComboBox |
Referenced by CLexiconKeyChooser::CLexiconKeyChooser(), and CBookKeyChooser::setModules().
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().
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
list | the stringlist to be inserted |
index | the index that the combobox is to jump to |
do_emit | should we emit changed(int) |
Definition at line 114 of file ckeychooserwidget.cpp.
References m_list.
Referenced by CKeyChooserWidget(), CLexiconKeyChooser::refreshContent(), reset(), CBookKeyChooser::setKey(), and CBookKeyChooser::setupCombo().
void CKeyChooserWidget::reset | ( | const QStringList & | list, |
int | index, | ||
bool | do_emit | ||
) |
Definition at line 127 of file ckeychooserwidget.cpp.
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.
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.
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().
|
private |
Members should never be public!!
Definition at line 138 of file ckeychooserwidget.h.
Referenced by comboBox(), init(), reset(), setItem(), and setToolTips().
|
private |
indicates wheter we are resetting at the moment
Definition at line 145 of file ckeychooserwidget.h.
Referenced by reset().
|
private |
Definition at line 132 of file ckeychooserwidget.h.
Referenced by CKeyChooserWidget(), and reset().
|
private |
Definition at line 139 of file ckeychooserwidget.h.
Referenced by init().
|
private |
Definition at line 147 of file ckeychooserwidget.h.
|
private |
Definition at line 140 of file ckeychooserwidget.h.
Referenced by init(), and setToolTips().
|
private |
Definition at line 133 of file ckeychooserwidget.h.
Referenced by init().