mrphunghuy
31st October 2013, 08:12
Hello Everybody!
I'm a newbie of Qt. I have a problem need help. I want insert an image with transparent background (icon-home.png) in to a window which I created.
This window I set background by follow command:
window->setStyleSheet("background-image: url(./images/bg.jpg");
Image I insert by:
QLabel *image = new QLabel;
image->setPixmap(QPixmap("./images/icon-home.png"));
Then:
layout->addWidget(image);
window->setLayout(layout);
but when program run, the area transparent of image haven't color of base background (otherwise, the area stransparent of image cover base background).
How to make this area transparent dont cover base background ?
Thanks!
I'm a newbie of Qt. I have a problem need help. I want insert an image with transparent background (icon-home.png) in to a window which I created.
This window I set background by follow command:
window->setStyleSheet("background-image: url(./images/bg.jpg");
Image I insert by:
QLabel *image = new QLabel;
image->setPixmap(QPixmap("./images/icon-home.png"));
Then:
layout->addWidget(image);
window->setLayout(layout);
but when program run, the area transparent of image haven't color of base background (otherwise, the area stransparent of image cover base background).
How to make this area transparent dont cover base background ?
Thanks!