You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
46 lines
1.0 KiB
46 lines
1.0 KiB
#include "applicationbridge.h"
|
|
#include "dataobject.h"
|
|
|
|
ApplicationBridge::ApplicationBridge(QObject *parent)
|
|
: QObject{parent}
|
|
{
|
|
QTimer *timer= new QTimer(this);
|
|
connect(timer, SIGNAL(timeout()), this, SLOT(timerSlot()));
|
|
timer->start(1000);
|
|
|
|
setList({
|
|
new DataObject("Item 1", "red"),
|
|
new DataObject("Item 2", "green"),
|
|
new DataObject("Item 3", "blue"),
|
|
new DataObject("Item 4", "yellow")
|
|
});
|
|
}
|
|
|
|
const QString &ApplicationBridge::inputForCpp() const
|
|
{
|
|
return m_inputForCpp;
|
|
}
|
|
|
|
void ApplicationBridge::setInputForCpp(const QString &newInputForCpp)
|
|
{
|
|
if (m_inputForCpp == newInputForCpp)
|
|
return;
|
|
m_inputForCpp = newInputForCpp;
|
|
emit inputForCppChanged();
|
|
|
|
qWarning()<<"Set in cpp"<<" "<<newInputForCpp;
|
|
}
|
|
|
|
const QList<QObject *> &ApplicationBridge::list() const
|
|
{
|
|
return m_list;
|
|
}
|
|
|
|
void ApplicationBridge::setList(const QList<QObject *> &newList)
|
|
{
|
|
if (m_list == newList)
|
|
return;
|
|
m_list = newList;
|
|
emit listChanged();
|
|
}
|