代码拉取完成,页面将自动刷新
同步操作将从 Qt(开源集合)/图与网络优化_Qt 强制同步,此操作会覆盖自 Fork 仓库以来所做的任何修改,且无法恢复!!!
确定后同步将在后台操作,完成时将刷新页面,请耐心等待。
#include "setcapacityandcostdialog.h"
#include "ui_setcapacityandcostdialog.h"
#include "common.h"
#include <QRegExpValidator>
SetCapacityAndCostDialog::SetCapacityAndCostDialog(QWidget *parent) :
QDialog(parent),
ui(new Ui::SetCapacityAndCostDialog)
{
ui->setupUi(this);
capacity=POS_INFINITY;
cost=0;
connect(ui->btnOK,SIGNAL(clicked()),this,SLOT(onBtnOKClicked()));
QRegExpValidator *validator=new QRegExpValidator(QRegExp("\\d*"),this);
ui->tbCapacity->setValidator(validator);
ui->tbCost->setValidator(validator);
}
SetCapacityAndCostDialog::~SetCapacityAndCostDialog()
{
delete ui;
}
void SetCapacityAndCostDialog::onBtnOKClicked(){
QString strCapacity=ui->tbCapacity->text();
QString strCost=ui->tbCost->text();
if(strCost.isEmpty()){
this->reject();
return;
}else{
cost=strCost.toInt();
}
if(!strCapacity.isEmpty()){
capacity=strCapacity.toInt();
}
this->accept();
}
int SetCapacityAndCostDialog::getCost() const
{
return cost;
}
void SetCapacityAndCostDialog::setCost(int value)
{
cost = value;
if(cost!=POS_INFINITY){
ui->tbCost->setText(QString::number(cost));
ui->tbCapacity->setFocus();
}
}
int SetCapacityAndCostDialog::getCapacity() const
{
return capacity;
}
void SetCapacityAndCostDialog::setCapacity(int value)
{
capacity = value;
}
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。