8000 Merge pull request #2328 from mspacek/qtapi · benzea/matplotlib@8bba2a4 · GitHub
[go: up one dir, main page]

Skip to content

Commit 8bba2a4

Browse files
committed
Merge pull request matplotlib#2328 from mspacek/qtapi
Fix PySide compatibility
2 parents c001797 + cea9000 commit 8bba2a4

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

lib/matplotlib/backends/qt4_editor/formlayout.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ def choose_color(self):
7979
def get_color(self):
8080
return self._color
8181

82-
@QtCore.pyqtSignature("QColor")
82+
@QtCore.Slot("QColor")
8383
def set_color(self, color):
8484
if color != self._color:
8585
self._color = color
@@ -88,7 +88,7 @@ def set_color(self, color):
8888
pixmap.fill(color)
8989
self.setIcon(QtGui.QIcon(pixmap))
9090

91-
color = QtCore.pyqtProperty("QColor", get_color, set_color)
91+
color = QtCore.Property("QColor", get_color, set_color)
9292

9393
def col2hex(color):
9494
"""Convert matplotlib color to hex before passing to Qt"""
@@ -97,8 +97,7 @@ def col2hex(color):
9797
def to_qcolor(color):
9898
"""Create a QColor from a matplotlib color"""
9999
qcolor = QtGui.QColor()
100-
if isinstance(color, QtCore.QString):
101-
color = str(color)
100+
color = str(color)
102101
try:
103102
color = col2hex(color)
104103
except ValueError:

0 commit comments

Comments
 (0)
0