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:
Qt Code:
  1. bool operator < (const ProgressBar &other);
To copy to clipboard, switch view to plain text mode 
CPP:
Qt Code:
  1. bool ProgressBar::operator < (const ProgressBar &other)
  2. {
  3. return progress < other.progress;
  4. }
To copy to clipboard, switch view to plain text mode