Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

QColorDialog doesn't preview alpha



  • When a QColorDialog is opened with the ShowAlphaChannel option, it adds a little box to change the alpha value, but it's not especially obvious. In other applications with an alpha channel in their colour picker, there's usually something more prominent, like a slider and/or some indication of the alpha value in the box showing the selected colour. For example, Paint.NET (not a link, I just can't see how to escape the link parsing when a dot is present) has both:

    599d574b-a265-420e-9431-d563ec9faabc-image.png

    There's a slider on the bottom right showing the current value and letting the user set it without typing, and in the top left, the preview box shows a checkerboard pattern.

    In contrast, the Qt dialogue just has the Alpha channel text and spinner in the bottom right:

    007ef37f-ef31-4ad0-bd53-61493da87aa6-image.png

    Users of my application have been confused by this, thinking they've set an opaque colour when it's actually been fully transparent.

    My recommendation would be to:

    • Add a slider to the right of the Val slider for the opacity when the ShowAlphaChannel option is active.
    • Blend the selected colour preview in the middle on top of a standard checkerboard pattern so the current opacity is obvious.

Log in to reply