QFocusFrame 类

The QFocusFrame widget provides a focus frame which can be outside of a widget's normal paintable area. 更多...

头: #include <QFocusFrame>
qmake: QT += widgets
继承: QWidget

公共函数

QFocusFrame (QWidget * parent = Q_NULLPTR)
~QFocusFrame ()
void setWidget (QWidget * widget )
QWidget * widget () const

保护函数

void initStyleOption (QStyleOption * option ) const

重实现保护函数

virtual bool event (QEvent * e )
virtual bool eventFilter (QObject * o , QEvent * e )
virtual void paintEvent ( QPaintEvent * )

额外继承成员

详细描述

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

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 QFocusFrame::setWidget . It is, however, legal to create your own QFocusFrame on a custom widget and set its geometry manually via QWidget::setGeometry 但不会自动放置,当聚焦 Widget 改变大小或放置时。

成员函数文档编制

QFocusFrame:: QFocusFrame ( QWidget * parent = Q_NULLPTR)

构造 QFocusFrame .

聚焦框架不会监控 parent for updates but rather can be placed manually or by using QFocusFrame::setWidget QFocusFrame sets Qt::WA_NoChildEventsForParent attribute; as a result the parent will not receive a QEvent::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.

另请参阅 QFocusFrame::setWidget ().

QFocusFrame:: ~QFocusFrame ()

析构函数。

[virtual protected] bool QFocusFrame:: event ( QEvent * e )

重实现自 QObject::event ().

[virtual protected] bool QFocusFrame:: eventFilter ( QObject * o , QEvent * e )

重实现自 QObject::eventFilter ().

[protected] void QFocusFrame:: initStyleOption ( QStyleOption * option ) const

初始化 option 采用值来自此 QFocusFrame 。此方法对子类是有用的,当需要 QStyleOption ,但不希望自己填充所有信息。

另请参阅 QStyleOption::initFrom ().

[virtual protected] void QFocusFrame:: paintEvent ( QPaintEvent * )

重实现自 QWidget::paintEvent ().

void QFocusFrame:: setWidget ( QWidget * widget )

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.

另请参阅 QFocusFrame::widget ().

QWidget *QFocusFrame:: widget () const

返回自动重置尺寸和更新的当前监视 Widget。

另请参阅 QFocusFrame::setWidget ().