Slicer  4.10
Slicer is a multi-platform, free and open source software package for visualization and medical image computing
List of all members | Public Types | Properties | Public Slots | Signals | Public Member Functions | Protected Slots | Protected Member Functions | Protected Attributes
qSlicerModulesMenu Class Reference

#include <Base/QTGUI/qSlicerModulesMenu.h>

Inheritance diagram for qSlicerModulesMenu:
Inheritance graph
[legend]
Collaboration diagram for qSlicerModulesMenu:
Collaboration graph
[legend]

Public Types

typedef QMenu Superclass
 

Properties

QString currentModule
 
bool duplicateActions
 
bool showHiddenModules
 

Public Slots

void addModule (const QString &moduleName)
 
void removeModule (const QString &moduleName)
 Remove the module from the list of available module. More...
 
void setCurrentModule (const QString &moduleName)
 Select a module by name. It looks for the module action and triggers it. More...
 
void setCurrentModuleByTitle (const QString &title)
 Select a module by title. It looks for the module action and triggers it. More...
 

Signals

void currentModuleChanged (const QString &name)
 

Public Member Functions

void addModules (const QStringList &moduleNames)
 Add a list of module available for selection. More...
 
QString currentModule () const
 Return the last selected module name. More...
 
bool duplicateActions () const
 
QAction * moduleAction (const QString &moduleName) const
 
qSlicerModuleManagermoduleManager () const
 
 qSlicerModulesMenu (const QString &title, QWidget *parent=0)
 
 qSlicerModulesMenu (QWidget *parent=0)
 
void removeModules (const QStringList &moduleNames)
 Add a list of module available for selection. More...
 
void setDuplicateActions (bool duplicate)
 
void setModuleManager (qSlicerModuleManager *moduleManager)
 Set the module manager to retrieve the modules from. More...
 
void setShowHiddenModules (bool show)
 
bool showHiddenModules () const
 
virtual ~qSlicerModulesMenu ()
 

Protected Slots

void actionSelected (QAction *action)
 
void onActionTriggered ()
 

Protected Member Functions

void addModule (qSlicerAbstractCoreModule *)
 
void removeModule (qSlicerAbstractCoreModule *)
 

Protected Attributes

QScopedPointer< qSlicerModulesMenuPrivate > d_ptr
 

Detailed Description

qSlicerModulesMenu supports a tree hierarchy of modules (based on module->category() )

Definition at line 37 of file qSlicerModulesMenu.h.

Member Typedef Documentation

◆ Superclass

Definition at line 58 of file qSlicerModulesMenu.h.

Property Documentation

◆ currentModule

QString qSlicerModulesMenu::currentModule
readwrite

Definition at line 40 of file qSlicerModulesMenu.h.

◆ 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.

Constructor & Destructor Documentation

◆ qSlicerModulesMenu() [1/2]

qSlicerModulesMenu::qSlicerModulesMenu ( const QString &  title,
QWidget *  parent = 0 
)

Constructor title is the name of the menu (can appear using right click on the toolbar area)

◆ qSlicerModulesMenu() [2/2]

qSlicerModulesMenu::qSlicerModulesMenu ( QWidget *  parent = 0)

◆ ~qSlicerModulesMenu()

virtual qSlicerModulesMenu::~qSlicerModulesMenu ( )
virtual

Member Function Documentation

◆ 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]

void qSlicerModulesMenu::addModule ( qSlicerAbstractCoreModule )
protected

◆ addModules()

void qSlicerModulesMenu::addModules ( const QStringList &  moduleNames)
inline

Add a list of module available for selection.

Definition at line 131 of file qSlicerModulesMenu.h.

◆ 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()

QAction* qSlicerModulesMenu::moduleAction ( const QString &  moduleName) const

◆ moduleManager()

qSlicerModuleManager* qSlicerModulesMenu::moduleManager ( ) const

◆ onActionTriggered

void qSlicerModulesMenu::onActionTriggered ( )
protectedslot

◆ removeModule [1/2]

void qSlicerModulesMenu::removeModule ( const QString &  moduleName)
slot

Remove the module from the list of available module.

◆ removeModule() [2/2]

void qSlicerModulesMenu::removeModule ( qSlicerAbstractCoreModule )
protected

◆ removeModules()

void qSlicerModulesMenu::removeModules ( const QStringList &  moduleNames)
inline

Add a list of module available for selection.

Definition at line 140 of file qSlicerModulesMenu.h.

◆ setCurrentModule

void qSlicerModulesMenu::setCurrentModule ( const QString &  moduleName)
slot

Select a module by name. It looks for the module action and triggers it.

◆ setCurrentModuleByTitle

void qSlicerModulesMenu::setCurrentModuleByTitle ( const QString &  title)
slot

Select a module by title. It looks for the module action and triggers it.

◆ setDuplicateActions()

void qSlicerModulesMenu::setDuplicateActions ( bool  duplicate)

◆ setModuleManager()

void qSlicerModulesMenu::setModuleManager ( qSlicerModuleManager moduleManager)

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.

◆ showHiddenModules()

bool qSlicerModulesMenu::showHiddenModules ( ) const

Member Data Documentation

◆ d_ptr

QScopedPointer<qSlicerModulesMenuPrivate> qSlicerModulesMenu::d_ptr
protected

Definition at line 120 of file qSlicerModulesMenu.h.


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