From e23841dd7f199b97a2e24cb7618c07416e269af7 Mon Sep 17 00:00:00 2001 From: Tomaz Canabrava Date: Fri, 17 Jan 2014 10:18:03 -0200 Subject: Remove warning about a null pixmap. Since I didn't add a pixmap to be the background of the new profile, yet, things got wrong on mac and crashed. This should fix it. Signed-off-by: Tomaz Canabrava Signed-off-by: Dirk Hohndel --- qt-ui/profile/profilewidget2.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/qt-ui/profile/profilewidget2.cpp b/qt-ui/profile/profilewidget2.cpp index 9708f2bd3..be309b921 100644 --- a/qt-ui/profile/profilewidget2.cpp +++ b/qt-ui/profile/profilewidget2.cpp @@ -360,7 +360,11 @@ void ProfileWidget2::resizeEvent(QResizeEvent* event) void ProfileWidget2::fixBackgroundPos() { - QPixmap p = QPixmap(":background").scaledToHeight(viewport()->height()); + QPixmap toBeScaled(":background"); + if (toBeScaled.isNull()) + return; + QPixmap p = toBeScaled.scaledToHeight(viewport()->height()); + int x = viewport()->width() / 2 - p.width() / 2; DivePixmapItem *bg = background; bg->setPixmap(p); -- cgit v1.2.3-70-g09d2