[LyX/2.3.x] Backport deprecation fix

Juergen Spitzmueller spitz at lyx.org
Sat Mar 13 10:24:39 UTC 2021


commit da0d01cc107d112d8b640dce92bfa6e943c1569c
Author: Juergen Spitzmueller <spitz at lyx.org>
Date:   Sat Mar 13 11:29:54 2021 +0100

    Backport deprecation fix
---
 src/frontends/qt4/BulletsModule.cpp |    2 +-
 src/frontends/qt4/GuiBibtex.cpp     |    4 ++--
 src/frontends/qt4/GuiBranches.cpp   |    2 +-
 src/frontends/qt4/GuiIndices.cpp    |    2 +-
 src/frontends/qt4/GuiPrefs.cpp      |   10 +++++-----
 src/frontends/qt4/GuiRef.cpp        |    6 +++---
 6 files changed, 13 insertions(+), 13 deletions(-)

diff --git a/src/frontends/qt4/BulletsModule.cpp b/src/frontends/qt4/BulletsModule.cpp
index 5cbca09..ef21bd9 100644
--- a/src/frontends/qt4/BulletsModule.cpp
+++ b/src/frontends/qt4/BulletsModule.cpp
@@ -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);
 }
 
 
diff --git a/src/frontends/qt4/GuiBibtex.cpp b/src/frontends/qt4/GuiBibtex.cpp
index 4b4dd7e..a1a4f54 100644
--- a/src/frontends/qt4/GuiBibtex.cpp
+++ b/src/frontends/qt4/GuiBibtex.cpp
@@ -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()) {
diff --git a/src/frontends/qt4/GuiBranches.cpp b/src/frontends/qt4/GuiBranches.cpp
index ab91587..b1ef8be 100644
--- a/src/frontends/qt4/GuiBranches.cpp
+++ b/src/frontends/qt4/GuiBranches.cpp
@@ -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());
diff --git a/src/frontends/qt4/GuiIndices.cpp b/src/frontends/qt4/GuiIndices.cpp
index 7c7a610..5e145f5 100644
--- a/src/frontends/qt4/GuiIndices.cpp
+++ b/src/frontends/qt4/GuiIndices.cpp
@@ -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);
diff --git a/src/frontends/qt4/GuiPrefs.cpp b/src/frontends/qt4/GuiPrefs.cpp
index f3e4269..f40f8fc 100644
--- a/src/frontends/qt4/GuiPrefs.cpp
+++ b/src/frontends/qt4/GuiPrefs.cpp
@@ -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 {
diff --git a/src/frontends/qt4/GuiRef.cpp b/src/frontends/qt4/GuiRef.cpp
index 0d30a68..6dae4b1 100644
--- a/src/frontends/qt4/GuiRef.cpp
+++ b/src/frontends/qt4/GuiRef.cpp
@@ -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;


More information about the lyx-cvs mailing list