added a way to get the item through C++ from the rust model

This commit is contained in:
Chris Cochrun 2023-09-08 14:54:00 -05:00
parent bc3024434e
commit e5a7360f0b
3 changed files with 16 additions and 35 deletions

View file

@ -25,6 +25,7 @@
#include <QImage>
#include "cxx-qt-gen/slide_model.cxxqt.h"
#include "cxx-qt-gen/service_item_model.cxxqt.h"
ServiceItemModel::ServiceItemModel(QObject *parent)
: QAbstractListModel(parent) {
@ -393,6 +394,11 @@ bool ServiceItemModel::moveUp(int id) {
return false;
}
QVariantMap ServiceItemModel::getRust(int index, ServiceItemMod *rustModel) const {
QVariantMap item = rustModel->getItem(index);
return item;
}
QVariantMap ServiceItemModel::getItem(int index) const {
QVariantMap data;
const QModelIndex idx = this->index(index,0);