[Qt-interest] opengl on MDI subwindow?

Bradley Smith bradley at baysmith.com
Thu Nov 19 20:11:49 CET 2009


> Does this signal some sort of bug?

Perhaps. I've been tracking down messages like these in some code I'm
converting from Qt 3 to Qt 4. To find the source of the message I
generally take the following approach. I use this on Linux using a
debug build of Qt 4.5.3.

shell> cd qt-all-opensource-src-4.5.3/src/gui
shell> grep -n 'QPainter::begin: Cannot paint on a null pixmap' */*
painting/qpainter.cpp:1735:                qWarning("QPainter::begin:
Cannot paint on a null pixmap");

Copy above location from shell to gdb.

(gdb) dir /full/path/to/qt-all-opensource-src-4.5.3/src/gui
(gdb) break painting/qpainter.cpp:1735
(gdb) run
... hopefully breaks at qWarning line
(gdb) where

Sometimes it doesn't break. Sometimes the message is being generated
on later updates in the paint cycle. But sometimes it pinpoints the
place where painting is going astray.

Of course, the messages I'm looking for are certainly caused by my
code and not a bug.

  Bradley




More information about the Qt-interest-old mailing list