Brush up the graphgallery example


- Basic C++ polishing:
  - Use nullptr
  - Use initializer lists
  - Replace typedef by using
  - Port to qsizetype
  - Default functions
  - Fix up copy constructor and assignent

- Instantiate the main widget, BarGraph and ScatterGraph on the stack
  for proper clean up

Amends 00272ac80843d94217e4f1ea36392e22919afa22.

Pick-to: 6.5
Task-number: QTBUG-110698
Change-Id: Ibb9e3ecf5e20ebaaeac2483c768d7b5eb00c0558
Reviewed-by: Tomi Korpipää <tomi.korpipaa@qt.io>
commit5f98f32634dc49feaed12d4798838e2da9f28194
parent279ed99a5f1fe06c250cec197609e819ea28a38f
authorFriedemann Kleint <Friedemann.Kleint@qt.io>
committerFriedemann Kleint <Friedemann.Kleint@qt.io>
commit timeTue, 28 Feb 2023 08:46:01 +0100