#include <QtGui>
int main(int argc, char *argv[])
{
cursor.insertHtml("<a href='http://www.w3schools.com/'>Link!</a>oops<br>");
cursor.insertHtml("<a href='http://www.w3schools.com/'>Link!</a>");
cursor.insertHtml("something");
cursor.insertHtml("<br>");
cursor.insertHtml("<a href='http://www.w3schools.com/'>Link!</a>");
cursor.insertText("something");
te.show();
return a.exec();
}
#include <QtGui>
int main(int argc, char *argv[])
{
QApplication a(argc, argv);
QTextEdit te;
QTextCursor cursor = te.textCursor();
cursor.insertHtml("<a href='http://www.w3schools.com/'>Link!</a>oops<br>");
cursor.insertHtml("<a href='http://www.w3schools.com/'>Link!</a>");
cursor.insertHtml("something");
cursor.insertHtml("<br>");
cursor.insertHtml("<a href='http://www.w3schools.com/'>Link!</a>");
cursor.insertText("something");
te.show();
return a.exec();
}
To copy to clipboard, switch view to plain text mode
LinkEdit..png
So you are right.. this is unexpected beviour. But inserting as html seems to work..
BTW:
self.cursor = QTextCursor(self.textArea.document())
To copy to clipboard, switch view to plain text mode
Is this correct for PyQt? Seems strange to me.
Johannes
Bookmarks