if ( !domElement.isNull() )
{
QString elementName
= domElement.
tagName();
if ( elementName.compare( "position" ) == 0 )
{
// Convert to position
p0.setX( domElement.attribute( "x" ).toInt() );
p0.setY( domElement.attribute( "y" ).toInt() );
}
}
QDomElement domElement
if ( !domElement.isNull() )
{
QString elementName = domElement.tagName();
if ( elementName.compare( "position" ) == 0 )
{
// Convert to position
QPoint p0;
p0.setX( domElement.attribute( "x" ).toInt() );
p0.setY( domElement.attribute( "y" ).toInt() );
}
}
To copy to clipboard, switch view to plain text mode
it is a simple example for read <position x="12",y="13"/> , good luck!
Bookmarks