On Wed, Sep 21, 2016 at 10:20:57PM +0200, Jean-Marc Lasgouttes wrote:
> 
> On this page,
>   http://stackoverflow.com/questions/10079011/qpixmap-and-svg
> someone proposes
>   QIcon("filepath.svg").pixmap(QSize())
> 
> Would something like that work for us? That looks good.

Yep, that seems producing an image with same quality. The patch would be
the attached one. Please, apply if you like it.

-- 
Enrico
diff --git a/src/frontends/qt4/GuiView.cpp b/src/frontends/qt4/GuiView.cpp
index 10ec74e..fdc05a9 100644
--- a/src/frontends/qt4/GuiView.cpp
+++ b/src/frontends/qt4/GuiView.cpp
@@ -578,17 +578,7 @@ GuiView::GuiView(int id)
        QFontMetrics const fm(statusBar()->fontMetrics());
        int const roheight = max(int(d.normalIconSize), fm.height());
        QSize const rosize(roheight, roheight);
-       QPixmap readonly = QPixmap(rosize);
-       QString imagedir = "images/";
-       FileName fname = imageLibFileSearch(imagedir, "emblem-readonly", 
"svgz");
-       QSvgRenderer renderer(toqstr(fname.absFileName()));
-       if (renderer.isValid()) {
-               
readonly.fill(statusBar()->palette().color(QWidget::backgroundRole()));
-               QPainter painter(&readonly);
-               renderer.render(&painter);
-       } else {
-               readonly = getPixmap("images/", "emblem-readonly", 
"png").scaled(rosize, Qt::KeepAspectRatio);
-       }
+       QPixmap readonly = QIcon(getPixmap("images/", "emblem-readonly", 
"svgz,png")).pixmap(rosize);
        read_only_ = new QLabel(statusBar());
        read_only_->setPixmap(readonly);
        read_only_->setScaledContents(true);

Reply via email to