#include <QPainter>
#include <QDebug>
-const int BORDER_X_OFFSET = 6;
-const int BORDER_Y_OFFSET = 6;
-const int RECT_WIDTH_OFFSET = 2;
-const int RECT_HEIGHT_OFFSET = 2;
+const int BORDER_X_OFFSET = 7;
+const int BORDER_Y_OFFSET = 7;
+const int RECT_WIDTH_OFFSET = 1;
+const int RECT_HEIGHT_OFFSET = 1;
const int ROUNDNESS = 9;
const int PIC_SIZE_X = 50;
const int PIC_SIZE_Y = 50;
SituareUser::SituareUser(QWidget *parent)
: QLabel(parent)
{
+ this->setAlignment(Qt::AlignHCenter|Qt::AlignVCenter);
+ this->setMargin(1);
}
{
Q_UNUSED(aPaintEvent);
- int roundness(9);
+ int roundness(ROUNDNESS);
QRect widgetRect = QRect(0,0,this->pixmap()->width(),this->pixmap()->height());
setMask(maskRegion);
- painter.drawPixmap(QPointF(0,0),(*(this->pixmap())));
+ painter.drawPixmap(QPointF(0, 0), (*(this->pixmap())));
clearMask();
+
painter.drawPixmap(QPointF(-BORDER_X_OFFSET,-BORDER_Y_OFFSET),
(QPixmap(":/res/images/profile_pic_border.png")));
+
painter.restore();
}
QSize SituareUser::sizeHint() const
{
- return QSize(PIC_SIZE_X,PIC_SIZE_Y);
+ return QSize(PIC_SIZE_X, PIC_SIZE_Y);
}