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 988 - The type supplied with currentChanged signal in QTabWidget has changed in 1.0.6
: The type supplied with currentChanged signal in QTabWidget has changed in 1.0.6
Status: CLOSED FIXED
Product: PySide
Classification: Unclassified
Component: QtGui
: 1.0.6
: All All
: P1 normal
Assigned To: Hugo Parente Lima
:
:
:
  Show dependency treegraph
 
Reported: 2011-08-27 11:45 EEST by Bjorn Helge Kjosnes
Modified: 2011-09-21 20:49 EEST (History)
10 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Bjorn Helge Kjosnes 2011-08-27 11:45:02 EEST
I got some problems with my program after I updated to 1.0.6. The QTabWidget
currentChanged gives me the QWidget on the tab changed to instead of the
expected int that it has been before.

The documentation indicates that it should indeed be an int:
http://www.pyside.org/docs/pyside/PySide/QtGui/QTabWidget.html#PySide.QtGui.PySide.QtGui.QTabWidget.currentChanged


Here is a code snippet showing the problem.

from PySide import QtCore, QtGui

class MainWindow(QtGui.QMainWindow):
    def __init__(self):
        super(MainWindow, self).__init__()
        self.main = QtGui.QTabWidget()
        self.main.currentChanged.connect(self._changed)
        self.t1 = QtGui.QTextEdit()
        self.main.addTab(self.t1,'Tab 1')
        self.t2 = QtGui.QTextEdit()
        self.main.addTab(self.t2,'Tab 2')
        self.t3 = QtGui.QTextEdit()
        self.main.addTab(self.t3,'Tab 3')
        self.setCentralWidget(self.main)

    def _changed(self,to):
        print 'This should have been an integer: %s' % to


if __name__ == '__main__':
    import sys

    app = QtGui.QApplication(sys.argv)
    mainWin = MainWindow()
    mainWin.show()
    sys.exit(app.exec_())
Comment 1 Hugo Parente Lima 2011-08-29 16:26:54 EEST
currentChanged(QWidget) should not exists at all, it only exist when Qt3
support is enabled in Qt, but PySide doesn't support this.

Thanks for report, as a workaround you could use:

self.main.currentChanged[int].connect(self._changed)
Comment 2 Hugo Parente Lima 2011-08-29 17:15:36 EEST
Raising priority to P1 as it's a regression.
Comment 3 Hugo Parente Lima 2011-08-31 00:44:12 EEST
Fixed in commit

pyside/93d87b2fc77031a6fe7d9c770ada5930f180e006
Comment 4 Hugo Parente Lima 2011-08-31 17:30:26 EEST
*** Bug 967 has been marked as a duplicate of this bug. ***
Comment 5 Hugo Parente Lima 2011-09-05 17:05:49 EEST
*** Bug 1001 has been marked as a duplicate of this bug. ***
Comment 6 renato filho 2011-09-21 20:49:28 EEST
Release 1.0.7