Results 1 to 5 of 5

Thread: action -> slot in Qt Designer

  1. #1
    Join Date
    Sep 2008
    Posts
    60
    Thanks
    8
    Thanked 10 Times in 9 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default action -> slot in Qt Designer

    I create actions in Qt Designer 4.3.4 and then write code to connect them to standard slots, like close():

    Qt Code:
    1. connect(m_form.action_Quit, SIGNAL(triggered()), this, SLOT(close()));
    To copy to clipboard, switch view to plain text mode 

    Would it be possible to create such connections in Qt Designer?

  2. #2
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    6,264
    Thanks
    36
    Thanked 1,519 Times in 1,389 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows Symbian S60 Maemo/MeeGo

    Default Re: action -> slot in Qt Designer

    Yes, with the Signal/Slot Editor (see Tools-menu).
    J-P Nurmi

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

    yuriry (5th October 2008)

  4. #3
    Join Date
    Sep 2008
    Posts
    60
    Thanks
    8
    Thanked 10 Times in 9 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: action -> slot in Qt Designer

    Thank you J-P Nurmi.

    I created a fake connection because I could not connect an action with the widget directly. Then I re-defined the connection in Signal/Slot Editor. Is this the right way to do it?

  5. #4
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    6,264
    Thanks
    36
    Thanked 1,519 Times in 1,389 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows Symbian S60 Maemo/MeeGo

    Default Re: action -> slot in Qt Designer

    I'm not sure if it's possible to create such connections on the form in the signal-slot editing mode, but I created it directly in the signal-slot editor by clicking "+" and choosing the parameters.
    Attached Images Attached Images
    J-P Nurmi

  6. The following user says thank you to jpn for this useful post:

    yuriry (6th October 2008)

  7. #5
    Join Date
    Sep 2008
    Posts
    60
    Thanks
    8
    Thanked 10 Times in 9 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: action -> slot in Qt Designer

    Thank you! I did not notice the plus sign

Similar Threads

  1. Replies: 1
    Last Post: 23rd August 2008, 22:09
  2. Problem When Creating my own Slot
    By Fatla in forum Qt Programming
    Replies: 12
    Last Post: 6th June 2008, 14:44
  3. Qt Designer & Qt4, connect to my own slot.
    By geitosten in forum Newbie
    Replies: 2
    Last Post: 17th February 2007, 19:22
  4. custom slot + Designer
    By bashamehboob in forum Qt Tools
    Replies: 1
    Last Post: 28th April 2006, 15:17
  5. How to create custom slot in Qt Designer 4.1?
    By jamadagni in forum Qt Tools
    Replies: 31
    Last Post: 18th January 2006, 20:46

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.