Did you add the images file into .qrc
file? A URL start with :
has indicated that It will be searched in .qrc
file. If .qrc
file didn't used, URL should not start with :
. Maybe you should access the image file as
ui->pushButton_play->setStyleSheet(QString::fromUtf8("background-image: url(source/play.png);"));
This is The Qt Resource System documentation.