31 if (
value.startsWith(prefix))
33 const auto pos =
value.lastIndexOf(
"::"_L1);
35 return prefix +
"::"_L1 +
value;
42 return expandEnum(
value,
"QSizePolicy::Policy"_L1);
47 return expandEnum(
value,
"Qt::ToolBarArea"_L1);
52 return expandEnum(
value,
"Qt::DockWidgetArea"_L1);
62 switch (pstyle->kind()) {
67 result = pstyle->elementEnum();
72 return expandToolBarArea(
result) +
", "_L1;
83 if (
const DomSize *sizeHint = sh->elementSize()) {
84 w = sizeHint->elementWidth();
85 h = sizeHint->elementHeight();
92 QString horizType = st !=
nullptr ? st->elementEnum() :
"Expanding"_L1;
93 QString vertType =
"Minimum"_L1;
97 if (
o !=
nullptr &&
o->elementEnum().endsWith(
"Vertical"_L1))
98 std::swap(horizType, vertType);
106 int compareInt(
int i1,
int i2) {
107 if (i1 < i2)
return -1;
108 if (i1 > i2)
return 1;
113 template <
class Value>
120 return i->hasElementNormalOff() ||
i->hasElementNormalOn() ||
121 i->hasElementDisabledOff() ||
i->hasElementDisabledOn() ||
122 i->hasElementActiveOff() ||
i->hasElementActiveOn() ||
123 i->hasElementSelectedOff() ||
i->hasElementSelectedOn();
127 return iconHasStatePixmaps(
i) || !
i->attributeTheme().
isEmpty();
139 if (
p->attributeName() == u
"features"
141 &&
p->elementSet() == u
"QDockWidget::AllDockWidgetFeatures") {
142 const QString msg =
fileName +
": Warning: Deprecated enum value QDockWidget::AllDockWidgetFeatures was encountered."_L1;
148 if (
p->attributeName() == u
"sizeAdjustPolicy"
150 &&
p->elementEnum() == u
"QComboBox::AdjustToMinimumContentsLength") {
151 const QString msg =
fileName +
": Warning: Deprecated enum value QComboBox::AdjustToMinimumContentsLength was encountered."_L1;
158 if (!isIconFormat44(dri)) {
159 if (dri->text().isEmpty()) {
170 if (drp->text().isEmpty()) {
201 if (domFont->hasElementFontWeight())
202 return domFont->elementFontWeight();
203 if (domFont->hasElementBold())
204 return domFont->elementBold() ? u
"Bold"_s : u
"Normal"_s;
213 if (
const int frc = family.
compare(rhsFamily))
219 if (
const int crc = compareInt(pointSize, rhsPointSize))
224 if (
const int wrc =
fontWeight.compare(rhsFontWeight))
229 if (
const int crc = compareInt(italic, rhsItalic))
234 if (
const int crc = compareInt(underline, rhsUnderline))
239 if (
const int crc = compareInt(strikeOut, rhsStrikeOut))
244 if (
const int crc = compareInt(
kerning, rhsKerning))
249 if (
const int crc = compareInt(antialiasing, rhsAntialiasing))
255 if (
const int src = styleStrategy.
compare(rhsStyleStrategy))
262 if (
const int src = hintingPreference.
compare(rhsHintingPreference))
280 if (
const int comp = normalOff.compare(rhsNormalOff))
285 if (
const int comp = normalOn.compare(rhsNormalOn))
290 if (
const int comp = disabledOff.compare(rhsDisabledOff))
295 if (
const int comp = disabledOn.compare(rhsDisabledOn))
300 if (
const int comp = activeOff.compare(rhsActiveOff))
305 if (
const int comp = activeOn.compare(rhsActiveOn))
310 if (
const int comp = selectedOff.compare(rhsSelectedOff))
315 if (
const int comp = selectedOn.compare(rhsSelectedOn))
325 m_domSizePolicy(domSizePolicy)
334 if (
const int crc = compareInt(hSizeType, rhsHSizeType))
339 if (
const int crc = compareInt(vSizeType, rhsVSizeType))
344 if (
const int crc = compareInt(hStretch, rhsHStretch))
349 if (
const int crc = compareInt(vStretch, rhsVStretch))
355 if (
const int hrc = attributeHSizeType.
compare(rhsAttributeHSizeType))
361 return attributeVSizeType.
compare(rhsAttributeVSizeType);
366WriteInitialization::LayoutDefaultHandler::LayoutDefaultHandler()
368 std::fill_n(m_state,
int(NumProperties), 0u);
369 std::fill_n(m_defaultValues,
int(NumProperties), 0);
374void WriteInitialization::LayoutDefaultHandler::acceptLayoutDefault(
DomLayoutDefault *node)
379 m_state[Margin] |= HasDefaultValue;
383 m_state[Spacing] |= HasDefaultValue;
388void WriteInitialization::LayoutDefaultHandler::acceptLayoutFunction(
DomLayoutFunction *node)
393 m_state[
Margin] |= HasDefaultFunction;
395 m_functions[
Margin] +=
"()"_L1;
398 m_state[Spacing] |= HasDefaultFunction;
400 m_functions[Spacing] +=
"()"_L1;
408 writeSetter(indent, objectName,
"setContentsMargins"_L1, contentsMargins,
str);
411void WriteInitialization::LayoutDefaultHandler::writeProperty(
int p,
const QString &indent,
const QString &objectName,
413 int defaultStyleValue,
bool suppressDefault,
QTextStream &
str)
const
417 const int value = prop->elementNumber();
420 const bool useLayoutFunctionPre43 = !suppressDefault && (m_state[
p] == (HasDefaultFunction|HasDefaultValue)) &&
value == m_defaultValues[
p];
421 if (!useLayoutFunctionPre43) {
422 bool ifndefMac = (!(m_state[
p] & (HasDefaultFunction|HasDefaultValue))
423 &&
value == defaultStyleValue);
425 str <<
"#ifndef Q_OS_MAC\n";
429 writeSetter(indent, objectName, setter,
value,
str);
439 if (m_state[
p] & HasDefaultFunction) {
441 writeSetter(indent, objectName, setter, m_functions[
p],
str);
444 if (m_state[
p] & HasDefaultValue) {
448 writeSetter(indent, objectName, setter, m_defaultValues[
p],
str);
455void WriteInitialization::LayoutDefaultHandler::writeProperties(
const QString &indent,
const QString &varName,
457 bool suppressMarginDefault,
463 defaultSpacing,
false,
str);
465 static const int layoutmargins[4] = {-1, 9, 9, 0};
467 layoutmargins[marginType], suppressMarginDefault,
str);
470template <
class DomElement>
475 return !element->hasAttributeNotr() || !
toBool(element->attributeNotr());
481 m_driver(uic->driver()), m_output(uic->
output()), m_option(uic->
option()),
482 m_indent(m_option.indent + m_option.indent),
483 m_dindent(m_indent + m_option.indent),
484 m_delayedOut(&m_delayedInitialization,
QIODevice::WriteOnly),
485 m_refreshOut(&m_refreshInitialization,
QIODevice::WriteOnly),
486 m_actionOut(&m_delayedActionInitialization,
QIODevice::WriteOnly)
492 m_actionGroupChain.
push(
nullptr);
493 m_widgetChain.
push(
nullptr);
494 m_layoutChain.
push(
nullptr);
500 m_customSlots = customSlots->elementSlot();
501 m_customSignals = customSlots->elementSignal();
511 m_output <<
"#include <" << m_driver->
headerFileName() <<
">\n\n";
521 m_mainFormVarName = varName;
525 const QString parameterType = widgetClassName +
" *"_L1;
526 m_output << m_option.
indent
535 m_output << m_indent << varConn <<
" = QSqlDatabase::database("
541 if (!m_buddies.
empty())
543 for (
const Buddy &
b : std::as_const(m_buddies)) {
545 if (buddyVarName.isEmpty()) {
546 fprintf(stderr,
"%s: Warning: Buddy assignment: '%s' is not a valid widget.\n",
555 if (!m_buddies.
empty())
561 if (!m_delayedActionInitialization.
isEmpty())
562 m_output <<
"\n" << m_delayedActionInitialization;
570 if (!m_delayedInitialization.
isEmpty())
571 m_output <<
"\n" << m_delayedInitialization <<
"\n";
580 if (!m_mainFormUsedInRetranslateUi) {
583 m_refreshInitialization += m_indent;
584 m_refreshInitialization +=
"(void)"_L1;
585 m_refreshInitialization += varName ;
589 m_refreshInitialization += m_indent;
590 m_refreshInitialization +=
"pass"_L1;
595 m_output << m_option.
indent
597 << m_refreshInitialization
602 m_actionGroupChain.
pop();
610 const auto &attributes =
page->elementAttribute();
611 if (!attributes.
empty()) {
613 if (
p->attributeName() ==
"pageId"_L1) {
625 <<
"setPage(" <<
id <<
", " << pageVarName <<
')' <<
language::eol;
635 QString parentWidget, parentClass;
636 if (m_widgetChain.
top()) {
641 const QString savedParentWidget = parentWidget;
644 parentWidget.
clear();
648 if (m_widgetChain.
size() != 1) {
654 parentWidget = savedParentWidget;
657 if (cwi->extends(
className,
"QComboBox")) {
658 initializeComboBox(node);
659 }
else if (cwi->extends(
className,
"QListWidget")) {
660 initializeListWidget(node);
661 }
else if (cwi->extends(
className,
"QTreeWidget")) {
662 initializeTreeWidget(node);
663 }
else if (cwi->extends(
className,
"QTableWidget")) {
664 initializeTableWidget(node);
668 addButtonGroup(node, varName);
674 initializeMenu(node, parentWidget);
678 m_layoutChain.
push(
nullptr);
680 m_layoutWidget =
false;
682 if (
const DomWidget* parentWidget = m_widgetChain.
top()) {
683 const QString parentClass = parentWidget->attributeClass();
684 if (parentClass !=
"QMainWindow"_L1
687 m_layoutWidget =
true;
690 m_widgetChain.
push(node);
691 m_layoutChain.
push(
nullptr);
695 m_layoutWidget =
false;
699 const QString pageDefaultString = u
"Page"_s;
701 if (cwi->extends(parentClass,
"QMainWindow")) {
702 if (cwi->extends(
className,
"QMenuBar")) {
705 }
else if (cwi->extends(
className,
"QToolBar")) {
711 if (pbreak->elementBool() ==
"true"_L1) {
717 }
else if (cwi->extends(
className,
"QDockWidget")) {
734 QString addPageMethod = cwi->customWidgetAddPageMethod(parentClass);
735 if (addPageMethod.isEmpty())
736 addPageMethod = cwi->simpleContainerAddPageMethod(parentClass);
737 if (!addPageMethod.isEmpty()) {
741 addWizardPage(varName, node, parentWidget);
744 DomString *plabelString = plabel ? plabel->elementString() :
nullptr;
747 icon =
", "_L1 + iconCall(picon);
749 << varName <<
icon <<
", " << noTrCall(plabelString, pageDefaultString)
752 autoTrOutput(plabelString, pageDefaultString) << m_indent << parentWidget
755 << autoTrCall(plabelString, pageDefaultString) <<
')' <<
language::eol;
758 autoTrOutput(ptoolTip->elementString())
762 << autoTrCall(ptoolTip->elementString()) <<
')' <<
language::eol
767 DomString *ptitleString = ptitle ? ptitle->elementString() :
nullptr;
770 icon =
", "_L1 + iconCall(picon);
774 autoTrOutput(ptitleString, pageDefaultString) << m_indent << parentWidget
777 << autoTrCall(ptitleString, pageDefaultString) <<
')' <<
language::eol;
780 autoTrOutput(ptoolTip->elementString())
784 <<
"), " << autoTrCall(ptoolTip->elementString()) <<
')' <<
language::eol
788 autoTrOutput(pwhatsThis->elementString())
792 <<
"), " << autoTrCall(pwhatsThis->elementString()) <<
')' <<
language::eol
802 "cascadingSectionResizes"_L1,
803 "minimumSectionSize"_L1,
804 "defaultSectionSize"_L1,
805 "highlightSections"_L1,
806 "showSortIndicator"_L1,
807 "stretchLastSection"_L1,
811 u
"QTreeView"_s, u
"QTreeWidget"_s
814 u
"QTableView"_s, u
"QTableWidget"_s
817 if (cwi->extendsOneOf(
className, trees)) {
819 for (
auto realPropertyName : realPropertyNames) {
820 const QString fakePropertyName =
"header"_L1
821 +
QChar(realPropertyName.at(0)).toUpper() + realPropertyName.mid(1);
823 fakeProperty->setAttributeName(realPropertyName);
824 headerProperties << fakeProperty;
828 "QHeaderView"_L1, headerProperties,
829 WritePropertyIgnoreObjectName);
831 }
else if (cwi->extendsOneOf(
className, tables)) {
833 "horizontalHeader"_L1,
837 for (
auto headerPrefix : headerPrefixes) {
839 for (
auto realPropertyName : realPropertyNames) {
840 const QString fakePropertyName = headerPrefix
841 +
QChar(realPropertyName.at(0)).toUpper() + realPropertyName.mid(1);
843 fakeProperty->setAttributeName(realPropertyName);
844 headerProperties << fakeProperty;
848 + headerPrefix +
"()"_L1;
849 writeProperties(headerVar,
"QHeaderView"_L1,
850 headerProperties, WritePropertyIgnoreObjectName);
860 if (varName.isEmpty()) {
861 fprintf(stderr,
"%s: Warning: Z-order assignment: '%s' is not a valid widget.\n",
863 name.toLatin1().data());
871void WriteInitialization::addButtonGroup(
const DomWidget *buttonNode,
const QString &varName)
875 const DomProperty *prop = attributes.value(
"buttonGroup"_L1);
882 const bool createGroupOnTheFly =
group ==
nullptr;
883 if (createGroupOnTheFly) {
887 fprintf(stderr,
"%s: Warning: Creating button group `%s'\n",
893 if (!m_buttonGroups.
contains(groupName)) {
895 m_output << m_indent;
896 if (createGroupOnTheFly)
900 m_buttonGroups.
insert(groupName);
913 const bool oldLayoutProperties =
properties.value(
"margin"_L1) !=
nullptr;
915 bool isGroupBox =
false;
919 if (!m_layoutChain.
top() && !isGroupBox)
925 const bool suppressMarginDefault = m_layoutChain.
top();
927 if (oldLayoutProperties)
928 marginType = m_layoutMarginType;
929 m_LayoutDefaultHandler.writeProperties(m_indent, varName,
properties, marginType, suppressMarginDefault, m_output);
935 if (m_layoutWidget) {
939 const QString propertyName =
p->attributeName();
951 p->setAttributeName(
"leftMargin"_L1);
952 p->setElementNumber(0);
953 newPropList.append(
p);
957 p->setAttributeName(
"topMargin"_L1);
958 p->setElementNumber(0);
959 newPropList.append(
p);
963 p->setAttributeName(
"rightMargin"_L1);
964 p->setElementNumber(0);
965 newPropList.append(
p);
969 p->setAttributeName(
"bottomMargin"_L1);
970 p->setElementNumber(0);
971 newPropList.append(
p);
973 m_layoutWidget =
false;
976 propList.append(newPropList);
978 writeProperties(varName,
className, propList, WritePropertyIgnoreMargin|WritePropertyIgnoreSpacing);
985 m_layoutChain.
push(node);
990 const QString numberNull(u
'0');
991 writePropertyList(varName,
"setStretch"_L1, node->
attributeStretch(), numberNull);
999void WriteInitialization::writePropertyList(
const QString &varName,
1004 if (
value.isEmpty())
1009 if (
list.
at(
i) != defaultValue) {
1019 writeSpacerItem(node, m_output);
1026 return "QFormLayout::SpanningRole"_L1;
1027 return column == 0 ?
"QFormLayout::LabelRole"_L1 :
"QFormLayout::FieldRole"_L1;
1032 const auto methodPrefix = layoutClass ==
"QFormLayout"_L1 ?
"set"_L1 :
"add"_L1;
1035 return methodPrefix +
"Widget"_L1;
1037 return methodPrefix +
"Layout"_L1;
1039 return methodPrefix +
"Item"_L1;
1062 if (
layout->attributeClass() ==
"QGridLayout"_L1) {
1068 m_output << itemName <<
", " <<
row <<
", " << col <<
", " << rowSpan <<
", " << colSpan;
1071 }
else if (
layout->attributeClass() ==
"QFormLayout"_L1) {
1077 m_output << itemName;
1089 if (m_actionGroupChain.
top())
1094 writeProperties(actionName,
"QActionGroup"_L1, node->
elementProperty());
1096 m_actionGroupChain.
push(node);
1098 m_actionGroupChain.
pop();
1109 if (m_actionGroupChain.
top())
1120 if (actionName.
isEmpty() || !m_widgetChain.
top()
1127 if (m_widgetChain.
top() && actionName ==
"separator"_L1) {
1135 if (domWidget && m_uic->
isMenu(domWidget->attributeClass())) {
1144 fprintf(stderr,
"%s: Warning: action `%s' not declared\n",
1158 char trailingDelimiter =
'}';
1161 str <<
"QStringList{";
1165 trailingDelimiter =
']';
1174 str <<
'\n' << m_indent <<
" " << trCall(
values.at(
i), comment);
1186 str << trailingDelimiter;
1187 return propertyValue;
1192 if (propertyName ==
"toolTip"_L1)
1194 if (propertyName ==
"whatsThis"_L1)
1196 if (propertyName ==
"statusTip"_L1)
1198 if (propertyName ==
"shortcut"_L1)
1200 if (propertyName ==
"accessibleName"_L1 || propertyName ==
"accessibleDescription"_L1)
1205void WriteInitialization::writeProperties(
const QString &varName,
1207 const DomPropertyList &lst,
1210 const bool isTopLevel = m_widgetChain.
size() == 1;
1222 if (!m_widgetChain.
top()) {
1223 indent = m_option.
indent;
1226 m_output << m_indent <<
"if (" << varName <<
"->objectName().isEmpty())\n";
1229 m_output << m_indent <<
"if not " << varName <<
".objectName():\n";
1233 if (!(
flags & WritePropertyIgnoreObjectName)) {
1237 m_output << m_indent << indent
1242 int leftMargin, topMargin, rightMargin, bottomMargin;
1243 leftMargin = topMargin = rightMargin = bottomMargin = -1;
1244 bool frameShadowEncountered =
false;
1249 QString propertyName =
p->attributeName();
1251 bool delayProperty =
false;
1254 if (isTopLevel && propertyName ==
"geometry"_L1 &&
p->elementRect()) {
1257 <<
r->elementWidth() <<
", " <<
r->elementHeight() <<
')' <<
language::eol;
1260 if (propertyName ==
"currentRow"_L1
1263 <<
"setCurrentRow(" <<
p->elementNumber() <<
')' <<
language::eol;
1267 u
"QComboBox"_s, u
"QStackedWidget"_s,
1268 u
"QTabWidget"_s, u
"QToolBox"_s
1270 if (propertyName ==
"currentIndex"_L1
1273 <<
"setCurrentIndex(" <<
p->elementNumber() <<
')' <<
language::eol;
1276 if (propertyName ==
"tabSpacing"_L1
1283 if (propertyName ==
"control"_L1
1288 if (propertyName ==
"default"_L1
1291 delayProperty =
true;
1292 }
else if (propertyName ==
"database"_L1
1293 &&
p->elementStringList()) {
1296 }
else if (propertyName ==
"frameworkCode"_L1
1300 }
else if (propertyName ==
"orientation"_L1
1303 QString shape = u
"QFrame::Shape::HLine"_s;
1304 if (
p->elementEnum().endsWith(
"::Vertical"_L1))
1305 shape = u
"QFrame::Shape::VLine"_s;
1310 if (!frameShadowEncountered) {
1312 <<
"setFrameShadow("
1317 }
else if ((
flags & WritePropertyIgnoreMargin) && propertyName ==
"margin"_L1) {
1319 }
else if ((
flags & WritePropertyIgnoreSpacing) && propertyName ==
"spacing"_L1) {
1322 leftMargin =
p->elementNumber();
1325 topMargin =
p->elementNumber();
1328 rightMargin =
p->elementNumber();
1331 bottomMargin =
p->elementNumber();
1333 }
else if (propertyName ==
"numDigits"_L1
1335 qWarning(
"Widget '%s': Deprecated property QLCDNumber::numDigits encountered. It has been replaced by QLCDNumber::digitCount.",
1337 propertyName =
"digitCount"_L1;
1338 }
else if (propertyName ==
"frameShadow"_L1) {
1339 frameShadowEncountered =
true;
1342 bool stdset = m_stdsetdef;
1343 if (
p->hasAttributeStdset())
1344 stdset =
p->attributeStdset();
1355 << propertyName <<
"\", ";
1359 str <<
"::fromValue";
1367 switch (
p->kind()) {
1373 propertyValue = domColor2QString(
p->elementColor());
1377 Buddy buddy = { varName,
p->elementCstring() };
1378 m_buddies.
append(std::move(buddy));
1383 str <<
"QByteArray(";
1391 .arg(
p->elementCursor());
1394 if (
p->hasAttributeStdset() && !
p->attributeStdset())
1400 propertyValue =
p->elementEnum();
1410 propertyValue = writeFontProperties(
p->elementFont());
1413 propertyValue = writeIconProperties(
p->elementIconSet());
1416 propertyValue = pixCall(
p);
1423 writeColorGroup(pal->
elementActive(),
"QPalette::Active"_L1, paletteName);
1424 writeColorGroup(pal->
elementInactive(),
"QPalette::Inactive"_L1, paletteName);
1425 writeColorGroup(pal->
elementDisabled(),
"QPalette::Disabled"_L1, paletteName);
1427 propertyValue = paletteName;
1433 .arg(po->elementX()).arg(po->elementY());
1439 .arg(pof->elementX()).arg(pof->elementY());
1445 .arg(
r->elementX()).arg(
r->elementY())
1446 .arg(
r->elementWidth()).arg(
r->elementHeight());
1452 .arg(rf->elementX()).arg(rf->elementY())
1453 .arg(rf->elementWidth()).arg(rf->elementHeight());
1460 <<
locale->attributeCountry() <<
')';
1464 const QString spName = writeSizePolicy(
p->elementSizePolicy());
1465 m_output << m_indent << spName <<
".setHeightForWidth("
1469 propertyValue = spName;
1475 .arg(
s->elementWidth()).arg(
s->elementHeight());
1481 .arg(sf->elementWidth()).arg(sf->elementHeight());
1485 if (propertyName ==
"objectName"_L1) {
1486 const QString v =
p->elementString()->text();
1493 propertyValue = autoTrCall(
p->elementString());
1501 propertyValue += u
'u';
1504 propertyValue =
"Q_INT64_C("_L1;
1506 propertyValue += u
')';
1509 propertyValue =
"Q_UINT64_C("_L1;
1511 propertyValue += u
')';
1522 .arg(
c->elementUnicode());
1528 .arg(
d->elementYear())
1529 .arg(
d->elementMonth())
1530 .arg(
d->elementDay());
1536 .arg(
t->elementHour())
1537 .arg(
t->elementMinute())
1538 .arg(
t->elementSecond());
1544 .arg(dt->elementYear())
1545 .arg(dt->elementMonth())
1546 .arg(dt->elementDay())
1547 .arg(dt->elementHour())
1548 .arg(dt->elementMinute())
1549 .arg(dt->elementSecond());
1553 propertyValue = writeStringListProperty(
p->elementStringList());
1557 const DomUrl* u =
p->elementUrl();
1563 propertyValue = writeBrushInitialization(
p->elementBrush());
1569 if (!propertyValue.
isEmpty()) {
1572 QTextStream &
o = delayProperty ? m_delayedOut : autoTrOutput(
p);
1574 if (!configKey.isEmpty())
1576 o << m_indent << varNewName <<
setFunction << propertyValue;
1580 if (!configKey.isEmpty())
1583 if (varName == m_mainFormVarName && &
o == &m_refreshOut) {
1586 m_mainFormUsedInRetranslateUi =
true;
1590 if (leftMargin != -1 || topMargin != -1 || rightMargin != -1 || bottomMargin != -1) {
1592 << leftMargin <<
", " << topMargin <<
", "
1593 << rightMargin <<
", " << bottomMargin <<
")" <<
language::eol;
1601 const SizePolicyHandle sizePolicyHandle(
sp);
1602 const SizePolicyNameMap::const_iterator
it = m_sizePolicyNameMap.
constFind(sizePolicyHandle);
1610 m_sizePolicyNameMap.
insert(sizePolicyHandle, spName);
1615 if (
sp->hasElementHSizeType() &&
sp->hasElementVSizeType()) {
1618 }
else if (
sp->hasAttributeHSizeType() &&
sp->hasAttributeVSizeType()) {
1619 horizPolicy =
sp->attributeHSizeType();
1620 vertPolicy =
sp->attributeVSizeType();
1622 if (!horizPolicy.isEmpty() && !vertPolicy.isEmpty()) {
1628 m_output << m_indent << spName <<
".setHorizontalStretch("
1630 m_output << m_indent << spName <<
".setVerticalStretch("
1640 const FontHandle fontHandle(
f);
1641 const FontPropertiesNameMap::const_iterator
it = m_fontPropertiesNameMap.
constFind(fontHandle);
1642 if (
it != m_fontPropertiesNameMap.
constEnd()) {
1652 if (
f->hasElementFamily() && !
f->elementFamily().isEmpty()) {
1653 m_output << m_indent <<
fontName <<
".setFamilies("
1658 if (
f->hasElementPointSize() &&
f->elementPointSize() > 0) {
1659 m_output << m_indent <<
fontName <<
".setPointSize(" <<
f->elementPointSize()
1663 if (
f->hasElementFontWeight()) {
1664 m_output << m_indent <<
fontName <<
".setWeight(QFont"
1666 }
else if (
f->hasElementBold()) {
1667 m_output << m_indent <<
fontName <<
".setBold("
1671 if (
f->hasElementItalic()) {
1672 m_output << m_indent <<
fontName <<
".setItalic("
1675 if (
f->hasElementUnderline()) {
1676 m_output << m_indent <<
fontName <<
".setUnderline("
1679 if (
f->hasElementStrikeOut()) {
1680 m_output << m_indent <<
fontName <<
".setStrikeOut("
1683 if (
f->hasElementKerning()) {
1684 m_output << m_indent <<
fontName <<
".setKerning("
1687 if (
f->hasElementAntialiasing()) {
1688 m_output << m_indent <<
fontName <<
".setStyleStrategy(QFont"
1690 << (
f->elementAntialiasing() ?
"PreferDefault" :
"NoAntialias")
1693 if (
f->hasElementStyleStrategy()) {
1694 m_output << m_indent <<
fontName <<
".setStyleStrategy(QFont"
1697 if (
f->hasElementHintingPreference()) {
1698 m_output << m_indent <<
fontName <<
".setHintingPreference(QFont"
1709 output << indent << iconName <<
".addFile("
1722 if (
i->hasElementNormalOff()) {
1726 if (
i->hasElementNormalOn()) {
1730 if (
i->hasElementDisabledOff()) {
1734 if (
i->hasElementDisabledOn()) {
1738 if (
i->hasElementActiveOff()) {
1742 if (
i->hasElementActiveOn()) {
1746 if (
i->hasElementSelectedOff()) {
1750 if (
i->hasElementSelectedOn()) {
1760 output << indent << iconName <<
".addPixmap(" << call <<
", QIcon"
1771 if (
i->hasElementNormalOff()) {
1773 pixCall(
"QPixmap"_L1,
i->elementNormalOff()->text()),
1776 if (
i->hasElementNormalOn()) {
1778 pixCall(
"QPixmap"_L1,
i->elementNormalOn()->text()),
1781 if (
i->hasElementDisabledOff()) {
1783 pixCall(
"QPixmap"_L1,
i->elementDisabledOff()->text()),
1786 if (
i->hasElementDisabledOn()) {
1788 pixCall(
"QPixmap"_L1,
i->elementDisabledOn()->text()),
1791 if (
i->hasElementActiveOff()) {
1793 pixCall(
"QPixmap"_L1,
i->elementActiveOff()->text()),
1796 if (
i->hasElementActiveOn()) {
1798 pixCall(
"QPixmap"_L1,
i->elementActiveOn()->text()),
1801 if (
i->hasElementSelectedOff()) {
1803 pixCall(
"QPixmap"_L1,
i->elementSelectedOff()->text()),
1806 if (
i->hasElementSelectedOn()) {
1808 pixCall(
"QPixmap"_L1,
i->elementSelectedOn()->text()),
1843void WriteInitialization::writeThemeIconCheckAssignment(
const QString &themeValue,
1849 m_output << m_indent <<
"if ";
1853 << themeValue <<
')' << (isCpp ?
") {" :
":") <<
'\n'
1854 << m_dindent << iconName <<
" = " << iconFromTheme(themeValue)
1856 m_output << m_indent << (isCpp ?
"} else {" :
"else:") <<
'\n';
1860 writePixmapFunctionIcon(m_output, iconName, m_dindent,
i);
1862 m_output << m_indent <<
'}';
1869 const IconHandle iconHandle(
i);
1870 const IconPropertiesNameMap::const_iterator
it = m_iconPropertiesNameMap.
constFind(iconHandle);
1871 if (
it != m_iconPropertiesNameMap.
constEnd())
1876 m_iconPropertiesNameMap.
insert(IconHandle(
i), iconName);
1881 m_output << m_indent;
1883 m_output <<
"const QIcon ";
1884 m_output << iconName <<
" = " << pixCall(
"QIcon"_L1,
i->text())
1890 QString theme =
i->attributeTheme();
1898 writePixmapFunctionIcon(m_output, iconName, m_indent,
i);
1902 const bool isThemeEnum = theme.
startsWith(
"QIcon::"_L1);
1907 if (iconHasStatePixmaps(
i)) {
1912 writeThemeIconCheckAssignment(theme, iconName,
i);
1916 static constexpr auto themeNameStringVariableC =
"iconThemeName"_L1;
1918 m_output << m_indent;
1919 if (m_firstThemeIcon) {
1921 m_output <<
"QString ";
1922 m_firstThemeIcon =
false;
1924 m_output << themeNameStringVariableC <<
" = "
1926 writeThemeIconCheckAssignment(themeNameStringVariableC, iconName,
i);
1931 m_output << m_indent
1934 m_output << iconFromTheme(theme);
1936 m_output << iconFromThemeStringLiteral(theme);
1943 if (
c->hasAttributeAlpha())
1945 .arg(
c->elementRed())
1946 .arg(
c->elementGreen())
1947 .arg(
c->elementBlue())
1948 .arg(
c->attributeAlpha());
1950 .arg(
c->elementRed())
1951 .arg(
c->elementGreen())
1952 .arg(
c->elementBlue());
1957 if (roleName ==
"PlaceholderText"_L1)
1972 m_output << m_indent << paletteName <<
".setColor(" <<
group
1974 <<
", " << domColor2QString(
color)
1981 if (colorRole->hasAttributeRole()) {
1982 const QString roleName = colorRole->attributeRole();
1984 const QString brushName = writeBrushInitialization(colorRole->elementBrush());
1985 if (!versionAdded.isNull()) {
1986 m_output <<
"#if QT_VERSION >= QT_VERSION_CHECK("
1987 << versionAdded.majorVersion() <<
", " << versionAdded.minorVersion()
1988 <<
", " << versionAdded.microVersion() <<
")\n";
1990 m_output << m_indent << paletteName <<
".setBrush("
1994 if (!versionAdded.isNull())
1995 m_output <<
"#endif\n";
2005 const bool solidColoredBrush = !
brush->hasAttributeBrushStyle() ||
brush->attributeBrushStyle() ==
"SolidPattern"_L1;
2007 if (solidColoredBrush) {
2009 rgb = ((
color->elementRed() & 0xFF) << 24) |
2010 ((
color->elementGreen() & 0xFF) << 16) |
2011 ((
color->elementBlue() & 0xFF) << 8) |
2012 ((
color->attributeAlpha() & 0xFF));
2014 if (cit != m_colorBrushHash.
constEnd())
2020 writeBrush(
brush, brushName);
2021 if (solidColoredBrush)
2022 m_colorBrushHash.
insert(
rgb, brushName);
2028 QString style = u
"SolidPattern"_s;
2029 if (
brush->hasAttributeBrushStyle())
2030 style =
brush->attributeBrushStyle();
2032 if (style ==
"LinearGradientPattern"_L1 ||
2033 style ==
"RadialGradientPattern"_L1 ||
2034 style ==
"ConicalGradientPattern"_L1) {
2037 const QString gradientName = m_driver->
unique(
"gradient"_L1);
2038 if (gradientType ==
"LinearGradient"_L1) {
2039 m_output << m_indent
2045 }
else if (gradientType ==
"RadialGradient"_L1) {
2046 m_output << m_indent
2053 }
else if (gradientType ==
"ConicalGradient"_L1) {
2054 m_output << m_indent
2061 m_output << m_indent << gradientName <<
".setSpread(QGradient"
2066 m_output << m_indent << gradientName <<
".setCoordinateMode(QGradient"
2074 m_output << m_indent << gradientName <<
".setColorAt("
2075 << stop->attributePosition() <<
", "
2078 m_output << m_indent
2081 }
else if (style ==
"TexturePattern"_L1) {
2085 m_output << m_indent
2090 m_output << m_indent
2094 m_output << m_indent << brushName <<
".setStyle("
2114 for (
int i=0;
i<l.size(); ++
i) {
2117 if (
name.isEmpty()) {
2118 fprintf(stderr,
"%s: Warning: Tab-stop assignment: '%s' is not a valid widget.\n",
2127 if (
name.isEmpty() || lastName.isEmpty())
2140 return writeIconProperties(
icon->elementIconSet());
2141 return pixCall(
icon);
2148 switch (
p->kind()) {
2151 s =
p->elementIconSet()->text();
2154 type =
"QPixmap"_L1;
2155 s =
p->elementPixmap()->text();
2158 qWarning(
"%s: Warning: Unknown icon format encountered. The ui-file was generated with a too-recent version of Qt Widgets Designer.",
2160 return "QIcon()"_L1;
2163 return pixCall(
type,
s);
2176 if (pixFunc.isEmpty())
2184void WriteInitialization::initializeComboBox(
DomWidget *
w)
2188 const auto &
items =
w->elementItem();
2201 iconValue = iconCall(
icon);
2205 m_output << iconValue <<
", ";
2210 <<
"setItemText(" <<
i <<
", " << trCall(
text->elementString())
2216 m_refreshOut <<
"\n";
2223 if (!
w->elementItem().isEmpty()) {
2224 tempName = m_driver->
unique(
"__sortingEnabled"_L1);
2225 m_refreshOut <<
"\n";
2226 m_refreshOut << m_indent;
2228 m_refreshOut <<
"const bool ";
2239 if (!
w->elementItem().isEmpty()) {
2241 <<
"setSortingEnabled(" << tempName <<
')' <<
language::eol <<
'\n';
2260void WriteInitialization::addInitializer(
Item *
item,
2263 if (!
value.isEmpty()) {
2270 item->addSetter(setter, directive, translatable);
2283void WriteInitialization::addStringInitializer(
Item *
item,
2297void WriteInitialization::addBrushInitializer(
Item *
item,
2301 if (
p->elementBrush())
2302 addInitializer(
item,
name,
column, writeBrushInitialization(
p->elementBrush()));
2303 else if (
p->elementColor())
2304 addInitializer(
item,
name,
column, domColor2QString(
p->elementColor()));
2312void WriteInitialization::addQtFlagsInitializer(
Item *
item,
2329void WriteInitialization::addQtEnumInitializer(
Item *
item,
2342void WriteInitialization::addCommonInitializers(
Item *
item,
2350 addInitializer(
item,
"font"_L1,
column, writeFontProperties(
font->elementFont()));
2362void WriteInitialization::initializeListWidget(
DomWidget *
w)
2366 const auto &
items =
w->elementItem();
2371 QString tempName = disableSorting(
w, varName);
2379 Item item(
"QListWidgetItem"_L1, m_indent, m_output, m_refreshOut, m_driver);
2383 item.writeSetupUi(varName);
2386 item.writeRetranslateUi(parentPath);
2388 enableSorting(
w, varName, tempName);
2391void WriteInitialization::initializeTreeWidget(
DomWidget *
w)
2396 Item item(
"QTreeWidgetItem"_L1, m_indent, m_output, m_refreshOut, m_driver);
2398 const auto &columns =
w->elementColumn();
2399 for (
int i = 0;
i < columns.size(); ++
i) {
2416 if (!itemName.isNull()) {
2421 if (
w->elementItem().empty())
2424 QString tempName = disableSorting(
w, varName);
2426 const auto items = initializeTreeWidgetItems(
w->elementItem());
2429 itm->writeSetupUi(varName);
2432 itm->writeRetranslateUi(parentPath);
2436 enableSorting(
w, varName, tempName);
2448WriteInitialization::Items WriteInitialization::initializeTreeWidgetItems(
const QList<DomItem *> &domItems)
2452 const int numDomItems = domItems.
size();
2455 for (
int i = 0;
i < numDomItems; ++
i) {
2456 const DomItem *domItem = domItems.at(
i);
2458 Item *
item =
new Item(
"QTreeWidgetItem"_L1, m_indent, m_output, m_refreshOut, m_driver);
2461 QHash<QString, DomProperty *>
map;
2466 if (
p->attributeName() ==
"text"_L1) {
2468 addCommonInitializers(
item,
map, col);
2475 addCommonInitializers(
item,
map, col);
2477 addQtFlagsInitializer(
item,
map,
"flags"_L1);
2479 const auto subItems = initializeTreeWidgetItems(domItem->
elementItem());
2480 for (
Item *subItem : subItems)
2481 item->addChild(subItem);
2486void WriteInitialization::initializeTableWidget(
DomWidget *
w)
2491 const auto &columns =
w->elementColumn();
2493 if (!columns.empty()) {
2495 <<
"columnCount() < " << columns.
size() <<
')';
2502 for (
int i = 0;
i < columns.size(); ++
i) {
2504 if (!
column->elementProperty().isEmpty()) {
2507 Item item(
"QTableWidgetItem"_L1, m_indent, m_output, m_refreshOut, m_driver);
2513 <<
"horizontalHeaderItem(" <<
i <<
')';
2514 item.writeRetranslateUi(parentPath);
2521 const auto &rows =
w->elementRow();
2523 if (!rows.isEmpty()) {
2525 <<
"rowCount() < " << rows.
size() <<
')';
2532 for (
int i = 0;
i < rows.size(); ++
i) {
2534 if (!
row->elementProperty().isEmpty()) {
2537 Item item(
"QTableWidgetItem"_L1, m_indent, m_output, m_refreshOut, m_driver);
2543 item.writeRetranslateUi(parentPath);
2550 QString tempName = disableSorting(
w, varName);
2552 const auto &
items =
w->elementItem();
2555 if (cell->hasAttributeRow() && cell->hasAttributeColumn() && !cell->elementProperty().isEmpty()) {
2556 const int r = cell->attributeRow();
2557 const int c = cell->attributeColumn();
2560 Item item(
"QTableWidgetItem"_L1, m_indent, m_output, m_refreshOut, m_driver);
2567 <<
", " <<
c <<
')';
2568 item.writeRetranslateUi(parentPath);
2573 enableSorting(
w, varName, tempName);
2586 if (idBasedTranslations || m_option.
idBased) {
2590 <<
'"' << m_generatedClass <<
"\", ";
2598 if (!idBasedTranslations && !m_option.
idBased) {
2600 if (commentHint.isEmpty())
2613 const QString menuAction = menuName +
"Action"_L1;
2617 m_output << m_indent << menuAction <<
" = " << menuName
2629 comment =
str->attributeComment();
2630 id =
str->attributeId();
2632 return trCall(
value, comment,
id);
2651 return trCall(
str, defaultString);
2652 return noTrCall(
str, defaultString);
2658 return autoTrOutput(
str);
2661 return m_refreshOut;
2668 return m_refreshOut;
2672WriteInitialization::Declaration WriteInitialization::findDeclaration(
const QString &
name)
2698 if (requiresStringSyntax.contains(sender.
className)
2699 || requiresStringSyntax.contains(receiver.
className)) {
2703 if ((sender.
name == m_mainFormVarName && m_customSignals.contains(sender.
signature))
2704 || (receiver.
name == m_mainFormVarName && m_customSlots.contains(receiver.
signature))) {
2718 const auto senderDecl = findDeclaration(senderName);
2719 const auto receiverDecl = findDeclaration(receiverName);
2721 if (senderDecl.name.isEmpty() || receiverDecl.name.isEmpty()) {
2724 <<
": Warning: Invalid signal/slot connection: \""
2725 << senderName <<
"\" -> \"" << receiverName <<
"\".";
2736 language::SignalSlotOptions signalOptions;
2738 language::SignalSlotOptions slotOptions;
2742 senderDecl.className, signalOptions};
2744 receiverDecl.className, slotOptions};
2746 m_output << m_indent;
2748 connectionSyntax(theSignal, theSlot));
2754 if (directives.isEmpty())
2757 if (directives.size() == 1) {
2762 auto list = directives.values();
2774 if (directives.isEmpty())
2777 outputStream <<
"#endif" <<
Qt::endl;
2782 m_itemClassName(itemClassName),
2784 m_setupUiStream(setupUiStream),
2785 m_retranslateUiStream(retranslateUiStream),
2791WriteInitialization::Item::~Item()
2796QString WriteInitialization::Item::writeSetupUi(
const QString &parent, Item::EmptyItemPolicy emptyItemPolicy)
2798 if (emptyItemPolicy == Item::DontConstruct && m_setupUiData.policy == ItemData::DontGenerate)
2801 bool generateMultiDirective =
false;
2802 if (emptyItemPolicy == Item::ConstructItemOnly && m_children.isEmpty()) {
2803 if (m_setupUiData.policy == ItemData::DontGenerate) {
2808 if (m_setupUiData.policy == ItemData::GenerateWithMultiDirective)
2809 generateMultiDirective =
true;
2812 if (generateMultiDirective)
2815 const QString uniqueName = m_driver->unique(
"__"_L1 + m_itemClassName.toLower());
2816 m_setupUiStream << m_indent;
2818 m_setupUiStream << m_itemClassName <<
" *";
2823 if (generateMultiDirective) {
2824 m_setupUiStream <<
"#else\n";
2831 while (
it != m_setupUiData.setters.
constEnd()) {
2844void WriteInitialization::Item::writeRetranslateUi(
const QString &parentPath)
2846 if (m_retranslateUiData.policy == ItemData::DontGenerate)
2849 if (m_retranslateUiData.policy == ItemData::GenerateWithMultiDirective)
2852 const QString uniqueName = m_driver->unique(
"___"_L1 + m_itemClassName.toLower());
2853 m_retranslateUiStream << m_indent;
2855 m_retranslateUiStream << m_itemClassName <<
" *";
2858 if (m_retranslateUiData.policy == ItemData::GenerateWithMultiDirective)
2863 while (
it != m_retranslateUiData.setters.
constEnd()) {
2865 if (oldDirective != newDirective) {
2866 if (!oldDirective.isEmpty())
2868 if (!newDirective.isEmpty())
2870 oldDirective = newDirective;
2875 if (!oldDirective.isEmpty())
2878 for (
int i = 0;
i < m_children.size();
i++) {
2881 m_children[
i]->writeRetranslateUi(
method);
2885void WriteInitialization::Item::addSetter(
const QString &setter,
const QString &directive,
bool translatable)
2887 const ItemData::TemporaryVariableGeneratorPolicy newPolicy = directive.
isNull() ? ItemData::Generate : ItemData::GenerateWithMultiDirective;
2889 m_retranslateUiData.setters.insert(directive, setter);
2890 if (ItemData::GenerateWithMultiDirective == newPolicy)
2891 m_retranslateUiData.directives << directive;
2892 if (m_retranslateUiData.policy < newPolicy)
2893 m_retranslateUiData.policy = newPolicy;
2895 m_setupUiData.setters.insert(directive, setter);
2896 if (ItemData::GenerateWithMultiDirective == newPolicy)
2897 m_setupUiData.directives << directive;
2898 if (m_setupUiData.policy < newPolicy)
2899 m_setupUiData.policy = newPolicy;
2903void WriteInitialization::Item::addChild(
Item *
child)
2905 m_children <<
child;
2906 child->m_parent =
this;
2911 p->m_setupUiData.directives |=
c->m_setupUiData.directives;
2912 p->m_retranslateUiData.directives |=
c->m_retranslateUiData.directives;
2913 if (
p->m_setupUiData.policy <
c->m_setupUiData.policy)
2914 p->m_setupUiData.policy =
c->m_setupUiData.policy;
2915 if (
p->m_retranslateUiData.policy <
c->m_retranslateUiData.policy)
2916 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
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 elementStrikeOut() const
QString elementHintingPreference() const
bool hasElementKerning() const
bool elementItalic() const
bool hasElementPointSize() const
bool hasElementHintingPreference() 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
DomString * elementString() 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
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
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
const_iterator constBegin() const noexcept
const_iterator constEnd() const noexcept
bool contains(const T &value) const
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...
QString mid(qsizetype position, qsizetype n=-1) const &
bool isEmpty() const noexcept
Returns true if the string has no characters; otherwise returns false.
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 noexcept
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...
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.
int compare(const QString &s, Qt::CaseSensitivity cs=Qt::CaseSensitive) const noexcept
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 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)
QTextStream & operator<<(QTextStream &str, const iconFromTheme &i)
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_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, qreal dpr)
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.
_stackVariable< true > stackVariableWithInitParameters
QString enumValue(const QString &value)
QLatin1StringView dockWidgetArea(int v)
QLatin1StringView paletteColorRole(int v)
_string< false > charliteral
QString fixClassName(QString className)
void formatConnection(QTextStream &str, const SignalSlot &sender, const SignalSlot &receiver, ConnectionSyntax connectionSyntax)
_stackVariable< false > stackVariable
QLatin1StringView toolbarArea(int v)
QLatin1StringView sizePolicy(int v)
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]
GLboolean GLboolean GLboolean GLboolean a
[7]
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
iconFromThemeStringLiteral(const QString &theme)
iconFromTheme(const QString &theme)
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)
QT_BEGIN_NAMESPACE bool toBool(const QString &str)
QHash< QString, DomProperty * > propertyMap(const QList< DomProperty * > &properties)