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 .
聚焦框架不會監控 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 ().
析構函數。
[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 ().
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 ().
返迴有自動重置大小和更新的目前監視 Widget。
另請參閱 QFocusFrame::setWidget ().