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.
 
 
 
 
 

24 lines
547 B

#include "resultdialog.h"
#include "ui_resultdialog.h"
#include <QtMvvmCore/Binding>
ResultDialog::ResultDialog(QtMvvm::ViewModel *viewModel, QWidget *parent) :
QDialog(parent),
_viewModel(static_cast<ResultViewModel*>(viewModel)),
ui(new Ui::ResultDialog)
{
ui->setupUi(this);
QtMvvm::bind(_viewModel, "result",
ui->lineEdit, "text",
QtMvvm::Binding::TwoWay,
nullptr,
"editingFinished()");
connect(this, &ResultDialog::accepted,
_viewModel, &ResultViewModel::done);
}
ResultDialog::~ResultDialog()
{
delete ui;
}