Hi.
I have code like:

Qt Code:
  1. class GraphItem : public QGraphicsWidget
  2. {
  3. virtual void resizeEvent(QGraphicsSceneResizeEvent* event)
  4. {
  5. //it doesn't call
  6. }
  7. }
  8.  
  9.  
  10.  
  11. class Form : public QGraphicsWidget
  12. {
  13.  
  14. public:
  15.  
  16. Form()
  17. {
  18. GraphItem* item1 = new GraphItem;
  19. GraphItem* item2 = new GraphItem;
  20. GraphItem* item3 = new GraphItem;
  21.  
  22. QGraphicsLinearLayout* layout = new QGraphicsLinearLayout;
  23. layout->addItem(item3);
  24. layout->addItem(item3);
  25. layout->addItem(item3);
  26.  
  27. setLayout(layout);
  28. };
  29. }
  30.  
  31. class GraphWidget : public QGraphicsView
  32. {
  33. Form* form = new Form;
  34. scene->addItem(form);
  35. setScene(scene);
  36. }
  37.  
  38. void GraphWidget::resizeEvent(QResizeEvent* event)
  39. {
  40. setSceneRect(0,0,geometry().width(),geometry().height());
  41. form->setGeometry(0,0,geometry().width(),geometry().height());
  42. QWidget::resizeEvent(event);
  43. }
To copy to clipboard, switch view to plain text mode 

Could somebody explain why resizeEvent doesn't call and how to fix it?