Is it possible to store a QPushButton in a QVariant?
<p>I'd like to know if it's possible to store a QPushButton in a QVariant. More precisely, I am trying to use it in a QStandardItemModel with the function <code>setData</code>. Here's what I want to do :</p>

<pre><code>QPushButton* button = new QPushButton("Update");
setData(index(0, 0), "Button");
setData(index(0, 1), button);
</code></pre>

<p>But obviously, it doesn't work like that so I tried this :</p>

<pre><code>QVariant variant;
variant.setValue(button);
setData(index(0, 1), QVariant::fromValue(variant));
</code></pre>

<p>And it's not working either. I'd like to do it <strong>without using a QTableView</strong> (I know there is a setIndexWidget in this kind of view). </p>

<p>Thanks in advance!</p>