Have you at least read the links that i gave you in my previous post?
class Version{
public:
Version
(QString releaseDate,
QString url
) : releaseDate
(releaseDate
), URL
(url
) { }};
bool VersionCompare(const Version& i, const Version& j)
{
return i.releaseDate < j.releaseDate; //what ever you consider necessary... for one Version to be lessThan other
}
int main()
{
QList<Version> list;
list.append(Version("zz", "url"));
list.append(Version("gg", "url"));
list.append(Version("aa", "aa"));
qSort(list.begin(), list.end(), VersionCompare);
return 0;
}
class Version{
public:
Version(QString releaseDate,QString url) : releaseDate(releaseDate), URL(url) { }
QString releaseDate;
QString URL;
};
bool VersionCompare(const Version& i, const Version& j)
{
return i.releaseDate < j.releaseDate; //what ever you consider necessary... for one Version to be lessThan other
}
int main()
{
QList<Version> list;
list.append(Version("zz", "url"));
list.append(Version("gg", "url"));
list.append(Version("aa", "aa"));
qSort(list.begin(), list.end(), VersionCompare);
return 0;
}
To copy to clipboard, switch view to plain text mode
Bookmarks