Add a QIcon constructor for Snore::Icon

REVIEW: 125095
This commit is contained in:
Aleix Pol 2015-09-07 22:25:07 +02:00
parent 3ab8aed89c
commit b81410f27c
2 changed files with 9 additions and 0 deletions

View File

@ -46,6 +46,10 @@ Icon::Icon(const QImage &img):
{
}
Icon::Icon(const QIcon &icon):
d(new IconData(icon.pixmap(32).toImage()))
{}
Icon::Icon(const QString &url):
d(new IconData(url))
{

View File

@ -53,6 +53,11 @@ public:
*/
Icon(const QImage &img);
/**
* Creates an Icon from QIcon @p icon
*/
Icon(const QIcon &icon);
/**
* Creates an Icon from a url
* Valid urls are "file://home/foo/foo.png", "C:\\foo.png", ":/root/foo.png", "http://foo.com/foo.png"