PySide Bugzilla Closed for New Bugs

PySide is now a Qt Add-on and uses the Qt Project's JIRA Bug Tracker instead of this Bugzilla instance. This Bugzilla is left for reference purposes.

Bug 624 - button click emit doesn't work
: button click emit doesn't work
Status: CLOSED FIXED
Product: PySide
Classification: Unclassified
Component: QtGui
: 1.0.0 beta3
: PC Linux
: P1 normal
Assigned To: renato filho
:
:
:
  Show dependency treegraph
 
Reported: 2011-01-18 22:07 EET by tarunkhanna
Modified: 2011-01-21 15:44 EET (History)
8 users (show)

See Also:


Attachments
Sample source code (749 bytes, text/x-python)
2011-01-18 22:07 EET, tarunkhanna
Details

Note You need to log in before you can comment on or make changes to this bug.
Description tarunkhanna 2011-01-18 22:07:38 EET
Created attachment 225 [details]
Sample source code

If button.clicked is connected to a function and then emitted explicitly using
button.emit, it doesn't work.

In the following code, click of button 1 should cause the click signal for
button two, to also be emitted. That used to work before beta3, but doesn't
work anymore.

Thanks,
Tarun

from PySide.QtCore import *
from PySide.QtGui import *

import sys

class MyMainWindow(QWidget):
    def __init__(self):
        QWidget.__init__(self, None)
        self.b = []

        vbox = QVBoxLayout()

        for i in range(2):
            self.b.append(QPushButton("&Test " + str(i), self))
            vbox.addWidget(self.b[i])

        self.b[0].clicked.connect(self.buttonPushed)
        self.b[1].clicked.connect(self.button2Pushed)

        self.setLayout(vbox)

    def buttonPushed(self):
        self.b[1].clicked.emit()
    def button2Pushed(self):
        print 'button 2 pushed'

if __name__ == '__main__':

    app = QApplication(sys.argv)

    w = MyMainWindow()

    w.show()

    app.exec_()

    sys.exit()
Comment 1 Matti Airas 2011-01-19 06:37:09 EET
Hi, apparently you found our Bugzilla on your own. :-)

Thanks for the bug - since it's a regression, I'll prioritize it P1 to have it
fixed before the next release.
Comment 2 tarunkhanna 2011-01-19 10:28:49 EET
Just need to mention that I saw this problem on my 64 bit machine. Haven't had
a chance to try it out on the 32 bit machine.
Comment 3 renato filho 2011-01-21 13:45:51 EET
fixed on pyside commit:

commit 92847038553383dac2c41d5b02968fdd01603ced
Author: Renato Araujo Oliveira Filho <renato.filho@openbossa.org>
Date:   Thu Jan 20 17:27:53 2011 -0300
Comment 4 renato filho 2011-01-21 15:44:53 EET
release beta4