value = item.value
type = value.type
- typedefStrippedType = stripTypedefs(type);
- nsStrippedType = self.stripNamespaceFromType(
- typedefStrippedType).replace("::", "__")
+ typedefStrippedType = stripTypedefs(type)
+ nsStrippedType = self.stripNamespaceFromType(typedefStrippedType)\
+ .replace("::", "__")
+
+ # Is this derived from QObject?
++ try:
++ item.value['staticMetaObject']
++ hasMetaObject = True
++ except:
++ hasMetaObject = False
+
+ # Is this derived from QObject?
try:
item.value['staticMetaObject']
hasMetaObject = True
break;
case ParseWithinField: // field attribute
field.name = attributeValue(reader, fieldNameAttributeC);
- field.mandatory = booleanAttributeValue(reader, fieldMandatoryAttributeC);
+ field.mandatory = booleanAttributeValue(reader, fieldMandatoryAttributeC, false);
break;
+ case ParseWithinFieldDescription:
+ assignLanguageElementText(reader, language, &field.description);
+ state = ParseWithinField; // The above reads away the end tag, set state.
+ break;
+ case ParseWithinFieldControl: // Copy widget control attributes
+ field.controlAttributes = attributesToStringMap(reader.attributes());
+ break;
+ case ParseWithinComboEntries:
+ break;
+ case ParseWithinComboEntry: // Combo entry with 'value' attribute
+ field.controlAttributes.insert(CustomWizardField::comboEntryValueKey(comboEntryCount),
+ attributeValue(reader, "value"));
+ break;
+ case ParseWithinComboEntryText: {
+
+ // This reads away the end tag, set state here.
+ QString text;
+ if (assignLanguageElementText(reader, language, &text))
+ field.controlAttributes.insert(CustomWizardField::comboEntryTextKey(comboEntryCount),
+ text);
+ state = ParseWithinComboEntry;
+ }
+ break;
case ParseWithinFile: { // file attribute
CustomWizardFile file;
file.source = attributeValue(reader, fileNameSourceAttributeC);
break;
case QXmlStreamReader::EndElement:
state = nextClosingState(state, reader.name());
- if (state == ParseError) {
+ switch (state) {
+ case ParseError:
*errorMessage = msgError(reader, configFileFullPath,
QString::fromLatin1("Unexpected end element %1").arg(reader.name().toString()));
- return false;
+ return ParseFailed;
- }
- if (state == ParseWithinFields) { // Leaving a field element
+ case ParseWithinFields: // Leaving a field element
fields.push_back(field);
field.clear();
+ break;
+ case ParseWithinComboEntries:
+ comboEntryCount++;
+ break;
+ default:
+ break;
}
break;
default: