Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit d52152a

Browse files
committed
Update color button upon leaving lineedit, not while editing it
1 parent 695e8dd commit d52152a

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

lib/matplotlib/backends/qt4_editor/formlayout.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ def __init__(self, color, parent=None):
131131
QHBoxLayout.__init__(self)
132132
assert isinstance(color, QColor)
133133
self.lineedit = QLineEdit(color.name(), parent)
134-
self.connect(self.lineedit, SIGNAL("textChanged(QString)"),
134+
self.connect(self.lineedit, SIGNAL("editingFinished()"),
135135
self.update_color)
136136
self.addWidget(self.lineedit)
137137
self.colorbtn = ColorButton(parent)
@@ -140,7 +140,8 @@ def __init__(self, color, parent=None):
140140
self.update_text)
141141
self.addWidget(self.colorbtn)
142142

143-
def update_color(self, color):
143+
def update_color(self):
144+
color = self.text()
144145
qcolor = to_qcolor(color)
145146
self.colorbtn.color = qcolor # defaults to black if not qcolor.isValid()
146147

0 commit comments

Comments
 (0)