50 #ifndef OBJECTLISTITEMMODEL_HH_ 51 #define OBJECTLISTITEMMODEL_HH_ 53 #include <QAbstractItemModel> 61 virtual int rowCount(
const QModelIndex & parent = QModelIndex())
const;
62 virtual QVariant data(
const QModelIndex & index,
int role = Qt::DisplayRole)
const;
64 void removeObject(
int _id);
66 void refresh(
const DataType &datatype);
71 ObjectInfo(
const QString &name,
const int id) : name(name), id(
id) {}
74 const int nameCmp = name.compare(rhs.name);
75 if (!nameCmp)
return id < rhs.id;
80 return id == rhs.id && name == rhs.name;
83 const QString &getName()
const {
return name; }
84 int getId()
const {
return id; }
91 std::vector<ObjectInfo> objects_;