diff options
Diffstat (limited to 'src/tools/uic/cpp/cppwriteinitialization.cpp')
-rw-r--r-- | src/tools/uic/cpp/cppwriteinitialization.cpp | 304 |
1 files changed, 203 insertions, 101 deletions
diff --git a/src/tools/uic/cpp/cppwriteinitialization.cpp b/src/tools/uic/cpp/cppwriteinitialization.cpp index e9ad0352af..205d6a50a9 100644 --- a/src/tools/uic/cpp/cppwriteinitialization.cpp +++ b/src/tools/uic/cpp/cppwriteinitialization.cpp @@ -24,6 +24,34 @@ QT_BEGIN_NAMESPACE using namespace Qt::StringLiterals; namespace { + + // Expand "Horizontal", "Qt::Horizontal" to "Qt::Orientation::Horizontal" + QString expandEnum(QString value, const QString &prefix) + { + if (value.startsWith(prefix)) + return value; + const auto pos = value.lastIndexOf("::"_L1); + if (pos == -1) + return prefix + "::"_L1 + value; + value.replace(0, pos, prefix); + return value; + } + + inline QString expandSizePolicyEnum(const QString &value) + { + return expandEnum(value, "QSizePolicy::Policy"_L1); + } + + inline QString expandToolBarArea(const QString &value) + { + return expandEnum(value, "Qt::ToolBarArea"_L1); + } + + inline QString expandDockWidgetArea(const QString &value) + { + return expandEnum(value, "Qt::DockWidgetArea"_L1); + } + // figure out the toolbar area of a DOM attrib list. // By legacy, it is stored as an integer. As of 4.3.0, it is the enumeration value. QString toolBarAreaStringFromDOMAttributes(const CPP::WriteInitialization::DomPropertyMap &attributes) { @@ -33,7 +61,7 @@ namespace { return result; switch (pstyle->kind()) { case DomProperty::Number: - result = QLatin1StringView(language::toolbarArea(pstyle->elementNumber())); + result = language::toolbarArea(pstyle->elementNumber()); break; case DomProperty::Enum: result = pstyle->elementEnum(); @@ -41,9 +69,7 @@ namespace { default: break; } - if (!result.startsWith("Qt::"_L1)) - result.prepend("Qt::"_L1); - return result + ", "_L1; + return expandToolBarArea(result) + ", "_L1; } // Write a statement to create a spacer item. @@ -62,27 +88,17 @@ namespace { output << w << ", " << h << ", "; // size type - QString sizeType; - if (const DomProperty *st = properties.value("sizeType"_L1)) { - const QString value = st->elementEnum(); - if (value.startsWith("QSizePolicy::"_L1)) - sizeType = value; - else - sizeType = "QSizePolicy::"_L1 + value; - } else { - sizeType = QStringLiteral("QSizePolicy::Expanding"); - } + const DomProperty *st = properties.value("sizeType"_L1); + QString horizType = st != nullptr ? st->elementEnum() : "Expanding"_L1; + QString vertType = "Minimum"_L1; // orientation - bool isVspacer = false; - if (const DomProperty *o = properties.value("orientation"_L1)) { - const QString orientation = o->elementEnum(); - if (orientation == "Qt::Vertical"_L1 || orientation == "Vertical"_L1) - isVspacer = true; - } - const QString horizType = isVspacer ? "QSizePolicy::Minimum"_L1 : sizeType; - const QString vertType = isVspacer ? sizeType : "QSizePolicy::Minimum"_L1; - output << language::enumValue(horizType) << ", " << language::enumValue(vertType) << ')'; + const DomProperty *o = properties.value("orientation"_L1); + if (o != nullptr && o->elementEnum().endsWith("Vertical"_L1)) + std::swap(horizType, vertType); + + output << language::enumValue(expandSizePolicyEnum(horizType)) << ", " + << language::enumValue(expandSizePolicyEnum(vertType)) << ')'; } @@ -180,6 +196,15 @@ FontHandle::FontHandle(const DomFont *domFont) : { } +static QString fontWeight(const DomFont *domFont) +{ + if (domFont->hasElementFontWeight()) + return domFont->elementFontWeight(); + if (domFont->hasElementBold()) + return domFont->elementBold() ? u"Bold"_s : u"Normal"_s; + return {}; +} + int FontHandle::compare(const FontHandle &rhs) const { const QString family = m_domFont->hasElementFamily() ? m_domFont->elementFamily() : QString(); @@ -194,10 +219,10 @@ int FontHandle::compare(const FontHandle &rhs) const if (const int crc = compareInt(pointSize, rhsPointSize)) return crc; - const int bold = m_domFont->hasElementBold() ? (m_domFont->elementBold() ? 1 : 0) : -1; - const int rhsBold = rhs.m_domFont->hasElementBold() ? (rhs.m_domFont->elementBold() ? 1 : 0) : -1; - if (const int crc = compareInt(bold, rhsBold)) - return crc; + const QString fontWeight = CPP::fontWeight(m_domFont); + const QString rhsFontWeight = CPP::fontWeight(rhs.m_domFont); + if (const int wrc = fontWeight.compare(rhsFontWeight)) + return wrc; const int italic = m_domFont->hasElementItalic() ? (m_domFont->elementItalic() ? 1 : 0) : -1; const int rhsItalic = rhs.m_domFont->hasElementItalic() ? (rhs.m_domFont->elementItalic() ? 1 : 0) : -1; @@ -209,11 +234,6 @@ int FontHandle::compare(const FontHandle &rhs) const if (const int crc = compareInt(underline, rhsUnderline)) return crc; - const int weight = m_domFont->hasElementWeight() ? m_domFont->elementWeight() : -1; - const int rhsWeight = rhs.m_domFont->hasElementWeight() ? rhs.m_domFont->elementWeight() : -1; - if (const int crc = compareInt(weight, rhsWeight)) - return crc; - const int strikeOut = m_domFont->hasElementStrikeOut() ? (m_domFont->elementStrikeOut() ? 1 : 0) : -1; const int rhsStrikeOut = rhs.m_domFont->hasElementStrikeOut() ? (rhs.m_domFont->elementStrikeOut() ? 1 : 0) : -1; if (const int crc = compareInt(strikeOut, rhsStrikeOut)) @@ -235,6 +255,13 @@ int FontHandle::compare(const FontHandle &rhs) const if (const int src = styleStrategy.compare(rhsStyleStrategy)) return src; + const QString hintingPreference = m_domFont->hasElementHintingPreference() + ? m_domFont->elementHintingPreference() : QString(); + const QString rhsHintingPreference = rhs.m_domFont->hasElementHintingPreference() + ? rhs.m_domFont->elementHintingPreference() : QString(); + if (const int src = hintingPreference.compare(rhsHintingPreference)) + return src; + return 0; } @@ -513,7 +540,7 @@ void WriteInitialization::acceptUI(DomUI *node) if (!m_buddies.empty()) m_output << language::openQtConfig(shortcutConfigKey()); - for (const Buddy &b : qAsConst(m_buddies)) { + for (const Buddy &b : std::as_const(m_buddies)) { const QString buddyVarName = m_driver->widgetVariableName(b.buddyAttributeName); if (buddyVarName.isEmpty()) { fprintf(stderr, "%s: Warning: Buddy assignment: '%s' is not a valid widget.\n", @@ -601,7 +628,7 @@ void WriteInitialization::addWizardPage(const QString &pageVarName, const DomWid void WriteInitialization::acceptWidget(DomWidget *node) { - m_layoutMarginType = m_widgetChain.count() == 1 ? TopLevelMargin : ChildMargin; + m_layoutMarginType = m_widgetChain.size() == 1 ? TopLevelMargin : ChildMargin; const QString className = node->attributeClass(); const QString varName = m_driver->findOrInsertWidget(node); @@ -669,7 +696,7 @@ void WriteInitialization::acceptWidget(DomWidget *node) const DomPropertyMap attributes = propertyMap(node->elementAttribute()); - const QString pageDefaultString = "Page"_L1; + const QString pageDefaultString = u"Page"_s; if (cwi->extends(parentClass, "QMainWindow")) { if (cwi->extends(className, "QMenuBar")) { @@ -690,8 +717,8 @@ void WriteInitialization::acceptWidget(DomWidget *node) } else if (cwi->extends(className, "QDockWidget")) { m_output << m_indent << parentWidget << language::derefPointer << "addDockWidget("; if (DomProperty *pstyle = attributes.value("dockWidgetArea"_L1)) { - m_output << "Qt" << language::qualifier - << language::dockWidgetArea(pstyle->elementNumber()) << ", "; + QString a = expandDockWidgetArea(language::dockWidgetArea(pstyle->elementNumber())); + m_output << language::enumValue(a) << ", "; } m_output << varName << ")" << language::eol; } else if (m_uic->customWidgetsInfo()->extends(className, "QStatusBar")) { @@ -781,10 +808,10 @@ void WriteInitialization::acceptWidget(DomWidget *node) }; static const QStringList trees = { - "QTreeView"_L1, "QTreeWidget"_L1 + u"QTreeView"_s, u"QTreeWidget"_s }; static const QStringList tables = { - "QTableView"_L1, "QTableWidget"_L1 + u"QTableView"_s, u"QTableWidget"_s }; if (cwi->extendsOneOf(className, trees)) { @@ -864,7 +891,7 @@ void WriteInitialization::addButtonGroup(const DomWidget *buttonNode, const QStr const QString groupName = m_driver->findOrInsertButtonGroup(group); // Create on demand if (!m_buttonGroups.contains(groupName)) { - const QString className = "QButtonGroup"_L1; + const QString className = u"QButtonGroup"_s; m_output << m_indent; if (createGroupOnTheFly) m_output << className << " *"; @@ -977,7 +1004,7 @@ void WriteInitialization::writePropertyList(const QString &varName, if (value.isEmpty()) return; const QStringList list = value.split(u','); - const int count = list.count(); + const int count = list.size(); for (int i = 0; i < count; i++) { if (list.at(i) != defaultValue) { m_output << m_indent << varName << language::derefPointer << setFunction @@ -1002,7 +1029,7 @@ static inline QString formLayoutRole(int column, int colspan) static QString layoutAddMethod(DomLayoutItem::Kind kind, const QString &layoutClass) { - const QString methodPrefix = layoutClass == "QFormLayout"_L1 ? "set"_L1 : "add"_L1; + const auto methodPrefix = layoutClass == "QFormLayout"_L1 ? "set"_L1 : "add"_L1; switch (kind) { case DomLayoutItem::Widget: return methodPrefix + "Widget"_L1; @@ -1180,7 +1207,7 @@ void WriteInitialization::writeProperties(const QString &varName, const DomPropertyList &lst, unsigned flags) { - const bool isTopLevel = m_widgetChain.count() == 1; + const bool isTopLevel = m_widgetChain.size() == 1; if (m_uic->customWidgetsInfo()->extends(className, "QAxWidget")) { DomPropertyMap properties = propertyMap(lst); @@ -1237,8 +1264,8 @@ void WriteInitialization::writeProperties(const QString &varName, continue; } static const QStringList currentIndexWidgets = { - "QComboBox"_L1, "QStackedWidget"_L1, - "QTabWidget"_L1, "QToolBox"_L1 + u"QComboBox"_s, u"QStackedWidget"_s, + u"QTabWidget"_s, u"QToolBox"_s }; if (propertyName == "currentIndex"_L1 // set currentIndex later && (m_uic->customWidgetsInfo()->extendsOneOf(className, currentIndexWidgets))) { @@ -1273,9 +1300,9 @@ void WriteInitialization::writeProperties(const QString &varName, } else if (propertyName == "orientation"_L1 && m_uic->customWidgetsInfo()->extends(className, "Line")) { // Line support - QString shape = "QFrame::HLine"_L1; - if (p->elementEnum() == "Qt::Vertical"_L1) - shape = "QFrame::VLine"_L1; + QString shape = u"QFrame::Shape::HLine"_s; + if (p->elementEnum().endsWith("::Vertical"_L1)) + shape = u"QFrame::Shape::VLine"_s; m_output << m_indent << varName << language::derefPointer << "setFrameShape(" << language::enumValue(shape) << ')' << language::eol; @@ -1283,7 +1310,7 @@ void WriteInitialization::writeProperties(const QString &varName, if (!frameShadowEncountered) { m_output << m_indent << varName << language::derefPointer << "setFrameShadow(" - << language::enumValue("QFrame::Sunken"_L1) + << language::enumValue("QFrame::Shadow::Sunken"_L1) << ')' << language::eol; } continue; @@ -1350,11 +1377,12 @@ void WriteInitialization::writeProperties(const QString &varName, Buddy buddy = { varName, p->elementCstring() }; m_buddies.append(std::move(buddy)); } else { + const bool useQByteArray = !stdset && language::language() == Language::Cpp; QTextStream str(&propertyValue); - if (!stdset) + if (useQByteArray) str << "QByteArray("; str << language::charliteral(p->elementCstring(), m_dindent); - if (!stdset) + if (useQByteArray) str << ')'; } break; @@ -1365,8 +1393,8 @@ void WriteInitialization::writeProperties(const QString &varName, case DomProperty::CursorShape: if (p->hasAttributeStdset() && !p->attributeStdset()) varNewName += language::derefPointer + "viewport()"_L1; - propertyValue = "QCursor(Qt"_L1 + language::qualifier - + p->elementCursorShape() + u')'; + propertyValue = "QCursor(Qt"_L1 + language::qualifier + "CursorShape"_L1 + + language::qualifier + p->elementCursorShape() + u')'; break; case DomProperty::Enum: propertyValue = p->elementEnum(); @@ -1582,12 +1610,18 @@ QString WriteInitialization::writeSizePolicy(const DomSizePolicy *sp) m_sizePolicyNameMap.insert(sizePolicyHandle, spName); m_output << m_indent << language::stackVariableWithInitParameters("QSizePolicy", spName); + QString horizPolicy; + QString vertPolicy; if (sp->hasElementHSizeType() && sp->hasElementVSizeType()) { - m_output << "QSizePolicy" << language::qualifier << language::sizePolicy(sp->elementHSizeType()) - << ", QSizePolicy" << language::qualifier << language::sizePolicy(sp->elementVSizeType()); + horizPolicy = language::sizePolicy(sp->elementHSizeType()); + vertPolicy = language::sizePolicy(sp->elementVSizeType()); } else if (sp->hasAttributeHSizeType() && sp->hasAttributeVSizeType()) { - m_output << "QSizePolicy" << language::qualifier << sp->attributeHSizeType() - << ", QSizePolicy" << language::qualifier << sp->attributeVSizeType(); + horizPolicy = sp->attributeHSizeType(); + vertPolicy = sp->attributeVSizeType(); + } + if (!horizPolicy.isEmpty() && !vertPolicy.isEmpty()) { + m_output << language::enumValue(expandSizePolicyEnum(horizPolicy)) + << ", " << language::enumValue(expandSizePolicyEnum(vertPolicy)); } m_output << ')' << language::eol; @@ -1626,10 +1660,14 @@ QString WriteInitialization::writeFontProperties(const DomFont *f) << ")" << language::eol; } - if (f->hasElementBold()) { + if (f->hasElementFontWeight()) { + m_output << m_indent << fontName << ".setWeight(QFont" + << language::qualifier << f->elementFontWeight() << ')' << language::eol; + } else if (f->hasElementBold()) { m_output << m_indent << fontName << ".setBold(" << language::boolValue(f->elementBold()) << ')' << language::eol; } + if (f->hasElementItalic()) { m_output << m_indent << fontName << ".setItalic(" << language::boolValue(f->elementItalic()) << ')' << language::eol; @@ -1656,6 +1694,11 @@ QString WriteInitialization::writeFontProperties(const DomFont *f) m_output << m_indent << fontName << ".setStyleStrategy(QFont" << language::qualifier << f->elementStyleStrategy() << ')' << language::eol; } + if (f->hasElementHintingPreference()) { + m_output << m_indent << fontName << ".setHintingPreference(QFont" + << language::qualifier << f->elementHintingPreference() << ')' << language::eol; + } + return fontName; } @@ -1665,8 +1708,9 @@ static void writeIconAddFile(QTextStream &output, const QString &indent, { output << indent << iconName << ".addFile(" << language::qstring(fileName, indent) << ", QSize(), QIcon" - << language::qualifier << mode << ", QIcon" << language::qualifier - << state << ')' << language::eol; + << language::qualifier << "Mode" << language::qualifier << mode + << ", QIcon" << language::qualifier << "State" << language::qualifier << state + << ')' << language::eol; } // Post 4.4 write resource icon @@ -1714,7 +1758,8 @@ static void writeIconAddPixmap(QTextStream &output, const QString &indent, const char *mode, const char *state) { output << indent << iconName << ".addPixmap(" << call << ", QIcon" - << language::qualifier << mode << ", QIcon" << language::qualifier + << language::qualifier << "Mode" << language::qualifier << mode + << ", QIcon" << language::qualifier << "State" << language::qualifier << state << ')' << language::eol; } @@ -1765,6 +1810,59 @@ void WriteInitialization::writePixmapFunctionIcon(QTextStream &output, } } +// Write QIcon::fromTheme() (value from enum or variable) +struct iconFromTheme +{ + explicit iconFromTheme(const QString &theme) : m_theme(theme) {} + + QString m_theme; +}; + +QTextStream &operator<<(QTextStream &str, const iconFromTheme &i) +{ + str << "QIcon" << language::qualifier << "fromTheme(" << i.m_theme << ')'; + return str; +} + +// Write QIcon::fromTheme() for an XDG icon from string literal +struct iconFromThemeStringLiteral +{ + explicit iconFromThemeStringLiteral(const QString &theme) : m_theme(theme) {} + + QString m_theme; +}; + +QTextStream &operator<<(QTextStream &str, const iconFromThemeStringLiteral &i) +{ + str << "QIcon" << language::qualifier << "fromTheme(" << language::qstring(i.m_theme) << ')'; + return str; +} + +// Write QIcon::fromTheme() with a path as fallback, add a check using +// QIcon::hasThemeIcon(). +void WriteInitialization::writeThemeIconCheckAssignment(const QString &themeValue, + const QString &iconName, + const DomResourceIcon *i) + +{ + const bool isCpp = language::language() == Language::Cpp; + m_output << m_indent << "if "; + if (isCpp) + m_output << '('; + m_output << "QIcon" << language::qualifier << "hasThemeIcon(" + << themeValue << ')' << (isCpp ? ") {" : ":") << '\n' + << m_dindent << iconName << " = " << iconFromTheme(themeValue) + << language::eol; + m_output << m_indent << (isCpp ? "} else {" : "else:") << '\n'; + if (m_uic->pixmapFunction().isEmpty()) + writeResourceIcon(m_output, iconName, m_dindent, i); + else + writePixmapFunctionIcon(m_output, iconName, m_dindent, i); + if (isCpp) + m_output << m_indent << '}'; + m_output << '\n'; +} + QString WriteInitialization::writeIconProperties(const DomResourceIcon *i) { // check cache @@ -1789,7 +1887,8 @@ QString WriteInitialization::writeIconProperties(const DomResourceIcon *i) } // 4.4 onwards - if (i->attributeTheme().isEmpty()) { + QString theme = i->attributeTheme(); + if (theme.isEmpty()) { // No theme: Write resource icon as is m_output << m_indent << language::stackVariable("QIcon", iconName) << language::eol; @@ -1800,12 +1899,21 @@ QString WriteInitialization::writeIconProperties(const DomResourceIcon *i) return iconName; } + const bool isThemeEnum = theme.startsWith("QIcon::"_L1); + if (isThemeEnum) + theme = language::enumValue(theme); + // Theme: Generate code to check the theme and default to resource if (iconHasStatePixmaps(i)) { // Theme + default state pixmaps: // Generate code to check the theme and default to state pixmaps m_output << m_indent << language::stackVariable("QIcon", iconName) << language::eol; - const char themeNameStringVariableC[] = "iconThemeName"; + if (isThemeEnum) { + writeThemeIconCheckAssignment(theme, iconName, i); + return iconName; + } + + static constexpr auto themeNameStringVariableC = "iconThemeName"_L1; // Store theme name in a variable m_output << m_indent; if (m_firstThemeIcon) { // Declare variable string @@ -1814,32 +1922,19 @@ QString WriteInitialization::writeIconProperties(const DomResourceIcon *i) m_firstThemeIcon = false; } m_output << themeNameStringVariableC << " = " - << language::qstring(i->attributeTheme()) << language::eol; - m_output << m_indent << "if "; - if (isCpp) - m_output << '('; - m_output << "QIcon" << language::qualifier << "hasThemeIcon(" - << themeNameStringVariableC << ')' << (isCpp ? ") {" : ":") << '\n' - << m_dindent << iconName << " = QIcon" << language::qualifier << "fromTheme(" - << themeNameStringVariableC << ')' << language::eol - << m_indent << (isCpp ? "} else {" : "else:") << '\n'; - if (m_uic->pixmapFunction().isEmpty()) - writeResourceIcon(m_output, iconName, m_dindent, i); - else - writePixmapFunctionIcon(m_output, iconName, m_dindent, i); - m_output << m_indent; - if (isCpp) - m_output << '}'; - m_output << '\n'; + << language::qstring(theme) << language::eol; + writeThemeIconCheckAssignment(themeNameStringVariableC, iconName, i); return iconName; } // Theme, but no state pixmaps: Construct from theme directly. m_output << m_indent - << language::stackVariableWithInitParameters("QIcon", iconName) - << "QIcon" << language::qualifier << "fromTheme(" - << language::qstring(i->attributeTheme()) << "))" - << language::eol; + << language::stackVariableWithInitParameters("QIcon", iconName); + if (isThemeEnum) + m_output << iconFromTheme(theme); + else + m_output << iconFromThemeStringLiteral(theme); + m_output << ')' << language::eol; return iconName; } @@ -1930,7 +2025,7 @@ QString WriteInitialization::writeBrushInitialization(const DomBrush *brush) void WriteInitialization::writeBrush(const DomBrush *brush, const QString &brushName) { - QString style = "SolidPattern"_L1; + QString style = u"SolidPattern"_s; if (brush->hasAttributeBrushStyle()) style = brush->attributeBrushStyle(); @@ -2048,7 +2143,8 @@ QString WriteInitialization::iconCall(const DomProperty *icon) QString WriteInitialization::pixCall(const DomProperty *p) const { - QString type, s; + QLatin1StringView type; + QString s; switch (p->kind()) { case DomProperty::IconSet: type = "QIcon"_L1; @@ -2067,23 +2163,22 @@ QString WriteInitialization::pixCall(const DomProperty *p) const return pixCall(type, s); } -QString WriteInitialization::pixCall(const QString &t, const QString &text) const +QString WriteInitialization::pixCall(QLatin1StringView t, const QString &text) const { - QString type = t; - if (text.isEmpty()) { - type += "()"_L1; - return type; - } + if (text.isEmpty()) + return t % "()"_L1; - QTextStream str(&type); + QString result; + QTextStream str(&result); + str << t; str << '('; - QString pixFunc = m_uic->pixmapFunction(); + const QString pixFunc = m_uic->pixmapFunction(); if (pixFunc.isEmpty()) str << language::qstring(text, m_dindent); else str << pixFunc << '(' << language::charliteral(text, m_dindent) << ')'; str << ')'; - return type; + return result; } void WriteInitialization::initializeComboBox(DomWidget *w) @@ -2329,7 +2424,7 @@ void WriteInitialization::initializeTreeWidget(DomWidget *w) QString tempName = disableSorting(w, varName); const auto items = initializeTreeWidgetItems(w->elementItem()); - for (int i = 0; i < items.count(); i++) { + for (int i = 0; i < items.size(); i++) { Item *itm = items[i]; itm->writeSetupUi(varName); QString parentPath; @@ -2632,14 +2727,21 @@ void WriteInitialization::acceptConnection(DomConnection *connection) return; } const QString senderSignature = connection->elementSignal(); + const QString slotSignature = connection->elementSlot(); + const bool senderAmbiguous = m_uic->customWidgetsInfo()->isAmbiguousSignal(senderDecl.className, + senderSignature); + const bool slotAmbiguous = m_uic->customWidgetsInfo()->isAmbiguousSlot(receiverDecl.className, + slotSignature); + language::SignalSlotOptions signalOptions; - if (m_uic->customWidgetsInfo()->isAmbiguousSignal(senderDecl.className, senderSignature)) - signalOptions.setFlag(language::SignalSlotOption::Ambiguous); + signalOptions.setFlag(language::SignalSlotOption::Ambiguous, senderAmbiguous); + language::SignalSlotOptions slotOptions; + slotOptions.setFlag(language::SignalSlotOption::Ambiguous, slotAmbiguous); language::SignalSlot theSignal{senderDecl.name, senderSignature, senderDecl.className, signalOptions}; - language::SignalSlot theSlot{receiverDecl.name, connection->elementSlot(), - receiverDecl.className, {}}; + language::SignalSlot theSlot{receiverDecl.name, slotSignature, + receiverDecl.className, slotOptions}; m_output << m_indent; language::formatConnection(m_output, theSignal, theSlot, @@ -2734,7 +2836,7 @@ QString WriteInitialization::Item::writeSetupUi(const QString &parent, Item::Emp m_setupUiStream << language::closeQtConfig(it.key()); ++it; } - for (Item *child : qAsConst(m_children)) + for (Item *child : std::as_const(m_children)) child->writeSetupUi(uniqueName); return uniqueName; } |