adding idx to all models
This commit is contained in:
parent
b80ee44abc
commit
d633a25ebe
6 changed files with 22 additions and 1 deletions
|
@ -219,6 +219,12 @@ ImageSqlModel *ImageProxyModel::imageModel() {
|
||||||
return m_imageModel;
|
return m_imageModel;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
QModelIndex ImageProxyModel::idx(int row) {
|
||||||
|
QModelIndex idx = index(row, 0);
|
||||||
|
// qDebug() << idx;
|
||||||
|
return idx;
|
||||||
|
}
|
||||||
|
|
||||||
QVariantMap ImageProxyModel::getImage(const int &row) {
|
QVariantMap ImageProxyModel::getImage(const int &row) {
|
||||||
return QVariantMap();
|
return QVariantMap();
|
||||||
}
|
}
|
||||||
|
|
|
@ -57,6 +57,7 @@ public:
|
||||||
~ImageProxyModel() = default;
|
~ImageProxyModel() = default;
|
||||||
|
|
||||||
ImageSqlModel *imageModel();
|
ImageSqlModel *imageModel();
|
||||||
|
Q_INVOKABLE QModelIndex idx(int row);
|
||||||
|
|
||||||
public slots:
|
public slots:
|
||||||
Q_INVOKABLE QVariantMap getImage(const int &row);
|
Q_INVOKABLE QVariantMap getImage(const int &row);
|
||||||
|
|
|
@ -254,6 +254,12 @@ PresentationSqlModel *PresentationProxyModel::presentationModel() {
|
||||||
return m_presentationModel;
|
return m_presentationModel;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
QModelIndex PresentationProxyModel::idx(int row) {
|
||||||
|
QModelIndex idx = index(row, 0);
|
||||||
|
// qDebug() << idx;
|
||||||
|
return idx;
|
||||||
|
}
|
||||||
|
|
||||||
QVariantMap PresentationProxyModel::getPresentation(const int &row) {
|
QVariantMap PresentationProxyModel::getPresentation(const int &row) {
|
||||||
return QVariantMap();
|
return QVariantMap();
|
||||||
}
|
}
|
||||||
|
|
|
@ -64,6 +64,7 @@ public:
|
||||||
~PresentationProxyModel() = default;
|
~PresentationProxyModel() = default;
|
||||||
|
|
||||||
PresentationSqlModel *presentationModel();
|
PresentationSqlModel *presentationModel();
|
||||||
|
Q_INVOKABLE QModelIndex idx(int row);
|
||||||
|
|
||||||
public slots:
|
public slots:
|
||||||
Q_INVOKABLE QVariantMap getPresentation(const int &row);
|
Q_INVOKABLE QVariantMap getPresentation(const int &row);
|
||||||
|
|
|
@ -335,6 +335,12 @@ VideoSqlModel *VideoProxyModel::videoModel() {
|
||||||
return m_videoModel;
|
return m_videoModel;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
QModelIndex VideoProxyModel::idx(int row) {
|
||||||
|
QModelIndex idx = index(row, 0);
|
||||||
|
// qDebug() << idx;
|
||||||
|
return idx;
|
||||||
|
}
|
||||||
|
|
||||||
QVariantMap VideoProxyModel::getVideo(const int &row) {
|
QVariantMap VideoProxyModel::getVideo(const int &row) {
|
||||||
auto model = qobject_cast<VideoSqlModel *>(sourceModel());
|
auto model = qobject_cast<VideoSqlModel *>(sourceModel());
|
||||||
QVariantMap video = model->getVideo(mapToSource(index(row, 0)).row());
|
QVariantMap video = model->getVideo(mapToSource(index(row, 0)).row());
|
||||||
|
|
|
@ -75,7 +75,8 @@ public:
|
||||||
~VideoProxyModel() = default;
|
~VideoProxyModel() = default;
|
||||||
|
|
||||||
VideoSqlModel *videoModel();
|
VideoSqlModel *videoModel();
|
||||||
|
Q_INVOKABLE QModelIndex idx(int row);
|
||||||
|
|
||||||
public slots:
|
public slots:
|
||||||
Q_INVOKABLE QVariantMap getVideo(const int &row);
|
Q_INVOKABLE QVariantMap getVideo(const int &row);
|
||||||
Q_INVOKABLE void deleteVideo(const int &row);
|
Q_INVOKABLE void deleteVideo(const int &row);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue