Hi

How do you make a code block Justin?

I would like to throw in what I found updating my script to PySide in the 
flowlayout. The example that comes with PySide itself was using some 
deprecated method too. The setMargin

if parent is not None:
    self.setMargin(margin)


The new one is setContentsMargins which takes 4 arguments for margin of 
each side. Just my quick silly fix.

if parent is not None:
    self.setContentsMargins(margin, margin, margin, margin)


the margin() method is deprecated too, so need to change this.

2 * self.margin()

to this

2 * self.getContentsMargins()[0]






On Saturday, April 18, 2015 at 4:58:30 AM UTC+7, Justin Israel wrote:
>
> Hey there,
>
> I found the reason it was showing up strangely under PySide. It is because 
> the code was using a now deprecated method, on QTableWidgetItem. In the 
> "showAttributes()" method, you need to change this line:
>
> item.setBackgroundColor(QtGui.QColor(40,40,40))
>
> ​
> to
>
> item.setBackground(QtGui.QBrush(QtGui.QColor(40,40,40)))
>
> ​
> It was still valid in PyQt4, but in PySide has been changed. For me, I got 
> a warning printing out in the Script Editor. Basically the loop would crash 
> while setting up the attributes, so you ended up with a partially 
> constructed channel box.
>
> Justin
>

-- 
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/864aa775-25da-476e-bad6-0fe4bd097d57%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to