MCPcopy Create free account
hub / github.com/YACReader/yacreader / translate

Method translate

YACReader/translator.cpp:167–191  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

165}
166
167void YACReaderTranslator::translate()
168{
169 QString text = this->text->toPlainText();
170 if (text.isEmpty())
171 return;
172 QString from = this->from->itemData(this->from->currentIndex()).toString();
173 QString to = this->to->itemData(this->to->currentIndex()).toString();
174
175 speakText = text;
176 speakLocale = from;
177
178 TranslationLoader *translationLoader = new TranslationLoader(text, from, to);
179 connect(translationLoader, &TranslationLoader::requestFinished, this, &YACReaderTranslator::setTranslation);
180 connect(translationLoader, &TranslationLoader::error, this, &YACReaderTranslator::error);
181 connect(translationLoader, &TranslationLoader::timeOut, this, &YACReaderTranslator::error);
182 connect(translationLoader, &QThread::finished, translationLoader, &QObject::deleteLater);
183
184 translationLoader->start();
185
186 resultsTitle->setText(tr("Translation"));
187
188 hideResults();
189
190 busyIndicator->show();
191}
192
193void YACReaderTranslator::error()
194{

Callers 7

paintMethod · 0.80
paintSelectedMethod · 0.80
generatePixmapMethod · 0.80
paintEventMethod · 0.80
renderMethod · 0.80
prepareDrawDataMethod · 0.80
getPlaneIntersectionMethod · 0.80

Calls 6

isEmptyMethod · 0.80
toStringMethod · 0.80
startMethod · 0.80
currentIndexMethod · 0.45
setTextMethod · 0.45
showMethod · 0.45

Tested by

no test coverage detected