On Thu, Aug 16, 2007 at 12:38:28AM +0200, Alfredo Braunstein wrote: > Bo Peng wrote: > > >> > qt422, I am trying 4.1. > >> > >> qt-4.2.3 here. > > > > Qt 4.1 does not work here. Please try 4.1 (the version lyx uses) if > > possible. > > Assuming the problem is the qt version, for me installing qt 4.1 is a real > PITA, and I would like to avoid it if possible. > > So if someone with qt4.1 and good will could look at lines 69-73 of > src/frontends/qt4/QViewSource.cpp and make them behave (that is, make them > select rows beg..end in the source view panel) I would be very grateful. > > QTextCursor c = QTextCursor(viewSourceTV->document()); > c.movePosition(QTextCursor::NextBlock, QTextCursor::MoveAnchor, > beg); > c.select(QTextCursor::BlockUnderCursor); > c.movePosition(QTextCursor::NextBlock, QTextCursor::KeepAnchor, > end - beg + 1); > viewSourceTV->setTextCursor(c); > > Thanks in advance,
I don't know what exactly does not work. I am testing it with Qt 4.1.5 on cygwin. After opening the View Source window, when I position the cursor, the corresponding line in the in View Source is highlighted. It also works when I move the cursor using the keyboard. The only glitch that I can see, is that when the cursor is at a position corresponding to the boundary between two successive lines in View Source, then both the actual and the next line are highlighted. But moving the cursor to the left by a position, the previous line is unhighlighted and only the now actual one remains highlighted. So, seems that it is working ok with 4.1.5, mentioned glitch apart. Rather, there's a problem with Qt 4.3. The line in the View Source window is highlighted only when clicking on the View Source scroll bar. However, when doing so, the cursor in the main window disappears, such that you visually lose the position associated to the highlighted line. -- Enrico