Yes, your code in comment #7 has the line as a pointer, that is fine.

But instead of modifying that line, you are modifying an object return by one of its getters, an object that is discarded immediately afterwards (it is a temporary object).

You write
Qt Code:
  1. line->line().setP1(mCenter);
To copy to clipboard, switch view to plain text mode 
which is equivalent to
Qt Code:
  1. QLineF a = line->line();
  2. a.setP1(mCenter);
To copy to clipboard, switch view to plain text mode 
How do you expect "line" to move when you are not changing its values?

You need to change the data your "line" has access to, not some copy of that data.

Cheers,
_