mirror of
https://github.com/JakubMelka/PDF4QT.git
synced 2025-06-05 21:59:17 +02:00
Rendering error reporting dialog
This commit is contained in:
@ -49,6 +49,7 @@ PDFWidget::PDFWidget(QWidget* parent) :
|
||||
|
||||
m_proxy = new PDFDrawWidgetProxy(this);
|
||||
m_proxy->init(this);
|
||||
connect(m_proxy, &PDFDrawWidgetProxy::renderingError, this, &PDFWidget::onRenderingError);
|
||||
}
|
||||
|
||||
PDFWidget::~PDFWidget()
|
||||
@ -61,6 +62,24 @@ void PDFWidget::setDocument(const PDFDocument* document)
|
||||
m_proxy->setDocument(document);
|
||||
}
|
||||
|
||||
int PDFWidget::getPageRenderingErrorCount() const
|
||||
{
|
||||
int count = 0;
|
||||
for (const auto& item : m_pageRenderingErrors)
|
||||
{
|
||||
count += item.second.size();
|
||||
}
|
||||
return count;
|
||||
}
|
||||
|
||||
void PDFWidget::onRenderingError(PDFInteger pageIndex, const QList<PDFRenderError>& errors)
|
||||
{
|
||||
// Empty list of error should not be reported!
|
||||
Q_ASSERT(!errors.empty());
|
||||
m_pageRenderingErrors[pageIndex] = errors;
|
||||
emit pageRenderingErrorsChanged(pageIndex, errors.size());
|
||||
}
|
||||
|
||||
PDFDrawWidget::PDFDrawWidget(PDFWidget* widget, QWidget* parent) :
|
||||
QWidget(parent),
|
||||
m_widget(widget),
|
||||
@ -74,6 +93,11 @@ PDFDrawWidget::~PDFDrawWidget()
|
||||
|
||||
}
|
||||
|
||||
std::vector<PDFInteger> PDFDrawWidget::getCurrentPages() const
|
||||
{
|
||||
return m_widget->getDrawWidgetProxy()->getPagesIntersectingRect(this->rect());
|
||||
}
|
||||
|
||||
QSize PDFDrawWidget::minimumSizeHint() const
|
||||
{
|
||||
return QSize(200, 200);
|
||||
|
Reference in New Issue
Block a user