8000 Test for QString, not QObject · matplotlib/matplotlib@f7bee43 · GitHub
[go: up one dir, main page]

Skip to content

Commit f7bee43

Browse files
committed
Test for QString, not QObject
1 parent 8f3baf0 commit f7bee43

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

lib/matplotlib/backends/qt4_editor/formlayout.py

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -67,8 +67,8 @@
6767
QtGui.QDateTimeEdit, QtGui.QFont, QtGui.QFontComboBox, QtGui.QFontDatabase,
6868
QtGui.QGridLayout, QtGui.QFormLayout, QtGui.QDoubleValidator)
6969

70-
(Qt, SIGNAL, SLOT, QObject, QSize,pyqtSignature, pyqtProperty) =\
71-
(QtCore.Qt, QtCore.SIGNAL, QtCore.SLOT, QtCore.QObject, QtCore.QSize,
70+
(Qt, SIGNAL, SLOT, QString, QSize, pyqtSignature, pyqtProperty) =\
71+
(QtCore.Qt, QtCore.SIGNAL, QtCore.SLOT, QtCore.QString, QtCore.QSize,
7272
QtCore.Slot, QtCore.Property)
7373
if not hasattr(QtGui, 'QFormLayout'):
7474
raise ImportError("Warning: formlayout requires PyQt4 >v4.3 or PySide")
@@ -114,9 +114,8 @@ def col2hex(color):
114114
def to_qcolor(color):
115115
"""Create a QColor from a matplotlib color"""
116116
qcolor = QColor()
117-
if isinstance(text, QObject):
118-
# actually a QString, which is not provided by the new PyQt4 API:
119-
text = str(text)
117+
if isinstance(color, QString):
118+
color = str(color)
120119
try:
121120
color = col2hex(color)
122121
except ValueError:

0 commit comments

Comments
 (0)
0