summaryrefslogtreecommitdiffstats
path: root/src/datavisualization/utils
diff options
context:
space:
mode:
authorMiikka Heikkinen <miikka.heikkinen@digia.com>2013-12-13 13:35:42 +0200
committerMiikka Heikkinen <miikka.heikkinen@digia.com>2013-12-13 14:35:32 +0200
commit642e3fb0d91cca401ebba0221f46bc32fccc1e74 (patch)
tree7f684b0941c8593b84bf9687ad8093f1b12ccc66 /src/datavisualization/utils
parent8f358742159ebf151ff8187f1a6d8a05ac5c0207 (diff)
Fix more valgrind issues
+ some misc fixes Change-Id: I728da6779bea026d0554d8aae5c00254c3c27694 Reviewed-by: Mika Salmela <mika.salmela@digia.com> Reviewed-by: Pasi Keränen <pasi.keranen@digia.com>
Diffstat (limited to 'src/datavisualization/utils')
-rw-r--r--src/datavisualization/utils/utils.cpp6
1 files changed, 2 insertions, 4 deletions
diff --git a/src/datavisualization/utils/utils.cpp b/src/datavisualization/utils/utils.cpp
index 1ec5fc05..e6f33032 100644
--- a/src/datavisualization/utils/utils.cpp
+++ b/src/datavisualization/utils/utils.cpp
@@ -131,12 +131,10 @@ QImage Utils::printTextToImage(const QFont &font, const QString &text, const QCo
QVector3D Utils::getSelection(QPoint mousepos, int height)
{
- QVector3D selectedColor;
-
//#if defined(QT_OPENGL_ES_2)
// This is the only one that works with ANGLE (ES 2.0)
// Item count will be limited to 256*256*256
- GLubyte pixel[4];
+ GLubyte pixel[4] = {255, 255, 255, 0};
glReadPixels(mousepos.x(), height - mousepos.y(), 1, 1, GL_RGBA, GL_UNSIGNED_BYTE,
(void *)pixel);
@@ -155,7 +153,7 @@ QVector3D Utils::getSelection(QPoint mousepos, int height)
// GL_RGB, GL_FLOAT, (void *)pixel3);
//qDebug() << "rgba" << pixel3[0] << pixel3[1] << pixel3[2];// << pixel[3];
//#endif
- selectedColor = QVector3D(pixel[0], pixel[1], pixel[2]);
+ QVector3D selectedColor(pixel[0], pixel[1], pixel[2]);
//qDebug() << selectedColor;
return selectedColor;