modifystudentsyearform.cpp

来自「ASP.NET 在线项目注册系统」· C++ 代码 · 共 56 行

CPP
56
字号
/***************************************************************************                          modifystudentsyearform.cpp  -  description                             -------------------    begin                : Feb 8, 2005    copyright            : (C) 2005 by Lalescu Liviu    email                : liviu@lalescu.ro ***************************************************************************//*************************************************************************** *                                                                         * *   This program is free software; you can redistribute it and/or modify  * *   it under the terms of the GNU General Public License as published by  * *   the Free Software Foundation; either version 2 of the License, or     * *   (at your option) any later version.                                   * *                                                                         * ***************************************************************************/#include "modifystudentsyearform.h"#include <qlineedit.h>ModifyStudentsYearForm::ModifyStudentsYearForm(const QString& initialYearName, int initialNumberOfStudents){	this->_initialYearName=initialYearName;	this->_initialNumberOfStudents=initialNumberOfStudents;	numberSpinBox->setValue(initialNumberOfStudents);	nameLineEdit->setText(initialYearName);	nameLineEdit->selectAll();	nameLineEdit->setFocus();}ModifyStudentsYearForm::~ModifyStudentsYearForm(){}void ModifyStudentsYearForm::cancel(){	this->close();}void ModifyStudentsYearForm::ok(){	if(nameLineEdit->text().isEmpty()){		QMessageBox::information(this, QObject::tr("FET information"), QObject::tr("Incorrect name"));		return;	}	if(this->_initialYearName!=nameLineEdit->text() && gt.rules.searchStudentsSet(nameLineEdit->text())!=NULL){		QMessageBox::information(this, QObject::tr("FET information"), QObject::tr("Name existing - please choose another"));		return;	}	bool t=gt.rules.modifyYear(this->_initialYearName, nameLineEdit->text(), numberSpinBox->value());	assert(t);	this->close();}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?