# Qtruby scale images on window resize with QGraphicsView and QGraphicsScene

**URL:** <https://www.ruby-forum.com/t/qtruby-scale-images-on-window-resize-with-qgraphicsview-and-qgraphicsscene/187940>\
**Category:** Ruby\
**Created:** [May 2, 2010, 9:46pm UTC](https://www.ruby-forum.com/t/qtruby-scale-images-on-window-resize-with-qgraphicsview-and-qgraphicsscene/187940 "2010-05-02T21:46:03Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![kevin](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/k/2acd7d/32.png) [@kevin](https://www.ruby-forum.com/u/kevin)\
**Post date:** [May 2, 2010, 9:46pm UTC](https://www.ruby-forum.com/t/qtruby-scale-images-on-window-resize-with-qgraphicsview-and-qgraphicsscene/187940/1 "2010-05-02T21:46:03Z")

</div>

I’m trying to get an image to scale nicely on window resize with Qt and  
all  
I seem to be able to get is the image to load full size.  
The offending code is here: [shadowskill - Pastebin.com](http://pastebin.com/LYF0e6hd)

I’m trying to get an effect similar to this Python example:

> **[QGraphicsView and QGraphicsScene](https://rk.edu.pl/en/qgraphicsview-and-qgraphicsscene/)**
>
> Description of widgets for visualizing 2D data (images etc.)

Scroll down to the bottom to see the class created there with the resize  
event handler.

My suspicion is that the resize event isn’t getting fired at all in my  
code.  
Any ideas would be greatly appreciated. Note that I have tried using  
FitInView which does what it says but it seems to make the image blurry.
