<table><tr><td style="">tobiasdeiminger added a comment.
</td><a style="text-decoration: none; padding: 4px 8px; margin: 0 8px 8px; float: right; color: #464C5C; font-weight: bold; border-radius: 3px; background-color: #F7F7F9; background-image: linear-gradient(to bottom,#fff,#f1f0f1); display: inline-block; border: 1px solid rgba(71,87,120,.2);" href="https://phabricator.kde.org/D15347">View Revision</a></tr></table><br /><div><div><p>Interestingly, if we remove <tt style="background: #ebebeb; font-size: 13px;">QTest::mouseMove</tt> and just keep <tt style="background: #ebebeb; font-size: 13px;">QTest::mouseClick</tt> in above test, the test passes OK as expected.</p>

<p>This holds some hints: Events can queue up right before a <tt style="background: #ebebeb; font-size: 13px;">QInputDialog</tt> is spawned, and are then processed in sequence and interpreted incorrectly by <tt style="background: #ebebeb; font-size: 13px;">PageViewAnnotator</tt>. In particular, I observed the following (if mouseMove + mouseClick is used):</p>

<ol class="remarkup-list">
<li class="remarkup-list-item"><tt style="background: #ebebeb; font-size: 13px;">QMouseEvent(MouseButtonPress, LeftButton, localPos=204,106, screenPos=1705,131)</tt> is processed by <tt style="background: #ebebeb; font-size: 13px;">PageViewAnnotator</tt>. It sets a locked item, but does not yet trigger <tt style="background: #ebebeb; font-size: 13px;">m_engine->end()</tt>. That's correct.</li>
<li class="remarkup-list-item"><tt style="background: #ebebeb; font-size: 13px;">QMouseEvent(MouseButtonRelease, LeftButton, localPos=204,106, screenPos=1705,131)</tt> is processed by <tt style="background: #ebebeb; font-size: 13px;">PageViewAnnotator</tt> and leads to <tt style="background: #ebebeb; font-size: 13px;">m_engine->end()</tt>, which spawns a <tt style="background: #ebebeb; font-size: 13px;">QInputDialog</tt>. That's correct.</li>
<li class="remarkup-list-item"><tt style="background: #ebebeb; font-size: 13px;">QMouseEvent(MouseMove, localPos=204,106, screenPos=1705,131)</tt> is processed by <tt style="background: #ebebeb; font-size: 13px;">PageViewAnnotator</tt> and leads to <tt style="background: #ebebeb; font-size: 13px;">m_engine->end()</tt>, which spawns a second <tt style="background: #ebebeb; font-size: 13px;">QInputDialog</tt>. That's <strong>NOT</strong> correct.</li>
</ol>

<p>A further hint is that <tt style="background: #ebebeb; font-size: 13px;">MouseMove</tt> got processed last, even if it was produced first.</p></div></div><br /><div><strong>REPOSITORY</strong><div><div>R223 Okular</div></div></div><br /><div><strong>REVISION DETAIL</strong><div><a href="https://phabricator.kde.org/D15347">https://phabricator.kde.org/D15347</a></div></div><br /><div><strong>To: </strong>tobiasdeiminger<br /><strong>Cc: </strong>sander, aacid, okular-devel, maguirre, fbampaloukas, joaonetto, kezik, tfella, ngraham, darcyshen<br /></div>