Qt5加载SVG格式的图片并更颜色
作者:互联网
QIcon MainWindow::qiconFromSvg(QString svg_path, QString color)
{
QPixmap img(svg_path);
QPainter qp(&img);
qp.setCompositionMode(QPainter::CompositionMode_SourceIn);
qp.fillRect( img.rect(), QColor(color) );
qp.end();
return QIcon(img);
}
标签:qp,Qt5,img,color,SVG,QString,path,QPainter,加载 来源: https://www.cnblogs.com/hokori/p/15102665.html