How to find QButton created with a loop?
<p>in maya one creates a button with:</p>

<pre><code>   cmds.button('buttonname', label='click me')
</code></pre>

<p>where buttonname is the name of 
the button object. At a later stage i can edit the button simply by calling:</p>

<pre><code>   cmds.button('buttonname', e=1, label='click me again')
</code></pre>

<p>Now the problem:
i created a bunch of buttons in qt using a loop:</p>

<pre><code>  for s in Collection:
        file = os.path.splitext(s)[0]

        # Main widget
        widgetItem = QtWidgets.QWidget()
        layoutItem = QtWidgets.QVBoxLayout()
        widgetItem.setLayout(layoutItem)

        # Button
        button = QtGui.QPushButton()
        button.setObjectName(file)
        layoutItem.addWidget(button)
</code></pre>

<p>How can i call/edit one of them using the button name?</p>

<p>Thanks in advance</p>

<p>Assuming you already have access to their parent widget, you can find them by <code>findChild</code> method.</p>

<p>In C++ syntax, it would be something like this:</p>

<pre><code>QPushButton *button = parentWidget-&gt;findChild&lt;QPushButton *&gt;("button1");
</code></pre>

<p>where <code>button1</code> is the name of that button.</p>

python qt button pyside maya