随机码随机码

QGridLayout *mainLayout = new QGridLayout(this);
	mainLayout->setSpacing(15);//设置按钮之间的距离
 
	// 产品名称
	mainLayout->addWidget(new QLabel(QStringLiteral("项目APP名称:"), this), 0, 0, 1, 1);
	m_productNameEdit = new QLineEdit(this);
	m_productNameEdit->setText("TestLicAPP");
	mainLayout->addWidget(m_productNameEdit, 0, 1, 1, 5);
 
	// 机器码
	mainLayout->addWidget(new QLabel(QStringLiteral("随机码:"), this), 1, 0, 1, 1);
	QRegExp rx("(A-Za-z0-9){4}(-(A-Za-z0-9){4}){3}");
	QRegExpValidator *pReg = new QRegExpValidator(rx, this);
	m_clientSignatureEdit = new QLineEdit(this);
	m_clientSignatureEdit->setValidator(pReg);
	//m_clientSignatureEdit->setInputMask("XXXX-XXXX-XXXX-XXXX;X");
 
		// 获取机器码
	PcSignature identifier_out;
	FUNCTION_RETURN ret = generate_user_pc_signature(identifier_out, ETHERNET);
	if (FUNC_RET_OK == ret) {
		printf("机器码为:%s\n", identifier_out);
	}
	else {
		printf("获取机器码失败!\n");
	}
	m_clientSignatureEdit->setText(QString(identifier_out));
	mainLayout->addWidget(m_clientSignatureEdit, 1, 1, 1, 5);
 
	// 有效期
	mainLayout->addWidget(new QLabel(QStringLiteral("有效期:"), this), 2, 0, 1, 1);
	m_beginDateEdit = new QDateEdit(QDate::currentDate(), this);
	m_beginDateEdit->setCalendarPopup(true);
	mainLayout->addWidget(m_beginDateEdit, 2, 1, 1, 1);
	QLabel *label = new QLabel(QStringLiteral("至"), this);
	label->setFixedWidth(20);
	mainLayout->addWidget(label, 2, 2, 1, 1);
	m_endDateEdit = new QDateEdit(QDate::currentDate().addMonths(1), this);
	m_endDateEdit->setCalendarPopup(true);
	mainLayout->addWidget(m_endDateEdit, 2, 3, 1, 1);
 
	// Liscense输出目录
	mainLayout->addWidget(new QLabel(QStringLiteral("受权输出:"), this), 3, 0, 1, 1);
	m_outputFileNameEdit = new QLineEdit(QApplication::applicationDirPath() + "/License.ini",this);
	QPushButton *fileNameBtn = new QPushButton("...", this);
	//fileNameBtn->setFixedWidth(48);
	connect(fileNameBtn, &QPushButton::clicked, [this]() {
		QString fileName = QFileDialog::getSaveFileName(this, QStringLiteral("Liscense另存为"), m_outputFileNameEdit->text(), ".lic");
		if (!fileName.isEmpty()) {
			m_outputFileNameEdit->setText(fileName);
		}
	});
 
 
	// 输出签名
	mainLayout->addWidget(new QLabel(QStringLiteral("加密签名输出:"), this), 4, 0, 1, 1);
	signEdit = new QLineEdit(this);
	//signEdit->setMaximumWidth(500);
	mainLayout->addWidget(signEdit, 4, 1, 1, 5);
 
	QWidget *subWidget = new QWidget(this);
	QHBoxLayout *subLayout = new QHBoxLayout(subWidget);
	subLayout->setMargin(0);
	subLayout->addWidget(m_outputFileNameEdit);
	subLayout->addWidget(fileNameBtn);
	mainLayout->addWidget(subWidget, 3, 1, 1, 5);
 
	// 
	m_buttonBox = new QDialogButtonBox(QDialogButtonBox::Ok | QDialogButtonBox::Close, Qt::Horizontal, this);
	m_buttonBox->button(QDialogButtonBox::Ok)->setText(QStringLiteral("确定"));
	m_buttonBox->button(QDialogButtonBox::Close)->setText(QStringLiteral("关闭"));
	connect(m_buttonBox, &QDialogButtonBox::accepted, this, &EngiLicenseGenerator::createLicense);
	connect(m_buttonBox, &QDialogButtonBox::rejected, this, &EngiLicenseGenerator::close);
	mainLayout->addWidget(m_buttonBox, 5, 1, 1, 5);
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

lst0426

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值