bool getPixmap(QPixmap & pixmap, QString const & path)
{
if (pixmap.load(path)) {
+#if QT_VERSION >= 0x050000
if (path.endsWith(".svgz") || path.endsWith(".svg") ) {
GuiApplication const * guiApp = theGuiApp();
if (guiApp != 0) {
pixmap.setDevicePixelRatio(guiApp->pixelRatio());
}
}
+#endif
return true;
}
return false;
// No clipping is necessary.
return false;
+#if QT_VERSION >= 0x050000
double const pixelRatio = is_transformed_ ? transformed_.devicePixelRatio() : original_.devicePixelRatio();
int const new_width = static_cast<int>((params.bb.xr - params.bb.xl) * pixelRatio);
int const new_height = static_cast<int>((params.bb.yt - params.bb.yb) * pixelRatio);
+#else
+ int const new_width = static_cast<int>((params.bb.xr - params.bb.xl));
+ int const new_height = static_cast<int>((params.bb.yt - params.bb.yb));
+#endif
QImage const & image = is_transformed_ ? transformed_ : original_;
if (params.scale == 100)
return false;
+#if QT_VERSION >= 0x050000
double const pixelRatio = is_transformed_ ? transformed_.devicePixelRatio() : original_.devicePixelRatio();
qreal scale = qreal(params.scale) / 100.0 * pixelRatio;
+#else
+ qreal scale = qreal(params.scale) / 100.0;
+#endif
#if (QT_VERSION >= 0x040500) && (QT_VERSION <= 0x040502)
// Due to a bug in Qt, LyX will crash for certain
#include <QSplitter>
#include <QStackedWidget>
#include <QStatusBar>
+#if QT_VERSION >= 0x050000
#include <QSvgRenderer>
+#endif
#include <QtConcurrentRun>
#include <QTime>
#include <QTimer>
qt_("version ") + lyx_version : qt_("unknown version");
QString imagedir = "images/";
FileName fname = imageLibFileSearch(imagedir, "banner", "svgz");
+#if QT_VERSION >= 0x050000
QSvgRenderer svgRenderer(toqstr(fname.absFileName()));
if (svgRenderer.isValid()) {
splash_ = QPixmap(splashSize());
} else {
splash_ = getPixmap("images/", "banner", "png");
}
+#else
+ splash_ = getPixmap("images/", "banner", "png");
+#endif
QPainter pain(&splash_);
pain.setPen(QColor(0, 0, 0));