Backport deprecation fix

This commit is contained in:
Juergen Spitzmueller 2021-03-13 11:29:54 +01:00
parent 472f4f0a9d
commit da0d01cc10
6 changed files with 13 additions and 13 deletions

View File

@ -159,7 +159,7 @@ void BulletsModule::selectItem(int font, int character, bool select)
return;
QListWidget * lw = static_cast<QListWidget *>(bulletpaneSW->widget(font));
lw->setItemSelected(lw->item(character), select);
lw->item(character)->setSelected(select);
}

View File

@ -215,8 +215,8 @@ void GuiBibtex::addDatabase()
// multiple selections are possible
for (int i = 0; i != add_->bibLW->count(); ++i) {
QListWidgetItem * const item = add_->bibLW->item(i);
if (add_->bibLW->isItemSelected(item)) {
add_->bibLW->setItemSelected(item, false);
if (item->isSelected()) {
item->setSelected(false);
QList<QListWidgetItem *> matches =
databaseLW->findItems(item->text(), Qt::MatchExactly);
if (matches.empty()) {

View File

@ -144,7 +144,7 @@ void GuiBranches::updateView()
// restore selected branch
if (bname == sel_branch) {
branchesTW->setCurrentItem(newItem);
branchesTW->setItemSelected(newItem, true);
newItem->setSelected(true);
}
}
unknownPB->setEnabled(!unknown_branches_.isEmpty());

View File

@ -146,7 +146,7 @@ void GuiIndices::updateView()
// restore selected index
if (iname == sel_index) {
indicesTW->setCurrentItem(newItem);
indicesTW->setItemSelected(newItem, true);
newItem->setSelected(true);
}
}
indicesTW->resizeColumnToContents(0);

View File

@ -3320,7 +3320,7 @@ void PrefShortcuts::on_searchLE_textEdited()
// show all hidden items
QTreeWidgetItemIterator it(shortcutsTW, QTreeWidgetItemIterator::Hidden);
for (; *it; ++it)
shortcutsTW->setItemHidden(*it, isAlwaysHidden(**it));
(*it)->setHidden(isAlwaysHidden(**it));
// close all categories
for (int i = 0; i < shortcutsTW->topLevelItemCount(); ++i)
shortcutsTW->collapseItem(shortcutsTW->topLevelItem(i));
@ -3335,12 +3335,12 @@ void PrefShortcuts::on_searchLE_textEdited()
// hide everyone (to avoid searching in matched QList repeatedly
QTreeWidgetItemIterator it(shortcutsTW, QTreeWidgetItemIterator::Selectable);
while (*it)
shortcutsTW->setItemHidden(*it++, true);
(*it++)->setHidden(true);
// show matched items
for (int i = 0; i < matched.size(); ++i)
if (!isAlwaysHidden(*matched[i])) {
shortcutsTW->setItemHidden(matched[i], false);
shortcutsTW->setItemExpanded(matched[i]->parent(), true);
matched[i]->setHidden(false);
matched[i]->parent()->setExpanded(true);
}
}
@ -3447,7 +3447,7 @@ void PrefShortcuts::shortcutOkPressed()
if (item) {
user_bind_.bind(&k, func);
shortcutsTW->sortItems(0, Qt::AscendingOrder);
shortcutsTW->setItemExpanded(item->parent(), true);
item->parent()->setExpanded(true);
shortcutsTW->setCurrentItem(item);
shortcutsTW->scrollToItem(item);
} else {

View File

@ -206,7 +206,7 @@ void GuiRef::refHighlighted(QTreeWidgetItem * sel)
/* int const cur_item = refsTW->currentRow();
bool const cur_item_selected = cur_item >= 0 ?
refsLB->isSelected(cur_item) : false;*/
bool const cur_item_selected = refsTW->isItemSelected(sel);
bool const cur_item_selected = sel->isSelected();
if (cur_item_selected)
referenceED->setText(sel->text(0));
@ -242,7 +242,7 @@ void GuiRef::refSelected(QTreeWidgetItem * sel)
/* int const cur_item = refsTW->currentRow();
bool const cur_item_selected = cur_item >= 0 ?
refsLB->isSelected(cur_item) : false;*/
bool const cur_item_selected = refsTW->isItemSelected(sel);
bool const cur_item_selected = sel->isSelected();
if (cur_item_selected)
referenceED->setText(sel->text(0));
@ -526,7 +526,7 @@ void GuiRef::redoRefs()
while (*it) {
if ((*it)->text(0) == textToFind) {
refsTW->setCurrentItem(*it);
refsTW->setItemSelected(*it, true);
(*it)->setSelected(true);
//Make sure selected item is visible
refsTW->scrollToItem(*it);
last_reference_ = textToFind;