From: isn Date: Tue, 20 Oct 2015 10:24:25 +0000 (+0300) Subject: static qvector of color X-Git-Tag: v1.5~81 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=1c9eb6da9a3b95d5ba614eb09e24f66e229f4b3d;p=modules%2Fhydro.git static qvector of color --- diff --git a/src/HYDRO_tests/TestViewer.cxx b/src/HYDRO_tests/TestViewer.cxx index 7dcec1aa..5863579a 100644 --- a/src/HYDRO_tests/TestViewer.cxx +++ b/src/HYDRO_tests/TestViewer.cxx @@ -67,14 +67,17 @@ Handle(AIS_InteractiveContext) context() QColor TestViewer::GetColor(int i) { - QVector 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 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]; }