Migration of QtMvvm from github
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.

29 lines
611 B

#include "%{WindowHdrName}"
#include "ui_%{WindowHdrName}"
#include <QtMvvmCore/Binding>
%{WindowCn}::%{WindowCn}(QtMvvm::ViewModel *viewModel, QWidget *parent) :
QMainWindow(parent),
_viewModel(static_cast<%{VmCn}*>(viewModel)),
_ui(new Ui::%{WindowCn})
{
_ui->setupUi(this);
@if '%{UseSettings}'
connect(_ui->actionSettings, &QAction::triggered,
_viewModel, &%{VmCn}::showSettings);
@endif
QtMvvm::bind(_viewModel, "text",
_ui->lineEdit, "text");
QtMvvm::bind(_viewModel, "text",
_ui->label, "text",
QtMvvm::Binding::OneWayToView);
}
%{WindowCn}::~%{WindowCn}()
{
delete _ui;
}