Replace the deprecated qSort with std::sort

This commit is contained in:
Srivats P 2019-07-26 21:24:25 +05:30
parent 0a2154d31b
commit 6974f4016f
4 changed files with 6 additions and 6 deletions

View File

@ -98,7 +98,7 @@ void Port::updateStreamOrdinalsFromIndex()
void Port::reorderStreamsByOrdinals()
{
qSort(mStreams.begin(), mStreams.end(), StreamBase::StreamLessThan);
std::sort(mStreams.begin(), mStreams.end(), StreamBase::StreamLessThan);
}
void Port::setDirty(bool dirty)

View File

@ -87,7 +87,7 @@ void PortStatsFilterDialog::on_tbSelectIn_clicked()
foreach(QModelIndex idx, lvUnselected->selectionModel()->selectedIndexes())
rows.append(idx.row());
qSort(rows.begin(), rows.end(), qGreater<int>());
std::sort(rows.begin(), rows.end(), qGreater<int>());
QModelIndex idx = lvSelected->selectionModel()->currentIndex();
int insertAt = idx.isValid() ? idx.row() : mSelected.rowCount();
@ -105,7 +105,7 @@ void PortStatsFilterDialog::on_tbSelectOut_clicked()
foreach(QModelIndex idx, lvSelected->selectionModel()->selectedIndexes())
rows.append(idx.row());
qSort(rows.begin(), rows.end(), qGreater<int>());
std::sort(rows.begin(), rows.end(), qGreater<int>());
foreach(int row, rows)
{

View File

@ -53,7 +53,7 @@ protected:
QString text;
int lastRow = -1;
QModelIndexList selected = selectionModel()->selectedIndexes();
qSort(selected);
std::sort(selected.begin(), selected.end());
foreach(QModelIndex index, selected) {
if (index.row() != lastRow) {
if (!text.isEmpty())

View File

@ -230,7 +230,7 @@ int AbstractPort::updatePacketListSequential()
qDebug("In %s", __FUNCTION__);
// First sort the streams by ordinalValue
qSort(streamList_.begin(), streamList_.end(), StreamBase::StreamLessThan);
std::sort(streamList_.begin(), streamList_.end(), StreamBase::StreamLessThan);
clearPacketList();
@ -440,7 +440,7 @@ int AbstractPort::updatePacketListInterleaved()
}
// First sort the streams by ordinalValue
qSort(streamList_.begin(), streamList_.end(), StreamBase::StreamLessThan);
std::sort(streamList_.begin(), streamList_.end(), StreamBase::StreamLessThan);
for (int i = 0; i < streamList_.size(); i++)
{