summaryrefslogtreecommitdiffstats
path: root/src/printsupport/dialogs/qprintdialog_unix.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/printsupport/dialogs/qprintdialog_unix.cpp')
-rw-r--r--src/printsupport/dialogs/qprintdialog_unix.cpp15
1 files changed, 11 insertions, 4 deletions
diff --git a/src/printsupport/dialogs/qprintdialog_unix.cpp b/src/printsupport/dialogs/qprintdialog_unix.cpp
index bf77666c41..a59d8bbb4a 100644
--- a/src/printsupport/dialogs/qprintdialog_unix.cpp
+++ b/src/printsupport/dialogs/qprintdialog_unix.cpp
@@ -67,6 +67,10 @@
#include <QtWidgets/qdialogbuttonbox.h>
+#if QT_CONFIG(regularexpression)
+#include <qregularexpression.h>
+#endif
+
#if QT_CONFIG(completer)
#include <private/qcompleter_p.h>
#endif
@@ -487,7 +491,7 @@ bool QPrintPropertiesDialog::createAdvancedOptionsWidget()
if (choicesCb->count() > 1) {
- connect(choicesCb, QOverload<int>::of(&QComboBox::currentIndexChanged), this, setPpdOptionFromCombo);
+ connect(choicesCb, &QComboBox::currentIndexChanged, this, setPpdOptionFromCombo);
// We need an extra label at the end to show the conflict warning
QWidget *choicesCbWithLabel = new QWidget();
@@ -1434,10 +1438,13 @@ QUnixPrintWidget::QUnixPrintWidget(QPrinter *printer, QWidget *parent)
if (printer->docName().isEmpty()) {
cur += QStringLiteral("print.pdf");
} else {
- const QRegExp re(QStringLiteral("(.*)\\.\\S+"));
- if (re.exactMatch(printer->docName()))
- cur += re.cap(1);
+#if QT_CONFIG(regularexpression)
+ const QRegularExpression re(QStringLiteral("(.*)\\.\\S+"));
+ auto match = re.match(printer->docName());
+ if (match.hasMatch())
+ cur += match.captured(1);
else
+#endif
cur += printer->docName();
cur += QStringLiteral(".pdf");
}