Results 1 to 1 of 1

Thread: PyQt5 button.clicked slot called TWICE, no matter what I do to fix it...

  1. #1
    Join Date
    Apr 2015
    Qt products

    Default Re: PyQt5 button.clicked slot called TWICE, no matter what I do to fix it...

    The code is half generated in QtDesigner.

    I have a button called placeImageButton, and am programatically connecting it
    self.toolBox.placeImageButton.clicked.connect(self .placeImage)

    I've tried renaming the button and the slot to obscure names.

    I've tried commenting out connectSlotsByName() call in QtDesigner-generated code.

    The slot gets called twice and has no call stack to find out where from.

    The second call also seems to crash the application when I have a QFileDialog.getOpenFileName() call in it and the user clicks 'Cancel'.

    This is such a bug that my app is useless for now until it is fixed. :'(

    Added after 15 minutes:


    I think I found the bug. I have two instances of GraphicsScene, each making the connection.

    So I have to reroute the call to a mother class that dispatches to the correct GraphicsScene.

    (I have multiple projects allowed open in my app)
    Last edited by enjoysmath; 17th November 2015 at 18:26.

Similar Threads

  1. PyQt5 button click not work in imported class
    By mongolor in forum Newbie
    Replies: 3
    Last Post: 26th September 2015, 10:32
  2. Slot never called
    By Kola73 in forum Newbie
    Replies: 2
    Last Post: 27th June 2015, 08:48
  3. Replies: 2
    Last Post: 26th August 2011, 08:51
  4. Slot gets called twice
    By greatgatsby in forum Newbie
    Replies: 7
    Last Post: 20th August 2009, 15:11
  5. SLOT not being called
    By steg90 in forum Qt Programming
    Replies: 4
    Last Post: 6th December 2007, 11:30

Tags for this Thread


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.