diff --git a/app/app.pri b/app/app.pri index 545eab4..c5d2340 100644 --- a/app/app.pri +++ b/app/app.pri @@ -5,6 +5,7 @@ VERSION = $${APPVERSION} LANGUAGE = C++ CONFIG += qt warn_on thread QT += core gui widgets +greaterThan(QT_MAJOR_VERSION, 5): QT += core5compat DEFINES += QT_STL QT_NO_CAST_FROM_ASCII QT_NO_CAST_TO_ASCII QT_NO_CAST_FROM_BYTEARRAY QT_STRICT_ITERATORS QT_NO_URL_CAST_FROM_STRING QT_NO_KEYWORDS #DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0x050200 diff --git a/app/configeditorwidget.cpp b/app/configeditorwidget.cpp index db88b22..a8a75c4 100644 --- a/app/configeditorwidget.cpp +++ b/app/configeditorwidget.cpp @@ -22,7 +22,7 @@ #include "configeditorwidget.h" #include -#include +#include #include #include "../common/utils/fontdialog.h" diff --git a/app/editreplacecurrentwidget.cpp b/app/editreplacecurrentwidget.cpp index 3786514..ab76d7d 100644 --- a/app/editreplacecurrentwidget.cpp +++ b/app/editreplacecurrentwidget.cpp @@ -43,7 +43,7 @@ ReplaceCurrentWidget::ReplaceCurrentWidget(QWidget *parent) : QWidget(parent) buttonsLayout->addWidget(dontReplaceButton); buttonsLayout->addWidget(cancelButton); buttonsLayout->addStretch(); - buttonsLayout->setMargin(0); + buttonsLayout->setContentsMargins(0, 0, 0, 0); buttonsWidget->setLayout(buttonsLayout); mainLayout->addWidget(m_replaceLabel); mainLayout->addWidget(buttonsWidget); diff --git a/app/linenumberwidget.cpp b/app/linenumberwidget.cpp index 72712ca..1f5037b 100644 --- a/app/linenumberwidget.cpp +++ b/app/linenumberwidget.cpp @@ -99,8 +99,8 @@ void LineNumberWidget::paintEvent(QPaintEvent *event) void LineNumberWidget::mousePressEvent(QMouseEvent *event) { event->accept(); - const QPoint p = m_editor->viewport()->mapFromGlobal(event->globalPos()); - const int lineNumber = m_editor->cursorForPosition(p).blockNumber() + 1; + const QPointF p = m_editor->viewport()->mapFromGlobal(event->globalPosition()); + const int lineNumber = m_editor->cursorForPosition(p.toPoint()).blockNumber() + 1; if (lineNumber <= 0) return; diff --git a/app/loghighlighter.cpp b/app/loghighlighter.cpp index a9b9dc6..e085c54 100644 --- a/app/loghighlighter.cpp +++ b/app/loghighlighter.cpp @@ -38,7 +38,7 @@ LogHighlighter::LogHighlighter(QTextDocument *parent) : QSyntaxHighlighter(paren // TikzPreviewGenerator::getParsedLogText() << tr("This program will not work!"); for (const auto &pattern : keywordPatterns) { - rule.pattern = QRegExp(pattern); + rule.pattern = QRegularExpression(pattern); rule.format = keywordFormat; m_highlightingRules.append(rule); } @@ -46,7 +46,7 @@ LogHighlighter::LogHighlighter(QTextDocument *parent) : QSyntaxHighlighter(paren QTextCharFormat commandFormat; commandFormat.setForeground(Qt::darkBlue); commandFormat.setFontWeight(QFont::Bold); - rule.pattern = QRegExp(QLatin1String("^\\[[^\\]\\d][^\\]]*\\]")); + rule.pattern = QRegularExpression(QLatin1String("^\\[[^\\]\\d][^\\]]*\\]")); rule.format = commandFormat; m_highlightingRules.append(rule); @@ -61,15 +61,13 @@ void LogHighlighter::highlightBlock(const QString &text) { // Try each highlighting pattern and apply formatting if it matches for (const auto &rule : m_highlightingRules) { - // const QRegExp expression(rule.pattern); - // int index = text.indexOf(expression); - QRegExp expression(rule.pattern); - int index = expression.indexIn(text); - while (index >= 0) { - const int length = expression.matchedLength(); - setFormat(index, length, rule.format); - // index = text.indexOf(expression, index + length); - index = expression.indexIn(text, index + length); + QRegularExpression expression(rule.pattern); + QRegularExpressionMatch match = expression.match(text); + while (match.hasMatch()) + { + const int length = match.capturedLength(); + setFormat(match.capturedStart(), length, rule.format); + match = expression.match(text, match.capturedEnd() + 1); } } diff --git a/app/loghighlighter.h b/app/loghighlighter.h index 901767d..5e7981d 100644 --- a/app/loghighlighter.h +++ b/app/loghighlighter.h @@ -23,6 +23,7 @@ #include #include +#include /** A simple, incomplete highlighter for LaTeX .log files * @author Florian Hackenberger @@ -44,7 +45,7 @@ protected: private: struct LogHighlightingRule { - QRegExp pattern; /// The pattern to match for formatting + QRegularExpression pattern; /// The pattern to match for formatting QTextCharFormat format; /// The style of the formatting }; /// All highlighting rules with their formatting for easy iteration diff --git a/app/mainwindow.cpp b/app/mainwindow.cpp index e01f254..c4cdb5c 100644 --- a/app/mainwindow.cpp +++ b/app/mainwindow.cpp @@ -38,7 +38,7 @@ #include #include #include -#include +#include #include #include #include @@ -82,7 +82,7 @@ QList MainWindow::s_mainWindowList; -MainWindow::MainWindow() +MainWindow::MainWindow() : m_doOverrideEncoder(false), m_doOverrideDecoder(false) { // QTime t = QTime::currentTime(); #ifndef KTIKZ_USE_KDE @@ -140,7 +140,7 @@ MainWindow::MainWindow() QWidget *mainWidget = new QWidget(this); QVBoxLayout *mainLayout = new QVBoxLayout(mainWidget); mainLayout->setSpacing(0); - mainLayout->setMargin(0); + mainLayout->setContentsMargins(0, 0, 0, 0); mainLayout->addWidget(m_tikzPreviewController->templateWidget()); mainLayout->addWidget(m_tikzEditorView); @@ -933,12 +933,32 @@ void MainWindow::applySettings() updateCompleter(); settings.beginGroup(QLatin1String("encoding")); QVariant qv = settings.value(QLatin1String("default")); - setCurrentEncoding(qv.isNull() ? QTextCodec::codecForLocale() - : QTextCodec::codecForName(qv.toByteArray())); + if (qv.isNull()) + { + setCurrentEncoding( QStringConverter::System ) ; + } else { + std::optional currentEncoding = QStringConverter::encodingForName(qv.toString().toStdString().c_str()); + setCurrentEncoding( currentEncoding.value_or( QStringConverter::System ) ) ; + } + qv = settings.value(QLatin1String("encoder")); - m_overrideEncoder = qv.isNull() ? NULL : QTextCodec::codecForName(qv.toByteArray()); + if (qv.isNull()) + { + m_doOverrideEncoder = false; + } else { + std::optional overrideEncoding = QStringConverter::encodingForName(qv.toString().toStdString().c_str()); + m_doOverrideEncoder = overrideEncoding.has_value(); + m_overrideEncoder = overrideEncoding.value_or( QStringConverter::System ) ; + } qv = settings.value(QLatin1String("decoder")); - m_overrideDecoder = qv.isNull() ? NULL : QTextCodec::codecForName(qv.toByteArray()); + if (qv.isNull()) + { + m_doOverrideDecoder = false; + } else { + std::optional overrideDecoding = QStringConverter::encodingForName(qv.toString().toStdString().c_str()); + m_doOverrideDecoder = overrideDecoding.has_value(); + m_overrideDecoder = overrideDecoding.value_or( QStringConverter::System ) ; + } m_encoderBom = settings.value(QLatin1String("bom"), true).toBool(); settings.endGroup(); @@ -1069,7 +1089,7 @@ void MainWindow::loadUrl(const QUrl &url) QApplication::setOverrideCursor(Qt::WaitCursor); this->configureStreamDecoding(in); m_tikzQtEditorView->editor()->setPlainText(in.readAll()); - setCurrentEncoding(in.codec()); + setCurrentEncoding(in.encoding()); } QApplication::restoreOverrideCursor(); @@ -1131,7 +1151,7 @@ bool MainWindow::saveUrl(const QUrl &url) return true; } -void MainWindow::setCurrentEncoding(QTextCodec *codec) +void MainWindow::setCurrentEncoding(QStringConverter::Encoding codec ) { m_currentEncoding = codec; // TODO: implement user warning and suggestion to reload the file. @@ -1160,27 +1180,22 @@ QString MainWindow::strippedName(const QUrl &url) const return (fileName.isEmpty()) ? QLatin1String("untitled.txt") : fileName; } -QTextCodec *MainWindow::getEncoder() const +QStringConverter::Encoding MainWindow::getEncoder() const { - return this->m_overrideEncoder ? this->m_overrideEncoder : this->m_currentEncoding; + return this->m_doOverrideEncoder ? this->m_overrideEncoder : this->m_currentEncoding; } void MainWindow::configureStreamEncoding(QTextStream &textStream) { - QTextCodec *encoder = this->getEncoder(); - if (Q_LIKELY(encoder)) // should be true - textStream.setCodec(encoder); - else - qWarning("The encoder variable should not be null."); + textStream.setEncoding(this->getEncoder()); textStream.setGenerateByteOrderMark(this->m_encoderBom); } void MainWindow::configureStreamDecoding(QTextStream &textStream) { - if (m_overrideDecoder) { - textStream.setCodec(m_overrideDecoder); - } + if(m_doOverrideDecoder) + textStream.setEncoding(m_overrideDecoder); textStream.setAutoDetectUnicode(true); } diff --git a/app/mainwindow.h b/app/mainwindow.h index 02c7391..aa76156 100644 --- a/app/mainwindow.h +++ b/app/mainwindow.h @@ -43,6 +43,7 @@ class QDockWidget; class QLabel; class QMenu; class QToolButton; +class QTextCodec; class Action; class ConfigDialog; @@ -134,7 +135,7 @@ private Q_SLOTS: /// Change the codec for the current document /// @param isUserRequest set to true if the user requested the changement (in this case, the /// application should warn the user -- not implemented yet.). - void setCurrentEncoding(QTextCodec *codec /*, bool isUserRequest = false */); + void setCurrentEncoding(QStringConverter::Encoding codec ); private: void createActions(); @@ -225,15 +226,17 @@ private: QPointer m_configDialog; QUrl m_currentUrl; - QTextCodec *m_currentEncoding; - /// If not null, override the encoder (rather than @ref m_currentEncoding) - QTextCodec *m_overrideEncoder; - /// If not null, override the decoder - QTextCodec *m_overrideDecoder; + QStringConverter::Encoding m_currentEncoding; + /// If true, override the encoder (rather than @ref m_currentEncoding) + bool m_doOverrideEncoder; + QStringConverter::Encoding m_overrideEncoder; + /// If true, override the decoder + bool m_doOverrideDecoder; + QStringConverter::Encoding m_overrideDecoder; /// True if a BOM must be added to the PGF-file bool m_encoderBom; /// Return the current encoder (m_currentEncoding or another if encoder is overriden). - /*virtual*/ QTextCodec *getEncoder() const; + /*virtual*/ QStringConverter::Encoding getEncoder() const; QUrl m_lastUrl; QDateTime m_lastInternalModifiedDateTime; diff --git a/app/tikzcommandinserter.cpp b/app/tikzcommandinserter.cpp index 470c743..73cc9e4 100644 --- a/app/tikzcommandinserter.cpp +++ b/app/tikzcommandinserter.cpp @@ -46,7 +46,7 @@ #include "tikzcommandwidget.h" #include "../common/utils/combobox.h" -static const QString s_completionPlaceHolder(0x2022); +static const QString s_completionPlaceHolder(QChar(0x2022)); TikzCommandList TikzCommandInserter::m_tikzSections; QList TikzCommandInserter::m_tikzCommandsList; @@ -90,10 +90,10 @@ static TikzCommand newCommand(const QString &name, const QString &description, static QString translateOptions(const QString &text) { QString translatedText; - for (int pos = 0, oldPos = 0; pos >= 0;) { + for (qsizetype pos = 0, oldPos = 0; pos >= 0;) { oldPos = pos; pos = text.indexOf(QLatin1Char('<'), pos); // option is between < and > - translatedText += text.midRef( + translatedText += text.mid( oldPos, pos - oldPos + 1); // add text between the current option and the previous // option; this also adds the end of the original string, // except when there are no options @@ -574,7 +574,7 @@ QDockWidget *TikzCommandInserter::getDockWidget(QWidget *parent) tikzLayout->addWidget(commandsComboLabel, 0, 0); tikzLayout->addWidget(m_commandsCombo, 0, 1); tikzLayout->addWidget(m_commandsStack, 1, 0, 1, 2); - tikzLayout->setMargin(5); + tikzLayout->setContentsMargins(5, 5, 5, 5); TikzCommandWidget *tikzWidget = new TikzCommandWidget; tikzWidget->setLayout(tikzLayout); @@ -801,7 +801,7 @@ void TikzCommandInserter::insertTag(const QString &tag, int dx, int dy) // replace all options (between <...>) by a place holder QString insertWord = tag; - const QRegExp rx(QLatin1String("<[^<>]*>")); + const QRegularExpression rx(QLatin1String("<[^<>]*>")); insertWord.replace(rx, s_completionPlaceHolder); QTextCursor cur = m_mainEdit->textCursor(); diff --git a/app/tikzeditor.cpp b/app/tikzeditor.cpp index aa7fa8d..81b8929 100644 --- a/app/tikzeditor.cpp +++ b/app/tikzeditor.cpp @@ -50,7 +50,7 @@ #include "linenumberwidget.h" -static const QString s_completionPlaceHolder(0x2022); +static const QString s_completionPlaceHolder(QChar(0x2022)); TikzEditor::TikzEditor(QWidget *parent) : QPlainTextEdit(parent), @@ -619,8 +619,8 @@ void TikzEditor::insertCompletion(const QString &completion) // remove all options (between <...>) and put cursor at the first option QString insertWord = completion.right(extra); - const QRegExp rx(QLatin1String("<[^<>]*>")); - const int offset = rx.indexIn(insertWord) - 1; // put cursor at the first option + const QRegularExpression rx(QLatin1String("<[^<>]*>")); + const int offset = insertWord.indexOf(rx) - 1; // put cursor at the first option insertWord.replace(rx, s_completionPlaceHolder); cursor.insertText(insertWord); diff --git a/app/tikzeditorhighlighter.h b/app/tikzeditorhighlighter.h index 6db5ee3..5352c2e 100644 --- a/app/tikzeditorhighlighter.h +++ b/app/tikzeditorhighlighter.h @@ -22,6 +22,7 @@ #define TIKZEDITORHIGHLIGHTER_H #include +#include struct HighlightingRule { diff --git a/app/tikzeditorview.cpp b/app/tikzeditorview.cpp index ffb79ef..e349edf 100644 --- a/app/tikzeditorview.cpp +++ b/app/tikzeditorview.cpp @@ -59,7 +59,7 @@ TikzEditorView::TikzEditorView(QWidget *parent) QVBoxLayout *mainLayout = new QVBoxLayout(this); mainLayout->setSpacing(0); - mainLayout->setMargin(0); + mainLayout->setContentsMargins(0, 0, 0, 0); mainLayout->addWidget(m_tikzEditor); createActions(); diff --git a/app/usercommandeditdialog.cpp b/app/usercommandeditdialog.cpp index 02d72d5..ca194af 100644 --- a/app/usercommandeditdialog.cpp +++ b/app/usercommandeditdialog.cpp @@ -20,7 +20,7 @@ #include -static const QString s_completionPlaceHolder(0x2022); +static const QString s_completionPlaceHolder(QChar(0x2022)); UserCommandEditDialog::UserCommandEditDialog(QWidget *parent) : QDialog(parent), m_oldIndex(-1) { diff --git a/app/usercommandinserter.cpp b/app/usercommandinserter.cpp index 42943c7..8151ca9 100644 --- a/app/usercommandinserter.cpp +++ b/app/usercommandinserter.cpp @@ -25,7 +25,7 @@ #include "tikzcommandinserter.h" #include "usercommandeditdialog.h" -static const QString s_completionPlaceHolder(0x2022); +static const QString s_completionPlaceHolder(QChar(0x2022)); UserCommandInserter::UserCommandInserter(QWidget *parent) : QObject(parent), m_userMenu(0) { diff --git a/common/common.pri b/common/common.pri index dd3aa7f..d4f05fc 100644 --- a/common/common.pri +++ b/common/common.pri @@ -1,4 +1,5 @@ QT *= widgets printsupport +greaterThan(QT_MAJOR_VERSION, 6): QT *= core5compat include($${_PRO_FILE_PWD_}/qmake/findpoppler.pri) diff --git a/common/tikzpreview.cpp b/common/tikzpreview.cpp index 8be3574..cd3573b 100644 --- a/common/tikzpreview.cpp +++ b/common/tikzpreview.cpp @@ -18,11 +18,10 @@ #include "tikzpreview.h" -#include +#include #include #include -#include #include #include #include @@ -316,13 +315,12 @@ void TikzPreview::pixmapUpdated(Poppler::Document *tikzPdfDoc, const QListpage(pageNumber); + auto page = m_tikzPdfDoc->page(pageNumber); // const QSizeF pageSize = page->pageSizeF(); // const QImage image = pageSize.height() >= pageSize.width() // ? page->renderToImage(xres, yres) // : page->renderToImage(xres, yres, -1, -1, -1, -1, Poppler::Page::Rotate270); // slow const QImage image = page->renderToImage(xres, yres); // slow - delete page; return image; } diff --git a/common/tikzpreviewcontroller.cpp b/common/tikzpreviewcontroller.cpp index e6329f4..f4d090d 100644 --- a/common/tikzpreviewcontroller.cpp +++ b/common/tikzpreviewcontroller.cpp @@ -33,7 +33,7 @@ #include #include -#include +#include #include "templatewidget.h" #include "tikzpreview.h" diff --git a/common/tikzpreviewgenerator.cpp b/common/tikzpreviewgenerator.cpp index 548d67e..5919f04 100644 --- a/common/tikzpreviewgenerator.cpp +++ b/common/tikzpreviewgenerator.cpp @@ -32,7 +32,8 @@ #include #include #include -#include +#include +#include #include "tikzpreviewcontroller.h" #include "mainwidget.h" @@ -306,7 +307,7 @@ void TikzPreviewGenerator::createPreview() // Update widget if (m_tikzPdfDoc) delete m_tikzPdfDoc; - m_tikzPdfDoc = Poppler::Document::load(tikzPdfFileInfo.absoluteFilePath()); + m_tikzPdfDoc = Poppler::Document::load(tikzPdfFileInfo.absoluteFilePath()).release(); if (m_tikzPdfDoc) { m_shortLogText = QLatin1String("[LaTeX] ") + tr("Process finished successfully.", "info process"); diff --git a/common/tikzpreviewmessagewidget.cpp b/common/tikzpreviewmessagewidget.cpp index 432d818..5daf551 100644 --- a/common/tikzpreviewmessagewidget.cpp +++ b/common/tikzpreviewmessagewidget.cpp @@ -55,7 +55,7 @@ TikzPreviewMessageWidget::TikzPreviewMessageWidget(QWidget *parent) : QFrame(par "}"))); QHBoxLayout *infoLayout = new QHBoxLayout(this); - infoLayout->setMargin(10); + infoLayout->setContentsMargins(10, 10 ,10, 10); infoLayout->addWidget(m_infoPixmapLabel); infoLayout->addWidget(m_infoLabel); diff --git a/common/tikzpreviewrenderer.cpp b/common/tikzpreviewrenderer.cpp index 372bea4..e97fe11 100644 --- a/common/tikzpreviewrenderer.cpp +++ b/common/tikzpreviewrenderer.cpp @@ -19,7 +19,7 @@ #include "tikzpreviewrenderer.h" #include -#include +#include TikzPreviewRenderer::TikzPreviewRenderer() { @@ -38,9 +38,8 @@ TikzPreviewRenderer::~TikzPreviewRenderer() void TikzPreviewRenderer::generatePreview(Poppler::Document *tikzPdfDoc, qreal zoomFactor, int currentPage) { - Poppler::Page *pdfPage = tikzPdfDoc->page(currentPage); + auto pdfPage = tikzPdfDoc->page(currentPage); const QImage tikzImage = pdfPage->renderToImage(zoomFactor * 72, zoomFactor * 72); - delete pdfPage; Q_EMIT showPreview(tikzImage, zoomFactor); } diff --git a/common/utils/pagedialog.cpp b/common/utils/pagedialog.cpp index 5585de9..32f3042 100644 --- a/common/utils/pagedialog.cpp +++ b/common/utils/pagedialog.cpp @@ -101,7 +101,7 @@ QWidget *PageDialog::centerWidget() m_pagesTitleLabel->setStyleSheet(QLatin1String("QLabel { font-weight: bold; }")); QGridLayout *titleLayout = new QGridLayout(titleFrame); titleLayout->setColumnStretch(0, 1); - titleLayout->setMargin(6); + titleLayout->setContentsMargins(6, 6, 6, 6); titleLayout->addWidget(m_pagesTitleLabel); // add pages diff --git a/common/utils/recentfilesaction.cpp b/common/utils/recentfilesaction.cpp index 48bfeed..7a45a3e 100644 --- a/common/utils/recentfilesaction.cpp +++ b/common/utils/recentfilesaction.cpp @@ -102,7 +102,7 @@ void RecentFilesAction::openRecentFile() # ifdef Q_OS_WIN32 Q_EMIT urlSelected(Url(action->data().toString())); # else - Q_EMIT urlSelected(Url(QLatin1String("file://") + action->data().toString())); + Q_EMIT urlSelected(QUrl(QLatin1String("file://") + action->data().toString())); # endif } diff --git a/common/utils/recentfilesaction.h b/common/utils/recentfilesaction.h index 0694ea9..3de53a5 100644 --- a/common/utils/recentfilesaction.h +++ b/common/utils/recentfilesaction.h @@ -60,7 +60,7 @@ public: void removeUrl(const QUrl &url); Q_SIGNALS: - void urlSelected(const Url &url); + void urlSelected(const QUrl &url); private Q_SLOTS: void openRecentFile(); diff --git a/common/utils/standardaction.cpp b/common/utils/standardaction.cpp index e78cba8..3b54b80 100644 --- a/common/utils/standardaction.cpp +++ b/common/utils/standardaction.cpp @@ -308,7 +308,7 @@ RecentFilesAction *openRecent(const QObject *recvr, const char *slot, QObject *p RecentFilesAction *action = new RecentFilesAction( Icon(QLatin1String("document-open-recent")), QCoreApplication::translate("StandardAction", "&Open Recent"), parent); - QObject::connect(action, SIGNAL(urlSelected(Url)), recvr, slot); + QObject::connect(action, SIGNAL(urlSelected(QUrl)), recvr, slot); return action; } Action *save(const QObject *recvr, const char *slot, QObject *parent) diff --git a/common/utils/toggleaction.h b/common/utils/toggleaction.h index a4efa49..7d9064f 100644 --- a/common/utils/toggleaction.h +++ b/common/utils/toggleaction.h @@ -36,7 +36,7 @@ public: }; #else # include -# include +# include class ToggleAction : public QAction { diff --git a/common/utils/urlcompletion.h b/common/utils/urlcompletion.h index 0694b5c..4360e20 100644 --- a/common/utils/urlcompletion.h +++ b/common/utils/urlcompletion.h @@ -29,7 +29,7 @@ public: }; #else # include -# include +# include class UrlCompletion : public QCompleter { diff --git a/common/utils/zoomaction.cpp b/common/utils/zoomaction.cpp index 902674f..c192633 100644 --- a/common/utils/zoomaction.cpp +++ b/common/utils/zoomaction.cpp @@ -18,6 +18,7 @@ #include "zoomaction.h" +#include #include "globallocale.h" #include "icon.h" @@ -136,7 +137,7 @@ void ZoomAction::setZoomFactor(const QString &zoomFactorText) { setZoomFactor(GlobalLocale::readNumber( QString(zoomFactorText) - .remove(QRegExp(QString(QLatin1String("[^\\d\\%1]*")) + .remove(QRegularExpression(QString(QLatin1String("[^\\d\\%1]*")) .arg(GlobalLocale::decimalSymbol())))) / 100.0); } diff --git a/qmake/findpoppler.pri b/qmake/findpoppler.pri index f30eddc..1a95677 100644 --- a/qmake/findpoppler.pri +++ b/qmake/findpoppler.pri @@ -1,7 +1,7 @@ unix: { PKG_CONFIG = $$pkgConfigExecutable() - POPPLERINCLUDES = $$system($$PKG_CONFIG --cflags poppler-qt5) - POPPLERLIBS = $$system($$PKG_CONFIG --libs poppler-qt5) + POPPLERINCLUDES = $$system($$PKG_CONFIG --cflags poppler-qt6) + POPPLERLIBS = $$system($$PKG_CONFIG --libs poppler-qt6) QMAKE_CXXFLAGS += $$POPPLERINCLUDES QMAKE_LFLAGS += $$POPPLERLIBS } @@ -11,4 +11,4 @@ win32 { LIBS += -L$${_PRO_FILE_PWD_}/win32/poppler/ } -LIBS += -lpoppler-qt5 +LIBS += -lpoppler-qt6