replace qAsConst with std::as_const in nglpdfdocument

Reduce Qt deprecation warnings

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This commit is contained in:
torstenandCopilot committed 2026-07-14 22:39:18 +02:00
1 parent 3546d1c7aa
commit 46e673f660
1 file changed
+3 -3
+3 -3
View File
@@ -163,7 +163,7 @@ void PDFDocument::setZoomFactor(double zoom)
return;
m_scaleFactor = zoom;
for (PDFPage *p : qAsConst(m_pages))
for (PDFPage *p : std::as_const(m_pages))
p->setZoomFactor(m_scaleFactor / m_widthFactor);
rebuildRanges();
@@ -177,7 +177,7 @@ void PDFDocument::setRotation(Poppler::Page::Rotation rot)
if (m_pages.isEmpty())
return;
for (PDFPage *p : qAsConst(m_pages))
for (PDFPage *p : std::as_const(m_pages))
p->setRotation(m_rotation);
rebuildRanges();
@@ -322,7 +322,7 @@ void PDFDocument::rebuildRanges()
QVBoxLayout *l = qobject_cast<QVBoxLayout *> (m_pdfLabel->layout());
m_ranges.clear();
int height = l->contentsMargins().top();
for (PDFPage *p : qAsConst(m_pages))
for (PDFPage *p : std::as_const(m_pages))
{
m_ranges += height;
height += p->height();