mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-01 05:26:45 +08:00
Formatting, icon utility function, icon size
This commit is contained in:
committed by
Mathew Sutcliffe
parent
371ee82f1b
commit
6a96d14baa
@@ -58,3 +58,11 @@ bool BlackMisc::pngHexStringToPixmapRef(const QString &hexString, QPixmap &pixma
|
||||
QByteArray ba(byteArrayFromHexString(hexString));
|
||||
return pngByteArrayToPixmapRef(ba, pixmap);
|
||||
}
|
||||
|
||||
QPixmap BlackMisc::iconToPixmap(const QIcon &icon)
|
||||
{
|
||||
if (icon.isNull()) { return QPixmap(); }
|
||||
const QList<QSize> sizes = icon.availableSizes();
|
||||
if (!sizes.isEmpty()) { return icon.pixmap(sizes.first()); }
|
||||
return icon.pixmap(16, 16);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user