Qt wiki will be updated on October 12th 2023 starting at 11:30 AM (EEST) and the maintenance will last around 2-3 hours. During the maintenance the site will be unavailable.

Quick tips to adjust font size: Difference between revisions

From Qt Wiki
Jump to navigation Jump to search
(Convert ExpressionEngine section headers)
(Decode HTML entity names)
Line 15: Line 15:
Using style sheet must be the simplest way.
Using style sheet must be the simplest way.
<code>
<code>
void setStyleSheet ( const QString &amp; sheet )
void setStyleSheet ( const QString & sheet )
label->setStyleSheet ("Font : 12pt");
label->setStyleSheet ("Font : 12pt");
</code>
</code>

Revision as of 17:47, 12 March 2015

This article may require cleanup to meet the Qt Wiki's quality standards. Reason: Auto-imported from ExpressionEngine.
Please improve this article if you can. Remove the {{cleanup}} tag and add this page to Updated pages list after it's clean.

4 Quick tips to adjust Font Size.

Use doc:QFont class

==== When you know font size in terms of Integer ,

void QFont::setPointSize ( int pointSize )<code> ====

==== Sometimes , it is required that we need font size other than the prescribed sizes. ====

void QFont::setPointSizeF ( qreal pointSize ) is really useful in that manner.

Stylesheet

Using style sheet must be the simplest way.

void setStyleSheet ( const QString & sheet )
label->setStyleSheet ("Font : 12pt");

'

We can use HTML tags as well, when applicable.

'

Categories snippets HowTo Learning::Demos_and_Examples