[PyQt] QTextEdit, QTextCursor: make 0-len QTextBlocks invisible, custom visible cursor ?

Denis denis-bz-py at t-online.de
Thu Feb 26 18:24:34 GMT 2009

  can anyone help on these 2 problems, either in PyQt or Qt C --

1) custom visible cursor in a QTextEdit, hilite a line or several lines;
  mouse click / 2click / 3click ->
  both the usual mac cursor hiliting, blue char / word / line
  AND whatever signal cursorPosChanged triggers

2) there are extra 0-len QTextBlocks between QTextFrames,
as the picture in .../richtext-cursor.html makes clear.  
Setting these invisible (setVisible(0)) doesn't work,
I still see empty lines; anyone have a workaround ?

My versions: qt-mac-opensource-src-4.4.3 PyQt-mac-gpl-4.4.4

(What I want to do is select, hilite, delete multi-line "Rec"s:
   Line = QTextBlock -- wrap or chop each Line
   Rec = [ Line ... ]  -- a QTextFrame
   Doc = [ Rec ... ] 
   addRec( [ str ... ])
   shift mouse click -> select, hilite a multi-line Rec
   deletekey -> delete it

An example of a tiny but real editor built on QTextEdit, using QTextCursor
(richtextlineedit.py doesn't) would *really* help.

  -- denis

More information about the PyQt mailing list