1. otaku2's Avatar
    Hi. I am new at Native programming, and am trying to set up a ContactPicker.
    The control works well enough, but I am trying to add a filter to only get contacts that have an email address, and it does not seem to work:

    ContactPicker {
    id: emailPicker
    kindFilters: KindFilters.Email <-- Does not work!
    onContactSelected: {
    emailResult.text = "You chose contact: " + contactId;

    Can this property be set in QML? If so, what is the syntax?

    (Moderator: Can you please move this to the appropriate Category?)

    06-21-16 01:20 AM
  2. baarn's Avatar
    Can this property be set in QML? If so, what is the syntax?
    No, because if you look at the docs for ContactPicker (properties index) you'll notice that it is not listed as a property at all. You'd have to call the
    setKindFilters(const QSet< bb::pim::contacts::AttributeKind::Type > &kindFilters)
    method, but that would be rather difficult from QML.

    The first two options that spring to mind for me are:

    • Subclass ContactPicker as EmailContactPicker and preset the kind, or subclass and add your own properties.
    • Construct an instance of ContactPicker with preset kind and pass it in to the QML as a context variable.

    The first can be made as flexible and complicated as you like. The second is messy and maybe more trouble than it's worth.
    06-22-16 04:40 AM

Similar Threads

  1. How do I unistall apps on my Z10
    By freshkid harmani in forum Ask a Question
    Replies: 4
    Last Post: 06-24-16, 09:17 PM
  2. How do I get Uber working on my Z10?
    By skstrials in forum BlackBerry Z10
    Replies: 2
    Last Post: 06-24-16, 04:07 PM
  3. How Can I Load Earlier Messages in the Desktop App?
    By tru_stry in forum Desktop Software
    Replies: 1
    Last Post: 06-22-16, 06:46 PM
  4. Replies: 3
    Last Post: 06-21-16, 12:35 AM
  5. How do I undo the last OS update on a Q10?
    By CrackBerry Question in forum BlackBerry Q10
    Replies: 2
    Last Post: 06-20-16, 09:24 PM