Ai
1 Star 0 Fork 11

fuyb/linux_feiq

forked from uenigma/linux_feiq 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
recvtextedit.h 1.61 KB
一键复制 编辑 原始数据 按行查看 历史
lpx 提交于 2021-12-16 21:35 +08:00 . 格式化代码
#ifndef RECVTEXTEDIT_H
#define RECVTEXTEDIT_H
#include "feiqlib/content.h"
#include "feiqlib/fellow.h"
#include <QObject>
#include <QTextEdit>
#include <unordered_map>
using namespace std;
class RecvTextEdit : public QTextEdit
{
Q_OBJECT
public:
RecvTextEdit(QWidget *parent = 0);
protected:
virtual void mousePressEvent(QMouseEvent *e) override;
virtual void mouseReleaseEvent(QMouseEvent *e) override;
public:
void addFellowContent(const Content *content, long long msSinceEpoch);
void addMyContent(const Content *content, long long msSinceEpoch);
void setCurFellow(const Fellow *fellow);
void addWarning(const QString &warning);
const Fellow *curFellow();
signals:
void navigateToFileTask(IdType packetNo, IdType fileId, bool upload);
private:
QString timeStr(long long msSinceEpoch);
void addContent(const Content *content, long long msSinceEpoch, bool mySelf);
void showHint(long long msSinceEpoch, bool mySelf);
void showContent(const Content *content, bool mySelf);
void showFile(const FileContent *content, bool fromMySelf);
void showImage(const ImageContent *content);
void showText(const TextContent *content);
void showKnock(const KnockContent *content, bool mySelf);
void showUnSupport(const QString &text = "");
void drawDaySeperatorIfNewDay(long long sinceEpoch);
QString textHtmlStr(const TextContent *content);
void parseLink(const QString &link);
private:
const Fellow *mFellow = nullptr;
unordered_map<const Fellow *, QTextDocument *> mDocs;
long long mLastEdit = 0;
QString mPressedAnchor;
};
#endif // RECVTEXTEDIT_H
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/HALOBING/linux_feiq.git
git@gitee.com:HALOBING/linux_feiq.git
HALOBING
linux_feiq
linux_feiq
master

搜索帮助