C++ (Qt)Window::Window(){ view_ = new QWebView(this); setCentralWidget(view_); QPushButton *pb = new QPushButton("Print", this); connect(pb, SIGNAL(clicked()), this, SLOT(print())); view_->setHtml("<center><h1>PRINT</h1></center>"); } void Window::print(){ QPrinter *printer = new QPrinter(); printer->setResolution(QPrinter::HighResolution); printer->setFullPage(true); printer->setPageMargins(2.0, 10.0, 2.0, 10.0, QPrinter::Millimeter); QPrintDialog *dlg = new QPrintDialog(printer, this); dlg->setWindowTitle(tr("Print Document")); if (dlg->exec() == QDialog::Accepted) { view_->print(printer); } delete printer; delete dlg; }
C++ (Qt)class Window : public QMainWindow{ Q_OBJECT public: Window(); QWebView *view_; public slots: void print(); };
QtGuid4.dll!QFlags<enum QPaintEngine::PaintEngineFeature>::operator&(int mask=256) Line 1928 + 0x16 bytes C++QtGuid4.dll!QPaintEngine::hasFeature(QFlags<enum QPaintEngine::PaintEngineFeature> feature={...}) Line 219 + 0x21 bytes C++ QtWebKitd4.dll!WebCore::GraphicsContext::setCompositeOperation(WebCore::CompositeOperator op=CompositeCopy) Line 776 + 0x28 bytesC++ QtWebKitd4.dll!WebCore::RenderBox::paintBackgroundExtended(WebCore::GraphicsContext * context=0x0012bb98, const WebCore::Color & c={...}, const WebCore::BackgroundLayer * bgLayer=0x00d9449c, int clipY=0, int clipH=583, int tx=0, int ty=0, int w=992, int h=600, bool includeLeftEdge=true, bool includeRightEdge=true) Line 670C++ QtWebKitd4.dll!WebCore::RenderBox::paintBackground(WebCore::GraphicsContext * context=0x0012bb98, const WebCore::Color & c={...}, const WebCore::BackgroundLayer * bgLayer=0x00d9449c, int clipY=0, int clipH=583, int tx=0, int ty=0, int width=992, int height=600) Line 409C++ QtWebKitd4.dll!WebCore::RenderBox::paintBackgrounds(WebCore::GraphicsContext * context=0x0012bb98, const WebCore::Color & c={...}, const WebCore::BackgroundLayer * bgLayer=0x00d9449c, int clipY=0, int clipH=583, int tx=0, int ty=0, int width=992, int height=600) Line 403C++ QtWebKitd4.dll!WebCore::RenderBox::paintRootBoxDecorations(WebCore::RenderObject::PaintInfo & paintInfo={...}, int tx=0, int ty=0) Line 344C++ QtWebKitd4.dll!WebCore::RenderBox::paintBoxDecorations(WebCore::RenderObject::PaintInfo & paintInfo={...}, int tx=0, int ty=0) Line 355C++ QtWebKitd4.dll!WebCore::RenderBlock::paintObject(WebCore::RenderObject::PaintInfo & paintInfo={...}, int tx=0, int ty=0) Line 1554C++ QtWebKitd4.dll!WebCore::RenderBlock::paint(WebCore::RenderObject::PaintInfo & paintInfo={...}, int tx=0, int ty=0) Line 1401C++ QtWebKitd4.dll!WebCore::RenderLayer::paintLayer(WebCore::RenderLayer * rootLayer=0x00d934e4, WebCore::GraphicsContext * p=0x0012bb98, const WebCore::IntRect & paintDirtyRect={...}, bool haveTransparency=false, WebCore::PaintRestriction paintRestriction=PaintRestrictionNone, WebCore::RenderObject * paintingRoot=0x00000000) Line 1473C++ QtWebKitd4.dll!WebCore::RenderLayer::paintLayer(WebCore::RenderLayer * rootLayer=0x00d934e4, WebCore::GraphicsContext * p=0x0012bb98, const WebCore::IntRect & paintDirtyRect={...}, bool haveTransparency=false, WebCore::PaintRestriction paintRestriction=PaintRestrictionNone, WebCore::RenderObject * paintingRoot=0x00000000) Line 1525 + 0x25 bytesC++ QtWebKitd4.dll!WebCore::RenderLayer::paint(WebCore::GraphicsContext * p=0x0012bb98, const WebCore::IntRect & damageRect={...}, WebCore::PaintRestriction paintRestriction=PaintRestrictionNone, WebCore::RenderObject * paintingRoot=0x00000000) Line 1393C++ QtWebKitd4.dll!WebCore::Frame::paint(WebCore::GraphicsContext * p=0x0012bb98, const WebCore::IntRect & rect={...}) Line 1362C++ QtWebKitd4.dll!WebCore::PrintContext::spoolPage(WebCore::GraphicsContext & ctx={...}, int pageNumber=0, float width=793.00000) Line 128C++ QtWebKitd4.dll!QWebFrame::print(QPrinter * printer=0x00e234a8) Line 785C++ QtWebKitd4.dll!QWebView::print(QPrinter * printer=0x00e234a8) Line 570C++ PrintWebView.exe!Window::print() Line 32C++ PrintWebView.exe!Window::qt_metacall(QMetaObject::Call _c=InvokeMetaMethod, int _id=0, void * * _a=0x0012bd5c) Line 67C++ QtCored4.dll!QMetaObject::activate(QObject * sender=0x00d37168, int from_signal_index=29, int to_signal_index=30, void * * argv=0x0012bd5c) Line 3022 + 0x2b bytesC++ QtCored4.dll!QMetaObject::activate(QObject * sender=0x00d37168, const QMetaObject * m=0x65899d74, int from_local_signal_index=2, int to_local_signal_index=3, void * * argv=0x0012bd5c) Line 3112 + 0x15 bytesC++ QtGuid4.dll!QAbstractButton::clicked(bool _t1=false) Line 185 + 0x17 bytesC++ QtGuid4.dll!QAbstractButtonPrivate::emitClicked() Line 540C++ QtGuid4.dll!QAbstractButtonPrivate::click() Line 532C++ QtGuid4.dll!QAbstractButton::mouseReleaseEvent(QMouseEvent * e=0x0012c448) Line 1111C++ QtGuid4.dll!QWidget::event(QEvent * event=0x0012c448) Line 7164C++ QtGuid4.dll!QAbstractButton::event(QEvent * e=0x0012c448) Line 1073C++ QtGuid4.dll!QPushButton::event(QEvent * e=0x0012c448) Line 653C++ QtGuid4.dll!QApplicationPrivate::notify_helper(QObject * receiver=0x00d37168, QEvent * e=0x0012c448) Line 3803 + 0x11 bytesC++ QtGuid4.dll!QApplication::notify(QObject * receiver=0x00d37168, QEvent * e=0x0012c448) Line 3528 + 0x2f bytesC++ QtCored4.dll!QCoreApplication::notifyInternal(QObject * receiver=0x00d37168, QEvent * event=0x0012c448) Line 587 + 0x15 bytesC++ QtCored4.dll!QCoreApplication::sendSpontaneousEvent(QObject * receiver=0x00d37168, QEvent * event=0x0012c448) Line 212 + 0x38 bytesC++ QtGuid4.dll!QApplicationPrivate::sendMouseEvent(QWidget * receiver=0x00d37168, QMouseEvent * event=0x0012c448, QWidget * alienWidget=0x00d37168, QWidget * nativeWidget=0x0012feac, QWidget * * buttonDown=0x65a7c74c, QPointer<QWidget> & lastMouseReceiver={...}) Line 2793 + 0xe bytesC++ QtGuid4.dll!QETWidget::translateMouseEvent(const tagMSG & msg={...}) Line 3085 + 0x28 bytesC++ QtGuid4.dll!QtWndProc(HWND__ * hwnd=0x000e0c52, unsigned int message=514, unsigned int wParam=0, long lParam=1441861) Line 1543 + 0xc bytesC++ user32.dll!77d48709() [Frames below may be incorrect and/or missing, no symbols loaded for user32.dll] user32.dll!77d487eb() user32.dll!77d70494() user32.dll!77d489a5() user32.dll!77d70494() user32.dll!77d489e8() QtCored4.dll!QEventDispatcherWin32::processEvents(QFlags<enum QEventLoop::ProcessEventsFlag> flags={...}) Line 737 + 0x21 bytesC++ QtGuid4.dll!QGuiEventDispatcherWin32::processEvents(QFlags<enum QEventLoop::ProcessEventsFlag> flags={...}) Line 1084 + 0x15 bytesC++ QtCored4.dll!QEventLoop::processEvents(QFlags<enum QEventLoop::ProcessEventsFlag> flags={...}) Line 144C++ QtCored4.dll!QEventLoop::exec(QFlags<enum QEventLoop::ProcessEventsFlag> flags={...}) Line 194 + 0x1c bytesC++ QtCored4.dll!QCoreApplication::exec() Line 845 + 0x15 bytesC++ QtGuid4.dll!QApplication::exec() Line 3332C++ PrintWebView.exe!main(int argc=1, char * * argv=0x003f8ee0) Line 18 + 0xc bytesC++ PrintWebView.exe!WinMain(HINSTANCE__ * instance=0x00400000, HINSTANCE__ * prevInstance=0x00000000, char * __formal=0x00151f0e, int cmdShow=1) Line 134 + 0x12 bytesC++ PrintWebView.exe!__tmainCRTStartup() Line 578 + 0x35 bytesC PrintWebView.exe!WinMainCRTStartup() Line 403C kernel32.dll!7c816d4f() kernel32.dll!7c8399f3()
C++ (Qt)QPainter painter(printer);
C++ (Qt)QPainter painter(printer);if (!painter.isActive()) { printContext.end(); return;}