PDA

View Full Version : Creating array of QColors?



ei7024
21st November 2015, 20:30
Hi,

New some help with creating an array that holds the different QColors. I am working on MSVC 12 and using Qt 5.3.1
From what i know to create an integer array one would simply use


int myInt[3] = {5, 12, 4};


So here is what I have


mColorButton = new PaletteButton(Qt::white);

this class is initialized as follows


PaletteButton(const QColor &color);

my intention is to store the different colors used by the PaletteButton in an array. Some like this


Qcolor myPaletteColor[3] = {Qt::black, Qt::white, Qt::gray};

Is this possible? Any ideas would be helpful!

Thanks,

ei7024
22nd November 2015, 03:49
Figured it out the Qt::Black was enum value declared from another name space.....initialized the array using the enum name from the pointed namespace by Qt:black