I try to write a simple Player with Qt.
I try to set Play
button look like this
Use stylesheet or use a QPixmap like a button.
My code is
playCtrl = new QPushButton(this);
playCtrl->setIcon(QIcon(QPixmap(":/icons/icons/play.png")));
playCtrl->setIconSize(QSize(150, 150));
playCtrl->setStyleSheet("QPushButton{background-image:url(:/icons/icons/play.png)}");
but when I run my code, I just got this:
I'm very happy to say, I had solve this problem.
Just use this:
playCtl = new QPushButton(this);
playCtl->setIcon(QIcon(QPixmap(":/icons/icons/player_play.png")));
playCtl->setIconSize(QSize(32, 32));
playCtl->setStyleSheet("QPushButton{border: none;outline: none;}");