One thing...
This is a bug:

self.setParent = parentWindow

You replace the actual setParent() method on your button which might cause
confusing errors later. There isn't a reason to save that parent since you
can query it any time with self.parent()



On Fri, Aug 24, 2018, 5:58 PM <[email protected]> wrote:

> Hi. This is how I fix it, thanks to you guys. I dont know why I was
> creating a function for the button:
>
> class CustomButtom(QtGui.QPushButton):
>     def __init__(self, parentWindow, buttonName, windowsList, icon):
>         super(CustomButtom, self).__init__(parentWindow)
>
>         #self.icon = QtGui.QIcon(":/clusterHandle.svg")
>         QtIcon = QtGui.QIcon(icon)
>         self.setParent = parentWindow
>         self.setObjectName(buttonName)
>         self.setGeometry(QtCore.QRect(0, 0, 50, 50))
>         self.setIcon(QtIcon)
>         self.setIconSize(QSize(45, 45))
>         self.clicked.connect(partial(self.closeWindow, windowsList))
>         self.setMouseTracking(1)
>         self.setStyleSheet("border: none;")
>
> thanks again
>
> --
> 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/4864dffa-cb76-4150-b53f-d37cd9dacb52%40googlegroups.com
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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/CAPGFgA1F%2BX0i6b14bSUjXYnAiQ8w9sNzS%3DPS0wQhzYqGJQD65w%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to