}
-/*void ButtonItem::paintEvent(QPaintEvent *aPaintEvent)
+void ButtonItem::paintEvent(QPaintEvent *aPaintEvent)
{
//Look and feel settings
- QPalette qpalette;
- QColor myColor(Qt::black);
- myColor.setAlpha(50);
- qpalette.setColor(QPalette::Background,myColor);
- setPalette(qpalette);
- int roundness(6);
+ int roundness(4);
QRect widgetRect = this->rect();
QPainter painter(this);
painter.save();
-}*/
+ painter.setRenderHint(QPainter::Antialiasing);
+ QPainterPath roundedRect;
+ roundedRect.addRoundedRect(1,1,widgetRect.width()-2, widgetRect.height()-2,roundness,roundness);
+
+ painter.setClipPath(roundedRect);
+ QRegion maskRegion = painter.clipRegion();
+
+ setMask(maskRegion);
+ QIcon tmpIcon = this->icon();
+ QSize visibleArea = this->iconSize();
+ QPixmap pixmap = tmpIcon.pixmap(visibleArea);
+ painter.drawPixmap(QPointF(0,0),pixmap);
+ painter.restore();
+
+}
QSize ButtonItem::sizeHint() const
{