summaryrefslogtreecommitdiffstats
path: root/qt-ui
diff options
context:
space:
mode:
authorGravatar Tomaz Canabrava <tcanabrava@kde.org>2014-01-17 10:18:03 -0200
committerGravatar Dirk Hohndel <dirk@hohndel.org>2014-01-17 14:04:47 -0800
commite23841dd7f199b97a2e24cb7618c07416e269af7 (patch)
treeaac2a070eb03e55714ed5103c33dc2bb52617a24 /qt-ui
parent470de7ee07582d00f0d93cbce411a919dd9b1cdc (diff)
downloadsubsurface-e23841dd7f199b97a2e24cb7618c07416e269af7.tar.gz
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 <tcanabrava@kde.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'qt-ui')
-rw-r--r--qt-ui/profile/profilewidget2.cpp6
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);