Here is what I changed it after skoa's advice:

In maincontrol.h I declared a QGraphicsPixmapItem pointer to use with the QGraphicsScene:

Qt Code:
  1. QGraphicsPixmapItem *control_pixmap_item;
To copy to clipboard, switch view to plain text mode 
Then in the constructor I used:

Qt Code:
  1. control_pixmap_item->setPixmap(*control)
  2. control_scene->addItem(control_pixmap_item);
To copy to clipboard, switch view to plain text mode 

Then on maincontrol.cpp I changed the update part in the process_canvas function:

Qt Code:
  1. void MainControl::process_canvas()
  2. {
  3. QImage control_image(image_w,image_h,QImage::Format_RGB32);
  4. control_image.fill(set_pixel_value(0,0,0));
  5. int cy=0;
  6. int cx=0;
  7. while(cy<control_image.height())
  8. {
  9. while(cx<control_image.width())
  10. {
  11. if(cx%(10*SCALE)==0 || cy%(10*SCALE)==0)
  12. {
  13. control_image.setPixel(cx,cy,set_pixel_value(150,150,150));
  14. }
  15. cx++;
  16. }
  17. cx=0;
  18. cy++;
  19. }
  20. control_pixmap->convertFromImage(control_image.scaled(image_w,image_h));
  21. control_pixmap_item->setPixmap(*control_pixmap);
  22. control_view->update();
  23. }
To copy to clipboard, switch view to plain text mode