<html>
<head>
<meta content="text/html; charset=ISO-8859-1"
http-equiv="Content-Type">
</head>
<body text="#000000" bgcolor="#FFFFFF">
<br>
<blockquote cite="mid:52B15B37.2080100@gmail.com" type="cite">
<meta content="text/html; charset=ISO-8859-1"
http-equiv="Content-Type">
Hi.<br>
<br>
In QPlainTextEdit::event( QEvent * e )<br>
<br>
I've found the next code:<br>
<br>
<span style=" color:#000080;">#ifndef</span><span style="
color:#c0c0c0;"> </span><span style=" color:#800080;">QT_NO_GESTURES</span>
<pre style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" color:#c0c0c0;"> </span><span style=" color:#00007f;">else</span><span style=" color:#c0c0c0;"> </span><span style=" color:#00007f;">if</span><span style=" color:#c0c0c0;"> </span><span style=" color:#000000;">(</span><span style=" color:#000000;">e</span><span style=" color:#000000;">-></span><span style=" color:#000000;">type</span><span style=" color:#000000;">()</span><span style=" color:#c0c0c0;"> </span><span style=" color:#000000;">==</span><span style=" color:#c0c0c0;"> </span><span style=" color:#800080;">QEvent</span><span style=" color:#000000;">::</span><span style=" color:#800080;">Gesture</span><span style=" color:#000000;">)</span><span style=" color:#c0c0c0;"> </span><span style=" color:#000000;">{</span></pre>
<pre style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" color:#c0c0c0;"> </span>QGestureEvent<span style=" color:#c0c0c0;"> </span><span style=" color:#000000;">*</span><span style=" color:#000000;">ge</span><span style=" color:#c0c0c0;"> </span><span style=" color:#000000;">=</span><span style=" color:#c0c0c0;"> </span><span style=" color:#00007f;">static_cast</span><span style=" color:#000000;"><</span>QGestureEvent<span style=" color:#c0c0c0;"> </span><span style=" color:#000000;">*>(</span><span style=" color:#000000;">e</span><span style=" color:#000000;">);</span></pre>
<pre style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" color:#c0c0c0;"> </span>QPanGesture<span style=" color:#c0c0c0;"> </span><span style=" color:#000000;">*</span><span style=" color:#000000;">g</span><span style=" color:#c0c0c0;"> </span><span style=" color:#000000;">=</span><span style=" color:#c0c0c0;"> </span><span style=" color:#00007f;">static_cast</span><span style=" color:#000000;"><</span>QPanGesture<span style=" color:#c0c0c0;"> </span><span style=" color:#000000;">*>(</span><span style=" color:#000000;">ge</span><span style=" color:#000000;">-></span>gesture<span style=" color:#000000;">(</span><span style=" color:#800080;">Qt</span><span style=" color:#000000;">::</span><span style=" color:#800080;">PanGesture</span><span style=" color:#000000;">));</span></pre>
<pre style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" color:#c0c0c0;"> </span><span style=" color:#00007f;">if</span><span style=" color:#c0c0c0;"> </span><span style=" color:#000000;">(</span><span style=" color:#000000;">g</span><span style=" color:#000000;">)</span><span style=" color:#c0c0c0;"> </span><span style=" color:#000000;">{</span></pre>
<pre style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" color:#c0c0c0;"> </span><span style=" color:#800080;">QScrollBar</span><span style=" color:#c0c0c0;"> </span><span style=" color:#000000;">*</span><span style=" color:#000000;">hBar</span><span style=" color:#c0c0c0;"> </span><span style=" color:#000000;">=</span><span style=" color:#c0c0c0;"> </span><span style=" color:#000000;">horizontalScrollBar</span><span style=" color:#000000;">();</span></pre>
<pre style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" color:#c0c0c0;"> </span><span style=" color:#800080;">QScrollBar</span><span style=" color:#c0c0c0;"> </span><span style=" color:#000000;">*</span><span style=" color:#000000;">vBar</span><span style=" color:#c0c0c0;"> </span><span style=" color:#000000;">=</span><span style=" color:#c0c0c0;"> </span><span style=" color:#000000;">verticalScrollBar</span><span style=" color:#000000;">();</span></pre>
<pre style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" color:#c0c0c0;"> </span><span style=" color:#00007f;">if</span><span style=" color:#c0c0c0;"> </span><span style=" color:#000000;">(</span><span style=" color:#000000;">g</span><span style=" color:#000000;">-></span>state<span style=" color:#000000;">()</span><span style=" color:#c0c0c0;"> </span><span style=" color:#000000;">==</span><span style=" color:#c0c0c0;"> </span><span style=" color:#800080;">Qt</span><span style=" color:#000000;">::</span><span style=" color:#800080;">GestureStarted</span><span style=" color:#000000;">)</span></pre>
<pre style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" color:#c0c0c0;"> </span><span style=" color:#000000;">d</span><span style=" color:#000000;">-></span><span style=" color:#800000;">originalOffsetY</span><span style=" color:#c0c0c0;"> </span><span style=" color:#000000;">=</span><span style=" color:#c0c0c0;"> </span><span style=" color:#000000;">vBar</span><span style=" color:#000000;">-></span><span style=" color:#000000;">value</span><span style=" color:#000000;">();</span></pre>
<pre style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" color:#c0c0c0;"> </span><span style=" color:#800080;">QPointF</span><span style=" color:#c0c0c0;"> </span><span style=" color:#000000;">offset</span><span style=" color:#c0c0c0;"> </span><span style=" color:#000000;">=</span><span style=" color:#c0c0c0;"> </span><span style=" color:#000000;">g</span><span style=" color:#000000;">-></span>offset<span style=" color:#000000;">();</span></pre>
<pre style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" color:#c0c0c0;"> </span><span style=" color:#00007f;">if</span><span style=" color:#c0c0c0;"> </span><span style=" color:#000000;">(!</span><span style=" color:#000000;">offset</span><span style=" color:#000000;">.</span><span style=" color:#000000;">isNull</span><span style=" color:#000000;">())</span><span style=" color:#c0c0c0;"> </span><span style=" color:#000000;">{</span></pre>
<pre style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" color:#c0c0c0;"> </span><span style=" color:#00007f;">if</span><span style=" color:#c0c0c0;"> </span><span style=" color:#000000;">(</span><span style=" color:#800080;">QApplication</span><span style=" color:#000000;">::</span><span style=" color:#000000;">isRightToLeft</span><span style=" color:#000000;">())</span></pre>
<pre style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" color:#c0c0c0;"> </span><span style=" color:#000000;">offset</span><span style=" color:#000000;">.</span><span style=" color:#000000;">rx</span><span style=" color:#000000;">()</span><span style=" color:#c0c0c0;"> </span><span style=" color:#000000;">*=</span><span style=" color:#c0c0c0;"> </span><span style=" color:#000000;">-</span><span style=" color:#000080;">1</span><span style=" color:#000000;">;</span></pre>
<pre style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" color:#c0c0c0;"> </span><span style=" color:#005500;">//</span><span style=" color:#c0c0c0;"> </span><span style=" color:#005500;">QPlainTextEdit</span><span style=" color:#c0c0c0;"> </span><span style=" color:#005500;">scrolls</span><span style=" color:#c0c0c0;"> </span><span style=" color:#005500;">by</span><span style=" color:#c0c0c0;"> </span><span style=" color:#005500;">lines</span><span style=" color:#c0c0c0;"> </span><span style=" color:#005500;">only</span><span style=" color:#c0c0c0;"> </span><span style=" color:#005500;">in</span><span style=" color:#c0c0c0;"> </span><span style=" color:#005500;">vertical</span><span style=" color:#c0c0c0;"> </span><span style=" color:#005500;">direction</span></pre>
<pre style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" color:#c0c0c0;"> </span><span style=" color:#800080;">QFontMetrics</span><span style=" color:#c0c0c0;"> </span><span style=" color:#000000;">fm</span><span style=" color:#000000;">(</span><span style=" color:#000000;">document</span><span style=" color:#000000;">()-></span><span style=" color:#000000;">defaultFont</span><span style=" color:#000000;">());</span></pre>
<pre style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" color:#c0c0c0;"> </span><span style=" color:#00007f;">int</span><span style=" color:#c0c0c0;"> </span><span style=" color:#000000;">lineHeight</span><span style=" color:#c0c0c0;"> </span><span style=" color:#000000;">=</span><span style=" color:#c0c0c0;"> </span><span style=" color:#000000;">fm</span><span style=" color:#000000;">.</span><span style=" color:#000000;">height</span><span style=" color:#000000;">();</span></pre>
<pre style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" color:#c0c0c0;"> </span><span style=" color:#00007f;">int</span><span style=" color:#c0c0c0;"> </span><span style=" color:#000000;">newX</span><span style=" color:#c0c0c0;"> </span><span style=" color:#000000;">=</span><span style=" color:#c0c0c0;"> </span><span style=" color:#000000;">hBar</span><span style=" color:#000000;">-></span><span style=" color:#000000;">value</span><span style=" color:#000000;">()</span><span style=" color:#c0c0c0;"> </span><span style=" color:#000000;">-</span><span style=" color:#c0c0c0;"> </span><span style=" color:#000000;">g</span><span style=" color:#000000;">-></span>delta<span style=" color:#000000;">().</span>x<span style=" color:#000000;">();</span></pre>
<pre style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" color:#c0c0c0;"> </span><span style=" color:#00007f;">int</span><span style=" color:#c0c0c0;"> </span><span style=" color:#000000;">newY</span><span style=" color:#c0c0c0;"> </span><span style=" color:#000000;">=</span><span style=" color:#c0c0c0;"> </span><span style=" color:#000000;">d</span><span style=" color:#000000;">-></span><span style=" color:#800000;">originalOffsetY</span><span style=" color:#c0c0c0;"> </span><span style=" color:#000000;">-</span><span style=" color:#c0c0c0;"> </span><span style=" color:#000000;">offset</span><span style=" color:#000000;">.</span><span style=" color:#000000;">y</span><span style=" color:#000000;">()/</span><span style=" color:#000000;">lineHeight</span><span style=" color:#000000;">;</span></pre>
<pre style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" color:#c0c0c0;"> </span><span style=" color:#000000;">hBar</span><span style=" color:#000000;">-></span><span style=" color:#000000;">setValue</span><span style=" color:#000000;">(</span><span style=" color:#000000;">newX</span><span style=" color:#000000;">);</span></pre>
<pre style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" color:#c0c0c0;"> </span><span style=" color:#000000;">vBar</span><span style=" color:#000000;">-></span><span style=" color:#000000;">setValue</span><span style=" color:#000000;">(</span><span style=" color:#000000;">newY</span><span style=" color:#000000;">);</span></pre>
<pre style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" color:#c0c0c0;"> </span><span style=" color:#000000;">}</span></pre>
<pre style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" color:#c0c0c0;"> </span><span style=" color:#000000;">}</span></pre>
<pre style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" color:#c0c0c0;"> </span><span style=" color:#00007f;">return</span><span style=" color:#c0c0c0;"> </span><span style=" color:#00007f;">true</span><span style=" color:#000000;">;</span></pre>
<pre style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" color:#c0c0c0;"> </span><span style=" color:#000000;">}</span></pre>
<pre style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" color:#000080;">#endif</span><span style=" color:#c0c0c0;"> </span><span style=" color:#005500;">//</span><span style=" color:#c0c0c0;"> </span><span style=" color:#005500;">QT_NO_GESTURES
</span>It told to me that QPlainTextEdit should support "pan gesture" and text should be paned with
fingers. But in my test app when I move finger in QPlainTextEdit I receive selection of the text.
And I saw that in event( QEvent * e ) method appear QEvent::InputMethodQuery event instead of
QEvent::Gesture.
But with two fingers I receive sometimes QEvent::Gesture and text scrolled but in wrong direction.
It's ugly to not to have scrolling with one finger. May be we should post suggestion to the
bugreports.qt-project.org?
Any ideas?!</pre>
</blockquote>
<br>
Sorry. Direction is correct.<br>
<br>
<blockquote cite="mid:52B15B37.2080100@gmail.com" type="cite">
<pre style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">
<span style="color: rgb(49, 49, 49); font-family: monospace; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 14px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; background-color: rgb(246, 246, 246); display: inline !important; float: none;"></span>
</pre>
<blockquote cite="mid:52B0A971.5000708@meyer-thomas.com"
type="cite">
<meta http-equiv="content-type" content="text/html;
charset=ISO-8859-1">
Hi,<br>
sorry for 3rd posting about same issue. I didn't know the right<br>
mailing list.<br>
<br>
<br>
I have tried it several hours and get only a pan gesture with
two fingers, <br>
with text selection (what I not want).<br>
<br>
I have used QPlainTextEdit, QTextEdit - with Qt Designer or
subclass (<span style=" color:#000000;">grabGesture</span><span
style=" color:#000000;">(</span><span style=" color:#800080;">Qt</span><span
style=" color:#000000;">::</span><span style=" color:#800080;">PanGesture</span><span
style=" color:#000000;">)</span>) -<br>
in a simple 'MainWindow' (c++).<br>
(I have tried the gesture source code from the QPLainTextEdit
'event' function.) <br>
<br>
I got never the result like with the 'aboutQt' (QMessageBox)
call.<br>
<br>
I have Installed: <br>
Qt 5.2.0 for Android (Windows 32-bit, 761 MB),<br>
Asus MeMO Pad HD 7 (Android 4.2.2),<br>
Samsung Galaxy S4 mini (Android 4.2.2)<br>
<br>
I want to show results in a QPlainTextEdit or QTextEdit without
text selection, but pan<br>
up and down (and it would be nice, left and right).<br>
<br>
Can somebody help me, please?<br>
<br>
Thanks,<br>
Thomas <br>
<fieldset class="mimeAttachmentHeader"></fieldset>
<br>
<pre wrap="">_______________________________________________
Interest mailing list
<a moz-do-not-send="true" class="moz-txt-link-abbreviated" href="mailto:Interest@qt-project.org">Interest@qt-project.org</a>
<a moz-do-not-send="true" class="moz-txt-link-freetext" href="http://lists.qt-project.org/mailman/listinfo/interest">http://lists.qt-project.org/mailman/listinfo/interest</a>
</pre>
</blockquote>
<br>
<pre class="moz-signature" cols="72">--
Best Regards,
Igor Mironchik.</pre>
</blockquote>
<br>
<pre class="moz-signature" cols="72">--
Best Regards,
Igor Mironchik.</pre>
</body>
</html>