Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-2052

Be able to indicate page breaks inside a QTextTable so that tables are printed across tables splitting columns and rows

    XMLWordPrintable

Details

    Description

      Be able to indicate page breaks inside a QTextTable so that tables are printed across tables splitting columns and rows. Currently it tries to fit it all on the one page, as far as the columns are concerned.

      Test cases main.cpp that should demonstrate issue
      ===========================
      #include <QPrinter>
      #include <QApplication>
      #include <QTextDocument>
      #include <QTextTableCell>
      #include <QTextCursor>
      #include <QDebug>

      static void addTable(QTextCursor& cursor)
      {
      const int columns = 15;
      const int headerRows = 0;
      const int rows = 1;

      QTextTableFormat tableFormat;
      QTextTable* textTable = cursor.insertTable( rows + headerRows,
      columns,
      tableFormat );
      int row = 0;
      for( int column = 0; column < columns; column++ )

      { QTextTableCell cell = textTable->cellAt( row + headerRows, column ); Q_ASSERT( cell.isValid() ); QTextCursor cellCursor = cell.firstCursorPosition(); const QString cellText = QString("This is column number %1").arg(column); cellCursor.insertText( cellText ); }

      }

      int main(int argc, char *argv[])
      {
      QApplication app(argc, argv);

      QTextDocument textDocument;
      QTextCursor cursor(&textDocument);
      cursor.insertText("The table below has many many columns");

      addTable(cursor);

      QPrinter printer;
      printer.setOutputFileName("test.pdf");
      printer.setFullPage(true);

      textDocument.print(&printer);

      return 0;
      }

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            sletta Gunnar Sletta
            anshaw Andy Shaw (closed Nokia identity) (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes