FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

qt: replace deprecated metric.width() with metric.horizontalAdvance() · gnuplot/gnuplot@f9fc261 · GitHub

Repository navigation

Commit f9fc261

Browse files
Ethan A Merritt
committed
qt: replace deprecated metric.width() with metric.horizontalAdvance()
1 parent a809046 commit f9fc261

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

‎src/qtterminal/QtGnuplotItems.cpp‎

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,10 @@
4545

4646
#include <QtGui>
4747

48+
#if QT_VERSION < QT_VERSION_CHECK(5, 11, 0)
49+
#define horizontalAdvance width
50+
#endif
51+
4852
/////////////////////////////
4953
// QtGnuplotEnhanced
5054

@@ -111,7 +115,7 @@ QRectF QtGnuplotEnhancedFragment::boundingRect() const
111115
qreal QtGnuplotEnhancedFragment::width() const
112116
{
113117
QFontMetricsF metrics(m_font);
114-
return metrics.width(m_text);
118+
return metrics.horizontalAdvance(m_text);
115119
}
116120

117121
void QtGnuplotEnhancedFragment::paint(QPainter* painter, const QStyleOptionGraphicsItem* option, QWidget* widget)

0 commit comments

Comments
 (0)

Back | FazBrowse Home | New Git URL