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.

28 lines
463 B

2 years ago
#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);
}