mirror of
https://gitee.com/Zhaoxin59/my-chat_-client.git
synced 2026-02-14 00:51:48 +08:00
improve ui and add historymessagewidget model
This commit is contained in:
58
historymessagewidget.h
Normal file
58
historymessagewidget.h
Normal file
@ -0,0 +1,58 @@
|
||||
#pragma once
|
||||
|
||||
#include <QDialog>
|
||||
#include <QGridLayout>
|
||||
#include <QRadioButton>
|
||||
#include <QLineEdit>
|
||||
#include <QPushButton>
|
||||
#include <QLabel>
|
||||
#include <QDateTimeEdit>
|
||||
#include <QScrollArea>
|
||||
#include <QScrollBar>
|
||||
#include <QFileDialog>
|
||||
|
||||
#include "debug.h"
|
||||
#include "model/data.h"
|
||||
|
||||
using model::Message;
|
||||
|
||||
////////////////////////////////////////////////////////////////////
|
||||
/// 表示一个历史消息元素
|
||||
////////////////////////////////////////////////////////////////////
|
||||
class HistoryItem : public QWidget {
|
||||
Q_OBJECT
|
||||
public:
|
||||
HistoryItem() {}
|
||||
|
||||
static HistoryItem* makeHistoryItem(const Message& message);
|
||||
};
|
||||
|
||||
////////////////////////////////////////////////////////////////////
|
||||
/// 展示历史消息窗口
|
||||
////////////////////////////////////////////////////////////////////
|
||||
class HistoryMessageWidget : public QDialog
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
HistoryMessageWidget(QWidget *parent);
|
||||
|
||||
//在窗口中添加一个历史消息
|
||||
void addHistoryMessage(const Message& message);
|
||||
|
||||
//清空窗口中所有的历史消息
|
||||
void clear();
|
||||
|
||||
private:
|
||||
void initScrollArea(QGridLayout* layout);
|
||||
|
||||
QRadioButton* keyRadioBtn;
|
||||
QRadioButton* timeRadioBtn;
|
||||
QLineEdit* searchEdit;
|
||||
|
||||
QDateTimeEdit* begTimeEdit;
|
||||
QDateTimeEdit* endTimeEdit;
|
||||
|
||||
//持有所有的历史消息结果的容器对象
|
||||
QWidget* container;
|
||||
};
|
||||
Reference in New Issue
Block a user