Return transparent background color if no brush is set
Fixes: QTBUG-110751 Change-Id: I6fa33ba22b0209da6c9e1022851f84c892a5ae5f Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io> (cherry picked from commit 9086bc7fd3dbe619fe28871690de2f70162af643) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This commit is contained in:
parent
0b279438b2
commit
3851964388
@ -713,7 +713,8 @@ QColor QTextEdit::textColor() const
|
|||||||
QColor QTextEdit::textBackgroundColor() const
|
QColor QTextEdit::textBackgroundColor() const
|
||||||
{
|
{
|
||||||
Q_D(const QTextEdit);
|
Q_D(const QTextEdit);
|
||||||
return d->control->textCursor().charFormat().background().color();
|
const QBrush &brush = d->control->textCursor().charFormat().background();
|
||||||
|
return brush.style() == Qt::NoBrush ? Qt::transparent : brush.color();
|
||||||
}
|
}
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
|
Loading…
x
Reference in New Issue
Block a user