From 968b46a86bfaa3b1ed86405be45d8af9a81d6bf8 Mon Sep 17 00:00:00 2001 From: apprb Date: Sat, 13 Sep 2014 01:54:03 +0700 Subject: [PATCH] get rid of .setBlockFormat(..) in ChatAreaWidget::insertMessage(..) function --- widget/chatareawidget.cpp | 12 ++++++------ widget/tool/chataction.cpp | 4 ++-- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/widget/chatareawidget.cpp b/widget/chatareawidget.cpp index 203633386..199420e9f 100644 --- a/widget/chatareawidget.cpp +++ b/widget/chatareawidget.cpp @@ -44,10 +44,10 @@ ChatAreaWidget::ChatAreaWidget(QWidget *parent) : chatTextTable->format().setCellSpacing(2); chatTextTable->format().setWidth(QTextLength(QTextLength::PercentageLength,100)); - nameFormat.setAlignment(Qt::AlignRight); - nameFormat.setNonBreakableLines(true); - dateFormat.setAlignment(Qt::AlignLeft); - dateFormat.setNonBreakableLines(true); +// nameFormat.setAlignment(Qt::AlignRight); +// nameFormat.setNonBreakableLines(true); +// dateFormat.setAlignment(Qt::AlignLeft); +// dateFormat.setNonBreakableLines(true); connect(this, &ChatAreaWidget::anchorClicked, this, &ChatAreaWidget::onAnchorClicked); connect(verticalScrollBar(), SIGNAL(rangeChanged(int,int)), this, SLOT(onSliderRangeChanged())); @@ -104,8 +104,8 @@ void ChatAreaWidget::insertMessage(ChatAction *msgAction) checkSlider(); int row = chatTextTable->rows() - 1; - chatTextTable->cellAt(row,0).firstCursorPosition().setBlockFormat(nameFormat); - chatTextTable->cellAt(row,2).firstCursorPosition().setBlockFormat(dateFormat); +// chatTextTable->cellAt(row,0).firstCursorPosition().setBlockFormat(nameFormat); +// chatTextTable->cellAt(row,2).firstCursorPosition().setBlockFormat(dateFormat); QTextCursor cur = chatTextTable->cellAt(row,1).firstCursorPosition(); cur.clearSelection(); cur.setKeepPositionOnInsert(true); diff --git a/widget/tool/chataction.cpp b/widget/tool/chataction.cpp index 0847abdda..3587eb600 100644 --- a/widget/tool/chataction.cpp +++ b/widget/tool/chataction.cpp @@ -43,9 +43,9 @@ QString ChatAction::QImage2base64(const QImage &img) QString ChatAction::getName() { if (isMe) - return QString("
" + toHtmlChars(name) + "
"); + return QString("
" + toHtmlChars(name) + "
"); else - return QString("
" + toHtmlChars(name) + "
"); + return QString("
" + toHtmlChars(name) + "
"); } QString ChatAction::getDate()