Android Qt - custom button does not appear
-
Hi guys, I wanted to create a custom styled button which would have an image on background but when I run the project, nothing appears - image is loaded, but the painting does not show:
@
MyButton::MyButton(QWidget *parent)
: QPushButton(parent)
{
setFixedSize(45, 45);
pixmap = new QPixmap(45,45);
qDebug() << pixmap->load(":/interface/Back.png");
}
@@
void
MyButton::paintEvent(QPaintEvent *)
{
QPainter p;
p.begin(this);
p.setBrush(Qt::SolidPattern);
p.setBackground(QBrush(pixmap->toImage()));
p.end();
}
@
The button does not show... Where do I have problem?