#ifndef CTAI_HISTORY_WIDGET_H #define CTAI_HISTORY_WIDGET_H #include #include #include #include #include "ctai_history_textedit.h" class ctai_history_widget : public QTableWidget { Q_OBJECT public: ctai_history_widget(QWidget *parent = nullptr); ~ctai_history_widget(); void add_message(const model_data &message); ctai_history_textedit *current_message() const; private: std::map> message_map_; // int存储行号 QString last_send_id_; void setup_table(); void update_stored_data(model_data* stored_data, const model_data& message); private slots: void on_msg_remove(QString send_id); void on_widget_height_changed(); // 新增槽函数处理高度变化 }; #endif