Skip to content

[Bug]: formlayout fails on PyQt6 due to the unqualified enum ShowAlphaChannel in class ColorButton #22471

@MAKOMO

Description

@MAKOMO

Bug summary

QtWidgets.QColorDialog.ShowAlphaChannel

needs to be qualified on PyQt6 as

QtWidgets.QColorDialog.ColorDialogOption.ShowAlphaChannel

in class ColorButton (backends/qt_editor/_formlayout.py)

or the _enum() magic needs to be applied.

Code for reproduction

Open figureoptions:figure_edit and click one of those color edit buttons

Actual outcome

Traceback (most recent call last):
  File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/matplotlib/backends/qt_editor/_formlayout.py", line 74, in choose_color
    QtWidgets.QColorDialog.ShowAlphaChannel)
AttributeError: type object 'QColorDialog' has no attribute 'ShowAlphaChannel'

Expected outcome

The color chooser dialog of the operating system should open

Additional information

No response

Operating system

tested on macOS but should affect all platforms

Matplotlib Version

3.5.1 and trunk

Matplotlib Backend

PyQt6

Python version

3.10.2

Jupyter version

No response

Installation

pip

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions