[Qt-interest] native painting in a QWidget on Windows

John Weeks john at wavemetrics.com
Wed Dec 29 21:35:31 CET 2010


It seems that I sent my follow-up to myself, instead of to the list. I am still thinking about the pointers posted a while back about why setting the Reply To field is a bad idea...

On Dec 28, 2010, at 3:49 PM, John Weeks wrote:

> In thinking about my problem (in the absence of a better solution) it seemed like perhaps I could create a memory device context (a bitmap context) and do my drawing into that. When the drawing is done, convert it to a QPixMap (presumably using QPixmap::fromWinHBITMAP) and then draw the QPixMap into my widget using QPainter::drawPixMap().

In the meantime, I have made a trivial test implementation of this, and it works. Now the question becomes, does it work slowly? I'm not sure my trivial test case is equal to measuring that. I did step into QPixmap::fromWinHBITMAP(), and see that it creates a QImage before making the QPixMap. I'm guessing that this all involves at least one copy of the bitmap data, if not two.

I'm still really interested in any reaction you folks might have to this idea, or any alternate solution to the problem of native drawing into a QWidget on Windows.

Regards,
John Weeks

WaveMetrics, Inc.
Phone (503) 620-3001
Fax   (503) 620-6754
email   support at WaveMetrics.com

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.qt-project.org/pipermail/qt-interest-old/attachments/20101229/b908ae33/attachment.html 


More information about the Qt-interest-old mailing list