Пример #1
0
void WebView::printPage(QWebFrame* frame)
{
    QPrintPreviewDialog* dialog = new QPrintPreviewDialog(this);
    dialog->resize(800, 750);

    if (!frame) {
        connect(dialog, SIGNAL(paintRequested(QPrinter*)), this, SLOT(print(QPrinter*)));
    }
Пример #2
0
void tab::printPage(QWebFrame *frame)
{
    QPrintPreviewDialog *dialog = new QPrintPreviewDialog(this);
    dialog->resize(800, 600);

    connect(dialog, SIGNAL(paintRequested(QPrinter*)), frame, SLOT(print(QPrinter*)));

    dialog->exec();
    dialog->deleteLater();
}