
Originally Posted by
NoobSaibot
3. i didn't make up my mind yet how to do that. i'll tinker with that a bit.
I think the context menu will do. Just add one. A "change width" action would popup an input dialog asking for a width (in pixel most probably) which would be set using setFixedWidth() just like you do in the ctor already.

Originally Posted by
NoobSaibot
further more, i'd like to have syntax highlightning and a magnifier in the panel. i hoped you'll do the syntax highlightning stuff

QDocumentLineHandle::draw()
QDocumentLineHandle::draw()
To copy to clipboard, switch view to plain text mode
will do what you want provided that you fed it with proper parameters. It is part of the private API and thus requires including qdocument_p.h You can find out more about how to use it by reading the code of QDocumentPrivate::draw() in qdocument.cpp
AFAIK all you'd have to do would be to scale and translate the painter properly to achieve the minimap effect with highlighting.

Originally Posted by
NoobSaibot
btw, how to get the linespacing used in the editor?
QDocument::fontMetrics()
QDocument::fontMetrics()
To copy to clipboard, switch view to plain text mode
is a static function which returns a QFontMetrics object initialized with the global font currently used. It should give you all the needed document metrics, including line spacing.
Bookmarks