So far good, but where are you allocating the object, that is only thing missing.

Here is a generic example
Qt Code:
  1. template <typename T>
  2. T *** New2DArray(int rows, int cols)
  3. {
  4. T *** array = new T**[rows];
  5.  
  6. for(int r = 0; r < rows; ++r)
  7. {
  8. array[r] = new T*[cols];
  9.  
  10. for(int c = 0; c < cols; ++c)
  11. array[r][c] = new T;
  12. }
  13.  
  14. return array;
  15. }
  16.  
  17. template <typename T>
  18. void Delete2DArray(T *** array, int rows, int cols)
  19. {
  20. for(int r = 0; r < rows; ++r)
  21. {
  22. for(int c = 0; c < cols; ++c)
  23. delete array[r][c];
  24.  
  25. delete[] array[r];
  26. }
  27.  
  28. delete[] array;
  29. }
  30.  
  31. ...
  32. QGraphicsRectItem *** objRect = New2DArray<QGraphicsRectItem>(rows, cols);
  33. ...
  34. Delete2DArray(array, rows, cols);
  35. ...
To copy to clipboard, switch view to plain text mode