title: How to test signal-slot connections with qtest
body: <p>I am just starting out with QT and would like to have unit tests. I found a blueprint for a project structure that supports having tests outside my application.</p>
  
  <p>For my first test I wanted to have a click on the "Quit" menu point, checking that the close action of QMainWindow is really called. </p>
  
  <p>Coming from Java with all its mocking frameworks, here is what I would like to do:</p>
  
  <ol>
  <li>Simulate Click on Menu (or key press)</li>
  <li>Click on Quit Action (or key press)</li>
  <li>Verify that signal "triggered()" of QAction was emitted</li>
  <li>Verify that slot "close" of QMainWindow was called</li>
  </ol>
  
  <p>I read the qtest tutorial, KDE documentation and other stuff on the net but I am not able to express that using qtest (yet). </p>
  
  <p>I found <a href="https://stackoverflow.com/questions/16536286/qt-ui-testing-how-to-simulate-a-click-on-a-qmenubar-item-using-qtest">Qt UI testing: How to simulate a click on a QMenuBar item using QTest?</a> which describes a similar thing, but even there only 1, 2, 3 are covered (And I was not even able to get them to work).</p>
  
  <p>So how can I write such a test case? Is that even possible? </p>