mirror of
https://github.com/JakubMelka/PDF4QT.git
synced 2025-06-05 21:59:17 +02:00
Issue #25: MinGW compilation fix
This commit is contained in:
@@ -25,6 +25,10 @@ add_library(AudioBookPlugin SHARED
|
||||
|
||||
target_link_libraries(AudioBookPlugin PRIVATE Pdf4QtLib Qt6::Core Qt6::Gui Qt6::Widgets Qt6::OpenGLWidgets)
|
||||
|
||||
if(MINGW)
|
||||
target_link_libraries(AudioBookPlugin PRIVATE ole32 sapi)
|
||||
endif()
|
||||
|
||||
set_target_properties(AudioBookPlugin PROPERTIES
|
||||
VERSION ${PDF4QT_VERSION}
|
||||
SOVERSION ${PDF4QT_VERSION}
|
||||
|
@@ -31,14 +31,16 @@ ObjectInspectorDialog::ObjectInspectorDialog(const pdf::PDFCMS* cms, const pdf::
|
||||
ui(new Ui::ObjectInspectorDialog),
|
||||
m_cms(cms),
|
||||
m_document(document),
|
||||
m_model(nullptr)
|
||||
m_model(nullptr),
|
||||
m_viewerWidget(new ObjectViewerWidget(this))
|
||||
{
|
||||
ui->setupUi(this);
|
||||
|
||||
m_objectClassifier.classify(document);
|
||||
|
||||
ui->currentObjectWidget->setCms(cms);
|
||||
ui->currentObjectWidget->setDocument(document);
|
||||
m_viewerWidget->setCms(cms);
|
||||
m_viewerWidget->setDocument(document);
|
||||
ui->currentObjectTabLayout->addWidget(m_viewerWidget);
|
||||
|
||||
ui->modeComboBox->addItem(tr("Document"), int(PDFObjectInspectorTreeItemModel::Document));
|
||||
ui->modeComboBox->addItem(tr("Pages"), int(PDFObjectInspectorTreeItemModel::Page));
|
||||
@@ -103,8 +105,8 @@ ObjectInspectorDialog::ObjectInspectorDialog(const pdf::PDFCMS* cms, const pdf::
|
||||
ui->splitter->setSizes(QList<int>() << pdf::PDFWidgetUtils::scaleDPI_x(this, 300) << pdf::PDFWidgetUtils::scaleDPI_x(this, 200));
|
||||
|
||||
connect(ui->objectTreeView->selectionModel(), &QItemSelectionModel::currentChanged, this, &ObjectInspectorDialog::onCurrentIndexChanged);
|
||||
connect(ui->currentObjectWidget, &ObjectViewerWidget::pinRequest, this, &ObjectInspectorDialog::onPinRequest);
|
||||
connect(ui->currentObjectWidget, &ObjectViewerWidget::unpinRequest, this, &ObjectInspectorDialog::onUnpinRequest);
|
||||
connect(m_viewerWidget, &ObjectViewerWidget::pinRequest, this, &ObjectInspectorDialog::onPinRequest);
|
||||
connect(m_viewerWidget, &ObjectViewerWidget::unpinRequest, this, &ObjectInspectorDialog::onUnpinRequest);
|
||||
|
||||
ui->objectTreeView->setMinimumWidth(pdf::PDFWidgetUtils::scaleDPI_x(this, 200));
|
||||
setMinimumSize(pdf::PDFWidgetUtils::scaleDPI(this, QSize(800, 600)));
|
||||
@@ -126,12 +128,12 @@ void ObjectInspectorDialog::onPinRequest()
|
||||
{
|
||||
ObjectViewerWidget* source = qobject_cast<ObjectViewerWidget*>(sender());
|
||||
|
||||
if (!source || source != ui->currentObjectWidget)
|
||||
if (!source || source != m_viewerWidget)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
ObjectViewerWidget* cloned = ui->currentObjectWidget->clone(true, this);
|
||||
ObjectViewerWidget* cloned = m_viewerWidget->clone(true, this);
|
||||
connect(cloned, &ObjectViewerWidget::pinRequest, this, &ObjectInspectorDialog::onPinRequest);
|
||||
connect(cloned, &ObjectViewerWidget::unpinRequest, this, &ObjectInspectorDialog::onUnpinRequest);
|
||||
ui->tabWidget->addTab(cloned, cloned->getTitleText());
|
||||
@@ -141,7 +143,7 @@ void ObjectInspectorDialog::onUnpinRequest()
|
||||
{
|
||||
ObjectViewerWidget* source = qobject_cast<ObjectViewerWidget*>(sender());
|
||||
|
||||
if (!source || source == ui->currentObjectWidget)
|
||||
if (!source || source == m_viewerWidget)
|
||||
{
|
||||
return;
|
||||
}
|
||||
@@ -165,7 +167,7 @@ void ObjectInspectorDialog::onCurrentIndexChanged(const QModelIndex& current, co
|
||||
isRoot = true;
|
||||
}
|
||||
|
||||
ui->currentObjectWidget->setData(reference, qMove(object), isRoot);
|
||||
m_viewerWidget->setData(reference, qMove(object), isRoot);
|
||||
}
|
||||
|
||||
} // namespace pdfplugin
|
||||
|
@@ -21,6 +21,7 @@
|
||||
#include "pdfdocument.h"
|
||||
#include "pdfobjectutils.h"
|
||||
#include "pdfcms.h"
|
||||
#include "objectviewerwidget.h"
|
||||
|
||||
#include <QDialog>
|
||||
|
||||
@@ -52,6 +53,7 @@ private:
|
||||
const pdf::PDFDocument* m_document;
|
||||
pdf::PDFObjectClassifier m_objectClassifier;
|
||||
PDFObjectInspectorTreeItemModel* m_model;
|
||||
ObjectViewerWidget* m_viewerWidget;
|
||||
};
|
||||
|
||||
} // namespace pdfplugin
|
||||
|
@@ -47,11 +47,7 @@
|
||||
<attribute name="title">
|
||||
<string>Current Object</string>
|
||||
</attribute>
|
||||
<layout class="QVBoxLayout" name="verticalLayout_3">
|
||||
<item>
|
||||
<widget class="pdfplugin::ObjectViewerWidget" name="currentObjectWidget" native="true"/>
|
||||
</item>
|
||||
</layout>
|
||||
<layout class="QVBoxLayout" name="currentObjectTabLayout"/>
|
||||
</widget>
|
||||
</widget>
|
||||
</widget>
|
||||
@@ -68,14 +64,6 @@
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<customwidgets>
|
||||
<customwidget>
|
||||
<class>pdfplugin::ObjectViewerWidget</class>
|
||||
<extends>QWidget</extends>
|
||||
<header>objectviewerwidget.h</header>
|
||||
<container>1</container>
|
||||
</customwidget>
|
||||
</customwidgets>
|
||||
<resources/>
|
||||
<connections>
|
||||
<connection>
|
||||
|
@@ -26,10 +26,13 @@ namespace pdfplugin
|
||||
ObjectStatisticsDialog::ObjectStatisticsDialog(const pdf::PDFDocument* document, QWidget *parent) :
|
||||
QDialog(parent, Qt::Dialog | Qt::WindowMaximizeButtonHint | Qt::WindowCloseButtonHint),
|
||||
ui(new Ui::ObjectStatisticsDialog),
|
||||
m_document(document)
|
||||
m_document(document),
|
||||
m_statisticsGraphWidget(new StatisticsGraphWidget(this))
|
||||
{
|
||||
ui->setupUi(this);
|
||||
|
||||
ui->dialogLayout->addWidget(m_statisticsGraphWidget);
|
||||
|
||||
ui->comboBox->addItem(tr("Statistics by Object Function"), int(ByObjectClass));
|
||||
ui->comboBox->addItem(tr("Statistics by Object Type"), int(ByObjectType));
|
||||
ui->comboBox->setCurrentIndex(ui->comboBox->findData(int(ByObjectClass), Qt::UserRole, Qt::MatchExactly));
|
||||
@@ -163,7 +166,7 @@ void ObjectStatisticsDialog::updateStatisticsWidget()
|
||||
break;
|
||||
}
|
||||
|
||||
ui->graphWidget->setStatistics(qMove(statistics));
|
||||
m_statisticsGraphWidget->setStatistics(qMove(statistics));
|
||||
}
|
||||
|
||||
} // namespace pdfplugin
|
||||
|
@@ -20,6 +20,7 @@
|
||||
|
||||
#include "pdfdocument.h"
|
||||
#include "pdfobjectutils.h"
|
||||
#include "statisticsgraphwidget.h"
|
||||
|
||||
#include <QDialog>
|
||||
|
||||
@@ -52,6 +53,7 @@ private:
|
||||
|
||||
const pdf::PDFDocument* m_document;
|
||||
pdf::PDFObjectClassifier::Statistics m_statistics;
|
||||
StatisticsGraphWidget* m_statisticsGraphWidget;
|
||||
};
|
||||
|
||||
} // namespace pdfplugin
|
||||
|
@@ -13,23 +13,12 @@
|
||||
<property name="windowTitle">
|
||||
<string>Object Statistics</string>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="verticalLayout">
|
||||
<layout class="QVBoxLayout" name="dialogLayout">
|
||||
<item>
|
||||
<widget class="QComboBox" name="comboBox"/>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="pdfplugin::StatisticsGraphWidget" name="graphWidget" native="true"/>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<customwidgets>
|
||||
<customwidget>
|
||||
<class>pdfplugin::StatisticsGraphWidget</class>
|
||||
<extends>QWidget</extends>
|
||||
<header>StatisticsGraphWidget.h</header>
|
||||
<container>1</container>
|
||||
</customwidget>
|
||||
</customwidgets>
|
||||
<resources/>
|
||||
<connections/>
|
||||
</ui>
|
||||
|
@@ -38,6 +38,7 @@ OutputPreviewDialog::OutputPreviewDialog(const pdf::PDFDocument* document, pdf::
|
||||
m_document(document),
|
||||
m_widget(widget),
|
||||
m_needUpdateImage(false),
|
||||
m_outputPreviewWidget(new OutputPreviewWidget(this)),
|
||||
m_futureWatcher(nullptr)
|
||||
{
|
||||
ui->setupUi(this);
|
||||
@@ -46,6 +47,8 @@ OutputPreviewDialog::OutputPreviewDialog(const pdf::PDFDocument* document, pdf::
|
||||
ui->pageIndexScrollBar->setValue(1);
|
||||
ui->pageIndexScrollBar->setMaximum(int(document->getCatalog()->getPageCount()));
|
||||
|
||||
ui->frameViewLayout->insertWidget(0, m_outputPreviewWidget);
|
||||
|
||||
ui->displayModeComboBox->addItem(tr("Separations"), OutputPreviewWidget::Separations);
|
||||
ui->displayModeComboBox->addItem(tr("Color Warnings | Ink Coverage"), OutputPreviewWidget::ColorWarningInkCoverage);
|
||||
ui->displayModeComboBox->addItem(tr("Color Warnings | Rich Black"), OutputPreviewWidget::ColorWarningRichBlack);
|
||||
@@ -54,7 +57,7 @@ OutputPreviewDialog::OutputPreviewDialog(const pdf::PDFDocument* document, pdf::
|
||||
ui->displayModeComboBox->addItem(tr("Opacity Channel"), OutputPreviewWidget::OpacityChannel);
|
||||
ui->displayModeComboBox->setCurrentIndex(0);
|
||||
|
||||
ui->imageWidget->setInkMapper(&m_inkMapper);
|
||||
m_outputPreviewWidget->setInkMapper(&m_inkMapper);
|
||||
ui->inksTreeWidget->setMinimumHeight(pdf::PDFWidgetUtils::scaleDPI_y(ui->inksTreeWidget, 150));
|
||||
|
||||
m_inkMapper.createSpotColors(ui->simulateSeparationsCheckBox->isChecked());
|
||||
@@ -191,7 +194,7 @@ void OutputPreviewDialog::updateAlarmColorButtonIcon()
|
||||
{
|
||||
QSize iconSize = ui->alarmColorButton->iconSize();
|
||||
QPixmap pixmap(iconSize);
|
||||
pixmap.fill(ui->imageWidget->getAlarmColor());
|
||||
pixmap.fill(m_outputPreviewWidget->getAlarmColor());
|
||||
ui->alarmColorButton->setIcon(QIcon(pixmap));
|
||||
}
|
||||
|
||||
@@ -206,10 +209,10 @@ void OutputPreviewDialog::onPaperColorChanged()
|
||||
|
||||
void OutputPreviewDialog::onAlarmColorButtonClicked()
|
||||
{
|
||||
QColorDialog colorDialog(ui->imageWidget->getAlarmColor(), this);
|
||||
QColorDialog colorDialog(m_outputPreviewWidget->getAlarmColor(), this);
|
||||
if (colorDialog.exec() == QColorDialog::Accepted)
|
||||
{
|
||||
ui->imageWidget->setAlarmColor(colorDialog.currentColor());
|
||||
m_outputPreviewWidget->setAlarmColor(colorDialog.currentColor());
|
||||
updateAlarmColorButtonIcon();
|
||||
}
|
||||
}
|
||||
@@ -231,7 +234,7 @@ void OutputPreviewDialog::onSimulatePaperColorChecked(bool checked)
|
||||
|
||||
void OutputPreviewDialog::onDisplayModeChanged()
|
||||
{
|
||||
ui->imageWidget->setDisplayMode(OutputPreviewWidget::DisplayMode(ui->displayModeComboBox->currentData().toInt()));
|
||||
m_outputPreviewWidget->setDisplayMode(OutputPreviewWidget::DisplayMode(ui->displayModeComboBox->currentData().toInt()));
|
||||
}
|
||||
|
||||
void OutputPreviewDialog::onInksChanged(const QModelIndex& topLeft, const QModelIndex& bottomRight, const QVector<int>& roles)
|
||||
@@ -247,12 +250,12 @@ void OutputPreviewDialog::onInksChanged(const QModelIndex& topLeft, const QModel
|
||||
|
||||
void OutputPreviewDialog::onInkCoverageLimitChanged(double value)
|
||||
{
|
||||
ui->imageWidget->setInkCoverageLimit(value / 100.0);
|
||||
m_outputPreviewWidget->setInkCoverageLimit(value / 100.0);
|
||||
}
|
||||
|
||||
void OutputPreviewDialog::onRichBlackLimtiChanged(double value)
|
||||
{
|
||||
ui->imageWidget->setRichBlackLimit(value / 100.0);
|
||||
m_outputPreviewWidget->setRichBlackLimit(value / 100.0);
|
||||
}
|
||||
|
||||
void OutputPreviewDialog::updatePageImage()
|
||||
@@ -268,7 +271,7 @@ void OutputPreviewDialog::updatePageImage()
|
||||
const pdf::PDFPage* page = m_document->getCatalog()->getPage(ui->pageIndexScrollBar->value() - 1);
|
||||
if (!page)
|
||||
{
|
||||
ui->imageWidget->clear();
|
||||
m_outputPreviewWidget->clear();
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -318,7 +321,7 @@ void OutputPreviewDialog::updatePageImage()
|
||||
flags.setFlag(pdf::PDFTransparencyRendererSettings::SaveOriginalProcessImage, true);
|
||||
|
||||
m_inkMapperForRendering = m_inkMapper;
|
||||
QSize renderSize = ui->imageWidget->getPageImageSizeHint();
|
||||
QSize renderSize = m_outputPreviewWidget->getPageImageSizeHint();
|
||||
auto renderImage = [this, page, renderSize, paperColor, activeColorMask, flags]() -> RenderedImage
|
||||
{
|
||||
return renderPage(page, renderSize, paperColor, activeColorMask, flags);
|
||||
@@ -389,7 +392,7 @@ void OutputPreviewDialog::onPageImageRendered()
|
||||
m_futureWatcher->deleteLater();
|
||||
m_futureWatcher = nullptr;
|
||||
|
||||
ui->imageWidget->setPageImage(qMove(result.image), qMove(result.originalProcessImage), result.pageSize);
|
||||
m_outputPreviewWidget->setPageImage(qMove(result.image), qMove(result.originalProcessImage), result.pageSize);
|
||||
|
||||
if (m_needUpdateImage)
|
||||
{
|
||||
|
@@ -87,6 +87,7 @@ private:
|
||||
const pdf::PDFDocument* m_document;
|
||||
pdf::PDFWidget* m_widget;
|
||||
bool m_needUpdateImage;
|
||||
OutputPreviewWidget* m_outputPreviewWidget;
|
||||
|
||||
QFuture<RenderedImage> m_future;
|
||||
QFutureWatcher<RenderedImage>* m_futureWatcher;
|
||||
|
@@ -7,7 +7,7 @@
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>955</width>
|
||||
<height>677</height>
|
||||
<height>686</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
@@ -40,9 +40,6 @@
|
||||
<property name="bottomMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<item>
|
||||
<widget class="pdfplugin::OutputPreviewWidget" name="imageWidget" native="true"/>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QScrollBar" name="pageIndexScrollBar">
|
||||
<property name="orientation">
|
||||
@@ -316,14 +313,6 @@
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<customwidgets>
|
||||
<customwidget>
|
||||
<class>pdfplugin::OutputPreviewWidget</class>
|
||||
<extends>QWidget</extends>
|
||||
<header>outputpreviewwidget.h</header>
|
||||
<container>1</container>
|
||||
</customwidget>
|
||||
</customwidgets>
|
||||
<resources/>
|
||||
<connections>
|
||||
<connection>
|
||||
|
Reference in New Issue
Block a user