Skip to content

standardPixmap issue in properties bin widgets on Qt 5.15.2.1 #454

Closed
@herronelou

Description

@herronelou

https://github.com/jchanvfx/NodeGraphQt/blob/a8fa9b394d35bf4fcad3c241ec1bd7a98b40bb1c/NodeGraphQt/custom_widgets/properties_bin/node_property_widgets.py#L319C26-L319C41

Raising an error saying that not enough arguments are passed to standardPixmap when called out of Nuke 14.0 (Qt 5.15.2.1).

Per the PySide2 documentation, https://doc.qt.io/qtforpython-5/PySide2/QtWidgets/QStyle.html#PySide2.QtWidgets.PySide2.QtWidgets.QStyle.standardPixmap it is recommended to use standardIcon instead.

Changing:

         close_btn = QtWidgets.QPushButton()
-        close_btn.setIcon(QtGui.QIcon(
-            self.style().standardPixmap(
-                QtWidgets.QStyle.SP_DialogCloseButton
-            )
-        ))
+        close_btn.setIcon(self.style().standardIcon(
+            QtWidgets.QStyle.SP_DialogCloseButton)
+        )

seems to do the trick, but also needs to be done for

tree.style().standardPixmap(QtWidgets.QStyle.SP_DialogYesButton)

After fixing these 2 I was able to display my nodes in the properties bin.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions