Results 1 to 3 of 3

Thread: establishing signal-slot connections between widgets in the same form with QtDesigner

  1. #1
    Join Date
    Jan 2009
    Posts
    78
    Thanks
    21
    Thanked 1 Time in 1 Post

    Default establishing signal-slot connections between widgets in the same form with QtDesigner

    Hi!
    I was going throw the example of "shape-changing dialog" in the "C++ GUI programming with Qt 4, Jasmin Blanchet, Mark Summerfield".
    As the dialog is not "shape-changing" e created a simple one with 3 buttons:
    • Button X
    • Button Cancel
    • Button Ok

    I seted the enabled property of the "Button Ok" to false.
    I wish that it becomes enable when i press "Button X".

    I entered "signals/slots" and connected this way:
    "Button X" signal clicked() to slot ???????

    Showld't there be a "enabled" option?

    Thanks

  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: establishing signal-slot connections between widgets in the same form with QtDesi

    Yes, there is QWidget::setEnabled(bool). But notice that it takes a bool parameter, and button has signals with a bool parameter only if it's checkable. So you can either make "Button X" checkable or you have to do it in code within an intermediate slot.
    J-P Nurmi

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

    gt.beta2 (12th February 2009)

  4. #3
    Join Date
    Jan 2009
    Posts
    78
    Thanks
    21
    Thanked 1 Time in 1 Post

    Default Re: establishing signal-slot connections between widgets in the same form with QtDesi

    I get the point.
    Thanks

Similar Threads

  1. Connection of custon signals/slots
    By brevleq in forum Qt Programming
    Replies: 2
    Last Post: 23rd December 2008, 08:04

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.