Hello Jean-Marc, > > You can use setTargetX() to force a recomputation. Does this work? > > > > Sorry that did not work. > > I am using this within drawparagraph() of TextMetrics. As setTargetX() is > not a const method, I cannot call it as cur.setTargetX(). So I defined > another non- cnstant cursor called 'cr'.and setTargetX(). > Before I call the setTagetX I tried printing x_target() (which will return > targetX or -1 if unset). Here I got -1 when I am in the Math and the value > same as targetX() when I am within the text. (Actually what I hoped to get > is a result which is totally upside down) But as I mentioned, that value did > not change when I go right or left in that same text row. > > Then I called cr.setTargetX() and againg tried printing x_target() values. > There I did not get any -1 for any case. The value I got was exactly like > the value from targetX(). But here also nothing changed when moving to and > fro in a text row. > > So the problem did not solve. Am I doing anything wrong? > > And as I figured out, the comment for int targetX() const; in > Cursor.h file > is wrong. It says "in pixels from left of screen, set to current position if > unset", but it really does not set to current position if unset.
I think I figured out some clue. When the cursor is in a Math inset and when I move the cursor using "ARROW KEYS", no change happens. But when I use the "MOUSE" for select a different position in the same row, the value targetX() gets change. What is the missing thing for key board events, other than the mouse events, regarding this? Thanks Hashini