I'm trying to create a custom shape QLineEdit
with QWidget::setMask()
. I redefined resizeEvent
for my sub class lineEdit
.
void MyLineEdit::resizeEvent(QResizeEvent *ev)
{
QPixmap pixmap(":/new/prefix1/region.png");
setFixedSize(ev->size());
setMask(pixmap.mask());
setStyleSheet("background-color : gray");
}
But the QlineEdit
isn't showed. Btw, it was added to a QGridlayout
and I checked that pixmap.isNull() == false
and the size was normal.
Did I miss something? Why isn't it displayed?