static inline long long color_to_int(QColor color)
{
auto shift = [&](unsigned val, int shift)
{
return ((val & 0xff) << shift);
};
return shift(color.red(), 0) |
shift(color.green(), 8) |
shift(color.blue(), 16) |
shift(color.alpha(), 24);
}
查阅开源源码所得。暂未验证