Obsolete Members for QFontInfo
类QFontInfo 的以下成员已被弃用。提供这些成员是为了保持旧源代码的正常运行。我们强烈建议不要在新代码中使用它们。
公共函数
(deprecated) int | legacyWeight() const |
成员函数文档
[deprecated]
int QFontInfo::legacyWeight() const
该函数已被弃用。我们强烈建议不要在新代码中使用它。
请使用weight() 代替它。
返回转换为 Qt 5 及更早版本中使用的非标准字体权重标度的字体权重。
自 Qt 6 起,将使用 OpenType 标准的字体权重标度,而不是非标准标度。这就需要从使用旧标尺的值进行转换。为方便起见,在从使用旧重量标度的代码移植时,可以使用此函数。
另请参阅 QFont::setWeight(),weight() 和QFontInfo 。
© 2025 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd. in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.