Important: Please read the Qt Code of Conduct -

QPushButton icon hover effect in Qt v4.8

  • Hello, I am trying to make hover effect on QPushButton in my project with icon/image. but the image is aligning at center in button, I have tried so much but I failed. please help me to solve this.
    The style sheet I used is below.

    #pushButton {
    font: 75 8pt "Tahoma";
    qproperty-icon: none;
    image: url(:/images/icon_cancel_none.svg);
    /*qproperty-icon: url(":/images/icon_cancel_none.svg");
    qproperty-iconSize: 18px 18px; */

    #pushButton:hover {
    font: 75 8pt "Tahoma";
    image: url(:/images/icon_cancel_over.svg);
    /*qproperty-icon: url(":/ images/icon_cancel_over.svg");
    qproperty-iconSize: 18px 18px; */


  • Lifetime Qt Champion


    Can you explain in more details what exactly your are expecting from that effect ?

Log in to reply