diff options
Diffstat (limited to 'src/gui/text/qfontmetrics.h')
-rw-r--r-- | src/gui/text/qfontmetrics.h | 30 |
1 files changed, 27 insertions, 3 deletions
diff --git a/src/gui/text/qfontmetrics.h b/src/gui/text/qfontmetrics.h index b6167a1d47..ba7f695380 100644 --- a/src/gui/text/qfontmetrics.h +++ b/src/gui/text/qfontmetrics.h @@ -59,7 +59,19 @@ class Q_GUI_EXPORT QFontMetrics { public: explicit QFontMetrics(const QFont &); - QFontMetrics(const QFont &, QPaintDevice *pd); +#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0) + QFontMetrics(const QFont &font, QPaintDevice *pd); +#ifndef Q_QDOC + // the template is necessary to make QFontMetrics(font,nullptr) and QFontMetrics(font,NULL) + // not ambiguous. Implementation detail that should not be documented. + template<char = 0> +#endif + QFontMetrics(const QFont &font, const QPaintDevice *pd) + : QFontMetrics(font, const_cast<QPaintDevice*>(pd)) + {} +#else + QFontMetrics(const QFont &font, const QPaintDevice *pd); +#endif QFontMetrics(const QFontMetrics &); ~QFontMetrics(); @@ -137,8 +149,20 @@ Q_DECLARE_SHARED(QFontMetrics) class Q_GUI_EXPORT QFontMetricsF { public: - explicit QFontMetricsF(const QFont &); - QFontMetricsF(const QFont &, QPaintDevice *pd); + explicit QFontMetricsF(const QFont &font); +#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0) + QFontMetricsF(const QFont &font, QPaintDevice *pd); +#ifndef Q_QDOC + // the template is necessary to make QFontMetrics(font,nullptr) and QFontMetrics(font,NULL) + // not ambiguous. Implementation detail that should not be documented. + template<char = 0> +#endif + QFontMetricsF(const QFont &font, const QPaintDevice *pd) + : QFontMetricsF(font, const_cast<QPaintDevice*>(pd)) + {} +#else + QFontMetricsF(const QFont &font, const QPaintDevice *pd); +#endif QFontMetricsF(const QFontMetrics &); QFontMetricsF(const QFontMetricsF &); ~QFontMetricsF(); |