Unfortunately you can't simply grab a precompiled build of PyQt and start
using it in Maya. Maya has a custom build of Qt, and your PyQt has to be
linked against it, otherwise you can end up with expected problems. Hence
the reason people have been hosting PyQt builds for different platforms and
Maya versions. So that might be your reason for crashing.
Having PySide now shipped with 2014 definitely makes this all much easier,
since you don't have to build anything.

As for your snippet... it seems to be doing a bunch of odd things.
Why are you using eval?
Why looping over length range of the list just to get the list value back
out?

When I reduce it to what I think it is doing, I end up with this:

for label in bttnLabels:
    bttn = QPushButton(label)
    self.mapper.setMapping(bttn, label)
    bttn.clicked.connect(self.mapper.map)
    buttonLayout.addWidget(bttn)


... which then can be switched to using partial instead of signal mapper
with this:

for label in bttnLabels:
    bttn = QPushButton(label)
    button.clicked.connect(partial(self.sayIt, label))




On Fri, Oct 25, 2013 at 10:05 AM, joshua ochoa <[email protected]> wrote:

> i used the latest win pyqt installer:
>
> http://sourceforge.net/projects/pyqt/files/PyQt4/PyQt-4.10.3/PyQt4-4.10.3-gpl-Py2.7-Qt4.8.5-x64.exe
>  from here:
> http://www.riverbankcomputing.com/software/pyqt/download
>
> autodesk docs says 2014 is using Qt4.8.2
> http://images.autodesk.com/adsk/files/pyqtmaya2014.pdf
>
> based on the url for the exe i dont really know what version correlates w/
> what.
> ...
> my pipeline spider sense is leaning towards your suggestion of the version
> compatibility being off.
>
> i need to upgrade to Service Pack 1 before going down the build route.
>
> thanks for the code tip but the QSignalMapper is facilitating the need for
> dynamic button creation based on a list of strings.
> here is what that snippet looks like:
> ##########################################
> ...
> for n in range(len(bttnLabels)):
>     bttn = eval( 'QPushButton("%s")' % (QString(bttnLabels[n])) )
>     self.mapper.setMapping(bttn,bttnLabels[n])
>     bttn.clicked[()].connect(self.mapper.map)
>
>     buttonLayout.addWidget(bttn)
>
> self.mapper.mapped[QString].connect(self.sayIt)
> ...
> ##########################################
> let me know if you/anyone might have a little alternative recipe for that.
>
>
>  --
> 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/CAP9wtn75V9Lykbx_yLOxzr6sUBUPEodmNY3o4NB1-bsA9yCnAw%40mail.gmail.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/CAPGFgA1Jf3vfA%3DrR%2BpDuW2Z%3D6DDh-1bkrp9Ro4N7kUn_sHT%3Dvg%40mail.gmail.com.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to