Sebas,<div><br></div><div>This just worked:</div><div><a href="http://paste.kde.org/584660/">http://paste.kde.org/584660/</a></div><div>Where QAction is</div><div><a href="http://paste.kde.org/584672/">http://paste.kde.org/584672/</a></div>
<div><br></div><div>Cheers,</div><div><br clear="all">Daker Fernandes Pinheiro<br><a href="http://codecereal.blogspot.com" target="_blank">http://codecereal.blogspot.com</a><br><br><br><div class="gmail_quote">2012/10/28 Sebastian Kügler <span dir="ltr"><<a href="mailto:sebas@kde.org" target="_blank">sebas@kde.org</a>></span><br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">On Thursday, October 25, 2012 20:00:25 Aaron J. Seigo wrote:<br>
> not automatically, no. but QActions are QObjects, so you can attach to their<br>
> signals in the QML.<br>
<br>
And it's quite wonky, for example offering a list of QActions<br>
(QDeclarativeListProperty or QList, even with the payload casted to QObjects)<br>
does not seem to work. There's one, corrupt and therefore unusable entry in<br>
the returned data in the best case, no data at all in the worst.<br>
<br>
A workaround I've found is to send a list of QActions (.name()) in a<br>
QStringList to the runtime, and offer a Q_INVOKABLE QAction* action(QString);<br>
accessor which returns a QAction* to the runtime.<br>
<br>
Your button has the following:<br>
<br>
property QtObject action<br>
<br>
onClicked: action.trigger()<br>
<br>
Then, in your delegate, you retrieve the action via the key you get in your<br>
"listmodel":<br>
<br>
delegate: ActionButton {<br>
action: cpppluginthing.action(modelData)<br>
}<br>
<br>
Not the most beautiful thing in the world, but it seems to work at least. I'm<br>
of course open to better solutions.<br>
<span class="HOEnZb"><font color="#888888">--<br>
sebas<br>
<br>
<a href="http://www.kde.org" target="_blank">http://www.kde.org</a> | <a href="http://vizZzion.org" target="_blank">http://vizZzion.org</a> | GPG Key ID: 9119 0EF9<br>
_______________________________________________<br>
Plasma-devel mailing list<br>
<a href="mailto:Plasma-devel@kde.org">Plasma-devel@kde.org</a><br>
<a href="https://mail.kde.org/mailman/listinfo/plasma-devel" target="_blank">https://mail.kde.org/mailman/listinfo/plasma-devel</a><br>
</font></span></blockquote></div><br></div>