From dd466d50734f0804aaff0242c946896d3c59b59f Mon Sep 17 00:00:00 2001 From: Jakub Melka Date: Sun, 18 Sep 2022 13:08:21 +0200 Subject: [PATCH] Issue #25: Linux build --- CMakeLists.txt | 5 +++ Pdf4QtDocDiff/settingsdockwidget.cpp | 2 +- Pdf4QtDocPageOrganizer/pageitemdelegate.cpp | 2 +- Pdf4QtDocPageOrganizer/pageitemmodel.cpp | 4 +-- Pdf4QtLib/CMakeLists.txt | 4 +++ Pdf4QtLib/sources/pdfadvancedtools.cpp | 30 ++++++++-------- Pdf4QtLib/sources/pdfannotation.cpp | 10 +++--- Pdf4QtLib/sources/pdfcms.cpp | 4 +-- Pdf4QtLib/sources/pdfcompiler.cpp | 8 ++--- Pdf4QtLib/sources/pdfdiff.cpp | 14 ++++---- .../pdfdocumenttextfloweditormodel.cpp | 14 ++++---- Pdf4QtLib/sources/pdfdrawspacecontroller.cpp | 32 ++++++++--------- Pdf4QtLib/sources/pdfdrawwidget.cpp | 2 +- Pdf4QtLib/sources/pdfform.cpp | 10 +++--- Pdf4QtLib/sources/pdfitemmodels.cpp | 8 ++--- Pdf4QtLib/sources/pdfobjecteditormodel.cpp | 2 +- Pdf4QtLib/sources/pdfobjecteditorwidget.cpp | 16 ++++----- Pdf4QtLib/sources/pdfoptimizer.cpp | 20 +++++------ Pdf4QtLib/sources/pdfoptionalcontent.cpp | 2 +- .../pdfpagecontenteditorstylesettings.cpp | 36 +++++++++---------- .../sources/pdfpagecontenteditortools.cpp | 22 ++++++------ .../sources/pdfpagecontenteditorwidget.cpp | 2 +- Pdf4QtLib/sources/pdfpagecontentelements.cpp | 28 +++++++-------- Pdf4QtLib/sources/pdfpagenavigation.cpp | 6 ++-- Pdf4QtLib/sources/pdfprogress.cpp | 6 ++-- Pdf4QtLib/sources/pdfrenderer.cpp | 10 +++--- Pdf4QtLib/sources/pdfwidgettool.cpp | 24 ++++++------- Pdf4QtViewer/pdfoptimizedocumentdialog.cpp | 2 +- Pdf4QtViewer/pdfprogramcontroller.cpp | 2 +- Pdf4QtViewer/pdfrecentfilemanager.cpp | 2 +- Pdf4QtViewer/pdfrendertoimagesdialog.cpp | 2 +- Pdf4QtViewer/pdfsidebarwidget.cpp | 2 +- Pdf4QtViewer/pdfundoredomanager.cpp | 14 ++++---- Pdf4QtViewer/pdfviewermainwindow.h | 1 + Pdf4QtViewer/pdfviewersettings.cpp | 18 +++++----- Pdf4QtViewer/pdfviewersettings.h | 1 + Pdf4QtViewerLite/CMakeLists.txt | 4 +++ .../DimensionsPlugin/dimensiontool.cpp | 4 +-- .../RedactPlugin/redactplugin.cpp | 4 +-- .../SignaturePlugin/signatureplugin.cpp | 2 +- Pdf4QtViewerProfi/CMakeLists.txt | 4 +++ PdfTool/CMakeLists.txt | 4 +++ PdfTool/pdfoutputformatter.cpp | 2 +- PdfTool/pdftoolabstractapplication.h | 1 + 44 files changed, 208 insertions(+), 184 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 3a1f5da..a3773fd 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -25,6 +25,7 @@ option(PDF4QT_INSTALL_DEPENDENCIES "Install dependencies" ON) option(PDF4QT_INSTALL_QT_DEPENDENCIES "Install Qt dependencies" ON) add_compile_definitions(PDF4QT_PROJECT_VERSION="${PDF4QT_VERSION}") +add_compile_definitions(QT_NO_EMIT) if(WIN32 AND MSVC) option(PDF4QT_INSTALL_MSVC_REDISTRIBUTABLE "Install MSVC redistributable package" ON) @@ -66,6 +67,10 @@ if (MINGW) add_compile_options("-Wa,-mbig-obj") endif() +if (UNIX AND NOT APPLE AND CMAKE_COMPILER_IS_GNUCXX) + set(LINUX_GCC ON) +endif() + add_subdirectory(Pdf4QtLib) add_subdirectory(CodeGenerator) add_subdirectory(JBIG2_Viewer) diff --git a/Pdf4QtDocDiff/settingsdockwidget.cpp b/Pdf4QtDocDiff/settingsdockwidget.cpp index eefdeeb..aad8570 100644 --- a/Pdf4QtDocDiff/settingsdockwidget.cpp +++ b/Pdf4QtDocDiff/settingsdockwidget.cpp @@ -143,7 +143,7 @@ void SettingsDockWidget::onEditColorChanged() if (isChanged) { - emit colorsChanged(); + Q_EMIT colorsChanged(); } } diff --git a/Pdf4QtDocPageOrganizer/pageitemdelegate.cpp b/Pdf4QtDocPageOrganizer/pageitemdelegate.cpp index 84c2ea1..73ca8fa 100644 --- a/Pdf4QtDocPageOrganizer/pageitemdelegate.cpp +++ b/Pdf4QtDocPageOrganizer/pageitemdelegate.cpp @@ -135,7 +135,7 @@ void PageItemDelegate::setPageImageSize(QSize pageImageSize) if (m_pageImageSize != pageImageSize) { m_pageImageSize = pageImageSize; - emit sizeHintChanged(QModelIndex()); + Q_EMIT sizeHintChanged(QModelIndex()); } } diff --git a/Pdf4QtDocPageOrganizer/pageitemmodel.cpp b/Pdf4QtDocPageOrganizer/pageitemmodel.cpp index e4d277d..83bc09d 100644 --- a/Pdf4QtDocPageOrganizer/pageitemmodel.cpp +++ b/Pdf4QtDocPageOrganizer/pageitemmodel.cpp @@ -494,7 +494,7 @@ void PageItemModel::rotateLeft(const QModelIndexList& list) rowMin = qMax(rowMin, 0); rowMax = qMin(rowMax, rowCount(QModelIndex()) - 1); - emit dataChanged(index(rowMin, 0, QModelIndex()), index(rowMax, 0, QModelIndex())); + Q_EMIT dataChanged(index(rowMin, 0, QModelIndex()), index(rowMax, 0, QModelIndex())); } void PageItemModel::rotateRight(const QModelIndexList& list) @@ -523,7 +523,7 @@ void PageItemModel::rotateRight(const QModelIndexList& list) rowMin = qMax(rowMin, 0); rowMax = qMin(rowMax, rowCount(QModelIndex()) - 1); - emit dataChanged(index(rowMin, 0, QModelIndex()), index(rowMax, 0, QModelIndex())); + Q_EMIT dataChanged(index(rowMin, 0, QModelIndex()), index(rowMax, 0, QModelIndex())); } PageItemModel::SelectionInfo PageItemModel::getSelectionInfo(const QModelIndexList& list) const diff --git a/Pdf4QtLib/CMakeLists.txt b/Pdf4QtLib/CMakeLists.txt index 42ea6cb..8589a39 100644 --- a/Pdf4QtLib/CMakeLists.txt +++ b/Pdf4QtLib/CMakeLists.txt @@ -116,6 +116,10 @@ target_link_libraries(Pdf4QtLib PRIVATE freetype) target_link_libraries(Pdf4QtLib PRIVATE openjp2) target_link_libraries(Pdf4QtLib PRIVATE JPEG::JPEG) +if(LINUX_GCC) + target_link_libraries(Pdf4QtLib PRIVATE tbb) +endif() + if(MINGW) target_link_libraries(Pdf4QtLib PRIVATE Secur32 Mscms Gdi32 User32 crypt32) endif() diff --git a/Pdf4QtLib/sources/pdfadvancedtools.cpp b/Pdf4QtLib/sources/pdfadvancedtools.cpp index ab9706d..5d0864d 100644 --- a/Pdf4QtLib/sources/pdfadvancedtools.cpp +++ b/Pdf4QtLib/sources/pdfadvancedtools.cpp @@ -86,7 +86,7 @@ void PDFCreateStickyNoteTool::onPointPicked(PDFInteger pageIndex, QPointF pagePo if (modifier.finalize()) { - emit m_toolManager->documentModified(PDFModifiedDocument(modifier.getDocument(), nullptr, modifier.getFlags())); + Q_EMIT m_toolManager->documentModified(PDFModifiedDocument(modifier.getDocument(), nullptr, modifier.getFlags())); } setActive(false); @@ -135,7 +135,7 @@ void PDFCreateHyperlinkTool::onRectanglePicked(PDFInteger pageIndex, QRectF page if (modifier.finalize()) { - emit m_toolManager->documentModified(PDFModifiedDocument(modifier.getDocument(), nullptr, modifier.getFlags())); + Q_EMIT m_toolManager->documentModified(PDFModifiedDocument(modifier.getDocument(), nullptr, modifier.getFlags())); } setActive(false); @@ -170,7 +170,7 @@ void PDFCreateFreeTextTool::onRectanglePicked(PDFInteger pageIndex, QRectF pageR if (modifier.finalize()) { - emit m_toolManager->documentModified(PDFModifiedDocument(modifier.getDocument(), nullptr, modifier.getFlags())); + Q_EMIT m_toolManager->documentModified(PDFModifiedDocument(modifier.getDocument(), nullptr, modifier.getFlags())); } setActive(false); @@ -241,7 +241,7 @@ void PDFCreateLineTypeTool::finishDefinition() if (modifier.finalize()) { - emit m_toolManager->documentModified(PDFModifiedDocument(modifier.getDocument(), nullptr, modifier.getFlags())); + Q_EMIT m_toolManager->documentModified(PDFModifiedDocument(modifier.getDocument(), nullptr, modifier.getFlags())); } setActive(false); @@ -268,7 +268,7 @@ void PDFCreateLineTypeTool::finishDefinition() if (modifier.finalize()) { - emit m_toolManager->documentModified(PDFModifiedDocument(modifier.getDocument(), nullptr, modifier.getFlags())); + Q_EMIT m_toolManager->documentModified(PDFModifiedDocument(modifier.getDocument(), nullptr, modifier.getFlags())); } setActive(false); @@ -301,7 +301,7 @@ void PDFCreateLineTypeTool::finishDefinition() if (modifier.finalize()) { - emit m_toolManager->documentModified(PDFModifiedDocument(modifier.getDocument(), nullptr, modifier.getFlags())); + Q_EMIT m_toolManager->documentModified(PDFModifiedDocument(modifier.getDocument(), nullptr, modifier.getFlags())); } setActive(false); @@ -594,7 +594,7 @@ void PDFCreateEllipseTool::onRectanglePicked(PDFInteger pageIndex, QRectF pageRe if (modifier.finalize()) { - emit m_toolManager->documentModified(PDFModifiedDocument(modifier.getDocument(), nullptr, modifier.getFlags())); + Q_EMIT m_toolManager->documentModified(PDFModifiedDocument(modifier.getDocument(), nullptr, modifier.getFlags())); } setActive(false); @@ -659,7 +659,7 @@ void PDFCreateFreehandCurveTool::mousePressEvent(QWidget* widget, QMouseEvent* e resetTool(); } - emit getProxy()->repaintNeeded(); + Q_EMIT getProxy()->repaintNeeded(); } void PDFCreateFreehandCurveTool::mouseReleaseEvent(QWidget* widget, QMouseEvent* event) @@ -695,7 +695,7 @@ void PDFCreateFreehandCurveTool::mouseReleaseEvent(QWidget* widget, QMouseEvent* if (modifier.finalize()) { - emit m_toolManager->documentModified(PDFModifiedDocument(modifier.getDocument(), nullptr, modifier.getFlags())); + Q_EMIT m_toolManager->documentModified(PDFModifiedDocument(modifier.getDocument(), nullptr, modifier.getFlags())); } setActive(false); @@ -705,7 +705,7 @@ void PDFCreateFreehandCurveTool::mouseReleaseEvent(QWidget* widget, QMouseEvent* resetTool(); } - emit getProxy()->repaintNeeded(); + Q_EMIT getProxy()->repaintNeeded(); } void PDFCreateFreehandCurveTool::mouseMoveEvent(QWidget* widget, QMouseEvent* event) @@ -852,7 +852,7 @@ void PDFCreateStampTool::onPointPicked(PDFInteger pageIndex, QPointF pagePoint) if (modifier.finalize()) { - emit m_toolManager->documentModified(PDFModifiedDocument(modifier.getDocument(), nullptr, modifier.getFlags())); + Q_EMIT m_toolManager->documentModified(PDFModifiedDocument(modifier.getDocument(), nullptr, modifier.getFlags())); } setActive(false); @@ -965,7 +965,7 @@ void PDFCreateHighlightTextTool::mouseReleaseEvent(QWidget* widget, QMouseEvent* if (modifier.finalize()) { - emit m_toolManager->documentModified(PDFModifiedDocument(modifier.getDocument(), nullptr, modifier.getFlags())); + Q_EMIT m_toolManager->documentModified(PDFModifiedDocument(modifier.getDocument(), nullptr, modifier.getFlags())); } } } @@ -1063,7 +1063,7 @@ void PDFCreateHighlightTextTool::setSelection(PDFTextSelection&& textSelection) if (m_textSelection != textSelection) { m_textSelection = qMove(textSelection); - emit getProxy()->repaintNeeded(); + Q_EMIT getProxy()->repaintNeeded(); } } @@ -1096,7 +1096,7 @@ void PDFCreateRedactRectangleTool::onRectanglePicked(PDFInteger pageIndex, QRect if (modifier.finalize()) { - emit m_toolManager->documentModified(PDFModifiedDocument(modifier.getDocument(), nullptr, modifier.getFlags())); + Q_EMIT m_toolManager->documentModified(PDFModifiedDocument(modifier.getDocument(), nullptr, modifier.getFlags())); } setActive(false); @@ -1180,7 +1180,7 @@ void PDFCreateRedactTextTool::mouseReleaseEvent(QWidget* widget, QMouseEvent* ev if (modifier.finalize()) { - emit m_toolManager->documentModified(PDFModifiedDocument(modifier.getDocument(), nullptr, modifier.getFlags())); + Q_EMIT m_toolManager->documentModified(PDFModifiedDocument(modifier.getDocument(), nullptr, modifier.getFlags())); } } } diff --git a/Pdf4QtLib/sources/pdfannotation.cpp b/Pdf4QtLib/sources/pdfannotation.cpp index b455b0c..1ffcc43 100644 --- a/Pdf4QtLib/sources/pdfannotation.cpp +++ b/Pdf4QtLib/sources/pdfannotation.cpp @@ -1964,7 +1964,7 @@ void PDFWidgetAnnotationManager::updateFromMouseEvent(QMouseEvent* event) if (linkAction) { - emit actionTriggered(linkAction); + Q_EMIT actionTriggered(linkAction); } } } @@ -1987,7 +1987,7 @@ void PDFWidgetAnnotationManager::updateFromMouseEvent(QMouseEvent* event) // If appearance has changed, then we must redraw the page if (appearanceChanged) { - emit widget->getDrawWidgetProxy()->repaintNeeded(); + Q_EMIT widget->getDrawWidgetProxy()->repaintNeeded(); } } @@ -2051,7 +2051,7 @@ void PDFWidgetAnnotationManager::onCopyAnnotation() if (modifier.finalize()) { - emit documentModified(PDFModifiedDocument(modifier.getDocument(), nullptr, modifier.getFlags())); + Q_EMIT documentModified(PDFModifiedDocument(modifier.getDocument(), nullptr, modifier.getFlags())); } } } @@ -2075,7 +2075,7 @@ void PDFWidgetAnnotationManager::onEditAnnotation() if (modifier.finalize()) { - emit documentModified(PDFModifiedDocument(modifier.getDocument(), nullptr, modifier.getFlags())); + Q_EMIT documentModified(PDFModifiedDocument(modifier.getDocument(), nullptr, modifier.getFlags())); } } } @@ -2091,7 +2091,7 @@ void PDFWidgetAnnotationManager::onDeleteAnnotation() if (modifier.finalize()) { - emit documentModified(PDFModifiedDocument(modifier.getDocument(), nullptr, modifier.getFlags())); + Q_EMIT documentModified(PDFModifiedDocument(modifier.getDocument(), nullptr, modifier.getFlags())); } } } diff --git a/Pdf4QtLib/sources/pdfcms.cpp b/Pdf4QtLib/sources/pdfcms.cpp index a821f10..a2c1767 100644 --- a/Pdf4QtLib/sources/pdfcms.cpp +++ b/Pdf4QtLib/sources/pdfcms.cpp @@ -1426,7 +1426,7 @@ void PDFCMSManager::setSettings(const PDFCMSSettings& settings) clearCache(); } - emit colorManagementSystemChanged(); + Q_EMIT colorManagementSystemChanged(); } } @@ -1571,7 +1571,7 @@ void PDFCMSManager::setDocument(const PDFDocument* document) if (outputIntentProfilesChanged) { lock = std::nullopt; - emit colorManagementSystemChanged(); + Q_EMIT colorManagementSystemChanged(); } } diff --git a/Pdf4QtLib/sources/pdfcompiler.cpp b/Pdf4QtLib/sources/pdfcompiler.cpp index abae981..a0150a7 100644 --- a/Pdf4QtLib/sources/pdfcompiler.cpp +++ b/Pdf4QtLib/sources/pdfcompiler.cpp @@ -98,7 +98,7 @@ void PDFAsynchronousPageCompilerWorkerThread::run() // we do not want to emit signals with locked mutexes. // If direct connection is applied, this can lead to deadlock. locker.unlock(); - emit pageCompiled(); + Q_EMIT pageCompiled(); locker.relock(); } } @@ -311,13 +311,13 @@ void PDFAsynchronousPageCompiler::onPageCompiled() for (const auto& error : errors) { - emit renderingError(error.first, { error.second }); + Q_EMIT renderingError(error.first, { error.second }); } if (!compiledPages.empty()) { Q_ASSERT(std::is_sorted(compiledPages.cbegin(), compiledPages.cend())); - emit pageImageChanged(false, compiledPages); + Q_EMIT pageImageChanged(false, compiledPages); } } @@ -629,7 +629,7 @@ void PDFAsynchronousTextLayoutCompiler::onTextLayoutCreated() m_textLayouts = m_textLayoutCompileFuture.result(); m_isRunning = false; - emit textLayoutChanged(); + Q_EMIT textLayoutChanged(); } } // namespace pdf diff --git a/Pdf4QtLib/sources/pdfdiff.cpp b/Pdf4QtLib/sources/pdfdiff.cpp index fd72345..cca7023 100644 --- a/Pdf4QtLib/sources/pdfdiff.cpp +++ b/Pdf4QtLib/sources/pdfdiff.cpp @@ -143,7 +143,7 @@ void PDFDiff::start() { // Just do comparation immediately m_result = perform(); - emit comparationFinished(); + Q_EMIT comparationFinished(); } } @@ -898,7 +898,7 @@ void PDFDiff::onComparationPerformed() { m_cancelled = false; m_result = m_future.result(); - emit comparationFinished(); + Q_EMIT comparationFinished(); } PDFReal PDFDiff::calculateEpsilonForPage(const PDFPage* page) const @@ -1806,7 +1806,7 @@ void PDFDiffResultNavigator::setResult(const PDFDiffResult* diffResult) if (m_diffResult != diffResult) { m_diffResult = diffResult; - emit selectionChanged(m_currentIndex); + Q_EMIT selectionChanged(m_currentIndex); } } @@ -1836,7 +1836,7 @@ void PDFDiffResultNavigator::goNext() } ++m_currentIndex; - emit selectionChanged(m_currentIndex); + Q_EMIT selectionChanged(m_currentIndex); } void PDFDiffResultNavigator::goPrevious() @@ -1855,7 +1855,7 @@ void PDFDiffResultNavigator::goPrevious() { --m_currentIndex; } - emit selectionChanged(m_currentIndex); + Q_EMIT selectionChanged(m_currentIndex); } void PDFDiffResultNavigator::update() @@ -1864,7 +1864,7 @@ void PDFDiffResultNavigator::update() if (limit > 0 && m_currentIndex >= limit) { m_currentIndex = limit - 1; - emit selectionChanged(m_currentIndex); + Q_EMIT selectionChanged(m_currentIndex); } } @@ -1873,7 +1873,7 @@ void PDFDiffResultNavigator::select(size_t currentIndex) if (currentIndex < getLimit() && m_currentIndex != currentIndex) { m_currentIndex = currentIndex; - emit selectionChanged(m_currentIndex); + Q_EMIT selectionChanged(m_currentIndex); } } diff --git a/Pdf4QtLib/sources/pdfdocumenttextfloweditormodel.cpp b/Pdf4QtLib/sources/pdfdocumenttextfloweditormodel.cpp index 16ae3b9..a988ec8 100644 --- a/Pdf4QtLib/sources/pdfdocumenttextfloweditormodel.cpp +++ b/Pdf4QtLib/sources/pdfdocumenttextfloweditormodel.cpp @@ -251,7 +251,7 @@ void PDFDocumentTextFlowEditorModel::setSelectionActivated(bool activate) m_editor->setSelectionActive(activate); m_editor->deselect(); - emit dataChanged(index(0, 0), index(rowCount(QModelIndex()) - 1, ColumnLast)); + Q_EMIT dataChanged(index(0, 0), index(rowCount(QModelIndex()) - 1, ColumnLast)); } void PDFDocumentTextFlowEditorModel::selectByRectangle(QRectF rectangle) @@ -262,7 +262,7 @@ void PDFDocumentTextFlowEditorModel::selectByRectangle(QRectF rectangle) } m_editor->selectByRectangle(rectangle); - emit dataChanged(index(0, 0), index(rowCount(QModelIndex()) - 1, ColumnLast)); + Q_EMIT dataChanged(index(0, 0), index(rowCount(QModelIndex()) - 1, ColumnLast)); } void PDFDocumentTextFlowEditorModel::selectByContainedText(QString text) @@ -273,7 +273,7 @@ void PDFDocumentTextFlowEditorModel::selectByContainedText(QString text) } m_editor->selectByContainedText(text); - emit dataChanged(index(0, 0), index(rowCount(QModelIndex()) - 1, ColumnLast)); + Q_EMIT dataChanged(index(0, 0), index(rowCount(QModelIndex()) - 1, ColumnLast)); } void PDFDocumentTextFlowEditorModel::selectByRegularExpression(const QRegularExpression& expression) @@ -284,7 +284,7 @@ void PDFDocumentTextFlowEditorModel::selectByRegularExpression(const QRegularExp } m_editor->selectByRegularExpression(expression); - emit dataChanged(index(0, 0), index(rowCount(QModelIndex()) - 1, ColumnLast)); + Q_EMIT dataChanged(index(0, 0), index(rowCount(QModelIndex()) - 1, ColumnLast)); } void PDFDocumentTextFlowEditorModel::selectByPageIndices(const PDFClosedIntervalSet& indices) @@ -295,7 +295,7 @@ void PDFDocumentTextFlowEditorModel::selectByPageIndices(const PDFClosedInterval } m_editor->selectByPageIndices(indices); - emit dataChanged(index(0, 0), index(rowCount(QModelIndex()) - 1, ColumnLast)); + Q_EMIT dataChanged(index(0, 0), index(rowCount(QModelIndex()) - 1, ColumnLast)); } void PDFDocumentTextFlowEditorModel::restoreOriginalTexts() @@ -307,7 +307,7 @@ void PDFDocumentTextFlowEditorModel::restoreOriginalTexts() m_editor->restoreOriginalTexts(); m_editor->deselect(); - emit dataChanged(index(0, 0), index(rowCount(QModelIndex()) - 1, ColumnLast)); + Q_EMIT dataChanged(index(0, 0), index(rowCount(QModelIndex()) - 1, ColumnLast)); } void PDFDocumentTextFlowEditorModel::moveSelectionUp() @@ -339,7 +339,7 @@ void PDFDocumentTextFlowEditorModel::notifyDataChanged() return; } - emit dataChanged(index(0, 0), index(rowCount(QModelIndex()) - 1, ColumnLast)); + Q_EMIT dataChanged(index(0, 0), index(rowCount(QModelIndex()) - 1, ColumnLast)); } } // namespace pdf diff --git a/Pdf4QtLib/sources/pdfdrawspacecontroller.cpp b/Pdf4QtLib/sources/pdfdrawspacecontroller.cpp index 6686934..d2dce12 100644 --- a/Pdf4QtLib/sources/pdfdrawspacecontroller.cpp +++ b/Pdf4QtLib/sources/pdfdrawspacecontroller.cpp @@ -432,7 +432,7 @@ void PDFDrawSpaceController::recalculate() } } - emit drawSpaceChanged(); + Q_EMIT drawSpaceChanged(); } void PDFDrawSpaceController::clear(bool emitSignal) @@ -442,7 +442,7 @@ void PDFDrawSpaceController::clear(bool emitSignal) if (emitSignal) { - emit drawSpaceChanged(); + Q_EMIT drawSpaceChanged(); } } @@ -676,7 +676,7 @@ void PDFDrawWidgetProxy::update() } } - emit drawSpaceChanged(); + Q_EMIT drawSpaceChanged(); } QTransform PDFDrawWidgetProxy::createPagePointToDevicePointMatrix(const PDFPage* page, const QRectF& rectangle) const @@ -893,7 +893,7 @@ void PDFDrawWidgetProxy::drawPages(QPainter* painter, QRect rect, PDFRenderer::F { errors.append(drawInterfaceErrors); } - emit renderingError(item.pageIndex, qMove(errors)); + Q_EMIT renderingError(item.pageIndex, qMove(errors)); } } } @@ -1268,7 +1268,7 @@ void PDFDrawWidgetProxy::setPageLayout(PageLayout pageLayout) if (getPageLayout() != pageLayout) { m_controller->setPageLayout(pageLayout); - emit pageLayoutChanged(); + Q_EMIT pageLayoutChanged(); } } @@ -1277,7 +1277,7 @@ void PDFDrawWidgetProxy::setCustomPageLayout(PDFDrawSpaceController::LayoutItems if (m_controller->getCustomLayout() != layoutItems) { m_controller->setCustomLayout(std::move(layoutItems)); - emit pageLayoutChanged(); + Q_EMIT pageLayoutChanged(); } } @@ -1299,8 +1299,8 @@ void PDFDrawWidgetProxy::performPageCacheClear() void PDFDrawWidgetProxy::onTextLayoutChanged() { - emit repaintNeeded(); - emit textLayoutChanged(); + Q_EMIT repaintNeeded(); + Q_EMIT textLayoutChanged(); } bool PDFDrawWidgetProxy::isBlockMode() const @@ -1402,7 +1402,7 @@ void PDFDrawWidgetProxy::setHorizontalOffset(int value) { m_horizontalOffset = horizontalOffset; updateHorizontalScrollbarFromOffset(); - emit drawSpaceChanged(); + Q_EMIT drawSpaceChanged(); } } @@ -1414,7 +1414,7 @@ void PDFDrawWidgetProxy::setVerticalOffset(int value) { m_verticalOffset = verticalOffset; updateVerticalScrollbarFromOffset(); - emit drawSpaceChanged(); + Q_EMIT drawSpaceChanged(); } } @@ -1480,7 +1480,7 @@ void PDFDrawWidgetProxy::setFeatures(PDFRenderer::Features features) m_features = features; m_compiler->start(); m_textLayoutCompiler->start(); - emit pageImageChanged(true, { }); + Q_EMIT pageImageChanged(true, { }); } } @@ -1491,7 +1491,7 @@ void PDFDrawWidgetProxy::setPreferredMeshResolutionRatio(PDFReal ratio) m_compiler->stop(true); m_meshQualitySettings.preferredMeshResolutionRatio = ratio; m_compiler->start(); - emit pageImageChanged(true, { }); + Q_EMIT pageImageChanged(true, { }); } } @@ -1502,7 +1502,7 @@ void PDFDrawWidgetProxy::setMinimalMeshResolutionRatio(PDFReal ratio) m_compiler->stop(true); m_meshQualitySettings.minimalMeshResolutionRatio = ratio; m_compiler->start(); - emit pageImageChanged(true, { }); + Q_EMIT pageImageChanged(true, { }); } } @@ -1513,21 +1513,21 @@ void PDFDrawWidgetProxy::setColorTolerance(PDFReal colorTolerance) m_compiler->stop(true); m_meshQualitySettings.tolerance = colorTolerance; m_compiler->start(); - emit pageImageChanged(true, { }); + Q_EMIT pageImageChanged(true, { }); } } void PDFDrawWidgetProxy::onColorManagementSystemChanged() { m_compiler->reset(); - emit pageImageChanged(true, { }); + Q_EMIT pageImageChanged(true, { }); } void PDFDrawWidgetProxy::onOptionalContentGroupStateChanged() { m_compiler->reset(); m_textLayoutCompiler->reset(); - emit pageImageChanged(true, { }); + Q_EMIT pageImageChanged(true, { }); } void IDocumentDrawInterface::drawPage(QPainter* painter, diff --git a/Pdf4QtLib/sources/pdfdrawwidget.cpp b/Pdf4QtLib/sources/pdfdrawwidget.cpp index 42ff232..7e589d7 100644 --- a/Pdf4QtLib/sources/pdfdrawwidget.cpp +++ b/Pdf4QtLib/sources/pdfdrawwidget.cpp @@ -146,7 +146,7 @@ void PDFWidget::onRenderingError(PDFInteger pageIndex, const QList& pages) diff --git a/Pdf4QtLib/sources/pdfform.cpp b/Pdf4QtLib/sources/pdfform.cpp index 99a9e2a..47a191c 100644 --- a/Pdf4QtLib/sources/pdfform.cpp +++ b/Pdf4QtLib/sources/pdfform.cpp @@ -1202,7 +1202,7 @@ void PDFFormManager::setFormFieldValue(PDFFormField::SetValueParameters paramete if (modifier.finalize()) { - emit documentModified(PDFModifiedDocument(modifier.getDocument(), nullptr, modifier.getFlags())); + Q_EMIT documentModified(PDFModifiedDocument(modifier.getDocument(), nullptr, modifier.getFlags())); } } } @@ -1565,7 +1565,7 @@ void PDFFormManager::performPaging() if (modifier.finalize()) { - emit documentModified(PDFModifiedDocument(modifier.getDocument(), nullptr, modifier.getFlags())); + Q_EMIT documentModified(PDFModifiedDocument(modifier.getDocument(), nullptr, modifier.getFlags())); } } } @@ -1727,7 +1727,7 @@ void PDFFormManager::performResetAction(const PDFActionResetForm* action) if (modifier.finalize()) { - emit documentModified(PDFModifiedDocument(modifier.getDocument(), nullptr, modifier.getFlags())); + Q_EMIT documentModified(PDFModifiedDocument(modifier.getDocument(), nullptr, modifier.getFlags())); } } @@ -1967,11 +1967,11 @@ void PDFFormFieldPushButtonEditor::click() { if (const PDFAction* mousePressAction = m_formManager->getAction(PDFAnnotationAdditionalActions::MousePressed, getFormWidget())) { - emit m_formManager->actionTriggered(mousePressAction); + Q_EMIT m_formManager->actionTriggered(mousePressAction); } else if (const PDFAction* defaultAction = m_formManager->getAction(PDFAnnotationAdditionalActions::Default, getFormWidget())) { - emit m_formManager->actionTriggered(defaultAction); + Q_EMIT m_formManager->actionTriggered(defaultAction); } } diff --git a/Pdf4QtLib/sources/pdfitemmodels.cpp b/Pdf4QtLib/sources/pdfitemmodels.cpp index e23d497..896f03f 100644 --- a/Pdf4QtLib/sources/pdfitemmodels.cpp +++ b/Pdf4QtLib/sources/pdfitemmodels.cpp @@ -727,10 +727,10 @@ void PDFThumbnailsItemModel::setThumbnailsSize(int size) { if (m_thumbnailSize != size) { - emit layoutAboutToBeChanged(); + Q_EMIT layoutAboutToBeChanged(); m_thumbnailSize = size; m_thumbnailCache.clear(); - emit layoutChanged(); + Q_EMIT layoutChanged(); } } @@ -773,7 +773,7 @@ void PDFThumbnailsItemModel::onPageImageChanged(bool all, const std::vectoraddItem(item.name, item.flags); } - connect(comboBox, QOverload::of(&QComboBox::currentIndexChanged), this, [this, attribute](){ emit commitRequested(attribute); }); + connect(comboBox, QOverload::of(&QComboBox::currentIndexChanged), this, [this, attribute](){ Q_EMIT commitRequested(attribute); }); } PDFObject PDFObjectEditorMappedComboBoxAdapter::getValue() const @@ -604,7 +604,7 @@ PDFObjectEditorMappedLineEditAdapter::PDFObjectEditorMappedLineEditAdapter(QLabe initLabel(label); lineEdit->setClearButtonEnabled(true); - connect(lineEdit, &QLineEdit::editingFinished, this, [this, attribute](){ emit commitRequested(attribute); }); + connect(lineEdit, &QLineEdit::editingFinished, this, [this, attribute](){ Q_EMIT commitRequested(attribute); }); } PDFObject PDFObjectEditorMappedLineEditAdapter::getValue() const @@ -645,7 +645,7 @@ PDFObjectEditorMappedTextBrowserAdapter::PDFObjectEditorMappedTextBrowserAdapter textBrowser->setUndoRedoEnabled(true); textBrowser->setTextInteractionFlags(Qt::TextEditorInteraction); - connect(textBrowser, &QTextBrowser::textChanged, this, [this, attribute](){ emit commitRequested(attribute); }); + connect(textBrowser, &QTextBrowser::textChanged, this, [this, attribute](){ Q_EMIT commitRequested(attribute); }); } PDFObject PDFObjectEditorMappedTextBrowserAdapter::getValue() const @@ -721,7 +721,7 @@ PDFObjectEditorMappedDateTimeAdapter::PDFObjectEditorMappedDateTimeAdapter(QLabe { initLabel(label); - connect(dateTimeEdit, &QDateTimeEdit::editingFinished, this, [this, attribute](){ emit commitRequested(attribute); }); + connect(dateTimeEdit, &QDateTimeEdit::editingFinished, this, [this, attribute](){ Q_EMIT commitRequested(attribute); }); } PDFObject PDFObjectEditorMappedDateTimeAdapter::getValue() const @@ -767,7 +767,7 @@ PDFObjectEditorMappedFlagsAdapter::PDFObjectEditorMappedFlagsAdapter(std::vector for (const auto& item : m_flagCheckBoxes) { QCheckBox* checkBox = item.second; - connect(checkBox, &QCheckBox::clicked, this, [this, attribute](){ emit commitRequested(attribute); }); + connect(checkBox, &QCheckBox::clicked, this, [this, attribute](){ Q_EMIT commitRequested(attribute); }); } } @@ -822,7 +822,7 @@ PDFObjectEditorMappedCheckBoxAdapter::PDFObjectEditorMappedCheckBoxAdapter(QLabe m_checkBox(checkBox) { initLabel(label); - connect(checkBox, &QCheckBox::clicked, this, [this, attribute](){ emit commitRequested(attribute); }); + connect(checkBox, &QCheckBox::clicked, this, [this, attribute](){ Q_EMIT commitRequested(attribute); }); } PDFObject PDFObjectEditorMappedCheckBoxAdapter::getValue() const @@ -858,7 +858,7 @@ PDFObjectEditorMappedDoubleAdapter::PDFObjectEditorMappedDoubleAdapter(QLabel* l { initLabel(label); - connect(spinBox, &QDoubleSpinBox::editingFinished, this, [this, attribute](){ emit commitRequested(attribute); }); + connect(spinBox, &QDoubleSpinBox::editingFinished, this, [this, attribute](){ Q_EMIT commitRequested(attribute); }); } PDFObject PDFObjectEditorMappedDoubleAdapter::getValue() const @@ -904,7 +904,7 @@ PDFObjectEditorMappedColorAdapter::PDFObjectEditorMappedColorAdapter(QLabel* lab comboBox->addItem(getIconForColor(color), colorName, color); } - connect(comboBox, QOverload::of(&QComboBox::currentIndexChanged), this, [this, attribute](){ emit commitRequested(attribute); }); + connect(comboBox, QOverload::of(&QComboBox::currentIndexChanged), this, [this, attribute](){ Q_EMIT commitRequested(attribute); }); } PDFObject PDFObjectEditorMappedColorAdapter::getValue() const diff --git a/Pdf4QtLib/sources/pdfoptimizer.cpp b/Pdf4QtLib/sources/pdfoptimizer.cpp index 829c076..7331148 100644 --- a/Pdf4QtLib/sources/pdfoptimizer.cpp +++ b/Pdf4QtLib/sources/pdfoptimizer.cpp @@ -240,10 +240,10 @@ void PDFOptimizer::optimize() int stage = 1; - emit optimizationStarted(); + Q_EMIT optimizationStarted(); for (OptimizationFlags flags : stages) { - emit optimizationProgress(tr("Stage %1").arg(stage++)); + Q_EMIT optimizationProgress(tr("Stage %1").arg(stage++)); OptimizationFlags currentSteps = flags & m_flags; int passIndex = 1; @@ -251,7 +251,7 @@ void PDFOptimizer::optimize() bool pass = true; while (pass) { - emit optimizationProgress(tr("Pass %1").arg(passIndex++)); + Q_EMIT optimizationProgress(tr("Pass %1").arg(passIndex++)); pass = false; if (currentSteps.testFlag(DereferenceSimpleObjects)) @@ -280,7 +280,7 @@ void PDFOptimizer::optimize() } } } - emit optimizationFinished(); + Q_EMIT optimizationFinished(); } PDFOptimizer::OptimizationFlags PDFOptimizer::getFlags() const @@ -307,7 +307,7 @@ bool PDFOptimizer::performDereferenceSimpleObjects() PDFExecutionPolicy::execute(PDFExecutionPolicy::Scope::Unknown, objects.begin(), objects.end(), processEntry); m_storage.setObjects(qMove(objects)); - emit optimizationProgress(tr("Simple objects dereferenced and embedded: %1").arg(counter)); + Q_EMIT optimizationProgress(tr("Simple objects dereferenced and embedded: %1").arg(counter)); return false; } @@ -326,7 +326,7 @@ bool PDFOptimizer::performRemoveNullObjects() PDFExecutionPolicy::execute(PDFExecutionPolicy::Scope::Unknown, objects.begin(), objects.end(), processEntry); m_storage.setObjects(qMove(objects)); - emit optimizationProgress(tr("Null objects entries from dictionaries removed: %1").arg(counter)); + Q_EMIT optimizationProgress(tr("Null objects entries from dictionaries removed: %1").arg(counter)); return false; } @@ -351,7 +351,7 @@ bool PDFOptimizer::performRemoveUnusedObjects() PDFExecutionPolicy::execute(PDFExecutionPolicy::Scope::Unknown, range.begin(), range.end(), processEntry); m_storage.setObjects(qMove(objects)); - emit optimizationProgress(tr("Unused objects removed: %1").arg(counter)); + Q_EMIT optimizationProgress(tr("Unused objects removed: %1").arg(counter)); return counter > 0; } @@ -415,7 +415,7 @@ bool PDFOptimizer::performMergeIdenticalObjects() } m_storage.setObjects(qMove(objects)); - emit optimizationProgress(tr("Identical objects merged: %1").arg(counter)); + Q_EMIT optimizationProgress(tr("Identical objects merged: %1").arg(counter)); return counter > 0; } @@ -511,7 +511,7 @@ bool PDFOptimizer::performShrinkObjectStorage() const size_t newObjectCount = objects.size(); m_storage.setObjects(qMove(objects)); - emit optimizationProgress(tr("Object list shrinked by: %1").arg(objectCount - newObjectCount)); + Q_EMIT optimizationProgress(tr("Object list shrinked by: %1").arg(objectCount - newObjectCount)); return false; } @@ -561,7 +561,7 @@ bool PDFOptimizer::performRecompressFlateStreams() PDFExecutionPolicy::execute(PDFExecutionPolicy::Scope::Unknown, objects.begin(), objects.end(), processEntry); m_storage.setObjects(qMove(objects)); - emit optimizationProgress(tr("Bytes saved by recompressing stream: %1").arg(bytesSaved)); + Q_EMIT optimizationProgress(tr("Bytes saved by recompressing stream: %1").arg(bytesSaved)); return false; } diff --git a/Pdf4QtLib/sources/pdfoptionalcontent.cpp b/Pdf4QtLib/sources/pdfoptionalcontent.cpp index ef638f2..e64e009 100644 --- a/Pdf4QtLib/sources/pdfoptionalcontent.cpp +++ b/Pdf4QtLib/sources/pdfoptionalcontent.cpp @@ -407,7 +407,7 @@ void PDFOptionalContentActivity::setState(PDFObjectReference ocg, OCState state, } it->second = state; - emit optionalContentGroupStateChanged(ocg, state); + Q_EMIT optionalContentGroupStateChanged(ocg, state); } } diff --git a/Pdf4QtLib/sources/pdfpagecontenteditorstylesettings.cpp b/Pdf4QtLib/sources/pdfpagecontenteditorstylesettings.cpp index 7ec14cd..8b88ee2 100644 --- a/Pdf4QtLib/sources/pdfpagecontenteditorstylesettings.cpp +++ b/Pdf4QtLib/sources/pdfpagecontenteditorstylesettings.cpp @@ -192,7 +192,7 @@ void PDFPageContentEditorStyleSettings::setPen(const QPen& pen, bool forceUpdate setColorToComboBox(ui->penColorCombo, pen.color()); blockSignals(oldBlockSignals); - emit penChanged(m_pen); + Q_EMIT penChanged(m_pen); } } @@ -207,7 +207,7 @@ void PDFPageContentEditorStyleSettings::setBrush(const QBrush& brush, bool force setColorToComboBox(ui->brushColorCombo, brush.color()); blockSignals(oldBlockSignals); - emit brushChanged(m_brush); + Q_EMIT brushChanged(m_brush); } } @@ -221,7 +221,7 @@ void PDFPageContentEditorStyleSettings::setFont(const QFont& font, bool forceUpd ui->fontComboBox->setCurrentFont(m_font); blockSignals(oldBlockSignals); - emit fontChanged(m_font); + Q_EMIT fontChanged(m_font); } } @@ -241,7 +241,7 @@ void PDFPageContentEditorStyleSettings::setFontAlignment(Qt::Alignment alignment radioButton->setChecked(true); blockSignals(oldBlockSignals); - emit alignmentChanged(m_alignment); + Q_EMIT alignmentChanged(m_alignment); } } @@ -252,7 +252,7 @@ void PDFPageContentEditorStyleSettings::setTextAngle(PDFReal angle, bool forceUp const bool oldBlockSignals = blockSignals(true); ui->textAngleEdit->setValue(angle); blockSignals(oldBlockSignals); - emit textAngleChanged(ui->textAngleEdit->value()); + Q_EMIT textAngleChanged(ui->textAngleEdit->value()); } } @@ -371,7 +371,7 @@ void PDFPageContentEditorStyleSettings::onSelectFontButtonClicked() { m_font = font; ui->fontComboBox->setCurrentFont(m_font); - emit fontChanged(m_font); + Q_EMIT fontChanged(m_font); } } @@ -381,7 +381,7 @@ void PDFPageContentEditorStyleSettings::setPenColor(QColor color) { m_pen.setColor(color); setColorToComboBox(ui->penColorCombo, color); - emit penChanged(m_pen); + Q_EMIT penChanged(m_pen); } } @@ -397,7 +397,7 @@ void PDFPageContentEditorStyleSettings::setBrushColor(QColor color) { m_brush.setColor(color); setColorToComboBox(ui->brushColorCombo, color); - emit brushChanged(m_brush); + Q_EMIT brushChanged(m_brush); } } @@ -437,13 +437,13 @@ void PDFPageContentEditorStyleSettings::onPenWidthChanged(double value) if (m_pen.widthF() != value) { m_pen.setWidthF(value); - emit penChanged(m_pen); + Q_EMIT penChanged(m_pen); } } void PDFPageContentEditorStyleSettings::onTextAngleChanged(double value) { - emit textAngleChanged(value); + Q_EMIT textAngleChanged(value); } void PDFPageContentEditorStyleSettings::onAlignmentRadioButtonClicked(int alignment) @@ -452,7 +452,7 @@ void PDFPageContentEditorStyleSettings::onAlignmentRadioButtonClicked(int alignm if (m_alignment != alignmentValue) { m_alignment = alignmentValue; - emit alignmentChanged(m_alignment); + Q_EMIT alignmentChanged(m_alignment); } } @@ -462,7 +462,7 @@ void PDFPageContentEditorStyleSettings::onPenStyleChanged() if (m_pen.style() != penStyle) { m_pen.setStyle(penStyle); - emit penChanged(m_pen); + Q_EMIT penChanged(m_pen); } } @@ -472,7 +472,7 @@ void PDFPageContentEditorStyleSettings::onBrushStyleChanged() if (m_brush.style() != brushStyle) { m_brush.setStyle(brushStyle); - emit brushChanged(m_brush); + Q_EMIT brushChanged(m_brush); } } @@ -486,7 +486,7 @@ void PDFPageContentEditorStyleSettings::onPenColorComboTextChanged() if (m_pen.color() != color) { m_pen.setColor(color); - emit penChanged(m_pen); + Q_EMIT penChanged(m_pen); } } else if (ui->penColorCombo->currentIndex() != -1) @@ -502,7 +502,7 @@ void PDFPageContentEditorStyleSettings::onPenColorComboIndexChanged() if (color.isValid() && m_pen.color() != color) { m_pen.setColor(color); - emit penChanged(m_pen); + Q_EMIT penChanged(m_pen); } } @@ -516,7 +516,7 @@ void PDFPageContentEditorStyleSettings::onBrushColorComboTextChanged() if (m_brush.color() != color) { m_brush.setColor(color); - emit brushChanged(m_brush); + Q_EMIT brushChanged(m_brush); } } else if (ui->brushColorCombo->currentIndex() != -1) @@ -532,7 +532,7 @@ void PDFPageContentEditorStyleSettings::onBrushColorComboIndexChanged() if (color.isValid() && m_brush.color() != color) { m_brush.setColor(color); - emit brushChanged(m_brush); + Q_EMIT brushChanged(m_brush); } } @@ -541,7 +541,7 @@ void PDFPageContentEditorStyleSettings::onFontChanged(const QFont& font) if (m_font != font) { m_font = font; - emit fontChanged(m_font); + Q_EMIT fontChanged(m_font); } } diff --git a/Pdf4QtLib/sources/pdfpagecontenteditortools.cpp b/Pdf4QtLib/sources/pdfpagecontenteditortools.cpp index 89ed1a1..443ccfb 100644 --- a/Pdf4QtLib/sources/pdfpagecontenteditortools.cpp +++ b/Pdf4QtLib/sources/pdfpagecontenteditortools.cpp @@ -46,7 +46,7 @@ void PDFCreatePCElementTool::setPen(const QPen& pen) if (PDFPageContentStyledElement* styledElement = dynamic_cast(getElement())) { styledElement->setPen(pen); - emit getProxy()->repaintNeeded(); + Q_EMIT getProxy()->repaintNeeded(); } } @@ -55,7 +55,7 @@ void PDFCreatePCElementTool::setBrush(const QBrush& brush) if (PDFPageContentStyledElement* styledElement = dynamic_cast(getElement())) { styledElement->setBrush(brush); - emit getProxy()->repaintNeeded(); + Q_EMIT getProxy()->repaintNeeded(); } } @@ -64,7 +64,7 @@ void PDFCreatePCElementTool::setFont(const QFont& font) if (PDFPageContentElementTextBox* textBoxElement = dynamic_cast(getElement())) { textBoxElement->setFont(font); - emit getProxy()->repaintNeeded(); + Q_EMIT getProxy()->repaintNeeded(); } } @@ -73,7 +73,7 @@ void PDFCreatePCElementTool::setAlignment(Qt::Alignment alignment) if (PDFPageContentElementTextBox* textBoxElement = dynamic_cast(getElement())) { textBoxElement->setAlignment(alignment); - emit getProxy()->repaintNeeded(); + Q_EMIT getProxy()->repaintNeeded(); } } @@ -82,7 +82,7 @@ void PDFCreatePCElementTool::setTextAngle(PDFReal angle) if (PDFPageContentElementTextBox* textBoxElement = dynamic_cast(getElement())) { textBoxElement->setAngle(angle); - emit getProxy()->repaintNeeded(); + Q_EMIT getProxy()->repaintNeeded(); } } @@ -590,7 +590,7 @@ void PDFCreatePCElementFreehandCurveTool::mousePressEvent(QWidget* widget, QMous resetTool(); } - emit getProxy()->repaintNeeded(); + Q_EMIT getProxy()->repaintNeeded(); } void PDFCreatePCElementFreehandCurveTool::mouseReleaseEvent(QWidget* widget, QMouseEvent* event) @@ -618,7 +618,7 @@ void PDFCreatePCElementFreehandCurveTool::mouseReleaseEvent(QWidget* widget, QMo resetTool(); } - emit getProxy()->repaintNeeded(); + Q_EMIT getProxy()->repaintNeeded(); } void PDFCreatePCElementFreehandCurveTool::mouseMoveEvent(QWidget* widget, QMouseEvent* event) @@ -636,7 +636,7 @@ void PDFCreatePCElementFreehandCurveTool::mouseMoveEvent(QWidget* widget, QMouse m_element->addPoint(pagePoint); } - emit getProxy()->repaintNeeded(); + Q_EMIT getProxy()->repaintNeeded(); } } @@ -940,14 +940,14 @@ void PDFCreatePCElementTextTool::setFont(const QFont& font) { BaseClass::setFont(font); m_textEditWidget->setAppearance(font, m_element->getAlignment(), m_element->getRectangle(), std::numeric_limits::max(), m_element->getPen().color()); - emit getProxy()->repaintNeeded(); + Q_EMIT getProxy()->repaintNeeded(); } void PDFCreatePCElementTextTool::setAlignment(Qt::Alignment alignment) { BaseClass::setAlignment(alignment); m_textEditWidget->setAppearance(m_element->getFont(), alignment, m_element->getRectangle(), std::numeric_limits::max(), m_element->getPen().color()); - emit getProxy()->repaintNeeded(); + Q_EMIT getProxy()->repaintNeeded(); } void PDFCreatePCElementTextTool::setPen(const QPen& pen) @@ -962,7 +962,7 @@ void PDFCreatePCElementTextTool::setPen(const QPen& pen) } m_textEditWidget->setAppearance(font, m_element->getAlignment(), m_element->getRectangle(), std::numeric_limits::max(), pen.color()); - emit getProxy()->repaintNeeded(); + Q_EMIT getProxy()->repaintNeeded(); } } // namespace pdf diff --git a/Pdf4QtLib/sources/pdfpagecontenteditorwidget.cpp b/Pdf4QtLib/sources/pdfpagecontenteditorwidget.cpp index ed0bfcc..d3088ff 100644 --- a/Pdf4QtLib/sources/pdfpagecontenteditorwidget.cpp +++ b/Pdf4QtLib/sources/pdfpagecontenteditorwidget.cpp @@ -221,7 +221,7 @@ void PDFPageContentEditorWidget::onItemSelectionChanged() { if (m_selectionChangeEnabled) { - emit itemSelectionChangedByUser(); + Q_EMIT itemSelectionChangedByUser(); } } diff --git a/Pdf4QtLib/sources/pdfpagecontentelements.cpp b/Pdf4QtLib/sources/pdfpagecontentelements.cpp index f5d6638..c32cf1e 100644 --- a/Pdf4QtLib/sources/pdfpagecontentelements.cpp +++ b/Pdf4QtLib/sources/pdfpagecontentelements.cpp @@ -344,7 +344,7 @@ void PDFPageContentScene::addElement(PDFPageContentElement* element) { element->setElementId(m_firstFreeId++); m_elements.emplace_back(element); - emit sceneChanged(false); + Q_EMIT sceneChanged(false); } void PDFPageContentScene::replaceElement(PDFPageContentElement* element) @@ -356,7 +356,7 @@ void PDFPageContentScene::replaceElement(PDFPageContentElement* element) if (m_elements[i]->getElementId() == element->getElementId()) { m_elements[i] = std::move(elementPtr); - emit sceneChanged(false); + Q_EMIT sceneChanged(false); break; } } @@ -379,7 +379,7 @@ void PDFPageContentScene::clear() { m_manipulator.reset(); m_elements.clear(); - emit sceneChanged(false); + Q_EMIT sceneChanged(false); } } @@ -507,7 +507,7 @@ void PDFPageContentScene::mouseDoubleClickEvent(QWidget* widget, QMouseEvent* ev MouseEventInfo info = getMouseEventInfo(widget, event->pos()); if (info.isValid()) { - emit editElementRequest(info.hoveredElementIds); + Q_EMIT editElementRequest(info.hoveredElementIds); } // If mouse is grabbed, then event is accepted always (because @@ -602,7 +602,7 @@ void PDFPageContentScene::mouseMoveEvent(QWidget* widget, QMouseEvent* event) if (m_manipulator.isManipulationInProgress()) { - emit sceneChanged(true); + Q_EMIT sceneChanged(true); } } @@ -815,8 +815,8 @@ void PDFPageContentScene::updateMouseCursor(const MouseEventInfo& info, PDFReal void PDFPageContentScene::onSelectionChanged() { - emit sceneChanged(true); - emit selectionChanged(); + Q_EMIT sceneChanged(true); + Q_EMIT selectionChanged(); } PDFWidget* PDFPageContentScene::widget() const @@ -846,7 +846,7 @@ void PDFPageContentScene::setActive(bool newIsActive) m_manipulator.reset(); } - emit sceneChanged(false); + Q_EMIT sceneChanged(false); } } @@ -917,7 +917,7 @@ void PDFPageContentScene::removeElementsById(const std::vector& sele if (newSize < oldSize) { - emit sceneChanged(false); + Q_EMIT sceneChanged(false); } } @@ -1518,7 +1518,7 @@ void PDFPageContentElementManipulator::update(PDFInteger id, SelectionModes mode if (modified) { - emit selectionChanged(); + Q_EMIT selectionChanged(); } } @@ -1580,7 +1580,7 @@ void PDFPageContentElementManipulator::update(const std::set& ids, S if (modified) { - emit selectionChanged(); + Q_EMIT selectionChanged(); } } @@ -2195,7 +2195,7 @@ void PDFPageContentElementManipulator::startManipulation(PDFInteger pageIndex, m_isManipulationInProgress = true; m_lastUpdatedPoint = startPoint; updateManipulation(pageIndex, startPoint, currentPoint); - emit stateChanged(); + Q_EMIT stateChanged(); } } @@ -2216,7 +2216,7 @@ void PDFPageContentElementManipulator::updateManipulation(PDFInteger pageIndex, } m_lastUpdatedPoint = currentPoint; - emit stateChanged(); + Q_EMIT stateChanged(); } void PDFPageContentElementManipulator::finishManipulation(PDFInteger pageIndex, @@ -2252,7 +2252,7 @@ void PDFPageContentElementManipulator::cancelManipulation() m_isManipulationInProgress = false; m_manipulatedElements.clear(); m_manipulationModes.clear(); - emit stateChanged(); + Q_EMIT stateChanged(); } Q_ASSERT(!m_isManipulationInProgress); diff --git a/Pdf4QtLib/sources/pdfpagenavigation.cpp b/Pdf4QtLib/sources/pdfpagenavigation.cpp index d132094..c6ab620 100644 --- a/Pdf4QtLib/sources/pdfpagenavigation.cpp +++ b/Pdf4QtLib/sources/pdfpagenavigation.cpp @@ -57,7 +57,7 @@ void PDFPageNavigation::navigateToPage(size_t pageIndex) executeNavigationNode(isForward ? Direction::Forward : Direction::Backward); // Step c) Navigate to new page - send navigation request. - emit pageChangeRequest(m_currentPageIndex, &m_transition); + Q_EMIT pageChangeRequest(m_currentPageIndex, &m_transition); } void PDFPageNavigation::navigateForward() @@ -104,7 +104,7 @@ void PDFPageNavigation::executeNavigationNode(Direction direction) { for (const PDFAction* currentAction : action->getActionList()) { - emit actionTriggered(currentAction); + Q_EMIT actionTriggered(currentAction); } } break; @@ -116,7 +116,7 @@ void PDFPageNavigation::executeNavigationNode(Direction direction) { for (const PDFAction* currentAction : action->getActionList()) { - emit actionTriggered(currentAction); + Q_EMIT actionTriggered(currentAction); } } break; diff --git a/Pdf4QtLib/sources/pdfprogress.cpp b/Pdf4QtLib/sources/pdfprogress.cpp index 9b75a35..ef26d0f 100644 --- a/Pdf4QtLib/sources/pdfprogress.cpp +++ b/Pdf4QtLib/sources/pdfprogress.cpp @@ -35,7 +35,7 @@ void PDFProgress::start(size_t stepCount, ProgressStartupInfo startupInfo) m_stepCount = stepCount; m_percentage = 0; - emit progressStarted(qMove(startupInfo)); + Q_EMIT progressStarted(qMove(startupInfo)); } void PDFProgress::step() @@ -55,13 +55,13 @@ void PDFProgress::step() if (emitSignal) { - emit progressStep(newPercentage); + Q_EMIT progressStep(newPercentage); } } void PDFProgress::finish() { - emit progressFinished(); + Q_EMIT progressFinished(); } } // namespace pdf diff --git a/Pdf4QtLib/sources/pdfrenderer.cpp b/Pdf4QtLib/sources/pdfrenderer.cpp index d5502c1..52e3989 100644 --- a/Pdf4QtLib/sources/pdfrenderer.cpp +++ b/Pdf4QtLib/sources/pdfrenderer.cpp @@ -426,7 +426,7 @@ void PDFRasterizerPool::render(const std::vector& pageIndices, QElapsedTimer timer; timer.start(); - emit renderError(PDFCatalog::INVALID_PAGE_INDEX, PDFRenderError(RenderErrorType::Information, PDFTranslationContext::tr("Start at %1...").arg(QTime::currentTime().toString(Qt::TextDate)))); + Q_EMIT renderError(PDFCatalog::INVALID_PAGE_INDEX, PDFRenderError(RenderErrorType::Information, PDFTranslationContext::tr("Start at %1...").arg(QTime::currentTime().toString(Qt::TextDate)))); if (progress) { @@ -445,7 +445,7 @@ void PDFRasterizerPool::render(const std::vector& pageIndices, { progress->step(); } - emit renderError(pageIndex, PDFRenderError(RenderErrorType::Error, PDFTranslationContext::tr("Page %1 not found.").arg(pageIndex))); + Q_EMIT renderError(pageIndex, PDFRenderError(RenderErrorType::Error, PDFTranslationContext::tr("Page %1 not found.").arg(pageIndex))); return; } @@ -465,7 +465,7 @@ void PDFRasterizerPool::render(const std::vector& pageIndices, for (const PDFRenderError& error : precompiledPage.getErrors()) { - emit renderError(pageIndex, error); + Q_EMIT renderError(pageIndex, error); } // We can const-cast here, because we do not modify the document in annotation manager. @@ -506,8 +506,8 @@ void PDFRasterizerPool::render(const std::vector& pageIndices, progress->finish(); } - emit renderError(PDFCatalog::INVALID_PAGE_INDEX, PDFRenderError(RenderErrorType::Information, PDFTranslationContext::tr("Finished at %1...").arg(QTime::currentTime().toString(Qt::TextDate)))); - emit renderError(PDFCatalog::INVALID_PAGE_INDEX, PDFRenderError(RenderErrorType::Information, PDFTranslationContext::tr("%1 miliseconds elapsed to render %2 pages...").arg(timer.nsecsElapsed() / 1000000).arg(pageIndices.size()))); + Q_EMIT renderError(PDFCatalog::INVALID_PAGE_INDEX, PDFRenderError(RenderErrorType::Information, PDFTranslationContext::tr("Finished at %1...").arg(QTime::currentTime().toString(Qt::TextDate)))); + Q_EMIT renderError(PDFCatalog::INVALID_PAGE_INDEX, PDFRenderError(RenderErrorType::Information, PDFTranslationContext::tr("%1 miliseconds elapsed to render %2 pages...").arg(timer.nsecsElapsed() / 1000000).arg(pageIndices.size()))); } int PDFRasterizerPool::getDefaultRasterizerCount() diff --git a/Pdf4QtLib/sources/pdfwidgettool.cpp b/Pdf4QtLib/sources/pdfwidgettool.cpp index fef32e0..28ef995 100644 --- a/Pdf4QtLib/sources/pdfwidgettool.cpp +++ b/Pdf4QtLib/sources/pdfwidgettool.cpp @@ -102,8 +102,8 @@ void PDFWidgetTool::setActive(bool active) setActiveImpl(active); updateActions(); - emit m_proxy->repaintNeeded(); - emit toolActivityChanged(active); + Q_EMIT m_proxy->repaintNeeded(); + Q_EMIT toolActivityChanged(active); } } @@ -1176,7 +1176,7 @@ void PDFPickTool::mousePressEvent(QWidget* widget, QMouseEvent* event) m_snapper.setReferencePoint(pageIndex, pagePoint); // Emit signal about picked point - emit pointPicked(pageIndex, pagePoint); + Q_EMIT pointPicked(pageIndex, pagePoint); if (m_mode == Mode::Rectangles && m_pickedPoints.size() == 2) { @@ -1189,14 +1189,14 @@ void PDFPickTool::mousePressEvent(QWidget* widget, QMouseEvent* event) const qreal yMax = qMax(first.y(), second.y()); QRectF pageRectangle(xMin, yMin, xMax - xMin, yMax - yMin); - emit rectanglePicked(pageIndex, pageRectangle); + Q_EMIT rectanglePicked(pageIndex, pageRectangle); // We must reset tool, to pick next rectangle resetTool(); } buildSnapData(); - emit getProxy()->repaintNeeded(); + Q_EMIT getProxy()->repaintNeeded(); } } else @@ -1204,7 +1204,7 @@ void PDFPickTool::mousePressEvent(QWidget* widget, QMouseEvent* event) // Try to perform pick image if (const PDFSnapper::ViewportSnapImage* snappedImage = m_snapper.getSnappedImage()) { - emit imagePicked(snappedImage->image); + Q_EMIT imagePicked(snappedImage->image); } } } @@ -1230,7 +1230,7 @@ void PDFPickTool::mouseMoveEvent(QWidget* widget, QMouseEvent* event) { m_mousePosition = mousePos; m_snapper.updateSnappedPoint(m_mousePosition); - emit getProxy()->repaintNeeded(); + Q_EMIT getProxy()->repaintNeeded(); } } @@ -1271,7 +1271,7 @@ void PDFPickTool::resetTool() m_snapper.clearReferencePoint(); buildSnapData(); - emit getProxy()->repaintNeeded(); + Q_EMIT getProxy()->repaintNeeded(); } void PDFPickTool::buildSnapData() @@ -1334,7 +1334,7 @@ void PDFScreenshotTool::onRectanglePicked(PDFInteger pageIndex, QRectF pageRecta } QApplication::clipboard()->setImage(image, QClipboard::Clipboard); - emit messageDisplayRequest(tr("Page contents of size %1 x %2 pixels were copied to the clipboard.").arg(image.width()).arg(image.height()), 5000); + Q_EMIT messageDisplayRequest(tr("Page contents of size %1 x %2 pixels were copied to the clipboard.").arg(image.width()).arg(image.height()), 5000); } } } @@ -1365,7 +1365,7 @@ void PDFExtractImageTool::onImagePicked(const QImage& image) if (!image.isNull()) { QApplication::clipboard()->setImage(image, QClipboard::Clipboard); - emit messageDisplayRequest(tr("Image of size %1 x %2 pixels was copied to the clipboard.").arg(image.width()).arg(image.height()), 5000); + Q_EMIT messageDisplayRequest(tr("Image of size %1 x %2 pixels was copied to the clipboard.").arg(image.width()).arg(image.height()), 5000); } } @@ -1487,7 +1487,7 @@ void PDFSelectTableTool::mousePressEvent(QWidget* widget, QMouseEvent* event) } } - emit getProxy()->repaintNeeded(); + Q_EMIT getProxy()->repaintNeeded(); event->accept(); } } @@ -1671,7 +1671,7 @@ void PDFSelectTableTool::onRectanglePicked(PDFInteger pageIndex, QRectF pageRect autodetectTableGeometry(); - emit messageDisplayRequest(tr("Table region was selected. Use left/right mouse buttons to add/remove rows/columns, then use Enter key to copy the table."), 5000); + Q_EMIT messageDisplayRequest(tr("Table region was selected. Use left/right mouse buttons to add/remove rows/columns, then use Enter key to copy the table."), 5000); } void PDFSelectTableTool::autodetectTableGeometry() diff --git a/Pdf4QtViewer/pdfoptimizedocumentdialog.cpp b/Pdf4QtViewer/pdfoptimizedocumentdialog.cpp index be923ca..2a8f625 100644 --- a/Pdf4QtViewer/pdfoptimizedocumentdialog.cpp +++ b/Pdf4QtViewer/pdfoptimizedocumentdialog.cpp @@ -92,7 +92,7 @@ void PDFOptimizeDocumentDialog::optimize() m_optimizationInfo.msecsElapsed = msecsElapsed; m_optimizationInfo.bytesBeforeOptimization = pdf::PDFDocumentWriter::getDocumentFileSize(m_document); m_optimizationInfo.bytesAfterOptimization = pdf::PDFDocumentWriter::getDocumentFileSize(&m_optimizedDocument); - emit displayOptimizationInfo(); + Q_EMIT displayOptimizationInfo(); } void PDFOptimizeDocumentDialog::onOptimizeButtonClicked() diff --git a/Pdf4QtViewer/pdfprogramcontroller.cpp b/Pdf4QtViewer/pdfprogramcontroller.cpp index 1ef7962..fb17a74 100644 --- a/Pdf4QtViewer/pdfprogramcontroller.cpp +++ b/Pdf4QtViewer/pdfprogramcontroller.cpp @@ -1538,7 +1538,7 @@ void PDFProgramController::openDocument(const QString& fileName) { QString result; *ok = false; - emit queryPasswordRequest(&result, ok); + Q_EMIT queryPasswordRequest(&result, ok); return result; }; diff --git a/Pdf4QtViewer/pdfrecentfilemanager.cpp b/Pdf4QtViewer/pdfrecentfilemanager.cpp index 835c311..767005b 100644 --- a/Pdf4QtViewer/pdfrecentfilemanager.cpp +++ b/Pdf4QtViewer/pdfrecentfilemanager.cpp @@ -99,7 +99,7 @@ void PDFRecentFileManager::onRecentFileActionTriggered() QVariant data = action->data(); if (data.typeId() == QMetaType::QString) { - emit fileOpenRequest(data.toString()); + Q_EMIT fileOpenRequest(data.toString()); } } diff --git a/Pdf4QtViewer/pdfrendertoimagesdialog.cpp b/Pdf4QtViewer/pdfrendertoimagesdialog.cpp index 18e12a4..db31229 100644 --- a/Pdf4QtViewer/pdfrendertoimagesdialog.cpp +++ b/Pdf4QtViewer/pdfrendertoimagesdialog.cpp @@ -345,7 +345,7 @@ void PDFRenderToImagesDialog::on_buttonBox_clicked(QAbstractButton* button) if (!imageWriter.write(renderedPageImage.pageImage)) { - emit m_rasterizerPool->renderError(renderedPageImage.pageIndex, pdf::PDFRenderError(pdf::RenderErrorType::Error, tr("Cannot write page image to file '%1', because: %2.").arg(fileName).arg(imageWriter.errorString()))); + Q_EMIT m_rasterizerPool->renderError(renderedPageImage.pageIndex, pdf::PDFRenderError(pdf::RenderErrorType::Error, tr("Cannot write page image to file '%1', because: %2.").arg(fileName).arg(imageWriter.errorString()))); } }; diff --git a/Pdf4QtViewer/pdfsidebarwidget.cpp b/Pdf4QtViewer/pdfsidebarwidget.cpp index 41d8675..08e0bc8 100644 --- a/Pdf4QtViewer/pdfsidebarwidget.cpp +++ b/Pdf4QtViewer/pdfsidebarwidget.cpp @@ -621,7 +621,7 @@ void PDFSidebarWidget::onOutlineItemClicked(const QModelIndex& index) { if (const pdf::PDFAction* action = m_outlineTreeModel->getAction(index)) { - emit actionTriggered(action); + Q_EMIT actionTriggered(action); } } diff --git a/Pdf4QtViewer/pdfundoredomanager.cpp b/Pdf4QtViewer/pdfundoredomanager.cpp index 64db65a..6c6a51e 100644 --- a/Pdf4QtViewer/pdfundoredomanager.cpp +++ b/Pdf4QtViewer/pdfundoredomanager.cpp @@ -45,8 +45,8 @@ void PDFUndoRedoManager::doUndo() m_redoSteps.insert(m_redoSteps.begin(), item); clampUndoRedoSteps(); - emit undoRedoStateChanged(); - emit documentChangeRequest(pdf::PDFModifiedDocument(item.oldDocument, nullptr, item.flags)); + Q_EMIT undoRedoStateChanged(); + Q_EMIT documentChangeRequest(pdf::PDFModifiedDocument(item.oldDocument, nullptr, item.flags)); } void PDFUndoRedoManager::doRedo() @@ -62,8 +62,8 @@ void PDFUndoRedoManager::doRedo() m_undoSteps.push_back(item); clampUndoRedoSteps(); - emit undoRedoStateChanged(); - emit documentChangeRequest(pdf::PDFModifiedDocument(item.newDocument, nullptr, item.flags)); + Q_EMIT undoRedoStateChanged(); + Q_EMIT documentChangeRequest(pdf::PDFModifiedDocument(item.newDocument, nullptr, item.flags)); } void PDFUndoRedoManager::clear() @@ -72,7 +72,7 @@ void PDFUndoRedoManager::clear() { m_undoSteps.clear(); m_redoSteps.clear(); - emit undoRedoStateChanged(); + Q_EMIT undoRedoStateChanged(); } } @@ -81,7 +81,7 @@ void PDFUndoRedoManager::createUndo(pdf::PDFModifiedDocument document, pdf::PDFD m_undoSteps.emplace_back(oldDocument, document, document.getFlags()); m_redoSteps.clear(); clampUndoRedoSteps(); - emit undoRedoStateChanged(); + Q_EMIT undoRedoStateChanged(); } void PDFUndoRedoManager::setMaximumSteps(size_t undoLimit, size_t redoLimit) @@ -91,7 +91,7 @@ void PDFUndoRedoManager::setMaximumSteps(size_t undoLimit, size_t redoLimit) m_undoLimit = undoLimit; m_redoLimit = redoLimit; clampUndoRedoSteps(); - emit undoRedoStateChanged(); + Q_EMIT undoRedoStateChanged(); } } diff --git a/Pdf4QtViewer/pdfviewermainwindow.h b/Pdf4QtViewer/pdfviewermainwindow.h index 0f4d044..fb0eea5 100644 --- a/Pdf4QtViewer/pdfviewermainwindow.h +++ b/Pdf4QtViewer/pdfviewermainwindow.h @@ -18,6 +18,7 @@ #ifndef PDFVIEWERMAINWINDOW_H #define PDFVIEWERMAINWINDOW_H +#include "pdfglobal.h" #include "pdfviewerglobal.h" #include "pdfcatalog.h" #include "pdfrenderer.h" diff --git a/Pdf4QtViewer/pdfviewersettings.cpp b/Pdf4QtViewer/pdfviewersettings.cpp index 0dab45a..eb75948 100644 --- a/Pdf4QtViewer/pdfviewersettings.cpp +++ b/Pdf4QtViewer/pdfviewersettings.cpp @@ -30,7 +30,7 @@ void PDFViewerSettings::setSettings(const PDFViewerSettings::Settings& settings) if (m_settings != settings) { m_settings = settings; - emit settingsChanged(); + Q_EMIT settingsChanged(); } } @@ -100,7 +100,7 @@ void PDFViewerSettings::readSettings(QSettings& settings, const pdf::PDFCMSSetti m_settings.m_signatureUseSystemStore = settings.value("signatureUseSystemStore", defaultSettings.m_signatureUseSystemStore).toBool(); settings.endGroup(); - emit settingsChanged(); + Q_EMIT settingsChanged(); } void PDFViewerSettings::writeSettings(QSettings& settings) @@ -178,7 +178,7 @@ void PDFViewerSettings::setDirectory(const QString& directory) if (m_settings.m_directory != directory) { m_settings.m_directory = directory; - emit settingsChanged(); + Q_EMIT settingsChanged(); } } @@ -192,7 +192,7 @@ void PDFViewerSettings::setFeatures(const pdf::PDFRenderer::Features& features) if (m_settings.m_features != features) { m_settings.m_features = features; - emit settingsChanged(); + Q_EMIT settingsChanged(); } } @@ -206,7 +206,7 @@ void PDFViewerSettings::setRendererEngine(pdf::RendererEngine rendererEngine) if (m_settings.m_rendererEngine != rendererEngine) { m_settings.m_rendererEngine = rendererEngine; - emit settingsChanged(); + Q_EMIT settingsChanged(); } } @@ -220,7 +220,7 @@ void PDFViewerSettings::setRendererSamples(int rendererSamples) if (m_settings.m_rendererSamples != rendererSamples) { m_settings.m_rendererSamples = rendererSamples; - emit settingsChanged(); + Q_EMIT settingsChanged(); } } @@ -229,7 +229,7 @@ void PDFViewerSettings::setPreferredMeshResolutionRatio(pdf::PDFReal preferredMe if (m_settings.m_preferredMeshResolutionRatio != preferredMeshResolutionRatio) { m_settings.m_preferredMeshResolutionRatio = preferredMeshResolutionRatio; - emit settingsChanged(); + Q_EMIT settingsChanged(); } } @@ -238,7 +238,7 @@ void PDFViewerSettings::setMinimalMeshResolutionRatio(pdf::PDFReal minimalMeshRe if (m_settings.m_minimalMeshResolutionRatio != minimalMeshResolutionRatio) { m_settings.m_minimalMeshResolutionRatio = minimalMeshResolutionRatio; - emit settingsChanged(); + Q_EMIT settingsChanged(); } } @@ -247,7 +247,7 @@ void PDFViewerSettings::setColorTolerance(pdf::PDFReal colorTolerance) if (m_settings.m_colorTolerance != colorTolerance) { m_settings.m_colorTolerance = colorTolerance; - emit settingsChanged(); + Q_EMIT settingsChanged(); } } diff --git a/Pdf4QtViewer/pdfviewersettings.h b/Pdf4QtViewer/pdfviewersettings.h index 519f7e3..eb6f90d 100644 --- a/Pdf4QtViewer/pdfviewersettings.h +++ b/Pdf4QtViewer/pdfviewersettings.h @@ -18,6 +18,7 @@ #ifndef PDFVIEWERSETTINGS_H #define PDFVIEWERSETTINGS_H +#include "pdfglobal.h" #include "pdfrenderer.h" #include "pdfcms.h" #include "pdfexecutionpolicy.h" diff --git a/Pdf4QtViewerLite/CMakeLists.txt b/Pdf4QtViewerLite/CMakeLists.txt index da36dbc..c068974 100644 --- a/Pdf4QtViewerLite/CMakeLists.txt +++ b/Pdf4QtViewerLite/CMakeLists.txt @@ -22,6 +22,10 @@ add_executable(Pdf4QtViewerLite target_link_libraries(Pdf4QtViewerLite PRIVATE Pdf4QtLib Pdf4QtViewer Qt6::Core Qt6::Gui Qt6::Widgets) +if(LINUX_GCC) + target_link_libraries(Pdf4QtViewerLite PRIVATE tbb) +endif() + set_target_properties(Pdf4QtViewerLite PROPERTIES WIN32_EXECUTABLE ON MACOSX_BUNDLE ON diff --git a/Pdf4QtViewerPlugins/DimensionsPlugin/dimensiontool.cpp b/Pdf4QtViewerPlugins/DimensionsPlugin/dimensiontool.cpp index 8cdd445..d2af61e 100644 --- a/Pdf4QtViewerPlugins/DimensionsPlugin/dimensiontool.cpp +++ b/Pdf4QtViewerPlugins/DimensionsPlugin/dimensiontool.cpp @@ -98,7 +98,7 @@ void DimensionTool::onPointPicked(pdf::PDFInteger pageIndex, QPointF pagePoint) } pdf::PDFReal measuredValue = getMeasuredValue(pageIndex, points); - emit dimensionCreated(Dimension(getDimensionType(), pageIndex, measuredValue, qMove(points))); + Q_EMIT dimensionCreated(Dimension(getDimensionType(), pageIndex, measuredValue, qMove(points))); m_pickTool->resetTool(); } @@ -118,7 +118,7 @@ void DimensionTool::onRectanglePicked(pdf::PDFInteger pageIndex, QRectF pageRect std::vector points = { pageRectangle.topLeft(), pageRectangle.topRight(), pageRectangle.bottomRight(), pageRectangle.bottomLeft(), pageRectangle.topLeft() }; Q_ASSERT(Dimension::isComplete(getDimensionType(), points)); pdf::PDFReal measuredValue = getMeasuredValue(pageIndex, points); - emit dimensionCreated(Dimension(getDimensionType(), pageIndex, measuredValue, qMove(points))); + Q_EMIT dimensionCreated(Dimension(getDimensionType(), pageIndex, measuredValue, qMove(points))); } QPointF DimensionTool::adjustPagePoint(QPointF pagePoint) const diff --git a/Pdf4QtViewerPlugins/RedactPlugin/redactplugin.cpp b/Pdf4QtViewerPlugins/RedactPlugin/redactplugin.cpp index 0c8d0fa..7740ab0 100644 --- a/Pdf4QtViewerPlugins/RedactPlugin/redactplugin.cpp +++ b/Pdf4QtViewerPlugins/RedactPlugin/redactplugin.cpp @@ -133,7 +133,7 @@ void RedactPlugin::onRedactTextSelectionTriggered() if (modifier.finalize()) { - emit m_widget->getToolManager()->documentModified(pdf::PDFModifiedDocument(modifier.getDocument(), nullptr, modifier.getFlags())); + Q_EMIT m_widget->getToolManager()->documentModified(pdf::PDFModifiedDocument(modifier.getDocument(), nullptr, modifier.getFlags())); } } @@ -164,7 +164,7 @@ void RedactPlugin::onRedactPageTriggered() if (modifier.finalize()) { - emit m_widget->getToolManager()->documentModified(pdf::PDFModifiedDocument(modifier.getDocument(), nullptr, modifier.getFlags())); + Q_EMIT m_widget->getToolManager()->documentModified(pdf::PDFModifiedDocument(modifier.getDocument(), nullptr, modifier.getFlags())); } } } diff --git a/Pdf4QtViewerPlugins/SignaturePlugin/signatureplugin.cpp b/Pdf4QtViewerPlugins/SignaturePlugin/signatureplugin.cpp index fcc6d16..1fb7462 100644 --- a/Pdf4QtViewerPlugins/SignaturePlugin/signatureplugin.cpp +++ b/Pdf4QtViewerPlugins/SignaturePlugin/signatureplugin.cpp @@ -304,7 +304,7 @@ void SignaturePlugin::onSignElectronically() if (modifier.finalize()) { - emit m_widget->getToolManager()->documentModified(pdf::PDFModifiedDocument(modifier.getDocument(), nullptr, modifier.getFlags())); + Q_EMIT m_widget->getToolManager()->documentModified(pdf::PDFModifiedDocument(modifier.getDocument(), nullptr, modifier.getFlags())); } } } diff --git a/Pdf4QtViewerProfi/CMakeLists.txt b/Pdf4QtViewerProfi/CMakeLists.txt index 0e7ca0e..0f357f3 100644 --- a/Pdf4QtViewerProfi/CMakeLists.txt +++ b/Pdf4QtViewerProfi/CMakeLists.txt @@ -22,6 +22,10 @@ add_executable(Pdf4QtViewerProfi target_link_libraries(Pdf4QtViewerProfi PRIVATE Pdf4QtLib Pdf4QtViewer Qt6::Core Qt6::Gui Qt6::Widgets) +if(LINUX_GCC) + target_link_libraries(Pdf4QtViewerProfi PRIVATE tbb) +endif() + set_target_properties(Pdf4QtViewerProfi PROPERTIES WIN32_EXECUTABLE ON MACOSX_BUNDLE ON diff --git a/PdfTool/CMakeLists.txt b/PdfTool/CMakeLists.txt index 0a3ef59..1d0d1da 100644 --- a/PdfTool/CMakeLists.txt +++ b/PdfTool/CMakeLists.txt @@ -52,4 +52,8 @@ if(MINGW) target_link_libraries(PdfTool PRIVATE ole32 sapi) endif() +if(LINUX_GCC) + target_link_libraries(PdfTool PRIVATE tbb) +endif() + install(TARGETS PdfTool) diff --git a/PdfTool/pdfoutputformatter.cpp b/PdfTool/pdfoutputformatter.cpp index 484e263..51e7e37 100644 --- a/PdfTool/pdfoutputformatter.cpp +++ b/PdfTool/pdfoutputformatter.cpp @@ -679,7 +679,7 @@ void PDFConsole::writeError(QString text, QStringConverter::Encoding encoding) #else QTextStream stream(stdout); stream << text; - stream << endl; + stream << Qt::endl; #endif } diff --git a/PdfTool/pdftoolabstractapplication.h b/PdfTool/pdftoolabstractapplication.h index 9506a7c..9f4e434 100644 --- a/PdfTool/pdftoolabstractapplication.h +++ b/PdfTool/pdftoolabstractapplication.h @@ -18,6 +18,7 @@ #ifndef PDFTOOLABSTRACTAPPLICATION_H #define PDFTOOLABSTRACTAPPLICATION_H +#include "pdfglobal.h" #include "pdfoutputformatter.h" #include "pdfdocument.h" #include "pdfdocumenttextflow.h"