Obsolete Members for QApplication
类QApplication 的以下成员已被弃用。提供这些成员是为了保持旧源代码的正常运行。我们强烈建议不要在新代码中使用它们。
静态公共成员
(deprecated in 6.0) QFontMetrics | fontMetrics() |
(deprecated in 6.5) void | setActiveWindow(QWidget *active) |
成员函数文档
[static, deprecated in 6.0]
QFontMetrics QApplication::fontMetrics()
自 6.0 版起,该函数已被弃用。我们强烈建议不要在新代码中使用该函数。
请使用QFontMetricsF(qApp->font()) 代替。
返回应用程序字体的显示(屏幕)字体度量值。有关QFontMetrics 和QFontMetricsF 之间区别的详细信息,请参阅QFontMetrics 的详细说明。
另请参阅 font()、setFont()、QWidget::fontMetrics() 和QPainter::fontMetrics()。
[static, deprecated in 6.5]
void QApplication::setActiveWindow(QWidget *active)
自 6.5 版起,该函数已被弃用。我们强烈建议不要在新代码中使用该函数。
请使用QWidget::activateWindow() 代替。
响应系统事件,将活动窗口设置为active widget。该函数由特定平台的事件处理程序调用。
警告 此函数不会将键盘焦点设置为活动部件。请调用QWidget::activateWindow() 代替。
它将设置activeWindow() 和focusWidget() 属性,并向所有适当的窗口部件发送适当的WindowActivate/WindowDeactivate 和FocusIn/FocusOut 事件。然后,窗口将处于活动状态(例如,行编辑中的光标将闪烁),并启用工具提示。
另请参阅 activeWindow() 和QWidget::activateWindow()。
© 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.