trying to make services available to slide class
This commit is contained in:
parent
d96b933a7a
commit
dbc6b5e33a
4 changed files with 24 additions and 3 deletions
|
@ -94,6 +94,7 @@ int main(int argc, char *argv[])
|
|||
qDebug() << QIcon::themeName();
|
||||
|
||||
//Need to instantiate our slide
|
||||
ServiceItemModel services();
|
||||
QScopedPointer<Slide> slide(new Slide("", "", "", "", "", "", "", 0));
|
||||
|
||||
// apparently mpv needs this class set
|
||||
|
|
|
@ -144,7 +144,7 @@ Controls.Page {
|
|||
SlideObject.setText("");
|
||||
}
|
||||
else
|
||||
SlideObject.setText(item.text);
|
||||
SlideObject.setText(item.text[0]);
|
||||
presentation.textIndex = 0;
|
||||
presentation.changeSlide();
|
||||
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
#include "slide.h"
|
||||
#include "serviceitemmodel.h"
|
||||
|
||||
#include <QDebug>
|
||||
|
||||
|
@ -132,3 +133,22 @@ void Slide::setFontSize(int fontSize)
|
|||
m_fontSize = fontSize;
|
||||
emit fontSizeChanged(m_fontSize);
|
||||
}
|
||||
|
||||
void Slide::changeSlide(int index)
|
||||
{
|
||||
QVariantMap item = services.getItem(index);
|
||||
if (item.backgroundType == "image") {
|
||||
setImageBackground(item.background);
|
||||
setVideoBackground("");
|
||||
} else {
|
||||
setVideoBackground(item.background);
|
||||
setImageBackground("");
|
||||
}
|
||||
if (item.text.length < 1)
|
||||
setText(item.text[0]);
|
||||
}
|
||||
|
||||
void Slide::nextSlide()
|
||||
{
|
||||
|
||||
}
|
||||
|
|
|
@ -45,8 +45,8 @@ public:
|
|||
Q_INVOKABLE void setFont(QString font);
|
||||
Q_INVOKABLE void setFontSize(int fontSize);
|
||||
|
||||
// Q_INVOKABLE void changeSlide(int index);
|
||||
// Q_INVOKABLE void nextSlide();
|
||||
Q_INVOKABLE void changeSlide(int index);
|
||||
Q_INVOKABLE void nextSlide();
|
||||
|
||||
signals:
|
||||
Q_INVOKABLE void textChanged(QString text);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue