PDA

View Full Version : What is the relation between QWidget/QPaintDevice and native "Device Context"?



agnus
18th November 2009, 00:32
Hello again. I was wondering what is the mapping between QWidget/QPaintDevice and native device contexts (http://en.wikipedia.org/wiki/Graphics_Device_Interface#Technical_details). Supposedly we have to render 1 top level window with 10 widgets of various kinds. Does each widget map to 1 separate native DC?

In Java Swing, as far as I know, only the top level windows have a native device context but the rest of components (widgets) do not.

wysota
18th November 2009, 02:41
Since some time in Qt only the top-level window is tied to a real widget (or device context, if you may) unless you explicitly or implicitly ask to be otherwise. You may search for the term "Aliens" regarding Qt.

http://labs.trolltech.com/blogs/2007/08/09/qt-invaded-by-aliens-the-end-of-all-flicker

agnus
18th November 2009, 03:43
Very helpful. Thank you :)