Converting From Hexadecimal to QString
Unsolved
Game Development
-
Hi Guys,
This is my first post here and I'm hoping you can help me out. I've a project in which I have to implement unions so I'm doing so with a packed representation and component-wise representation of a hexadecimal color. The code below will clear things up but basically I'm stuck on how to convert from the hexadecimal to a QString so that I can use it in the stylesheet. If you have any ideas I'd really appreciate your help cause I've been unable to find an answer for the past few hours.//union typedef union color4bTag { unsigned int c; // packed representation struct argbTag // component-wise representation { unsigned char b; // (reversed for intel storage order) unsigned char g; unsigned char r; unsigned char a; } argb; } COLOR4B;
//setting color.c color4bTag color; color.c = 0x000000FF;
//stylesheet QString styleSheet( "QMainWindow{background-color: %1;} ); //seting background color QString varBGColour(/*What do I put here to get #000000FF*/); setStyleSheet(styleSheet.arg(varBGColour));