diff --git a/lib/matplotlib/backends/qt4_editor/formlayout.py b/lib/matplotlib/backends/qt4_editor/formlayout.py index e48a675d8e88..d599622e0bad 100644 --- a/lib/matplotlib/backends/qt4_editor/formlayout.py +++ b/lib/matplotlib/backends/qt4_editor/formlayout.py @@ -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 @@ -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""" @@ -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: