QT close window by QTest in locked thread
<p>I have a QT application and I want to test it with QTest. Shortly about what I wanna do: I have a Main Window, where the button <strong>Settings</strong> is located. If I click on this button, the QDialog is appeared. I want to test if this really happens</p>

<pre><code>MainWindow mwindow;
QTest::mouseClick(mwindow-&gt;showButton, QtCore::Qt::LeftButton)
</code></pre>

<p>and then I would check for presence of text in new dialog and so on.</p>

<p>The dialog appears but - how do I close it within the test without closing it manually? And how do I test for text presence in it. If I got it right, I can't do anything in test while the dialog is shown.</p>

<p>What am I doing wrong?</p>