mirror of
https://gitee.com/vnotex/vnote.git
synced 2025-07-05 13:59:52 +08:00
VTreeWidget: setCurrentItem with ClearAndSelect
This commit is contained in:
parent
a1bef71215
commit
f9c994b91c
@ -170,7 +170,7 @@ void VListWidget::selectNextItem(bool p_forward)
|
||||
cur = count() - 1;
|
||||
}
|
||||
|
||||
setCurrentRow(cur);
|
||||
setCurrentRow(cur, QItemSelectionModel::ClearAndSelect);
|
||||
}
|
||||
|
||||
void VListWidget::sortListWidget(QListWidget *p_list, const QVector<int> &p_sortedIdx)
|
||||
|
@ -197,7 +197,7 @@ void VTreeWidget::clearItemsHighlight()
|
||||
|
||||
void VTreeWidget::selectHitItem(void *p_item)
|
||||
{
|
||||
setCurrentItem(static_cast<QTreeWidgetItem *>(p_item));
|
||||
setCurrentItem(static_cast<QTreeWidgetItem *>(p_item), 0, QItemSelectionModel::ClearAndSelect);
|
||||
}
|
||||
|
||||
// Count the total number of tree @p_item.
|
||||
@ -301,13 +301,13 @@ void VTreeWidget::selectNextItem(bool p_forward)
|
||||
|
||||
QTreeWidgetItem *item = currentItem();
|
||||
if (!item) {
|
||||
setCurrentItem(topLevelItem(0));
|
||||
setCurrentItem(topLevelItem(0), 0, QItemSelectionModel::ClearAndSelect);
|
||||
return;
|
||||
}
|
||||
|
||||
QTreeWidgetItem *nItem = nextItem(item, p_forward);
|
||||
if (nItem) {
|
||||
setCurrentItem(nItem);
|
||||
setCurrentItem(nItem, 0, QItemSelectionModel::ClearAndSelect);
|
||||
}
|
||||
}
|
||||
|
||||
@ -341,7 +341,7 @@ void VTreeWidget::selectParentItem()
|
||||
if (item) {
|
||||
QTreeWidgetItem *pitem = item->parent();
|
||||
if (pitem) {
|
||||
setCurrentItem(pitem);
|
||||
setCurrentItem(pitem, 0, QItemSelectionModel::ClearAndSelect);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user