forked from Sepanta/console-emulator
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.
36 lines
652 B
36 lines
652 B
3 years ago
|
#include "viewModel/MainViewModel.h"
|
||
|
|
||
|
#include <QtMvvmCore/SettingsViewModel>
|
||
|
|
||
|
#include "model/Console.h"
|
||
|
#include "UdpDataSender.h"
|
||
|
|
||
|
MainViewModel::MainViewModel(QObject *parent) :
|
||
|
ViewModel(parent),
|
||
|
_text(QStringLiteral("hello world"))
|
||
|
{
|
||
|
Console c;
|
||
|
auto u = new UdpDataSender;
|
||
|
c.injectDataSender(u);
|
||
|
c.test();
|
||
|
}
|
||
|
|
||
|
QString MainViewModel::text() const
|
||
|
{
|
||
|
return _text;
|
||
|
}
|
||
|
|
||
|
void MainViewModel::showSettings()
|
||
|
{
|
||
|
show<QtMvvm::SettingsViewModel>();
|
||
|
}
|
||
|
|
||
|
void MainViewModel::setText(const QString &text)
|
||
|
{
|
||
|
if (_text == text)
|
||
|
return;
|
||
|
|
||
|
_text = text;
|
||
|
emit textChanged(_text);
|
||
|
}
|