I am having problems displaying overlays on Linux with my NVIDIA card. The same code works on windows.
Answer:
The NVIDIA driver only offers RGBA overlays. The default setting in QGLFormat is to use an index-based overlays. You can switch to RGBA overlays using this code:
QGLFormat f = QGLFormat::defaultOverlayFormat();
f.setRgba(true);
QGLFormat::setDefaultOverlayFormat(f);