<html>
<body>
<div style="font-family: Verdana, Arial, Helvetica, Sans-Serif;">
<table bgcolor="#f9f3c9" width="100%" cellpadding="12" style="border: 1px #c9c399 solid; border-radius: 6px; -moz-border-radius: 6px; -webkit-border-radius: 6px;">
<tr>
<td>
This is an automatically generated e-mail. To reply, visit:
<a href="https://git.reviewboard.kde.org/r/128858/">https://git.reviewboard.kde.org/r/128858/</a>
</td>
</tr>
</table>
<br />
<blockquote style="margin-left: 1em; border-left: 2px solid #d0d0d0; padding-left: 10px;">
<p style="margin-top: 0;">On September 6th, 2017, 8:24 p.m. UTC, <b>Albert Astals Cid</b> wrote:</p>
<blockquote style="margin-left: 1em; border-left: 2px solid #d0d0d0; padding-left: 10px;">
<table width="100%" border="0" bgcolor="white" style="border: 1px solid #C0C0C0; border-collapse: collapse; margin: 2px padding: 2px;">
<thead>
<tr>
<th colspan="4" bgcolor="#F0F0F0" style="border-bottom: 1px solid #C0C0C0; font-size: 9pt; padding: 4px 8px; text-align: left;">
<a href="https://git.reviewboard.kde.org/r/128858/diff/4/?file=481745#file481745line1305" style="color: black; font-weight: bold; text-decoration: underline;">ui/presentationwidget.cpp</a>
<span style="font-weight: normal;">
(Diff revision 4)
</span>
</th>
</tr>
</thead>
<tbody>
<tr>
<th bgcolor="#b1ebb0" style="border-right: 1px solid #C0C0C0;" align="right"><font size="2"></font></th>
<td bgcolor="#c5ffc4" width="50%"><pre style="font-size: 8pt; line-height: 140%; margin: 0; "></pre></td>
<th bgcolor="#b1ebb0" style="border-left: 1px solid #C0C0C0; border-right: 1px solid #C0C0C0;" align="right"><font size="2">1305</font></th>
<td bgcolor="#c5ffc4" width="50%"><pre style="font-size: 8pt; line-height: 140%; margin: 0; "> <span class="n">m_drawingEngine</span> <span class="o">=</span> <span class="k">new</span> <span class="n">SmoothPathEngine</span><span class="p">(</span> <span class="n">m_currentDrawingToolElement</span> <span class="p">);</span></pre></td>
</tr>
</tbody>
</table>
<pre style="white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;"><p style="padding: 0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: inherit;">Why this change?</p></pre>
</blockquote>
</blockquote>
<pre style="margin-left: 1em; white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;"><p style="padding: 0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: inherit;">Previously, the code there was</p>
<p style="padding: 0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: inherit;"><div class="codehilite" style="background: #f8f8f8"><pre style="line-height: 125%"><span></span> slotChangeDrawingToolEngine( QDomElement() );
slotChangeDrawingToolEngine( m_currentDrawingToolElement );
</pre></div>
</p>
<p style="padding: 0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: inherit;">And here is the content of slotChangeDrawingToolEngine:</p>
<p style="padding: 0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: inherit;"><div class="codehilite" style="background: #f8f8f8"><pre style="line-height: 125%"><span></span><span style="color: #008000; font-weight: bold">if</span> <span style="color: #666666">(</span> <span style="color: #008000; font-weight: bold">element</span><span style="color: #0000FF; font-weight: bold">.isNull</span><span style="color: #666666">()</span> <span style="color: #666666">)</span>
{
delete m_drawingEngine;
m_drawingEngine <span style="color: #666666">=</span> <span style="color: #666666">0</span>;
m_drawingRect <span style="color: #666666">=</span> QRect();
setCursor( Qt<span style="color: #666666">::</span>ArrowCursor );
}
<span style="color: #008000; font-weight: bold">else</span>
{
m_drawingEngine <span style="color: #666666">=</span> new SmoothPathEngine( element );
setCursor( QCursor( QPixmap( QStringLiteral(<span style="color: #BA2121">"pencil"</span>) )<span style="color: #666666">,</span> Qt<span style="color: #666666">::</span>ArrowCursor ) );
m_currentDrawingToolElement <span style="color: #666666">=</span> element;
}
</pre></div>
</p>
<p style="padding: 0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: inherit;">You can see that it sets the cursor shape, but we don't want that: When drawing with the stylus we want the cursor to remain a CrossCursor, not change back to ArrowCursor. But the cursor change is really only a by-product of the calls to this method. Therefore I simply inlined the calls to slotChangeDrawingToolEngine, and omitted the cursor change.</p></pre>
<br />
<p>- Oliver</p>
<br />
<p>On October 5th, 2016, 4:20 p.m. UTC, Oliver Sander wrote:</p>
<table bgcolor="#fefadf" width="100%" cellspacing="0" cellpadding="12" style="border: 1px #888a85 solid; border-radius: 6px; -moz-border-radius: 6px; -webkit-border-radius: 6px;">
<tr>
<td>
<div>Review request for Okular.</div>
<div>By Oliver Sander.</div>
<p style="color: grey;"><i>Updated Oct. 5, 2016, 4:20 p.m.</i></p>
<div style="margin-top: 1.5em;">
<b style="color: #575012; font-size: 10pt;">Repository: </b>
okular
</div>
<h1 style="color: #575012; font-size: 10pt; margin-top: 1.5em;">Description </h1>
<table width="100%" bgcolor="#ffffff" cellspacing="0" cellpadding="10" style="border: 1px solid #b8b5a0">
<tr>
<td>
<pre style="margin: 0; padding: 0; white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;"><p style="padding: 0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: inherit;">I am trying to fix the following papercut: I regularly write on pdf files in presentation mode, using the pen that comes with my Lenovo ThinkPad Yoga. When I approach the screen with the pen, the cursor appears, and it follows the pen tip during writing. When I lift off the pen, the cursor stays on, and auto-hides only a few seconds later (because of Okular::Settings::EnumSlidesCursor::HiddenDelay). As a consequence, the cursor frequently hides the last bits of what I have just written. This is a nuisance, because I do this in front of an audience, and a lot of it is math (where every detail matters).</p>
<p style="padding: 0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: inherit;">Ideally, the cursor would auto-hide when I lift the pen off the screen. Luckily, Qt has an event for this: QEvent::TabletLeaveProximity. Unluckily, the documentation says (http://doc.qt.io/qt-5/qtabletevent.html):</p>
<p style="padding: 0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: inherit;">"TabletEnterProximity and TabletLeaveProximity events [...] are only sent to QApplication"</p>
<p style="padding: 0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: inherit;">Therefore, this patch introduces a new class TabletApplication, which inherits from QApplication, and is used in main.cpp instead of QApplication. The proximity events are really caught, and each time a short note is printed on the console.</p>
<p style="padding: 0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: inherit;">Unfortunately, at this point I am stuck and need some help. Apparently, I cannot control the cursor from a QApplication. How do I get the information that a TabletProximity has been caught to the presentation widget? Maybe the answer is trivial, but I have very little Qt programming experience. Thanks for your help!</p></pre>
</td>
</tr>
</table>
<h1 style="color: #575012; font-size: 10pt; margin-top: 1.5em;">Diffs</b> </h1>
<ul style="margin-left: 3em; padding-left: 0;">
<li>ui/presentationwidget.h <span style="color: grey">(69574d2)</span></li>
<li>ui/presentationwidget.cpp <span style="color: grey">(c16d616)</span></li>
</ul>
<p><a href="https://git.reviewboard.kde.org/r/128858/diff/" style="margin-left: 3em;">View Diff</a></p>
</td>
</tr>
</table>
</div>
</body>
</html>