C++ (Qt)QModelIndex DiliveriesModel::index(int row, int column, const QModelIndex &parent) const{ if (!hasIndex(row, column, parent)) return QModelIndex(); int tree_level; if (!parent.isValid()) // ??? tree_level = 1; else tree_level = 2; if (/* check row and column */) return createIndex(row, column, tree_level); else return QModelIndex();}
C++ (Qt)parentItem = static_cast<TreeItem*>(parent.internalPointer());
C++ (Qt)tree_level = static_cast<int>(parent.internalPointer());
C++ (Qt)QVariant DiliveriesModel::data(const QModelIndex &index, int role) const{}
class Delivery{public:...private: int deliveryNumber_; QDate deliveryDate_; QList<Product> deliveredProducts_;}