addconstraintminimizenumberofroomsforteachersform.cpp

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

CPP
66
字号
/***************************************************************************                          addconstraintminimizenumberofroomsforteachersform.cpp  -  description                             -------------------    begin                : 12 July 2005    copyright            : (C) 2005 by Liviu Lalescu    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 "addconstraintminimizenumberofroomsforteachersform.h"#include "spaceconstraint.h"#include <qradiobutton.h>#include <qlabel.h>#include <qlineedit.h>#include <qtable.h>AddConstraintMinimizeNumberOfRoomsForTeachersForm::AddConstraintMinimizeNumberOfRoomsForTeachersForm(){}AddConstraintMinimizeNumberOfRoomsForTeachersForm::~AddConstraintMinimizeNumberOfRoomsForTeachersForm(){}void AddConstraintMinimizeNumberOfRoomsForTeachersForm::addConstraint(){	SpaceConstraint *ctr=NULL;	double weight;	QString tmp=weightLineEdit->text();	sscanf(tmp, "%lf", &weight);	if(weight<0.0){		QMessageBox::warning(this, QObject::tr("FET information"),			QObject::tr("Invalid weight"));		return;	}	bool compulsory=false;	if(compulsoryCheckBox->isChecked())		compulsory=true;	ctr=new ConstraintMinimizeNumberOfRoomsForTeachers(weight, compulsory);	bool tmp2=gt.rules.addSpaceConstraint(ctr);	if(tmp2){		QString s=QObject::tr("Constraint added:");		s+="\n";		s+=ctr->getDetailedDescription(gt.rules);		QMessageBox::information(this, QObject::tr("FET information"), s);	}	else{		QMessageBox::warning(this, QObject::tr("FET information"),			QObject::tr("Constraint NOT added - please report error"));		delete ctr;	}}

⌨️ 快捷键说明

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