QFocusFrame

The QFocusFrame widget provides a focus frame which can be outside of a widget’s normal paintable area. More

Inheritance diagram of PySide2.QtWidgets.QFocusFrame

Synopsis

Functions

Detailed Description

Normally an application will not need to create its own QFocusFrame as QStyle will handle this detail for you. A style writer can optionally use a QFocusFrame to have a focus area outside of the widget’s paintable geometry. In this way space need not be reserved for the widget to have focus but only set on a QWidget with setWidget . It is, however, legal to create your own QFocusFrame on a custom widget and set its geometry manually via setGeometry however you will not get auto-placement when the focused widget changes size or placement.

class PySide2.QtWidgets.QFocusFrame([parent=None])

Constructs a QFocusFrame .

The focus frame will not monitor parent for updates but rather can be placed manually or by using setWidget . A QFocusFrame sets WA_NoChildEventsForParent attribute; as a result the parent will not receive a ChildAdded event, this will make it possible to manually set the geometry of the QFocusFrame inside of a QSplitter or other child event monitoring widget.

See also

setWidget()

PySide2.QtWidgets.QFocusFrame.initStyleOption(option)
Parameters

optionPySide2.QtWidgets.QStyleOption

Initialize option with the values from this QFocusFrame . This method is useful for subclasses when they need a QStyleOption , but don’t want to fill in all the information themselves.

See also

initFrom()

PySide2.QtWidgets.QFocusFrame.setWidget(widget)
Parameters

widgetPySide2.QtWidgets.QWidget

QFocusFrame will track changes to widget and resize itself automatically. If the monitored widget’s parent changes, QFocusFrame will follow the widget and place itself around the widget automatically. If the monitored widget is deleted, QFocusFrame will set it to zero.

See also

widget()

PySide2.QtWidgets.QFocusFrame.widget()
Return type

PySide2.QtWidgets.QWidget

Returns the currently monitored widget for automatically resize and update.

See also

setWidget()