scanresultsitem.cpp 504 B

123456789101112131415161718
  1. /*
  2. * wpa_gui - ScanResultsItem class
  3. * Copyright (c) 2015, Adrian Nowicki <adinowicki@gmail.com>
  4. *
  5. * This software may be distributed under the terms of the BSD license.
  6. * See README for more details.
  7. */
  8. #include "scanresultsitem.h"
  9. bool ScanResultsItem::operator< (const QTreeWidgetItem &other) const
  10. {
  11. int sortCol = treeWidget()->sortColumn();
  12. if (sortCol == 2 || sortCol == 3) {
  13. return text(sortCol).toInt() < other.text(sortCol).toInt();
  14. }
  15. return text(sortCol) < other.text(sortCol);
  16. }