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:
@ -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>
|
||||
|
Reference in New Issue
Block a user