This property holds the way the widget accepts keyboard focus.
The policy is Qt::TabFocus if the widget accepts keyboard focus by tabbing, Qt::ClickFocus if the widget accepts focus by clicking, Qt::StrongFocus if it accepts both, and Qt::NoFocus (the default) if it does not accept focus at all.
You must enable keyboard focus for a widget if it processes keyboard events. This is normally done from the widget's constructor. For instance, the QLineEdit constructor calls setFocusPolicy(Qt::StrongFocus).
If the widget has a focus proxy, then the focus policy will be propagated to it.
此属性判断窗口是否接收键盘按键事件后,让其处于焦点状态.
Qt::TabFocus表示接收键盘聚焦
Qt::ClickFocus表示接收鼠标点击事件后聚焦
Qt::StrongFocus表示既接收鼠标点击事件也接收键盘Tab键的事件,然后使其窗口聚焦
Qt::NoFocus不接收任何事件