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

Error printer from QWebView

    XMLWordPrintable

Details

    • Bug
    • Resolution: Duplicate
    • P3: Somewhat important
    • None
    • 5.0.1, 5.0.2, 5.1.0 RC1
    • GUI: Printing, WebKit
    • None
    • windows 7 64bit
      windows XP 32bit

    Description

      When printing pages with both QWebView, as QwebFrame
      errors occur that affect the elements (elements "DOM") "inline" (display: inline, eg. text and images).

      Source-example:
      QPrinter p;
      p.setPaperSize(QPrinter::A4);
      p.setFullPage(true);
      p.setResolution(300);
      p.setOrientation(QPrinter::Portrait);

      QPrintPreviewDialog preview(&p);
      connect(&preview, SIGNAL(paintRequested(QPrinter*)), this, SLOT(printPreview(QPrinter*)));
      preview.exec();

      ...

      void printPreview(QPrinter *printer)

      { ui->myWebView->print(printer);//teste 1 //ui->ci_web_view->page()->mainFrame()->print(p); //test 2 }

      ------------------
      Source-example 2:

      QPrintPreviewDialog preview(this);//this is mainWindow
      connect(&preview, SIGNAL(paintRequested(QPrinter*)), this, SLOT(printPreview(QPrinter*)));
      preview.exec();

      ...

      void printPreview(QPrinter *printer)

      { printer->setPaperSize(QPagedPaintDevice::A4); printer->setFullPage(true); printer->setResolution(300); printer->setOrientation(QPrinter::Portrait); ui->myWebView->print(printer);//teste 1 //ui->ci_web_view->page()->mainFrame()->print(p); //test 2 }

      HTML example:
      <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
      <html>
      <head>
      <meta http-equiv="content-type" content="text/html;charset=iso-8859-1">
      <meta name="robots" content="noindex,nofollow">
      <meta name="Googlebot" content="noindex,nofollow">
      <title>test</title>
      <style>
      *{
      margin:0;padding:0;
      }
      #body{
      padding:10px 0;
      }
      #plain{
      width:99%;
      border:1px #000 solid;
      }
      #plain th{
      background:#2a388d;
      color:#fff;
      padding:5px 0;
      }
      #plain td{
      background:#bcbcbc;
      padding:2px;
      }
      </style>
      </head>
      <body>
      <div id="body">
      <table id="plain">
      <thead>
      <tr>
      <th>id</th>
      <th>in</th>
      <th>out</th>
      <th>Final</th>
      </tr>
      </thead>
      <tbody>
      ...repeat trs...
      <tr>
      <td>0.00</td>
      <td>0.00</td>
      <td>0.00</td>
      <td>0.00</td>
      </tr>
      ...repeat trs...
      </tbody>
      </table>
      </div>
      </body>
      </html>

      Attachments

        1. TXCp8.png
          34 kB
          Guilherme Nascimento
        2. Y9dOc.png
          33 kB
          Guilherme Nascimento

        Issue Links

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

          Activity

            People

              mibrunin Michael Bruning
              brcontainer Guilherme Nascimento
              Votes:
              2 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes