[Qt-interest] QWebView/WebKit font sizes compared to rest of QWidgets?

Bastian Bense bastibense at gmail.com
Mon Jan 11 09:56:32 CET 2010


Hey fellas!


I have a QWebView which displays some HTML content and I used CSS to style
the text:

body { font-size: 10pt; }

The window with the QWebView also has aQTextEdit field, for which I have set
the font like this:

QFont newFont;
newfont.setPointSize(10);
myEditField->setFont(newFont);

Unfortunately, the text displayed in theQWebViewis slightly larger than the
text displayed in theQTextEdit. I have a feeling that this has something to
do with DPI settings being different in theQWebView.

I can't use "pixel" sizes, since those can't be set in QWidget properties in
Qt Designer/Creator.

See what I mean in this screenshot <http://i.imgur.com/XqIJP.png>.

Is there a way to get the same font sizes displayed for both the QWebView and
the QTextEdit? I assume that this has something to do with differing DPI
settings?

PS: I have asked the same question a few days ago on StackOverflow. So if
you know the answer, you can fresh up your reputation there:
http://stackoverflow.com/questions/2019716/

-- 
Best regards,
Bastian Bense
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.qt-project.org/pipermail/qt-interest-old/attachments/20100111/b4546057/attachment.html 


More information about the Qt-interest-old mailing list