We have moved to a new Sailfish OS Forum. Please start new discussions there.

Revision history [back]

click to hide/show revision 1
initial version

posted 2019-02-17 01:14:54 +0200

How to search programmatically for people

I want to search for people, weherein the search input string matches with the prefix of the first or last name. I'm using the Nemo QML plugin for contaxts. In the QML type definitions of this plugin I found the following method for the PeopleModel:

Method {
    name: "search"
    Parameter { name: "pattern"; type: "string" }
}

I assumed, that I can use a regular expression:

import org.nemomobile.contacts 1.0
...
PeopleModel {
    id: contacts
    ...
}
...
var regex = new RegExp("(^|\\s)" + searchInput + "*", i)
contacts.search(regex)

Unfortunately, this doesn't work. Has someone any idea or advice?

How to search programmatically for peoplepeople?

I want to search for people, weherein the search input string matches with the prefix of the first or last name. I'm using the Nemo QML plugin for contaxts. In the QML type definitions of this plugin I found the following method for the PeopleModel:

Method {
    name: "search"
    Parameter { name: "pattern"; type: "string" }
}

I assumed, that I can use a regular expression:

import org.nemomobile.contacts 1.0
...
PeopleModel {
    id: contacts
    ...
}
...
var regex = new RegExp("(^|\\s)" + searchInput + "*", i)
contacts.search(regex)

Unfortunately, this doesn't work. Has someone any idea or advice?

How to search programmatically for people?

I want to search for people, weherein the search input string matches with the prefix of the first or last name. I'm using the Nemo QML plugin for contaxts. In the QML type definitions of this plugin I found the following method for the PeopleModel:

Method {
    name: "search"
    Parameter { name: "pattern"; type: "string" }
}

I assumed, that I can use a regular expression:

import org.nemomobile.contacts 1.0
...
PeopleModel {
    id: contacts
    ...
}
...
var regex = new RegExp("(^|\\s)" + searchInput + "*", i)
contacts.search(regex)

Unfortunately, this doesn't work. Has someone any idea or advice?

How to search programmatically for people?

I want to search for people, weherein the search input string matches with the prefix of the first or last name. I'm using the Nemo QML plugin for contaxts. In the QML type definitions of this plugin I found the following method for the PeopleModel:

Method {
    name: "search"
    Parameter { name: "pattern"; type: "string" }
}

I assumed, that I can use a regular expression:

import org.nemomobile.contacts 1.0
...
PeopleModel {
    id: contacts
    ...
}
...
var regex = new RegExp("(^|\\s)" + searchInput + "*", i)
contacts.search(regex)

Unfortunately, this doesn't work. Has someone any idea or advice?

By the way: Does someone know the status of QtPIM respectively QtContacts? They are announced as the officially supported platform API.