mirror of
https://github.com/xiaoyifang/goldendict-ng.git
synced 2024-11-27 23:34:06 +00:00
fix: print preview does not work
This commit is contained in:
parent
c035cdc4ae
commit
de0815f45d
|
@ -1682,7 +1682,15 @@ Config::InputPhrase ArticleView::getPhrase() const
|
|||
|
||||
void ArticleView::print( QPrinter * printer ) const
|
||||
{
|
||||
ui.definition->page()->print(printer, [](bool result) {});
|
||||
//ui.definition->page()->print(printer, [](bool result) {});
|
||||
QEventLoop loop;
|
||||
bool result;
|
||||
auto printPreview = [&](bool success) { result = success; loop.quit(); };
|
||||
ui.definition->page()->print(printer, std::move(printPreview));
|
||||
loop.exec();
|
||||
if (!result) {
|
||||
qDebug()<<"print failed";
|
||||
}
|
||||
}
|
||||
|
||||
void ArticleView::contextMenuRequested( QPoint const & pos )
|
||||
|
|
Loading…
Reference in a new issue