@@ -41,7 +41,11 @@ typedef libxml2_MathView MathView;
41
41
class QMathViewLogger : public AbstractLogger
42
42
{
43
43
public:
44
+ #if QT_VERSION >= 0x050300
44
45
QMathViewLogger (const QLoggingCategory& category)
46
+ #else
47
+ QMathViewLogger (QLoggingCategory& category)
48
+ #endif
45
49
: AbstractLogger()
46
50
, m_category(category)
47
51
{}
@@ -54,15 +58,24 @@ class QMathViewLogger : public AbstractLogger
54
58
qCCritical (m_category) << log ;
55
59
} else if (m_category.isWarningEnabled () && log .startsWith (" [MathView] *** Warning" )) {
56
60
qCWarning (m_category) << log ;
61
+ #if QT_VERSION >= 0x050500
57
62
} else if (m_category.isInfoEnabled () && log .startsWith (" [MathView] *** Info" )) {
58
63
qCInfo (m_category) << log ;
64
+ #else
65
+ } else if (m_category.isDebugEnabled () && log .startsWith (" [MathView] *** Info" )) {
66
+ qCDebug (m_category) << log ;
67
+ #endif
59
68
} else if (m_category.isDebugEnabled () && log .startsWith (" [MathView] *** Debug" )) {
60
69
qCDebug (m_category) << log ;
61
70
}
62
71
}
63
72
64
73
private:
74
+ #if QT_VERSION >= 0x050300
65
75
const QLoggingCategory& m_category;
76
+ #else
77
+ QLoggingCategory& m_category;
78
+ #endif
66
79
};
67
80
68
81
class QMathViewPrivate
@@ -79,7 +92,11 @@ class QMathViewPrivate
79
92
RGBColor m_backgroundColor;
80
93
};
81
94
95
+ #if QT_VERSION >= 0x050300
82
96
QMathView::QMathView (const QFont& font, const QLoggingCategory& category)
97
+ #else
98
+ QMathView::QMathView (const QFont& font, QLoggingCategory& category)
99
+ #endif
83
100
: d (new QMathViewPrivate ())
84
101
{
85
102
d->m_rawFont = QRawFont::fromFont (font);
@@ -123,6 +140,7 @@ void QMathView::setFont(const QFont& font) {
123
140
d->m_view , d->m_backend ->getMathGraphicDevice ()
124
141
));
125
142
}
143
+
126
144
void QMathView::update (QPainter* painter) {
127
145
d->m_rc .setPainter (painter);
128
146
d->m_view ->render (d->m_rc , scaled::zero (), -d->m_view ->getBoundingBox ().height );
0 commit comments