Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to create HTML element in Qt?

Qt has its own wrapper on WebKit (QWebNode, QWebElement, etc).

How can I create HTML element using that Qt wrapper (obtain QWebElement of new HTML element)?

If it can help, say we have QWebFrame frame.

like image 894
artyom.stv Avatar asked Sep 09 '11 16:09

artyom.stv


People also ask

Does qt use HTML?

Qt's text widgets are able to display rich text, specified using a subset of HTML 4 markup.

Can QT be used for Web development?

To create Qt-based web applications, Qt provides interfaces that support a wide range of standard web techologies such as HTML, CSS, and JavaScript. These interfaces enable applications to embed content from the World Wide Web.

How do you use text browser QT?

If you want to provide your users with an editable rich text editor, use QTextEdit. If you want a text browser without hypertext navigation use QTextEdit, and use QTextEdit::setReadOnly() to disable editing. If you just need to display a small piece of rich text use QLabel.


1 Answers

The only method I found is to call appendInside, appendOutside, etc methods of existing QWebElement elements with QString html markup as an argument.

QWebElement existingElement;
existingElement.appendInside( '<div/>' );
QWebElement newElement = existingElement.lastChild();
like image 170
artyom.stv Avatar answered Sep 18 '22 03:09

artyom.stv