Document Appending
-
how can i append or overload two html document (one contains the image and another contains text and image ) to a single document using
QTextDocumentWriter// FORMAT HTML
@ QTextDocumentWriter writer("./XXXXXXX.html");
@ writer.setFormat("html");
@ //writer.
@---- writer.write(doc);
@ writer.write(doc1);its not working only the doc1 is wrote because i mention it in the last if i mention doc then the doc is wrote in the html file
-
-
@
QString ltext ="<img />";
QTextDocumentFragment fragment = QTextDocumentFragment::fromHtml(ltext);
cursor.insertFragment(fragment);
@but the next string comes under the base line of the image
i need Image in the corner if the html and the title ( Heading) is in the same line and aligned center like our qt html page (logo of qt ) and the Developer Network string in the same line ( no in the base of the logo-image )
[Edit: Added @ tags; mlong]
-
This code snippet inserts an empty image (what is the point of that?) at the specified cursor position. It doesn't attempt to insert text anywhere.
We cannot read your mind and have no idea what you mean unless you tell us. You asked to append one HTML document onto another but now it seems you want some magic definition of 'append' that you describe in terms of some assumed knowledge of a document and requirement that we clearly do not have.
If you are going to persist using HTML to build up a description of a page then I suggest you learn some HTML/CSS first. If you want an image (or paragraph) to float to the left/right out of the natural top-to-bottom flow of a page then your HTML/CSS needs to say so. There's plenty of information in the Qt documentation on "Rich Text processing" and the "Supported HTML Subset" but it is not an HTML/CSS tutorial.
-
I suggest you have a look at these links: "HTML":http://www.w3schools.com/html/default.asp "CSS":http://www.w3schools.com/cssref/default.asp
QTextCursor is least suited for HTML layout tasks.