Clickable hyperlink in QTextEdit
I want to use QTextEdit (in read-only mode) to show a clickable hyperlink, I used to do QTextEdit *textEdit = new QTextEdit; QTextCursor cursor(textEdit->document()); textEdit->setTextCursor(cursor); cursor->insertHtml("<a href=\"www.google.com\" >Google</a>"); textEdit->show(); this code will show Google as hyperlink but unable to click. And if I used QTextEdit *textEdit = new QTextEdit; QTextCursor cursor(textEdit->document()); textEdit->setTextCursor(cursor); QTextCharFormat linkFormat = cursor.charFormat(); linkFormat.setAnchor(true); linkFormat.setAnchorHref("http://www.google.com");