atrooney-online-2/aotextarea.h
Cerapter d314b8dd07 Moved includes out of the CPP files into the header files.
Reimplementation of `30a87d23c9c63bed072b3460e7482075dc530b2c` from the
old origin.
2018-08-19 09:37:34 +02:00

25 lines
551 B
C++

#ifndef AOTEXTAREA_H
#define AOTEXTAREA_H
#include <QTextBrowser>
#include <QScrollBar>
#include <QTextCursor>
#include <QRegExp>
#include <QDebug>
class AOTextArea : public QTextBrowser
{
public:
AOTextArea(QWidget *p_parent = nullptr);
void append_chatmessage(QString p_name, QString p_message);
void append_error(QString p_message);
private:
const QRegExp omnis_dank_url_regex = QRegExp("\\b(https?://\\S+\\.\\S+)\\b");
void auto_scroll(QTextCursor old_cursor, int scrollbar_value, bool is_scrolled_down);
};
#endif // AOTEXTAREA_H