QColor TestViewer::GetColor(int i)
{
- QVector<QColor> aCV;
- aCV << QColor(0,0,255)
- << QColor(0,255,0)
- << QColor(255,0,0)
- << QColor(255,255,20)
- << QColor(20,255,255)
- << QColor(100,100,20)
- << QColor(10,100,150);
+ static QVector<QColor> aCV;
+ if (aCV.isEmpty())
+ {
+ aCV << QColor(0,0,255)
+ << QColor(0,255,0)
+ << QColor(255,0,0)
+ << QColor(255,255,20)
+ << QColor(20,255,255)
+ << QColor(100,100,20)
+ << QColor(10,100,150);
+ }
return aCV[i];
}