34 switch (pstyle->
kind()) {
44 if (!
result.startsWith(
"Qt::"_L1))
57 if (
const DomSize *sizeHint = sh->elementSize()) {
58 w = sizeHint->elementWidth();
59 h = sizeHint->elementHeight();
68 if (
value.startsWith(
"QSizePolicy::"_L1))
71 sizeType =
"QSizePolicy::"_L1 +
value;
77 bool isVspacer =
false;
79 const QString orientation =
o->elementEnum();
80 if (orientation ==
"Qt::Vertical"_L1 || orientation ==
"Vertical"_L1)
83 const QString horizType = isVspacer ?
"QSizePolicy::Minimum"_L1 : sizeType;
84 const QString vertType = isVspacer ? sizeType :
"QSizePolicy::Minimum"_L1;
90 int compareInt(
int i1,
int i2) {
91 if (i1 < i2)
return -1;
92 if (i1 > i2)
return 1;
97 template <
class Value>
104 return i->hasElementNormalOff() ||
i->hasElementNormalOn() ||
105 i->hasElementDisabledOff() ||
i->hasElementDisabledOn() ||
106 i->hasElementActiveOff() ||
i->hasElementActiveOn() ||
107 i->hasElementSelectedOff() ||
i->hasElementSelectedOn();
111 return iconHasStatePixmaps(
i) || !
i->attributeTheme().isEmpty();
123 if (
p->attributeName() == u
"features"
125 &&
p->elementSet() == u
"QDockWidget::AllDockWidgetFeatures") {
126 const QString msg =
fileName +
": Warning: Deprecated enum value QDockWidget::AllDockWidgetFeatures was encountered."_L1;
132 if (
p->attributeName() == u
"sizeAdjustPolicy"
134 &&
p->elementEnum() == u
"QComboBox::AdjustToMinimumContentsLength") {
135 const QString msg =
fileName +
": Warning: Deprecated enum value QComboBox::AdjustToMinimumContentsLength was encountered."_L1;
142 if (!isIconFormat44(dri)) {
143 if (dri->text().isEmpty()) {
154 if (drp->text().isEmpty()) {
188 return domFont->
elementBold() ? u
"Bold"_s : u
"Normal"_s;
197 if (
const int frc = family.
compare(rhsFamily))
203 if (
const int crc = compareInt(pointSize, rhsPointSize))
213 if (
const int crc = compareInt(italic, rhsItalic))
218 if (
const int crc = compareInt(underline, rhsUnderline))
223 if (
const int crc = compareInt(strikeOut, rhsStrikeOut))
228 if (
const int crc = compareInt(
kerning, rhsKerning))
233 if (
const int crc = compareInt(antialiasing, rhsAntialiasing))
239 if (
const int src = styleStrategy.
compare(rhsStyleStrategy))
246 if (
const int src = hintingPreference.
compare(rhsHintingPreference))
264 if (
const int comp = normalOff.
compare(rhsNormalOff))
269 if (
const int comp = normalOn.
compare(rhsNormalOn))
274 if (
const int comp = disabledOff.
compare(rhsDisabledOff))
279 if (
const int comp = disabledOn.
compare(rhsDisabledOn))
284 if (
const int comp = activeOff.
compare(rhsActiveOff))
289 if (
const int comp = activeOn.
compare(rhsActiveOn))
294 if (
const int comp = selectedOff.
compare(rhsSelectedOff))
299 if (
const int comp = selectedOn.
compare(rhsSelectedOn))
309 m_domSizePolicy(domSizePolicy)
318 if (
const int crc = compareInt(hSizeType, rhsHSizeType))
323 if (
const int crc = compareInt(vSizeType, rhsVSizeType))
328 if (
const int crc = compareInt(hStretch, rhsHStretch))
333 if (
const int crc = compareInt(vStretch, rhsVStretch))
339 if (
const int hrc = attributeHSizeType.
compare(rhsAttributeHSizeType))
345 return attributeVSizeType.
compare(rhsAttributeVSizeType);
350WriteInitialization::LayoutDefaultHandler::LayoutDefaultHandler()
352 std::fill_n(m_state,
int(NumProperties), 0u);
353 std::fill_n(m_defaultValues,
int(NumProperties), 0);
358void WriteInitialization::LayoutDefaultHandler::acceptLayoutDefault(
DomLayoutDefault *node)
363 m_state[Margin] |= HasDefaultValue;
367 m_state[Spacing] |= HasDefaultValue;
372void WriteInitialization::LayoutDefaultHandler::acceptLayoutFunction(
DomLayoutFunction *node)
377 m_state[
Margin] |= HasDefaultFunction;
379 m_functions[
Margin] +=
"()"_L1;
382 m_state[Spacing] |= HasDefaultFunction;
384 m_functions[Spacing] +=
"()"_L1;
392 writeSetter(indent, objectName,
"setContentsMargins"_L1, contentsMargins,
str);
395void WriteInitialization::LayoutDefaultHandler::writeProperty(
int p,
const QString &indent,
const QString &objectName,
397 int defaultStyleValue,
bool suppressDefault,
QTextStream &
str)
const
401 const int value = prop->elementNumber();
404 const bool useLayoutFunctionPre43 = !suppressDefault && (m_state[
p] == (HasDefaultFunction|HasDefaultValue)) &&
value == m_defaultValues[
p];
405 if (!useLayoutFunctionPre43) {
406 bool ifndefMac = (!(m_state[
p] & (HasDefaultFunction|HasDefaultValue))
407 &&
value == defaultStyleValue);
409 str <<
"#ifndef Q_OS_MAC\n";
413 writeSetter(indent, objectName, setter,
value,
str);
423 if (m_state[
p] & HasDefaultFunction) {
425 writeSetter(indent, objectName, setter, m_functions[
p],
str);
428 if (m_state[
p] & HasDefaultValue) {
432 writeSetter(indent, objectName, setter, m_defaultValues[
p],
str);
439void WriteInitialization::LayoutDefaultHandler::writeProperties(
const QString &indent,
const QString &varName,
440 const DomPropertyMap &
properties,
int marginType,
441 bool suppressMarginDefault,
447 defaultSpacing,
false,
str);
449 static const int layoutmargins[4] = {-1, 9, 9, 0};
451 layoutmargins[marginType], suppressMarginDefault,
str);
454template <
class DomElement>
459 return !element->hasAttributeNotr() || !
toBool(element->attributeNotr());
465 m_driver(uic->driver()), m_output(uic->
output()), m_option(uic->
option()),
466 m_indent(m_option.indent + m_option.indent),
467 m_dindent(m_indent + m_option.indent),
468 m_delayedOut(&m_delayedInitialization,
QIODevice::WriteOnly),
469 m_refreshOut(&m_refreshInitialization,
QIODevice::WriteOnly),
470 m_actionOut(&m_delayedActionInitialization,
QIODevice::WriteOnly)
476 m_actionGroupChain.
push(
nullptr);
477 m_widgetChain.
push(
nullptr);
478 m_layoutChain.
push(
nullptr);
484 m_customSlots = customSlots->elementSlot();
485 m_customSignals = customSlots->elementSignal();
495 m_output <<
"#include <" << m_driver->
headerFileName() <<
">\n\n";
505 m_mainFormVarName = varName;
509 const QString parameterType = widgetClassName +
" *"_L1;
510 m_output << m_option.
indent
519 m_output << m_indent << varConn <<
" = QSqlDatabase::database("
525 if (!m_buddies.
empty())
527 for (
const Buddy &
b : std::as_const(m_buddies)) {
530 fprintf(stderr,
"%s: Warning: Buddy assignment: '%s' is not a valid widget.\n",
539 if (!m_buddies.
empty())
545 if (!m_delayedActionInitialization.
isEmpty())
546 m_output <<
"\n" << m_delayedActionInitialization;
554 if (!m_delayedInitialization.
isEmpty())
555 m_output <<
"\n" << m_delayedInitialization <<
"\n";
564 if (!m_mainFormUsedInRetranslateUi) {
567 m_refreshInitialization += m_indent;
568 m_refreshInitialization +=
"(void)"_L1;
569 m_refreshInitialization += varName ;
573 m_refreshInitialization += m_indent;
574 m_refreshInitialization +=
"pass"_L1;
579 m_output << m_option.
indent
581 << m_refreshInitialization
586 m_actionGroupChain.
pop();
594 const auto &attributes =
page->elementAttribute();
595 if (!attributes.
empty()) {
597 if (
p->attributeName() ==
"pageId"_L1) {
609 <<
"setPage(" <<
id <<
", " << pageVarName <<
')' <<
language::eol;
619 QString parentWidget, parentClass;
620 if (m_widgetChain.
top()) {
625 const QString savedParentWidget = parentWidget;
628 parentWidget.
clear();
632 if (m_widgetChain.
size() != 1) {
638 parentWidget = savedParentWidget;
641 if (cwi->extends(
className,
"QComboBox")) {
642 initializeComboBox(node);
643 }
else if (cwi->extends(
className,
"QListWidget")) {
644 initializeListWidget(node);
645 }
else if (cwi->extends(
className,
"QTreeWidget")) {
646 initializeTreeWidget(node);
647 }
else if (cwi->extends(
className,
"QTableWidget")) {
648 initializeTableWidget(node);
652 addButtonGroup(node, varName);
658 initializeMenu(node, parentWidget);
662 m_layoutChain.
push(
nullptr);
664 m_layoutWidget =
false;
666 if (
const DomWidget* parentWidget = m_widgetChain.
top()) {
667 const QString parentClass = parentWidget->attributeClass();
668 if (parentClass !=
"QMainWindow"_L1
671 m_layoutWidget =
true;
674 m_widgetChain.
push(node);
675 m_layoutChain.
push(
nullptr);
679 m_layoutWidget =
false;
683 const QString pageDefaultString = u
"Page"_s;
685 if (cwi->extends(parentClass,
"QMainWindow")) {
686 if (cwi->extends(
className,
"QMenuBar")) {
689 }
else if (cwi->extends(
className,
"QToolBar")) {
695 if (pbreak->elementBool() ==
"true"_L1) {
701 }
else if (cwi->extends(
className,
"QDockWidget")) {
718 QString addPageMethod = cwi->customWidgetAddPageMethod(parentClass);
720 addPageMethod = cwi->simpleContainerAddPageMethod(parentClass);
721 if (!addPageMethod.
isEmpty()) {
725 addWizardPage(varName, node, parentWidget);
731 icon =
", "_L1 + iconCall(picon);
733 << varName <<
icon <<
", " << noTrCall(plabelString, pageDefaultString)
736 autoTrOutput(plabelString, pageDefaultString) << m_indent << parentWidget
739 << autoTrCall(plabelString, pageDefaultString) <<
')' <<
language::eol;
742 autoTrOutput(ptoolTip->elementString())
746 << autoTrCall(ptoolTip->elementString()) <<
')' <<
language::eol
754 icon =
", "_L1 + iconCall(picon);
758 autoTrOutput(ptitleString, pageDefaultString) << m_indent << parentWidget
761 << autoTrCall(ptitleString, pageDefaultString) <<
')' <<
language::eol;
764 autoTrOutput(ptoolTip->elementString())
768 <<
"), " << autoTrCall(ptoolTip->elementString()) <<
')' <<
language::eol
772 autoTrOutput(pwhatsThis->elementString())
776 <<
"), " << autoTrCall(pwhatsThis->elementString()) <<
')' <<
language::eol
786 "cascadingSectionResizes"_L1,
787 "minimumSectionSize"_L1,
788 "defaultSectionSize"_L1,
789 "highlightSections"_L1,
790 "showSortIndicator"_L1,
791 "stretchLastSection"_L1,
795 u
"QTreeView"_s, u
"QTreeWidget"_s
798 u
"QTableView"_s, u
"QTableWidget"_s
801 if (cwi->extendsOneOf(
className, trees)) {
803 for (
auto realPropertyName : realPropertyNames) {
804 const QString fakePropertyName =
"header"_L1
805 +
QChar(realPropertyName.at(0)).
toUpper() + realPropertyName.mid(1);
807 fakeProperty->setAttributeName(realPropertyName);
808 headerProperties << fakeProperty;
812 "QHeaderView"_L1, headerProperties,
813 WritePropertyIgnoreObjectName);
815 }
else if (cwi->extendsOneOf(
className, tables)) {
817 "horizontalHeader"_L1,
821 for (
auto headerPrefix : headerPrefixes) {
823 for (
auto realPropertyName : realPropertyNames) {
824 const QString fakePropertyName = headerPrefix
825 +
QChar(realPropertyName.at(0)).
toUpper() + realPropertyName.mid(1);
827 fakeProperty->setAttributeName(realPropertyName);
828 headerProperties << fakeProperty;
832 + headerPrefix +
"()"_L1;
833 writeProperties(headerVar,
"QHeaderView"_L1,
834 headerProperties, WritePropertyIgnoreObjectName);
845 fprintf(stderr,
"%s: Warning: Z-order assignment: '%s' is not a valid widget.\n",
847 name.toLatin1().data());
855void WriteInitialization::addButtonGroup(
const DomWidget *buttonNode,
const QString &varName)
859 const DomProperty *prop = attributes.value(
"buttonGroup"_L1);
866 const bool createGroupOnTheFly =
group ==
nullptr;
867 if (createGroupOnTheFly) {
871 fprintf(stderr,
"%s: Warning: Creating button group `%s'\n",
877 if (!m_buttonGroups.
contains(groupName)) {
879 m_output << m_indent;
880 if (createGroupOnTheFly)
884 m_buttonGroups.
insert(groupName);
897 const bool oldLayoutProperties =
properties.value(
"margin"_L1) !=
nullptr;
899 bool isGroupBox =
false;
903 if (!m_layoutChain.
top() && !isGroupBox)
909 const bool suppressMarginDefault = m_layoutChain.
top();
911 if (oldLayoutProperties)
912 marginType = m_layoutMarginType;
913 m_LayoutDefaultHandler.writeProperties(m_indent, varName,
properties, marginType, suppressMarginDefault, m_output);
919 if (m_layoutWidget) {
923 const QString propertyName =
p->attributeName();
935 p->setAttributeName(
"leftMargin"_L1);
936 p->setElementNumber(0);
941 p->setAttributeName(
"topMargin"_L1);
942 p->setElementNumber(0);
947 p->setAttributeName(
"rightMargin"_L1);
948 p->setElementNumber(0);
953 p->setAttributeName(
"bottomMargin"_L1);
954 p->setElementNumber(0);
957 m_layoutWidget =
false;
960 propList.
append(newPropList);
962 writeProperties(varName,
className, propList, WritePropertyIgnoreMargin|WritePropertyIgnoreSpacing);
969 m_layoutChain.
push(node);
974 const QString numberNull(u
'0');
975 writePropertyList(varName,
"setStretch"_L1, node->
attributeStretch(), numberNull);
983void WriteInitialization::writePropertyList(
const QString &varName,
993 if (
list.
at(
i) != defaultValue) {
1003 writeSpacerItem(node, m_output);
1010 return "QFormLayout::SpanningRole"_L1;
1011 return column == 0 ?
"QFormLayout::LabelRole"_L1 :
"QFormLayout::FieldRole"_L1;
1016 const auto methodPrefix = layoutClass ==
"QFormLayout"_L1 ?
"set"_L1 :
"add"_L1;
1019 return methodPrefix +
"Widget"_L1;
1021 return methodPrefix +
"Layout"_L1;
1023 return methodPrefix +
"Item"_L1;
1046 if (
layout->attributeClass() ==
"QGridLayout"_L1) {
1052 m_output << itemName <<
", " <<
row <<
", " << col <<
", " << rowSpan <<
", " << colSpan;
1055 }
else if (
layout->attributeClass() ==
"QFormLayout"_L1) {
1061 m_output << itemName;
1073 if (m_actionGroupChain.
top())
1078 writeProperties(actionName,
"QActionGroup"_L1, node->
elementProperty());
1080 m_actionGroupChain.
push(node);
1082 m_actionGroupChain.
pop();
1093 if (m_actionGroupChain.
top())
1104 if (actionName.
isEmpty() || !m_widgetChain.
top()
1111 if (m_widgetChain.
top() && actionName ==
"separator"_L1) {
1128 fprintf(stderr,
"%s: Warning: action `%s' not declared\n",
1142 char trailingDelimiter =
'}';
1145 str <<
"QStringList{";
1149 trailingDelimiter =
']';
1158 str <<
'\n' << m_indent <<
" " << trCall(
values.at(
i), comment);
1170 str << trailingDelimiter;
1171 return propertyValue;
1176 if (propertyName ==
"toolTip"_L1)
1178 if (propertyName ==
"whatsThis"_L1)
1180 if (propertyName ==
"statusTip"_L1)
1182 if (propertyName ==
"shortcut"_L1)
1184 if (propertyName ==
"accessibleName"_L1 || propertyName ==
"accessibleDescription"_L1)
1189void WriteInitialization::writeProperties(
const QString &varName,
1191 const DomPropertyList &lst,
1194 const bool isTopLevel = m_widgetChain.
size() == 1;
1206 if (!m_widgetChain.
top()) {
1207 indent = m_option.
indent;
1210 m_output << m_indent <<
"if (" << varName <<
"->objectName().isEmpty())\n";
1213 m_output << m_indent <<
"if not " << varName <<
".objectName():\n";
1217 if (!(
flags & WritePropertyIgnoreObjectName)) {
1221 m_output << m_indent << indent
1226 int leftMargin, topMargin, rightMargin, bottomMargin;
1227 leftMargin = topMargin = rightMargin = bottomMargin = -1;
1228 bool frameShadowEncountered =
false;
1233 QString propertyName =
p->attributeName();
1235 bool delayProperty =
false;
1238 if (isTopLevel && propertyName ==
"geometry"_L1 &&
p->elementRect()) {
1241 <<
r->elementWidth() <<
", " <<
r->elementHeight() <<
')' <<
language::eol;
1244 if (propertyName ==
"currentRow"_L1
1247 <<
"setCurrentRow(" <<
p->elementNumber() <<
')' <<
language::eol;
1251 u
"QComboBox"_s, u
"QStackedWidget"_s,
1252 u
"QTabWidget"_s, u
"QToolBox"_s
1254 if (propertyName ==
"currentIndex"_L1
1257 <<
"setCurrentIndex(" <<
p->elementNumber() <<
')' <<
language::eol;
1260 if (propertyName ==
"tabSpacing"_L1
1267 if (propertyName ==
"control"_L1
1272 if (propertyName ==
"default"_L1
1275 delayProperty =
true;
1276 }
else if (propertyName ==
"database"_L1
1277 &&
p->elementStringList()) {
1280 }
else if (propertyName ==
"frameworkCode"_L1
1284 }
else if (propertyName ==
"orientation"_L1
1287 QString shape = u
"QFrame::HLine"_s;
1288 if (
p->elementEnum() ==
"Qt::Vertical"_L1)
1289 shape = u
"QFrame::VLine"_s;
1294 if (!frameShadowEncountered) {
1296 <<
"setFrameShadow("
1301 }
else if ((
flags & WritePropertyIgnoreMargin) && propertyName ==
"margin"_L1) {
1303 }
else if ((
flags & WritePropertyIgnoreSpacing) && propertyName ==
"spacing"_L1) {
1306 leftMargin =
p->elementNumber();
1309 topMargin =
p->elementNumber();
1312 rightMargin =
p->elementNumber();
1315 bottomMargin =
p->elementNumber();
1317 }
else if (propertyName ==
"numDigits"_L1
1319 qWarning(
"Widget '%s': Deprecated property QLCDNumber::numDigits encountered. It has been replaced by QLCDNumber::digitCount.",
1321 propertyName =
"digitCount"_L1;
1322 }
else if (propertyName ==
"frameShadow"_L1) {
1323 frameShadowEncountered =
true;
1326 bool stdset = m_stdsetdef;
1327 if (
p->hasAttributeStdset())
1328 stdset =
p->attributeStdset();
1339 << propertyName <<
"\", ";
1343 str <<
"::fromValue";
1351 switch (
p->kind()) {
1357 propertyValue = domColor2QString(
p->elementColor());
1361 Buddy buddy = { varName,
p->elementCstring() };
1362 m_buddies.
append(std::move(buddy));
1367 str <<
"QByteArray(";
1375 .
arg(
p->elementCursor());
1378 if (
p->hasAttributeStdset() && !
p->attributeStdset())
1381 +
p->elementCursorShape() + u
')';
1384 propertyValue =
p->elementEnum();
1394 propertyValue = writeFontProperties(
p->elementFont());
1397 propertyValue = writeIconProperties(
p->elementIconSet());
1400 propertyValue = pixCall(
p);
1407 writeColorGroup(pal->
elementActive(),
"QPalette::Active"_L1, paletteName);
1408 writeColorGroup(pal->
elementInactive(),
"QPalette::Inactive"_L1, paletteName);
1409 writeColorGroup(pal->
elementDisabled(),
"QPalette::Disabled"_L1, paletteName);
1411 propertyValue = paletteName;
1429 .
arg(
r->elementX()).
arg(
r->elementY())
1430 .
arg(
r->elementWidth()).
arg(
r->elementHeight());
1444 <<
locale->attributeCountry() <<
')';
1448 const QString spName = writeSizePolicy(
p->elementSizePolicy());
1449 m_output << m_indent << spName <<
".setHeightForWidth("
1453 propertyValue = spName;
1459 .
arg(
s->elementWidth()).
arg(
s->elementHeight());
1469 if (propertyName ==
"objectName"_L1) {
1470 const QString v =
p->elementString()->text();
1477 propertyValue = autoTrCall(
p->elementString());
1485 propertyValue += u
'u';
1488 propertyValue =
"Q_INT64_C("_L1;
1490 propertyValue += u
')';
1493 propertyValue =
"Q_UINT64_C("_L1;
1495 propertyValue += u
')';
1506 .
arg(
c->elementUnicode());
1512 .
arg(
d->elementYear())
1513 .
arg(
d->elementMonth())
1514 .
arg(
d->elementDay());
1520 .
arg(
t->elementHour())
1521 .
arg(
t->elementMinute())
1522 .
arg(
t->elementSecond());
1537 propertyValue = writeStringListProperty(
p->elementStringList());
1541 const DomUrl* u =
p->elementUrl();
1547 propertyValue = writeBrushInitialization(
p->elementBrush());
1553 if (!propertyValue.
isEmpty()) {
1556 QTextStream &
o = delayProperty ? m_delayedOut : autoTrOutput(
p);
1560 o << m_indent << varNewName <<
setFunction << propertyValue;
1567 if (varName == m_mainFormVarName && &
o == &m_refreshOut) {
1570 m_mainFormUsedInRetranslateUi =
true;
1574 if (leftMargin != -1 || topMargin != -1 || rightMargin != -1 || bottomMargin != -1) {
1576 << leftMargin <<
", " << topMargin <<
", "
1577 << rightMargin <<
", " << bottomMargin <<
")" <<
language::eol;
1585 const SizePolicyHandle sizePolicyHandle(
sp);
1586 const SizePolicyNameMap::const_iterator
it = m_sizePolicyNameMap.
constFind(sizePolicyHandle);
1594 m_sizePolicyNameMap.
insert(sizePolicyHandle, spName);
1597 if (
sp->hasElementHSizeType() &&
sp->hasElementVSizeType()) {
1600 }
else if (
sp->hasAttributeHSizeType() &&
sp->hasAttributeVSizeType()) {
1606 m_output << m_indent << spName <<
".setHorizontalStretch("
1608 m_output << m_indent << spName <<
".setVerticalStretch("
1618 const FontHandle fontHandle(
f);
1619 const FontPropertiesNameMap::const_iterator
it = m_fontPropertiesNameMap.
constFind(fontHandle);
1620 if (
it != m_fontPropertiesNameMap.
constEnd()) {
1630 if (
f->hasElementFamily() && !
f->elementFamily().isEmpty()) {
1631 m_output << m_indent <<
fontName <<
".setFamilies("
1636 if (
f->hasElementPointSize() &&
f->elementPointSize() > 0) {
1637 m_output << m_indent <<
fontName <<
".setPointSize(" <<
f->elementPointSize()
1641 if (
f->hasElementFontWeight()) {
1642 m_output << m_indent <<
fontName <<
".setWeight(QFont"
1644 }
else if (
f->hasElementBold()) {
1645 m_output << m_indent <<
fontName <<
".setBold("
1649 if (
f->hasElementItalic()) {
1650 m_output << m_indent <<
fontName <<
".setItalic("
1653 if (
f->hasElementUnderline()) {
1654 m_output << m_indent <<
fontName <<
".setUnderline("
1657 if (
f->hasElementStrikeOut()) {
1658 m_output << m_indent <<
fontName <<
".setStrikeOut("
1661 if (
f->hasElementKerning()) {
1662 m_output << m_indent <<
fontName <<
".setKerning("
1665 if (
f->hasElementAntialiasing()) {
1666 m_output << m_indent <<
fontName <<
".setStyleStrategy(QFont"
1668 << (
f->elementAntialiasing() ?
"PreferDefault" :
"NoAntialias")
1671 if (
f->hasElementStyleStrategy()) {
1672 m_output << m_indent <<
fontName <<
".setStyleStrategy(QFont"
1675 if (
f->hasElementHintingPreference()) {
1676 m_output << m_indent <<
fontName <<
".setHintingPreference(QFont"
1687 output << indent << iconName <<
".addFile("
1699 if (
i->hasElementNormalOff()) {
1703 if (
i->hasElementNormalOn()) {
1707 if (
i->hasElementDisabledOff()) {
1711 if (
i->hasElementDisabledOn()) {
1715 if (
i->hasElementActiveOff()) {
1719 if (
i->hasElementActiveOn()) {
1723 if (
i->hasElementSelectedOff()) {
1727 if (
i->hasElementSelectedOn()) {
1737 output << indent << iconName <<
".addPixmap(" << call <<
", QIcon"
1747 if (
i->hasElementNormalOff()) {
1749 pixCall(
"QPixmap"_L1,
i->elementNormalOff()->text()),
1752 if (
i->hasElementNormalOn()) {
1754 pixCall(
"QPixmap"_L1,
i->elementNormalOn()->text()),
1757 if (
i->hasElementDisabledOff()) {
1759 pixCall(
"QPixmap"_L1,
i->elementDisabledOff()->text()),
1762 if (
i->hasElementDisabledOn()) {
1764 pixCall(
"QPixmap"_L1,
i->elementDisabledOn()->text()),
1767 if (
i->hasElementActiveOff()) {
1769 pixCall(
"QPixmap"_L1,
i->elementActiveOff()->text()),
1772 if (
i->hasElementActiveOn()) {
1774 pixCall(
"QPixmap"_L1,
i->elementActiveOn()->text()),
1777 if (
i->hasElementSelectedOff()) {
1779 pixCall(
"QPixmap"_L1,
i->elementSelectedOff()->text()),
1782 if (
i->hasElementSelectedOn()) {
1784 pixCall(
"QPixmap"_L1,
i->elementSelectedOn()->text()),
1792 const IconHandle iconHandle(
i);
1793 const IconPropertiesNameMap::const_iterator
it = m_iconPropertiesNameMap.
constFind(iconHandle);
1794 if (
it != m_iconPropertiesNameMap.
constEnd())
1799 m_iconPropertiesNameMap.
insert(IconHandle(
i), iconName);
1804 m_output << m_indent;
1806 m_output <<
"const QIcon ";
1807 m_output << iconName <<
" = " << pixCall(
"QIcon"_L1,
i->text())
1813 if (
i->attributeTheme().isEmpty()) {
1820 writePixmapFunctionIcon(m_output, iconName, m_indent,
i);
1825 if (iconHasStatePixmaps(
i)) {
1829 const char themeNameStringVariableC[] =
"iconThemeName";
1831 m_output << m_indent;
1832 if (m_firstThemeIcon) {
1834 m_output <<
"QString ";
1835 m_firstThemeIcon =
false;
1837 m_output << themeNameStringVariableC <<
" = "
1839 m_output << m_indent <<
"if ";
1843 << themeNameStringVariableC <<
')' << (isCpp ?
") {" :
":") <<
'\n'
1846 << m_indent << (isCpp ?
"} else {" :
"else:") <<
'\n';
1850 writePixmapFunctionIcon(m_output, iconName, m_dindent,
i);
1852 m_output << m_indent <<
'}';
1858 m_output << m_indent
1868 if (
c->hasAttributeAlpha())
1870 .
arg(
c->elementRed())
1871 .
arg(
c->elementGreen())
1872 .
arg(
c->elementBlue())
1873 .
arg(
c->attributeAlpha());
1875 .
arg(
c->elementRed())
1876 .
arg(
c->elementGreen())
1877 .
arg(
c->elementBlue());
1882 if (roleName ==
"PlaceholderText"_L1)
1897 m_output << m_indent << paletteName <<
".setColor(" <<
group
1899 <<
", " << domColor2QString(
color)
1906 if (colorRole->hasAttributeRole()) {
1907 const QString roleName = colorRole->attributeRole();
1909 const QString brushName = writeBrushInitialization(colorRole->elementBrush());
1910 if (!versionAdded.
isNull()) {
1911 m_output <<
"#if QT_VERSION >= QT_VERSION_CHECK("
1915 m_output << m_indent << paletteName <<
".setBrush("
1919 if (!versionAdded.
isNull())
1920 m_output <<
"#endif\n";
1930 const bool solidColoredBrush = !
brush->hasAttributeBrushStyle() ||
brush->attributeBrushStyle() ==
"SolidPattern"_L1;
1932 if (solidColoredBrush) {
1934 rgb = ((
color->elementRed() & 0xFF) << 24) |
1935 ((
color->elementGreen() & 0xFF) << 16) |
1936 ((
color->elementBlue() & 0xFF) << 8) |
1937 ((
color->attributeAlpha() & 0xFF));
1939 if (cit != m_colorBrushHash.
constEnd())
1945 writeBrush(
brush, brushName);
1946 if (solidColoredBrush)
1947 m_colorBrushHash.
insert(
rgb, brushName);
1953 QString style = u
"SolidPattern"_s;
1954 if (
brush->hasAttributeBrushStyle())
1955 style =
brush->attributeBrushStyle();
1957 if (style ==
"LinearGradientPattern"_L1 ||
1958 style ==
"RadialGradientPattern"_L1 ||
1959 style ==
"ConicalGradientPattern"_L1) {
1962 const QString gradientName = m_driver->
unique(
"gradient"_L1);
1963 if (gradientType ==
"LinearGradient"_L1) {
1964 m_output << m_indent
1970 }
else if (gradientType ==
"RadialGradient"_L1) {
1971 m_output << m_indent
1978 }
else if (gradientType ==
"ConicalGradient"_L1) {
1979 m_output << m_indent
1986 m_output << m_indent << gradientName <<
".setSpread(QGradient"
1991 m_output << m_indent << gradientName <<
".setCoordinateMode(QGradient"
1999 m_output << m_indent << gradientName <<
".setColorAt("
2000 << stop->attributePosition() <<
", "
2003 m_output << m_indent
2006 }
else if (style ==
"TexturePattern"_L1) {
2010 m_output << m_indent
2015 m_output << m_indent
2019 m_output << m_indent << brushName <<
".setStyle("
2039 for (
int i=0;
i<l.size(); ++
i) {
2042 if (
name.isEmpty()) {
2043 fprintf(stderr,
"%s: Warning: Tab-stop assignment: '%s' is not a valid widget.\n",
2065 return writeIconProperties(
icon->elementIconSet());
2066 return pixCall(
icon);
2073 switch (
p->kind()) {
2076 s =
p->elementIconSet()->text();
2079 type =
"QPixmap"_L1;
2080 s =
p->elementPixmap()->text();
2083 qWarning(
"%s: Warning: Unknown icon format encountered. The ui-file was generated with a too-recent version of Designer.",
2085 return "QIcon()"_L1;
2088 return pixCall(
type,
s);
2109void WriteInitialization::initializeComboBox(
DomWidget *
w)
2113 const auto &
items =
w->elementItem();
2126 iconValue = iconCall(
icon);
2130 m_output << iconValue <<
", ";
2135 <<
"setItemText(" <<
i <<
", " << trCall(
text->elementString())
2141 m_refreshOut <<
"\n";
2148 if (!
w->elementItem().isEmpty()) {
2149 tempName = m_driver->
unique(
"__sortingEnabled"_L1);
2150 m_refreshOut <<
"\n";
2151 m_refreshOut << m_indent;
2153 m_refreshOut <<
"const bool ";
2164 if (!
w->elementItem().isEmpty()) {
2166 <<
"setSortingEnabled(" << tempName <<
')' <<
language::eol <<
'\n';
2185void WriteInitialization::addInitializer(
Item *
item,
2188 if (!
value.isEmpty()) {
2195 item->addSetter(setter, directive, translatable);
2208void WriteInitialization::addStringInitializer(
Item *
item,
2222void WriteInitialization::addBrushInitializer(
Item *
item,
2226 if (
p->elementBrush())
2227 addInitializer(
item,
name,
column, writeBrushInitialization(
p->elementBrush()));
2228 else if (
p->elementColor())
2229 addInitializer(
item,
name,
column, domColor2QString(
p->elementColor()));
2237void WriteInitialization::addQtFlagsInitializer(
Item *
item,
2254void WriteInitialization::addQtEnumInitializer(
Item *
item,
2267void WriteInitialization::addCommonInitializers(
Item *
item,
2275 addInitializer(
item,
"font"_L1,
column, writeFontProperties(
font->elementFont()));
2287void WriteInitialization::initializeListWidget(
DomWidget *
w)
2291 const auto &
items =
w->elementItem();
2296 QString tempName = disableSorting(
w, varName);
2304 Item item(
"QListWidgetItem"_L1, m_indent, m_output, m_refreshOut, m_driver);
2308 item.writeSetupUi(varName);
2311 item.writeRetranslateUi(parentPath);
2313 enableSorting(
w, varName, tempName);
2316void WriteInitialization::initializeTreeWidget(
DomWidget *
w)
2321 Item item(
"QTreeWidgetItem"_L1, m_indent, m_output, m_refreshOut, m_driver);
2323 const auto &columns =
w->elementColumn();
2324 for (
int i = 0;
i < columns.size(); ++
i) {
2341 if (!itemName.
isNull()) {
2346 if (
w->elementItem().empty())
2349 QString tempName = disableSorting(
w, varName);
2351 const auto items = initializeTreeWidgetItems(
w->elementItem());
2354 itm->writeSetupUi(varName);
2357 itm->writeRetranslateUi(parentPath);
2361 enableSorting(
w, varName, tempName);
2373WriteInitialization::Items WriteInitialization::initializeTreeWidgetItems(
const QList<DomItem *> &domItems)
2377 const int numDomItems = domItems.
size();
2380 for (
int i = 0;
i < numDomItems; ++
i) {
2383 Item *
item =
new Item(
"QTreeWidgetItem"_L1, m_indent, m_output, m_refreshOut, m_driver);
2391 if (
p->attributeName() ==
"text"_L1) {
2393 addCommonInitializers(
item,
map, col);
2400 addCommonInitializers(
item,
map, col);
2402 addQtFlagsInitializer(
item,
map,
"flags"_L1);
2404 const auto subItems = initializeTreeWidgetItems(domItem->
elementItem());
2405 for (
Item *subItem : subItems)
2406 item->addChild(subItem);
2411void WriteInitialization::initializeTableWidget(
DomWidget *
w)
2416 const auto &columns =
w->elementColumn();
2418 if (!columns.empty()) {
2420 <<
"columnCount() < " << columns.
size() <<
')';
2427 for (
int i = 0;
i < columns.size(); ++
i) {
2429 if (!
column->elementProperty().isEmpty()) {
2432 Item item(
"QTableWidgetItem"_L1, m_indent, m_output, m_refreshOut, m_driver);
2438 <<
"horizontalHeaderItem(" <<
i <<
')';
2439 item.writeRetranslateUi(parentPath);
2446 const auto &rows =
w->elementRow();
2448 if (!rows.isEmpty()) {
2450 <<
"rowCount() < " << rows.
size() <<
')';
2457 for (
int i = 0;
i < rows.size(); ++
i) {
2459 if (!
row->elementProperty().isEmpty()) {
2462 Item item(
"QTableWidgetItem"_L1, m_indent, m_output, m_refreshOut, m_driver);
2468 item.writeRetranslateUi(parentPath);
2475 QString tempName = disableSorting(
w, varName);
2477 const auto &
items =
w->elementItem();
2480 if (cell->hasAttributeRow() && cell->hasAttributeColumn() && !cell->elementProperty().isEmpty()) {
2481 const int r = cell->attributeRow();
2482 const int c = cell->attributeColumn();
2485 Item item(
"QTableWidgetItem"_L1, m_indent, m_output, m_refreshOut, m_driver);
2492 <<
", " <<
c <<
')';
2493 item.writeRetranslateUi(parentPath);
2498 enableSorting(
w, varName, tempName);
2511 if (idBasedTranslations || m_option.
idBased) {
2515 <<
'"' << m_generatedClass <<
"\", ";
2523 if (!idBasedTranslations && !m_option.
idBased) {
2538 const QString menuAction = menuName +
"Action"_L1;
2542 m_output << m_indent << menuAction <<
" = " << menuName
2554 comment =
str->attributeComment();
2555 id =
str->attributeId();
2557 return trCall(
value, comment,
id);
2576 return trCall(
str, defaultString);
2577 return noTrCall(
str, defaultString);
2583 return autoTrOutput(
str);
2586 return m_refreshOut;
2593 return m_refreshOut;
2597WriteInitialization::Declaration WriteInitialization::findDeclaration(
const QString &
name)
2623 if (requiresStringSyntax.contains(sender.
className)
2624 || requiresStringSyntax.contains(receiver.
className)) {
2632 if ((sender.
name == m_mainFormVarName && m_customSignals.contains(sender.
signature))
2633 || (receiver.
name == m_mainFormVarName && m_customSlots.contains(receiver.
signature))) {
2647 const auto senderDecl = findDeclaration(senderName);
2648 const auto receiverDecl = findDeclaration(receiverName);
2650 if (senderDecl.name.isEmpty() || receiverDecl.name.isEmpty()) {
2653 <<
": Warning: Invalid signal/slot connection: \""
2654 << senderName <<
"\" -> \"" << receiverName <<
"\".";
2659 language::SignalSlotOptions signalOptions;
2664 senderDecl.className, signalOptions};
2666 receiverDecl.className, {}};
2668 m_output << m_indent;
2670 connectionSyntax(theSignal, theSlot));
2679 if (directives.
size() == 1) {
2699 outputStream <<
"#endif" <<
Qt::endl;
2704 m_itemClassName(itemClassName),
2706 m_setupUiStream(setupUiStream),
2707 m_retranslateUiStream(retranslateUiStream),
2713WriteInitialization::Item::~Item()
2718QString WriteInitialization::Item::writeSetupUi(
const QString &
parent, Item::EmptyItemPolicy emptyItemPolicy)
2720 if (emptyItemPolicy == Item::DontConstruct && m_setupUiData.policy == ItemData::DontGenerate)
2723 bool generateMultiDirective =
false;
2724 if (emptyItemPolicy == Item::ConstructItemOnly && m_children.isEmpty()) {
2725 if (m_setupUiData.policy == ItemData::DontGenerate) {
2730 if (m_setupUiData.policy == ItemData::GenerateWithMultiDirective)
2731 generateMultiDirective =
true;
2734 if (generateMultiDirective)
2737 const QString uniqueName = m_driver->unique(
"__"_L1 + m_itemClassName.toLower());
2738 m_setupUiStream << m_indent;
2740 m_setupUiStream << m_itemClassName <<
" *";
2745 if (generateMultiDirective) {
2746 m_setupUiStream <<
"#else\n";
2753 while (
it != m_setupUiData.setters.
constEnd()) {
2766void WriteInitialization::Item::writeRetranslateUi(
const QString &parentPath)
2768 if (m_retranslateUiData.policy == ItemData::DontGenerate)
2771 if (m_retranslateUiData.policy == ItemData::GenerateWithMultiDirective)
2774 const QString uniqueName = m_driver->unique(
"___"_L1 + m_itemClassName.toLower());
2775 m_retranslateUiStream << m_indent;
2777 m_retranslateUiStream << m_itemClassName <<
" *";
2780 if (m_retranslateUiData.policy == ItemData::GenerateWithMultiDirective)
2785 while (
it != m_retranslateUiData.setters.
constEnd()) {
2787 if (oldDirective != newDirective) {
2792 oldDirective = newDirective;
2800 for (
int i = 0;
i < m_children.size();
i++) {
2803 m_children[
i]->writeRetranslateUi(
method);
2807void WriteInitialization::Item::addSetter(
const QString &setter,
const QString &directive,
bool translatable)
2809 const ItemData::TemporaryVariableGeneratorPolicy newPolicy = directive.
isNull() ? ItemData::Generate : ItemData::GenerateWithMultiDirective;
2811 m_retranslateUiData.setters.insert(directive, setter);
2812 if (ItemData::GenerateWithMultiDirective == newPolicy)
2813 m_retranslateUiData.directives << directive;
2814 if (m_retranslateUiData.policy < newPolicy)
2815 m_retranslateUiData.policy = newPolicy;
2817 m_setupUiData.setters.
insert(directive, setter);
2818 if (ItemData::GenerateWithMultiDirective == newPolicy)
2819 m_setupUiData.directives << directive;
2820 if (m_setupUiData.policy < newPolicy)
2821 m_setupUiData.policy = newPolicy;
2825void WriteInitialization::Item::addChild(
Item *
child)
2827 m_children <<
child;
2828 child->m_parent =
this;
2833 p->m_setupUiData.directives |=
c->m_setupUiData.directives;
2834 p->m_retranslateUiData.directives |=
c->m_retranslateUiData.directives;
2835 if (
p->m_setupUiData.policy <
c->m_setupUiData.policy)
2836 p->m_setupUiData.policy =
c->m_setupUiData.policy;
2837 if (
p->m_retranslateUiData.policy <
c->m_retranslateUiData.policy)
2838 p->m_retranslateUiData.policy =
c->m_retranslateUiData.policy;
FontHandle(const DomFont *domFont)
int compare(const FontHandle &) const
int compare(const IconHandle &) const
IconHandle(const DomResourceIcon *domIcon)
SizePolicyHandle(const DomSizePolicy *domSizePolicy)
int compare(const SizePolicyHandle &) const
QStringList connections() const
QList< DomProperty * > elementProperty() const
QString attributeName() const
QList< DomProperty * > elementProperty() const
bool hasAttributeMenu() const
QList< DomColor * > elementColor() const
QList< DomColorRole * > elementColorRole() const
int elementMinute() const
int elementSecond() const
QString elementFontWeight() const
bool hasElementStrikeOut() const
bool hasElementItalic() const
bool elementKerning() const
bool elementUnderline() const
bool hasElementStyleStrategy() const
QString elementStyleStrategy() const
int elementPointSize() const
bool hasElementFamily() const
QString elementFamily() const
bool hasElementAntialiasing() const
bool hasElementUnderline() const
bool elementAntialiasing() const
bool hasElementFontWeight() const
bool elementStrikeOut() const
QString elementHintingPreference() const
bool hasElementKerning() const
bool elementItalic() const
bool hasElementPointSize() const
bool hasElementHintingPreference() const
bool hasElementBold() const
QString attributeSpread() const
QString attributeType() const
double attributeCentralX() const
double attributeFocalY() const
double attributeEndY() const
double attributeFocalX() const
QList< DomGradientStop * > elementGradientStop() const
double attributeAngle() const
double attributeStartY() const
double attributeRadius() const
double attributeStartX() const
bool hasAttributeCoordinateMode() const
double attributeEndX() const
QString attributeCoordinateMode() const
double attributeCentralY() const
QList< DomProperty * > elementProperty() const
QList< DomItem * > elementItem() const
int attributeMargin() const
bool hasAttributeMargin() const
bool hasAttributeSpacing() const
int attributeSpacing() const
QString attributeSpacing() const
QString attributeMargin() const
bool hasAttributeMargin() const
bool hasAttributeSpacing() const
bool hasAttributeRowSpan() const
int attributeRowSpan() const
QString attributeAlignment() const
bool hasAttributeColSpan() const
int attributeColumn() const
int attributeColSpan() const
QString attributeStretch() const
QList< DomProperty * > elementProperty() const
QString attributeColumnMinimumWidth() const
QString attributeRowStretch() const
QString attributeClass() const
QString attributeRowMinimumHeight() const
QString attributeColumnStretch() const
DomColorGroup * elementDisabled() const
DomColorGroup * elementInactive() const
DomColorGroup * elementActive() const
QString elementEnum() const
DomString * elementString() const
int elementNumber() const
double elementWidth() const
double elementHeight() const
bool hasElementSelectedOn() const
DomResourcePixmap * elementActiveOff() const
DomResourcePixmap * elementSelectedOn() const
bool hasElementActiveOff() const
DomResourcePixmap * elementDisabledOn() const
DomResourcePixmap * elementSelectedOff() const
bool hasElementDisabledOn() const
QString attributeTheme() const
DomResourcePixmap * elementDisabledOff() const
bool hasElementSelectedOff() const
bool hasElementDisabledOff() const
bool hasElementNormalOff() const
DomResourcePixmap * elementNormalOff() const
DomResourcePixmap * elementNormalOn() const
DomResourcePixmap * elementActiveOn() const
bool hasElementNormalOn() const
bool hasElementActiveOn() const
double elementWidth() const
double elementHeight() const
QString attributeVSizeType() const
int elementHSizeType() const
int elementVerStretch() const
bool hasElementHSizeType() const
bool hasElementVerStretch() const
int elementVSizeType() const
bool hasElementVSizeType() const
bool hasAttributeHSizeType() const
int elementHorStretch() const
bool hasElementHorStretch() const
QString attributeHSizeType() const
bool hasAttributeVSizeType() const
QList< DomProperty * > elementProperty() const
QStringList elementTabStop() const
bool hasAttributeStdSetDef() const
DomSlots * elementSlots() const
DomLayoutFunction * elementLayoutFunction() const
int attributeStdSetDef() const
DomWidget * elementWidget() const
QString elementClass() const
DomLayoutDefault * elementLayoutDefault() const
bool attributeConnectslotsbyname() const
DomCustomWidgets * elementCustomWidgets() const
DomTabStops * elementTabStops() const
bool hasAttributeConnectslotsbyname() const
DomConnections * elementConnections() const
DomString * elementString() const
const DomAction * actionByName(const QString &attributeName) const
QString widgetVariableName(const QString &attributeName) const
const DomActionGroup * actionGroupByName(const QString &attributeName) const
QString unique(const QString &instanceName=QString(), const QString &className=QString())
QString findOrInsertButtonGroup(const DomButtonGroup *ui_group)
bool useIdBasedTranslations() const
QString findOrInsertWidget(const DomWidget *ui_widget)
const DomWidget * widgetByName(const QString &attributeName) const
QString findOrInsertActionGroup(const DomActionGroup *ui_group)
static QString headerFileName(const QString &fileName)
QString findOrInsertLayoutItem(const DomLayoutItem *ui_layoutItem)
const DomButtonGroup * findButtonGroup(const QString &attributeName) const
QString findOrInsertAction(const DomAction *ui_action)
QString findOrInsertLayout(const DomLayout *ui_layout)
QString findOrInsertSpacer(const DomSpacer *ui_spacer)
char * data()
\macro QT_NO_CAST_FROM_BYTEARRAY
QChar toUpper() const noexcept
Returns the uppercase equivalent if the character is lowercase or titlecase; otherwise returns the ch...
const_iterator constFind(const Key &key) const noexcept
const_iterator constEnd() const noexcept
Returns a const \l{STL-style iterators}{STL-style iterator} pointing to the imaginary item after the ...
T value(const Key &key) const noexcept
friend class const_iterator
bool empty() const noexcept
This function is provided for STL compatibility.
iterator insert(const Key &key, const T &value)
Inserts a new item with the key and a value of value.
\inmodule QtCore \reentrant
qsizetype size() const noexcept
bool isEmpty() const noexcept
bool empty() const noexcept
const_reference at(qsizetype i) const noexcept
const T & constFirst() const noexcept
void reserve(qsizetype size)
void append(parameter_type t)
iterator insert(const Key &key, const T &value)
const_iterator constFind(const Key &key) const
const_iterator constEnd() const
QList< T > values() const
const_iterator constBegin() const noexcept
const_iterator constEnd() const noexcept
bool contains(const T &value) const
const_iterator cbegin() const noexcept
iterator insert(const T &value)
T & top()
Returns a reference to the stack's top item.
T pop()
Removes the top item from the stack and returns it.
void push(const T &t)
Adds element t to the top of the stack.
constexpr QStringView mid(qsizetype pos, qsizetype n=-1) const noexcept
Returns the substring of length length starting at position start in this object.
\macro QT_RESTRICTED_CAST_FROM_ASCII
QByteArray toLatin1() const &
bool startsWith(const QString &s, Qt::CaseSensitivity cs=Qt::CaseSensitive) const
Returns true if the string starts with s; otherwise returns false.
QString & replace(qsizetype i, qsizetype len, QChar after)
static QString fromLatin1(QByteArrayView ba)
This is an overloaded member function, provided for convenience. It differs from the above function o...
void clear()
Clears the contents of the string and makes it null.
bool isNull() const
Returns true if this string is null; otherwise returns false.
qsizetype size() const
Returns the number of characters in this string.
static QString fromUtf8(QByteArrayView utf8)
This is an overloaded member function, provided for convenience. It differs from the above function o...
QString arg(qlonglong a, int fieldwidth=0, int base=10, QChar fillChar=u' ') const
QString mid(qsizetype position, qsizetype n=-1) const
Returns a string that contains n characters of this string, starting at the specified position index.
const QChar at(qsizetype i) const
Returns the character at the given index position in the string.
bool endsWith(const QString &s, Qt::CaseSensitivity cs=Qt::CaseSensitive) const
Returns true if the string ends with s; otherwise returns false.
bool isEmpty() const
Returns true if the string has no characters; otherwise returns false.
int compare(const QString &s, Qt::CaseSensitivity cs=Qt::CaseSensitive) const noexcept
QString & insert(qsizetype i, QChar c)
bool contains(QChar c, Qt::CaseSensitivity cs=Qt::CaseSensitive) const
static QString number(int, int base=10)
This is an overloaded member function, provided for convenience. It differs from the above function o...
QString & remove(qsizetype i, qsizetype len)
Removes n characters from the string, starting at the given position index, and returns a reference t...
QString & prepend(QChar c)
bool isNull() const noexcept
Returns true if there are zero numerical segments, otherwise returns false.
int minorVersion() const noexcept
Returns the minor version number, that is, the second segment.
int majorVersion() const noexcept
Returns the major version number, that is, the first segment.
int microVersion() const noexcept
Returns the micro version number, that is, the third segment.
bool isButton(const QString &className) const
QString pixmapFunction() const
const DatabaseInfo * databaseInfo() const
const CustomWidgetsInfo * customWidgetsInfo() const
bool isMenu(const QString &className) const
bool isContainer(const QString &className) const
static QString whatsThisConfigKey()
static QString toolTipConfigKey()
static QString accessibilityConfigKey()
static QString statusTipConfigKey()
static QString shortcutConfigKey()
QMap< QString, QString > map
[6]
type name READ getFunction WRITE setFunction
[0]
qDeleteAll(list.begin(), list.end())
QSet< QString >::iterator it
static void generateMultiDirectiveEnd(QTextStream &outputStream, const QSet< QString > &directives)
static QVersionNumber colorRoleVersionAdded(const QString &roleName)
static bool needsTranslation(const DomElement *element)
static void writeResourceIcon(QTextStream &output, const QString &iconName, const QString &indent, const DomResourceIcon *i)
static void generateMultiDirectiveBegin(QTextStream &outputStream, const QSet< QString > &directives)
static QString configKeyForProperty(const QString &propertyName)
static QString fontWeight(const DomFont *domFont)
static QString layoutAddMethod(DomLayoutItem::Kind kind, const QString &layoutClass)
static QString formLayoutRole(int column, int colspan)
static void writeIconAddPixmap(QTextStream &output, const QString &indent, const QString &iconName, const QString &call, const char *mode, const char *state)
static void writeContentsMargins(const QString &indent, const QString &objectName, int value, QTextStream &str)
static void writeIconAddFile(QTextStream &output, const QString &indent, const QString &iconName, const QString &fileName, const char *mode, const char *state)
Q_QML_PRIVATE_EXPORT QV4::ReturnedValue locale(QV4::ExecutionEngine *engine, const QString &localeName)
Provides locale specific properties and formatted data.
QString uniqueName(const QString &key, const QStyleOption *option, const QSize &size)
Combined button and popup list for selecting options.
void setter(QUntypedPropertyData *d, const void *value)
QTextStream & endl(QTextStream &stream)
Writes '\n' to the stream and flushes the stream.
QString enumValue(const QString &value)
const char * toolbarArea(int v)
_string< false > charliteral
const char * dockWidgetArea(int v)
_stackVariable< true > stackVariableWithInitParameters
const char * sizePolicy(int v)
QString fixClassName(QString className)
const char * paletteColorRole(int v)
void formatConnection(QTextStream &str, const SignalSlot &sender, const SignalSlot &receiver, ConnectionSyntax connectionSyntax)
_stackVariable< false > stackVariable
QString boolValue(bool v)
static const QCssKnownValue properties[NumProperties - 1]
DBusConnection * connection
DBusConnection const char DBusError DBusBusType DBusError return DBusConnection DBusHandleMessageFunction void DBusFreeFunction return DBusConnection return DBusConnection return const char DBusError return DBusConnection DBusMessage dbus_uint32_t return DBusConnection dbus_bool_t DBusConnection DBusAddWatchFunction DBusRemoveWatchFunction DBusWatchToggledFunction void DBusFreeFunction return DBusConnection DBusDispatchStatusFunction void DBusFreeFunction DBusTimeout return DBusTimeout return DBusWatch return DBusWatch unsigned int return DBusError const DBusError return const DBusMessage return DBusMessage return DBusMessage return DBusMessage return DBusMessage return DBusMessage return DBusMessageIter int const void return DBusMessageIter DBusMessageIter return DBusMessageIter void DBusMessageIter void int return DBusMessage DBusMessageIter return DBusMessageIter return DBusMessageIter DBusMessageIter const char const char const char const char * method
static int writeProperty(QObject *obj, const QByteArray &property_name, QVariant value, int propFlags=QDBusConnection::ExportAllProperties)
EGLOutputLayerEXT EGLint EGLAttrib value
[5]
static QFixed kerning(int left, int right, const QFontEngine::KernPair *pairs, int numPairs)
GLenum GLsizei GLsizei GLint * values
[15]
GLboolean GLboolean GLboolean b
GLsizei const GLfloat * v
[13]
GLfloat GLfloat GLfloat w
[0]
GLenum GLuint GLintptr GLsizeiptr size
[1]
GLdouble GLdouble GLdouble GLdouble top
GLenum GLenum GLsizei count
GLuint GLsizei const GLchar * message
GLenum const void * fontName
GLfloat GLfloat GLfloat GLfloat h
GLenum GLenum GLsizei void GLsizei void * column
GLenum GLenum GLsizei void * row
static QT_BEGIN_NAMESPACE const QRgb colors[][14]
#define qPrintable(string)
#define QStringLiteral(str)
QT_BEGIN_NAMESPACE typedef uchar * output
const char className[16]
[1]
char * toString(const MyType &t)
[31]
void acceptCustomWidgets(DomCustomWidgets *node) override
void acceptActionGroup(DomActionGroup *node) override
void acceptSpacer(DomSpacer *node) override
void acceptLayoutItem(DomLayoutItem *node) override
void acceptTabStops(DomTabStops *tabStops) override
void acceptUI(DomUI *node) override
QList< DomProperty * > DomPropertyList
void acceptLayoutDefault(DomLayoutDefault *node) override
void acceptLayout(DomLayout *node) override
void acceptAction(DomAction *node) override
void acceptCustomWidget(DomCustomWidget *node) override
void acceptLayoutFunction(DomLayoutFunction *node) override
void acceptActionRef(DomActionRef *node) override
WriteInitialization(Uic *uic)
void acceptConnection(DomConnection *connection) override
QHash< QString, DomProperty * > DomPropertyMap
void acceptWidget(DomWidget *node) override
unsigned int forceMemberFnPtrConnectionSyntax
unsigned int forceStringConnectionSyntax
QString messagePrefix() const
QString translateFunction
unsigned int generateImplemetation
unsigned int autoConnection
virtual void acceptActionGroup(DomActionGroup *actionGroup)
virtual void acceptLayoutItem(DomLayoutItem *layoutItem)
virtual void acceptCustomWidgets(DomCustomWidgets *customWidgets)
virtual void acceptWidget(DomWidget *widget)
virtual void acceptConnections(DomConnections *connections)
virtual void acceptLayout(DomLayout *layout)
IUIAutomationTreeWalker __RPC__deref_out_opt IUIAutomationElement ** parent
QT_BEGIN_NAMESPACE bool toBool(const QString &str)
QHash< QString, DomProperty * > propertyMap(const QList< DomProperty * > &properties)