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 = nullptr)
virtual ~QFocusFrame ()
void setWidget (QWidget * widget )
QWidget * widget () const

靜態公共成員

const QMetaObject staticMetaObject

保護函數

void initStyleOption (QStyleOption * option ) const

重實現保護函數

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

額外繼承成員

詳細描述

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 = 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 ()

析構函數。

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

重實現自 QWidget::event ().

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

重實現自 QObject::eventFilter ().

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

初始化 option 采用值來自此 QFocusFrame 。此方法對子類是有用的,當需要 QStyleOption ,但不希望自己填充所有信息。

另請參閱 QStyleOption::initFrom ().

[override 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 ().