PDA

View Full Version : Question about QColorDialog maybe a bug?



Wurgl
8th November 2014, 19:25
First of all a minimalist test program to see what I mean …


#include <Qt/qcolordialog.h>
#include <Qt/qapplication.h>

int main(int argc, char **argv)
{
QApplication a(argc, argv);
QColor c(127,127,127);
QColorDialog::getColor(c, 0, "test", QColorDialog::ShowAlphaChannel);
}


I am running Linux and have Qt 4.8.4 installed. This is the version which comes with Suse 12.3 (will upgrade end of december, but not earlier).

When I start this program, then the colordialog shows up. Fine.
There is a combobox which initially shows "Forty Colors", change the selection to "Named Colors"
After doing so, below you can read "Name: AliceBlue" and "HTML: #F0F8FF"
==> Fine so far.

Now select the named color "AntiqueWhite".
After that you see (again below) "Name: -unnamed-" and "HTML: #FAEBD7"
==> Well, no name, but I can accept that.

So let us switch back and select again AliceBlue
After that you see "Name: -unnamed-" and "HTML: #F0F8FF"
==> Now the name is lost? Why? When initially switching the color had a name?

Now select AntiqueWhite1
After that you see "Name: AntiqueWhite1" and "HTML: #FFEFDB"
==> Fine again, I see the color name!

So let us switch back and select again AliceBlue
After that you see "Name: AliceBlue" and "HTML: #F0F8FF"
==> Oops! The color name is here again!

You can click around in those list of color names, when clicking on some colors, you will see name *and* you may even see a name on the next color, when clicking on other colors you will not see a name, and what I expect to be a bug, you will not see a name for the next selected color.

I do not see a bug in my program, it is so minimal, that there is not enough space for such a monster. The behaviour also does not depend on the parameter QColorDialog::ShowAlphaChannel.

Is this a bug in Qt?