---
This commit is contained in:
@@ -306,7 +306,7 @@ void RecordQuery::on_btnNextPage_clicked()
|
||||
}
|
||||
|
||||
|
||||
void RecordQuery::on_btnLastPage_2_clicked()
|
||||
void RecordQuery::on_btnLastPage_clicked()
|
||||
{
|
||||
m_currentPageIndex = m_maxPageIndex-1;
|
||||
ui->spbGoToPage->setValue(m_currentPageIndex+1);
|
||||
|
||||
@@ -70,7 +70,7 @@ private slots:
|
||||
|
||||
void on_btnNextPage_clicked();
|
||||
|
||||
void on_btnLastPage_2_clicked();
|
||||
void on_btnLastPage_clicked();
|
||||
|
||||
void on_spbGoToPage_valueChanged(int arg1);
|
||||
|
||||
|
||||
@@ -385,7 +385,7 @@
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QToolButton" name="btnLastPage_2">
|
||||
<widget class="QToolButton" name="btnLastPage">
|
||||
<property name="text">
|
||||
<string>...</string>
|
||||
</property>
|
||||
|
||||
@@ -293,15 +293,21 @@ void MainWindow::UpdateMessageList() {
|
||||
column_index = column_index + 1;
|
||||
|
||||
//插入所有项
|
||||
m_unReadMsgCount = 0;
|
||||
int rowIndex = 0;
|
||||
for (int index = 0; index < m_msgList.size(); index++) {
|
||||
Record& r = m_msgList[index];
|
||||
if(r.type == CommType::Call){
|
||||
continue;
|
||||
}
|
||||
|
||||
int column_index = 0;
|
||||
// 读取状态
|
||||
auto item = new QTableWidgetItem(r.isUnread ? "未读" : "已读");
|
||||
item->setTextAlignment(Qt::AlignCenter);
|
||||
if(r.isUnread){
|
||||
item->setBackground(Qt::cyan);
|
||||
++m_unReadMsgCount;
|
||||
}
|
||||
ui->tblMessageList->setItem(rowIndex, column_index, item);
|
||||
column_index = column_index + 1;
|
||||
@@ -333,6 +339,7 @@ void MainWindow::UpdateMessageList() {
|
||||
|
||||
rowIndex++;
|
||||
}
|
||||
ui->lblUnreadMessageCount->setText(QString("%1").arg(m_unReadMsgCount));
|
||||
}
|
||||
//--------------------------------------------------------------------------------------
|
||||
// 槽函数
|
||||
@@ -433,9 +440,11 @@ void MainWindow::on_tblMessageList_currentItemChanged(QTableWidgetItem *current,
|
||||
}else{
|
||||
ui->txtCurrentItemMessageContent->setText(m_msgList[currentRow].content);
|
||||
if(m_msgList[currentRow].isUnread){
|
||||
m_msgList[currentRow].isUnread = true;
|
||||
m_msgList[currentRow].isUnread = false;
|
||||
ui->tblMessageList->item(currentRow,0)->setText("已读");
|
||||
ui->tblMessageList->item(currentRow,0)->setBackground(Qt::white);
|
||||
--m_unReadMsgCount;
|
||||
ui->lblUnreadMessageCount->setText(QString("%1").arg(m_unReadMsgCount));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -87,7 +87,7 @@ private:
|
||||
Ui::MainWindow *ui;
|
||||
CallStatus m_callStatus = CallStatus::Idle;
|
||||
std::vector<Record> m_msgList;
|
||||
|
||||
int m_unReadMsgCount = 0;
|
||||
int m_callDuration = 0;
|
||||
std::shared_ptr<QTimer> m_timer;
|
||||
std::shared_ptr<spdlog::logger> m_logger;
|
||||
|
||||
Reference in New Issue
Block a user