svg文件字符串读取到QPushButton上

来源:互联网 发布:ubuntu安装fcitx五笔 编辑:程序博客网 时间:2024/04/30 18:42

QString str1=svgString.at(0);

            QXmlStreamReader * xmlString=new QXmlStreamReader(str1);
            QSvgRenderer renderer(xmlString);
             QPixmap image(60, 80);
//                // Get QPainter that paints to the image
             QPainter painter(&image);
             renderer.render(&painter);
             // QIcon * icon=new QIcon(image);
            button->setIcon(QIcon(image));
0 0
原创粉丝点击