hi friends.

i have a QGraphicsScene with around 400 labels in it. when i increase initial size of labels program crashes.

Qt Code:
  1. scene = QtGui.QGraphicsScene()
  2. scene.setBackgroundBrush(QtGui.QColor('white'))
  3. graphics_widget = QtGui.QGraphicsWidget()
  4. layout = QtGui.QGraphicsLinearLayout(QtCore.Qt.Vertical)
  5. page_size = QtCore.QSize(995, 1242)
  6. for number in xrange(400):
  7. lbl = QtGui.QLabel()
  8. lbl.setFixedSize(page_size)
  9. lbl.setContentsMargins(0, 0, 0, 0)
  10. lbl.setScaledContents(True)
  11.  
  12. widget = scene.addWidget(lbl)
  13. layout.addItem(widget)
  14.  
  15. graphics_widget.setLayout(layout)
  16. scene.addItem(graphics_widget)
  17. self.gs_view.setScene(scene)
  18. self.gs_view.show()
To copy to clipboard, switch view to plain text mode 

but when i decrease initial size of labels to ie QtCore.QSize(695, 942) it does not crash. sometimes when i scale QGraphicsView and my application memory usage is around 250mb i get and out of memory error and application exits automatically.

thank you.