QColorDialog.getColor is a static method, call it accordingly

This commit is contained in:
Philipp Wolfer
2019-08-31 15:53:17 +02:00
parent b13d1f2932
commit 956cabbaa7

View File

@@ -53,8 +53,7 @@ class ColorButton(QtWidgets.QPushButton):
self.setStyleSheet("QPushButton { background-color: %s; }" % self.color.name())
def open_color_dialog(self):
dlg = QtWidgets.QColorDialog()
new_color = dlg.getColor(self.color, title=_("Choose a color"), parent=self)
new_color = QtWidgets.QColorDialog.getColor(self.color, title=_("Choose a color"), parent=self)
if new_color.isValid():
self.color = new_color