[Development] Probably too late, but re: rich text and Qt 5

Stephen Kelly stephen.kelly at kdab.com
Fri Dec 23 14:07:52 CET 2011


On Friday, December 23, 2011 10:13:43 Ian Walters wrote:
> Hi,
> 
> This post is probably too late.  It was attempted via various paths as early
> as October but I somehow missed or forgot that the dev list was public and
> the people I did contact didn't point me this way until recently.
> 
> I'm not sure how many people have heard of Scrivener.  I'm sure though that
> a quick search should help find enough information on Scrivener for Windows
> for those that are interested.  The bottom line is its pushed the rich text
> component of Qt 4, hard.  We have been in the position of changing Qt
> (under commercial) for most of the project.
> 
> The biggest help would be to untie QTextLayout from QTextDocumentLayout, and
> update the API of QTextLayout to be easier to subclass.  To this end the
> minimum I'd like to help see done in Qt 5.0 is better encapsulation. Some
> specific actions towards this would be:
> 
> QTextDocumentLayout in a public header and exported
> QTextFrameLayout in a public header and exported

Are you sure this would need to be in 5.0.0?

> QTextLayout handling its own line layout (rather than having this code in
> QTextDocumentLayout).  Search for uses of beginLayout some API changes to
> QTextLayout
> QTextLayout API changes to encourage subclassing (e.g. virtual draw, draw
> cursor, and 'block layout' functions)
> 
> and a factory approach where there is a function you can override in
> QTextDocumentLayout that creates QTextFrameLayouts, and in turn a factory
> function in QTextFrameLayout that creates QTextLayouts. 

<snip>

> In the not done but plan to do list.
> 
> - non root frames in QTextDocument (e.g. for footers, headers, word style
> annotations)
> 
> - QTextLines to be positioned only in terms of QTextLayouts.  These in turn
> will keep track of their own clip region.  Rather than shifting each line
> if a paragraph moves down, just the layout will be shifted.  Lines only
> affected if the clip shape of the paragraph changes.
> 
> - QTextLayout to QObject.  This is so we get Q_PROPERTY and start being able
> to enable animation hooks.
> 
> 
> So, once again sorry for not posting this to dev earlier, and sorry if its
> too late in the process for this to matter.  In practical terms I can only
> do minor work and advice on the above until mid-January, which may further
> hinder the ability of any of this to make it into Qt 5.

It is late in the cycle to be rewriting so much of QTextDocument, but I would 
suggest that you focus on implementing the minimum that will allow extension 
after 5.0.0 in the future in a BC way. Please list that minimum here:

https://wiki.qt-project.org/5.0_Feature_Targets

Anything that can go into 5.1 or later shouldn't be on that page (yes, there's 
a few already. I'll clear those up).

Thanks, 

-- 
Stephen Kelly <stephen.kelly at kdab.com> | Software Engineer
KDAB (Deutschland) GmbH & Co.KG, a KDAB Group Company
www.kdab.com || Germany +49-30-521325470 || Sweden (HQ) +46-563-540090
KDAB - Qt Experts - Platform-Independent Software Solutions
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/development/attachments/20111223/ab13818d/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 198 bytes
Desc: This is a digitally signed message part.
URL: <http://lists.qt-project.org/pipermail/development/attachments/20111223/ab13818d/attachment.sig>


More information about the Development mailing list