some connections to make active follow slideObject
This commit is contained in:
parent
3286935b8e
commit
8fad5cadb4
4 changed files with 10 additions and 5 deletions
|
@ -444,7 +444,7 @@ bool SlideModel::activate(int id) {
|
|||
|
||||
item->setActive(true);
|
||||
qDebug() << "################";
|
||||
qDebug() << "activated" << item->slideIndex();
|
||||
qDebug() << "slide activated" << item->slideIndex();
|
||||
qDebug() << "################";
|
||||
emit dataChanged(idx, idx, QVector<int>() << ActiveRole);
|
||||
return true;
|
||||
|
|
|
@ -75,15 +75,15 @@ public:
|
|||
Q_INVOKABLE bool moveRows(int sourceIndex, int destIndex, int count);
|
||||
Q_INVOKABLE bool moveDown(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 QVariantList getItems();
|
||||
Q_INVOKABLE void clearAll();
|
||||
Q_INVOKABLE int findSlideIdFromServItm(int index);
|
||||
|
||||
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 insertItemFromService(const int &index, const ServiceItem &item);
|
||||
|
||||
|
|
|
@ -30,7 +30,7 @@ public:
|
|||
int slideIndex() 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 pause();
|
||||
Q_INVOKABLE void playPause();
|
||||
|
@ -42,6 +42,7 @@ signals:
|
|||
Q_INVOKABLE void isPlayingChanged(bool isPlaying);
|
||||
Q_INVOKABLE void slideIndexChanged(int slideIndex);
|
||||
Q_INVOKABLE void slideSizeChanged(int slideSize);
|
||||
Q_INVOKABLE void slideChanged(int slide);
|
||||
|
||||
private:
|
||||
bool m_isPlaying;
|
||||
|
|
|
@ -147,6 +147,10 @@ int main(int argc, char *argv[])
|
|||
SIGNAL(itemAdded(const int&, const ServiceItem&)),
|
||||
slideModel.get(),
|
||||
SLOT(addItemFromService(const int&, const ServiceItem&)));
|
||||
QObject::connect(slideobject.get(),
|
||||
SIGNAL(slideChanged(int)),
|
||||
slideModel.get(),
|
||||
SLOT(activate(int)));
|
||||
|
||||
bool loading = serviceItemModel.get()->loadLastSaved();
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue