そうするとthis->setFocusPolicy(Qt::WheelFocus);
、ウィジェットの上でマウスホイールを押すと、フォーカスが移動します。ポインターが同じウィジェット内にある場合this->setFocusPolicy(Qt::ClickFocus);
でも、マウスホイールを使用すると、フォーカスが失われます。では、どうすればクリックに焦点を合わせることができますが、それをマウスホイールに留めておくことができますか?
さらに調査すると、mouseWheelEventは常にフォーカスイベントの後に処理されます。したがって、これがマウスホイールによるものかどうかを記憶するために変数を設定しようとしても、機能しません。さらに、FocusReasonに示されている理由は、ホイールまたはクリックの場合のマウスであるため、どちらも役に立ちません。