Salome HOME
static qvector of color
authorisn <isn@opencascade.com>
Tue, 20 Oct 2015 10:24:25 +0000 (13:24 +0300)
committerisn <isn@opencascade.com>
Tue, 20 Oct 2015 10:24:25 +0000 (13:24 +0300)
src/HYDRO_tests/TestViewer.cxx

index 7dcec1aa3c2a972d91bd0318082ad995617a7522..5863579a732aac015c4724685a06bb26d600b73f 100644 (file)
@@ -67,14 +67,17 @@ Handle(AIS_InteractiveContext) context()
 
 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];
 }