PDA

View Full Version : action and signal



sniperroms
30th September 2010, 03:44
How can I activate the pHideUnselect action from the modelstructure class?



moldestructure.cpp File
declaration
ModelStructure::ModelStructure(OpenglView* pOpenglView, QAction* pInstanceProperties, QAction* pHideUnselect , QAction* pCopy, QAction* pPaste, QPair<GLC_uint, GLC_StructOccurence*>*pClipBoard, QWidget *parent)
: QWidget(parent)
.
.
.
{
// Add contextual menu
//Contextual menu Creation
structure->addAction(pHideUnselect);



pHideUnselect is defined in glc_player.cpp the class and references are created as follows:


m_pModelManagerView= new ModelManagerView(&m_OpenglView, ui.action_Property, ui.actionHide_unselected, ui.actionCopy, ui.actionPaste, &m_ClipBoard, ui.albumManagementWindow);

connect(ui.actionHide_unselected, SIGNAL(triggered()), this, SLOT(hideUnselected()));



but I do not know how to execute pHideUnselect manually as if this were selected from the menu.

tbscope
30th September 2010, 07:14
just call

pHideUnselect->trigger();

Lykurg
30th September 2010, 08:16
... and please do recognize the difference between [QTCLASS] and [CODE] in your further posts.