QWebPage CUT and JS range problem
Using the bridge I created a namespace object with properties and methods. In this namespace I have an array where I store range clones. Supposedly these clones are not affected by a window selection or its range but when I execute the following line of (C++) code:
I find that my cloned range offsets are changed. This is causing me some serious headaches and I'm looking for any advice on how to further isolate this problem.
NOTE: I tried the following two methods to clone a range
- @var setRange = range.cloneRange()@
- @var setRange=document.createRange();
Both methods are messed up by Qt's cut action.
FYI: Apparently one cannot depend on cloning a range and saving it but I found a cumbersome but effective solution. What I did was save the start and end nodes and their offsets separately. Then when I needed a saved range equivalent I used createRange() to form a temporary range object as needed.