diff options
-rw-r--r-- | qt-ui/profile/profilewidget2.cpp | 6 |
1 files changed, 5 insertions, 1 deletions
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); |