<?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[What happened to the QGraphicsSceneMouseEvent::button() function?]]></title><description><![CDATA[<p dir="auto">Hi!!<br />
I have next code;</p>
<pre><code>void Test::mouseMoveEvent(QGraphicsSceneMouseEvent *event)
{
    
    qDebug()&lt;&lt;"MouseMove"&lt;&lt;event-&gt;button();
    if (event-&gt;button() != Qt::LeftButton){
          //Always execute
              return;
    }
QGraphicsScene::mouseMoveEvent(event);
}

Output:
MouseMove Qt::NoButton
</code></pre>
<p dir="auto">Why does the QGraphicsSceneMouseEvent :: button () function inside the mouseMoveEvent function return  Qt :: Nobutton?<br />
However mousePressEvent and mouseReleaseEvent function work fine :(<br />
Output :<br />
MousePress Qt::LeftButton<br />
MouseMove Qt::NoButton<br />
MouseMove Qt::NoButton<br />
MouseRelease Qt::LeftButton</p>
<p dir="auto">Thanks!!</p>
]]></description><link>https://forum.qt.io/topic/106114/what-happened-to-the-qgraphicsscenemouseevent-button-function</link><generator>RSS for Node</generator><lastBuildDate>Tue, 03 Nov 2026 19:52:33 GMT</lastBuildDate><atom:link href="https://forum.qt.io/topic/106114.rss" rel="self" type="application/rss+xml"/><pubDate>Wed, 21 Aug 2019 20:54:43 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to What happened to the QGraphicsSceneMouseEvent::button() function? on Tue, 27 Aug 2019 12:48:29 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/sgaist">@<bdi>sgaist</bdi></a> The version is Qt opensource-windows-x86-5.13.0.</p>
]]></description><link>https://forum.qt.io/post/548077</link><guid isPermaLink="true">https://forum.qt.io/post/548077</guid><dc:creator><![CDATA[Yosvanis]]></dc:creator><pubDate>Tue, 27 Aug 2019 12:48:29 GMT</pubDate></item><item><title><![CDATA[Reply to What happened to the QGraphicsSceneMouseEvent::button() function? on Fri, 23 Aug 2019 21:55:33 GMT]]></title><description><![CDATA[<p dir="auto">Looks like the <a href="https://doc.qt.io/qt-5/qgraphicsscenemouseevent.html#buttons" target="_blank" rel="noopener noreferrer nofollow ugc">buttons</a> method return value could be fo interest.</p>
]]></description><link>https://forum.qt.io/post/547604</link><guid isPermaLink="true">https://forum.qt.io/post/547604</guid><dc:creator><![CDATA[SGaist]]></dc:creator><pubDate>Fri, 23 Aug 2019 21:55:33 GMT</pubDate></item><item><title><![CDATA[Reply to What happened to the QGraphicsSceneMouseEvent::button() function? on Fri, 23 Aug 2019 21:17:11 GMT]]></title><description><![CDATA[<p dir="auto">That's the Qt Creator information. I would like to know which version of Qt you are using to build your application.</p>
]]></description><link>https://forum.qt.io/post/547601</link><guid isPermaLink="true">https://forum.qt.io/post/547601</guid><dc:creator><![CDATA[SGaist]]></dc:creator><pubDate>Fri, 23 Aug 2019 21:17:11 GMT</pubDate></item><item><title><![CDATA[Reply to What happened to the QGraphicsSceneMouseEvent::button() function? on Wed, 21 Aug 2019 21:39:51 GMT]]></title><description><![CDATA[<p dir="auto">I have:<br />
Qt Creator 4.9.1<br />
Based on Qt 5.12.3 (MSVC 2017, 32 bit)<br />
Built on May 26 2019 21:17:08<br />
From revision 168e91b618<br />
Copyright 2008-2019 The Qt Company Ltd. All rights reserved.</p>
<p dir="auto">On Windows 10 Pro and you can run <strong>"Diagram Scene Example"</strong> and executed the same code just <s>before</s> after mousePressEvent, mouseMoveEvent and mouseReleaseEvent, in the DiagramScene class ... I'm sorry for my bad English ;)</p>
]]></description><link>https://forum.qt.io/post/547248</link><guid isPermaLink="true">https://forum.qt.io/post/547248</guid><dc:creator><![CDATA[Yosvanis]]></dc:creator><pubDate>Wed, 21 Aug 2019 21:39:51 GMT</pubDate></item><item><title><![CDATA[Reply to What happened to the QGraphicsSceneMouseEvent::button() function? on Wed, 21 Aug 2019 21:18:57 GMT]]></title><description><![CDATA[<p dir="auto">Hi,</p>
<p dir="auto">That surprising indeed.</p>
<p dir="auto">What version of Qt are you using ?<br />
On what platform ?<br />
Can you provide a minimal compilable example that reproduces this ?</p>
]]></description><link>https://forum.qt.io/post/547247</link><guid isPermaLink="true">https://forum.qt.io/post/547247</guid><dc:creator><![CDATA[SGaist]]></dc:creator><pubDate>Wed, 21 Aug 2019 21:18:57 GMT</pubDate></item></channel></rss>