Actually it's the same behaviour as explained in the link in my first post.
So let's say this is my code:
Qt Code:
  1. QSvgGenerator generator;
  2. generator.setFileName(file);
  3. generator.setSize(QSize(200, 200));
  4. generator.setViewBox(QRect(0, 0, 200, 200));
  5. generator.setResolution(25.4);//setting the resolution
  6.  
  7. QPainter painter;
  8.  
  9. painter.begin(&generator);
  10. painter.drawRect(10,10,100,100);
  11. painter.end();
To copy to clipboard, switch view to plain text mode 

What I get is:
#without setting resolution I get (first lines of the svg file):
Qt Code:
  1. <?xml version="1.0" encoding="UTF-8" standalone="no"?>
  2. <svg width="70.5556mm" height="70.5556mm"
  3. viewBox="0 0 200 200"
To copy to clipboard, switch view to plain text mode 

#when setting resolution to 25.4 I get (first lines of the svg file):
Qt Code:
  1. <?xml version="1.0" encoding="UTF-8" standalone="no"?>
  2. <svg width="203.2mm" height="203.2mm"
  3. viewBox="0 0 200 200"
To copy to clipboard, switch view to plain text mode 

what I would like to get:
Qt Code:
  1. <?xml version="1.0" encoding="UTF-8" standalone="no"?>
  2. <svg width="200mm" height="200mm"
  3. viewBox="0 0 200 200"
To copy to clipboard, switch view to plain text mode 

As I define the size as 200,200 I would also like to get a 200mm,200mm drawing (so my rectangle has the correct size of 100mm,100mm).