Commit 2e4212ad authored by Albert Astals Cid's avatar Albert Astals Cid

Partially revert "Fix two easy deprecation warnings"

QFontMetrincs::horizontalAdvance is only available in Qt 5.11

This reverts commit 69ec1755.
parent ec51b2f0
......@@ -919,7 +919,7 @@ void XpsHandler::processGlyph( XpsRenderNode &node )
if ( advanceWidth > 0.0 ) {
originAdvance.rx() += advanceWidth;
} else {
originAdvance.rx() += metrics.horizontalAdvance( thisChar );
originAdvance.rx() += metrics.width( thisChar );
}
}
// qCWarning(OkularXpsDebug) << "Glyphs: " << atts.value("Fill") << ", " << atts.value("FontUri");
......@@ -1659,7 +1659,7 @@ Okular::TextPage* XpsPage::textPage()
int lastWidth = 0;
for (int i = 0; i < text.length(); i++) {
int width = metrics.horizontalAdvance( text, i + 1 );
int width = metrics.width( text, i + 1 );
Okular::NormalizedRect * rect = new Okular::NormalizedRect( (origin.x() + lastWidth) / m_pageSize.width(),
(origin.y() - metrics.height()) / m_pageSize.height(),
......
......@@ -182,7 +182,7 @@ PresentationWidget::PresentationWidget( QWidget * parent, Okular::Document * doc
QFontMetrics fm( m_pagesEdit->font() );
QStyleOptionFrame option;
option.initFrom( m_pagesEdit );
m_pagesEdit->setMaximumWidth( fm.horizontalAdvance( QString::number( m_document->pages() ) ) + 2 * style()->pixelMetric( QStyle::PM_DefaultFrameWidth, &option, m_pagesEdit ) + 4 ); // the 4 comes from 2*horizontalMargin, horizontalMargin being a define in qlineedit.cpp
m_pagesEdit->setMaximumWidth( fm.width( QString::number( m_document->pages() ) ) + 2 * style()->pixelMetric( QStyle::PM_DefaultFrameWidth, &option, m_pagesEdit ) + 4 ); // the 4 comes from 2*horizontalMargin, horizontalMargin being a define in qlineedit.cpp
QIntValidator *validator = new QIntValidator( 1, m_document->pages(), m_pagesEdit );
m_pagesEdit->setValidator( validator );
m_topBar->addWidget( m_pagesEdit );
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment