コード例 #1
0
Telescope* Telescope::telescopeModel()
{
	Telescope* model = new Telescope();
	model->setName("My Telescope");
	model->setDiameter(80);
	model->setFocalLength(500);
	model->setHFlipped(true);
	model->setVFlipped(true);
	return model;
}
コード例 #2
0
Telescope* Telescope::telescopeFromSettings(QSettings* theSettings, int telescopeIndex)
{
	Telescope* telescope = new Telescope();
	QString prefix = "telescope/" + QVariant(telescopeIndex).toString() + "/";
	
	telescope->setName(theSettings->value(prefix + "name", "").toString());
	telescope->setFocalLength(theSettings->value(prefix + "focalLength", "0").toDouble());
	telescope->setDiameter(theSettings->value(prefix + "diameter", "0").toDouble());
	telescope->setHFlipped(theSettings->value(prefix + "hFlip").toBool());
	telescope->setVFlipped(theSettings->value(prefix + "vFlip").toBool());
	
	return telescope;
}