Mercurial > hg > sonic-visualiser
diff main/SVSplash.cpp @ 2300:eb7f4579e5cc by-id
Updates throughout for ModelById logic
author | Chris Cannam |
---|---|
date | Thu, 04 Jul 2019 14:32:08 +0100 |
parents | 82cac4a6c581 |
children | 7e70382e6ece |
line wrap: on
line diff
--- a/main/SVSplash.cpp Mon Jun 24 16:58:10 2019 +0100 +++ b/main/SVSplash.cpp Thu Jul 04 14:32:08 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);