25 lines
709 B
C
25 lines
709 B
C
|
|
#pragma once
|
||
|
|
#ifndef QWFASSOC_ICON_UTILS_H_
|
||
|
|
#define QWFASSOC_ICON_UTILS_H_
|
||
|
|
|
||
|
|
#include <QPixmap>
|
||
|
|
|
||
|
|
#include <wfassoc++.h>
|
||
|
|
|
||
|
|
namespace qwfassoc {
|
||
|
|
namespace icon_utils {
|
||
|
|
|
||
|
|
// Convert a wfassocpp::HICON handle (the C++ wrapper around wfassoc's opaque
|
||
|
|
// icon handle) into a QPixmap suitable for use in Qt widgets.
|
||
|
|
//
|
||
|
|
// The conversion goes through QImage::fromHICON() (available since Qt 6.0 on
|
||
|
|
// Windows) and then QPixmap::fromImage() using its rvalue-reference overload
|
||
|
|
// so that no extra pixel buffer copy is performed. The returned pixmap is null
|
||
|
|
// if the input handle is null.
|
||
|
|
QPixmap fromHicon(wfassocpp::HICON handle);
|
||
|
|
|
||
|
|
} // namespace icon_utils
|
||
|
|
} // namespace qwfassoc
|
||
|
|
|
||
|
|
#endif // QWFASSOC_ICON_UTILS_H_
|