title: Qt Test Simulated MouseEvent not forwared to child widget
body: <p>I did some survey, if it might be possible to use QtTest to test some of my custom Qt Widgets. </p>
  
  <p>I was able to build and run tests and I was also able to simulate events and check them with <code>QSignalSpy</code>. </p>
  
  <p>The widgets I'm going to tests are not revealing their internal subwidgets, so that I have to simulate the positions of my mouse clicks relative to their parent widget. </p>
  
  <p>For some reason I'm failing with this approach. The following snippet shows what I'm trying to achieve.</p>
  
  <pre><code>auto button=new QPushButton("Hello");
  auto grpBox = new QGroupBox("Group Box");
  grpBox-&gt;setLayout(new QVBoxLayout);
  grpBox-&gt;layout()-&gt;addWidget(button);
  QSignalSpy spy(button, &amp;QPushButton::clicked);
  grpBox-&gt;show();
  QTest::mouseClick(button, Qt::MouseButton::LeftButton);
  QTest::mouseClick(grpBox, Qt::MouseButton::LeftButton, Qt::KeyboardModifier::NoModifier, QPoint(250,70));
  QCOMPARE(spy.count(), 2); // 1!=2
  </code></pre>
  
  <p>The first click is considered correctly, whereas the second one vanishes somehow. Why is that?</p>
  
  <p>I'm wondering, if I really understood how to use the framework correctly, as dealing with mouse positions, seems to be too tedious and fragile for a practical test framework.</p>
  
  <p><strong>Revision:</strong> </p>
  
  <p>It's obvious that using coordinates in a GUI test are very fragile. Hence, I found a solution utilizing <code>findChild</code> that actually does the same thing. </p>
  
  <pre><code>auto button=new QPushButton("Hello");
  button-&gt;setObjectName("PushButton");
  auto grpBox = new QGroupBox("Group Box");
  grpBox-&gt;setLayout(new QVBoxLayout);
  grpBox-&gt;layout()-&gt;addWidget(button);
  QSignalSpy spy(button, &amp;QPushButton::clicked);
  grpBox-&gt;show();
  QTest::mouseClick(button, Qt::MouseButton::LeftButton);
  if (auto btn = grpBox-&gt;findChild&lt;QPushButton*&gt;("PushButton")) {
      QTest::mouseClick(btn, Qt::MouseButton::LeftButton, Qt::KeyboardModifier::NoModifier);
  } else {
      QVERIFY(false);
  }
  QCOMPARE(spy.count(), 2);
  </code></pre>
  
  <p>This combines two advantages. Firstly, it is no longer necessary to deal with coordinates and secondly you still doesn't need to touch the code of the widgets you are going to test. </p>
  
  <p>For this approach it seems to be advantageous, if every gui element has a unique <code>objectName()</code> supporting an easy search mechanism. </p>