digiKam
Loading...
Searching...
No Matches
Digikam::DOnlineTranslatorOption Struct Reference

Contains translation options for a single word. More...

#include <donlinetranslator.h>

Public Member Functions

QJsonObject toJson () const
 Converts the object to JSON.
 

Public Attributes

QString gender
 Gender of the word.
 
QStringList translations
 Associated translations for the word.
 
QString word
 Word that specified for translation options.
 

Detailed Description

Contains translation options for a single word.

Can be obtained from the QOnlineTranslator object.

Example:

QOnlineTranslator translator;
// Obtain translation
QTextStream out(stdout);
for (auto it = translator.translationOptions().cbegin() ; it != translator.translationOptions().cend() ; ++it)
{
out << it.key() << ":" << endl; // Output the type of speech with a colon
for (const auto &[word, gender, translations] : it.value())
{
out << " " << word << ": "; // Print the word
out << translations; // Print translations
out << endl;
}
out << endl;
}
qulonglong value
Definition itemviewutilities.cpp:585
QStringList translations
Associated translations for the word.
Definition donlinetranslator.h:98
QString word
Word that specified for translation options.
Definition donlinetranslator.h:88
QString gender
Gender of the word.
Definition donlinetranslator.h:93

Possible output:

// verb:
// sagen: say, tell, speak, mean, utter
// sprechen: speak, talk, say, pronounce, militate, discourse
// meinen: think, mean, believe, say, opine, fancy
// heißen: mean, be called, be named, bid, tell, be titled
// äußern: express, comment, speak, voice, say, utter
// aussprechen: express, pronounce, say, speak, voice, enunciate
// vorbringen: make, put forward, raise, say, put, bring forward
// aufsagen: recite, say, speak
// noun:
// Sagen: say
// Mitspracherecht: say

Member Function Documentation

◆ toJson()

QJsonObject Digikam::DOnlineTranslatorOption::toJson ( ) const
inline

Converts the object to JSON.

Returns
JSON representation

Member Data Documentation

◆ gender

QString Digikam::DOnlineTranslatorOption::gender

Gender of the word.

◆ translations

QStringList Digikam::DOnlineTranslatorOption::translations

Associated translations for the word.

◆ word

QString Digikam::DOnlineTranslatorOption::word

Word that specified for translation options.


The documentation for this struct was generated from the following file: