⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 subject.cpp

📁 基于遗传算法的排课软件源码 根据需要安排合理的课程时间等
💻 CPP
字号:
////// C++ Implementation: $MODULE$//// Description: ////// Author: Liviu Lalescu <liviu@lalescu.ro>, (C) 2003//// Copyright: See COPYING file that comes with this distribution////#include "subject.h"#include "rules.h"Subject::Subject(){}Subject::~Subject(){}QString Subject::getXmlDescription(){	QString s="<Subject>\n";	s+="	<Name>"+protect(this->name)+"</Name>\n";	s+="</Subject>\n";	return s;}QString Subject::getDetailedDescription(){	QString s=QObject::tr("Subject");	s+="\n";	s+=QObject::tr("Name=%1").arg(this->name);	s+="\n";	return s;}int SubjectsList::compareItems(QPtrCollection::Item item1, QPtrCollection::Item item2){	if(((Subject*)item1)->name > ((Subject*)item2)->name)		return 1;	else if(((Subject*)item1)->name < ((Subject*)item2)->name)		return -1;	else		return 0;}QString Subject::getDetailedDescriptionWithConstraints(Rules& r){	QString s=this->getDetailedDescription();	s+="--------------------------------------------------\n";	s+=QObject::tr("Time constraints directly related to this subject:");	s+="\n";	for(TimeConstraint* c=r.timeConstraintsList.first(); c; c=r.timeConstraintsList.next()){		if(c->isRelatedToSubject(this)){			s+="\n";			s+=c->getDetailedDescription(r);		}	}	s+="--------------------------------------------------\n";	s+=QObject::tr("Space constraints directly related to this subject:");	s+="\n";	for(SpaceConstraint* c=r.spaceConstraintsList.first(); c; c=r.spaceConstraintsList.next()){		if(c->isRelatedToSubject(this)){			s+="\n";			s+=c->getDetailedDescription(r);		}	}	s+="--------------------------------------------------\n";	return s;}

⌨️ 快捷键说明

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