I have a class where I declare some public static const QColors in my .h file:

Qt Code:
  1. class myClass
  2. {
  3. public:
  4. ...
  5. static const QColor GREEN;
  6. static const QColor BLUE;
  7. static const QColor RED;
  8. static const QColor ORANGE;
  9. ...
  10. }
To copy to clipboard, switch view to plain text mode 

Then at the top of my .cpp file, I have:
Qt Code:
  1. const QColor myClass::GREEN = QColor(0, 204, 0);
  2. const QColor myClass::BLUE = QColor(0, 102, 255);
  3. const QColor myClass::RED = QColor( 255, 0, 0);
  4. const QColor myClass::ORANGE = QColor(255, 153, 0);
To copy to clipboard, switch view to plain text mode 

Later, in a function inside myClass, when I try to say:

Qt Code:
  1. QColor newColor = myClass::GREEN; // Also tried QColor newColor = GREEN;
  2. qDebug( ) << newColor;
To copy to clipboard, switch view to plain text mode 

It prints out that newColor is "QColor(Invalid)"

What is wrong with declaring these QColors this way?