Mercurial > trustbridge > trustbridge
diff ui/textoverlaybutton.cpp @ 932:57371f2e8dae
(issue72) Set background image as pixmap in textoverlayicon
author | Andre Heinecke <andre.heinecke@intevation.de> |
---|---|
date | Fri, 22 Aug 2014 16:20:25 +0200 |
parents | a467204a35f5 |
children | 947a880ec5d3 |
line wrap: on
line diff
--- a/ui/textoverlaybutton.cpp Fri Aug 22 16:19:46 2014 +0200 +++ b/ui/textoverlaybutton.cpp Fri Aug 22 16:20:25 2014 +0200 @@ -30,6 +30,7 @@ QRect myRect = e->rect().translated(26, -29); // circle +/* old manually painted background QLinearGradient gradient(myRect.topLeft(), myRect.bottomRight()); gradient.setColorAt(0, Qt::white); @@ -38,6 +39,8 @@ painter.setBrush(brush); painter.setPen(Qt::white); painter.drawEllipse(75.5, 6, 20, 20); + */ + painter.drawPixmap(75.5, 5, mBackground); // font QFont font; @@ -48,3 +51,7 @@ return; } + +void TextOverlayButton::setBackgroundIcon (const QString& iconPath) { + mBackground = QIcon(iconPath).pixmap(QSize(22,22)); +}