Mercurial > hg > sonic-visualiser
diff main/SVSplash.cpp @ 2306:a1c14880404b
Merge from branch by-id
author | Chris Cannam |
---|---|
date | Wed, 17 Jul 2019 14:28:24 +0100 |
parents | eb7f4579e5cc |
children | 7e70382e6ece |
line wrap: on
line diff
--- a/main/SVSplash.cpp Fri Jun 21 13:30:17 2019 +0100 +++ b/main/SVSplash.cpp Wed Jul 17 14:28:24 2019 +0100 @@ -18,7 +18,7 @@ #include <QPainter> #include <QApplication> -#include <QDesktopWidget> +#include <QScreen> #include <QSvgRenderer> #include <cmath> @@ -33,7 +33,8 @@ QPixmap *p1 = new QPixmap(":icons/scalable/sv-splash.png"); int w = p1->width(), h = p1->height(); - QRect desk = QApplication::desktop()->availableGeometry(); + QScreen *screen = QApplication::primaryScreen(); + QRect desk = screen->availableGeometry(); double dpratio = devicePixelRatio(); double widthMultiple = double(desk.width()) / double(w); @@ -89,6 +90,11 @@ void SVSplash::drawContents(QPainter *painter) { + // Qt 5.13 deprecates QFontMetrics::width(), but its suggested + // replacement (horizontalAdvance) was only added in Qt 5.11 + // which is too new for us +#pragma GCC diagnostic ignored "-Wdeprecated-declarations" + painter->drawPixmap(rect(), *m_pixmap, m_pixmap->rect()); QString text = QString("v%1").arg(SV_VERSION); painter->setPen(Qt::black);