title: QGraphicsView steals focus on hover on OSX?
body: <p>I have a QMainWindow with various QDockWidgets.  One of the QDockWidgets has a QDoubleSpinBox.  There's a QGraphicsView in the center.</p>
  
  <p>When a user is editing a value in the SpinBox, and then hovers his mouse over the QGraphicsView, it steals the focus.  This is confirmed by checking QApplication::focusWidget() during the SpinBox's focusOutEvent()</p>
  
  <p>Adding the following code eliminates the focus stealing, confirming that it is the case that the focus is travelling to the QGraphicsView.</p>
  
  <pre><code>void OtherQGraphicsView::mouseMoveEvent(QMouseEvent *event) {
      QWidget *w = QApplication::focusWidget();
      if (w == this) {
          event-&gt;accept();
      }
  }
  </code></pre>
  
  <p>As I understand it, Qt does not support the focus-follows-hover model.  How could the QGraphicsView gain focus just by a mouseMoveEvent?</p>
  
  <p>Is there something I should be doing to the SpinBox to prevent the stealing from occurring?</p>
  
  <p>For an example, <strong>just load up the DiagramScene example from the Qt creator built-in examples</strong>.  The font selector at the top will lose focus when the mouse hovers over the main panel.</p>
  
  <p>edit: This happens on OSX (Yosemite) but not Windows (8.1)</p>
  
  <p>edit 2:  Stack Trace when the offending event occurs:</p>
  
  <pre><code>0   NumberEdit::focusOutEvent(QFocusEvent *)    inspector.cpp   123 0x10003cc00 
  1   QWidget::event(QEvent *)    QWidget::event(QEvent*)     0x1001a8add 
  2   QAbstractSpinBox::event(QEvent *)   QAbstractSpinBox::event(QEvent*)        0x100252bc9 
  3   QApplicationPrivate::notify_helper(QObject *, QEvent *) QApplicationPrivate::notify_helper(QObject*, QEvent*)       0x10016932b 
  4   QApplication::notify(QObject *, QEvent *)   QApplication::notify(QObject*, QEvent*)     0x10016c648 
  5   QCoreApplication::notifyInternal(QObject *, QEvent *)   QCoreApplication::notifyInternal(QObject*, QEvent*)     0x100fe1d83 
  6   QApplicationPrivate::setFocusWidget(QWidget *, Qt::FocusReason) QApplicationPrivate::setFocusWidget(QWidget*, Qt::FocusReason)      0x1001670ce 
  7   QWidget::setFocus(Qt::FocusReason)  QWidget::setFocus(Qt::FocusReason)      0x1001a4809 
  8   QApplicationPrivate::giveFocusAccordingToFocusPolicy(QWidget *, QEvent *, QPoint)   QApplicationPrivate::giveFocusAccordingToFocusPolicy(QWidget*, QEvent*, QPoint)     0x10016d348 
  9   QApplication::notify(QObject *, QEvent *)   QApplication::notify(QObject*, QEvent*)     0x10016bef1 
  10  QCoreApplication::notifyInternal(QObject *, QEvent *)   QCoreApplication::notifyInternal(QObject*, QEvent*)     0x100fe1d83 
  11  QApplicationPrivate::translateRawTouchEvent(QWidget *, QTouchDevice *, QList&lt;QTouchEvent::TouchPoint&gt; const&amp;, unsigned long)    QApplicationPrivate::translateRawTouchEvent(QWidget*, QTouchDevice*, QList&lt;QTouchEvent::TouchPoint&gt; const&amp;, unsigned long)      0x10016ef2b 
  12  QWidgetWindow::event(QEvent *)  QWidgetWindow::event(QEvent*)       0x1001c2eb5 
  13  QApplicationPrivate::notify_helper(QObject *, QEvent *) QApplicationPrivate::notify_helper(QObject*, QEvent*)       0x10016932b 
  14  QApplication::notify(QObject *, QEvent *)   QApplication::notify(QObject*, QEvent*)     0x10016c648 
  15  QCoreApplication::notifyInternal(QObject *, QEvent *)   QCoreApplication::notifyInternal(QObject*, QEvent*)     0x100fe1d83 
  16  QGuiApplicationPrivate::processTouchEvent(QWindowSystemInterfacePrivate::TouchEvent *)  QGuiApplicationPrivate::processTouchEvent(QWindowSystemInterfacePrivate::TouchEvent*)       0x10081eb09 
  17  QGuiApplicationPrivate::processWindowSystemEvent(QWindowSystemInterfacePrivate::WindowSystemEvent *)    QGuiApplicationPrivate::processWindowSystemEvent(QWindowSystemInterfacePrivate::WindowSystemEvent*)     0x10081bc69 
  18  QWindowSystemInterface::sendWindowSystemEvents(QFlags&lt;QEventLoop::ProcessEventsFlag&gt;)   QWindowSystemInterface::sendWindowSystemEvents(QFlags&lt;QEventLoop::ProcessEventsFlag&gt;)       0x1008092da 
  19  QCocoaEventDispatcherPrivate::postedEventsSourceCallback(void *)    QCocoaEventDispatcherPrivate::postedEventsSourceCallback(void*)     0x1033b0411 
  20  __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__  __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__      0x7fff895e87c1  
  21  __CFRunLoopDoSources0   __CFRunLoopDoSources0       0x7fff895da94d  
  22  __CFRunLoopRun  __CFRunLoopRun      0x7fff895d9f7f  
  23  CFRunLoopRunSpecific    CFRunLoopRunSpecific        0x7fff895d9998  
  24  RunCurrentEventLoopInMode   RunCurrentEventLoopInMode       0x7fff880a27df  
  25  ReceiveNextEventCommon  ReceiveNextEventCommon      0x7fff880a245e  
  26  _BlockUntilNextEventMatchingListInModeWithFilter    _BlockUntilNextEventMatchingListInModeWithFilter        0x7fff880a239b  
  27  _DPSNextEvent   _DPSNextEvent       0x7fff8b739a6d  
  28  -[NSApplication nextEventMatchingMask:untilDate:inMode:dequeue:]    -[NSApplication nextEventMatchingMask:untilDate:inMode:dequeue:]        0x7fff8b739220  
  29  -[NSApplication run]    -[NSApplication run]        0x7fff8b72d0c3  
  30  QCocoaEventDispatcher::processEvents(QFlags&lt;QEventLoop::ProcessEventsFlag&gt;) QCocoaEventDispatcher::processEvents(QFlags&lt;QEventLoop::ProcessEventsFlag&gt;)     0x1033af2fd 
  31  QEventLoop::exec(QFlags&lt;QEventLoop::ProcessEventsFlag&gt;) QEventLoop::exec(QFlags&lt;QEventLoop::ProcessEventsFlag&gt;)     0x100fdf37d 
  32  QCoreApplication::exec()    QCoreApplication::exec()        0x100fe235a 
  33  main    main.cpp    100 0x100004b82 
  34  start   start       0x100004014 
  </code></pre>