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.
|
|
|
#include "MainViewModel.h"
|
|
|
|
#include <QtMvvmCore/SettingsViewModel>
|
|
|
|
|
|
|
|
MainViewModel::MainViewModel(QObject *parent) :
|
|
|
|
ViewModel(parent),
|
|
|
|
_text(QStringLiteral("hello world"))
|
|
|
|
{
|
|
|
|
|
|
|
|
}
|
|
|
|
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);
|
|
|
|
}
|