Skip to content

PythonQt.Qt.QGLColormap

QGLColormap

PythonQtInstanceWrapper object

Native bases: PythonQtInstanceWrapper

Supplemental documentation: Qt 5 reference:

Detailed Description

QGLColormap provides a platform independent way of specifying and installing indexed colormaps for a QGLWidget. QGLColormap is especially useful when using the OpenGL color-index mode.

Under X11 you must use an X server that supports either a PseudoColor or DirectColor visual class. If your X server currently only provides a GrayScale, TrueColor, StaticColor or StaticGray visual, you will not be able to allocate colorcells for writing. If this is the case, try setting your X server to 8 bit mode. It should then provide you with at least a PseudoColor visual. Note that you may experience colormap flashing if your X server is running in 8 bit mode.

The size() of the colormap is always set to 256 colors. Note that under Windows you can also install colormaps in child widgets.

This class uses implicit sharing as a memory and speed optimization.

Example of use:

#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();
}

Source: https://doc.qt.io/archives/qt-5.15/qglcolormap.html

Complete member index

Every captured member retains its own identity. Identical captured declaration text is linked once; this does not establish native inheritance or interchangeable objects.

Member Kind Signature Summary
__init__ function (self, *args: Any, **kwargs: Any) -> None Native constructor; consult class documentation for supported overloads. (shared captured text)
className function (self, *args: Any, **kwargs: Any) -> Any Return the classname of the object (shared captured text)
delete function (self, *args: Any, **kwargs: Any) -> Any Deletes the C++ object (at your own risk, my friend!) (shared captured text)
entryColor function (self, idx: int) -> Any X.entryColor(idx) -> PythonQt.QtGui.QColor (shared captured text)
entryRgb function (self, idx: int) -> int X.entryRgb(idx) -> int (shared captured text)
find function (self, color: int) -> int X.find(color) -> int (shared captured text)
findNearest function (self, color: int) -> int X.findNearest(color) -> int (shared captured text)
handle function (self) -> int (shared captured text)
help function (self, *args: Any, **kwargs: Any) -> Any Shows the help of available methods for this class (shared captured text)
inherits function (self, *args: Any, **kwargs: Any) -> Any Returns if the class inherits or is of given type name (shared captured text)
isEmpty function (self) -> bool X.isEmpty() -> bool (shared captured text)
setEntry function (self, idx: int, color: Any) -> None X.setEntry(idx, color) (shared captured text)
setHandle function (self, ahandle: int) -> None (shared captured text)
size function (self) -> int X.size() -> int (shared captured text)