I can't reproduce it in 2013, using PyQt 4.8.6. Are you sure you have the
right match of Qt/PyQt built for 2014?
Also, have you considered switching to PySide, since its bundled with 2014?
(unless you have to support backwards compatible PyQt/Maya combinations)

You could work around this problem by not using QSignalMapper at all, and
swapping to functools.partial:

from functools import partial
...
        self.b1.clicked.connect(partial(self.sayIt, "B1"))
        self.b2.clicked.connect(partial(self.sayIt, "B2"))

    def sayIt(self, name):
        print name



On Fri, Oct 25, 2013 at 6:08 AM, zoshua <[email protected]> wrote:

> hey all,
>
> ##########################################
> my current setup...
> os: windows 7 Pro 64
> maya: 2014 x64 (version 20130301024-864206)
>
> ##########################################
> the issue...
> running the following code and clicking either of the buttons consistently
> crashes maya.
> the error seems to be an "Unhandled Exception"
> i have whittled it down to the issue being the QSignalMapper
>
> ##########################################
> from PyQt4.QtCore import *
> from PyQt4.QtGui import *
> class Test(QWidget):
>     def __init__(self, parent=None):
>         super(Test, self).__init__(parent)
>         layout = QVBoxLayout()
>         self.b1 = QPushButton("B1")
>         self.b2 = QPushButton("B2")
>         layout.addWidget(self.b1)
>         layout.addWidget(self.b2)
>         self.setLayout(layout)
>         self.mapper = QSignalMapper(self)
>         self.mapper.setMapping(self.b1, "B1")
>         self.mapper.setMapping(self.b2, "B2")
>         self.b1.clicked.connect(self.mapper.map)
>         self.b2.clicked.connect(self.mapper.map)
>         self.mapper.mapped[QString].connect(self.sayIt)
>
>     @pyqtSlot(QString)
>     def sayIt(self, name):
>         print name
>
> t = Test()
> t.show()
> ##########################################
>
> anyone have any insight on this one?
>
> --
> You received this message because you are subscribed to the Google Groups
> "Python Programming for Autodesk Maya" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/python_inside_maya/56504c3e-a97d-4bc1-ba51-86c2e674c1a9%40googlegroups.com
> .
> For more options, visit https://groups.google.com/groups/opt_out.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Python Programming for Autodesk Maya" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/python_inside_maya/CAPGFgA3-UQ__niAi-oDGeumxcjkrC7Nj3R43jfJ2exbQZXh2_g%40mail.gmail.com.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to