replaced a function by another function that does the same job in this case but works in Qt < 5.11 too