Fix: Seletion is cleared when paletted changed.
修复收到palettechanged信号时列表选中状态消失的问题.
This commit is contained in:
parent
550681b38f
commit
b47720396e
|
@ -128,7 +128,13 @@ void SearchListView::clear() {
|
|||
*/
|
||||
void SearchListView::refresh()
|
||||
{
|
||||
QModelIndex index = this->currentIndex();
|
||||
m_model->refresh();
|
||||
if(index.row() >= 0 && index.row() < m_model->length() && m_isSelected) {
|
||||
this->blockSignals(true);
|
||||
this->setCurrentIndex(index);
|
||||
this->blockSignals(false);
|
||||
}
|
||||
rowheight = this->rowHeight(this->model()->index(0, 0, QModelIndex())) + 1;
|
||||
this->setFixedHeight(m_item->getCurrentSize() * rowheight + 4);
|
||||
}
|
||||
|
|
|
@ -186,3 +186,8 @@ void SearchItemModel::refresh()
|
|||
this->beginResetModel();
|
||||
this->endResetModel();
|
||||
}
|
||||
|
||||
int SearchItemModel::length()
|
||||
{
|
||||
return m_item->m_pathlist.length();
|
||||
}
|
||||
|
|
|
@ -60,6 +60,7 @@ public:
|
|||
void clear();
|
||||
void setBestAppIcon(const QString &, const bool &);
|
||||
void refresh();
|
||||
int length();
|
||||
|
||||
private :
|
||||
SearchItem * m_item = nullptr;
|
||||
|
|
Loading…
Reference in New Issue