开发者

jamvm1.5+classpath-0.96+qt4.3 QPixmap: It is not safe to use pixmaps outside the GUI thread

jamvm -Dawt.toolkit=gnu.java.awt.peer.qt t开发者_C百科est

QPixmap: It is not safe to use pixmaps outside the GUI thread

I'm new to Qt, I don't know how to deal with it.


I have no experience whatsoever with the jamvm, but here's the Qt doc quote that might be helpful:

Qt provides four classes for handling image data: QImage, QPixmap, QBitmap and QPicture. QImage is designed and optimized for I/O, and for direct pixel access and manipulation, while QPixmap is designed and optimized for showing images on screen.

Try using QImage instead of QPixmap and see if there is the same warning/error message.


Since QPixmap is a device-dependent representation, and many display drivers and systems aren't thread-safe, QPixmap is restricted to only being used in the main or GUI thread, which is the same thread your QApplication object should be instantiated in. You can see a brief bit in the documentation here, and read more information about it in this discussion thread.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜