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
color_codes_ = colors();
qSort(color_codes_.begin(), color_codes_.end(), ColorSorter);
sort(color_codes_.begin(), color_codes_.end(), ColorSorter);
fillComboColor(backgroundColorCO, true);
fillComboColor(frameColorCO, false);

View File

@ -234,7 +234,7 @@ GuiCharacter::GuiCharacter(GuiView & lv)
bar = barData();
strike = strikeData();
color = colorData();
qSort(color.begin(), color.end(), ColorSorter);
sort(color.begin(), color.end(), ColorSorter);
language = languageData();
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));
// Sort alphabetically by (localized) GUI name
QStringList keys = localizedTemplates.keys();
qSort(keys.begin(), keys.end(), SortLocaleAware);
sort(keys.begin(), keys.end(), SortLocaleAware);
for (QString & key : keys) {
QString const value = localizedTemplates[key];
externalCO->addItem(key, value);

View File

@ -1204,7 +1204,7 @@ PrefColors::PrefColors(GuiPreferences * form)
continue;
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 const end = lcolors_.end();
for (; cit != end; ++cit) {

View File

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