/usr/share/qt5/doc/qtcontacts/qcontact.html is in qtpim5-doc-html 5.0~git20140515~29475884-0ubuntu24~7.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 | <?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<!-- qcontact.cpp -->
<title>QContact Class | Qt 5.0</title>
<link rel="stylesheet" type="text/css" href="style/offline-simple.css" />
<script type="text/javascript">
document.getElementsByTagName("link").item(0).setAttribute("href", "style/offline.css");
// loading style sheet breaks anchors that were jumped to before
// so force jumping to anchor again
setTimeout(function() {
var anchor = location.hash;
// need to jump to different anchor first (e.g. none)
location.hash = "#";
setTimeout(function() {
location.hash = anchor;
}, 0);
}, 0);
</script>
</head>
<body>
<div class="header" id="qtdocheader">
<div class="main">
<div class="main-rounded">
<div class="navigationbar">
<table><tr>
<td >Qt 5.0</td><td >QContact</td></tr></table><table class="buildversion"><tr>
<td id="buildversion" width="100%" align="right">Qt 5.0.0 Reference Documentation</td>
</tr></table>
</div>
</div>
<div class="content">
<div class="line">
<div class="content mainContent">
<div class="sidebar">
<div class="toc">
<h3><a name="toc">Contents</a></h3>
<ul>
<li class="level1"><a href="#public-functions">Public Functions</a></li>
<li class="level1"><a href="#details">Detailed Description</a></li>
</ul>
</div>
<div class="sidebar-content" id="sidebar-content"></div></div>
<h1 class="title">QContact Class</h1>
<!-- $$$QContact-brief -->
<p>The <a href="qcontact.html">QContact</a> class represents an addressbook contact. <a href="#details">More...</a></p>
<!-- @@@QContact -->
<div class="table"><table class="alignedsummary">
<tr><td class="memItemLeft rightAlign topAlign"> Header:</td><td class="memItemRight bottomAlign"> <span class="preprocessor">#include <QContact></span>
</td></tr></table></div><ul>
<li><a href="qcontact-members.html">List of all members, including inherited members</a></li>
</ul>
<a name="public-functions"></a>
<h2 id="public-functions">Public Functions</h2>
<div class="table"><table class="alignedsummary">
<tr><td class="memItemLeft rightAlign topAlign"> </td><td class="memItemRight bottomAlign"><b><a href="qcontact.html#QContact">QContact</a></b>()</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> </td><td class="memItemRight bottomAlign"><b><a href="qcontact.html#QContact-1">QContact</a></b>(const QContact &<i>other</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> </td><td class="memItemRight bottomAlign"><b><a href="qcontact.html#dtor.QContact">~QContact</a></b>()</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qcontact.html#addTag">addTag</a></b>(const QString &<i>tag</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qcontact.html#appendDetail">appendDetail</a></b>(const QContactDetail &<i>detail</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QList<QContactActionDescriptor> </td><td class="memItemRight bottomAlign"><b><a href="qcontact.html#availableActions">availableActions</a></b>(const QString &<i>serviceName</i> = QString()) const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qcontact.html#clearDetails">clearDetails</a></b>()</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qcontact.html#clearTags">clearTags</a></b>()</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QContactDetail </td><td class="memItemRight bottomAlign"><b><a href="qcontact.html#detail">detail</a></b>(QContactDetail::DetailType <i>type</i>) const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> T </td><td class="memItemRight bottomAlign"><b><a href="qcontact.html#detail-1">detail</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QList<QContactDetail> </td><td class="memItemRight bottomAlign"><b><a href="qcontact.html#details">details</a></b>(QContactDetail::DetailType <i>type</i> = QContactDetail::TypeUndefined) const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QList<T> </td><td class="memItemRight bottomAlign"><b><a href="qcontact.html#details-1">details</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QContactId </td><td class="memItemRight bottomAlign"><b><a href="qcontact.html#id">id</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qcontact.html#isEmpty">isEmpty</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qcontact.html#isPreferredDetail">isPreferredDetail</a></b>(const QString &<i>actionName</i>, const QContactDetail &<i>detail</i>) const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QContactDetail </td><td class="memItemRight bottomAlign"><b><a href="qcontact.html#preferredDetail">preferredDetail</a></b>(const QString &<i>actionName</i>) const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QMap<QString, QContactDetail> </td><td class="memItemRight bottomAlign"><b><a href="qcontact.html#preferredDetails">preferredDetails</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QList<QContact> </td><td class="memItemRight bottomAlign"><b><a href="qcontact.html#relatedContacts">relatedContacts</a></b>(const QString &<i>relationshipType</i> = QString(), QContactRelationship::Role <i>role</i> = QContactRelationship::Either) const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QList<QContactRelationship> </td><td class="memItemRight bottomAlign"><b><a href="qcontact.html#relationships">relationships</a></b>(const QString &<i>relationshipType</i> = QString()) const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qcontact.html#removeDetail">removeDetail</a></b>(QContactDetail *<i>detail</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qcontact.html#saveDetail">saveDetail</a></b>(QContactDetail *<i>detail</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qcontact.html#setId">setId</a></b>(const QContactId &<i>id</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qcontact.html#setPreferredDetail">setPreferredDetail</a></b>(const QString &<i>actionName</i>, const QContactDetail &<i>preferredDetail</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qcontact.html#setTags">setTags</a></b>(const QStringList &<i>tags</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qcontact.html#setType">setType</a></b>(const QContactType::TypeValues &<i>type</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QStringList </td><td class="memItemRight bottomAlign"><b><a href="qcontact.html#tags">tags</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QContactType::TypeValues </td><td class="memItemRight bottomAlign"><b><a href="qcontact.html#type">type</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qcontact.html#operator-not-eq">operator!=</a></b>(const QContact &<i>other</i>) const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QContact &</td><td class="memItemRight bottomAlign"><b><a href="qcontact.html#operator-eq">operator=</a></b>(const QContact &<i>other</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qcontact.html#operator-eq-eq">operator==</a></b>(const QContact &<i>other</i>) const</td></tr>
</table></div>
<a name="details"></a>
<!-- $$$QContact-description -->
<div class="descr">
<h2 id="details">Detailed Description</h2>
<p>The <a href="qcontact.html">QContact</a> class represents an addressbook contact.</p>
<p>Individual contacts, groups, and other types of contacts are represented with a <a href="qcontact.html">QContact</a> object. In addition to the type, a <a href="qcontact.html">QContact</a> consists of information that belongs to the contact, some information about the relationships that the contact has, and the preferred ways to interact with the contact.</p>
<p>A <a href="qcontact.html">QContact</a> object has a collection of details (like a name, phone numbers and email addresses). Each detail (which can have multiple fields) is stored in an appropriate subclass of <a href="qcontactdetail.html">QContactDetail</a>, and the <a href="qcontact.html">QContact</a> allows retrieving these details in various ways.</p>
<p>Depending on the details of the <a href="qcontact.html">QContact</a>, certain actions are available for a contact. An instance of a <a href="qcontact.html">QContact</a> can return a list of actions that can be performed on it, and a list of details supported by a specific action can be retrieved (for example - a list of phone numbers supported by a specific "Call" action). It is also possible to store one detail for each type of action that is the "preferred" detail to use.</p>
<p>A <a href="qcontact.html">QContact</a> may have zero or more relationships with other contacts. For example, a group contact would have a <code>"HasMember"</code> relationship with the QContacts that are its members. Spouses, managers and assistants can also be represented this way.</p>
<p>A <a href="qcontact.html">QContact</a> instance represents the in-memory version of an addressbook contact, and has no tie to a specific <a href="qcontactmanager.html">QContactManager</a>. It is possible for the contents of a <a href="qcontact.html">QContact</a> to change independently of the contents that are stored persistently in a <a href="qcontactmanager.html">QContactManager</a>. A <a href="qcontact.html">QContact</a> has an ID associated with it when it is first retrieved from a <a href="qcontactmanager.html">QContactManager</a>, or after it has been first saved, and this allows clients to track changes using the signals in <a href="qcontactmanager.html">QContactManager</a>.</p>
<p>A <a href="qcontact.html">QContact</a> has a number of mandatory details:</p>
<ul>
<li>A QContactType, with the type of the contact (individual contact, group etc)</li>
</ul>
</div>
<p><b>See also </b><a href="qcontactmanager.html">QContactManager</a> and <a href="qcontactdetail.html">QContactDetail</a>.</p>
<!-- @@@QContact -->
<div class="func">
<h2>Member Function Documentation</h2>
<!-- $$$QContact[overload1]$$$QContact -->
<h3 class="fn" id="QContact"><a name="QContact"></a>QContact::<span class="name">QContact</span>()</h3>
<p>Construct an empty contact.</p>
<p>The contact will have an empty id, and have type QContactType::TypeContact. The <a href="qcontact.html#isEmpty">isEmpty</a>() function will return true.</p>
<!-- @@@QContact -->
<!-- $$$QContact$$$QContactconstQContact& -->
<h3 class="fn" id="QContact-1"><a name="QContact-1"></a>QContact::<span class="name">QContact</span>(const <span class="type"><a href="qcontact.html#QContact">QContact</a></span> &<i>other</i>)</h3>
<p>Initializes this <a href="qcontact.html">QContact</a> from <i>other</i></p>
<!-- @@@QContact -->
<!-- $$$~QContact[overload1]$$$~QContact -->
<h3 class="fn" id="dtor.QContact"><a name="dtor.QContact"></a>QContact::<span class="name">~QContact</span>()</h3>
<p>Frees the memory used by this <a href="qcontact.html">QContact</a></p>
<!-- @@@~QContact -->
<!-- $$$addTag[overload1]$$$addTagconstQString& -->
<h3 class="fn" id="addTag"><a name="addTag"></a><span class="type">void</span> QContact::<span class="name">addTag</span>(const <span class="type">QString</span> &<i>tag</i>)</h3>
<p>Adds the <i>tag</i> to this contact.</p>
<p><b>See also </b><a href="qcontacttag.html">QContactTag</a>.</p>
<!-- @@@addTag -->
<!-- $$$appendDetail[overload1]$$$appendDetailconstQContactDetail& -->
<h3 class="fn" id="appendDetail"><a name="appendDetail"></a><span class="type">bool</span> QContact::<span class="name">appendDetail</span>(const <span class="type"><a href="qcontactdetail.html">QContactDetail</a></span> &<i>detail</i>)</h3>
<p>Appends the given <i>detail</i> to the list of stored details. This is a convenience method intended to be used e.g. by backend developers to populate an empty <a href="qcontact.html">QContact</a> object when fetching data from the backend. If <i>detail</i> is a QContactType, the existing contact type will be overwritten with <i>detail</i>. There is never more than one contact type in a contact.</p>
<p>Note that if another detail of the same type and id has been previously saved in this contact, that detail is duplicated. For this reason, this method should not be used to update an existing contact object with a newer version of an existing detail. For this use case, the clients must use the <a href="qcontact.html#saveDetail">saveDetail</a>() method.</p>
<p>Returns true if the detail was appended successfully, otherwise returns false.</p>
<p><b>See also </b><a href="qcontact.html#saveDetail">saveDetail</a>().</p>
<!-- @@@appendDetail -->
<!-- $$$availableActions[overload1]$$$availableActionsconstQString& -->
<h3 class="fn" id="availableActions"><a name="availableActions"></a><span class="type">QList</span><<span class="type"><a href="qcontactactiondescriptor.html">QContactActionDescriptor</a></span>> QContact::<span class="name">availableActions</span>(const <span class="type">QString</span> &<i>serviceName</i> = QString()) const</h3>
<p>Return a list of descriptors for the actions available to be performed on this contact.</p>
<p>The actions considered can be restricted by the optional parameters The actions can be restricted to those provided by a specific service with the <i>serviceName</i> parameter. If <i>serviceName</i> is empty, actions provided by any service will be returned if the contact meets the required criteria (contains details of the correct type, etc).</p>
<p>Each action that matches the above criteria will be tested to see if this contact is supported by the action, and a list of the action descriptors that are supported will be returned.</p>
<!-- @@@availableActions -->
<!-- $$$clearDetails[overload1]$$$clearDetails -->
<h3 class="fn" id="clearDetails"><a name="clearDetails"></a><span class="type">void</span> QContact::<span class="name">clearDetails</span>()</h3>
<p>Removes all details of the contact. This function does not modify the id or type of the contact. Calling <a href="qcontact.html#isEmpty">isEmpty</a>() after calling this function will return true.</p>
<!-- @@@clearDetails -->
<!-- $$$clearTags[overload1]$$$clearTags -->
<h3 class="fn" id="clearTags"><a name="clearTags"></a><span class="type">void</span> QContact::<span class="name">clearTags</span>()</h3>
<p>Removes all tags associated with the contact.</p>
<p><b>See also </b><a href="qcontacttag.html">QContactTag</a>.</p>
<!-- @@@clearTags -->
<!-- $$$detail[overload1]$$$detailQContactDetail::DetailType -->
<h3 class="fn" id="detail"><a name="detail"></a><span class="type"><a href="qcontactdetail.html">QContactDetail</a></span> QContact::<span class="name">detail</span>(<span class="type"><a href="qcontactdetail.html#DetailType-enum">QContactDetail::DetailType</a></span> <i>type</i>) const</h3>
<p>Returns the first detail stored in the contact which with the given <i>type</i>. The <i>type</i> argument is typically the detail type constant provided by a specific subclass of <a href="qcontactdetail.html">QContactDetail</a>. For example:</p>
<pre class="cpp">
<span class="type"><a href="qcontactdetail.html">QContactDetail</a></span> detail <span class="operator">=</span> contact<span class="operator">.</span>detail(<span class="type"><a href="qcontactname.html">QContactName</a></span><span class="operator">::</span>Type);
</pre>
<p>It would usually be more convenient to use the template version of this function, in the following manner:</p>
<pre class="cpp">
<span class="type"><a href="qcontactname.html">QContactName</a></span> name <span class="operator">=</span> contact<span class="operator">.</span>detail<span class="operator"><</span><span class="type"><a href="qcontactname.html">QContactName</a></span><span class="operator">></span>();
</pre>
<!-- @@@detail -->
<!-- $$$detail$$$detail -->
<h3 class="fn" id="detail-1"><a name="detail-1"></a><span class="type">T</span> QContact::<span class="name">detail</span>() const</h3>
<p>Returns the first detail of the template parameter type, as returned by the template <a href="qcontact.html#details-1">details</a>() function. The type must be a subclass of <a href="qcontactdetail.html">QContactDetail</a>.</p>
<!-- @@@detail -->
<!-- $$$details[overload1]$$$detailsQContactDetail::DetailType -->
<h3 class="fn" id="details"><a name="details"></a><span class="type">QList</span><<span class="type"><a href="qcontactdetail.html">QContactDetail</a></span>> QContact::<span class="name">details</span>(<span class="type"><a href="qcontactdetail.html#DetailType-enum">QContactDetail::DetailType</a></span> <i>type</i> = QContactDetail::TypeUndefined) const</h3>
<p>Returns a list of details of the given <i>type</i>.</p>
<p>The <i>type</i> argument is typically the detail type constant provided by a specific subclass of <a href="qcontactdetail.html">QContactDetail</a>. For example:</p>
<pre class="cpp">
<span class="type">QList</span><span class="operator"><</span><span class="type"><a href="qcontactdetail.html">QContactDetail</a></span><span class="operator">></span> details <span class="operator">=</span> contact<span class="operator">.</span>details(<span class="type"><a href="qcontactphonenumber.html">QContactPhoneNumber</a></span><span class="operator">::</span>Type);
</pre>
<p>It would usually be more convenient to use the template version of this function, in the following manner:</p>
<pre class="cpp">
<span class="type">QList</span><span class="operator"><</span><span class="type"><a href="qcontactphonenumber.html">QContactPhoneNumber</a></span><span class="operator">></span> phoneNumbers <span class="operator">=</span> contact<span class="operator">.</span>details<span class="operator"><</span><span class="type"><a href="qcontactphonenumber.html">QContactPhoneNumber</a></span><span class="operator">></span>();
</pre>
<!-- @@@details -->
<!-- $$$details$$$details -->
<h3 class="fn" id="details-1"><a name="details-1"></a><span class="type">QList</span><<span class="type">T</span>> QContact::<span class="name">details</span>() const</h3>
<p>Returns a list of details of the template parameter type. The type must be a subclass of <a href="qcontactdetail.html">QContactDetail</a>.</p>
<p>For example:</p>
<pre class="cpp">
<span class="type">QList</span><span class="operator"><</span><span class="type"><a href="qcontactphonenumber.html">QContactPhoneNumber</a></span><span class="operator">></span> phoneNumbers <span class="operator">=</span> contact<span class="operator">.</span>details<span class="operator"><</span><span class="type"><a href="qcontactphonenumber.html">QContactPhoneNumber</a></span><span class="operator">></span>();
</pre>
<!-- @@@details -->
<!-- $$$id[overload1]$$$id -->
<h3 class="fn" id="id"><a name="id"></a><span class="type"><a href="qcontactid.html">QContactId</a></span> QContact::<span class="name">id</span>() const</h3>
<p>Returns the <a href="qcontactid.html">QContactId</a> that identifies this contact.</p>
<p>This may have been set when the contact was retrieved from a particular manager, or when the contact was first saved in a manager. The <a href="qcontactid.html">QContactId</a> is only valid with a specific manager. See <a href="qcontactmanager.html#saveContact">QContactManager::saveContact</a>() for more information.</p>
<p><b>See also </b><a href="qcontact.html#setId">setId</a>().</p>
<!-- @@@id -->
<!-- $$$isEmpty[overload1]$$$isEmpty -->
<h3 class="fn" id="isEmpty"><a name="isEmpty"></a><span class="type">bool</span> QContact::<span class="name">isEmpty</span>() const</h3>
<p>Returns true if this <a href="qcontact.html">QContact</a> is empty, false if not.</p>
<p>An empty <a href="qcontact.html">QContact</a> has no extra details. The type of the contact is irrelevant.</p>
<!-- @@@isEmpty -->
<!-- $$$isPreferredDetail[overload1]$$$isPreferredDetailconstQString&constQContactDetail& -->
<h3 class="fn" id="isPreferredDetail"><a name="isPreferredDetail"></a><span class="type">bool</span> QContact::<span class="name">isPreferredDetail</span>(const <span class="type">QString</span> &<i>actionName</i>, const <span class="type"><a href="qcontactdetail.html">QContactDetail</a></span> &<i>detail</i>) const</h3>
<p>Returns true if the given <i>detail</i> is a preferred detail for the given <i>actionName</i>, or for any action if the <i>actionName</i> is empty.</p>
<p><b>See also </b><a href="qcontact.html#preferredDetail">preferredDetail</a>().</p>
<!-- @@@isPreferredDetail -->
<!-- $$$preferredDetail[overload1]$$$preferredDetailconstQString& -->
<h3 class="fn" id="preferredDetail"><a name="preferredDetail"></a><span class="type"><a href="qcontactdetail.html">QContactDetail</a></span> QContact::<span class="name">preferredDetail</span>(const <span class="type">QString</span> &<i>actionName</i>) const</h3>
<p>Returns the preferred detail for a given <i>actionName</i>.</p>
<p>If the <i>actionName</i> is empty, or there is no preference recorded for the supplied <i>actionName</i>, returns an empty <a href="qcontactdetail.html">QContactDetail</a>.</p>
<p><b>See also </b><a href="qcontact.html#setPreferredDetail">setPreferredDetail</a>() and <a href="qcontact.html#preferredDetails">preferredDetails</a>().</p>
<!-- @@@preferredDetail -->
<!-- $$$preferredDetails[overload1]$$$preferredDetails -->
<h3 class="fn" id="preferredDetails"><a name="preferredDetails"></a><span class="type">QMap</span><<span class="type">QString</span>, <span class="type"><a href="qcontactdetail.html">QContactDetail</a></span>> QContact::<span class="name">preferredDetails</span>() const</h3>
<p>Returns the recorded detail preferences for action names.</p>
<p>Each entry in the map has the action name as the key, and the corresponding preferred detail as the value.</p>
<!-- @@@preferredDetails -->
<!-- $$$relatedContacts[overload1]$$$relatedContactsconstQString&QContactRelationship::Role -->
<h3 class="fn" id="relatedContacts"><a name="relatedContacts"></a><span class="type">QList</span><<span class="type"><a href="qcontact.html#QContact">QContact</a></span>> QContact::<span class="name">relatedContacts</span>(const <span class="type">QString</span> &<i>relationshipType</i> = QString(), <span class="type"><a href="qcontactrelationship.html#Role-enum">QContactRelationship::Role</a></span> <i>role</i> = QContactRelationship::Either) const</h3>
<p>Returns a list of the ids of contacts which have a relationship of the given <i>relationshipType</i> with this contact. The <i>role</i> parameter describes the role that the related contacts have in the relationship.</p>
<p>If <i>relationshipType</i> is empty, relationships of all types will be considered.</p>
<p><b>Note: </b>This function only examines the relationships that were present when this contact was retrieved from a manager. You can also query the manager directly, if you require the most up to date information.</p><pre class="cpp">
<span class="comment">// Who are the members of a group contact?</span>
<span class="type">QList</span><span class="operator"><</span><span class="type"><a href="qcontact.html#QContact">QContact</a></span><span class="operator">></span> groupMembers <span class="operator">=</span> groupContact<span class="operator">.</span>relatedContacts(<span class="type"><a href="qcontactrelationship.html">QContactRelationship</a></span><span class="operator">::</span>HasMember()<span class="operator">,</span> <span class="type"><a href="qcontactrelationship.html">QContactRelationship</a></span><span class="operator">::</span>Second);
<span class="comment">// What groups is this contact in?</span>
<span class="type">QList</span><span class="operator"><</span><span class="type"><a href="qcontact.html#QContact">QContact</a></span><span class="operator">></span> contactGroups <span class="operator">=</span> contact<span class="operator">.</span>relatedContacts(<span class="type"><a href="qcontactrelationship.html">QContactRelationship</a></span><span class="operator">::</span>HasMember()<span class="operator">,</span> <span class="type"><a href="qcontactrelationship.html">QContactRelationship</a></span><span class="operator">::</span>First);
<span class="comment">// An alternative to QContact::relationships()</span>
<span class="type">QList</span><span class="operator"><</span><span class="type"><a href="qcontact.html#QContact">QContact</a></span><span class="operator">></span> spouses <span class="operator">=</span> contact<span class="operator">.</span>relatedContacts(<span class="type"><a href="qcontactrelationship.html">QContactRelationship</a></span><span class="operator">::</span>HasSpouse()<span class="operator">,</span> <span class="type"><a href="qcontactrelationship.html">QContactRelationship</a></span><span class="operator">::</span>Either);
<span class="keyword">if</span> (spouses<span class="operator">.</span>count() <span class="operator">></span> <span class="number">1</span>) {
<span class="comment">// Custom relationship type</span>
<span class="type">QList</span><span class="operator"><</span><span class="type"><a href="qcontact.html#QContact">QContact</a></span><span class="operator">></span> therapists <span class="operator">=</span> contact<span class="operator">.</span>relatedContacts(<span class="string">"HasTherapist"</span><span class="operator">,</span> <span class="type"><a href="qcontactrelationship.html">QContactRelationship</a></span><span class="operator">::</span>Second);
}
</pre>
<p><b>See also </b><a href="qcontactrelationshipfetchrequest.html">QContactRelationshipFetchRequest</a> and <a href="qcontactmanager.html#relationships">QContactManager::relationships</a>().</p>
<!-- @@@relatedContacts -->
<!-- $$$relationships[overload1]$$$relationshipsconstQString& -->
<h3 class="fn" id="relationships"><a name="relationships"></a><span class="type">QList</span><<span class="type"><a href="qcontactrelationship.html">QContactRelationship</a></span>> QContact::<span class="name">relationships</span>(const <span class="type">QString</span> &<i>relationshipType</i> = QString()) const</h3>
<p>Returns a list of relationships of the given <i>relationshipType</i> in which this contact is a participant.</p>
<p>If <i>relationshipType</i> is empty, all relationships will be returned.</p>
<p><b>Note: </b>This function only examines the relationships that were present when this contact was retrieved from a manager. You can also query the manager directly, if you require the most up to date information.</p><pre class="cpp">
<span class="type">QList</span><span class="operator"><</span><span class="type"><a href="qcontactrelationship.html">QContactRelationship</a></span><span class="operator">></span> spouseRelationships <span class="operator">=</span> contact<span class="operator">.</span>relationships(<span class="type"><a href="qcontactrelationship.html">QContactRelationship</a></span><span class="operator">::</span>HasSpouse());
<span class="comment">// For each relationship in spouseRelationships, contact.id() will either be first() or second()</span>
</pre>
<p><b>See also </b><a href="qcontactrelationshipfetchrequest.html">QContactRelationshipFetchRequest</a> and <a href="qcontactmanager.html#relationships">QContactManager::relationships</a>().</p>
<!-- @@@relationships -->
<!-- $$$removeDetail[overload1]$$$removeDetailQContactDetail* -->
<h3 class="fn" id="removeDetail"><a name="removeDetail"></a><span class="type">bool</span> QContact::<span class="name">removeDetail</span>(<span class="type"><a href="qcontactdetail.html">QContactDetail</a></span> *<i>detail</i>)</h3>
<p>Removes the <i>detail</i> from the contact.</p>
<p>The detail in the contact which has the same key as that of the given <i>detail</i> will be removed if it exists. Only the key is used for comparison - that is, the information in the detail may be different.</p>
<p>Any action preferences for the matching detail is also removed.</p>
<p>Be aware that if a contact is retrieved (or reloaded) from the backend, the keys of any details it contains may have been changed by the backend, or other threads may have modified the contact details in the backend. Therefore, clients should reload the detail that they wish to remove from a contact after retrieving the contact, in order to ensure that the remove operation is successful.</p>
<p>If the detail's access constraint includes <code>QContactDetail::Irremovable</code>, this function will return false.</p>
<p>Returns true if the detail was removed successfully, false if an error occurred.</p>
<p>Note that the caller retains ownership of the detail.</p>
<!-- @@@removeDetail -->
<!-- $$$saveDetail[overload1]$$$saveDetailQContactDetail* -->
<h3 class="fn" id="saveDetail"><a name="saveDetail"></a><span class="type">bool</span> QContact::<span class="name">saveDetail</span>(<span class="type"><a href="qcontactdetail.html">QContactDetail</a></span> *<i>detail</i>)</h3>
<p>Saves the given <i>detail</i> in the list of stored details, and sets the detail's id. If another detail of the same type and id has been previously saved in this contact, that detail is overwritten. Otherwise, a new id is generated and set in the detail, and the detail is added to the contact.</p>
<p>If the detail's access constraint includes <code>QContactDetail::ReadOnly</code>, this function will return true and save the detail in the contact, however attempting to save the contact in a manager may fail (if that manager decides that the read only detail should not be updated). Details with the <code>QContactDetail::ReadOnly</code> constraint set are typically provided in a contact by the manager, and are usually information that is either synthesized, or not intended to be changed by the user (e.g. presence information for other contacts).</p>
<p>If <i>detail</i> is a QContactType, the existing contact type will be overwritten with <i>detail</i>. There is never more than one contact type in a contact.</p>
<p>Be aware that if a contact is retrieved (or reloaded) from the backend, the keys of any details it contains may have been changed by the backend, or other threads may have modified the contact details in the backend. Therefore, clients should reload the detail that they wish to save in a contact after retrieving the contact, in order to avoid creating unwanted duplicated details.</p>
<p>Returns true if the detail was saved successfully, otherwise returns false.</p>
<p>Note that the caller retains ownership of the detail.</p>
<!-- @@@saveDetail -->
<!-- $$$setId[overload1]$$$setIdconstQContactId& -->
<h3 class="fn" id="setId"><a name="setId"></a><span class="type">void</span> QContact::<span class="name">setId</span>(const <span class="type"><a href="qcontactid.html">QContactId</a></span> &<i>id</i>)</h3>
<p>Sets the id of this contact to <i>id</i>.</p>
<p>Note that this only affects this object, not any corresponding structures stored by a <a href="qcontactmanager.html">QContactManager</a>.</p>
<p>If you change the id of a contact and save the contact in a manager, the previously existing contact will still exist. You can do this to create copies (possibly modified) of an existing contact, or to save a contact in a different manager.</p>
<p><b>See also </b><a href="qcontact.html#id">id</a>() and <a href="qcontactmanager.html#saveContact">QContactManager::saveContact</a>().</p>
<!-- @@@setId -->
<!-- $$$setPreferredDetail[overload1]$$$setPreferredDetailconstQString&constQContactDetail& -->
<h3 class="fn" id="setPreferredDetail"><a name="setPreferredDetail"></a><span class="type">bool</span> QContact::<span class="name">setPreferredDetail</span>(const <span class="type">QString</span> &<i>actionName</i>, const <span class="type"><a href="qcontactdetail.html">QContactDetail</a></span> &<i>preferredDetail</i>)</h3>
<p>Set a particular detail (<i>preferredDetail</i>) as the preferred detail for any actions with the given <i>actionName</i>.</p>
<p>The <i>preferredDetail</i> object must exist in this object, and the <i>actionName</i> cannot be empty.</p>
<p>Returns true if the preference could be recorded, and false otherwise.</p>
<p><b>See also </b><a href="qcontact.html#preferredDetail">preferredDetail</a>().</p>
<!-- @@@setPreferredDetail -->
<!-- $$$setTags[overload1]$$$setTagsconstQStringList& -->
<h3 class="fn" id="setTags"><a name="setTags"></a><span class="type">void</span> QContact::<span class="name">setTags</span>(const <span class="type">QStringList</span> &<i>tags</i>)</h3>
<p>Sets the list of tags associated with the contact to <i>tags</i>.</p>
<p><b>See also </b><a href="qcontact.html#tags">tags</a>() and <a href="qcontacttag.html">QContactTag</a>.</p>
<!-- @@@setTags -->
<!-- $$$setType[overload1]$$$setTypeconstQContactType::TypeValues& -->
<h3 class="fn" id="setType"><a name="setType"></a><span class="type">void</span> QContact::<span class="name">setType</span>(const <span class="type">QContactType::TypeValues</span> &<i>type</i>)</h3>
<p>Sets the type of the contact to the given <i>type</i>.</p>
<p><b>See also </b><a href="qcontact.html#type">type</a>().</p>
<!-- @@@setType -->
<!-- $$$tags[overload1]$$$tags -->
<h3 class="fn" id="tags"><a name="tags"></a><span class="type">QStringList</span> QContact::<span class="name">tags</span>() const</h3>
<p>Returns the list of tags for this contact. Tags are used for non-exclusive categorization.</p>
<p><b>See also </b><a href="qcontact.html#setTags">setTags</a>() and <a href="qcontacttag.html">QContactTag</a>.</p>
<!-- @@@tags -->
<!-- $$$type[overload1]$$$type -->
<h3 class="fn" id="type"><a name="type"></a><span class="type">QContactType::TypeValues</span> QContact::<span class="name">type</span>() const</h3>
<p>Returns the type of the contact. Every contact has exactly one type which is either set manually (by saving a modified copy of the QContactType in the contact, or by calling <a href="qcontact.html#setType">setType</a>()) or synthesized automatically.</p>
<p><b>See also </b><a href="qcontact.html#setType">setType</a>().</p>
<!-- @@@type -->
<!-- $$$operator!=[overload1]$$$operator!=constQContact& -->
<h3 class="fn" id="operator-not-eq"><a name="operator-not-eq"></a><span class="type">bool</span> QContact::<span class="name">operator!=</span>(const <span class="type"><a href="qcontact.html#QContact">QContact</a></span> &<i>other</i>) const</h3>
<p>Returns true if this contacts id or details are different to those of the <i>other</i> contact.</p>
<!-- @@@operator!= -->
<!-- $$$operator=[overload1]$$$operator=constQContact& -->
<h3 class="fn" id="operator-eq"><a name="operator-eq"></a><span class="type"><a href="qcontact.html#QContact">QContact</a></span> &QContact::<span class="name">operator=</span>(const <span class="type"><a href="qcontact.html#QContact">QContact</a></span> &<i>other</i>)</h3>
<p>Replace the contents of this <a href="qcontact.html">QContact</a> with <i>other</i></p>
<!-- @@@operator= -->
<!-- $$$operator==[overload1]$$$operator==constQContact& -->
<h3 class="fn" id="operator-eq-eq"><a name="operator-eq-eq"></a><span class="type">bool</span> QContact::<span class="name">operator==</span>(const <span class="type"><a href="qcontact.html#QContact">QContact</a></span> &<i>other</i>) const</h3>
<p>Returns true if this contact is equal to the <i>other</i> contact, false if either the id or stored details are not the same</p>
<!-- @@@operator== -->
</div>
</div>
</div>
</div>
</div>
</div>
<div class="footer">
<p>
<acronym title="Copyright">©</acronym> 2017 The Qt Company Ltd.
Documentation contributions included herein are the copyrights of
their respective owners.<br> The documentation provided herein is licensed under the terms of the <a href="http://www.gnu.org/licenses/fdl.html">GNU Free Documentation License version 1.3</a> as published by the Free Software Foundation.<br> Qt and respective logos are trademarks of The Qt Company Ltd. in Finland and/or other countries worldwide. All other trademarks are property
of their respective owners. </p>
</div>
</body>
</html>
|