mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-12-23 21:40:19 +00:00
Backport deprecation fix
This commit is contained in:
parent
472f4f0a9d
commit
da0d01cc10
@ -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);
|
||||
}
|
||||
|
||||
|
||||
|
@ -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()) {
|
||||
|
@ -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());
|
||||
|
@ -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);
|
||||
|
@ -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 {
|
||||
|
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user