borges
9th January 2007, 10:38
Hello all,
I'm new to Qt and trying to build a simple text editor with support to inline images using QTextEdit.
I am using toHtml and setHtml to load and save text content, but i also need to save images (ideally together with text, for example in a zipped file). I looked in Qt API, but it doesn't seem to be a method to access image data contained in a document.
My idea is to save image content in a data structure (maybe a QHash) when user inserts a new image using the corresponding dialog and then using this data when saving the document. But what if an image gets inserted and then removed using backspace? Should I scan the entire document to see if some image has been removed, just before saving?
Is there a better way of doing this?
Thanks in advance,
Flavio
I'm new to Qt and trying to build a simple text editor with support to inline images using QTextEdit.
I am using toHtml and setHtml to load and save text content, but i also need to save images (ideally together with text, for example in a zipped file). I looked in Qt API, but it doesn't seem to be a method to access image data contained in a document.
My idea is to save image content in a data structure (maybe a QHash) when user inserts a new image using the corresponding dialog and then using this data when saving the document. But what if an image gets inserted and then removed using backspace? Should I scan the entire document to see if some image has been removed, just before saving?
Is there a better way of doing this?
Thanks in advance,
Flavio