qt解析xml

QDomElement root = doc.documentElement();
			QDomNode Members = root.firstChild();
			QDomNode MicroscopeCcdConfig = Members.firstChild();
			QDomNode FrontLight = MicroscopeCcdConfig.firstChild();
			QDomNode BackLight = FrontLight.nextSiblingElement();

			QDomNode front2X = FrontLight.firstChild();
			QDomNode front2XGain = front2X.firstChild();
			frontLight.lens2X.gain = front2XGain.toElement().text().toDouble();
			QDomElement front2XBrightness = front2X.firstChildElement("Brightness");
			frontLight.lens2X.brightness = front2XBrightness.toElement().text().toInt();
			QDomElement front2XShutterSpeed = front2X.lastChildElement();
			frontLight.lens2X.shutterSpeed = front2XShutterSpeed.toElement().text().toInt();

你可能感兴趣的:(xml)