Check the state of QPushButton in PyQt4?
<p>I want to write a <code>if</code> with a condition as the state of <code>QPushButton</code>. I would like to execute <code>if</code> if the button is enabled. So, how can i check the state of the Button.</p>

<p>Code:</p>

<pre><code>self.pushButton = QtGui.QPushButton()
self.pushbutton.setEnabled(False)
</code></pre>

<hr>

<pre><code>self.pushbutton.setEnabled(False) ##some where in the another class I have enabled it this line will not be executed all the time,so I want the check state.
</code></pre>

<hr>

<pre><code>if self.pushbutton.checkstate() == Enabled:  ##??? How to write this condition?
    some code I want to execute
</code></pre>