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*))); }
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(); }