diff --git a/src/calibre/gui2/progress_indicator/QProgressIndicator.cpp b/src/calibre/gui2/progress_indicator/QProgressIndicator.cpp index 4066f807fb..20472129df 100644 --- a/src/calibre/gui2/progress_indicator/QProgressIndicator.cpp +++ b/src/calibre/gui2/progress_indicator/QProgressIndicator.cpp @@ -143,3 +143,13 @@ image_from_hicon(void* hicon) { return QImage(); #endif } + +QImage +image_from_hbitmap(void* hbitmap) { +#ifdef Q_OS_WIN + return QImage::fromHBITMAP((HBITMAP)hbitmap); +#else + (void)hibitmap; + return QImage(); +#endif +} diff --git a/src/calibre/gui2/progress_indicator/QProgressIndicator.h b/src/calibre/gui2/progress_indicator/QProgressIndicator.h index 9817d4242a..41a609c8ff 100644 --- a/src/calibre/gui2/progress_indicator/QProgressIndicator.h +++ b/src/calibre/gui2/progress_indicator/QProgressIndicator.h @@ -163,3 +163,4 @@ QMenu* menu_for_action(const QAction *ac); void set_image_allocation_limit(int megabytes); int get_image_allocation_limit(); QImage image_from_hicon(void* hicon); +QImage image_from_hbitmap(void* hbitmap); diff --git a/src/calibre/gui2/progress_indicator/QProgressIndicator.sip b/src/calibre/gui2/progress_indicator/QProgressIndicator.sip index 209a038009..ef9a52e6af 100644 --- a/src/calibre/gui2/progress_indicator/QProgressIndicator.sip +++ b/src/calibre/gui2/progress_indicator/QProgressIndicator.sip @@ -90,3 +90,4 @@ QMenu* menu_for_action(const QAction *ac); void set_image_allocation_limit(int megabytes); int get_image_allocation_limit(); QImage image_from_hicon(void*); +QImage image_from_hbitmap(void*);