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.
32 lines
460 B
32 lines
460 B
7 years ago
|
#include "%{VmHdrName}"
|
||
|
@if '%{UseSettings}'
|
||
|
|
||
|
#include <QtMvvmCore/SettingsViewModel>
|
||
|
@endif
|
||
|
|
||
|
%{VmCn}::%{VmCn}(QObject *parent) :
|
||
|
ViewModel(parent),
|
||
|
_text(QStringLiteral("hello world"))
|
||
|
{}
|
||
|
|
||
|
QString %{VmCn}::text() const
|
||
|
{
|
||
|
return _text;
|
||
|
}
|
||
|
|
||
|
@if '%{UseSettings}'
|
||
|
void %{VmCn}::showSettings()
|
||
|
{
|
||
|
show<QtMvvm::SettingsViewModel>();
|
||
|
}
|
||
|
|
||
|
@endif
|
||
|
void %{VmCn}::setText(const QString &text)
|
||
|
{
|
||
|
if (_text == text)
|
||
|
return;
|
||
|
|
||
|
_text = text;
|
||
|
emit textChanged(_text);
|
||
|
}
|