|
|
@ -20,6 +20,7 @@ |
|
|
|
#include <QDesktopServices> |
|
|
|
#include <QDesktopServices> |
|
|
|
#include <QTextTable> |
|
|
|
#include <QTextTable> |
|
|
|
#include <QAbstractTextDocumentLayout> |
|
|
|
#include <QAbstractTextDocumentLayout> |
|
|
|
|
|
|
|
#include <QCoreApplication> |
|
|
|
|
|
|
|
|
|
|
|
ChatAreaWidget::ChatAreaWidget(QWidget *parent) : |
|
|
|
ChatAreaWidget::ChatAreaWidget(QWidget *parent) : |
|
|
|
QTextBrowser(parent) |
|
|
|
QTextBrowser(parent) |
|
|
@ -104,15 +105,13 @@ void ChatAreaWidget::insertMessage(ChatAction *msgAction) |
|
|
|
checkSlider(); |
|
|
|
checkSlider(); |
|
|
|
|
|
|
|
|
|
|
|
int row = chatTextTable->rows() - 1; |
|
|
|
int row = chatTextTable->rows() - 1; |
|
|
|
// chatTextTable->cellAt(row,0).firstCursorPosition().setBlockFormat(nameFormat);
|
|
|
|
|
|
|
|
// chatTextTable->cellAt(row,2).firstCursorPosition().setBlockFormat(dateFormat);
|
|
|
|
|
|
|
|
QTextCursor cur = chatTextTable->cellAt(row,1).firstCursorPosition(); |
|
|
|
QTextCursor cur = chatTextTable->cellAt(row,1).firstCursorPosition(); |
|
|
|
cur.clearSelection(); |
|
|
|
cur.clearSelection(); |
|
|
|
cur.setKeepPositionOnInsert(true); |
|
|
|
cur.setKeepPositionOnInsert(true); |
|
|
|
|
|
|
|
chatTextTable->appendRows(1); |
|
|
|
chatTextTable->cellAt(row,0).firstCursorPosition().insertHtml(msgAction->getName()); |
|
|
|
chatTextTable->cellAt(row,0).firstCursorPosition().insertHtml(msgAction->getName()); |
|
|
|
chatTextTable->cellAt(row,1).firstCursorPosition().insertHtml(msgAction->getMessage()); |
|
|
|
chatTextTable->cellAt(row,1).firstCursorPosition().insertHtml(msgAction->getMessage()); |
|
|
|
chatTextTable->cellAt(row,2).firstCursorPosition().insertHtml(msgAction->getDate()); |
|
|
|
chatTextTable->cellAt(row,2).firstCursorPosition().insertText(msgAction->getDate()); |
|
|
|
chatTextTable->appendRows(1); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
msgAction->setTextCursor(cur); |
|
|
|
msgAction->setTextCursor(cur); |
|
|
|
|
|
|
|
|
|
|
|