addstudentform.ui.h
来自「学生管理系统 使用Qt写的界面 交互性好」· C头文件 代码 · 共 48 行
H
48 行
/****************************************************************************
** ui.h extension file, included from the uic-generated form implementation.
**
** If you want to add, delete, or rename functions or slots, use
** Qt Designer to update this file, preserving your code.
**
** You should not define a constructor or destructor in this file.
** Instead, write your code in functions called init() and destroy().
** These will automatically be called by the form's constructor and
** destructor.
*****************************************************************************/
void Form2::Add()
{
bool ok;
name = lineEdit1->text();
if(name == "")return;
ID = lineEdit2->text();
if(ID == "")return;
agetext = lineEdit3->text();
age = lineEdit3->text().toInt(&ok,10);
if(ok == false || age < 0 || age > 200)return;
switch(comboBox1->currentItem()){
case 0:
sex = 'M';sextext = "Male";break;
case 1:
sex = 'F';sextext = "Female";break;
}
close();
}
void Form2::myinit()
{
name = "";
ID = "";
age = 0;
sex = 'M';
agetext = "";
sextext = "";
lineEdit1->setText("");
lineEdit2->setText("");
lineEdit3->setText("");
comboBox1->setCurrentItem(0);
}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?