Mercurial > projects > qtd
comparison tools/duic/d/dwriteinitialization.cpp @ 338:e65f08f6262b
fix for duic. QStringUtil instead of QString
author | Eldar Insafutdinov |
---|---|
date | Sat, 27 Mar 2010 18:53:42 +0000 |
parents | 2edf95ad41e5 |
children | 4d17d96480db |
comparison
equal
deleted
inserted
replaced
337:5896535a03cd | 338:e65f08f6262b |
---|---|
1023 | 1023 |
1024 if (m_uic->customWidgetsInfo()->extends(className, QLatin1String("QAxWidget"))) { | 1024 if (m_uic->customWidgetsInfo()->extends(className, QLatin1String("QAxWidget"))) { |
1025 DomPropertyMap properties = propertyMap(lst); | 1025 DomPropertyMap properties = propertyMap(lst); |
1026 if (properties.contains(QLatin1String("control"))) { | 1026 if (properties.contains(QLatin1String("control"))) { |
1027 DomProperty *p = properties.value(QLatin1String("control")); | 1027 DomProperty *p = properties.value(QLatin1String("control")); |
1028 m_output << m_option.indent << varName << ".setControl(QString.fromUtf8(" | 1028 m_output << m_option.indent << varName << ".setControl(QStringUtil.fromUtf8(" |
1029 << fixString(toString(p->elementString()), m_option.indent) << "));\n"; | 1029 << fixString(toString(p->elementString()), m_option.indent) << "));\n"; |
1030 } | 1030 } |
1031 } | 1031 } |
1032 | 1032 |
1033 DomWidget *buttonGroupWidget = findWidget(QLatin1String("Q3ButtonGroup")); | 1033 DomWidget *buttonGroupWidget = findWidget(QLatin1String("Q3ButtonGroup")); |
1035 QString indent; | 1035 QString indent; |
1036 if (!m_widgetChain.top()) { | 1036 if (!m_widgetChain.top()) { |
1037 indent = QLatin1String(" "); | 1037 indent = QLatin1String(" "); |
1038 m_output << m_option.indent << "if (" << varName << ".objectName().length == 0)\n"; | 1038 m_output << m_option.indent << "if (" << varName << ".objectName().length == 0)\n"; |
1039 } | 1039 } |
1040 m_output << m_option.indent << indent << varName << ".setObjectName(QString.fromUtf8(" << fixString(varName, m_option.indent) << "));\n"; | 1040 m_output << m_option.indent << indent << varName << ".setObjectName(QStringUtil.fromUtf8(" << fixString(varName, m_option.indent) << "));\n"; |
1041 | 1041 |
1042 int leftMargin, topMargin, rightMargin, bottomMargin; | 1042 int leftMargin, topMargin, rightMargin, bottomMargin; |
1043 leftMargin = topMargin = rightMargin = bottomMargin = -1; | 1043 leftMargin = topMargin = rightMargin = bottomMargin = -1; |
1044 bool frameShadowEncountered = false; | 1044 bool frameShadowEncountered = false; |
1045 | 1045 |
1264 // ### qWarning("Deprecated: the property `objectName' is different from the variable name"); | 1264 // ### qWarning("Deprecated: the property `objectName' is different from the variable name"); |
1265 } | 1265 } |
1266 | 1266 |
1267 if (p->elementString()->hasAttributeNotr() | 1267 if (p->elementString()->hasAttributeNotr() |
1268 && toBool(p->elementString()->attributeNotr())) { | 1268 && toBool(p->elementString()->attributeNotr())) { |
1269 propertyValue = QLatin1String("QString.fromUtf8("); | 1269 propertyValue = QLatin1String("QStringUtil.fromUtf8("); |
1270 propertyValue += fixString(p->elementString()->text(), m_option.indent); | 1270 propertyValue += fixString(p->elementString()->text(), m_option.indent); |
1271 propertyValue += QLatin1Char(')'); | 1271 propertyValue += QLatin1Char(')'); |
1272 } else { | 1272 } else { |
1273 propertyValue = trCall(p->elementString()); | 1273 propertyValue = trCall(p->elementString()); |
1274 } | 1274 } |
1450 const QString fontName = m_driver->unique(QLatin1String("font")); | 1450 const QString fontName = m_driver->unique(QLatin1String("font")); |
1451 m_fontPropertiesNameMap.insert(FontHandle(f), fontName); | 1451 m_fontPropertiesNameMap.insert(FontHandle(f), fontName); |
1452 | 1452 |
1453 m_output << m_option.indent << "QFont " << fontName << ";\n"; | 1453 m_output << m_option.indent << "QFont " << fontName << ";\n"; |
1454 if (f->hasElementFamily() && !f->elementFamily().isEmpty()) { | 1454 if (f->hasElementFamily() && !f->elementFamily().isEmpty()) { |
1455 m_output << m_option.indent << fontName << ".setFamily(QString.fromUtf8(" << fixString(f->elementFamily(), m_option.indent) | 1455 m_output << m_option.indent << fontName << ".setFamily(QStringUtil.fromUtf8(" << fixString(f->elementFamily(), m_option.indent) |
1456 << "));\n"; | 1456 << "));\n"; |
1457 } | 1457 } |
1458 if (f->hasElementPointSize() && f->elementPointSize() > 0) { | 1458 if (f->hasElementPointSize() && f->elementPointSize() > 0) { |
1459 m_output << m_option.indent << fontName << ".setPointSize(" << f->elementPointSize() | 1459 m_output << m_option.indent << fontName << ".setPointSize(" << f->elementPointSize() |
1460 << ");\n"; | 1460 << ");\n"; |
1934 } | 1934 } |
1935 if (const DomImage *image = findImage(text)) { | 1935 if (const DomImage *image = findImage(text)) { |
1936 if (m_option.extractImages) { | 1936 if (m_option.extractImages) { |
1937 const QString format = image->elementData()->attributeFormat(); | 1937 const QString format = image->elementData()->attributeFormat(); |
1938 const QString extension = format.left(format.indexOf(QLatin1Char('.'))).toLower(); | 1938 const QString extension = format.left(format.indexOf(QLatin1Char('.'))).toLower(); |
1939 QString rc = QLatin1String("QPixmap(QString.fromUtf8(\":/"); | 1939 QString rc = QLatin1String("QPixmap(QStringUtil.fromUtf8(\":/"); |
1940 rc += m_generatedClass; | 1940 rc += m_generatedClass; |
1941 rc += QLatin1String("/images/"); | 1941 rc += QLatin1String("/images/"); |
1942 rc += text; | 1942 rc += text; |
1943 rc += QLatin1Char('.'); | 1943 rc += QLatin1Char('.'); |
1944 rc += extension; | 1944 rc += extension; |
1952 return rc; | 1952 return rc; |
1953 } | 1953 } |
1954 | 1954 |
1955 QString pixFunc = m_uic->pixmapFunction(); | 1955 QString pixFunc = m_uic->pixmapFunction(); |
1956 if (pixFunc.isEmpty()) | 1956 if (pixFunc.isEmpty()) |
1957 pixFunc = QLatin1String("QString.fromUtf8"); | 1957 pixFunc = QLatin1String("QStringUtil.fromUtf8"); |
1958 | 1958 |
1959 type += QLatin1Char('('); | 1959 type += QLatin1Char('('); |
1960 type += pixFunc; | 1960 type += pixFunc; |
1961 type += QLatin1Char('('); | 1961 type += QLatin1Char('('); |
1962 type += fixString(text, m_option.indent); | 1962 type += fixString(text, m_option.indent); |
2486 foreach (DomWidget *child, childWidgets) { | 2486 foreach (DomWidget *child, childWidgets) { |
2487 m_output << " << " << m_driver->findOrInsertWidget(child); | 2487 m_output << " << " << m_driver->findOrInsertWidget(child); |
2488 } | 2488 } |
2489 m_output << ";\n"; | 2489 m_output << ";\n"; |
2490 } | 2490 } |
2491 m_output << m_option.indent << "scriptContext.run(QString.fromUtf8(" | 2491 m_output << m_option.indent << "scriptContext.run(QStringUtil.fromUtf8(" |
2492 << fixString(script, m_option.indent) << "), " | 2492 << fixString(script, m_option.indent) << "), " |
2493 << m_driver->findOrInsertWidget(node) << ", childWidgets);\n"; | 2493 << m_driver->findOrInsertWidget(node) << ", childWidgets);\n"; |
2494 } | 2494 } |
2495 | 2495 |
2496 } // namespace D | 2496 } // namespace D |