8000 Fix PySide compatibility by mspacek · Pull Request #2328 · matplotlib/matplotlib · GitHub
[go: up one dir, main page]

Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
8000 Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 3 additions & 4 deletions lib/matplotlib/backends/qt4_editor/formlayout.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ def choose_color(self):
def get_color(self):
return self._color

@QtCore.pyqtSignature("QColor")
@QtCore.Slot("QColor")
def set_color(self, color):
if color != self._color:
self._color = color
Expand All @@ -88,7 +88,7 @@ def set_color(self, color):
pixmap.fill(color)
self.setIcon(QtGui.QIcon(pixmap))

color = QtCore.pyqtProperty("QColor", get_color, set_color)
color = QtCore.Property("QColor", get_color, set_color)

def col2hex(color):
"""Convert matplotlib color to hex before passing to Qt"""
Expand All @@ -97,8 +97,7 @@ def col2hex(color):
def to_qcolor(color):
"""Create a QColor from a matplotlib color"""
qcolor = QtGui.QColor()
if isinstance(color, QtCore.QString):
color = str(color)
color = str(color)
try:
color = col2hex(color)
except ValueError:
Expand Down
0