Results 1 to 6 of 6

Thread: Page based rich text editor

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

    Default Page based rich text editor

    Hi there,

    I'm currently writing a small editor application. Now I want to build an page based editor (like OO Writer, MS Word...). Is there a possibility doing that in Qt, even with rich text? The QPrintPreviewWidget can display rich text like that, but content displayed there is of course not editable.

    I'm using Qt 4.7.

    I'll hope that someone has an idea for that.

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

    There's a Rich Text section in Qt examples,take a look at it...

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

    Default Re: Page based rich text editor

    Hi,

    thanks for the reply. Of course, rich text editing in Qt is no problem. The problem is, that it must be page based.

    Any ideas?

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

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

  6. #6
    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, 09:05
  2. QTextEdit + paste rich text as plain text only
    By Yong in forum Qt Programming
    Replies: 2
    Last Post: 6th February 2008, 17:45
  3. Replies: 3
    Last Post: 13th December 2007, 17:10
  4. Qt based HTML editor.
    By William Wilson in forum Qt Programming
    Replies: 5
    Last Post: 12th August 2007, 19: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
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.