Results 1 to 7 of 7

Thread: QDialogButtonBox Clicked Signals is called with other signals

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Jan 2014
    Posts
    9
    Qt products
    Platforms
    MacOS X Unix/X11

    Default Re: QDialogButtonBox Clicked Signals is called with other signals

    Quote Originally Posted by anda_skoa View Post
    Then one option might be to use the return value of addButton().

    Something like
    Qt Code:
    1. resetButton = self.widget_01_btns.addButton('Clear', QtGui.QDialogButtonBox.ResetRole)
    2. resetButton.clicked.connect(....);
    To copy to clipboard, switch view to plain text mode 

    Cheers,
    _
    This is working... Though it seems a bit pointless that I have to return it as I thought the use of roles in QDialogButtonBox is meant to reduce such work (correct me if I am wrong on this) but this is the impression I am getting...

  2. #2
    Join Date
    Jan 2006
    Location
    Graz, Austria
    Posts
    8,416
    Thanks
    37
    Thanked 1,544 Times in 1,494 Posts
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: QDialogButtonBox Clicked Signals is called with other signals

    Using roles means the dialog button box can decide on the placement of buttons depending on the platform specific needs.
    I.e. you don't need to manually create and layout buttons.

    You can either connect to buttons explicitly or connect to the box signals.

    For the former it really doesn't matter if you connect to the button right after adding it or later retrieving it unless you require to connect later.

    Cheers,
    _

  3. #3
    Join Date
    Jan 2014
    Posts
    9
    Qt products
    Platforms
    MacOS X Unix/X11

    Default Re: QDialogButtonBox Clicked Signals is called with other signals

    Quote Originally Posted by anda_skoa View Post
    Using roles means the dialog button box can decide on the placement of buttons depending on the platform specific needs.
    I.e. you don't need to manually create and layout buttons.

    You can either connect to buttons explicitly or connect to the box signals.

    For the former it really doesn't matter if you connect to the button right after adding it or later retrieving it unless you require to connect later.

    Cheers,
    _
    I was actually hoping that there is a signal for ResetRole, seeing that there are specific signals when using AcceptRole, RejectRole and HelpRole.
    Also I did not expected that when using `clicked`, it is being called in conjunction with the specific signals for the above 3 roles.

Similar Threads

  1. QComboBox Signals doesn't invoke the called function
    By ladiesfinger in forum Qt Programming
    Replies: 6
    Last Post: 30th December 2010, 16:20
  2. Replies: 1
    Last Post: 4th December 2010, 22:28
  3. Replies: 1
    Last Post: 24th October 2010, 11:09
  4. [SOLVED] Two signals emitted, only one slot called!
    By codeverse in forum Qt Programming
    Replies: 0
    Last Post: 11th August 2010, 15:46
  5. QThread and signals (linux/UNIX signals not Qt Signals)
    By Micawber in forum Qt Programming
    Replies: 1
    Last Post: 28th November 2007, 22: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.