PDA

View Full Version : i dont get actions with "connect" works



pakine
7th July 2010, 13:26
hi, i have one problem linking the action with the SLOT. the SLOT procedure wrks perfectly, but i dont get the action executed.
i dont know if i need to declare the prcedure to execure as a public SLOT in the owner class, but i dont think so, cause with other action it is as a SLOT and still not working.

i have all the actions not working, and i show here one example of the actions




//here is my action code
removeAct = new QAction(QIcon("./images/del.png"), tr("Eliminar mensajes"),this);
removeAct->setStatusTip(tr("Borra los emementos seleccionados"));
connect(removeAct, SIGNAL(triggered()),this, SLOT(m_cListaMensajes.eliminarVariosMensajes()));

// and here is my context menu code
menu = new QMenu(this);
menuPU = new QMenu();
menu->addAction(enableMsgAct);
menu->addMenu(menuPU);
menu->addSeparator();
menu->addAction(removeAct); // here i add the action

menuPU->setTitle(tr("Elegir pantalla"));
menuPU->addAction(enablePU1Act);
menuPU->addAction(enablePU2Act);
menuPU->addAction(enablePU3Act);
menuPU->addAction(enablePU4Act);
menuPU->addAction(enablePU5Act);



m_cListaMensajes.eliminarVariosMensajes() works prefectly cause i'm using it in other parts of the program,
so i dont know if i'm not controlling anything, or where is the problem
thanks

agathiyaa
7th July 2010, 13:55
Hi try this..



connect(removeAct, SIGNAL(triggered()),&m_cListaMensajes, SLOT(eliminarVariosMensajes()));

pakine
7th July 2010, 15:17
ok i solved it, was another problem hehe
thanks anyway