diff options
Diffstat (limited to 'src/tools/uic/cpp/cppwriteinitialization.cpp')
-rw-r--r-- | src/tools/uic/cpp/cppwriteinitialization.cpp | 46 |
1 files changed, 23 insertions, 23 deletions
diff --git a/src/tools/uic/cpp/cppwriteinitialization.cpp b/src/tools/uic/cpp/cppwriteinitialization.cpp index 9471fd22d93..4c073987dcb 100644 --- a/src/tools/uic/cpp/cppwriteinitialization.cpp +++ b/src/tools/uic/cpp/cppwriteinitialization.cpp @@ -143,7 +143,7 @@ namespace { // ### fixme Qt 7 remove this: Exclude deprecated properties of Qt 5. case DomProperty::Set: if (p->attributeName() == u"features" - && customWidgetsInfo->extends(className, QLatin1String("QDockWidget")) + && customWidgetsInfo->extends(className, "QDockWidget") && p->elementSet() == u"QDockWidget::AllDockWidgetFeatures") { const QString msg = fileName + QLatin1String(": Warning: Deprecated enum value QDockWidget::AllDockWidgetFeatures was encountered."); qWarning("%s", qPrintable(msg)); @@ -152,7 +152,7 @@ namespace { break; case DomProperty::Enum: if (p->attributeName() == u"sizeAdjustPolicy" - && customWidgetsInfo->extends(className, QLatin1String("QComboBox")) + && customWidgetsInfo->extends(className, "QComboBox") && p->elementEnum() == u"QComboBox::AdjustToMinimumContentsLength") { const QString msg = fileName + QLatin1String(": Warning: Deprecated enum value QComboBox::AdjustToMinimumContentsLength was encountered."); qWarning("%s", qPrintable(msg)); @@ -649,13 +649,13 @@ void WriteInitialization::acceptWidget(DomWidget *node) parentWidget = savedParentWidget; - if (cwi->extends(className, QLatin1String("QComboBox"))) { + if (cwi->extends(className, "QComboBox")) { initializeComboBox(node); - } else if (cwi->extends(className, QLatin1String("QListWidget"))) { + } else if (cwi->extends(className, "QListWidget")) { initializeListWidget(node); - } else if (cwi->extends(className, QLatin1String("QTreeWidget"))) { + } else if (cwi->extends(className, "QTreeWidget")) { initializeTreeWidget(node); - } else if (cwi->extends(className, QLatin1String("QTableWidget"))) { + } else if (cwi->extends(className, "QTableWidget")) { initializeTableWidget(node); } @@ -665,7 +665,7 @@ void WriteInitialization::acceptWidget(DomWidget *node) writeProperties(varName, className, node->elementProperty()); if (!parentWidget.isEmpty() - && cwi->extends(className, QLatin1String("QMenu"))) { + && cwi->extends(className, "QMenu")) { initializeMenu(node, parentWidget); } @@ -693,11 +693,11 @@ void WriteInitialization::acceptWidget(DomWidget *node) const QString pageDefaultString = QLatin1String("Page"); - if (cwi->extends(parentClass, QLatin1String("QMainWindow"))) { - if (cwi->extends(className, QLatin1String("QMenuBar"))) { + if (cwi->extends(parentClass, "QMainWindow")) { + if (cwi->extends(className, "QMenuBar")) { m_output << m_indent << parentWidget << language::derefPointer << "setMenuBar(" << varName << ')' << language::eol; - } else if (cwi->extends(className, QLatin1String("QToolBar"))) { + } else if (cwi->extends(className, "QToolBar")) { m_output << m_indent << parentWidget << language::derefPointer << "addToolBar(" << language::enumValue(toolBarAreaStringFromDOMAttributes(attributes)) << varName << ')' << language::eol; @@ -709,14 +709,14 @@ void WriteInitialization::acceptWidget(DomWidget *node) } } - } else if (cwi->extends(className, QLatin1String("QDockWidget"))) { + } else if (cwi->extends(className, "QDockWidget")) { m_output << m_indent << parentWidget << language::derefPointer << "addDockWidget("; if (DomProperty *pstyle = attributes.value(QLatin1String("dockWidgetArea"))) { m_output << "Qt" << language::qualifier << language::dockWidgetArea(pstyle->elementNumber()) << ", "; } m_output << varName << ")" << language::eol; - } else if (m_uic->customWidgetsInfo()->extends(className, QLatin1String("QStatusBar"))) { + } else if (m_uic->customWidgetsInfo()->extends(className, "QStatusBar")) { m_output << m_indent << parentWidget << language::derefPointer << "setStatusBar(" << varName << ')' << language::eol; } else { @@ -732,9 +732,9 @@ void WriteInitialization::acceptWidget(DomWidget *node) if (!addPageMethod.isEmpty()) { m_output << m_indent << parentWidget << language::derefPointer << addPageMethod << '(' << varName << ')' << language::eol; - } else if (m_uic->customWidgetsInfo()->extends(parentClass, QLatin1String("QWizard"))) { + } else if (m_uic->customWidgetsInfo()->extends(parentClass, "QWizard")) { addWizardPage(varName, node, parentWidget); - } else if (m_uic->customWidgetsInfo()->extends(parentClass, QLatin1String("QToolBox"))) { + } else if (m_uic->customWidgetsInfo()->extends(parentClass, "QToolBox")) { const DomProperty *plabel = attributes.value(QLatin1String("label")); DomString *plabelString = plabel ? plabel->elementString() : nullptr; QString icon; @@ -757,7 +757,7 @@ void WriteInitialization::acceptWidget(DomWidget *node) << autoTrCall(ptoolTip->elementString()) << ')' << language::eol << language::closeQtConfig(toolTipConfigKey()); } - } else if (m_uic->customWidgetsInfo()->extends(parentClass, QLatin1String("QTabWidget"))) { + } else if (m_uic->customWidgetsInfo()->extends(parentClass, "QTabWidget")) { const DomProperty *ptitle = attributes.value(QLatin1String("title")); DomString *ptitleString = ptitle ? ptitle->elementString() : nullptr; QString icon; @@ -1190,7 +1190,7 @@ void WriteInitialization::writeProperties(const QString &varName, { const bool isTopLevel = m_widgetChain.count() == 1; - if (m_uic->customWidgetsInfo()->extends(className, QLatin1String("QAxWidget"))) { + if (m_uic->customWidgetsInfo()->extends(className, "QAxWidget")) { DomPropertyMap properties = propertyMap(lst); if (DomProperty *p = properties.value(QLatin1String("control"))) { m_output << m_indent << varName << language::derefPointer << "setControl(" @@ -1239,7 +1239,7 @@ void WriteInitialization::writeProperties(const QString &varName, continue; } if (propertyName == QLatin1String("currentRow") // QListWidget::currentRow - && m_uic->customWidgetsInfo()->extends(className, QLatin1String("QListWidget"))) { + && m_uic->customWidgetsInfo()->extends(className, "QListWidget")) { m_delayedOut << m_indent << varName << language::derefPointer << "setCurrentRow(" << p->elementNumber() << ')' << language::eol; continue; @@ -1255,19 +1255,19 @@ void WriteInitialization::writeProperties(const QString &varName, continue; } if (propertyName == QLatin1String("tabSpacing") - && m_uic->customWidgetsInfo()->extends(className, QLatin1String("QToolBox"))) { + && m_uic->customWidgetsInfo()->extends(className, "QToolBox")) { m_delayedOut << m_indent << varName << language::derefPointer << "layout()" << language::derefPointer << "setSpacing(" << p->elementNumber() << ')' << language::eol; continue; } if (propertyName == QLatin1String("control") // ActiveQt support - && m_uic->customWidgetsInfo()->extends(className, QLatin1String("QAxWidget"))) { + && m_uic->customWidgetsInfo()->extends(className, "QAxWidget")) { // already done ;) continue; } if (propertyName == QLatin1String("default") - && m_uic->customWidgetsInfo()->extends(className, QLatin1String("QPushButton"))) { + && m_uic->customWidgetsInfo()->extends(className, "QPushButton")) { // QTBUG-44406: Setting of QPushButton::default needs to be delayed until the parent is set delayProperty = true; } else if (propertyName == QLatin1String("database") @@ -1279,7 +1279,7 @@ void WriteInitialization::writeProperties(const QString &varName, // Sql support continue; } else if (propertyName == QLatin1String("orientation") - && m_uic->customWidgetsInfo()->extends(className, QLatin1String("Line"))) { + && m_uic->customWidgetsInfo()->extends(className, "Line")) { // Line support QString shape = QLatin1String("QFrame::HLine"); if (p->elementEnum() == QLatin1String("Qt::Vertical")) @@ -1312,7 +1312,7 @@ void WriteInitialization::writeProperties(const QString &varName, bottomMargin = p->elementNumber(); continue; } else if (propertyName == QLatin1String("numDigits") // Deprecated in Qt 4, removed in Qt 5. - && m_uic->customWidgetsInfo()->extends(className, QLatin1String("QLCDNumber"))) { + && m_uic->customWidgetsInfo()->extends(className, "QLCDNumber")) { qWarning("Widget '%s': Deprecated property QLCDNumber::numDigits encountered. It has been replaced by QLCDNumber::digitCount.", qPrintable(varName)); propertyName = QLatin1String("digitCount"); @@ -1354,7 +1354,7 @@ void WriteInitialization::writeProperties(const QString &varName, propertyValue = domColor2QString(p->elementColor()); break; case DomProperty::Cstring: - if (propertyName == QLatin1String("buddy") && m_uic->customWidgetsInfo()->extends(className, QLatin1String("QLabel"))) { + if (propertyName == QLatin1String("buddy") && m_uic->customWidgetsInfo()->extends(className, "QLabel")) { Buddy buddy = { varName, p->elementCstring() }; m_buddies.append(std::move(buddy)); } else { |