#include <Base/QTGUI/qSlicerModulesMenu.h>
|
QScopedPointer< qSlicerModulesMenuPrivate > | d_ptr |
|
qSlicerModulesMenu supports a tree hierarchy of modules (based on module->category() )
Definition at line 37 of file qSlicerModulesMenu.h.
◆ Superclass
◆ currentModule
QString qSlicerModulesMenu::currentModule |
|
readwrite |
◆ duplicateActions
bool qSlicerModulesMenu::duplicateActions |
|
readwrite |
By default (duplicateActions = false), multiple instances of qSlicerModulesMenu share the same QActions. When a module QAction is fired from a menu, all the qSlicerModulesMenu would make it the current module. When duplicateActions is true, the QActions populating the menu are duplicates from the original module QAction. That way the qSlicerModulesMenu behaves independently from the other qSlicerModulesMenus. Note: this property should be set before modules are added (addModule()).
Definition at line 48 of file qSlicerModulesMenu.h.
◆ showHiddenModules
bool qSlicerModulesMenu::showHiddenModules |
|
readwrite |
By default (showHiddenModules == false), modules with the hidden property set to true are not shown. If showHiddenModules is true, all the modules are visible. Note: this property should be set before modules are added (addModule), changing its value won't change the visibility of the current volumes but only the future added modules
Definition at line 56 of file qSlicerModulesMenu.h.
◆ topLevelCategoryOrder
QStringList qSlicerModulesMenu::topLevelCategoryOrder |
|
readwrite |
◆ qSlicerModulesMenu() [1/2]
qSlicerModulesMenu::qSlicerModulesMenu |
( |
const QString & |
title, |
|
|
QWidget * |
parent = nullptr |
|
) |
| |
Constructor title is the name of the menu (can appear using right click on the toolbar area)
◆ qSlicerModulesMenu() [2/2]
qSlicerModulesMenu::qSlicerModulesMenu |
( |
QWidget * |
parent = nullptr | ) |
|
◆ ~qSlicerModulesMenu()
qSlicerModulesMenu::~qSlicerModulesMenu |
( |
| ) |
|
|
override |
◆ actionSelected
void qSlicerModulesMenu::actionSelected |
( |
QAction * |
action | ) |
|
|
protectedslot |
◆ addModule [1/2]
void qSlicerModulesMenu::addModule |
( |
const QString & |
moduleName | ) |
|
|
slot |
Add a module by name into the menu.
The category property of the module is used to assign a submenu to the module action. If a module is hidden and showHiddenModules is false (default), the module is ignored and not added into the list
- See also
- qSlicerAbstractCoreModule::category()
-
qSlicerAbstractCoreModule::action()
-
qSlicerAbstractCoreModule::isHidden()
◆ addModule [2/2]
Add a module into the menu.
◆ addModules()
void qSlicerModulesMenu::addModules |
( |
const QStringList & |
moduleNames | ) |
|
|
inline |
◆ currentModule()
QString qSlicerModulesMenu::currentModule |
( |
| ) |
const |
Return the last selected module name.
◆ currentModuleChanged
void qSlicerModulesMenu::currentModuleChanged |
( |
const QString & |
name | ) |
|
|
signal |
The signal is fired every time a module is selected. The QAction of the module is triggered.
◆ duplicateActions()
bool qSlicerModulesMenu::duplicateActions |
( |
| ) |
const |
◆ moduleAction()
Q_INVOKABLE QAction* qSlicerModulesMenu::moduleAction |
( |
const QString & |
moduleName | ) |
const |
◆ moduleManager()
◆ onActionTriggered
void qSlicerModulesMenu::onActionTriggered |
( |
| ) |
|
|
protectedslot |
◆ removeCategory()
Q_INVOKABLE bool qSlicerModulesMenu::removeCategory |
( |
const QString & |
categoryName | ) |
|
Remove a top-level category or sub-category. Return true if it was found and removed.
Sub-category can be specified using a "dot" separator (i.e. "CategoryName.SubCategoryName")
- See also
- removeModule()
◆ removeModule [1/2]
bool qSlicerModulesMenu::removeModule |
( |
const QString & |
moduleName | ) |
|
|
slot |
Remove the module from the menu.
Return true if the module was found and removed.
By default, matching module entries are removed from the top-level category, the custom and pre-defined categories.
removeFromAllModules to false allows to change this.
◆ removeModule [2/2]
Remove the module from the menu.
By default, matching module entries are removed from the top-level category, the custom and pre-defined categories as well as the "All Modules" special category. Setting removeFromAllModules to false allows to change this.
Return true if the module was found and removed.
◆ removeModules()
void qSlicerModulesMenu::removeModules |
( |
const QStringList & |
moduleNames | ) |
|
|
inline |
◆ setCurrentModule
void qSlicerModulesMenu::setCurrentModule |
( |
const QString & |
moduleName | ) |
|
|
slot |
◆ setCurrentModuleByTitle
void qSlicerModulesMenu::setCurrentModuleByTitle |
( |
const QString & |
title | ) |
|
|
slot |
Select a module by title. It looks for the module action and triggers it.
- See also
- setCurrentModule()
◆ setDuplicateActions()
void qSlicerModulesMenu::setDuplicateActions |
( |
bool |
duplicate | ) |
|
◆ setModuleManager()
Set the module manager to retrieve the modules from.
◆ setShowHiddenModules()
void qSlicerModulesMenu::setShowHiddenModules |
( |
bool |
show | ) |
|
If true, modules with the hidden property set to true are still visible in the module.
◆ setTopLevelCategoryOrder()
void qSlicerModulesMenu::setTopLevelCategoryOrder |
( |
const QStringList & |
categories | ) |
|
◆ showHiddenModules()
bool qSlicerModulesMenu::showHiddenModules |
( |
| ) |
const |
◆ topLevelCategoryOrder()
QStringList qSlicerModulesMenu::topLevelCategoryOrder |
( |
| ) |
const |
◆ d_ptr
QScopedPointer<qSlicerModulesMenuPrivate> qSlicerModulesMenu::d_ptr |
|
protected |
The documentation for this class was generated from the following file: