Commit fe2aaa30 authored by Michael Winkelmann's avatar Michael Winkelmann

Error handling for printPdf

parent 59e57fea
Pipeline #1167 failed with stages
......@@ -23,6 +23,10 @@ void QmlPrinter::changePrinterOrientation(QPrinter &printer, const int &width,
}
bool QmlPrinter::printPdf(const QString &location, QQuickItem *presentation) {
if (!presentation) {
return false;
}
QVector<QQuickItem *> slides, masterSlideElements;
presentation->setProperty(
"allowDelay",
......@@ -38,6 +42,7 @@ bool QmlPrinter::printPdf(const QString &location, QQuickItem *presentation) {
}
if (slides.length() == 0) {
qCWarning(lc) << QObject::tr("No pages in %1, no PDF produced!").arg(location);
return false;
}
......@@ -141,6 +146,7 @@ void QmlPrinter::paintItem(QQuickItem *item, QQuickWindow *window,
drawChildren = false;
}
}
if (drawChildren) {
auto items = item->childItems();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment