add looping for slides
This add looping primarily for videos but I've added in the groundwork for looping through any kind of slide. This obviously will be implemented differently for each type of slide, but this way the groundwork is done already.
This commit is contained in:
parent
caded1027c
commit
caa2e31d99
15 changed files with 130 additions and 49 deletions
|
@ -52,9 +52,9 @@ ServiceItem::ServiceItem(const QString &name, const QString &type, const QString
|
|||
ServiceItem::ServiceItem(const QString &name, const QString &type, const QString &background,
|
||||
const QString &backgroundType, const QStringList &text,
|
||||
const QString &audio, const QString &font, const int &fontSize,
|
||||
const int &slideNumber, QObject *parent)
|
||||
const int &slideNumber, const bool &loop, QObject *parent)
|
||||
: QObject(parent),m_name(name),m_type(type),m_background(background),
|
||||
m_backgroundType(backgroundType),m_text(text),m_audio(audio),m_font(font),m_fontSize(fontSize),m_slideNumber(slideNumber)
|
||||
m_backgroundType(backgroundType),m_text(text),m_audio(audio),m_font(font),m_fontSize(fontSize),m_slideNumber(slideNumber),m_loop(loop)
|
||||
{
|
||||
|
||||
}
|
||||
|
@ -106,6 +106,10 @@ bool ServiceItem::selected() const {
|
|||
return m_selected;
|
||||
}
|
||||
|
||||
bool ServiceItem::loop() const {
|
||||
return m_loop;
|
||||
}
|
||||
|
||||
void ServiceItem::setName(QString name)
|
||||
{
|
||||
if (m_name == name)
|
||||
|
@ -207,3 +211,12 @@ void ServiceItem::setSelected(bool selected)
|
|||
m_selected = selected;
|
||||
emit selectedChanged(m_selected);
|
||||
}
|
||||
|
||||
void ServiceItem::setLoop(bool loop)
|
||||
{
|
||||
if (m_loop == loop)
|
||||
return;
|
||||
|
||||
m_loop = loop;
|
||||
emit loopChanged(m_loop);
|
||||
}
|
||||
|
|
|
@ -18,6 +18,7 @@ class ServiceItem : public QObject
|
|||
Q_PROPERTY(int fontSize READ fontSize WRITE setFontSize NOTIFY fontSizeChanged)
|
||||
Q_PROPERTY(bool active READ active WRITE setActive NOTIFY activeChanged)
|
||||
Q_PROPERTY(bool selected READ selected WRITE setSelected NOTIFY selectedChanged)
|
||||
Q_PROPERTY(bool loop READ loop WRITE setLoop NOTIFY loopChanged)
|
||||
Q_PROPERTY(int slideNumber READ slideNumber WRITE setSlideNumber NOTIFY slideNumberChanged)
|
||||
// Q_PROPERTY(Thumbnail thumbnail READ thumbnail WRITE setThumbnail NOTIFY thumbnailChanged)
|
||||
|
||||
|
@ -38,7 +39,7 @@ public:
|
|||
ServiceItem(const QString &name, const QString &type, const QString &background,
|
||||
const QString &backgroundType, const QStringList &text, const QString &audio,
|
||||
const QString &font, const int &fontSize, const int &slideNumber,
|
||||
QObject * parent = nullptr);
|
||||
const bool &loop, QObject * parent = nullptr);
|
||||
|
||||
QString name() const;
|
||||
QString type() const;
|
||||
|
@ -50,6 +51,7 @@ public:
|
|||
int fontSize() const;
|
||||
bool active() const;
|
||||
bool selected() const;
|
||||
bool loop() const;
|
||||
int slideNumber() const;
|
||||
// Thumbnail thumbnail() const;
|
||||
|
||||
|
@ -64,6 +66,7 @@ public:
|
|||
void setSlideNumber(int slideNumber);
|
||||
void setActive(bool active);
|
||||
void setSelected(bool selected);
|
||||
void setLoop(bool loop);
|
||||
|
||||
signals:
|
||||
void nameChanged(QString name);
|
||||
|
@ -77,6 +80,7 @@ signals:
|
|||
void slideNumberChanged(int slideNumber);
|
||||
void activeChanged(bool active);
|
||||
void selectedChanged(bool selected);
|
||||
void loopChanged(bool loop);
|
||||
|
||||
private:
|
||||
QString m_name;
|
||||
|
@ -90,6 +94,7 @@ private:
|
|||
int m_slideNumber;
|
||||
bool m_active;
|
||||
bool m_selected;
|
||||
bool m_loop;
|
||||
};
|
||||
|
||||
#endif // SERVICEITEM_H
|
||||
|
|
|
@ -68,6 +68,8 @@ QVariant ServiceItemModel::data(const QModelIndex &index, int role) const {
|
|||
return item->active();
|
||||
case SelectedRole:
|
||||
return item->selected();
|
||||
case LoopRole:
|
||||
return item->loop();
|
||||
default:
|
||||
return QVariant();
|
||||
}
|
||||
|
@ -84,7 +86,8 @@ QHash<int, QByteArray> ServiceItemModel::roleNames() const {
|
|||
{FontSizeRole, "fontSize"},
|
||||
{SlideNumberRole, "slideNumber"},
|
||||
{ActiveRole, "active"},
|
||||
{SelectedRole, "selected"}};
|
||||
{SelectedRole, "selected"},
|
||||
{LoopRole, "loop"}};
|
||||
|
||||
return mapping;
|
||||
}
|
||||
|
@ -162,6 +165,12 @@ bool ServiceItemModel::setData(const QModelIndex &index, const QVariant &value,
|
|||
somethingChanged = true;
|
||||
}
|
||||
break;
|
||||
case LoopRole:
|
||||
if (item->loop() != value.toBool()) {
|
||||
item->setLoop(value.toBool());
|
||||
somethingChanged = true;
|
||||
}
|
||||
break;
|
||||
if (somethingChanged) {
|
||||
emit dataChanged(index, index, QVector<int>() << role);
|
||||
return true;
|
||||
|
@ -267,12 +276,12 @@ void ServiceItemModel::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,
|
||||
const int &slideNumber) {
|
||||
const int &slideNumber, const bool &loop) {
|
||||
qDebug() << "*************************";
|
||||
qDebug() << "Plain adding item: " << name;
|
||||
qDebug() << "*************************";
|
||||
ServiceItem *item = new ServiceItem(name, type, background, backgroundType,
|
||||
text, audio, font, fontSize, slideNumber);
|
||||
text, audio, font, fontSize, slideNumber, loop);
|
||||
item->setSelected(false);
|
||||
item->setActive(false);
|
||||
addItem(item);
|
||||
|
@ -339,12 +348,13 @@ void ServiceItemModel::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,
|
||||
const int &fontSize, const int &slideNumber) {
|
||||
const int &fontSize, const int &slideNumber,
|
||||
const bool &loop) {
|
||||
qDebug() << "*************************";
|
||||
qDebug() << "Inserting serviceItem: " << name << " and index is " << index;
|
||||
qDebug() << "*************************";
|
||||
ServiceItem *item = new ServiceItem(name, type, background, backgroundType,
|
||||
text, audio, font, fontSize, slideNumber);
|
||||
text, audio, font, fontSize, slideNumber, loop);
|
||||
item->setSelected(false);
|
||||
item->setActive(false);
|
||||
insertItem(index, item);
|
||||
|
@ -490,6 +500,7 @@ QVariantList ServiceItemModel::getItems() {
|
|||
itm["fontSize"] = item->fontSize();
|
||||
itm["slideNumber"] = item->slideNumber();
|
||||
itm["selected"] = item->selected();
|
||||
itm["loop"] = item->loop();
|
||||
itm["active"] = item->active();
|
||||
data.append(itm);
|
||||
}
|
||||
|
@ -614,6 +625,7 @@ bool ServiceItemModel::save(QUrl file) {
|
|||
item.insert("slideNumber", m_items[i]->slideNumber());
|
||||
item.insert("text", m_items[i]->text());
|
||||
item.insert("type", m_items[i]->type());
|
||||
item.insert("loop", m_items[i]->loop());
|
||||
|
||||
qDebug() << "AUDIO IS: " << item.value("audio").toString();
|
||||
QFileInfo audioFile = item.value("audio").toString();
|
||||
|
@ -807,11 +819,11 @@ bool ServiceItemModel::load(QUrl file) {
|
|||
}
|
||||
|
||||
addItem(item.value("name").toString(), item.value("type").toString(),
|
||||
realBackground,
|
||||
item.value("backgroundType").toString(),
|
||||
item.value("text").toStringList(), realAudio,
|
||||
item.value("font").toString(), item.value("fontSize").toInt(),
|
||||
item.value("slideNumber").toInt());
|
||||
realBackground,
|
||||
item.value("backgroundType").toString(),
|
||||
item.value("text").toStringList(), realAudio,
|
||||
item.value("font").toString(), item.value("fontSize").toInt(),
|
||||
item.value("slideNumber").toInt(), item.value("loop").toBool());
|
||||
}
|
||||
|
||||
return true;
|
||||
|
|
|
@ -26,7 +26,8 @@ public:
|
|||
FontSizeRole,
|
||||
SlideNumberRole,
|
||||
ActiveRole,
|
||||
SelectedRole
|
||||
SelectedRole,
|
||||
LoopRole
|
||||
};
|
||||
|
||||
// Basic functionality:
|
||||
|
@ -72,7 +73,7 @@ public:
|
|||
const QString &backgroundType,
|
||||
const QStringList &text, const QString &audio,
|
||||
const QString &font, const int &fontSize,
|
||||
const int &slideNumber);
|
||||
const int &slideNumber, const bool &loop);
|
||||
// Q_INVOKABLE void insertItem(const int &index, const QString &name,
|
||||
// const QString &type);
|
||||
// Q_INVOKABLE void insertItem(const int &index, const QString &name,
|
||||
|
@ -93,7 +94,8 @@ public:
|
|||
const QString &type, const QString &background,
|
||||
const QString &backgroundType, const QStringList &text,
|
||||
const QString &audio, const QString &font,
|
||||
const int &fontSize, const int &slideNumber);
|
||||
const int &fontSize, const int &slideNumber,
|
||||
const bool &loop);
|
||||
Q_INVOKABLE void removeItem(int index);
|
||||
Q_INVOKABLE void removeItems();
|
||||
Q_INVOKABLE bool moveRows(int sourceIndex, int destIndex, int count);
|
||||
|
|
|
@ -13,12 +13,12 @@ Slide::Slide(const QString &text, const QString &audio, const QString &imageBack
|
|||
const QString &videoBackground, const QString &horizontalTextAlignment,
|
||||
const QString &verticalTextAlignment, const QString &font,
|
||||
const int &fontSize, const int &imageCount,
|
||||
const QString &type, const int &slideIndex, QObject *parent)
|
||||
const QString &type, const int &slideIndex, const bool &loop, QObject *parent)
|
||||
: QObject(parent),m_text(text),m_audio(audio),m_imageBackground(imageBackground),
|
||||
m_videoBackground(videoBackground),m_verticalTextAlignment(verticalTextAlignment),
|
||||
m_horizontalTextAlignment(horizontalTextAlignment),m_font(font),
|
||||
m_fontSize(fontSize),m_imageCount(imageCount),m_type(type),
|
||||
m_slideIndex(slideIndex),m_active(false),m_selected(false)
|
||||
m_slideIndex(slideIndex),m_active(false),m_selected(false),m_loop(loop)
|
||||
{
|
||||
qDebug() << "Initializing slide with defaults";
|
||||
}
|
||||
|
@ -92,6 +92,10 @@ bool Slide::selected() const {
|
|||
return m_selected;
|
||||
}
|
||||
|
||||
bool Slide::loop() const {
|
||||
return m_loop;
|
||||
}
|
||||
|
||||
void Slide::setText(QString text)
|
||||
{
|
||||
if (m_text == text)
|
||||
|
@ -238,3 +242,12 @@ void Slide::setSelected(bool selected)
|
|||
m_selected = selected;
|
||||
emit selectedChanged(m_selected);
|
||||
}
|
||||
|
||||
void Slide::setLoop(bool loop)
|
||||
{
|
||||
if (m_loop == loop)
|
||||
return;
|
||||
|
||||
m_loop = loop;
|
||||
emit loopChanged(m_loop);
|
||||
}
|
||||
|
|
|
@ -28,6 +28,7 @@ class Slide : public QObject
|
|||
Q_PROPERTY(int slideIndex READ slideIndex WRITE setSlideIndex NOTIFY slideIndexChanged)
|
||||
Q_PROPERTY(bool active READ active WRITE setActive NOTIFY activeChanged)
|
||||
Q_PROPERTY(bool selected READ selected WRITE setSelected NOTIFY selectedChanged)
|
||||
Q_PROPERTY(bool loop READ loop WRITE setLoop NOTIFY loopChanged)
|
||||
Q_PROPERTY(QString vidThumbnail READ vidThumbnail WRITE setVidThumbnail
|
||||
NOTIFY vidThumbnailChanged)
|
||||
// QML_ELEMENT
|
||||
|
@ -38,7 +39,7 @@ public:
|
|||
const QString &imageBackground, const QString &videoBackground,
|
||||
const QString &horizontalTextAlignment, const QString &verticalTextAlignment,
|
||||
const QString &font, const int &fontSize, const int &imageCount,
|
||||
const QString &type, const int &slideIndex,
|
||||
const QString &type, const int &slideIndex, const bool &loop,
|
||||
QObject * parent = nullptr);
|
||||
|
||||
QString text() const;
|
||||
|
@ -55,6 +56,7 @@ public:
|
|||
int serviceItemId() const;
|
||||
bool active() const;
|
||||
bool selected() const;
|
||||
bool loop() const;
|
||||
QString vidThumbnail() const;
|
||||
|
||||
Q_INVOKABLE void setText(QString text);
|
||||
|
@ -71,6 +73,7 @@ public:
|
|||
Q_INVOKABLE void setSlideIndex(int slideIndex);
|
||||
Q_INVOKABLE void setActive(bool active);
|
||||
Q_INVOKABLE void setSelected(bool selected);
|
||||
Q_INVOKABLE void setLoop(bool loop);
|
||||
Q_INVOKABLE void setVidThumbnail(QString vidThumbnail);
|
||||
|
||||
signals:
|
||||
|
@ -88,6 +91,7 @@ signals:
|
|||
Q_INVOKABLE void slideIndexChanged(int slideIndex);
|
||||
Q_INVOKABLE void activeChanged(bool active);
|
||||
Q_INVOKABLE void selectedChanged(bool selected);
|
||||
Q_INVOKABLE void loopChanged(bool loop);
|
||||
Q_INVOKABLE void vidThumbnailChanged(QString vidThumbnail);
|
||||
|
||||
private:
|
||||
|
@ -106,6 +110,7 @@ private:
|
|||
int m_slideIndex;
|
||||
bool m_active;
|
||||
bool m_selected;
|
||||
bool m_loop;
|
||||
QString m_vidThumbnail;
|
||||
};
|
||||
|
||||
|
|
|
@ -85,6 +85,8 @@ QVariant SlideModel::data(const QModelIndex &index, int role) const {
|
|||
return item->active();
|
||||
case SelectedRole:
|
||||
return item->selected();
|
||||
case LoopRole:
|
||||
return item->loop();
|
||||
case VidThumbnailRole:
|
||||
return item->vidThumbnail();
|
||||
default:
|
||||
|
@ -107,6 +109,7 @@ QHash<int, QByteArray> SlideModel::roleNames() const {
|
|||
{SlideIndexRole, "slideIndex"},
|
||||
{ActiveRole, "active"},
|
||||
{SelectedRole, "selected"},
|
||||
{LoopRole, "loop"},
|
||||
{VidThumbnailRole, "vidThumbnail"}
|
||||
};
|
||||
|
||||
|
@ -198,6 +201,12 @@ bool SlideModel::setData(const QModelIndex &index, const QVariant &value,
|
|||
somethingChanged = true;
|
||||
}
|
||||
break;
|
||||
case LoopRole:
|
||||
if (item->loop() != value.toBool()) {
|
||||
item->setLoop(value.toBool());
|
||||
somethingChanged = true;
|
||||
}
|
||||
break;
|
||||
case VidThumbnailRole:
|
||||
if (item->vidThumbnail() != value.toString()) {
|
||||
item->setVidThumbnail(value.toString());
|
||||
|
@ -262,11 +271,11 @@ void SlideModel::addItem(const QString &text, const QString &type,
|
|||
const QString &horizontalTextAlignment,
|
||||
const QString &verticalTextAlignment,
|
||||
const int &serviceItemId, const int &slideIndex,
|
||||
const int &imageCount) {
|
||||
const int &imageCount, const bool &loop) {
|
||||
Slide *item = new Slide(text, audio, imageBackground, videoBackground,
|
||||
horizontalTextAlignment,
|
||||
verticalTextAlignment,
|
||||
font, fontSize, imageCount, type, slideIndex );
|
||||
font, fontSize, imageCount, type, slideIndex, loop);
|
||||
item->setSelected(false);
|
||||
item->setActive(false);
|
||||
item->setServiceItemId(serviceItemId);
|
||||
|
@ -283,10 +292,10 @@ void SlideModel::insertItem(const int &index,
|
|||
const int &fontSize, const QString &horizontalTextAlignment,
|
||||
const QString &verticalTextAlignment,
|
||||
const int &serviceItemId, const int &slideIndex,
|
||||
const int &imageCount) {
|
||||
const int &imageCount, const bool &loop) {
|
||||
Slide *item = new Slide(text, audio, imageBackground, videoBackground,
|
||||
horizontalTextAlignment, verticalTextAlignment, font, fontSize,
|
||||
imageCount, type, slideIndex);
|
||||
imageCount, type, slideIndex, loop);
|
||||
item->setSelected(false);
|
||||
item->setActive(false);
|
||||
item->setServiceItemId(serviceItemId);
|
||||
|
@ -461,6 +470,7 @@ QVariantList SlideModel::getItems() {
|
|||
itm["serviceItemId"] = item->serviceItemId();
|
||||
itm["selected"] = item->selected();
|
||||
itm["active"] = item->active();
|
||||
itm["loop"] = item->loop();
|
||||
data.append(itm);
|
||||
}
|
||||
qDebug() << "$$$$$$$$$$$$$$$$$$$$$$$$$$$";
|
||||
|
@ -552,11 +562,11 @@ void SlideModel::addItemFromService(const int &index, const ServiceItem &item) {
|
|||
if (item.backgroundType() == "image") {
|
||||
addItem(item.text()[i], item.type(), item.background(), "",
|
||||
item.audio(), item.font(), item.fontSize(), "center", "center",
|
||||
index, i, item.text().size());
|
||||
index, i, item.text().size(), item.loop());
|
||||
} else {
|
||||
addItem(item.text()[i], item.type(), "", item.background(),
|
||||
item.audio(), item.font(), item.fontSize(), "center", "center",
|
||||
index, i, item.text().size());
|
||||
index, i, item.text().size(), item.loop());
|
||||
}
|
||||
}
|
||||
} else if (item.type() == "presentation") {
|
||||
|
@ -564,18 +574,18 @@ void SlideModel::addItemFromService(const int &index, const ServiceItem &item) {
|
|||
addItem("", item.type(), item.background(), "",
|
||||
item.audio(), item.font(), item.fontSize(),
|
||||
"center", "center",
|
||||
index, i, item.slideNumber());
|
||||
index, i, item.slideNumber(), item.loop());
|
||||
}
|
||||
} else if (item.type() == "video") {
|
||||
addItem("", item.type(), "", item.background(),
|
||||
item.audio(), item.font(), item.fontSize(),
|
||||
"center", "center",
|
||||
index, 0, 1);
|
||||
index, 0, 1, item.loop());
|
||||
} else {
|
||||
addItem("", item.type(), item.background(), "",
|
||||
item.audio(), item.font(), item.fontSize(),
|
||||
"center", "center",
|
||||
index, 0, 1);
|
||||
index, 0, 1, item.loop());
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -595,11 +605,11 @@ void SlideModel::insertItemFromService(const int &index, const ServiceItem &item
|
|||
if (item.backgroundType() == "image") {
|
||||
insertItem(slideId + i, item.type(), item.background(), "", item.text()[i],
|
||||
item.audio(), item.font(), item.fontSize(), "center", "center",
|
||||
index, i, item.text().size());
|
||||
index, i, item.text().size(), item.loop());
|
||||
} else {
|
||||
insertItem(slideId + i, item.type(), "", item.background(), item.text()[i],
|
||||
item.audio(), item.font(), item.fontSize(), "center", "center",
|
||||
index, i, item.text().size());
|
||||
index, i, item.text().size(), item.loop());
|
||||
}
|
||||
}
|
||||
} else if (item.type() == "presentation") {
|
||||
|
@ -607,18 +617,18 @@ void SlideModel::insertItemFromService(const int &index, const ServiceItem &item
|
|||
insertItem(slideId + i, item.type(), item.background(), "",
|
||||
"", item.audio(), item.font(), item.fontSize(),
|
||||
"center", "center",
|
||||
index, i, item.slideNumber());
|
||||
index, i, item.slideNumber(), item.loop());
|
||||
}
|
||||
} else if (item.type() == "video") {
|
||||
insertItem(slideId, item.type(), "", item.background(), "",
|
||||
item.audio(), item.font(), item.fontSize(),
|
||||
"center", "center",
|
||||
index, 0, 1);
|
||||
index, 0, 1, item.loop());
|
||||
} else {
|
||||
insertItem(slideId, item.type(), item.background(), "", "",
|
||||
item.audio(), item.font(), item.fontSize(),
|
||||
"center", "center",
|
||||
index, 0, 1);
|
||||
index, 0, 1, item.loop());
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -30,6 +30,7 @@ public:
|
|||
ImageCountRole,
|
||||
ActiveRole,
|
||||
SelectedRole,
|
||||
LoopRole,
|
||||
VidThumbnailRole
|
||||
};
|
||||
|
||||
|
@ -61,7 +62,8 @@ public:
|
|||
const QString &verticalTextAlignment,
|
||||
const int &serviceItemId,
|
||||
const int &slideIndex,
|
||||
const int &imageCount);
|
||||
const int &imageCount,
|
||||
const bool &loop);
|
||||
Q_INVOKABLE void insertItem(const int &index, const QString &text,
|
||||
const QString &type, const QString &imageBackground,
|
||||
const QString &videoBackground,
|
||||
|
@ -71,7 +73,8 @@ public:
|
|||
const QString &verticalTextAlignment,
|
||||
const int &serviceItemId,
|
||||
const int &slideIndex,
|
||||
const int &imageCount);
|
||||
const int &imageCount,
|
||||
const bool &loop);
|
||||
Q_INVOKABLE void removeItem(int index);
|
||||
Q_INVOKABLE void removeItems();
|
||||
Q_INVOKABLE bool moveRows(int sourceIndex, int destIndex, int count);
|
||||
|
|
|
@ -84,6 +84,10 @@ void SlideObject::changeSlide(QVariantMap item, int index)
|
|||
if (item.value("fontSize").toInt() != fontSize())
|
||||
setFontSize(item.value("fontSize").toInt());
|
||||
|
||||
if (loop() != item.value("loop").toBool()) {
|
||||
setLoop(item.value("loop").toBool());
|
||||
emit loopChanged(loop());
|
||||
}
|
||||
setImageCount(item.value("imageCount").toInt());
|
||||
setSlideIndex(item.value("slideIndex").toInt());
|
||||
qDebug() << "THIS IS THE INDEX OF THE SLIDE!";
|
||||
|
@ -108,6 +112,10 @@ bool SlideObject::next(QVariantMap nextItem, SlideModel *slideModel)
|
|||
setFontSize(nextItem.value("fontSize").toInt());
|
||||
setImageCount(nextItem.value("imageCount").toInt());
|
||||
setSlideIndex(nextItem.value("slideIndex").toInt());
|
||||
if (loop() != nextItem.value("loop").toBool()) {
|
||||
setLoop(nextItem.value("loop").toBool());
|
||||
emit loopChanged(loop());
|
||||
}
|
||||
// m_slideSize = serviceItem.value("slideNumber").toInt();
|
||||
|
||||
|
||||
|
@ -129,6 +137,10 @@ bool SlideObject::previous(QVariantMap prevItem, SlideModel *slideModel)
|
|||
setFontSize(prevItem.value("fontSize").toInt());
|
||||
setImageCount(prevItem.value("imageCount").toInt());
|
||||
setSlideIndex(prevItem.value("slideIndex").toInt());
|
||||
if (loop() != prevItem.value("loop").toBool()) {
|
||||
setLoop(prevItem.value("loop").toBool());
|
||||
emit loopChanged(loop());
|
||||
}
|
||||
// m_slideSize = serviceItem.value("slideNumber").toInt();
|
||||
|
||||
// emit slideSizeChanged(m_slideSize);
|
||||
|
@ -173,9 +185,9 @@ void SlideObject::play()
|
|||
emit isPlayingChanged(m_isPlaying);
|
||||
}
|
||||
|
||||
void SlideObject::setLoop()
|
||||
void SlideObject::setLoop(bool loop)
|
||||
{
|
||||
m_loop = true;
|
||||
m_loop = loop;
|
||||
emit loopChanged(m_loop);
|
||||
}
|
||||
|
||||
|
|
|
@ -39,7 +39,7 @@ public:
|
|||
Q_INVOKABLE bool next(QVariantMap nextItem, SlideModel *slideModel);
|
||||
Q_INVOKABLE bool previous(QVariantMap prevItem, SlideModel *slideModel);
|
||||
Q_INVOKABLE bool changeSlideIndex(int index);
|
||||
Q_INVOKABLE void setLoop();
|
||||
Q_INVOKABLE void setLoop(bool loop);
|
||||
|
||||
signals:
|
||||
Q_INVOKABLE void isPlayingChanged(bool isPlaying);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue