<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: QPlainTextEdit With In Line Spell Check</title>
	<atom:link href="http://john.nachtimwald.com/2009/08/22/qplaintextedit-with-in-line-spell-check/feed/" rel="self" type="application/rss+xml" />
	<link>http://john.nachtimwald.com/2009/08/22/qplaintextedit-with-in-line-spell-check/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=qplaintextedit-with-in-line-spell-check</link>
	<description>My little blog</description>
	<lastBuildDate>Sat, 21 Jan 2012 00:48:47 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
	<item>
		<title>By: Jonas F. Jensen.</title>
		<link>http://john.nachtimwald.com/2009/08/22/qplaintextedit-with-in-line-spell-check/comment-page-1/#comment-21</link>
		<dc:creator>Jonas F. Jensen.</dc:creator>
		<pubDate>Mon, 14 Sep 2009 20:17:31 +0000</pubDate>
		<guid isPermaLink="false">http://john.nachtimwald.com/?p=197#comment-21</guid>
		<description>Hi,

Just realized that instead of overwriting the mousePressEvent on the Q(Plain)TextEdit an convert right clicks to left clicks inorder to move the cursor... Which is sort of an ugly hack, you can use QPlainTextEdit.cursorForPosition(QPoint)

cursor = self.cursorForPosition(event.pos())
instead of cursor = self.textCursor() in the contextMenuEvent implementation, this also means that the visible text cursor won&#039;t move, and the user will not see that the text is selected...
This could still be achieved though, by calling self.setTextCursor(cursor)</description>
		<content:encoded><![CDATA[<p>Hi,</p>
<p>Just realized that instead of overwriting the mousePressEvent on the Q(Plain)TextEdit an convert right clicks to left clicks inorder to move the cursor&#8230; Which is sort of an ugly hack, you can use QPlainTextEdit.cursorForPosition(QPoint)</p>
<p>cursor = self.cursorForPosition(event.pos())<br />
instead of cursor = self.textCursor() in the contextMenuEvent implementation, this also means that the visible text cursor won&#8217;t move, and the user will not see that the text is selected&#8230;<br />
This could still be achieved though, by calling self.setTextCursor(cursor)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: John</title>
		<link>http://john.nachtimwald.com/2009/08/22/qplaintextedit-with-in-line-spell-check/comment-page-1/#comment-20</link>
		<dc:creator>John</dc:creator>
		<pubDate>Thu, 27 Aug 2009 22:52:42 +0000</pubDate>
		<guid isPermaLink="false">http://john.nachtimwald.com/?p=197#comment-20</guid>
		<description>The reason you can&#039;t import pyqtSignal is because it is only available in PyQt 4.5+. While, Ubuntu 9.04 ships with Qt 4.5, it only ships with PyQt 4.4.4. The partial solution still works fine and is probably the cleanest solution for PyQt 4.4.</description>
		<content:encoded><![CDATA[<p>The reason you can&#8217;t import pyqtSignal is because it is only available in PyQt 4.5+. While, Ubuntu 9.04 ships with Qt 4.5, it only ships with PyQt 4.4.4. The partial solution still works fine and is probably the cleanest solution for PyQt 4.4.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jonas Finnemann Jensen</title>
		<link>http://john.nachtimwald.com/2009/08/22/qplaintextedit-with-in-line-spell-check/comment-page-1/#comment-19</link>
		<dc:creator>Jonas Finnemann Jensen</dc:creator>
		<pubDate>Thu, 27 Aug 2009 12:38:31 +0000</pubDate>
		<guid isPermaLink="false">http://john.nachtimwald.com/?p=197#comment-19</guid>
		<description>Thanks... This is great...

I had some problems importing pyqtSignal though... Ubuntu 9.04, Qt 4.5.

Nevertheless, replacing the custom SpellAction with a normal Action connected to a partial function did the trick:
action = QAction(suggestion, spell_menu)
action.connect(action, SIGNAL(&quot;triggered()&quot;), functools.partial(self.correctWord, word = suggestion))
spell_menu.addAction(action)

Don&#039;t know if this approach is better, but it worked for me...

And again thanks for publishing this... Otherwise this would not be a feature I&#039;d waste time on :)
(But it&#039;s just so neat to have...)</description>
		<content:encoded><![CDATA[<p>Thanks&#8230; This is great&#8230;</p>
<p>I had some problems importing pyqtSignal though&#8230; Ubuntu 9.04, Qt 4.5.</p>
<p>Nevertheless, replacing the custom SpellAction with a normal Action connected to a partial function did the trick:<br />
action = QAction(suggestion, spell_menu)<br />
action.connect(action, SIGNAL(&#8220;triggered()&#8221;), functools.partial(self.correctWord, word = suggestion))<br />
spell_menu.addAction(action)</p>
<p>Don&#8217;t know if this approach is better, but it worked for me&#8230;</p>
<p>And again thanks for publishing this&#8230; Otherwise this would not be a feature I&#8217;d waste time on <img src='http://john.nachtimwald.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /><br />
(But it&#8217;s just so neat to have&#8230;)</p>
]]></content:encoded>
	</item>
</channel>
</rss>

