Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/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; */
    }

    pButton.JPG


  • Lifetime Qt Champion

    Hi,

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


Log in to reply