initial port to cxx_qt 6.0
This commit is contained in:
parent
62daf316a3
commit
744481587f
31 changed files with 1992 additions and 1860 deletions
|
@ -27,11 +27,11 @@
|
|||
#include "cxx-qt-gen/slide_model.cxxqt.h"
|
||||
#include "cxx-qt-gen/service_item_model.cxxqt.h"
|
||||
|
||||
ServiceItemModel::ServiceItemModel(QObject *parent)
|
||||
ServiceItemModelCpp::ServiceItemModelCpp(QObject *parent)
|
||||
: QAbstractListModel(parent) {
|
||||
}
|
||||
|
||||
int ServiceItemModel::rowCount(const QModelIndex &parent) const {
|
||||
int ServiceItemModelCpp::rowCount(const QModelIndex &parent) const {
|
||||
// For list models only the root node (an invalid parent) should return the
|
||||
// list's size. For all other (valid) parents, rowCount() should return 0 so
|
||||
// that it does not become a tree model.
|
||||
|
@ -42,7 +42,7 @@ int ServiceItemModel::rowCount(const QModelIndex &parent) const {
|
|||
return m_items.size();
|
||||
}
|
||||
|
||||
QVariant ServiceItemModel::data(const QModelIndex &index, int role) const {
|
||||
QVariant ServiceItemModelCpp::data(const QModelIndex &index, int role) const {
|
||||
if (!index.isValid())
|
||||
return QVariant();
|
||||
|
||||
|
@ -77,7 +77,7 @@ QVariant ServiceItemModel::data(const QModelIndex &index, int role) const {
|
|||
}
|
||||
}
|
||||
|
||||
QHash<int, QByteArray> ServiceItemModel::roleNames() const {
|
||||
QHash<int, QByteArray> ServiceItemModelCpp::roleNames() const {
|
||||
static QHash<int, QByteArray> mapping{{NameRole, "name"},
|
||||
{TypeRole, "type"},
|
||||
{BackgroundRole, "background"},
|
||||
|
@ -94,7 +94,7 @@ QHash<int, QByteArray> ServiceItemModel::roleNames() const {
|
|||
return mapping;
|
||||
}
|
||||
|
||||
bool ServiceItemModel::setData(const QModelIndex &index, const QVariant &value,
|
||||
bool ServiceItemModelCpp::setData(const QModelIndex &index, const QVariant &value,
|
||||
int role) {
|
||||
|
||||
ServiceItem *item = m_items[index.row()];
|
||||
|
@ -182,14 +182,14 @@ bool ServiceItemModel::setData(const QModelIndex &index, const QVariant &value,
|
|||
return false;
|
||||
}
|
||||
|
||||
Qt::ItemFlags ServiceItemModel::flags(const QModelIndex &index) const {
|
||||
Qt::ItemFlags ServiceItemModelCpp::flags(const QModelIndex &index) const {
|
||||
if (!index.isValid())
|
||||
return Qt::NoItemFlags;
|
||||
|
||||
return Qt::ItemIsEditable; // FIXME: Implement me!
|
||||
}
|
||||
|
||||
void ServiceItemModel::addItem(ServiceItem *item) {
|
||||
void ServiceItemModelCpp::addItem(ServiceItem *item) {
|
||||
const int index = m_items.size();
|
||||
qDebug() << index;
|
||||
// foreach (item, m_items) {
|
||||
|
@ -200,14 +200,14 @@ void ServiceItemModel::addItem(ServiceItem *item) {
|
|||
endInsertRows();
|
||||
}
|
||||
|
||||
void ServiceItemModel::insertItem(const int &index, ServiceItem *item) {
|
||||
void ServiceItemModelCpp::insertItem(const int &index, ServiceItem *item) {
|
||||
beginInsertRows(this->index(index).parent(), index, index);
|
||||
m_items.insert(index, item);
|
||||
endInsertRows();
|
||||
qDebug() << "Success";
|
||||
}
|
||||
|
||||
void ServiceItemModel::addItem(const QString &name, const QString &type,
|
||||
void ServiceItemModelCpp::addItem(const QString &name, const QString &type,
|
||||
const QString &background, const QString &backgroundType,
|
||||
const QStringList &text, const QString &audio,
|
||||
const QString &font, const int &fontSize,
|
||||
|
@ -248,7 +248,7 @@ void ServiceItemModel::addItem(const QString &name, const QString &type,
|
|||
qDebug() << "#################################";
|
||||
}
|
||||
|
||||
void ServiceItemModel::insertItem(const int &index, const QString &name,
|
||||
void ServiceItemModelCpp::insertItem(const int &index, const QString &name,
|
||||
const QString &type,const QString &background,
|
||||
const QString &backgroundType,const QStringList &text,
|
||||
const QString &audio, const QString &font,
|
||||
|
@ -289,13 +289,13 @@ void ServiceItemModel::insertItem(const int &index, const QString &name,
|
|||
qDebug() << "#################################";
|
||||
}
|
||||
|
||||
void ServiceItemModel::removeItem(int index) {
|
||||
void ServiceItemModelCpp::removeItem(int index) {
|
||||
beginRemoveRows(QModelIndex(), index, index);
|
||||
m_items.removeAt(index);
|
||||
endRemoveRows();
|
||||
}
|
||||
|
||||
void ServiceItemModel::removeItems() {
|
||||
void ServiceItemModelCpp::removeItems() {
|
||||
for (int i = m_items.length() - 1; i > -1; i--) {
|
||||
QModelIndex idx = index(i);
|
||||
ServiceItem *item = m_items[idx.row()];
|
||||
|
@ -313,7 +313,7 @@ void ServiceItemModel::removeItems() {
|
|||
|
||||
}
|
||||
|
||||
bool ServiceItemModel::moveRows(int sourceIndex, int destIndex, int count) {
|
||||
bool ServiceItemModelCpp::moveRows(int sourceIndex, int destIndex, int count) {
|
||||
qDebug() << sourceIndex;
|
||||
qDebug() << destIndex;
|
||||
|
||||
|
@ -349,7 +349,7 @@ bool ServiceItemModel::moveRows(int sourceIndex, int destIndex, int count) {
|
|||
return true;
|
||||
}
|
||||
|
||||
bool ServiceItemModel::moveDown(int id) {
|
||||
bool ServiceItemModelCpp::moveDown(int id) {
|
||||
qDebug() << index(id).row();
|
||||
qDebug() << index(id + 1).row();
|
||||
QModelIndex parent = index(id).parent();
|
||||
|
@ -371,7 +371,7 @@ bool ServiceItemModel::moveDown(int id) {
|
|||
return false;
|
||||
}
|
||||
|
||||
bool ServiceItemModel::moveUp(int id) {
|
||||
bool ServiceItemModelCpp::moveUp(int id) {
|
||||
qDebug() << index(id).row();
|
||||
qDebug() << index(id - 1).row();
|
||||
QModelIndex parent = index(id).parent();
|
||||
|
@ -394,7 +394,7 @@ bool ServiceItemModel::moveUp(int id) {
|
|||
return false;
|
||||
}
|
||||
|
||||
bool ServiceItemModel::moveRowsRust(int source, int dest, int count, ServiceItemMod *rustModel) {
|
||||
bool ServiceItemModelCpp::moveRowsRust(int source, int dest, int count, ServiceItemModel *rustModel) {
|
||||
const QModelIndex parent = index(source).parent();
|
||||
const bool isMoveDown = dest > source;
|
||||
|
||||
|
@ -409,12 +409,12 @@ bool ServiceItemModel::moveRowsRust(int source, int dest, int count, ServiceItem
|
|||
return moved;
|
||||
}
|
||||
|
||||
QVariantMap ServiceItemModel::getRust(int index, ServiceItemMod *rustModel) const {
|
||||
QVariantMap ServiceItemModelCpp::getRust(int index, ServiceItemModel *rustModel) const {
|
||||
QVariantMap item = rustModel->getItem(index);
|
||||
return item;
|
||||
}
|
||||
|
||||
QVariantMap ServiceItemModel::getItem(int index) const {
|
||||
QVariantMap ServiceItemModelCpp::getItem(int index) const {
|
||||
QVariantMap data;
|
||||
const QModelIndex idx = this->index(index,0);
|
||||
// qDebug() << idx;
|
||||
|
@ -431,7 +431,7 @@ QVariantMap ServiceItemModel::getItem(int index) const {
|
|||
return data;
|
||||
}
|
||||
|
||||
QVariantList ServiceItemModel::getItems() {
|
||||
QVariantList ServiceItemModelCpp::getItems() {
|
||||
QVariantList data;
|
||||
ServiceItem * item;
|
||||
foreach (item, m_items) {
|
||||
|
@ -457,7 +457,7 @@ QVariantList ServiceItemModel::getItems() {
|
|||
return data;
|
||||
}
|
||||
|
||||
bool ServiceItemModel::select(int id) {
|
||||
bool ServiceItemModelCpp::select(int id) {
|
||||
for (int i = 0; i < m_items.length(); i++) {
|
||||
QModelIndex idx = index(i);
|
||||
ServiceItem *item = m_items[idx.row()];
|
||||
|
@ -479,7 +479,7 @@ bool ServiceItemModel::select(int id) {
|
|||
return true;
|
||||
}
|
||||
|
||||
bool ServiceItemModel::selectItems(QVariantList items) {
|
||||
bool ServiceItemModelCpp::selectItems(QVariantList items) {
|
||||
qDebug() << "Let's select some items!";
|
||||
for (int i = 0; i < m_items.length(); i++) {
|
||||
QModelIndex idx = index(i);
|
||||
|
@ -508,7 +508,7 @@ bool ServiceItemModel::selectItems(QVariantList items) {
|
|||
return true;
|
||||
}
|
||||
|
||||
bool ServiceItemModel::activate(int id) {
|
||||
bool ServiceItemModelCpp::activate(int id) {
|
||||
QModelIndex idx = index(id);
|
||||
ServiceItem *item = m_items[idx.row()];
|
||||
|
||||
|
@ -532,7 +532,7 @@ bool ServiceItemModel::activate(int id) {
|
|||
return true;
|
||||
}
|
||||
|
||||
bool ServiceItemModel::deactivate(int id) {
|
||||
bool ServiceItemModelCpp::deactivate(int id) {
|
||||
QModelIndex idx = index(id);
|
||||
ServiceItem *item = m_items[idx.row()];
|
||||
|
||||
|
@ -544,7 +544,7 @@ bool ServiceItemModel::deactivate(int id) {
|
|||
return true;
|
||||
}
|
||||
|
||||
bool ServiceItemModel::save(QUrl file) {
|
||||
bool ServiceItemModelCpp::save(QUrl file) {
|
||||
qDebug() << "@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@";
|
||||
qDebug() << "Saving...";
|
||||
qDebug() << "File path is: " << file.toString();
|
||||
|
@ -661,7 +661,7 @@ bool ServiceItemModel::save(QUrl file) {
|
|||
return false;
|
||||
}
|
||||
|
||||
bool ServiceItemModel::load(QUrl file) {
|
||||
bool ServiceItemModelCpp::load(QUrl file) {
|
||||
qDebug() << "@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@";
|
||||
qDebug() << "Loading...";
|
||||
qDebug() << "File path is: " << file.toString();
|
||||
|
@ -780,14 +780,14 @@ bool ServiceItemModel::load(QUrl file) {
|
|||
return false;
|
||||
}
|
||||
|
||||
void ServiceItemModel::clearAll() {
|
||||
void ServiceItemModelCpp::clearAll() {
|
||||
for (int i = m_items.size(); i >= 0; i--) {
|
||||
removeItem(i);
|
||||
}
|
||||
emit allRemoved();
|
||||
}
|
||||
|
||||
bool ServiceItemModel::loadLastSaved() {
|
||||
bool ServiceItemModelCpp::loadLastSaved() {
|
||||
QSettings settings;
|
||||
return load(settings.value("lastSaveFile").toUrl());
|
||||
}
|
||||
|
|
|
@ -11,11 +11,11 @@
|
|||
|
||||
#include "cxx-qt-gen/service_item_model.cxxqt.h"
|
||||
|
||||
class ServiceItemModel : public QAbstractListModel {
|
||||
class ServiceItemModelCpp : public QAbstractListModel {
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
explicit ServiceItemModel(QObject *parent = nullptr);
|
||||
explicit ServiceItemModelCpp(QObject *parent = nullptr);
|
||||
|
||||
enum Roles {
|
||||
NameRole = Qt::UserRole,
|
||||
|
@ -66,7 +66,7 @@ public:
|
|||
Q_INVOKABLE void removeItem(int index);
|
||||
Q_INVOKABLE void removeItems();
|
||||
Q_INVOKABLE bool moveRows(int sourceIndex, int destIndex, int count);
|
||||
Q_INVOKABLE bool moveRowsRust(int source, int dest, int count, ServiceItemMod *rustModel);
|
||||
Q_INVOKABLE bool moveRowsRust(int source, int dest, int count, ServiceItemModel *rustModel);
|
||||
Q_INVOKABLE bool moveDown(int index);
|
||||
Q_INVOKABLE bool moveUp(int index);
|
||||
Q_INVOKABLE bool select(int id);
|
||||
|
@ -74,7 +74,7 @@ public:
|
|||
Q_INVOKABLE bool activate(int id);
|
||||
Q_INVOKABLE bool deactivate(int id);
|
||||
Q_INVOKABLE QVariantMap getItem(int index) const;
|
||||
Q_INVOKABLE QVariantMap getRust(int index, ServiceItemMod *rustModel) const;
|
||||
Q_INVOKABLE QVariantMap getRust(int index, ServiceItemModel *rustModel) const;
|
||||
Q_INVOKABLE QVariantList getItems();
|
||||
Q_INVOKABLE void clearAll();
|
||||
|
||||
|
|
|
@ -27,7 +27,7 @@
|
|||
|
||||
const QDir writeDir = QStandardPaths::writableLocation(QStandardPaths::AppDataLocation);
|
||||
|
||||
SlideModel::SlideModel(QObject *parent)
|
||||
SlideModelCpp::SlideModelCpp(QObject *parent)
|
||||
: QAbstractListModel(parent) {
|
||||
// if () {
|
||||
// addItem(new Slide("10,000 Reasons", "song",
|
||||
|
@ -43,7 +43,7 @@ SlideModel::SlideModel(QObject *parent)
|
|||
// }
|
||||
}
|
||||
|
||||
int SlideModel::rowCount(const QModelIndex &parent) const {
|
||||
int SlideModelCpp::rowCount(const QModelIndex &parent) const {
|
||||
// For list models only the root node (an invalid parent) should return the
|
||||
// list's size. For all other (valid) parents, rowCount() should return 0 so
|
||||
// that it does not become a tree model.
|
||||
|
@ -54,7 +54,7 @@ int SlideModel::rowCount(const QModelIndex &parent) const {
|
|||
return m_items.size();
|
||||
}
|
||||
|
||||
QVariant SlideModel::data(const QModelIndex &index, int role) const {
|
||||
QVariant SlideModelCpp::data(const QModelIndex &index, int role) const {
|
||||
if (!index.isValid())
|
||||
return QVariant();
|
||||
|
||||
|
@ -95,7 +95,7 @@ QVariant SlideModel::data(const QModelIndex &index, int role) const {
|
|||
}
|
||||
}
|
||||
|
||||
QHash<int, QByteArray> SlideModel::roleNames() const {
|
||||
QHash<int, QByteArray> SlideModelCpp::roleNames() const {
|
||||
static QHash<int, QByteArray> mapping {
|
||||
{TextRole, "text"},
|
||||
{TypeRole, "type"},
|
||||
|
@ -117,7 +117,7 @@ QHash<int, QByteArray> SlideModel::roleNames() const {
|
|||
return mapping;
|
||||
}
|
||||
|
||||
bool SlideModel::setData(const QModelIndex &index, const QVariant &value,
|
||||
bool SlideModelCpp::setData(const QModelIndex &index, const QVariant &value,
|
||||
int role) {
|
||||
|
||||
Slide *item = m_items[index.row()];
|
||||
|
@ -223,14 +223,14 @@ bool SlideModel::setData(const QModelIndex &index, const QVariant &value,
|
|||
return false;
|
||||
}
|
||||
|
||||
Qt::ItemFlags SlideModel::flags(const QModelIndex &index) const {
|
||||
Qt::ItemFlags SlideModelCpp::flags(const QModelIndex &index) const {
|
||||
if (!index.isValid())
|
||||
return Qt::NoItemFlags;
|
||||
|
||||
return Qt::ItemIsEditable; // FIXME: Implement me!
|
||||
}
|
||||
|
||||
// int SlideModel::index(int row, int column, const QModelIndex &parent) {
|
||||
// int SlideyMod::index(int row, int column, const QModelIndex &parent) {
|
||||
// if (!hasIndex(row, column, parent))
|
||||
// return QModelIndex();
|
||||
|
||||
|
@ -247,7 +247,7 @@ Qt::ItemFlags SlideModel::flags(const QModelIndex &index) const {
|
|||
// return QModelIndex();
|
||||
// }
|
||||
|
||||
void SlideModel::addItem(Slide *item) {
|
||||
void SlideModelCpp::addItem(Slide *item) {
|
||||
const int index = m_items.size();
|
||||
qDebug() << index;
|
||||
// foreach (item, m_items) {
|
||||
|
@ -258,14 +258,14 @@ void SlideModel::addItem(Slide *item) {
|
|||
endInsertRows();
|
||||
}
|
||||
|
||||
void SlideModel::insertItem(const int &index, Slide *item) {
|
||||
void SlideModelCpp::insertItem(const int &index, Slide *item) {
|
||||
beginInsertRows(this->index(index).parent(), index, index);
|
||||
m_items.insert(index, item);
|
||||
endInsertRows();
|
||||
qDebug() << "Success";
|
||||
}
|
||||
|
||||
void SlideModel::addItem(const QString &text, const QString &type,
|
||||
void SlideModelCpp::addItem(const QString &text, const QString &type,
|
||||
const QString &imageBackground, const QString &videoBackground,
|
||||
const QString &audio,
|
||||
const QString &font, const int &fontSize,
|
||||
|
@ -286,7 +286,7 @@ void SlideModel::addItem(const QString &text, const QString &type,
|
|||
qDebug() << "#################################";
|
||||
}
|
||||
|
||||
void SlideModel::insertItem(const int &index,
|
||||
void SlideModelCpp::insertItem(const int &index,
|
||||
const QString &type, const QString &imageBackground,
|
||||
const QString &videoBackground, const QString &text,
|
||||
const QString &audio, const QString &font,
|
||||
|
@ -307,13 +307,13 @@ void SlideModel::insertItem(const int &index,
|
|||
qDebug() << "#################################";
|
||||
}
|
||||
|
||||
void SlideModel::removeItem(int index) {
|
||||
void SlideModelCpp::removeItem(int index) {
|
||||
beginRemoveRows(QModelIndex(), index, index);
|
||||
m_items.removeAt(index);
|
||||
endRemoveRows();
|
||||
}
|
||||
|
||||
void SlideModel::removeServiceItem(const int &index, const ServiceItem &item) {
|
||||
void SlideModelCpp::removeServiceItem(const int &index, const ServiceItem &item) {
|
||||
qDebug() << "Need to remove serviceItem:"
|
||||
<< item.name()
|
||||
<< "with"
|
||||
|
@ -345,7 +345,7 @@ void SlideModel::removeServiceItem(const int &index, const ServiceItem &item) {
|
|||
}
|
||||
}
|
||||
|
||||
void SlideModel::removeItems() {
|
||||
void SlideModelCpp::removeItems() {
|
||||
for (int i = m_items.length() - 1; i > -1; i--) {
|
||||
QModelIndex idx = index(i);
|
||||
Slide *item = m_items[idx.row()];
|
||||
|
@ -358,7 +358,7 @@ void SlideModel::removeItems() {
|
|||
}
|
||||
}
|
||||
|
||||
bool SlideModel::moveRows(int sourceIndex, int destIndex, int count) {
|
||||
bool SlideModelCpp::moveRows(int sourceIndex, int destIndex, int count) {
|
||||
qDebug() << index(sourceIndex).row();
|
||||
qDebug() << index(destIndex).row();
|
||||
|
||||
|
@ -391,7 +391,7 @@ bool SlideModel::moveRows(int sourceIndex, int destIndex, int count) {
|
|||
return true;
|
||||
}
|
||||
|
||||
bool SlideModel::moveDown(int id) {
|
||||
bool SlideModelCpp::moveDown(int id) {
|
||||
qDebug() << index(id).row();
|
||||
qDebug() << index(id + 1).row();
|
||||
QModelIndex parent = index(id).parent();
|
||||
|
@ -413,7 +413,7 @@ bool SlideModel::moveDown(int id) {
|
|||
return false;
|
||||
}
|
||||
|
||||
bool SlideModel::moveUp(int id) {
|
||||
bool SlideModelCpp::moveUp(int id) {
|
||||
qDebug() << index(id).row();
|
||||
qDebug() << index(id - 1).row();
|
||||
QModelIndex parent = index(id).parent();
|
||||
|
@ -436,7 +436,7 @@ bool SlideModel::moveUp(int id) {
|
|||
return false;
|
||||
}
|
||||
|
||||
QVariantMap SlideModel::getItem(int index) const {
|
||||
QVariantMap SlideModelCpp::getItem(int index) const {
|
||||
QVariantMap data;
|
||||
const QModelIndex idx = this->index(index,0);
|
||||
// qDebug() << idx;
|
||||
|
@ -453,13 +453,13 @@ QVariantMap SlideModel::getItem(int index) const {
|
|||
return data;
|
||||
}
|
||||
|
||||
QVariantMap SlideModel::getItemRust(int index, SlideyMod *slidemodel) const {
|
||||
QVariantMap SlideModelCpp::getItemRust(int index, SlideModel *slidemodel) const {
|
||||
QVariantMap data = slidemodel->getItem(index);
|
||||
qDebug() << data;
|
||||
return data;
|
||||
}
|
||||
|
||||
QVariantList SlideModel::getItems() {
|
||||
QVariantList SlideModelCpp::getItems() {
|
||||
QVariantList data;
|
||||
Slide * item;
|
||||
foreach (item, m_items) {
|
||||
|
@ -486,7 +486,7 @@ QVariantList SlideModel::getItems() {
|
|||
return data;
|
||||
}
|
||||
|
||||
bool SlideModel::select(int id) {
|
||||
bool SlideModelCpp::select(int id) {
|
||||
for (int i = 0; i < m_items.length(); i++) {
|
||||
QModelIndex idx = index(i);
|
||||
Slide *item = m_items[idx.row()];
|
||||
|
@ -508,7 +508,7 @@ bool SlideModel::select(int id) {
|
|||
return true;
|
||||
}
|
||||
|
||||
bool SlideModel::activate(int id) {
|
||||
bool SlideModelCpp::activate(int id) {
|
||||
QModelIndex idx = index(id);
|
||||
Slide *item = m_items[idx.row()];
|
||||
qDebug() << item->type();
|
||||
|
@ -534,7 +534,7 @@ bool SlideModel::activate(int id) {
|
|||
return true;
|
||||
}
|
||||
|
||||
bool SlideModel::deactivate(int id) {
|
||||
bool SlideModelCpp::deactivate(int id) {
|
||||
QModelIndex idx = index(id);
|
||||
Slide *item = m_items[idx.row()];
|
||||
|
||||
|
@ -546,13 +546,13 @@ bool SlideModel::deactivate(int id) {
|
|||
return true;
|
||||
}
|
||||
|
||||
void SlideModel::clearAll() {
|
||||
void SlideModelCpp::clearAll() {
|
||||
for (int i = m_items.size(); i >= 0; i--) {
|
||||
removeItem(i);
|
||||
}
|
||||
}
|
||||
|
||||
int SlideModel::findSlideIdFromServItm(int index) {
|
||||
int SlideModelCpp::findSlideIdFromServItm(int index) {
|
||||
for (int i = 0; i < m_items.size(); i++) {
|
||||
Slide *itm = m_items[i];
|
||||
if (itm->serviceItemId() == index) {
|
||||
|
@ -562,7 +562,7 @@ int SlideModel::findSlideIdFromServItm(int index) {
|
|||
return 0;
|
||||
}
|
||||
|
||||
void SlideModel::addItemFromService(const int &index, const ServiceItem &item) {
|
||||
void SlideModelCpp::addItemFromService(const int &index, const ServiceItem &item) {
|
||||
qDebug() << "***INSERTING SLIDE FROM SERVICEITEM***";
|
||||
if (item.type() == "song") {
|
||||
for (int i = 0; i < item.text().size(); i++) {
|
||||
|
@ -597,7 +597,7 @@ void SlideModel::addItemFromService(const int &index, const ServiceItem &item) {
|
|||
|
||||
}
|
||||
|
||||
void SlideModel::insertItemFromService(const int &index, const ServiceItem &item) {
|
||||
void SlideModelCpp::insertItemFromService(const int &index, const ServiceItem &item) {
|
||||
qDebug() << "***INSERTING SLIDE FROM SERVICEITEM***";
|
||||
int slideId = findSlideIdFromServItm(index);
|
||||
// move all slides to the next serviceItem
|
||||
|
@ -640,7 +640,7 @@ void SlideModel::insertItemFromService(const int &index, const ServiceItem &item
|
|||
|
||||
}
|
||||
|
||||
void SlideModel::moveRowFromService(const int &fromIndex,
|
||||
void SlideModelCpp::moveRowFromService(const int &fromIndex,
|
||||
const int &toIndex,
|
||||
const ServiceItem &item) {
|
||||
const bool isMoveDown = toIndex > fromIndex;
|
||||
|
@ -700,7 +700,7 @@ void SlideModel::moveRowFromService(const int &fromIndex,
|
|||
}
|
||||
}
|
||||
|
||||
QString SlideModel::thumbnailVideoRust(QString video, int serviceItemId, int index, SlideyMod *slideModel) {
|
||||
QString SlideModelCpp::thumbnailVideoRust(QString video, int serviceItemId, int index, SlideModel *slideModel) {
|
||||
|
||||
QDir dir = writeDir.absolutePath() + "/librepresenter/thumbnails";
|
||||
QDir absDir = writeDir.absolutePath() + "/librepresenter";
|
||||
|
@ -745,7 +745,7 @@ QString SlideModel::thumbnailVideoRust(QString video, int serviceItemId, int ind
|
|||
return thumbnailInfo.filePath();
|
||||
}
|
||||
|
||||
QString SlideModel::thumbnailVideo(QString video, int serviceItemId, int index) {
|
||||
QString SlideModelCpp::thumbnailVideo(QString video, int serviceItemId, int index) {
|
||||
|
||||
QDir dir = writeDir.absolutePath() + "/librepresenter/thumbnails";
|
||||
QDir absDir = writeDir.absolutePath() + "/librepresenter";
|
||||
|
@ -803,7 +803,7 @@ QString SlideModel::thumbnailVideo(QString video, int serviceItemId, int index)
|
|||
return thumbnailInfo.filePath();
|
||||
}
|
||||
|
||||
QImage SlideModel::frameToImage(const QString &video, int width)
|
||||
QImage SlideModelCpp::frameToImage(const QString &video, int width)
|
||||
{
|
||||
QImage image;
|
||||
FrameDecoder frameDecoder(video, nullptr);
|
||||
|
|
|
@ -10,11 +10,11 @@
|
|||
#include <qsize.h>
|
||||
#include "cxx-qt-gen/slide_model.cxxqt.h"
|
||||
|
||||
class SlideModel : public QAbstractListModel {
|
||||
class SlideModelCpp : public QAbstractListModel {
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
explicit SlideModel(QObject *parent = nullptr);
|
||||
explicit SlideModelCpp(QObject *parent = nullptr);
|
||||
|
||||
enum Roles {
|
||||
TypeRole = Qt::UserRole,
|
||||
|
@ -82,11 +82,11 @@ public:
|
|||
Q_INVOKABLE bool moveDown(int index);
|
||||
Q_INVOKABLE bool moveUp(int index);
|
||||
Q_INVOKABLE QVariantMap getItem(int index) const;
|
||||
Q_INVOKABLE QVariantMap getItemRust(int index, SlideyMod *slidemodel) const;
|
||||
Q_INVOKABLE QVariantMap getItemRust(int index, SlideModel *slidemodel) const;
|
||||
Q_INVOKABLE QVariantList getItems();
|
||||
Q_INVOKABLE int findSlideIdFromServItm(int index);
|
||||
Q_INVOKABLE QString thumbnailVideo(QString video, int serviceItemId, int index);
|
||||
Q_INVOKABLE QString thumbnailVideoRust(QString video, int serviceItemId, int index, SlideyMod *slideModel);
|
||||
Q_INVOKABLE QString thumbnailVideoRust(QString video, int serviceItemId, int index, SlideModel *slideModel);
|
||||
QImage frameToImage(const QString &video, int width);
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue