diff options
author | Tomaz Canabrava <tomaz.canabrava@intel.com> | 2014-06-08 13:11:00 -0300 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2014-06-08 12:42:51 -0700 |
commit | 8e682c41e831c174e3a513ff6704d9ff3734f7a4 (patch) | |
tree | 8ee12f218f6b8734823897bd2fb3242a5cbf9380 /qt-ui/profile | |
parent | e14a15e61c6fa5529f33de410bfc6e0ad351a7af (diff) | |
download | subsurface-8e682c41e831c174e3a513ff6704d9ff3734f7a4.tar.gz |
Add a nice white rectangle around the picture
This makes the picture looks a bit more like a real paper picture
shadow's missing, though.
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'qt-ui/profile')
-rw-r--r-- | qt-ui/profile/divepixmapitem.cpp | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/qt-ui/profile/divepixmapitem.cpp b/qt-ui/profile/divepixmapitem.cpp index b1942344e..215ce99c2 100644 --- a/qt-ui/profile/divepixmapitem.cpp +++ b/qt-ui/profile/divepixmapitem.cpp @@ -1,5 +1,9 @@ #include "divepixmapitem.h" #include "animationfunctions.h" + +#include <QPen> +#include <QBrush> + DivePixmapItem::DivePixmapItem(QObject *parent) : QObject(parent), QGraphicsPixmapItem() { } @@ -13,6 +17,11 @@ DivePictureItem::DivePictureItem(QObject *parent): DivePixmapItem(parent) void DivePictureItem::setPixmap(const QPixmap &pix) { DivePixmapItem::setPixmap(pix); + QRectF r = boundingRect(); + QGraphicsRectItem *rect = new QGraphicsRectItem(0 - 10, 0 -10, r.width() + 20, r.height() + 20, this); + rect->setPen(Qt::NoPen); + rect->setBrush(QColor(Qt::white)); + rect->setFlag(ItemStacksBehindParent); setTransformOriginPoint(boundingRect().width()/2, boundingRect().height()/2); } |