<?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[Why graphics scene occupy whole graphics view?]]></title><description><![CDATA[<p dir="auto">Why graphics scene is beeing drawed in whole graphics view area? I invoked setSceneRect and scene does not have correct size as it supposed to have.</p>
<pre><code>graphicsScene = std::make_shared&lt;GraphicsScene&gt;(new GraphicsScene(this));
graphicsScene-&gt;setSceneRect(0, 0, 250, 250);
graphicsScene-&gt;setBackgroundBrush(QColor(123,123,123));
ui-&gt;canvas-&gt;setScene(graphicsScene.get());
</code></pre>
<p dir="auto">Whole view area is gray (color(123,123,123)) regardless what view's size is. Even graphics items are beeing drawed outside scene rect. How to correcty set scene size?</p>
]]></description><link>https://forum.qt.io/topic/109899/why-graphics-scene-occupy-whole-graphics-view</link><generator>RSS for Node</generator><lastBuildDate>Tue, 21 Apr 2026 19:27:46 GMT</lastBuildDate><atom:link href="https://forum.qt.io/topic/109899.rss" rel="self" type="application/rss+xml"/><pubDate>Wed, 18 Dec 2019 22:06:19 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Why graphics scene occupy whole graphics view? on Thu, 19 Dec 2019 06:27:49 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/clostridium_difficile">@<bdi>clostridium_difficile</bdi></a> said in <a href="/post/568140">Why graphics scene occupy whole graphics view?</a>:</p>
<blockquote>
<p dir="auto">how to make scene to get events when mouse pointer is over scene's rendering rectangle?</p>
</blockquote>
<p dir="auto">Override <a href="https://doc.qt.io/qt-5/qgraphicsscene.html#mouseMoveEvent" target="_blank" rel="noopener noreferrer nofollow ugc">https://doc.qt.io/qt-5/qgraphicsscene.html#mouseMoveEvent</a></p>
]]></description><link>https://forum.qt.io/post/568158</link><guid isPermaLink="true">https://forum.qt.io/post/568158</guid><dc:creator><![CDATA[jsulm]]></dc:creator><pubDate>Thu, 19 Dec 2019 06:27:49 GMT</pubDate></item><item><title><![CDATA[Reply to Why graphics scene occupy whole graphics view? on Wed, 18 Dec 2019 23:18:44 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/mrjj">@<bdi>mrjj</bdi></a> said in <a href="/post/568137">Why graphics scene occupy whole graphics view?</a>:</p>
<blockquote>
<p dir="auto">Hi<br />
As that is how it works. The setSceneRect defines the logical extent of the scene and<br />
used by the View to know if to show scrollbars etc.<br />
Its not a setting for the ClientArea it will occupy. It will always fill the View completely.</p>
</blockquote>
<p dir="auto">Well, how to make graphics view render only selected region of scene? Also, I have other questions: how to make scene to get events when mouse pointer is over scene's rendering rectangle?</p>
]]></description><link>https://forum.qt.io/post/568140</link><guid isPermaLink="true">https://forum.qt.io/post/568140</guid><dc:creator><![CDATA[clostridium_difficile]]></dc:creator><pubDate>Wed, 18 Dec 2019 23:18:44 GMT</pubDate></item><item><title><![CDATA[Reply to Why graphics scene occupy whole graphics view? on Wed, 18 Dec 2019 22:15:57 GMT]]></title><description><![CDATA[<p dir="auto">Hi<br />
As that is how it works. The setSceneRect defines the logical extent of the scene and<br />
used by the View to know if to show scrollbars etc.<br />
Its not a setting for the ClientArea it will occupy. It will always fill the View completely.</p>
]]></description><link>https://forum.qt.io/post/568137</link><guid isPermaLink="true">https://forum.qt.io/post/568137</guid><dc:creator><![CDATA[mrjj]]></dc:creator><pubDate>Wed, 18 Dec 2019 22:15:57 GMT</pubDate></item></channel></rss>