This is the code using pt instead of px and the attached screenshot.
As you can see some of the attributes are interpreted correctly, some not.
#include <QtGui>
int main(int argc, char *argv[])
{
<html> \
<head> \
<style type=text/css> \
body { background: #ffffff; color: black; } \
.title { background: #f0f0f0; align: center; } \
.subtitle { font-size: 8pt; color: red;} \
.small-subtitle { font-size: 6pt; color: blue; } \
</style> \
</head> \
\
<body> \
<h1 class=title>Title without subtitle<br></h1> \
<h1 class=title>Title with subtitle<br><span class=subtitle>This is the subtitle</span></h1> \
<h1 class=title>Title with small subtitle<br><span class=small-subtitle>This is the small subtitle</span></h1> \
</body> \
</html> \
");
test.show();
return app.exec();
}
#include <QtGui>
int main(int argc, char *argv[])
{
QApplication app(argc, argv);
QString html_sequence = QString(" \
<html> \
<head> \
<style type=text/css> \
body { background: #ffffff; color: black; } \
.title { background: #f0f0f0; align: center; } \
.subtitle { font-size: 8pt; color: red;} \
.small-subtitle { font-size: 6pt; color: blue; } \
</style> \
</head> \
\
<body> \
<h1 class=title>Title without subtitle<br></h1> \
<h1 class=title>Title with subtitle<br><span class=subtitle>This is the subtitle</span></h1> \
<h1 class=title>Title with small subtitle<br><span class=small-subtitle>This is the small subtitle</span></h1> \
</body> \
</html> \
");
QTextEdit test(html_sequence);
test.show();
return app.exec();
}
To copy to clipboard, switch view to plain text mode
Bookmarks