1#include "ParameterNetUI.h"
2#include "ui_ParameterNetUI.h"
3#include <QLoggingCategory>
6static Q_LOGGING_CATEGORY(log,
"Client.Parameter.Net.UI")
14 connect(ui->leHost, &QLineEdit::editingFinished,
this, [&](){
15 emit sigHostChanged(ui->leHost->text());
19CParameterNetUI::~CParameterNetUI()
27 if(!pParameter)
return -1;
29 m_pNet = qobject_cast<CParameterNet*>(pParameter);
31 ui->leHost->setText(m_pNet->GetHost());
32 ui->spPort->setValue(m_pNet->GetPort());
35 ui->wUser->SetParameter(&m_pNet->
m_User);
44 if(validity && ui->leHost->text().isEmpty()) {
45 QMessageBox::critical(
this, tr(
"Error"),
47 qCritical(log) <<
"The host is empty" << m_pNet->GetPrompt();
48 ui->leHost->setFocus();
60 m_pNet->SetHost(ui->leHost->text());
61 m_pNet->SetPort(ui->spPort->value());
71 auto s = ui->leHost->text().split(
":");
74 ui->spPort->setValue(s[1].toUInt());
75 ui->leHost->setText(s[0]);
int Accept()
Accept parameters.
void on_leHost_editingFinished()
[Accept]
bool CheckValidity(bool validity=false)
[Set Parameter]
int SetParameter(CParameter *pParameter)
[Parameter commone functions]
CParameterUser m_User
[Instance user]
The parameter UI interface.