Subclassing of QPushButton
<p>I've been looking for a way of subclassing QPushButton, so I can connect 'clicked' signal when constructing new button, like:</p>

<pre><code>Btn = CustomButtonClass('Text', clicked='lambda: self.func(par)')
</code></pre>

<p>So far - without any success.</p>

<p>I guess the thing is to pass correct parameters to <strong>init</strong>() of CustomButtonClass, but have no idea what, and why.</p>

<p>What I've got:</p>

<pre><code>class CustomButtonClass(QtGui.QPushButton):
    def __init__(self, text, parent=None):
        super().__init__()
</code></pre>

<p>I also noticed that:</p>

<pre><code>Btn.clicked.connect(lambda: self.func(par))
</code></pre>

<p>Also doesn't work.</p>

<p>Do I have to override QPushButton's mouseReleaseEvent or construct custom signal to be able to complete my task?</p>