http模块有问题,需要修改
This commit is contained in:
48
core_form/serversetting/serversetting.cpp
Normal file
48
core_form/serversetting/serversetting.cpp
Normal file
@@ -0,0 +1,48 @@
|
||||
#include "serversetting.h"
|
||||
#include "ui_serversetting.h"
|
||||
|
||||
ServerSetting::ServerSetting(QWidget *parent) :
|
||||
QWidget(parent),
|
||||
ui(new Ui::ServerSetting)
|
||||
{
|
||||
ui->setupUi(this);
|
||||
initForm();
|
||||
initWidget();
|
||||
}
|
||||
|
||||
ServerSetting::~ServerSetting()
|
||||
{
|
||||
delete ui;
|
||||
}
|
||||
|
||||
void ServerSetting::initForm()
|
||||
{
|
||||
this->setWindowFlag(Qt::FramelessWindowHint);
|
||||
this->setWindowFlags(this->windowFlags() | Qt::WindowSystemMenuHint | Qt::WindowMaximizeButtonHint);
|
||||
ui->ledAddress->setPlaceholderText("example.com/ip:port");
|
||||
ui->ledPort->setPlaceholderText("admin");
|
||||
}
|
||||
|
||||
void ServerSetting::initWidget()
|
||||
{
|
||||
connect(ui->btnCencel, &QPushButton::clicked, [&](){
|
||||
this->hide();
|
||||
});
|
||||
connect(ui->btnOk, &QPushButton::clicked, [&](){
|
||||
emit okClicked(ui->ledAddress->text(), ui->ledPort->text().toInt());
|
||||
this->hide();
|
||||
});
|
||||
}
|
||||
|
||||
void ServerSetting::on_btnOk_clicked()
|
||||
{
|
||||
if (ui->ledAddress->text().isEmpty() || ui->ledPort->text().isEmpty() ||
|
||||
ui->ledPwd->text().isEmpty())
|
||||
return;
|
||||
|
||||
QString address = ui->ledAddress->text();
|
||||
QString userName = ui->ledPort->text();
|
||||
QString password = ui->ledPwd->text();
|
||||
|
||||
TCHttpService::getInstance()->setConfiguration(userName, password, address);
|
||||
}
|
||||
Reference in New Issue
Block a user