Also add a test case and Remove some dead code along the way. Task-number: QDS-2071 Change-Id: If34d4e152860ec9ab098f07e36e3a5dc4368c67f Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>