You are confusing all kinds of stuff, and you clearly have no understanding of how basic variable deceleration works.
You should really first learn basic programming concepts, and C syntax before you start programming with C++ and Qt.
your original code could not even compile!
QList<double> list;
for(int i = 0; i < Num; ++i) {
list << in[i]->text().toDouble(&ok);
}
qSort(list.begin(), list.end(), qGreater<double>());
for(int i = 0; i < Num; ++i){
in
[i
]->setText
( QString::number(list.
at(i
)));
}
QList<double> list;
for(int i = 0; i < Num; ++i) {
list << in[i]->text().toDouble(&ok);
}
qSort(list.begin(), list.end(), qGreater<double>());
for(int i = 0; i < Num; ++i){
in[i]->setText( QString::number(list.at(i)));
}
To copy to clipboard, switch view to plain text mode
Bookmarks