QGIS API Documentation 3.99.0-Master (26c88405ac0)
Loading...
Searching...
No Matches
qgsabstractmetadatabase.cpp
Go to the documentation of this file.
1/***************************************************************************
2 QgsAbstractMetadataBase.cpp
3 --------------------
4 begin : March 2018
5 copyright : (C) 2018 by Nyall Dawson
6 email : nyall dot dawson at gmail dot com
7 ***************************************************************************/
8
9/***************************************************************************
10 * *
11 * This program is free software; you can redistribute it and/or modify *
12 * it under the terms of the GNU General Public License as published by *
13 * the Free Software Foundation; either version 2 of the License, or *
14 * (at your option) any later version. *
15 * *
16 ***************************************************************************/
17
19
20#include "qgsmaplayer.h"
22
24{
25 return mIdentifier;
26}
27
32
37
42
44{
45 return mType;
46}
47
49{
50 mType = type;
51}
52
54{
55 return mTitle;
56}
57
59{
60 mTitle = title;
61}
62
64{
65 return mAbstract;
66}
67
72
74{
75 return mHistory;
76}
77
79{
81}
82
83void QgsAbstractMetadataBase::addHistoryItem( const QString &text )
84{
85 mHistory << text;
86}
87
88QMap<QString, QStringList> QgsAbstractMetadataBase::keywords() const
89{
90 return mKeywords;
91}
92
93void QgsAbstractMetadataBase::setKeywords( const QMap<QString, QStringList> &keywords )
94{
96}
97
98void QgsAbstractMetadataBase::addKeywords( const QString &vocabulary, const QStringList &keywords )
99{
100 mKeywords.insert( vocabulary, keywords );
101}
102
103bool QgsAbstractMetadataBase::removeKeywords( const QString &vocabulary )
104{
105 return mKeywords.remove( vocabulary );
106}
107
109{
110 return mKeywords.keys();
111}
112
113QStringList QgsAbstractMetadataBase::keywords( const QString &vocabulary ) const
114{
115 return mKeywords.value( vocabulary );
116}
117
119{
120 if ( mKeywords.contains( QStringLiteral( "gmd:topicCategory" ) ) )
121 {
122 return mKeywords.value( QStringLiteral( "gmd:topicCategory" ) );
123 }
124 else
125 {
126 return QStringList();
127 }
128}
129
130void QgsAbstractMetadataBase::setCategories( const QStringList &category )
131{
132 mKeywords.insert( QStringLiteral( "gmd:topicCategory" ), category );
133}
134
135QList<QgsAbstractMetadataBase::Contact> QgsAbstractMetadataBase::contacts() const
136{
137 return mContacts;
138}
139
140void QgsAbstractMetadataBase::setContacts( const QList<QgsAbstractMetadataBase::Contact> &contacts )
141{
143}
144
149
150QList<QgsAbstractMetadataBase::Link> QgsAbstractMetadataBase::links() const
151{
152 return mLinks;
153}
154
155void QgsAbstractMetadataBase::setLinks( const QList<QgsAbstractMetadataBase::Link> &links )
156{
157 mLinks = links;
158}
159
164
166{
167 return mDates.value( type );
168}
169
171{
172 if ( !date.isValid() || date.isNull() )
173 mDates.remove( type );
174 else
175 mDates[type] = date;
176}
177
179{
180 return mLanguage;
181}
182
184{
186}
187
188bool QgsAbstractMetadataBase::readMetadataXml( const QDomElement &metadataElement, const QgsReadWriteContext &context )
189{
190 QDomNode mnl;
191 QDomElement mne;
192
193 // set identifier
194 mnl = metadataElement.namedItem( QStringLiteral( "identifier" ) );
195 mIdentifier = mnl.toElement().text();
196
197 // set parent identifier
198 mnl = metadataElement.namedItem( QStringLiteral( "parentidentifier" ) );
199 mParentIdentifier = mnl.toElement().text();
200
201 // set language
202 mnl = metadataElement.namedItem( QStringLiteral( "language" ) );
203 mLanguage = mnl.toElement().text();
204
205 // set type
206 mnl = metadataElement.namedItem( QStringLiteral( "type" ) );
207 mType = mnl.toElement().text();
208
209 // set title
210 mnl = metadataElement.namedItem( QStringLiteral( "title" ) );
211 mTitle = mnl.toElement().text();
212
213 // set abstract
214 mnl = metadataElement.namedItem( QStringLiteral( "abstract" ) );
215 mAbstract = mnl.toElement().text();
216
217 mType = context.projectTranslator()->translate( "metadata", mType );
218 mTitle = context.projectTranslator()->translate( "metadata", mTitle );
219 mAbstract = context.projectTranslator()->translate( "metadata", mAbstract );
220
221 // set keywords
222 const QDomNodeList keywords = metadataElement.elementsByTagName( QStringLiteral( "keywords" ) );
223 mKeywords.clear();
224 for ( int i = 0; i < keywords.size(); i++ )
225 {
226 QStringList keywordsList;
227 mnl = keywords.at( i );
228 mne = mnl.toElement();
229
230 const QDomNodeList el = mne.elementsByTagName( QStringLiteral( "keyword" ) );
231 for ( int j = 0; j < el.size(); j++ )
232 {
233 keywordsList.append( el.at( j ).toElement().text() );
234 }
235 addKeywords( mne.attribute( QStringLiteral( "vocabulary" ) ), keywordsList );
236 }
237
238 // contact
239 const QDomNodeList contactsList = metadataElement.elementsByTagName( QStringLiteral( "contact" ) );
240 mContacts.clear();
241 for ( int i = 0; i < contactsList.size(); i++ )
242 {
243 mnl = contactsList.at( i );
244 mne = mnl.toElement();
245
247 oneContact.name = mne.namedItem( QStringLiteral( "name" ) ).toElement().text();
248 oneContact.organization = mne.namedItem( QStringLiteral( "organization" ) ).toElement().text();
249 oneContact.position = mne.namedItem( QStringLiteral( "position" ) ).toElement().text();
250 oneContact.voice = mne.namedItem( QStringLiteral( "voice" ) ).toElement().text();
251 oneContact.fax = mne.namedItem( QStringLiteral( "fax" ) ).toElement().text();
252 oneContact.email = mne.namedItem( QStringLiteral( "email" ) ).toElement().text();
253 oneContact.role = mne.namedItem( QStringLiteral( "role" ) ).toElement().text();
254
255 QList< QgsAbstractMetadataBase::Address > addresses;
256 const QDomNodeList addressList = mne.elementsByTagName( QStringLiteral( "contactAddress" ) );
257 for ( int j = 0; j < addressList.size(); j++ )
258 {
259 const QDomElement addressElement = addressList.at( j ).toElement();
261 oneAddress.address = addressElement.namedItem( QStringLiteral( "address" ) ).toElement().text();
262 oneAddress.administrativeArea = addressElement.namedItem( QStringLiteral( "administrativearea" ) ).toElement().text();
263 oneAddress.city = addressElement.namedItem( QStringLiteral( "city" ) ).toElement().text();
264 oneAddress.country = addressElement.namedItem( QStringLiteral( "country" ) ).toElement().text();
265 oneAddress.postalCode = addressElement.namedItem( QStringLiteral( "postalcode" ) ).toElement().text();
266 oneAddress.type = addressElement.namedItem( QStringLiteral( "type" ) ).toElement().text();
267 addresses << oneAddress;
268 }
269 oneContact.addresses = addresses;
270 addContact( oneContact );
271 }
272
273 // links
274 mnl = metadataElement.namedItem( QStringLiteral( "links" ) );
275 mne = mnl.toElement();
276 mLinks.clear();
277 const QDomNodeList el = mne.elementsByTagName( QStringLiteral( "link" ) );
278 for ( int i = 0; i < el.size(); i++ )
279 {
280 mne = el.at( i ).toElement();
282 oneLink.name = mne.attribute( QStringLiteral( "name" ) );
283 oneLink.type = mne.attribute( QStringLiteral( "type" ) );
284 oneLink.url = mne.attribute( QStringLiteral( "url" ) );
285 oneLink.description = mne.attribute( QStringLiteral( "description" ) );
286 oneLink.format = mne.attribute( QStringLiteral( "format" ) );
287 oneLink.mimeType = mne.attribute( QStringLiteral( "mimeType" ) );
288 oneLink.size = mne.attribute( QStringLiteral( "size" ) );
289 addLink( oneLink );
290 }
291
292 // history
293 const QDomNodeList historyNodeList = metadataElement.elementsByTagName( QStringLiteral( "history" ) );
294 QStringList historyList;
295 for ( int i = 0; i < historyNodeList.size(); i++ )
296 {
297 mnl = historyNodeList.at( i );
298 mne = mnl.toElement();
299 historyList.append( mne.text() );
300 }
301 setHistory( historyList );
302
303 {
304 mDates.clear();
305 const QDomElement dateElement = metadataElement.firstChildElement( QStringLiteral( "dates" ) );
306 if ( !dateElement.isNull() )
307 {
308 const QDomNodeList dateNodeList = dateElement.elementsByTagName( QStringLiteral( "date" ) );
309 const QMetaEnum dateEnum = QMetaEnum::fromType<Qgis::MetadataDateType>();
310 for ( int i = 0; i < dateNodeList.size(); i++ )
311 {
312 const QDomElement dateElement = dateNodeList.at( i ).toElement();
313 const Qgis::MetadataDateType type = static_cast< Qgis::MetadataDateType >( dateEnum.keyToValue( dateElement.attribute( QStringLiteral( "type" ) ).toStdString().c_str() ) );
314 const QDateTime value = QDateTime::fromString( dateElement.attribute( QStringLiteral( "value" ) ), Qt::ISODate );
315 if ( value.isValid() && !value.isNull() )
316 mDates.insert( type, value );
317 }
318 }
319 }
320
321 return true;
322}
323
324bool QgsAbstractMetadataBase::writeMetadataXml( QDomElement &metadataElement, QDomDocument &document, const QgsReadWriteContext & ) const
325{
326 // identifier
327 QDomElement identifier = document.createElement( QStringLiteral( "identifier" ) );
328 const QDomText identifierText = document.createTextNode( mIdentifier );
329 identifier.appendChild( identifierText );
330 metadataElement.appendChild( identifier );
331
332 // parent identifier
333 QDomElement parentIdentifier = document.createElement( QStringLiteral( "parentidentifier" ) );
334 const QDomText parentIdentifierText = document.createTextNode( mParentIdentifier );
335 parentIdentifier.appendChild( parentIdentifierText );
336 metadataElement.appendChild( parentIdentifier );
337
338 // language
339 QDomElement language = document.createElement( QStringLiteral( "language" ) );
340 const QDomText languageText = document.createTextNode( mLanguage );
341 language.appendChild( languageText );
342 metadataElement.appendChild( language );
343
344 // type
345 QDomElement type = document.createElement( QStringLiteral( "type" ) );
346 const QDomText typeText = document.createTextNode( mType );
347 type.appendChild( typeText );
348 metadataElement.appendChild( type );
349
350 // title
351 QDomElement title = document.createElement( QStringLiteral( "title" ) );
352 const QDomText titleText = document.createTextNode( mTitle );
353 title.appendChild( titleText );
354 metadataElement.appendChild( title );
355
356 // abstract
357 QDomElement abstract = document.createElement( QStringLiteral( "abstract" ) );
358 const QDomText abstractText = document.createTextNode( mAbstract );
359 abstract.appendChild( abstractText );
360 metadataElement.appendChild( abstract );
361
362 // keywords
363 QMapIterator<QString, QStringList> i( mKeywords );
364 while ( i.hasNext() )
365 {
366 i.next();
367 QDomElement keywordsElement = document.createElement( QStringLiteral( "keywords" ) );
368 keywordsElement.setAttribute( QStringLiteral( "vocabulary" ), i.key() );
369 const QStringList values = i.value();
370 for ( const QString &kw : values )
371 {
372 QDomElement keyword = document.createElement( QStringLiteral( "keyword" ) );
373 const QDomText keywordText = document.createTextNode( kw );
374 keyword.appendChild( keywordText );
375 keywordsElement.appendChild( keyword );
376 }
377 metadataElement.appendChild( keywordsElement );
378 }
379
380 // contact
381 for ( const QgsAbstractMetadataBase::Contact &contact : mContacts )
382 {
383 QDomElement contactElement = document.createElement( QStringLiteral( "contact" ) );
384 QDomElement nameElement = document.createElement( QStringLiteral( "name" ) );
385 QDomElement organizationElement = document.createElement( QStringLiteral( "organization" ) );
386 QDomElement positionElement = document.createElement( QStringLiteral( "position" ) );
387 QDomElement voiceElement = document.createElement( QStringLiteral( "voice" ) );
388 QDomElement faxElement = document.createElement( QStringLiteral( "fax" ) );
389 QDomElement emailElement = document.createElement( QStringLiteral( "email" ) );
390 QDomElement roleElement = document.createElement( QStringLiteral( "role" ) );
391
392 const QDomText nameText = document.createTextNode( contact.name );
393 const QDomText orgaText = document.createTextNode( contact.organization );
394 const QDomText positionText = document.createTextNode( contact.position );
395 const QDomText voiceText = document.createTextNode( contact.voice );
396 const QDomText faxText = document.createTextNode( contact.fax );
397 const QDomText emailText = document.createTextNode( contact.email );
398 const QDomText roleText = document.createTextNode( contact.role );
399
400 for ( const QgsAbstractMetadataBase::Address &oneAddress : contact.addresses )
401 {
402 QDomElement addressElement = document.createElement( QStringLiteral( "contactAddress" ) );
403 QDomElement typeElement = document.createElement( QStringLiteral( "type" ) );
404 QDomElement addressDetailedElement = document.createElement( QStringLiteral( "address" ) );
405 QDomElement cityElement = document.createElement( QStringLiteral( "city" ) );
406 QDomElement administrativeAreaElement = document.createElement( QStringLiteral( "administrativearea" ) );
407 QDomElement postalCodeElement = document.createElement( QStringLiteral( "postalcode" ) );
408 QDomElement countryElement = document.createElement( QStringLiteral( "country" ) );
409
410 typeElement.appendChild( document.createTextNode( oneAddress.type ) );
411 addressDetailedElement.appendChild( document.createTextNode( oneAddress.address ) );
412 cityElement.appendChild( document.createTextNode( oneAddress.city ) );
413 administrativeAreaElement.appendChild( document.createTextNode( oneAddress.administrativeArea ) );
414 postalCodeElement.appendChild( document.createTextNode( oneAddress.postalCode ) );
415 countryElement.appendChild( document.createTextNode( oneAddress.country ) );
416
417 addressElement.appendChild( typeElement );
418 addressElement.appendChild( addressDetailedElement );
419 addressElement.appendChild( cityElement );
420 addressElement.appendChild( administrativeAreaElement );
421 addressElement.appendChild( postalCodeElement );
422 addressElement.appendChild( countryElement );
423 contactElement.appendChild( addressElement );
424 }
425
426 nameElement.appendChild( nameText );
427 organizationElement.appendChild( orgaText );
428 positionElement.appendChild( positionText );
429 voiceElement.appendChild( voiceText );
430 faxElement.appendChild( faxText );
431 emailElement.appendChild( emailText );
432 roleElement.appendChild( roleText );
433
434 contactElement.appendChild( nameElement );
435 contactElement.appendChild( organizationElement );
436 contactElement.appendChild( positionElement );
437 contactElement.appendChild( voiceElement );
438 contactElement.appendChild( faxElement );
439 contactElement.appendChild( emailElement );
440 contactElement.appendChild( roleElement );
441 metadataElement.appendChild( contactElement );
442 }
443
444 // links
445 QDomElement links = document.createElement( QStringLiteral( "links" ) );
446 for ( const QgsAbstractMetadataBase::Link &link : mLinks )
447 {
448 QDomElement linkElement = document.createElement( QStringLiteral( "link" ) );
449 linkElement.setAttribute( QStringLiteral( "name" ), link.name );
450 linkElement.setAttribute( QStringLiteral( "type" ), link.type );
451 linkElement.setAttribute( QStringLiteral( "url" ), link.url );
452 linkElement.setAttribute( QStringLiteral( "description" ), link.description );
453 linkElement.setAttribute( QStringLiteral( "format" ), link.format );
454 linkElement.setAttribute( QStringLiteral( "mimeType" ), link.mimeType );
455 linkElement.setAttribute( QStringLiteral( "size" ), link.size );
456 links.appendChild( linkElement );
457 }
458 metadataElement.appendChild( links );
459
460 // history
461 for ( const QString &history : mHistory )
462 {
463 QDomElement historyElement = document.createElement( QStringLiteral( "history" ) );
464 const QDomText historyText = document.createTextNode( history );
465 historyElement.appendChild( historyText );
466 metadataElement.appendChild( historyElement );
467 }
468
469 // dates
470 {
471 const QMetaEnum dateEnum = QMetaEnum::fromType<Qgis::MetadataDateType>();
472 QDomElement datesElement = document.createElement( QStringLiteral( "dates" ) );
473 for ( int k = 0; k < dateEnum.keyCount(); k++ )
474 {
475 const Qgis::MetadataDateType type = static_cast< Qgis::MetadataDateType >( dateEnum.value( k ) );
476 if ( mDates.contains( type ) && mDates.value( type ).isValid() )
477 {
478 QDomElement dateElement = document.createElement( QStringLiteral( "date" ) );
479 dateElement.setAttribute( QStringLiteral( "type" ), dateEnum.valueToKey( static_cast< int >( type ) ) );
480 dateElement.setAttribute( QStringLiteral( "value" ), mDates.value( type ).toString( Qt::ISODate ) );
481 datesElement.appendChild( dateElement );
482 }
483 }
484 metadataElement.appendChild( datesElement );
485 }
486
487 return true;
488}
489
491{
492 if ( !mTitle.isEmpty() )
493 {
494 translationContext->registerTranslation( QStringLiteral( "metadata" ), mTitle );
495 }
496 if ( !mType.isEmpty() )
497 {
498 translationContext->registerTranslation( QStringLiteral( "metadata" ), mType );
499 }
500 if ( !mAbstract.isEmpty() )
501 {
502 translationContext->registerTranslation( QStringLiteral( "metadata" ), mAbstract );
503 }
504}
505
507{
508 if ( !other )
509 return;
510
511 if ( !other->identifier().isEmpty() )
512 mIdentifier = other->identifier();
513
514 if ( !other->parentIdentifier().isEmpty() )
516
517 if ( !other->language().isEmpty() )
518 mLanguage = other->language();
519
520 if ( !other->type().isEmpty() )
521 mType = other->type();
522
523 if ( !other->title().isEmpty() )
524 mTitle = other->title();
525
526 if ( !other->abstract().isEmpty() )
527 mAbstract = other->abstract();
528
529 if ( !other->history().isEmpty() )
530 mHistory = other->history();
531
532 if ( !other->keywords().isEmpty() )
533 mKeywords = other->keywords();
534
535 if ( !other->contacts().isEmpty() )
536 mContacts = other->contacts();
537
538 if ( !other->links().isEmpty() )
539 mLinks = other->links();
540
541 const QMetaEnum dateEnum = QMetaEnum::fromType<Qgis::MetadataDateType>();
542 for ( int k = 0; k < dateEnum.keyCount(); k++ )
543 {
544 const Qgis::MetadataDateType type = static_cast< Qgis::MetadataDateType >( dateEnum.value( k ) );
545 if ( other->mDates.contains( type ) && other->mDates.value( type ).isValid() )
546 {
547 mDates.insert( type, other->mDates[type] );
548 }
549 }
550
551}
552
554{
555 return ( ( mIdentifier == metadataOther.mIdentifier ) &&
556 ( mParentIdentifier == metadataOther.mParentIdentifier ) &&
557 ( mLanguage == metadataOther.mLanguage ) &&
558 ( mType == metadataOther.mType ) &&
559 ( mTitle == metadataOther.mTitle ) &&
560 ( mAbstract == metadataOther.mAbstract ) &&
561 ( mHistory == metadataOther.mHistory ) &&
562 ( mKeywords == metadataOther.mKeywords ) &&
563 ( mContacts == metadataOther.mContacts ) &&
564 ( mLinks == metadataOther.mLinks ) &&
565 ( mDates == metadataOther.mDates ) );
566}
567
568
570{
571 return name == other.name &&
572 organization == other.organization &&
573 position == other.position &&
574 addresses == other.addresses &&
575 voice == other.voice &&
576 fax == other.fax &&
577 email == other.email &&
578 role == other.role;
579}
580
582{
583 return name == other.name &&
584 type == other.type &&
585 description == other.description &&
586 url == other.url &&
587 format == other.format &&
588 mimeType == other.mimeType &&
589 size == other.size;
590}
591
593{
594 return type == other.type &&
595 address == other.address &&
596 city == other.city &&
598 postalCode == other.postalCode &&
599 country == other.country;
600}
MetadataDateType
Date types for metadata.
Definition qgis.h:4693
QgsAbstractMetadataBase::ContactList mContacts
void setAbstract(const QString &abstract)
Sets a free-form abstract (description) of the resource.
void setType(const QString &type)
Sets the type (nature) of the resource.
void setParentIdentifier(const QString &parentIdentifier)
Sets a reference, URI, URL or some other mechanism to identify the parent resource that this resource...
void addContact(const QgsAbstractMetadataBase::Contact &contact)
Adds an individual contact to the existing contacts.
void setTitle(const QString &title)
Sets the human readable title (name) of the resource, typically displayed in search results.
void setHistory(const QStringList &history)
Sets the freeform description of the history or lineage of the resource.
QgsAbstractMetadataBase::ContactList contacts() const
Returns a list of contact persons or entities associated with the resource.
virtual void combine(const QgsAbstractMetadataBase *other)
Combines the metadata from this object with the metadata from an other object.
void setLinks(const QgsAbstractMetadataBase::LinkList &links)
Sets the list of online resources associated with the resource.
void setIdentifier(const QString &identifier)
Sets the reference, URI, URL or some other mechanism to identify the resource.
QStringList categories() const
Returns categories of the resource.
QString abstract() const
Returns a free-form description of the resource.
QMap< Qgis::MetadataDateType, QDateTime > mDates
Metadata dates.
QStringList keywordVocabularies() const
Returns a list of keyword vocabularies contained in the metadata.
QString title() const
Returns the human readable name of the resource, typically displayed in search results.
virtual bool writeMetadataXml(QDomElement &metadataElement, QDomDocument &document, const QgsReadWriteContext &context=QgsReadWriteContext()) const
Stores state in a DOM node.
void setContacts(const QgsAbstractMetadataBase::ContactList &contacts)
Sets the list of contacts or entities associated with the resource.
void setKeywords(const QgsAbstractMetadataBase::KeywordMap &keywords)
Sets the keywords map, which is a set of descriptive keywords associated with the resource.
QStringList history() const
Returns a freeform description of the history or lineage of the resource.
void setDateTime(Qgis::MetadataDateType type, QDateTime date)
Sets a date value for the specified date type.
QDateTime dateTime(Qgis::MetadataDateType type) const
Returns the date for the specified date type.
QgsAbstractMetadataBase::KeywordMap mKeywords
Keywords map.
QgsAbstractMetadataBase::KeywordMap keywords() const
Returns the keywords map, which is a set of descriptive keywords associated with the resource.
bool equals(const QgsAbstractMetadataBase &other) const
Tests whether the common metadata fields in this object are equal to other.
QgsAbstractMetadataBase::LinkList links() const
Returns a list of online resources associated with the resource.
void setLanguage(const QString &language)
Sets the human language associated with the resource.
virtual void registerTranslations(QgsTranslationContext *translationContext) const
Registers metadata translation strings.
QString parentIdentifier() const
A reference, URI, URL or some other mechanism to identify the parent resource that this resource is a...
QString language() const
Returns the human language associated with the resource.
void addKeywords(const QString &vocabulary, const QStringList &keywords)
Adds a list of descriptive keywords for a specified vocabulary.
void addLink(const QgsAbstractMetadataBase::Link &link)
Adds an individual link to the existing links.
bool removeKeywords(const QString &vocabulary)
Remove a vocabulary from the list.
QgsAbstractMetadataBase::LinkList mLinks
QString type() const
Returns the nature of the resource.
QString identifier() const
A reference, URI, URL or some other mechanism to identify the resource.
QgsAbstractMetadataBase()=default
Constructor for QgsAbstractMetadataBase.
void setCategories(const QStringList &categories)
Sets categories of the resource.
virtual bool readMetadataXml(const QDomElement &metadataElement, const QgsReadWriteContext &context=QgsReadWriteContext())
Sets state from DOM document.
void addHistoryItem(const QString &text)
Adds a single history text to the end of the existing history list.
virtual QString translate(const QString &context, const QString &sourceText, const char *disambiguation=nullptr, int n=-1) const =0
Translates a string using the Qt QTranslator mechanism.
A container for the context for various read/write operations on objects.
const QgsProjectTranslator * projectTranslator() const
Returns the project translator.
Used for the collecting of strings from projects for translation and creation of ts files.
void registerTranslation(const QString &context, const QString &source)
Registers the source to be translated.
bool operator==(const QgsAbstractMetadataBase::Address &other) const
QString administrativeArea
Administrative area (state, province/territory, etc.).
QString address
Free-form physical address component, e.g.
QString city
City or locality name.
QString country
Free-form country string.
QString postalCode
Postal (or ZIP) code.
QString position
Position/title of contact.
QList< QgsAbstractMetadataBase::Address > addresses
List of addresses associated with this contact.
QString email
Electronic mail address.
QString organization
Organization contact belongs to/represents.
bool operator==(const QgsAbstractMetadataBase::Contact &other) const