Results 1 to 6 of 6

Thread: Page based rich text editor

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Dec 2010
    Location
    Russia
    Posts
    83
    Thanks
    1
    Thanked 12 Times in 11 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Page based rich text editor

    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

  2. #2
    Join Date
    Mar 2011
    Posts
    6
    Qt products
    Qt4
    Platforms
    Unix/X11 Symbian S60

    Default Re: Page based rich text editor

    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.

  3. #3
    Join Date
    Nov 2011
    Location
    Oulu, Finland
    Posts
    6
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Page based rich text editor

    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...

Similar Threads

  1. Replies: 0
    Last Post: 27th August 2010, 08:05
  2. QTextEdit + paste rich text as plain text only
    By Yong in forum Qt Programming
    Replies: 2
    Last Post: 6th February 2008, 16:45
  3. Replies: 3
    Last Post: 13th December 2007, 16:10
  4. Qt based HTML editor.
    By William Wilson in forum Qt Programming
    Replies: 5
    Last Post: 12th August 2007, 18:58

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Qt is a trademark of The Qt Company.