diff options
author | Allan Sandfeld Jensen <allan.jensen@qt.io> | 2021-06-08 09:55:32 +0200 |
---|---|---|
committer | Allan Sandfeld Jensen <allan.jensen@qt.io> | 2021-06-11 08:57:42 +0200 |
commit | 4338bcbacf467c0d0d7aec36fbd186ca6b9e02f6 (patch) | |
tree | 771710cde151bc02773c419e67a2113fd9f75a93 /examples/webenginewidgets | |
parent | e69d7cf9cab6ac83d7009d5574cfe43f292271ad (diff) |
Move printing finished callback to signal
We can only have one printer active at a time anyway.
At the same time restore some lost documentation.
Pick-to: 6.2
Task-number: QTBUG-63235
Change-Id: I454ef3fb038712c832e73c661120fbbe77b3a90c
Reviewed-by: Peter Varga <pvarga@inf.u-szeged.hu>
Diffstat (limited to 'examples/webenginewidgets')
-rw-r--r-- | examples/webenginewidgets/printme/printhandler.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/examples/webenginewidgets/printme/printhandler.cpp b/examples/webenginewidgets/printme/printhandler.cpp index 58114a610..200f2f302 100644 --- a/examples/webenginewidgets/printme/printhandler.cpp +++ b/examples/webenginewidgets/printme/printhandler.cpp @@ -82,8 +82,8 @@ void PrintHandler::printDocument(QPrinter *printer) { QEventLoop loop; bool result; - auto printPreview = [&](bool success) { result = success; loop.quit(); }; - m_view->print(printer, std::move(printPreview)); + connect(m_view, &QWebEngineView::printFinished, [&](bool success) { result = success; loop.quit(); }); + m_view->print(printer); loop.exec(); if (!result) { QPainter painter; |