Logo Search packages:      
Sourcecode: qt4-x11 version File versions

src_opengl_qglcolormap.cpp

//! [0]
#include <QApplication>
#include <QGLColormap>

int main()
{
    QApplication app(argc, argv);

    MySuperGLWidget widget;     // a QGLWidget in color-index mode
    QGLColormap colormap;

    // This will fill the colormap with colors ranging from
    // black to white.
    for (int i = 0; i < colormap.size(); i++)
        colormap.setEntry(i, qRgb(i, i, i));

    widget.setColormap(colormap);
    widget.show();
    return app.exec();
}
//! [0]

Generated by  Doxygen 1.6.0   Back to index