<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Apr 27, 2016 at 2:15 PM, Joakim Bygdell <span dir="ltr"><<a href="mailto:j.bygdell@gmail.com" target="_blank">j.bygdell@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="HOEnZb"><div class="h5"><br>
> On 27 Apr 2016, at 18:55, Tomaz Canabrava <<a href="mailto:tcanabrava@kde.org">tcanabrava@kde.org</a>> wrote:<br>
><br>
> Please, please:<br>
><br>
> don't add more stuff to the QMLManager, it's a huge beast already :)<br>
> crete something like this:<br>
><br>
> Q_INVOKABLE QStringListModel : DiveObjectHelper::buddies() {<br>
>        static QStringListModel buddies = new QStringListModel();<br>
>         QStringList temp;<br>
>       for_each_dive (i, d) {<br>
>                 temp << d->buddy;<br>
>       }<br>
>        temp.removeDuplicates();<br>
>        buddies.setStringList(temp);<br>
>        qDebug() << temp;<br>
>        return buddies;<br>
> }<br>
><br>
> What can be happening is that a QStringList will not tell QML that it changed, and thus, it wont update it's contents.<br>
> a Model will.<br>
</div></div>Fully understandable.<br>
<br>
But why do I get data in my combobox if I do this: buddies << “foo” << “bar”<br>
and not this: buddies << d->buddy.<br>
<br>
If I add<br>
        buddies << “foo” << “bar”;<br>
before the return statement, the combobox will have two entries, “foo” and “bar".<br>
<br>
If i replace the combobox with a label where the text is a QString generated by joining the QStringList<br>
I get all buddies displayed on one line. “Buddy A, Buddy B, foo, bar"<br></blockquote><div><br></div><div>I have *no* idea, really.<br></div><div>can you create a branch where I can try this?<br></div><div>currently I'm in the middle of a subsurface refactor for 5.0 ( tcanabrava/subsurface:new_ui )<br></div><div>with almost 100 commits, I need to speed things there too.<br><br></div><div> <br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
<br>
<br>
<br>
><br>
><br>
<br>
/Jocke<br>
<br>
</blockquote></div><br></div></div>