From dcf7a98e0cf4a638fdf859fd9790d69d9e378720 Mon Sep 17 00:00:00 2001 From: Nyall Dawson Date: Tue, 4 Apr 2023 13:30:09 +1000 Subject: [PATCH] Apply suggestions from code review --- python/PyQt/PyQt5/QtGui.py | 36 +++++------------------------------- 1 file changed, 5 insertions(+), 31 deletions(-) diff --git a/python/PyQt/PyQt5/QtGui.py b/python/PyQt/PyQt5/QtGui.py index 5fe3a2a3166..ca0faaae0d4 100644 --- a/python/PyQt/PyQt5/QtGui.py +++ b/python/PyQt/PyQt5/QtGui.py @@ -28,41 +28,15 @@ def __qcolor_repr__(self: QColor): if not self.isValid(): return '' elif self.spec() == QColor.Rgb: - return ''.format( - self.red(), - self.green(), - self.blue(), - self.alpha() - ) + return f'' elif self.spec() == QColor.Hsv: - return ''.format( - self.hsvHue(), - self.hsvSaturation(), - self.value(), - self.alpha() - ) + return f'' elif self.spec() == QColor.Cmyk: - return ''.format( - self.cyan(), - self.magenta(), - self.yellow(), - self.black(), - self.alpha() - ) + return f'' elif self.spec() == QColor.Hsl: - return ''.format( - self.hslHue(), - self.hslSaturation(), - self.lightness(), - self.alpha() - ) + return f'' elif self.spec() == QColor.ExtendedRgb: - return ''.format( - self.redF(), - self.greenF(), - self.blueF(), - self.alphaF() - ) + return f'' # PyQt doesn't provide __repr__ for QColor, but it's highly desirable!