I'm using a
in PyQt5 to let the user select a color. My code looks like this:
result = QColorDialog.getColor(QColor(self.red, self.green, self.blue))
self.red, self.green, self.blue = result.red(), result.green(), result.blue()
This works fine so far, however I am unable to detect whether the user cancelled the dialog.
Even when the dialog is canceled, the returned color is
QColor(0, 0, 0, 255)
, and not
, as expected.
Is there a way to detect whether the dialog got canceled using the static
method? Or do I have to manually construct a