<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[CellExited()]]></title><description><![CDATA[<p dir="auto">Hello,<br />
I know there are the following signals for a QTableWidget:</p>
<p dir="auto">@<br />
void QTableWidget::cellEntered(int row, int column)<br />
void QTableWidget::currentCellChanged(int currentRow, int currentColumn, int previousRow, int previousColumn)<br />
@</p>
<p dir="auto">The first is called when the mouse enter in a cell (no need to click is the tracking is enabled).<br />
The second is called when a cell receive the focus.</p>
<p dir="auto">I need to take an action when the mouse enter a cell (without click) and take another one when it leaves it.<br />
It seems there isn't a cellLeaved(int row, int column) and I can't use the currentCellChanged() without clicking each cell.</p>
<p dir="auto">Any idea about this?<br />
Mark</p>
]]></description><link>https://forum.qt.io/topic/33521/cellexited</link><generator>RSS for Node</generator><lastBuildDate>Fri, 07 Aug 2026 10:50:16 GMT</lastBuildDate><atom:link href="https://forum.qt.io/topic/33521.rss" rel="self" type="application/rss+xml"/><pubDate>Fri, 25 Oct 2013 13:02:26 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to CellExited() on Fri, 25 Oct 2013 13:41:30 GMT]]></title><description><![CDATA[<p dir="auto">Thanks! Good hint, I'm going to try it!</p>
]]></description><link>https://forum.qt.io/post/201897</link><guid isPermaLink="true">https://forum.qt.io/post/201897</guid><dc:creator><![CDATA[[[global:former-user]]]]></dc:creator><pubDate>Fri, 25 Oct 2013 13:41:30 GMT</pubDate></item><item><title><![CDATA[Reply to CellExited() on Fri, 25 Oct 2013 13:40:33 GMT]]></title><description><![CDATA[<p dir="auto">ok then you can go with my suggested method. Something like this:<br />
@<br />
QPersistenModelIndex index;<br />
...<br />
bool eventFilter(QObject* obj, QEvent* event)<br />
{<br />
if( obj == table-&gt;viewport() )<br />
{<br />
switch( event-&gt;type() )<br />
{<br />
case QEvent::Leave:<br />
{<br />
doStuffWithOldCell(index);<br />
index = QModelIndex();<br />
}<br />
break;<br />
case QEvent::MouseMove:<br />
{<br />
QMouseEvent* e = static_cast&lt;QMouseEvent*&gt;(event);<br />
QModelIndex newIndex = table-&gt;indexAt(e-&gt;pos());<br />
if( index != newIndex )<br />
{<br />
doStuffWithOldCell(index);<br />
index = newIndex;<br />
doStuffWithNewCell(index);<br />
}<br />
}<br />
break;<br />
}<br />
return false;<br />
}<br />
@</p>
]]></description><link>https://forum.qt.io/post/201896</link><guid isPermaLink="true">https://forum.qt.io/post/201896</guid><dc:creator><![CDATA[raven-worx]]></dc:creator><pubDate>Fri, 25 Oct 2013 13:40:33 GMT</pubDate></item><item><title><![CDATA[Reply to CellExited() on Fri, 25 Oct 2013 13:20:10 GMT]]></title><description><![CDATA[<p dir="auto">Thanks for your reply.<br />
I'm trying to achieve exactly what I said :-) I want to take an action when the mouse enter a cell (already done) and another when it leaves.</p>
<p dir="auto">Just an example: think to move the mouse over a QTableView and to highlight the cell under the pointer.</p>
<p dir="auto">I would highlight the current cell and restore the previous background when the pointer leaves it.</p>
]]></description><link>https://forum.qt.io/post/201891</link><guid isPermaLink="true">https://forum.qt.io/post/201891</guid><dc:creator><![CDATA[[[global:former-user]]]]></dc:creator><pubDate>Fri, 25 Oct 2013 13:20:10 GMT</pubDate></item><item><title><![CDATA[Reply to CellExited() on Fri, 25 Oct 2013 13:17:24 GMT]]></title><description><![CDATA[<p dir="auto">what are you exactly trying to achieve?</p>
<p dir="auto">Basically a cell is left when another cell is entered or on the leave event (leaving the whole table).</p>
<p dir="auto">you can also listen for the mouse move event on the viewport (also requires mouse tracking turned on) and check the cell with QAbstractItemView::indexAt().</p>
]]></description><link>https://forum.qt.io/post/201890</link><guid isPermaLink="true">https://forum.qt.io/post/201890</guid><dc:creator><![CDATA[raven-worx]]></dc:creator><pubDate>Fri, 25 Oct 2013 13:17:24 GMT</pubDate></item></channel></rss>