Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[PyQt] Fix None pixmap, USING_PYQT for PyQt5 #92

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# ---- ignore special files written during config setup
tk-metadata

# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
Expand Down
2 changes: 1 addition & 1 deletion python/overlay_widget/shotgun_overlay_widget.py
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ def _set_mode(self, mode, payload=None):
if mode == self.MODE_INFO_PIXMAP:
self.setPixmap(payload)
else:
self.setPixmap(None)
self.setPixmap(QtGui.QPixmap()) # i.e. self.pixmap().isNull()

# Decide which kind of string we need to show.
if mode == self.MODE_ERROR:
Expand Down
2 changes: 1 addition & 1 deletion python/shotgun_fields/bubble_widget.py
Original file line number Diff line number Diff line change
Expand Up @@ -412,7 +412,7 @@ class _BubbleTextObject(QtGui.QPyTextObject):

BUBBLE_DATA_PROPERTY = 1
OBJECT_TYPE = QtGui.QTextFormat.UserFormat + 1
USING_PYQT = hasattr(QtCore, "QVariant")
USING_PYQT = not hasattr(QtCore, "ClassInfo") # Only PySide has ClassInfo

def __init__(self, parent=None):
"""
Expand Down
2 changes: 1 addition & 1 deletion python/views/widget_delegate.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
import sgtk
from sgtk.platform.qt import QtCore, QtGui

USING_PYQT = hasattr(QtCore, "QVariant")
USING_PYQT = not hasattr(QtCore, "ClassInfo") # Only PySide has ClassInfo


class WidgetDelegate(QtGui.QStyledItemDelegate):
Expand Down