fix(frontend): Selection canceled with 'Show More' button clicked.
Description: 修复点击显示更多按钮时列表选中项被取消的问题 Log: 修复点击显示更多按钮时列表选中项被取消的问题
This commit is contained in:
parent
f2bddcc0ae
commit
8d30052518
|
@ -76,7 +76,13 @@ void SearchListView::appendItem(QString path) {
|
|||
*/
|
||||
void SearchListView::setList(QStringList list)
|
||||
{
|
||||
m_model->appendList(list);
|
||||
QModelIndex index = this->currentIndex();
|
||||
m_model->setList(list);
|
||||
if (index.row() >= 0 && index.row() < list.length()) {
|
||||
this->blockSignals(true);
|
||||
this->setCurrentIndex(index);
|
||||
this->blockSignals(false);
|
||||
}
|
||||
rowheight = this->rowHeight(this->model()->index(0, 0, QModelIndex()));
|
||||
this->setFixedHeight(m_item->getCurrentSize() * rowheight + 4);
|
||||
}
|
||||
|
|
|
@ -149,10 +149,10 @@ void SearchItemModel::appendItem(QString path) {
|
|||
}
|
||||
|
||||
/**
|
||||
* @brief SearchItemModel::appendList 直接以列表形式添加搜索结果
|
||||
* @brief SearchItemModel::setList 直接以列表形式添加搜索结果
|
||||
* @param list
|
||||
*/
|
||||
void SearchItemModel::appendList(QStringList list)
|
||||
void SearchItemModel::setList(QStringList list)
|
||||
{
|
||||
this->beginResetModel();
|
||||
m_item->m_pathlist = list;
|
||||
|
|
|
@ -53,7 +53,7 @@ public:
|
|||
void setItem(SearchItem *);
|
||||
|
||||
void appendItem(QString);
|
||||
void appendList(QStringList);
|
||||
void setList(QStringList);
|
||||
void removeItem(QString);
|
||||
void clear();
|
||||
|
||||
|
|
Loading…
Reference in New Issue