Issue #25: Linux build

This commit is contained in:
Jakub Melka 2022-09-18 13:08:21 +02:00
parent 3b57f85d4d
commit dd466d5073
44 changed files with 208 additions and 184 deletions

View File

@ -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)

View File

@ -143,7 +143,7 @@ void SettingsDockWidget::onEditColorChanged()
if (isChanged)
{
emit colorsChanged();
Q_EMIT colorsChanged();
}
}

View File

@ -135,7 +135,7 @@ void PageItemDelegate::setPageImageSize(QSize pageImageSize)
if (m_pageImageSize != pageImageSize)
{
m_pageImageSize = pageImageSize;
emit sizeHintChanged(QModelIndex());
Q_EMIT sizeHintChanged(QModelIndex());
}
}

View File

@ -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

View File

@ -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()

View File

@ -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()));
}
}
}

View File

@ -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()));
}
}
}

View File

@ -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();
}
}

View File

@ -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

View File

@ -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);
}
}

View File

@ -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

View File

@ -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,

View File

@ -146,7 +146,7 @@ void PDFWidget::onRenderingError(PDFInteger pageIndex, const QList<PDFRenderErro
// Empty list of error should not be reported!
Q_ASSERT(!errors.empty());
m_pageRenderingErrors[pageIndex] = errors;
emit pageRenderingErrorsChanged(pageIndex, errors.size());
Q_EMIT pageRenderingErrorsChanged(pageIndex, errors.size());
}
void PDFWidget::onPageImageChanged(bool all, const std::vector<PDFInteger>& pages)

View File

@ -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);
}
}

View File

@ -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::vector<PDFI
if (all)
{
m_thumbnailCache.clear();
emit dataChanged(index(0, 0, QModelIndex()), index(rowCount(QModelIndex()) - 1, 0, QModelIndex()));
Q_EMIT dataChanged(index(0, 0, QModelIndex()), index(rowCount(QModelIndex()) - 1, 0, QModelIndex()));
}
else
{
@ -783,7 +783,7 @@ void PDFThumbnailsItemModel::onPageImageChanged(bool all, const std::vector<PDFI
if (pageIndex < rowCount)
{
m_thumbnailCache.remove(getKey(pageIndex));
emit dataChanged(index(pageIndex, 0, QModelIndex()), index(pageIndex, 0, QModelIndex()));
Q_EMIT dataChanged(index(pageIndex, 0, QModelIndex()), index(pageIndex, 0, QModelIndex()));
}
}
}

View File

@ -257,7 +257,7 @@ void PDFObjectEditorAbstractModel::setEditedObject(PDFObject object)
{
m_editedObject = qMove(object);
updateSelectorValues();
emit editedObjectChanged();
Q_EMIT editedObjectChanged();
}
}

View File

@ -544,7 +544,7 @@ PDFObjectEditorMappedComboBoxAdapter::PDFObjectEditorMappedComboBoxAdapter(QLabe
comboBox->addItem(item.name, item.flags);
}
connect(comboBox, QOverload<int>::of(&QComboBox::currentIndexChanged), this, [this, attribute](){ emit commitRequested(attribute); });
connect(comboBox, QOverload<int>::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<int>::of(&QComboBox::currentIndexChanged), this, [this, attribute](){ emit commitRequested(attribute); });
connect(comboBox, QOverload<int>::of(&QComboBox::currentIndexChanged), this, [this, attribute](){ Q_EMIT commitRequested(attribute); });
}
PDFObject PDFObjectEditorMappedColorAdapter::getValue() const

View File

@ -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;
}

View File

@ -407,7 +407,7 @@ void PDFOptionalContentActivity::setState(PDFObjectReference ocg, OCState state,
}
it->second = state;
emit optionalContentGroupStateChanged(ocg, state);
Q_EMIT optionalContentGroupStateChanged(ocg, state);
}
}

View File

@ -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);
}
}

View File

@ -46,7 +46,7 @@ void PDFCreatePCElementTool::setPen(const QPen& pen)
if (PDFPageContentStyledElement* styledElement = dynamic_cast<PDFPageContentStyledElement*>(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<PDFPageContentStyledElement*>(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<PDFPageContentElementTextBox*>(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<PDFPageContentElementTextBox*>(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<PDFPageContentElementTextBox*>(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<int>::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<int>::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<int>::max(), pen.color());
emit getProxy()->repaintNeeded();
Q_EMIT getProxy()->repaintNeeded();
}
} // namespace pdf

View File

@ -221,7 +221,7 @@ void PDFPageContentEditorWidget::onItemSelectionChanged()
{
if (m_selectionChangeEnabled)
{
emit itemSelectionChangedByUser();
Q_EMIT itemSelectionChangedByUser();
}
}

View File

@ -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<PDFInteger>& 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<PDFInteger>& 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);

View File

@ -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;

View File

@ -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

View File

@ -426,7 +426,7 @@ void PDFRasterizerPool::render(const std::vector<PDFInteger>& 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<PDFInteger>& 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<PDFInteger>& 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<PDFInteger>& 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()

View File

@ -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()

View File

@ -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()

View File

@ -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;
};

View File

@ -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());
}
}

View File

@ -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())));
}
};

View File

@ -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);
}
}

View File

@ -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();
}
}

View File

@ -18,6 +18,7 @@
#ifndef PDFVIEWERMAINWINDOW_H
#define PDFVIEWERMAINWINDOW_H
#include "pdfglobal.h"
#include "pdfviewerglobal.h"
#include "pdfcatalog.h"
#include "pdfrenderer.h"

View File

@ -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();
}
}

View File

@ -18,6 +18,7 @@
#ifndef PDFVIEWERSETTINGS_H
#define PDFVIEWERSETTINGS_H
#include "pdfglobal.h"
#include "pdfrenderer.h"
#include "pdfcms.h"
#include "pdfexecutionpolicy.h"

View File

@ -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

View File

@ -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<QPointF> 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

View File

@ -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()));
}
}
}

View File

@ -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()));
}
}
}

View File

@ -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

View File

@ -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)

View File

@ -679,7 +679,7 @@ void PDFConsole::writeError(QString text, QStringConverter::Encoding encoding)
#else
QTextStream stream(stdout);
stream << text;
stream << endl;
stream << Qt::endl;
#endif
}

View File

@ -18,6 +18,7 @@
#ifndef PDFTOOLABSTRACTAPPLICATION_H
#define PDFTOOLABSTRACTAPPLICATION_H
#include "pdfglobal.h"
#include "pdfoutputformatter.h"
#include "pdfdocument.h"
#include "pdfdocumenttextflow.h"