Results 1 to 3 of 3

Thread: i dont get actions with "connect" works

  1. #1
    Join Date
    Jul 2010
    Posts
    17
    Thanks
    8
    Qt products
    Qt4
    Platforms
    Windows

    Default i dont get actions with "connect" works

    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


    Qt Code:
    1. //here is my action code
    2. removeAct = new QAction(QIcon("./images/del.png"), tr("Eliminar mensajes"),this);
    3. removeAct->setStatusTip(tr("Borra los emementos seleccionados"));
    4. connect(removeAct, SIGNAL(triggered()),this, SLOT(m_cListaMensajes.eliminarVariosMensajes()));
    5.  
    6. // and here is my context menu code
    7. menu = new QMenu(this);
    8. menuPU = new QMenu();
    9. menu->addAction(enableMsgAct);
    10. menu->addMenu(menuPU);
    11. menu->addSeparator();
    12. menu->addAction(removeAct); // here i add the action
    13.  
    14. menuPU->setTitle(tr("Elegir pantalla"));
    15. menuPU->addAction(enablePU1Act);
    16. menuPU->addAction(enablePU2Act);
    17. menuPU->addAction(enablePU3Act);
    18. menuPU->addAction(enablePU4Act);
    19. menuPU->addAction(enablePU5Act);
    To copy to clipboard, switch view to plain text mode 

    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

  2. #2
    Join Date
    Jun 2010
    Location
    India
    Posts
    50
    Thanks
    1
    Thanked 15 Times in 14 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: i dont get actions with "connect" works

    Hi try this..

    Qt Code:
    1. connect(removeAct, SIGNAL(triggered()),&m_cListaMensajes, SLOT(eliminarVariosMensajes()));
    To copy to clipboard, switch view to plain text mode 

  3. The following user says thank you to agathiyaa for this useful post:

    pakine (25th August 2010)

  4. #3
    Join Date
    Jul 2010
    Posts
    17
    Thanks
    8
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: i dont get actions with "connect" works

    ok i solved it, was another problem hehe
    thanks anyway

Similar Threads

  1. Replies: 3
    Last Post: 29th August 2009, 22:24
  2. Replies: 1
    Last Post: 23rd August 2008, 22:09
  3. Replies: 1
    Last Post: 29th February 2008, 13:43
  4. Translation QFileDialog standart buttons ("Open"/"Save"/"Cancel")
    By victor.yacovlev in forum Qt Programming
    Replies: 4
    Last Post: 24th January 2008, 19:05

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.