qtextdocument

Customize page number when printing a QTextDocument

Hi, I'm trying to print the content of a QTextEdit. For that I'm using QTextDocument::print(QPrinter*). Doing that, a page number is automatically added at the right bottom of the page. Is there any way to change its format / move it / get rid of it? Thanks. ...

How to create the new QTextDocument from existing widgets???

Hi, I'm absolutely confused with how to create the customized QTextDocument. I have the widget QWidget, which consists of some QLabels, QTableWidgets and QWidgets and I want to print it . I decided to create the new QTextDocument and insert in it all the defined widgets. I have already tried QTextCursor->insertBlock and insertText but...

Table and Image in a single page of QTextDocument in Qt4

Hi, I want to display a table and a image side by side. i.e Left side the image and right side the table. I want this because the image is the reference image for the data present in the table. I want that output in pdf. So I am using QTextDocument, QTextCursor and QPrinter to get the output in pdf. So how it is possible to display the i...

QTextDocument eats multiple whitespaces

There is a Qt/C++ code: #include <QtCore/QCoreApplication> #include <QtGui/QTextDocument> #include <QByteArray> #include <QDebug> int main(int argc, char *argv[]) { QCoreApplication a(argc, argv); QTextDocument *doc = new QTextDocument(); qDebug() << " === Document was: === "; qDebug() << doc->toHtml(QByteArray()); ...

How do I indent/un-indent a QTextDocument?

What is the preferred way to indent/un-indent text in a list within a QTextDocument? Do I basically have to pass in the corresponding HTML tags myself? Edit: I'm looking for a way for the user to change the indentation level of a bulleted list with the Tab key. ...

How can I access the QUndoStack of a QTextDocument?

How can I access the QUndoStack of a QTextDocument? (For example, I want to be able to add custom QUndoCommand objects to the document's undo stack) ...

How do I determine the height of a QTextDocument?

Given a specific width, I want to find out the height of a QTextDocument. In other words, if the QTextEdit that contains the QTextDocument is w wide, what is its minimum height h in order to fully display the document without the need for scrollbars? ...

Qt4.6: QTextDocument <HR> tag prints only very thin, almost invisible hair lines

When printing a QTextDocument with doc->print() I almost cannot see the horizontal rules inserted by <hr>. When printing to PDF these are clearly visible. But when printed to a printer these lines are very very thin lines, almost invisible on the paper. How do I fix this? I currently helped myself by inserting an <img> with a black pixe...

Populate a QTextDocument from a .odt file

Hi, I am writing a rich text editor using C++ and Qt. For now, I would like it to support (at least) the .odt format. I found QTextDocumentWriter for writing the contents of the QTextDocument to a file, but I can't seem to find anything to read that back into the QTextDocument, which obviously makes saving it sort of useless in the firs...