diff --git a/lib/jkqtplotter/gui/jkqtpgraphsmodel.cpp b/lib/jkqtplotter/gui/jkqtpgraphsmodel.cpp index 2dcefcfc360..71a205a4ab6 100644 --- a/lib/jkqtplotter/gui/jkqtpgraphsmodel.cpp +++ b/lib/jkqtplotter/gui/jkqtpgraphsmodel.cpp @@ -21,6 +21,7 @@ #include "jkqtplotter/gui/jkqtpgraphsmodel.h" #include "jkqtplotter/jkqtpbaseplotter.h" +#include #include "jkqtplotter/jkqtptools.h" #include "jkqtplotter/graphs/jkqtpscatter.h" #include @@ -51,6 +52,10 @@ QVariant JKQTPGraphsModel::data(const QModelIndex &index, int role) const if (index.row()(m_plotter->getGraphCount())) return m_plotter->getGraph(static_cast(index.row()))->isVisible()?Qt::Checked:Qt::Unchecked; } else if (role == Qt::DecorationRole) { if (index.row()(m_plotter->getGraphCount())) { + const qreal dpr = qGuiApp->devicePixelRatio(); + QPixmap pix=QPixmap::fromImage(m_plotter->getGraph(static_cast(index.row()))->generateKeyMarker(QSize(16,16)*dpr)); + pix.setDevicePixelRatio(dpr); + return m_plotter->getGraph(static_cast(index.row()))->generateKeyMarker(QSize(16,16)); } }