I have QTableWidget with custom progress bars (derived from QWidget), inserted into table with setCellWidget. Each bar have "progress" property and I need to sort by it. I reimplemented "<" operator, but sorting doesn't work and operator "<" not even called.
Header:
bool operator < (const ProgressBar &other);
bool operator < (const ProgressBar &other);
To copy to clipboard, switch view to plain text mode
CPP:
bool ProgressBar::operator < (const ProgressBar &other)
{
return progress < other.progress;
}
bool ProgressBar::operator < (const ProgressBar &other)
{
return progress < other.progress;
}
To copy to clipboard, switch view to plain text mode
Bookmarks