Hi I have to put a pixmap with opacity on a pushbutton.ï½”
I checked on line and tried, the following is my code:
livePushButton = new QPushButton(centralWidget);
QPixmap pixmap("../icons/live.PNG");
QIcon icon(pixmap);
livePushButton->setIcon(icon);
livePushButton->setIconSize(QRect(0, 1020, 256, 90).size());
livePushButton->setObjectName(QString::fromUtf8("livePushButton") );
livePushButton->setGeometry(QRect(0, 1020, 256, 90));
The pixmap is drawn on the pushbutton, when I insert the pixmap.fill(Qt::transparent); to the code, the pixmap disappeared. that means the pixmap was transparent completely.
livePushButton = new QPushButton(centralWidget);
QPixmap pixmap("../icons/live.PNG");
pixmap.fill(Qt::transparent);
QIcon icon(pixmap);
livePushButton->setIcon(icon);
livePushButton->setIconSize(QRect(0, 1020, 256, 90).size());
livePushButton->setObjectName(QString::fromUtf8("livePushButton") );
livePushButton->setGeometry(QRect(0, 1020, 256, 90));
how I can draw the pixmap with the opacity 0.75? I am a starter, , and many thanks for any advice!
Added after 25 minutes:
Thanks, solved.
Bookmarks