From e71c2a6d13e079e9e4d7a8446f2ef4c6958b18f8 Mon Sep 17 00:00:00 2001 From: artoka Date: Tue, 1 Nov 2011 13:47:17 +0100 Subject: QGLColormap example was invalid QGLColormap example missed int argc and char *argv[] from main - method. Filling the QGLColormap with for - loop was not working because of the 0 - size. Added arguments to main - method and changed the filling so that for-loop uses size of 256. Task-number: QTBUG-3563 Merge-request: 2698 Reviewed-by: Casper van Donderen --- doc/src/snippets/code/src_opengl_qglcolormap.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/doc/src/snippets/code/src_opengl_qglcolormap.cpp b/doc/src/snippets/code/src_opengl_qglcolormap.cpp index 3bd780b..535777d 100644 --- a/doc/src/snippets/code/src_opengl_qglcolormap.cpp +++ b/doc/src/snippets/code/src_opengl_qglcolormap.cpp @@ -42,7 +42,7 @@ #include #include -int main() +int main(int argc, char *argv[]) { QApplication app(argc, argv); @@ -51,7 +51,8 @@ int main() // This will fill the colormap with colors ranging from // black to white. - for (int i = 0; i < colormap.size(); i++) + const int size = 256; + for (int i = 0; i < size; ++i) colormap.setEntry(i, qRgb(i, i, i)); widget.setColormap(colormap); -- cgit v0.12