简体   繁体   中英

Is it possible to add a native child window to a Qt widget?

I need to do some platform specific drawing in my Qt app, so I want to add a Windows child window to my Qt Widget. I call CreateWindowEx and pass effectiveWinId() as the parent. The child window is created successfully. However, the drawing in my Qt app stops working. Widgets will no longer repaint.

Is there anyway to do this? There was QWinHost in Qt 3, but it doesn't appear to be in Qt 4.

Normally have to overide the paintEvent(QPaintEvent*)

You can also set setAttribute(Qt::WA_PaintOnScreen,true); to tell Qt not to bother drawing.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM