diff options
Diffstat (limited to 'src/gui/image/qpixmap_win.cpp')
-rw-r--r-- | src/gui/image/qpixmap_win.cpp | 26 |
1 files changed, 10 insertions, 16 deletions
diff --git a/src/gui/image/qpixmap_win.cpp b/src/gui/image/qpixmap_win.cpp index 7ac66f3..f12088d 100644 --- a/src/gui/image/qpixmap_win.cpp +++ b/src/gui/image/qpixmap_win.cpp @@ -59,7 +59,7 @@ #include "qdebug.h" #include "qt_windows.h" -#if defined(Q_OS_WINCE) +#if defined(Q_WS_WINCE) #include <winbase.h> #include "qguifunctions_wince.h" extern bool qt_wince_is_high_dpi(); @@ -80,7 +80,7 @@ QPixmap QPixmap::grabWindow(WId winId, int x, int y, int w, int h ) if (w < 0) w = r.right - r.left; if (h < 0) h = r.bottom - r.top; -#ifdef Q_OS_WINCE_WM +#ifdef Q_WS_WINCE_WM if (qt_wince_is_pocket_pc()) { QWidget *widget = QWidget::find(winId); if (qobject_cast<QDesktopWidget *>(widget)) { @@ -101,7 +101,7 @@ QPixmap QPixmap::grabWindow(WId winId, int x, int y, int w, int h ) // copy data HDC window_dc = GetDC(winId); BitBlt(bitmap_dc, 0, 0, w, h, window_dc, x, y, SRCCOPY -#ifndef Q_OS_WINCE +#ifndef Q_WS_WINCE | CAPTUREBLT #endif ); @@ -123,7 +123,7 @@ HBITMAP QPixmap::toWinHBITMAP(HBitmapFormat format) const { HBITMAP bitmap = 0; if (data->classId() == QPixmapData::RasterClass) { - QRasterPixmapData* d = static_cast<QRasterPixmapData*>(data); + QRasterPixmapData* d = static_cast<QRasterPixmapData*>(data.data()); int w = d->image.width(); int h = d->image.height(); @@ -179,13 +179,7 @@ QPixmap QPixmap::fromWinHBITMAP(HBITMAP bitmap, HBitmapFormat format) BITMAP bitmap_info; memset(&bitmap_info, 0, sizeof(BITMAP)); - int res; - QT_WA({ - res = GetObjectW(bitmap, sizeof(BITMAP), &bitmap_info); - } , { - res = GetObjectA(bitmap, sizeof(BITMAP), &bitmap_info); - }); - + int res = GetObject(bitmap, sizeof(BITMAP), &bitmap_info); if (!res) { qErrnoWarning("QPixmap::fromWinHBITMAP(), failed to get bitmap info"); return QPixmap(); @@ -243,7 +237,7 @@ QPixmap QPixmap::fromWinHBITMAP(HBITMAP bitmap, HBitmapFormat format) } #ifdef Q_WS_WIN -#ifndef Q_OS_WINCE +#ifndef Q_WS_WINCE static QImage qt_fromWinHBITMAP(HDC hdc, HBITMAP bitmap, int w, int h) { @@ -347,7 +341,7 @@ QPixmap convertHIconToPixmap( const HICON icon) DeleteDC(hdc); return QPixmap::fromImage(image); } -#else //ifndef Q_OS_WINCE +#else //ifndef Q_WS_WINCE QPixmap convertHIconToPixmap( const HICON icon, bool large) { HDC screenDevice = GetDC(0); @@ -412,14 +406,14 @@ QPixmap convertHIconToPixmap( const HICON icon, bool large) DeleteDC(hdc); return QPixmap::fromImage(image); } -#endif //ifndef Q_OS_WINCE +#endif //ifndef Q_WS_WINCE QPixmap loadIconFromShell32( int resourceId, int size ) { #ifdef Q_OS_WINCE - HMODULE hmod = LoadLibrary((const wchar_t *) QString::fromLatin1("ceshell.dll").utf16()); + HMODULE hmod = LoadLibrary(L"ceshell.dll"); #else - HMODULE hmod = LoadLibraryA("shell32.dll"); + HMODULE hmod = LoadLibrary(L"shell32.dll"); #endif if( hmod ) { HICON iconHandle = (HICON)LoadImage(hmod, MAKEINTRESOURCE(resourceId), IMAGE_ICON, size, size, 0); |