Ref T369, fixed findChildren by adding Q_OBJECT macro

https://swift-project.slack.com/archives/G7GD2UP9C/p1537898045000100
This commit is contained in:
Klaus Basan
2018-09-25 21:11:34 +02:00
parent df3fb1f1a8
commit b9ae33d126
3 changed files with 11 additions and 16 deletions

View File

@@ -28,8 +28,7 @@ namespace BlackGui
{
CTextMessageTextEdit::CTextMessageTextEdit(QWidget *parent) : QTextEdit(parent)
{
m_textDocument = new QTextDocument(this);
this->setDocument(m_textDocument);
this->setDocument(&m_textDocument);
this->setReadOnly(true);
this->setWordWrap(true);
@@ -72,7 +71,7 @@ namespace BlackGui
m_messages.push_front(textMessage);
}
const QString html(toHtml(m_messages, m_withSender, m_withRecipient));
m_textDocument->setHtml(html);
m_textDocument.setHtml(html);
}
int CTextMessageTextEdit::count() const
@@ -88,15 +87,13 @@ namespace BlackGui
void CTextMessageTextEdit::redrawHtml()
{
Q_ASSERT_X(m_textDocument, Q_FUNC_INFO, "Missing text document");
const QString html(toHtml(m_messages, m_withSender, m_withRecipient));
m_textDocument->setHtml(html);
m_textDocument.setHtml(html);
}
void CTextMessageTextEdit::setStyleSheetForContent(const QString &styleSheet)
{
Q_ASSERT_X(m_textDocument, Q_FUNC_INFO, "Missing text document");
m_textDocument->setDefaultStyleSheet(styleSheet);
m_textDocument.setDefaultStyleSheet(styleSheet);
this->redrawHtml();
}