Style hints are used by the font matching algorithm to find an appropriate default family if a selected font family is not available.
| Constant | Value | Description |
|---|---|---|
| QFont::AnyStyle | ? | leaves the font matching algorithm to choose the family. This is the default. |
| QFont::SansSerif | Helvetica | the font matcher prefer sans serif fonts. |
| QFont::Helvetica | 0 | is a synonym for SansSerif. |
| QFont::Serif | Times | the font matcher prefers serif fonts. |
| QFont::Times | ? | is a synonym for Serif. |
| QFont::TypeWriter | Courier | the font matcher prefers fixed pitch fonts. |
| QFont::Courier | ? | a synonym for TypeWriter. |
| QFont::OldEnglish | ? | the font matcher prefers decorative fonts. |
| QFont::Decorative | OldEnglish | is a synonym for OldEnglish. |
| QFont::Monospace | ? | the font matcher prefers fonts that map to the CSS generic font-family 'monospace'. |
| QFont::Fantasy | ? | the font matcher prefers fonts that map to the CSS generic font-family 'fantasy'. |
| QFont::Cursive | ? | the font matcher prefers fonts that map to the CSS generic font-family 'cursive'. |
| QFont::System | ? | the font matcher prefers system fonts. |
Qt uses a weighting scale from 0 to 99 similar to, but not the same as, the scales used in Windows or CSS. A weight of 0 is ultralight, whilst 99 will be an extremely black.
This enum contains the predefined font weights:
| Constant | Value | Description |
|---|---|---|
| QFont::Light | 25 | 25 |
| QFont::Normal | 50 | 50 |
| QFont::DemiBold | 63 | 63 |
| QFont::Bold | 75 | 75 |
| QFont::Black | 87 | 87 |
理解Qt字体样式与权重
1301

被折叠的 条评论
为什么被折叠?



