Below is the code for highlighting the selected text
findText(str);
page()->setContentEditable(true);
m_Color.setNamedColor(hcolorlist[index]);
QVariant va
= page
()->mainFrame
()->evaluateJavaScript
(js
);
page()->setContentEditable(false);
findText(str);
page()->setContentEditable(true);
QColor m_Color;
m_Color.setNamedColor(hcolorlist[index]);
QString clrName = m_Color.name();
QLatin1String cmd = QLatin1String("HiliteColor");
QString js = QString(QLatin1String("document.execCommand(\"%1\",null, \"%2\")")).arg(cmd).arg(clrName);
QVariant va = page()->mainFrame()->evaluateJavaScript(js);
page()->setContentEditable(false);
To copy to clipboard, switch view to plain text mode
"str" in the code is the selected word.
I want set border color and onclick() event for the selected word
I have heard that its possible using <span> tag. But not sure how to apply it here.
Is there anyother way, border and onclick() event could be implemented
Bookmarks