On Wed, Apr 27, 2016 at 2:15 PM, Joakim Bygdell <[email protected]> wrote:
> > > On 27 Apr 2016, at 18:55, Tomaz Canabrava <[email protected]> wrote: > > > > Please, please: > > > > don't add more stuff to the QMLManager, it's a huge beast already :) > > crete something like this: > > > > Q_INVOKABLE QStringListModel : DiveObjectHelper::buddies() { > > static QStringListModel buddies = new QStringListModel(); > > QStringList temp; > > for_each_dive (i, d) { > > temp << d->buddy; > > } > > temp.removeDuplicates(); > > buddies.setStringList(temp); > > qDebug() << temp; > > return buddies; > > } > > > > What can be happening is that a QStringList will not tell QML that it > changed, and thus, it wont update it's contents. > > a Model will. > Fully understandable. > > But why do I get data in my combobox if I do this: buddies << “foo” << > “bar” > and not this: buddies << d->buddy. > > If I add > buddies << “foo” << “bar”; > before the return statement, the combobox will have two entries, “foo” and > “bar". > > If i replace the combobox with a label where the text is a QString > generated by joining the QStringList > I get all buddies displayed on one line. “Buddy A, Buddy B, foo, bar" > I have *no* idea, really. can you create a branch where I can try this? currently I'm in the middle of a subsurface refactor for 5.0 ( tcanabrava/subsurface:new_ui ) with almost 100 commits, I need to speed things there too. > > > > > > > > > > /Jocke > >
_______________________________________________ subsurface mailing list [email protected] http://lists.subsurface-divelog.org/cgi-bin/mailman/listinfo/subsurface
