Home > Mobile >  QList<Structure & gt; Scheduling problems
QList<Structure & gt; Scheduling problems

Time:10-27

Struct JIEGOU1
{
int a;
}

QList
Excuse me I how through a field in the structure size list ordering

CodePudding user response:

Through the qsort sorts, and then introduced to compare the size of function
 
Bool compareBarData (const JIEGOU1 & amp; BarAmount1, const JIEGOU1 & amp; BarAmount2)
{
If (barAmount1. A & lt; BarAmount2. A)
{
return true;
}
return false;
}

Tree list. The begin (), list the end (), compareBarData);

CodePudding user response:

Learn about the generic algorithm

CodePudding user response:

reference 1/f, but the plane's reply:
by qsort sorts, and then introduced to compare the size of function
 
Bool compareBarData (const JIEGOU1 & amp; BarAmount1, const JIEGOU1 & amp; BarAmount2)
{
If (barAmount1. A & lt; BarAmount2. A)
{
return true;
}
return false;
}

Tree list. The begin (), list the end (), compareBarData);
I also is such
  •  Tags:  
  • Qt
  • Related