I guess you can try to calculate the amount of text per page and once it's exceeded , create a new instance of a page and textEditor (that will use the page's layout ).Although it's just my suggestion , and too abstract![]()
I guess you can try to calculate the amount of text per page and once it's exceeded , create a new instance of a page and textEditor (that will use the page's layout ).Although it's just my suggestion , and too abstract![]()
Hi,
well, yes, that was also my plan. But there are a lot of problems: There is no possibility to get the height of a QTextBlock. There is no possibility to get the HTML for the QTextBlock. And there is no real possibility to remove or add them.
If someone has a solution for one of theese problems, it would help a lot.
Hi, I am interested exactly from the same thing. I have been writing an editor and I would like to implement OpenOffice-like "contiguous view". The text is stored in separate QStrings, and they are organized as a tree. I have planned to create a scrollable area, place vertical box layout on it, go through the tree and create QLineEdit & QTextEdit objects to layout. Quite simple this far? But the problems have arised from:
- How to make text edit box to take as much vertical space as needed to show the contents? I have used fixed size, but then, when you edit, the box does not shrink/grow. Is there any other ways to do this than connect a bunch of signals to some sort of resize routine to calculate new height for the element?
- Getting the edit components and scrollable area to work together: for example, when cursor goes out of visible area, make the scrollable area to scroll it visible again (like OO and similar do).
- Moving between components (pg up/dn, cursor keys)
I have thought an alternative, using just one single textedit box, and adding some hidden (and non-destructible) fields to content to tell where to find the corresponding QString to save the result. Would it be possible/easier?
Anyways, I probably have lots of problems to keep the editor boxes and tree itself synchronized together, when user edits, moves and deletes parts of the text...
Bookmarks