<?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[Maximize QGraphicsView]]></title><description><![CDATA[<p dir="auto">Hello!</p>
<p dir="auto">I don't know if it could be possible, but maybe you could help me.</p>
<p dir="auto">I am showing an image in a QGraphicsView and I want to know if it is possible to maximize it when using double click, for example.</p>
<p dir="auto">Is it possible?</p>
<p dir="auto">Thank you very much!</p>
]]></description><link>https://forum.qt.io/topic/84310/maximize-qgraphicsview</link><generator>RSS for Node</generator><lastBuildDate>Mon, 14 Sep 2026 15:07:18 GMT</lastBuildDate><atom:link href="https://forum.qt.io/topic/84310.rss" rel="self" type="application/rss+xml"/><pubDate>Thu, 19 Oct 2017 09:59:46 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Maximize QGraphicsView on Fri, 20 Oct 2017 11:33:15 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/ivanicy">@<bdi>ivanicy</bdi></a> said in <a href="/post/421766">Maximize QGraphicsView</a>:</p>
<blockquote>
<p dir="auto">showFullScreen</p>
</blockquote>
<p dir="auto">Docs for showFullScreen state:<br />
"Shows the widget in full-screen mode.<br />
Calling this function only affects windows."</p>
<p dir="auto">Check whether your QGraphicsView' isWindow() method returns true. If not, I believe you need to specify the flag Qt::Window in the constructor.<br />
Or you make a QDialog or QMainWindow (which are a window by default), and insert the QGraphicsView as a full-size child window.</p>
]]></description><link>https://forum.qt.io/post/421935</link><guid isPermaLink="true">https://forum.qt.io/post/421935</guid><dc:creator><![CDATA[Asperamanca]]></dc:creator><pubDate>Fri, 20 Oct 2017 11:33:15 GMT</pubDate></item><item><title><![CDATA[Reply to Maximize QGraphicsView on Fri, 20 Oct 2017 11:15:07 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/asperamanca">@<bdi>Asperamanca</bdi></a> No, sorry. The QGraphicsView has always the same size. It doesn't maximize.  QgraphicsView and image have always the same size both.</p>
<p dir="auto"><img src="https://ddgobkiprc33d.cloudfront.net/8acbf502-9992-4167-87db-3d7700cc9d27.png" alt="0_1508498086138_fcac6278-5060-419c-a797-a9782117a6c3-imagen.png" class=" img-fluid img-markdown" /></p>
<p dir="auto">The QGraphicsView never maximizes.</p>
]]></description><link>https://forum.qt.io/post/421929</link><guid isPermaLink="true">https://forum.qt.io/post/421929</guid><dc:creator><![CDATA[ivanicy]]></dc:creator><pubDate>Fri, 20 Oct 2017 11:15:07 GMT</pubDate></item><item><title><![CDATA[Reply to Maximize QGraphicsView on Fri, 20 Oct 2017 10:48:50 GMT]]></title><description><![CDATA[<p dir="auto">Okay, so your QGraphicsView is made fullscreen, but the image stays the same size.<br />
This is because by default, when you resize a QGraphicsView, the content stays the same size.<br />
You can find information on how to resize the content when you resize the GraphicsView in this article: <a href="https://stackoverflow.com/questions/24738458/qt-qgraphicsview-how-to-hook-to-resize-event#24738962" target="_blank" rel="noopener noreferrer nofollow ugc">https://stackoverflow.com/questions/24738458/qt-qgraphicsview-how-to-hook-to-resize-event#24738962</a></p>
]]></description><link>https://forum.qt.io/post/421918</link><guid isPermaLink="true">https://forum.qt.io/post/421918</guid><dc:creator><![CDATA[Asperamanca]]></dc:creator><pubDate>Fri, 20 Oct 2017 10:48:50 GMT</pubDate></item><item><title><![CDATA[Reply to Maximize QGraphicsView on Fri, 20 Oct 2017 10:30:14 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/asperamanca">@<bdi>Asperamanca</bdi></a> I mean that the image doesn't maximize. Now, when I doubleclick the image, the image gets small and then fill the QGraphicsView, but it doesn't fill in fullscreen, only the image square that I drew before.</p>
]]></description><link>https://forum.qt.io/post/421916</link><guid isPermaLink="true">https://forum.qt.io/post/421916</guid><dc:creator><![CDATA[ivanicy]]></dc:creator><pubDate>Fri, 20 Oct 2017 10:30:14 GMT</pubDate></item><item><title><![CDATA[Reply to Maximize QGraphicsView on Fri, 20 Oct 2017 08:13:54 GMT]]></title><description><![CDATA[<p dir="auto">First, this line in double click is unnecessary:</p>
<pre><code>fitInView(QApplication::desktop()-&gt;availableGeometry(-1), Qt::IgnoreAspectRatio);
</code></pre>
<p dir="auto">because your image should already be fully zoomed in from the constructor.</p>
<p dir="auto">Second, try to change the line in showEvent to the following</p>
<pre><code>fitInView(myGraphicsPixmapItem, Qt::IgnoreAspectRatio);
</code></pre>
<p dir="auto">Finally, what do you mean by "it doesn't work": Is the whole window not maximized? Or is the image not large enough within the window?</p>
]]></description><link>https://forum.qt.io/post/421890</link><guid isPermaLink="true">https://forum.qt.io/post/421890</guid><dc:creator><![CDATA[Asperamanca]]></dc:creator><pubDate>Fri, 20 Oct 2017 08:13:54 GMT</pubDate></item><item><title><![CDATA[Reply to Maximize QGraphicsView on Thu, 19 Oct 2017 15:14:44 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/asperamanca">@<bdi>Asperamanca</bdi></a> The QGraphicsView and the image have the same size. In the QGraphicsView's showEvent, I put this line:</p>
<pre><code>fitInView(this-&gt;scene-&gt;sceneRect(), Qt::IgnoreAspectRatio);
</code></pre>
<p dir="auto">The 'this' pointer is the QGraphicsView. I have tryed this lines, but it doesn't work:</p>
<pre><code>void imageView::mouseDoubleClickEvent(QMouseEvent *event) {
    this-&gt;setWindowState(Qt::WindowFullScreen);
    this-&gt;showFullScreen();
    fitInView(QApplication::desktop()-&gt;availableGeometry(-1), Qt::IgnoreAspectRatio);
}
</code></pre>
<p dir="auto">imageView is the QGraphicsView.</p>
<p dir="auto">Do you know what could be the problem?? Thank you again!!</p>
]]></description><link>https://forum.qt.io/post/421766</link><guid isPermaLink="true">https://forum.qt.io/post/421766</guid><dc:creator><![CDATA[ivanicy]]></dc:creator><pubDate>Thu, 19 Oct 2017 15:14:44 GMT</pubDate></item><item><title><![CDATA[Reply to Maximize QGraphicsView on Thu, 19 Oct 2017 14:19:55 GMT]]></title><description><![CDATA[<p dir="auto">How big is your GraphicsView in the first picture? Does it already fill the whole rectangle (but the image is smaller), or does it only fill the gray area in the middle?<br />
Because if the GraphicsView does not fill the whole interface, you first need to maximize that. For this, you might get some info in this article: <a href="https://stackoverflow.com/questions/9412971/how-to-set-qwidget-fullscreen-but-real-fullscreen-change-resolution-set-mod#9413140" target="_blank" rel="noopener noreferrer nofollow ugc">https://stackoverflow.com/questions/9412971/how-to-set-qwidget-fullscreen-but-real-fullscreen-change-resolution-set-mod#9413140</a></p>
]]></description><link>https://forum.qt.io/post/421754</link><guid isPermaLink="true">https://forum.qt.io/post/421754</guid><dc:creator><![CDATA[Asperamanca]]></dc:creator><pubDate>Thu, 19 Oct 2017 14:19:55 GMT</pubDate></item><item><title><![CDATA[Reply to Maximize QGraphicsView on Thu, 19 Oct 2017 14:14:52 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/asperamanca">@<bdi>Asperamanca</bdi></a> I am trying to get this effect:</p>
<p dir="auto"><img src="https://ddgobkiprc33d.cloudfront.net/94dfdd99-c11f-4f98-96d1-087a99c6017c.png" alt="0_1508422247805_0fb74006-933c-4548-a998-12b5a6097ddc-imagen.png" class=" img-fluid img-markdown" /></p>
<p dir="auto">The image is a QGraphicPixmapItem in a QGraphicsScene in a QGraphicsView.</p>
<p dir="auto">I tryed this line in the mouseDoubleClickEvent():</p>
<pre><code>void imageView::mouseDoubleClickEvent(QMouseEvent *event) {
    fitInView(QApplication::desktop()-&gt;availableGeometry(-1), Qt::IgnoreAspectRatio);
}
</code></pre>
<p dir="auto">but it doesn't works.</p>
<p dir="auto">Thank you very much</p>
]]></description><link>https://forum.qt.io/post/421752</link><guid isPermaLink="true">https://forum.qt.io/post/421752</guid><dc:creator><![CDATA[ivanicy]]></dc:creator><pubDate>Thu, 19 Oct 2017 14:14:52 GMT</pubDate></item><item><title><![CDATA[Reply to Maximize QGraphicsView on Thu, 19 Oct 2017 12:23:32 GMT]]></title><description><![CDATA[<p dir="auto">If I understand you correctly, it's only zooming in onto the image, and then zooming out again.</p>
<p dir="auto">If you show the image within a QGraphicsItem (e.g. a QGraphicsPixmap item), you can use QGraphicsView::fitInView to show this image in full view. Before that, you can remember the position and zoom level by saving QGraphicsView::transform().<br />
If you</p>
]]></description><link>https://forum.qt.io/post/421741</link><guid isPermaLink="true">https://forum.qt.io/post/421741</guid><dc:creator><![CDATA[Asperamanca]]></dc:creator><pubDate>Thu, 19 Oct 2017 12:23:32 GMT</pubDate></item><item><title><![CDATA[Reply to Maximize QGraphicsView on Thu, 19 Oct 2017 12:15:31 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/asperamanca">@<bdi>Asperamanca</bdi></a></p>
<p dir="auto">This is that I want:</p>
<p dir="auto">When I doubleclick the image, I want to show it fullscreen and, doubleclicking again, I want to restore the default interface. Do you understand me? I know my english is not very good.</p>
]]></description><link>https://forum.qt.io/post/421739</link><guid isPermaLink="true">https://forum.qt.io/post/421739</guid><dc:creator><![CDATA[ivanicy]]></dc:creator><pubDate>Thu, 19 Oct 2017 12:15:31 GMT</pubDate></item><item><title><![CDATA[Reply to Maximize QGraphicsView on Thu, 19 Oct 2017 11:32:07 GMT]]></title><description><![CDATA[<p dir="auto">What exactly do you want to maximize (the GraphicsView or the Image), and what exactly do you mean by that? How should it look?</p>
]]></description><link>https://forum.qt.io/post/421736</link><guid isPermaLink="true">https://forum.qt.io/post/421736</guid><dc:creator><![CDATA[Asperamanca]]></dc:creator><pubDate>Thu, 19 Oct 2017 11:32:07 GMT</pubDate></item></channel></rss>