Write rich text into .odt file
-
@SGaist
Hello,
the project I am working on is something like this:
https://conclave-team.github.io/conclave-site/
The client and server send data with QTcpSockets. The server side does not have a GUI (it is on the client side, with a textEdit), the client sends each Symbol and the server keeps them in a QList.
Now, we would like to store this Symbols (that compose a rich text) in a local .odt file.
I think it is unconvenient to send the whole textEdit->document() at every change inside the client textEdit. -
@artwaw said in Write rich text into .odt file:
@Tamfub I'd still stick with internal representation as QTextEdit, you can edit it as the symbols flow in.
Agreed, establish a protocol to keep the documents in sync but there's no need to reinvent the wheel.
-
Ok, I have a distributed application and I must apply the CRDT algorithm to keep consistency in shared documents. Since more than one clients may work on the same document (like in Google Docs), how can I keep more than one textEdit graphical element on the server? Maybe I'm not getting it at all.
-
So you want to implement something like Google Docs ?
-
@Tamfub You edit QTextDocument using QTextCursor (it is mentioned in QTextDocument documentation btw.).
Also worth reading before you begin is Rich Text Editing overview page.It is a fair amount of reading but in my honest opinion - it is worth it.