Hi !
I am developing a custom QGraphicsTextItem with simple text editor functions like bold,italic, underline font support.
I create a standard toolbar that modify (and merge if necessary) the QTextCharFormat of the document returned from the QGraphicsTextItem and I want to sync the checked buttons (bold, italic, underline) with the current cursor position.
In QTextEdit widgets there is a signal very useful to accomplish this task (cursorPositionChanged) that is emitted whenever the position of the cursor changed.
Using a QGraphicsTextItem I have access only to a QTextDocument that have a similar signal (with the same name: cursorPositionChanged) that is emitted whenever the position of a cursor changed due to an editing operation.
In the documentation is written: "If you need a signal when the cursor is moved with the arrow keys you can use the cursorPositionChanged() signal in QTextEdit."
In this particular case I cannot use this kind of signal, there is another way to perform the same task in a QGraphicsTextItem (check the current text char format) ?
Thanks in advance,
Angelo
Bookmarks