summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--doc/src/snippets/code/src_opengl_qglcolormap.cpp5
1 files 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 <QApplication>
#include <QGLColormap>
-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);