Results 1 to 3 of 3

Thread: action and signal

  1. #1
    Join Date
    Sep 2010
    Posts
    1
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Question action and signal

    How can I activate the pHideUnselect action from the modelstructure class?

    Qt Code:
    1. moldestructure.cpp File
    2. declaration
    3. ModelStructure::ModelStructure(OpenglView* pOpenglView, QAction* pInstanceProperties, QAction* pHideUnselect , QAction* pCopy, QAction* pPaste, QPair<GLC_uint, GLC_StructOccurence*>*pClipBoard, QWidget *parent)
    4. : QWidget(parent)
    5. .
    6. .
    7. .
    8. {
    9. // Add contextual menu
    10. //Contextual menu Creation
    11. structure->addAction(pHideUnselect);
    To copy to clipboard, switch view to plain text mode 

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

    Qt Code:
    1. m_pModelManagerView= new ModelManagerView(&m_OpenglView, ui.action_Property, ui.actionHide_unselected, ui.actionCopy, ui.actionPaste, &m_ClipBoard, ui.albumManagementWindow);
    2.  
    3. connect(ui.actionHide_unselected, SIGNAL(triggered()), this, SLOT(hideUnselected()));
    To copy to clipboard, switch view to plain text mode 


    but I do not know how to execute pHideUnselect manually as if this were selected from the menu.
    Last edited by Lykurg; 30th September 2010 at 08:14. Reason: changed [qtclass] to [code]

  2. #2
    Join Date
    Jan 2006
    Location
    Belgium
    Posts
    1,938
    Thanked 268 Times in 268 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows
    Wiki edits
    20

    Default Re: action and signal

    just call
    Qt Code:
    1. pHideUnselect->trigger();
    To copy to clipboard, switch view to plain text mode 

  3. #3
    Join Date
    Jan 2006
    Location
    Germany
    Posts
    4,380
    Thanks
    19
    Thanked 1,005 Times in 913 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows Symbian S60
    Wiki edits
    5

    Default Re: action and signal

    ... and please do recognize the difference between [QTCLASS] and [CODE] in your further posts.

Similar Threads

  1. QlistWidget Missing signal for Drop action
    By papitou38 in forum Qt Programming
    Replies: 1
    Last Post: 8th March 2009, 16:48
  2. how to scale an action.
    By hgedek in forum Qt Programming
    Replies: 1
    Last Post: 13th August 2007, 16:58
  3. pushbutton action
    By mickey in forum Newbie
    Replies: 9
    Last Post: 21st April 2006, 19:46
  4. No action checked in an exclusive action group
    By SkripT in forum Qt Programming
    Replies: 12
    Last Post: 13th February 2006, 06:19
  5. action
    By mickey in forum Qt Tools
    Replies: 3
    Last Post: 19th January 2006, 05:18

Tags for this Thread

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.