#ifndef LOCATION_TABLE_DISTANCE_ITEM_H
#define LOCATION_TABLE_DISTANCE_ITEM_H

#include <QtGui>

class LocationTableDistanceItem : public QTableWidgetItem {
public:
	LocationTableDistanceItem(const QString & text, double kilometers) : QTableWidgetItem(text) {
		this->setData(Qt::UserRole, QVariant::fromValue(kilometers));
	}

	virtual bool operator<(const QTableWidgetItem & that) const {
		unsigned long long thisKilometers = this->data(Qt::UserRole).toULongLong();
		unsigned long long thatKilometers = that.data(Qt::UserRole).toULongLong();

		return thisKilometers < thatKilometers;
	}
};

#endif