Hi all,

I would like to push an empty object in front of objects list model of
ComboBox.
I can do this in c++:

QList<QObject*> SomeClass::getList() {
    QList<QObject*> list = db.getList();
    list.push_front(Q_NULLPTR);
    return list;
}

then set it as model for ComboBox:

    model: SomeClass.getList()

And it works, I then can check modelData for null in delegate.

But I'm interesting if there is any way I could do it in qml, something
like:

  model: [0, (or undifined), DB.getList()]
or
  model: {0, (or undifined), DB.getList()}

or push empty object in front of list in Component.onCompleted?

Thanks in advance for help!

--
With regards, Oleg.
_______________________________________________
Interest mailing list
Interest@qt-project.org
http://lists.qt-project.org/mailman/listinfo/interest

Reply via email to