Example #1
0
void QWebFrameProto::setContent(const QByteArray & data, const QString & mimeType, const QUrl & baseUrl)
{
  scriptDeprecated("QWebFrame will not be available in future versions");
  QWebFrame *item = qscriptvalue_cast<QWebFrame*>(thisObject());
  if (item)
    item->setContent(data, mimeType, baseUrl);
}
Example #2
0
void wordsImporter::returnWord(QString word, QByteArray translation)
{
	saveCard(word, translation); // Но туточки нужно не просто сохранить слово, но и запузырить обратный поиск!
	QWebFrame * frame = page.mainFrame();
	frame->setContent (translation);
	if (backTranslation)
	{
		QWebElementCollection transl = frame->findAllElements(".b-translate a");
		foreach (QWebElement h, transl) {
			qDebug() << "translate back" << h.toPlainText();
			emit translateItBack(h.toPlainText());
		}
	}