ui->label->setStyelSheet(\"image:url(:/1.png); border-image:url(:/2.png);\");
Why can\'t the image be displayed after run? But the border-i
I think the image
property is for subcontrol only (see doc ), while border-image
is valid for labels.
Use
QPixmap::QPixmap ( const QString & fileName, const char * format = 0, Qt::ImageConversionFlags flags = Qt::AutoColor );
QLabel::setPixmap ( const QPixmap & );
Like this:
QPixmap pix(":/1.png");
ui->label->setStyleSheet("border-image:url(:/2.png);");
ui->label->setPixmap(pix);
try following
ui->label->setStyleSheet("background-image: url(:/1.png);");