Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Print QWebEngineView
Forum Updated to NodeBB v4.3 + New Features

Print QWebEngineView

Scheduled Pinned Locked Moved Unsolved General and Desktop
1 Posts 1 Posters 228 Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • F Offline
    F Offline
    fender
    wrote on last edited by
    #1

    good day
    I implement printing in my program, it is necessary to capture the current window and print
    If the program is deployed, then all the text on the tab is printed completely, but if you reduce the program window until the scroll appears, part of the text is not displayed on the printed sheet.

    Is there a solution for my problem?
    thanks

        m_WebEngineView = new QWebEngineView(ui->tabReport);
        QVBoxLayout* layout = static_cast<QVBoxLayout*>(ui->tabReport->layout());
        layout->insertWidget(0,m_WebEngineView);
    
    void MainWindow::on_act_print_triggered()
        {
        QPrinter printer(QPrinter::ScreenResolution);
        printer.setOrientation(QPrinter::Landscape);
        QPrintPreviewDialog preview(&printer, this);
        QPrintDialog *dlg = new QPrintDialog(&printer, this);
        if (m_WebEngineView->hasSelection())
        dlg->addEnabledOption(QAbstractPrintDialog::PrintSelection);
        dlg->setWindowTitle(tr("Print Document"));
        if (dlg->exec() == QDialog::Accepted)
        ui->tabReport->render(&printer);
        delete dlg;
        }
    1 Reply Last reply
    0

    • Login

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Get Qt Extensions
    • Unsolved