增加通讯协议
This commit is contained in:
@@ -17,17 +17,29 @@ class FaultTable : public QWidget
|
||||
public:
|
||||
explicit FaultTable(QWidget* parent = nullptr);
|
||||
|
||||
// 表头高度:同页其他控件可据此与表格内容区对齐
|
||||
static const int kHeaderHeight = 70;
|
||||
|
||||
void setData(const QVector<FaultRecord>& data);
|
||||
void setPage(int p);
|
||||
int page() const { return m_page; }
|
||||
int pageCount() const;
|
||||
|
||||
// 供外部设置 Tab 顺序用(定义在 .cpp,避免用到未完整声明的类型)
|
||||
QWidget* view() const;
|
||||
QWidget* prevButton() const;
|
||||
QWidget* nextButton() const;
|
||||
|
||||
signals:
|
||||
void pageChanged(int page);
|
||||
void rowClicked(int globalIndex);
|
||||
|
||||
protected:
|
||||
bool eventFilter(QObject* obj, QEvent* ev) override; // 拦截 Tab(按行切换选中)、回车/空格(等同点击)
|
||||
|
||||
private:
|
||||
void refresh();
|
||||
void setHoverRow(int row); // 鼠标悬停的整行高亮
|
||||
|
||||
QTableWidget* m_table = nullptr;
|
||||
QLabel* m_pageLabel = nullptr;
|
||||
@@ -36,6 +48,7 @@ private:
|
||||
QVector<FaultRecord> m_data;
|
||||
int m_page = 0;
|
||||
int m_pageSize = 6;
|
||||
int m_hoverRow = -1;
|
||||
};
|
||||
|
||||
#endif // FAULTTABLE_H
|
||||
|
||||
Reference in New Issue
Block a user