I have a char[4]
and I want to be able to cast it into a QColor
is there a way that I can directly convert rather than doing this:
const char foo[4] = { 128, 128, 128, 128 };
const QColor bar( foo[0], foo[1], foo[2], foo[3] );
I have a char[4]
and I want to be able to cast it into a QColor
is there a way that I can directly convert rather than doing this:
const char foo[4] = { 128, 128, 128, 128 };
const QColor bar( foo[0], foo[1], foo[2], foo[3] );
I will assume that you are using RGBA, so you can use the corresponding constructor:
You could also use the following static method: