mirror of
https://gitee.com/Zhaoxin59/my-chat_-client.git
synced 2026-02-14 00:51:48 +08:00
promote ui
This commit is contained in:
@ -15,7 +15,7 @@
|
||||
#include <QPainter>
|
||||
#include <QEnterEvent>
|
||||
#include "model/data.h"
|
||||
|
||||
#include <QLabel>
|
||||
|
||||
|
||||
////////////////////////////////////////
|
||||
@ -73,12 +73,18 @@ public:
|
||||
|
||||
void select();
|
||||
|
||||
//Active实现Item被点击后的业务逻辑
|
||||
virtual void active();
|
||||
|
||||
private:
|
||||
//owner 就是指向了 SessionFriendArea
|
||||
QWidget* owner;
|
||||
|
||||
//表示当前的Item是否是选中的状态(选中时其背景色会有所不同)
|
||||
bool selected = false;
|
||||
|
||||
protected:
|
||||
QLabel* messageLabel;
|
||||
};
|
||||
|
||||
////////////////////////////////////////
|
||||
@ -88,7 +94,10 @@ class SessionItem : public SessionFriendItem {
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
SessionItem(QWidget* owner, const QString& chatSessionId, const QIcon& avatar, const QString& name, const QString& lastmessage);
|
||||
SessionItem(QWidget* owner, const QString& chatSessionId, const QIcon& avatar,
|
||||
const QString& name, const QString& lastmessage);
|
||||
|
||||
void active() override;
|
||||
private:
|
||||
//当前会话Id
|
||||
QString chatSessionId;
|
||||
@ -102,6 +111,7 @@ class FriendItem : public SessionFriendItem {
|
||||
Q_OBJECT
|
||||
public:
|
||||
FriendItem(QWidget* owner, const QString& userId, const QIcon& avatar, const QString& name, const QString& description);
|
||||
void active() override;
|
||||
private:
|
||||
// 好友的用户Id
|
||||
QString userId;
|
||||
@ -115,6 +125,7 @@ class ApplyItem : public SessionFriendItem {
|
||||
|
||||
public:
|
||||
ApplyItem(QWidget* owner, const QString& userId, const QIcon& avatar, const QString& name);
|
||||
void active() override;
|
||||
private:
|
||||
//好友申请Id
|
||||
QString userId;
|
||||
|
||||
Reference in New Issue
Block a user