Backport qSort deprecation fixes

This commit is contained in:
Juergen Spitzmueller 2021-03-13 11:46:49 +01:00
parent 935e51837d
commit aad8804549
5 changed files with 10 additions and 10 deletions

View File

@ -155,7 +155,7 @@ GuiBox::GuiBox(QWidget * parent) : InsetParamsWidget(parent)
// the background can be uncolored while the frame cannot // the background can be uncolored while the frame cannot
color_codes_ = colors(); color_codes_ = colors();
qSort(color_codes_.begin(), color_codes_.end(), ColorSorter); sort(color_codes_.begin(), color_codes_.end(), ColorSorter);
fillComboColor(backgroundColorCO, true); fillComboColor(backgroundColorCO, true);
fillComboColor(frameColorCO, false); fillComboColor(frameColorCO, false);

View File

@ -234,7 +234,7 @@ GuiCharacter::GuiCharacter(GuiView & lv)
bar = barData(); bar = barData();
strike = strikeData(); strike = strikeData();
color = colorData(); color = colorData();
qSort(color.begin(), color.end(), ColorSorter); sort(color.begin(), color.end(), ColorSorter);
language = languageData(); language = languageData();
language.prepend(LanguagePair(qt_("Default"), "reset")); language.prepend(LanguagePair(qt_("Default"), "reset"));

View File

@ -207,7 +207,7 @@ GuiExternal::GuiExternal(GuiView & lv)
localizedTemplates.insert(qt_(i1->second.guiName), toqstr(i1->second.lyxName)); localizedTemplates.insert(qt_(i1->second.guiName), toqstr(i1->second.lyxName));
// Sort alphabetically by (localized) GUI name // Sort alphabetically by (localized) GUI name
QStringList keys = localizedTemplates.keys(); QStringList keys = localizedTemplates.keys();
qSort(keys.begin(), keys.end(), SortLocaleAware); sort(keys.begin(), keys.end(), SortLocaleAware);
for (QString & key : keys) { for (QString & key : keys) {
QString const value = localizedTemplates[key]; QString const value = localizedTemplates[key];
externalCO->addItem(key, value); externalCO->addItem(key, value);

View File

@ -1204,7 +1204,7 @@ PrefColors::PrefColors(GuiPreferences * form)
continue; continue;
lcolors_.push_back(lc); lcolors_.push_back(lc);
} }
qSort(lcolors_.begin(), lcolors_.end(), ColorSorter); sort(lcolors_.begin(), lcolors_.end(), ColorSorter);
vector<ColorCode>::const_iterator cit = lcolors_.begin(); vector<ColorCode>::const_iterator cit = lcolors_.begin();
vector<ColorCode>::const_iterator const end = lcolors_.end(); vector<ColorCode>::const_iterator const end = lcolors_.end();
for (; cit != end; ++cit) { for (; cit != end; ++cit) {

View File

@ -471,19 +471,19 @@ void GuiRef::redoRefs()
} }
} }
// sort categories case-intensively // sort categories case-intensively
qSort(refsCategories.begin(), refsCategories.end(), sort(refsCategories.begin(), refsCategories.end(),
caseInsensitiveLessThan /*defined above*/); caseInsensitiveLessThan /*defined above*/);
if (noprefix) if (noprefix)
refsCategories.insert(0, qt_("<No prefix>")); refsCategories.insert(0, qt_("<No prefix>"));
QString const sort = sortingCO->isEnabled() ? QString const sort_method = sortingCO->isEnabled() ?
sortingCO->itemData(sortingCO->currentIndex()).toString() sortingCO->itemData(sortingCO->currentIndex()).toString()
: QString(); : QString();
if (sort == "nocase") if (sort_method == "nocase")
qSort(refsStrings.begin(), refsStrings.end(), sort(refsStrings.begin(), refsStrings.end(),
caseInsensitiveLessThan /*defined above*/); caseInsensitiveLessThan /*defined above*/);
else if (sort == "case") else if (sort_method == "case")
qSort(refsStrings.begin(), refsStrings.end()); sort(refsStrings.begin(), refsStrings.end());
if (groupCB->isChecked()) { if (groupCB->isChecked()) {
QList<QTreeWidgetItem *> refsCats; QList<QTreeWidgetItem *> refsCats;