BibleTime
|
#include <btmodulechoosermenu.h>
Public Types | |
enum | Flag { DisableNonBiblesOnFirstButton , DisableSelectedModule , AddNoneButton } |
Signals | |
void | sigModuleChosen (CSwordModuleInfo *module) |
Signals inherited from BtMenuView | |
void | triggered (QModelIndex index) |
Public Member Functions | |
BtModuleChooserMenu (QString const &title, CSwordModuleInfo::ModuleType moduleType, Flags flags, QWidget *parent=nullptr) | |
int | buttonIndex () const noexcept |
CSwordModuleInfo::ModuleType | moduleType () const noexcept |
CSwordModuleInfo * | selectedModule () const noexcept |
void | setSelectedModule (CSwordModuleInfo *const newSelectedModule) noexcept |
void | update (BtModuleList newModulesToUse, CSwordModuleInfo *newSelectedModule, int newButtonIndexIndex, int newLeftLikeModules) |
Public Member Functions inherited from BtMenuView | |
BtMenuView (QString const &title, QWidget *parent=nullptr) | |
BtMenuView (QWidget *parent=nullptr) | |
bool | event (QEvent *e) override |
QAbstractItemModel * | model () const |
void | setModel (QAbstractItemModel *model) |
~BtMenuView () override | |
Public Attributes | |
int | m_buttonIndex |
Flags const | m_flags |
int | m_leftLikeModules |
CSwordModuleInfo::ModuleType const | m_moduleType |
BtModuleList | m_newModulesToUse |
CSwordModuleInfo * | m_selectedModule = nullptr |
void *const | m_sortedModel |
Private Member Functions | |
QAction * | newAction (QMenu *parentMenu, QModelIndex const &itemIndex) final override |
void | preBuildMenu (QActionGroup *actionGroup) final override |
Additional Inherited Members | |
Protected Member Functions inherited from BtMenuView | |
virtual QMenu * | newMenu (QMenu *parentMenu, const QModelIndex &itemIndex) |
virtual void | postBuildMenu (QActionGroup *actions) |
void | rebuildMenu () |
Rebuilds the menu. More... | |
Definition at line 30 of file btmodulechoosermenu.h.
Enumerator | |
---|---|
DisableNonBiblesOnFirstButton | |
DisableSelectedModule | |
AddNoneButton |
Definition at line 36 of file btmodulechoosermenu.h.
BtModuleChooserMenu::BtModuleChooserMenu | ( | QString const & | title, |
CSwordModuleInfo::ModuleType | moduleType, | ||
Flags | flags, | ||
QWidget * | parent = nullptr |
||
) |
Definition at line 102 of file btmodulechoosermenu.cpp.
References BT_CONNECT, m_sortedModel, BtMenuView::setModel(), and BtMenuView::triggered().
|
inlinenoexcept |
Definition at line 63 of file btmodulechoosermenu.h.
References m_buttonIndex.
Referenced by BtModuleChooserButton::moduleChosen().
|
inlinenoexcept |
Definition at line 55 of file btmodulechoosermenu.h.
References m_moduleType.
Referenced by BtModuleChooserButton::icon().
|
finaloverrideprivatevirtual |
This method is called by BtMenuView to initialize an action to add to this menu. If the action corresponding to the given index is not to be added to this menu, please return 0.
[in] | parentMenu | the parent menu under which the new action is to be added. |
[in] | itemIndex | the index of the item corresponding to the action. |
Reimplemented from BtMenuView.
Definition at line 148 of file btmodulechoosermenu.cpp.
References CSwordModuleInfo::Bible, CSwordModuleInfo::Bibles, BT_ASSERT, DisableNonBiblesOnFirstButton, DisableSelectedModule, m_buttonIndex, m_flags, m_newModulesToUse, m_selectedModule, m_sortedModel, and BtMenuView::newAction().
|
finaloverrideprivatevirtual |
This method is called by BtMenuView before populating itself with data from the model. Reimplement this method to add any menus/actions to this menu before the items of the menu. The default implementation does nothing.
The model might be unset before this method is called. When the menu is about to be shown, this allows for this method to initialize the model on request. If the model is unset after this method returns, the menu is not populated with data from the item model.
Reimplemented from BtMenuView.
Definition at line 127 of file btmodulechoosermenu.cpp.
References AddNoneButton, BT_ASSERT, BT_CONNECT, m_buttonIndex, m_flags, m_leftLikeModules, m_newModulesToUse, m_selectedModule, and BtMenuView::triggered().
|
inlinenoexcept |
Definition at line 58 of file btmodulechoosermenu.h.
References m_selectedModule.
Referenced by BtModuleChooserButton::icon(), and BtModuleChooserButton::moduleChosen().
|
noexcept |
Definition at line 194 of file btmodulechoosermenu.cpp.
Referenced by BtModuleChooserButton::moduleChosen().
|
signal |
void BtModuleChooserMenu::update | ( | BtModuleList | newModulesToUse, |
CSwordModuleInfo * | newSelectedModule, | ||
int | newButtonIndexIndex, | ||
int | newLeftLikeModules | ||
) |
Definition at line 182 of file btmodulechoosermenu.cpp.
References m_buttonIndex, m_leftLikeModules, m_newModulesToUse, m_selectedModule, and BtMenuView::rebuildMenu().
Referenced by BtModuleChooserButton::updateMenu(), and BtTextWindowHeaderWidget::updateWidget().
int BtModuleChooserMenu::m_buttonIndex |
Definition at line 83 of file btmodulechoosermenu.h.
Referenced by buttonIndex(), newAction(), preBuildMenu(), and update().
Flags const BtModuleChooserMenu::m_flags |
Definition at line 80 of file btmodulechoosermenu.h.
Referenced by newAction(), and preBuildMenu().
int BtModuleChooserMenu::m_leftLikeModules |
Definition at line 84 of file btmodulechoosermenu.h.
Referenced by preBuildMenu(), and update().
CSwordModuleInfo::ModuleType const BtModuleChooserMenu::m_moduleType |
Definition at line 78 of file btmodulechoosermenu.h.
Referenced by moduleType().
BtModuleList BtModuleChooserMenu::m_newModulesToUse |
Definition at line 81 of file btmodulechoosermenu.h.
Referenced by newAction(), preBuildMenu(), and update().
CSwordModuleInfo* BtModuleChooserMenu::m_selectedModule = nullptr |
Definition at line 82 of file btmodulechoosermenu.h.
Referenced by newAction(), preBuildMenu(), selectedModule(), and update().
void* const BtModuleChooserMenu::m_sortedModel |
Definition at line 79 of file btmodulechoosermenu.h.
Referenced by BtModuleChooserMenu(), and newAction().