Python QT how to visualise that the button is clicked
<p>I have a <code>QtCreator</code> generated gui. After import i am setting images to the buttons and when i click them the button below probably indicates the click but the <code>QIcon</code> doesn't change in any way. Is there a way to make it visible?
This is my button code:</p>

<pre><code> self.pushButton.setIcon(QtGui.QIcon('artwork/player_rew'))
 self.pushButton.setIconSize(QtCore.QSize(48, 48))
 self.pushButton.setStyleSheet('QPushButton{border: 0px solid;}')
</code></pre>

<p>You can use the <code>:pressed</code> <a href="http://doc.qt.io/qt-5/stylesheet-reference.html#list-of-pseudo-states" rel="nofollow">pseudo-state</a> in your style sheet to specify the behaviour when the button is pressed:</p>

<pre><code>self.pushButton.setStyleSheet("""
    QPushButton{
        border: 0px solid;
    }
    QPushButton:pressed {
        border: 0px solid;
        image: url(some_different_image);
        background-color: red;
    }
""")
</code></pre>

<p>More information can also be found in the <a href="http://doc.qt.io/qt-5/stylesheet-examples.html#customizing-a-qpushbutton-using-the-box-model" rel="nofollow">Qt Style Sheets Examples</a></p>

python qt qt-creator pyqt5