some connections to make active follow slideObject

This commit is contained in:
Chris Cochrun 2023-01-22 07:31:07 -06:00
parent 3286935b8e
commit 8fad5cadb4
4 changed files with 10 additions and 5 deletions

View file

@ -444,7 +444,7 @@ bool SlideModel::activate(int id) {
item->setActive(true); item->setActive(true);
qDebug() << "################"; qDebug() << "################";
qDebug() << "activated" << item->slideIndex(); qDebug() << "slide activated" << item->slideIndex();
qDebug() << "################"; qDebug() << "################";
emit dataChanged(idx, idx, QVector<int>() << ActiveRole); emit dataChanged(idx, idx, QVector<int>() << ActiveRole);
return true; return true;

View file

@ -75,15 +75,15 @@ public:
Q_INVOKABLE bool moveRows(int sourceIndex, int destIndex, int count); Q_INVOKABLE bool moveRows(int sourceIndex, int destIndex, int count);
Q_INVOKABLE bool moveDown(int index); Q_INVOKABLE bool moveDown(int index);
Q_INVOKABLE bool moveUp(int index); Q_INVOKABLE bool moveUp(int index);
Q_INVOKABLE bool select(int id);
Q_INVOKABLE bool activate(int id);
Q_INVOKABLE bool deactivate(int id);
Q_INVOKABLE QVariantMap getItem(int index) const; Q_INVOKABLE QVariantMap getItem(int index) const;
Q_INVOKABLE QVariantList getItems(); Q_INVOKABLE QVariantList getItems();
Q_INVOKABLE void clearAll(); Q_INVOKABLE void clearAll();
Q_INVOKABLE int findSlideIdFromServItm(int index); Q_INVOKABLE int findSlideIdFromServItm(int index);
public slots: public slots:
Q_INVOKABLE bool select(int id);
Q_INVOKABLE bool activate(int id);
Q_INVOKABLE bool deactivate(int id);
void addItemFromService(const int &index, const ServiceItem &item); void addItemFromService(const int &index, const ServiceItem &item);
void insertItemFromService(const int &index, const ServiceItem &item); void insertItemFromService(const int &index, const ServiceItem &item);

View file

@ -30,7 +30,7 @@ public:
int slideIndex() const; int slideIndex() const;
int slideSize() const; int slideSize() const;
Q_INVOKABLE void changeSlide(QVariantMap item); Q_INVOKABLE void changeSlide(QVariantMap item, int index);
Q_INVOKABLE void play(); Q_INVOKABLE void play();
Q_INVOKABLE void pause(); Q_INVOKABLE void pause();
Q_INVOKABLE void playPause(); Q_INVOKABLE void playPause();
@ -42,6 +42,7 @@ signals:
Q_INVOKABLE void isPlayingChanged(bool isPlaying); Q_INVOKABLE void isPlayingChanged(bool isPlaying);
Q_INVOKABLE void slideIndexChanged(int slideIndex); Q_INVOKABLE void slideIndexChanged(int slideIndex);
Q_INVOKABLE void slideSizeChanged(int slideSize); Q_INVOKABLE void slideSizeChanged(int slideSize);
Q_INVOKABLE void slideChanged(int slide);
private: private:
bool m_isPlaying; bool m_isPlaying;

View file

@ -147,6 +147,10 @@ int main(int argc, char *argv[])
SIGNAL(itemAdded(const int&, const ServiceItem&)), SIGNAL(itemAdded(const int&, const ServiceItem&)),
slideModel.get(), slideModel.get(),
SLOT(addItemFromService(const int&, const ServiceItem&))); SLOT(addItemFromService(const int&, const ServiceItem&)));
QObject::connect(slideobject.get(),
SIGNAL(slideChanged(int)),
slideModel.get(),
SLOT(activate(int)));
bool loading = serviceItemModel.get()->loadLastSaved(); bool loading = serviceItemModel.get()->loadLastSaved();