Conversion of Qwidget and HWND to each other
When writing Windows applications, we sometimes inevitably have to deal with the Win32 API inherent in the Windows platform, but there are many handles such as HWND that are often used in the Win32 API. Qt as a good cross-platform GUI library, can not be considered, then need to convert each other when to do?
HWND Turn Qwidget
| 123 |
QWidget *myWidget;HWNDhwnd;myWidget=QWidget::find(hwnd); |
Qwidget Turn hwnd
| 123 |
QWidget *myWidget;HWNDhwnd;hwnd=(HWND)myWidget->winId(); |
Qpixmap and Hbitmap, hicon with each other
Use Qpixmap::towinhicon (); Qpixmap::towinhbitmap (); Qpixmap::fromwinhicon (); Qpixmap::fromwinhbitmap (); Function usage at a glance
Qpixmap and Qicon, Qimage can easily turn to each other, there is not much to say.
Reference: http://www.cnblogs.com/davesla/archive/2011/01/18/1938559.html
Conversion of Qwidget and HWND to each other