QTextBrowser css trouble



  • Hello!
    I have problem with font-size property for <h*> tags in QTextBrowser.
    Example:
    @
    QString css = "p{color:blue;font-size:30px;}"
    "h1{color:green;font-size:50px;}"
    "h2{color:red;font-size:10px;}";
    ui->tbEye->document()->setDefaultStyleSheet(css);
    ui->tbEye->append("<h1>head1</h1><p>bass</p><h2>head2</h2>");
    @

    Result:
    !http://db.tt/86tbBDYA(QTextBrowser css result)!

    As you can see, colors and size of <p> tag are fine. But size of <h*> tags are wrong.
    I cannot understand where is my fault?

    UPDATE I grab actual _html _code from QTextBrowser.
    As I can understand, the cause of problem is that for <p> tags Qt generates font-sizes like this:

    @font-size:30px;@

    and for headers it uses predefined values like

    @font-size:xx-large;@

    Better understanding of problem, but still no solution.


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.