chatview improvement

This commit is contained in:
Max-Wilhelm Bruker 2011-07-05 21:33:03 +02:00
parent add47315d5
commit fccc91818d
4 changed files with 76 additions and 76 deletions

View file

@ -3,6 +3,7 @@
#include <QTextBrowser>
#include <QTextFragment>
#include <QTextCursor>
#include <QColor>
class QTextTable;
@ -11,16 +12,18 @@ class QMouseEvent;
class ChatView : public QTextBrowser {
Q_OBJECT;
private:
QTextTable *table;
bool evenNumber;
QString ownName;
bool showTimestamps;
QTextFragment getFragmentUnderMouse(const QPoint &pos) const;
QString getCardNameUnderMouse(QTextFragment frag) const;
QString getCardNameUnderMouse(const QPoint &pos) const;
QTextCursor prepareBlock();
private slots:
void openLink(const QUrl &link);
public:
ChatView(const QString &_ownName, bool _showTimestamps, QWidget *parent = 0);
void appendHtml(const QString &html);
void appendMessage(QString sender, QString message, QColor playerColor = QColor(), bool playerBold = false);
protected:
void enterEvent(QEvent *event);