- Qt 6.7
- Qt Widgets
- C++ Classes
- QApplication
- Qt 6.7.2 Reference Documentation

# Obsolete Members for QApplication

The following members of class QApplication are deprecated. They are provided to keep old source code working. We strongly advise against using them in new code.

## Static Public Members

`(deprecated)` QFontMetrics | fontMetrics()
`(deprecated in 6.5)` void | setActiveWindow(QWidget *active)

## Member Function Documentation

### `[static, deprecated]` QFontMetrics QApplication::fontMetrics()

This function is deprecated. We strongly advise against using it in new code.

Use the QFontMetricsF constructor instead. Returns display (screen) font metrics for the application font.

See also font(), setFont(), QWidget::fontMetrics(), and QPainter::fontMetrics().

### `[static, deprecated in 6.5]` void QApplication::setActiveWindow(QWidget *active)

This function is deprecated since 6.5. We strongly advise against using it in new code.

Use QWidget::activateWindow() instead.

Sets the active window to the active widget in response to a system event. The function is called from the platform specific event handlers.

Warning: This function does not set the keyboard focus to the active widget. Call QWidget::activateWindow() instead.

It sets the activeWindow() and focusWidget() attributes and sends proper WindowActivate/WindowDeactivate and FocusIn/FocusOut events to all appropriate widgets. The window will then be painted in active state (e.g. cursors in line edits will blink), and it will have tool tips enabled.

See also activeWindow() and QWidget::activateWindow().