Convert a Contact to a QVariant in a list

Hey. Since I'm still pretty new to c ++ my understanding of the collocation of type is incomplete. I need to get my Contacts QList into a QVariantList, so I can put it in the constructor of a QListDataModel for use in a ListView. I can't get my Contact to convert a QVariant. Here's the code. I also tried to convert a Contact or a Contact * in a QVariant without success.

Enjoy your time,

See you soon
Justin D.

Q_DECLARE_METATYPE(Contact);
Q_DECLARE_METATYPE(std::list);

///////////////////////////////////////////////////

    if (partial.length() < 3)
        return;

    QString completed = partial;

    ContactAutoCompleteSearchFilters cacsf;
    cacsf.setLimit(5);
    cacsf = cacsf.setIncludePhotos(true);
    cacsf = cacsf.setSearchField(SearchAutoCompleteField::Email);
    cacsf = cacsf.setSearchValue(partial);

    ContactService cs;

    qRegisterMetaType("Contact");

    QList ql = cs.searchContactsAutoComplete(cacsf);
    std::list l = ql.toStdList();
    QVariantList qvl = QVariantList::fromStdList(l);   /// <<<<< Error, No matching function for call

QVariant supports a limited set of objects. But one of them is QObject *, which allows to use
qVariantFromValue(objectPointer)

Now the second question would be if the implementation of Contact can be used in QML (saved successfully). I have not tried, but if it does not, you will need to write your own wrapper class that returns the properties that you need, for example using Q_PROPERTY.

Tags: BlackBerry Developers

Similar Questions

  • In Hotmail and MSN Messenger, my contacts (EmitDefaultValue) are appearing on the lists "Suggestion of a friend" of others?

    In Hotmail and MSN Messenger, my contacts (EmitDefaultValue) are appearing on the lists "Suggestion of a friend" of others? How can I change that to keep different people, that I am in contact with to appear like this? This is a very serious concern, that I wasn't aware of before, and this could actually lead to harm. Please instruct me how to keep a (certain) higher risk contacts private from each other. Thank you

    View all Windows Live and Hotmail questions in the appropriate forum found here:
    http://windowslivehelp.com/

  • How to select the contact of a subset of the list of contacts?

    Hi all

    I had a problem with the call from address book and select the contact. I need to invoke the myapplication Blackberry address book and view the list of contacts. However, instead of a list of wholecontact, I need to show to those who have at least one address. I tried to useBlackBerryContactList.choose (), but it seems no way to filter the contacts without address. Any who have the same problem or know the solution for it? Thank you very much!

    You can call the address book, but the list is not possible only a few Contacts. You could open a particular contact... Find the AddressBookArgument class for more details...

    Invoke.invokeApplication (Invoke.APP_TYPE_ADDRESSBOOK, new AddressBookArguments());

  • How to convert the &lt; Contact &gt; QLIST Qstring

    Hello

    I would like to send my contacts from the device to the server using the Soap web service. but the method which who sent the item on the server takes the QString parameter and the contacts which I am retriving are type QLIST then please suggest me a method that converts the QList QString.

    Help, please...

    QString has a constructor that accepts a QByteArray.

  • How to convert a Contact card in text format on the Clipboard?

    OMG, how to copy the text into a Contact card in the Clipboard to plain text?

    This violates some divinity of Apple? Why is it so difficult?

    Help!

    Different Contact item fields to copy to the Clipboard, but not the entire Contact. You will need to export the Contact information in vCard document (text) and then access the content later.

    You can select a contact from the Panel on the left request name and drag it to your desktop. It lands as a vCard (name.vcf).  You can also select the desired contact name and in the file menu: export: export vCard...

    Run the following command in the Terminal. It will display the vcard in the form of text content in the Terminal.

    AWK ' / BEGIN: VCARD /, / PHOTO; ENCODING / {print x}; {x = $0}' ~/Desktop/filename.vcf

    If you would like this out of text to the Clipboard, then

    AWK ' / BEGIN: VCARD /, / PHOTO; ENCODING / {print x}; {x = $0}' ~/Desktop/filename.vcf | pbpaste

    There is no standard Python and Ruby libraries for reading vCard directly and printing field information of easy to use, instead of all the gibberish of vCard.

  • How to convert outlook contacts PST file to work with Windows Live Mail?

    PST file

    I have a PST file of contacts on a USB key that came out of Microsoft Outlook. I want to export these contacts in Windows Live Mail desktop. How can I do this?

    Once that is done, is there a way to then export these same contacts for an Apple IPad2?

    Hello MarkPhillips77777,

    The best place to ask your question of Windows Live is inside Windows Live help forums. Experts specialize in all things, Windows Live, and would be delighted to help you with your questions. Please choose a product below to be redirected to the appropriate community:

    Windows Live Mail

    Windows Live Hotmail

    Windows Live Messenger

    Looking for a different product to Windows Live? Visit the home page Windows Live Help for the complete list of Windows Live forums to www.windowslivehelp.com.

  • Convert a Contact (.pdf form) sheet to JPEG?

    I created a Board-contact on Adobe Bridge CS5. I want to save as a jpeg, but it will only allow me to save it in pdf format. How can I change it to JPG... If this is possible?

    You could possibly open the. PDF file - in Photoshop then file save in JPEG has...

    -Christmas

  • In Contacts, how to print a mailing list?

    Hello

    I need to print a list of all the names in a specific mailing list.

    The instructions in the help of Contacts do not work. They say "to highlight the individual or in a group, go to file > print.»  All that happens when I do it is that it offers to print an envelope with my name etc as recipient and sender address area. Needless.

    How can I just print a list of names in a specific mailing list?

    Any help much appreciated.

    Giles

    Not sure whether you're El Capitan (as in your hardware profile) or Yosemite (the forum in which you posted) but the two versions of Contact are similar. In the dialog box print box is an option for 'Style' that includes "lists".

    By default, it can not show that lists so use the drop down menu to change it.

  • How to contact apple support from countries not listed for problem / apple account ID

    I'm created Apple ID using my gmail account but email is showing as already in existence (I don't remember not create) and I am not able to log in. I tried to use the e-mail delivery and it does not work and I have no idea on the questions of security. It is possible that my email was used by mistake as I donot get any email from apple products.

    My country is not listed in the list of countries to support, so I'll try to contact Apple support using "using my current location function" (who doesn't) and via link 'other Asia '. Either I'm doing something wrong, but nothing seems to work. When I do a calendar, a call, it does not recognize my number or my country code.

    I've lost nearly a week trying to figure how to contact apple support group. And the whole process is not so easy to use for those countries that are not included. The whole process is like being in a loop and not taking me to the real solution page.

    I would be grateful if anyone can give me a phone number or show me direction how to use the support of apple for other Asian countries that are not listed.

    I currently use on behalf of someone to put this question because my email does not work with the Apple.

    Contact Apple for support and service - Apple Support< all="" worldwide="" telephone="">

  • BlackBerry WebWorks PIM Contact Plugin customization for retriving the list of all the Contacts in the phonebook

    Hi all

    I use the plugin contact Blackberry 10 webwroks sdk 1.0.0.Howvere pim, it gives me almost all pim access contact api.

    However, I would like to add a few additional options of pim api. Exactly, I want to customize seen pim plugin contact. And to expose methods added to the WebWorks project.

    Now, will I have to make the plugin necessary to start contact (by writing native code, and then wrap the same in construction of extension).

    Or is he in any case, I can get the code for the pim.contact plugin that came with blackberry SDK and can make the necessary changes in the native code and buiding new folder so and, following the steps for the construction of the extension.

    Here is the reason why I am demanding to make it personalized:

    I can't find any method that can retrieve list of the basicarry contact a table containing data for all contacts. The only thing I am able to do using the method find explicitly by setting the limit.

    Please suggest something and also correct me if I am wrong somewhere.

    It may be easier to start with your own custom extensions, but if you want to take a look at the SDK WebWorks and included extensions, that would be the best starting point.

    https://github.com/BlackBerry/BB10-WebWorks-framework/tree/master/ext/PIM.contacts

  • Convert a string to a table of Word list

    Hi all

    Note: All here
    I have a strange requirement, I have a table that provides me with a description string

    For example

    Table_a

    Description
    -------------------------------------
    THE BOY IS SMART.
    A GUY AND A GIRL
    A MEMO % RAB? THE WEEK
    POLICE ARE INVESTIGATING

    I also have a list of words that should be ignored

    For example:
    Ignore_table

    ignore_list
    ---------------------
    THE
    IS
    A
    A
    ARE

    I need to convert a list of words in each sentence or string in the table_A.
    Potential separators (space, comma, pipe etc. defined in specifications) must be considered. Likely to be used with all possible delimiters defined, a reference table

    Example of output would be

    word_table

    list of words
    --------------
    THE
    BOY
    IS
    SMART
    A
    GUY
    AND
    A
    YOUNG GIRL
    MEMO
    RAB
    THE
    WEEK
    THE
    POLICE
    ARE
    INVESTIGATING


    This table will then be used as a source to compare a pre-defined list to ignore the words and select those that should not be ignored.

    Case is not a problem because everything must be converted to uppercase.
    creates this possible "word_table"?

    advice or tips will really help

    Birdy

    Just to avoid the product super cartesan and separate application on this subject, you might want this.

    SQL> WITH T
      2       AS (SELECT 1 ID, 'THE BOY IS SMART.' description FROM DUAL
      3           UNION
      4           SELECT 2, 'A GUY AND A GIRL' FROM DUAL
      5           UNION
      6           SELECT 3, 'A MEMO%RAB?LE WEEK' FROM DUAL
      7           UNION
      8           SELECT 4, 'THE,POLICE ARE INVESTIGATING' FROM DUAL)
      9  SELECT ID,REGEXP_SUBSTR ( description, '([^ '',.]+)', 1, lvl)
     10    FROM T,
     11         (SELECT LEVEL lvl
     12            FROM (SELECT MAX (LENGTH (REGEXP_REPLACE ( description, '[^ ,]'))) mx
     13                    FROM T)
     14          CONNECT BY LEVEL <= mx + 1)
     15   WHERE lvl - 1 <= LENGTH (REGEXP_REPLACE ( description, '[^ ,]'))
     16   ORDER BY ID,lvl;
    
            ID REGEXP_SUBSTR(DESCRIPTION,'(
    ---------- ----------------------------
             1 THE
             1 BOY
             1 IS
             1 SMART
             2 A
             2 GUY
             2 AND
             2 A
             2 GIRL
             3 A
             3 MEMO%RAB?LE
             3 WEEK
             4 THE
             4 POLICE
             4 ARE
             4 INVESTIGATING
    
    16 rows selected.
    
    SQL> 
    

    G.

  • Convert file .ctt file .txt

    How to convert my contact list of the .txt file .ctt file

    Hello

    In most cases will not convert simple txt file in XML format

    Otherwise, it depends on the layout of the contents of your text file.

    Read this page for more precision.

    http://www.stylusstudio.com/text_file_to_xml.html

    Jack MVP-networking. EZLAN.NET

  • Copy the Contacts from Vista to Windows 7 Contacts Possible?

    I have a new desktop under Windows 7 Home Premium. Before the death of my old desktop (Vista 32 Home Premium), I was able to copy my Contacts folder to a backup drive. Is Vista comes in contact with the same type of file as Windows 7 contacts? Is it possible to copy contacts from Vista to Windows 7 contacts folder? If this is not the case, how would I go about importing the contacts? Thank you!

    Hi Fallstar,

    Welcome to the Microsoft Answers site.

    You can import the information book or contact address of several formats used by other programs, convert them for use in this version of Windows and store them in your Contacts folder. You can also convert your contacts to other formats by exporting. Allows you to share them with people who use an earlier version of Windows or a different operating system.

    However, you must download Windows Live Mail in order to perform the steps listed in method 1. To download windows live mail on windows 7 click on the link below.

    Windows Live Mail

    http://www.Microsoft.com/downloads/details.aspx?displaylang=en&FamilyID=56883de5-2024-4631-806e-757693072a1c#requirements

    After installing windows live mail follow method 1.

    Method 1:

    Follow the steps mentioned below to import contacts.

    1. open Windows Contacts by clicking on the button start then on your user name. Type of contacts in the address bar and press ENTER.

    2. on the toolbar, click Import, and then click one of the following formats to import contacts from:

    o CSV (Comma Separated Values). It is a format of generic file used to export and import information to and from databases or spreadsheets. If you can't import an address book file directly into Windows Contacts, try everything first convert to a CSV file and then import this file.

    o LDIF (LDAP server). This format is used to import information from LDAP directory servers directory.

    o vCard (VCF file). This is the most widely used contacts format.

    o the Windows address book file (Outlook Express contacts). This format (.wab file) is used by most earlier versions of Windows, including Windows XP.

    3. click on import, locate the contacts file you want to import, and then click Open. The new contacts should appear in your Contacts folder.

    If you can't find the contacts file you want to import, see the documentation provided with the program that created the contacts or visit the manufacturer's website. You will need to export contacts from the program before you can import them into Windows Contacts.

    4. when a message appears telling you that the contacts import process has completed, click OK and then click Close.

    For more information, see the article mentioned below.

    Import, export, or change the format for contacts

    http://Windows.Microsoft.com/en-us/Windows7/import-export-or-change-the-format-for-contacts

    Or follow method 2.

    Method 2:

    1. in Vista, navigate to the folder C:\Users\(user name) \Contacts , and then copy all your contacts and groups of contacts to something (ex: DVD, USB drive, etc.) to copy in Windows 7.

    (2 in Windows 7, copy the Vista contacts and groups of contacts in the folder C:\Users\(user name) \Contacts .

    Hope this information is useful.

    Thanks and regards.

    Thahaseena M
    Microsoft Answers Support Engineer.
    Visit our Microsoft answers feedback Forum and let us know what you think.

  • iCloud Contacts disappear from Oultllo after updates

    After I have updated recently iCloud and Windows 10 (update of the anniversary) my iCloud Contacts disappeared from Outlook 2007, giving the following message appears in Outlook by clicking Contacts iCloud: "failed to open all the files. The information store could not be opened. "When clicking on tools-address book in Outlook, the following message appears:"unable to display the list of addresses. The Contacts folder associated with this address list could not be opened. It may have been deleted or you do not have permissions.

    Everything worked fine before the update and the address list is in my iCloud contact account and is accessible by my iPhone.

    I tried to export a vCard in iCloud for import in Outlook by going to the Menu Action to iCloud and selecting 'Select all' and then 'export vCard', but no window never opens in which name and save the file.

    As a last resort, I could probably restore the old file of Contacts if I knew where she stood in Outlook.

    I tried many suggestions but nothing worked. Someone has any idea how to restore the iCloud Contacts file in Outlook?

    Thank you

    See if it helps, - the set of folders could not be opened. The information store could not be opened.

  • Suggested contacts corrupted

    When the composition or send an e-mail, click in the address bar and start typing > a pop-up/drop-down menu with a list of suggested addresses.

    -The list includes: former winners / previous contacts / previous recipients.

    -The list appears to include addresses which have never been used or stored on the real device, but have been used or stored on other devices at any given time, but also are more stored in all Apps.

    Why these appear when?

    (a) settings > Contacts > Contacts found in Apps... is set to OFF.

    (b) settings > general > Spotlight search... all is set to OFF.

    Where he 'draws' this information since then?

    _____

    The same thing happens in the Messages application, although the entries in the drop-down pop-up/list differ.

    -The proposed lists also includes current Contacts, but displays the previous names, for example: contact is now called - Ben. At one point the contact previously qualified - Jimmys Mate. Jimmys Mate, this is what comes!

    In addition to being extremely laborious, scrolling of the endless lists. This has the potential of disaster, Contacts information are constantly changing. I have no desire to see several e-mail addresses or phone numbers, I might have used previously, but are no longer relevant.

    ... It seems that Mail & APPs Message reference also against an old database. I noticed on 10 iOS device is a database called RECENT where some of the suggestions are taken from.

    Hello

    The Mail App has the question "Previous winners" in the window Menu.

    It can be accessed and will show ANY address that was sent to you, even if it was spam or ordinary e-mail.

    Messages stores the elements of what was a list of recent in the com.apple.ichat.plist although it is difficult to change.

    The actual Menu item is gone in Yosemite and higher.

    This list of recent is the real you got cats.

    As the list is in the ~/Library/Messages data element that has the largest file size.

    The file is a little readable in TextEdit and can them be sought (search in the Menu Edition) for the elements concerned.

    I still work on the criteria for what is included in this list.

    I still try to edit this file.

    21:02 Thursday; September 15, 2016

     iMac 2.5 Ghz i5 2011 (El Capitan)
     G4/1GhzDual MDD (Leopard 10.5.8)
     MacBookPro (Snow Leopard 10.6.8) 2 GB
     Mac OS X (10.6.8).
     iPhone and iPad (2)

Maybe you are looking for