From 8e40050efed8bc5bf262123c59a36f6a47594bab Mon Sep 17 00:00:00 2001 From: Jarek Kobus Date: Tue, 4 Jul 2017 13:04:59 +0200 Subject: uic: Don't clear and readd combobox items in retranslateUi Task-number: QTBUG-61778 Change-Id: If7a15ef69fcfe459f177ff8b671f53a6022ab335 Reviewed-by: Friedemann Kleint Reviewed-by: Qt CI Bot --- src/tools/uic/cpp/cppwriteinitialization.cpp | 62 ++++++---------------- tests/auto/tools/uic/baseline/config.ui.h | 9 ++-- tests/auto/tools/uic/baseline/default.ui.h | 37 +++++++------ tests/auto/tools/uic/baseline/embeddeddialog.ui.h | 12 ++--- tests/auto/tools/uic/baseline/pagefold.ui.h | 43 ++++++++------- tests/auto/tools/uic/baseline/previewwidget.ui.h | 9 ++-- .../auto/tools/uic/baseline/stylesheeteditor.ui.h | 15 +++--- tests/auto/tools/uic/baseline/validators.ui.h | 12 ++--- .../tools/uic/baseline/wateringconfigdialog.ui.h | 40 ++++++++------ 9 files changed, 113 insertions(+), 126 deletions(-) diff --git a/src/tools/uic/cpp/cppwriteinitialization.cpp b/src/tools/uic/cpp/cppwriteinitialization.cpp index ad9e040824..cc7e8fc9e3 100644 --- a/src/tools/uic/cpp/cppwriteinitialization.cpp +++ b/src/tools/uic/cpp/cppwriteinitialization.cpp @@ -1899,63 +1899,34 @@ QString WriteInitialization::pixCall(const QString &t, const QString &text) cons void WriteInitialization::initializeComboBox(DomWidget *w) { const QString varName = m_driver->findOrInsertWidget(w); - const QString className = w->attributeClass(); const auto &items = w->elementItem(); if (items.isEmpty()) return; - // If possible use qcombobox's addItems() which is much faster then a bunch of addItem() calls - bool makeStringListCall = true; - bool translatable = false; - QStringList list; - for (int i=0; ielementProperty()); const DomProperty *text = properties.value(QLatin1String("text")); - const DomProperty *pixmap = properties.value(QLatin1String("icon")); - bool needsTr = needsTranslation(text->elementString()); - if (pixmap != 0 || (i > 0 && translatable != needsTr)) { - makeStringListCall = false; - break; - } - translatable = needsTr; - list.append(autoTrCall(text->elementString())); // fix me here - } + const DomProperty *icon = properties.value(QLatin1String("icon")); - if (makeStringListCall) { - QTextStream &o = translatable ? m_refreshOut : m_output; - if (translatable) - o << m_indent << varName << "->clear();\n"; - o << m_indent << varName << "->insertItems(0, QStringList()" << '\n'; - for (int i = 0; i < list.size(); ++i) - o << m_indent << " << " << list.at(i) << "\n"; - o << m_indent << ");\n"; - } else { - for (int i = 0; i < items.size(); ++i) { - const DomItem *item = items.at(i); - const DomPropertyMap properties = propertyMap(item->elementProperty()); - const DomProperty *text = properties.value(QLatin1String("text")); - const DomProperty *icon = properties.value(QLatin1String("icon")); - - QString iconValue; - if (icon) - iconValue = iconCall(icon); - - m_output << m_indent << varName << "->addItem("; - if (icon) - m_output << iconValue << ", "; - - if (needsTranslation(text->elementString())) { - m_output << "QString());\n"; - m_refreshOut << m_indent << varName << "->setItemText(" << i << ", " << trCall(text->elementString()) << ");\n"; - } else { - m_output << noTrCall(text->elementString()) << ");\n"; - } + QString iconValue; + if (icon) + iconValue = iconCall(icon); + + m_output << m_indent << varName << "->addItem("; + if (icon) + m_output << iconValue << ", "; + + if (needsTranslation(text->elementString())) { + m_output << "QString());\n"; + m_refreshOut << m_indent << varName << "->setItemText(" << i << ", " << trCall(text->elementString()) << ");\n"; + } else { + m_output << noTrCall(text->elementString()) << ");\n"; } - m_refreshOut << "\n"; } + m_refreshOut << "\n"; } QString WriteInitialization::disableSorting(DomWidget *w, const QString &varName) @@ -2090,7 +2061,6 @@ void WriteInitialization::addCommonInitializers(Item *item, void WriteInitialization::initializeListWidget(DomWidget *w) { const QString varName = m_driver->findOrInsertWidget(w); - const QString className = w->attributeClass(); const auto &items = w->elementItem(); diff --git a/tests/auto/tools/uic/baseline/config.ui.h b/tests/auto/tools/uic/baseline/config.ui.h index 2dadae383e..002eababb9 100644 --- a/tests/auto/tools/uic/baseline/config.ui.h +++ b/tests/auto/tools/uic/baseline/config.ui.h @@ -31,7 +31,7 @@ /******************************************************************************** ** Form generated from reading UI file 'config.ui' ** -** Created by: Qt User Interface Compiler version 5.0.0 +** Created by: Qt User Interface Compiler version 5.10.0 ** ** WARNING! All changes made in this file will be lost when recompiling UI file! ********************************************************************************/ @@ -286,6 +286,7 @@ public: hboxLayout2->addWidget(TextLabel1_3); skin = new QComboBox(Config); + skin->addItem(QString()); skin->setObjectName(QStringLiteral("skin")); QSizePolicy sizePolicy2(QSizePolicy::Expanding, QSizePolicy::Fixed); sizePolicy2.setHorizontalStretch(0); @@ -729,10 +730,8 @@ public: depth_32->setText(QApplication::translate("Config", "32 bit", Q_NULLPTR)); depth_32_argb->setText(QApplication::translate("Config", "32 bit ARGB", Q_NULLPTR)); TextLabel1_3->setText(QApplication::translate("Config", "Skin", Q_NULLPTR)); - skin->clear(); - skin->insertItems(0, QStringList() - << QApplication::translate("Config", "None", Q_NULLPTR) - ); + skin->setItemText(0, QApplication::translate("Config", "None", Q_NULLPTR)); + touchScreen->setText(QApplication::translate("Config", "Emulate touch screen (no mouse move)", Q_NULLPTR)); lcdScreen->setText(QApplication::translate("Config", "Emulate LCD screen (Only with fixed zoom of 3.0 times magnification)", Q_NULLPTR)); TextLabel1->setText(QApplication::translate("Config", "

Note that any applications using the virtual framebuffer will be terminated if you change the Size or Depth above. You may freely modify the Gamma below.", Q_NULLPTR)); diff --git a/tests/auto/tools/uic/baseline/default.ui.h b/tests/auto/tools/uic/baseline/default.ui.h index 03d97f86f1..e81f1bc2ca 100644 --- a/tests/auto/tools/uic/baseline/default.ui.h +++ b/tests/auto/tools/uic/baseline/default.ui.h @@ -1,7 +1,7 @@ /******************************************************************************** ** Form generated from reading UI file 'default.ui' ** -** Created by: Qt User Interface Compiler version 5.0.0 +** Created by: Qt User Interface Compiler version 5.10.0 ** ** WARNING! All changes made in this file will be lost when recompiling UI file! ********************************************************************************/ @@ -91,6 +91,10 @@ public: gridLayout->addWidget(nameLabel, 0, 0, 1, 1); nameCombo = new QComboBox(centralwidget); + nameCombo->addItem(QString()); + nameCombo->addItem(QString()); + nameCombo->addItem(QString()); + nameCombo->addItem(QString()); nameCombo->setObjectName(QStringLiteral("nameCombo")); nameCombo->setEditable(true); @@ -169,6 +173,11 @@ public: gridLayout->addWidget(professionList, 5, 1, 1, 3); countryCombo = new QComboBox(centralwidget); + countryCombo->addItem(QString()); + countryCombo->addItem(QString()); + countryCombo->addItem(QString()); + countryCombo->addItem(QString()); + countryCombo->addItem(QString()); countryCombo->setObjectName(QStringLiteral("countryCombo")); gridLayout->addWidget(countryCombo, 4, 1, 1, 3); @@ -225,13 +234,11 @@ public: editStyleAction->setText(QApplication::translate("MainWindow", "Edit &Style", Q_NULLPTR)); aboutAction->setText(QApplication::translate("MainWindow", "About", Q_NULLPTR)); nameLabel->setText(QApplication::translate("MainWindow", "&Name:", Q_NULLPTR)); - nameCombo->clear(); - nameCombo->insertItems(0, QStringList() - << QApplication::translate("MainWindow", "Girish", Q_NULLPTR) - << QApplication::translate("MainWindow", "Jasmin", Q_NULLPTR) - << QApplication::translate("MainWindow", "Simon", Q_NULLPTR) - << QApplication::translate("MainWindow", "Zack", Q_NULLPTR) - ); + nameCombo->setItemText(0, QApplication::translate("MainWindow", "Girish", Q_NULLPTR)); + nameCombo->setItemText(1, QApplication::translate("MainWindow", "Jasmin", Q_NULLPTR)); + nameCombo->setItemText(2, QApplication::translate("MainWindow", "Simon", Q_NULLPTR)); + nameCombo->setItemText(3, QApplication::translate("MainWindow", "Zack", Q_NULLPTR)); + #ifndef QT_NO_TOOLTIP nameCombo->setToolTip(QApplication::translate("MainWindow", "Specify your name", Q_NULLPTR)); #endif // QT_NO_TOOLTIP @@ -285,14 +292,12 @@ public: #ifndef QT_NO_WHATSTHIS professionList->setWhatsThis(QApplication::translate("MainWindow", "Select your profession", Q_NULLPTR)); #endif // QT_NO_WHATSTHIS - countryCombo->clear(); - countryCombo->insertItems(0, QStringList() - << QApplication::translate("MainWindow", "Germany", Q_NULLPTR) - << QApplication::translate("MainWindow", "India", Q_NULLPTR) - << QApplication::translate("MainWindow", "Norway", Q_NULLPTR) - << QApplication::translate("MainWindow", "United States Of America", Q_NULLPTR) - << QApplication::translate("MainWindow", "United Kingdom", Q_NULLPTR) - ); + countryCombo->setItemText(0, QApplication::translate("MainWindow", "Germany", Q_NULLPTR)); + countryCombo->setItemText(1, QApplication::translate("MainWindow", "India", Q_NULLPTR)); + countryCombo->setItemText(2, QApplication::translate("MainWindow", "Norway", Q_NULLPTR)); + countryCombo->setItemText(3, QApplication::translate("MainWindow", "United States Of America", Q_NULLPTR)); + countryCombo->setItemText(4, QApplication::translate("MainWindow", "United Kingdom", Q_NULLPTR)); + #ifndef QT_NO_TOOLTIP countryCombo->setToolTip(QApplication::translate("MainWindow", "Specify your country", Q_NULLPTR)); #endif // QT_NO_TOOLTIP diff --git a/tests/auto/tools/uic/baseline/embeddeddialog.ui.h b/tests/auto/tools/uic/baseline/embeddeddialog.ui.h index 69027286b6..446c5d54ff 100644 --- a/tests/auto/tools/uic/baseline/embeddeddialog.ui.h +++ b/tests/auto/tools/uic/baseline/embeddeddialog.ui.h @@ -1,7 +1,7 @@ /******************************************************************************** ** Form generated from reading UI file 'embeddeddialog.ui' ** -** Created by: Qt User Interface Compiler version 5.0.0 +** Created by: Qt User Interface Compiler version 5.10.0 ** ** WARNING! All changes made in this file will be lost when recompiling UI file! ********************************************************************************/ @@ -49,6 +49,8 @@ public: formLayout->setWidget(0, QFormLayout::LabelRole, label); layoutDirection = new QComboBox(embeddedDialog); + layoutDirection->addItem(QString()); + layoutDirection->addItem(QString()); layoutDirection->setObjectName(QStringLiteral("layoutDirection")); formLayout->setWidget(0, QFormLayout::FieldRole, layoutDirection); @@ -100,11 +102,9 @@ public: { embeddedDialog->setWindowTitle(QApplication::translate("embeddedDialog", "Embedded Dialog", Q_NULLPTR)); label->setText(QApplication::translate("embeddedDialog", "Layout Direction:", Q_NULLPTR)); - layoutDirection->clear(); - layoutDirection->insertItems(0, QStringList() - << QApplication::translate("embeddedDialog", "Left to Right", Q_NULLPTR) - << QApplication::translate("embeddedDialog", "Right to Left", Q_NULLPTR) - ); + layoutDirection->setItemText(0, QApplication::translate("embeddedDialog", "Left to Right", Q_NULLPTR)); + layoutDirection->setItemText(1, QApplication::translate("embeddedDialog", "Right to Left", Q_NULLPTR)); + label_2->setText(QApplication::translate("embeddedDialog", "Select Font:", Q_NULLPTR)); label_3->setText(QApplication::translate("embeddedDialog", "Style:", Q_NULLPTR)); label_4->setText(QApplication::translate("embeddedDialog", "Layout spacing:", Q_NULLPTR)); diff --git a/tests/auto/tools/uic/baseline/pagefold.ui.h b/tests/auto/tools/uic/baseline/pagefold.ui.h index b82c8d7fbd..5a6277089d 100644 --- a/tests/auto/tools/uic/baseline/pagefold.ui.h +++ b/tests/auto/tools/uic/baseline/pagefold.ui.h @@ -1,7 +1,7 @@ /******************************************************************************** ** Form generated from reading UI file 'pagefold.ui' ** -** Created by: Qt User Interface Compiler version 5.0.0 +** Created by: Qt User Interface Compiler version 5.10.0 ** ** WARNING! All changes made in this file will be lost when recompiling UI file! ********************************************************************************/ @@ -102,6 +102,10 @@ public: #endif gridLayout->setObjectName(QStringLiteral("gridLayout")); nameCombo = new QComboBox(mainFrame); + nameCombo->addItem(QString()); + nameCombo->addItem(QString()); + nameCombo->addItem(QString()); + nameCombo->addItem(QString()); nameCombo->setObjectName(QStringLiteral("nameCombo")); nameCombo->setEditable(true); @@ -180,6 +184,13 @@ public: gridLayout->addWidget(label, 5, 0, 1, 1); countryCombo = new QComboBox(mainFrame); + countryCombo->addItem(QString()); + countryCombo->addItem(QString()); + countryCombo->addItem(QString()); + countryCombo->addItem(QString()); + countryCombo->addItem(QString()); + countryCombo->addItem(QString()); + countryCombo->addItem(QString()); countryCombo->setObjectName(QStringLiteral("countryCombo")); gridLayout->addWidget(countryCombo, 4, 1, 1, 3); @@ -238,13 +249,11 @@ public: aboutQtAction->setText(QApplication::translate("MainWindow", "About Qt", Q_NULLPTR)); editStyleAction->setText(QApplication::translate("MainWindow", "Edit &Style", Q_NULLPTR)); aboutAction->setText(QApplication::translate("MainWindow", "About", Q_NULLPTR)); - nameCombo->clear(); - nameCombo->insertItems(0, QStringList() - << QApplication::translate("MainWindow", "Girish", Q_NULLPTR) - << QApplication::translate("MainWindow", "Jasmin", Q_NULLPTR) - << QApplication::translate("MainWindow", "Simon", Q_NULLPTR) - << QApplication::translate("MainWindow", "Zack", Q_NULLPTR) - ); + nameCombo->setItemText(0, QApplication::translate("MainWindow", "Girish", Q_NULLPTR)); + nameCombo->setItemText(1, QApplication::translate("MainWindow", "Jasmin", Q_NULLPTR)); + nameCombo->setItemText(2, QApplication::translate("MainWindow", "Simon", Q_NULLPTR)); + nameCombo->setItemText(3, QApplication::translate("MainWindow", "Zack", Q_NULLPTR)); + #ifndef QT_NO_TOOLTIP nameCombo->setToolTip(QApplication::translate("MainWindow", "Specify your name", Q_NULLPTR)); #endif // QT_NO_TOOLTIP @@ -296,16 +305,14 @@ public: professionList->setWhatsThis(QApplication::translate("MainWindow", "Specify your name here", Q_NULLPTR)); #endif // QT_NO_WHATSTHIS label->setText(QApplication::translate("MainWindow", "Profession:", Q_NULLPTR)); - countryCombo->clear(); - countryCombo->insertItems(0, QStringList() - << QApplication::translate("MainWindow", "Egypt", Q_NULLPTR) - << QApplication::translate("MainWindow", "France", Q_NULLPTR) - << QApplication::translate("MainWindow", "Germany", Q_NULLPTR) - << QApplication::translate("MainWindow", "India", Q_NULLPTR) - << QApplication::translate("MainWindow", "Italy", Q_NULLPTR) - << QApplication::translate("MainWindow", "Korea", Q_NULLPTR) - << QApplication::translate("MainWindow", "Norway", Q_NULLPTR) - ); + countryCombo->setItemText(0, QApplication::translate("MainWindow", "Egypt", Q_NULLPTR)); + countryCombo->setItemText(1, QApplication::translate("MainWindow", "France", Q_NULLPTR)); + countryCombo->setItemText(2, QApplication::translate("MainWindow", "Germany", Q_NULLPTR)); + countryCombo->setItemText(3, QApplication::translate("MainWindow", "India", Q_NULLPTR)); + countryCombo->setItemText(4, QApplication::translate("MainWindow", "Italy", Q_NULLPTR)); + countryCombo->setItemText(5, QApplication::translate("MainWindow", "Korea", Q_NULLPTR)); + countryCombo->setItemText(6, QApplication::translate("MainWindow", "Norway", Q_NULLPTR)); + #ifndef QT_NO_TOOLTIP countryCombo->setToolTip(QApplication::translate("MainWindow", "Specify country of origin", Q_NULLPTR)); #endif // QT_NO_TOOLTIP diff --git a/tests/auto/tools/uic/baseline/previewwidget.ui.h b/tests/auto/tools/uic/baseline/previewwidget.ui.h index 1fb96c8c70..f537924ca9 100644 --- a/tests/auto/tools/uic/baseline/previewwidget.ui.h +++ b/tests/auto/tools/uic/baseline/previewwidget.ui.h @@ -31,7 +31,7 @@ /******************************************************************************** ** Form generated from reading UI file 'previewwidget.ui' ** -** Created by: Qt User Interface Compiler version 5.0.0 +** Created by: Qt User Interface Compiler version 5.10.0 ** ** WARNING! All changes made in this file will be lost when recompiling UI file! ********************************************************************************/ @@ -122,6 +122,7 @@ public: vboxLayout->addWidget(LineEdit1); ComboBox1 = new QComboBox(qdesigner_internal__PreviewWidget); + ComboBox1->addItem(QString()); ComboBox1->setObjectName(QStringLiteral("ComboBox1")); vboxLayout->addWidget(ComboBox1); @@ -239,10 +240,8 @@ public: { qdesigner_internal__PreviewWidget->setWindowTitle(QApplication::translate("qdesigner_internal::PreviewWidget", "Preview Window", Q_NULLPTR)); LineEdit1->setText(QApplication::translate("qdesigner_internal::PreviewWidget", "LineEdit", Q_NULLPTR)); - ComboBox1->clear(); - ComboBox1->insertItems(0, QStringList() - << QApplication::translate("qdesigner_internal::PreviewWidget", "ComboBox", Q_NULLPTR) - ); + ComboBox1->setItemText(0, QApplication::translate("qdesigner_internal::PreviewWidget", "ComboBox", Q_NULLPTR)); + PushButton1->setText(QApplication::translate("qdesigner_internal::PreviewWidget", "PushButton", Q_NULLPTR)); ButtonGroup2->setTitle(QApplication::translate("qdesigner_internal::PreviewWidget", "ButtonGroup2", Q_NULLPTR)); CheckBox1->setText(QApplication::translate("qdesigner_internal::PreviewWidget", "CheckBox1", Q_NULLPTR)); diff --git a/tests/auto/tools/uic/baseline/stylesheeteditor.ui.h b/tests/auto/tools/uic/baseline/stylesheeteditor.ui.h index 94ffa45509..d7b6f38d1e 100644 --- a/tests/auto/tools/uic/baseline/stylesheeteditor.ui.h +++ b/tests/auto/tools/uic/baseline/stylesheeteditor.ui.h @@ -1,7 +1,7 @@ /******************************************************************************** ** Form generated from reading UI file 'stylesheeteditor.ui' ** -** Created by: Qt User Interface Compiler version 5.0.0 +** Created by: Qt User Interface Compiler version 5.10.0 ** ** WARNING! All changes made in this file will be lost when recompiling UI file! ********************************************************************************/ @@ -63,6 +63,9 @@ public: gridLayout->addItem(spacerItem1, 0, 0, 1, 1); styleSheetCombo = new QComboBox(StyleSheetEditor); + styleSheetCombo->addItem(QString()); + styleSheetCombo->addItem(QString()); + styleSheetCombo->addItem(QString()); styleSheetCombo->setObjectName(QStringLiteral("styleSheetCombo")); gridLayout->addWidget(styleSheetCombo, 0, 5, 1, 1); @@ -131,12 +134,10 @@ public: void retranslateUi(QWidget *StyleSheetEditor) { StyleSheetEditor->setWindowTitle(QApplication::translate("StyleSheetEditor", "Style Editor", Q_NULLPTR)); - styleSheetCombo->clear(); - styleSheetCombo->insertItems(0, QStringList() - << QApplication::translate("StyleSheetEditor", "Default", Q_NULLPTR) - << QApplication::translate("StyleSheetEditor", "Coffee", Q_NULLPTR) - << QApplication::translate("StyleSheetEditor", "Pagefold", Q_NULLPTR) - ); + styleSheetCombo->setItemText(0, QApplication::translate("StyleSheetEditor", "Default", Q_NULLPTR)); + styleSheetCombo->setItemText(1, QApplication::translate("StyleSheetEditor", "Coffee", Q_NULLPTR)); + styleSheetCombo->setItemText(2, QApplication::translate("StyleSheetEditor", "Pagefold", Q_NULLPTR)); + label_7->setText(QApplication::translate("StyleSheetEditor", "Style:", Q_NULLPTR)); applyButton->setText(QApplication::translate("StyleSheetEditor", "&Apply", Q_NULLPTR)); label_8->setText(QApplication::translate("StyleSheetEditor", "Style Sheet:", Q_NULLPTR)); diff --git a/tests/auto/tools/uic/baseline/validators.ui.h b/tests/auto/tools/uic/baseline/validators.ui.h index e8548f1454..fab7e41e0e 100644 --- a/tests/auto/tools/uic/baseline/validators.ui.h +++ b/tests/auto/tools/uic/baseline/validators.ui.h @@ -1,7 +1,7 @@ /******************************************************************************** ** Form generated from reading UI file 'validators.ui' ** -** Created by: Qt User Interface Compiler version 5.0.0 +** Created by: Qt User Interface Compiler version 5.10.0 ** ** WARNING! All changes made in this file will be lost when recompiling UI file! ********************************************************************************/ @@ -268,6 +268,8 @@ public: gridLayout1->addWidget(label_5, 0, 2, 1, 1); doubleFormat = new QComboBox(groupBox_2); + doubleFormat->addItem(QString()); + doubleFormat->addItem(QString()); doubleFormat->setObjectName(QStringLiteral("doubleFormat")); gridLayout1->addWidget(doubleFormat, 0, 3, 1, 1); @@ -384,11 +386,9 @@ public: groupBox_2->setTitle(QApplication::translate("ValidatorsForm", "QDoubleValidator", Q_NULLPTR)); label_3->setText(QApplication::translate("ValidatorsForm", "Min:", Q_NULLPTR)); label_5->setText(QApplication::translate("ValidatorsForm", "Format:", Q_NULLPTR)); - doubleFormat->clear(); - doubleFormat->insertItems(0, QStringList() - << QApplication::translate("ValidatorsForm", "Standard", Q_NULLPTR) - << QApplication::translate("ValidatorsForm", "Scientific", Q_NULLPTR) - ); + doubleFormat->setItemText(0, QApplication::translate("ValidatorsForm", "Standard", Q_NULLPTR)); + doubleFormat->setItemText(1, QApplication::translate("ValidatorsForm", "Scientific", Q_NULLPTR)); + label_4->setText(QApplication::translate("ValidatorsForm", "Max:", Q_NULLPTR)); label_6->setText(QApplication::translate("ValidatorsForm", "Decimals:", Q_NULLPTR)); doubleLedWidget->setText(QString()); diff --git a/tests/auto/tools/uic/baseline/wateringconfigdialog.ui.h b/tests/auto/tools/uic/baseline/wateringconfigdialog.ui.h index 348a83a8da..c84a6e2631 100644 --- a/tests/auto/tools/uic/baseline/wateringconfigdialog.ui.h +++ b/tests/auto/tools/uic/baseline/wateringconfigdialog.ui.h @@ -1,7 +1,7 @@ /******************************************************************************** ** Form generated from reading UI file 'wateringconfigdialog.ui' ** -** Created by: Qt User Interface Compiler version 5.0.0 +** Created by: Qt User Interface Compiler version 5.10.0 ** ** WARNING! All changes made in this file will be lost when recompiling UI file! ********************************************************************************/ @@ -79,6 +79,12 @@ public: gridLayout->addWidget(label_3, 0, 0, 1, 1); plantComboBox = new QComboBox(WateringConfigDialog); + plantComboBox->addItem(QString()); + plantComboBox->addItem(QString()); + plantComboBox->addItem(QString()); + plantComboBox->addItem(QString()); + plantComboBox->addItem(QString()); + plantComboBox->addItem(QString()); plantComboBox->setObjectName(QStringLiteral("plantComboBox")); QSizePolicy sizePolicy(QSizePolicy::Preferred, QSizePolicy::Fixed); sizePolicy.setHorizontalStretch(0); @@ -173,6 +179,10 @@ public: gridLayout->addWidget(label_5, 10, 0, 1, 1); sourceComboBox = new QComboBox(WateringConfigDialog); + sourceComboBox->addItem(QString()); + sourceComboBox->addItem(QString()); + sourceComboBox->addItem(QString()); + sourceComboBox->addItem(QString()); sourceComboBox->setObjectName(QStringLiteral("sourceComboBox")); gridLayout->addWidget(sourceComboBox, 10, 1, 1, 3); @@ -245,15 +255,13 @@ public: { WateringConfigDialog->setWindowTitle(QApplication::translate("WateringConfigDialog", "Watering Configuration", Q_NULLPTR)); label_3->setText(QApplication::translate("WateringConfigDialog", "Plant:", Q_NULLPTR)); - plantComboBox->clear(); - plantComboBox->insertItems(0, QStringList() - << QApplication::translate("WateringConfigDialog", "Squash", Q_NULLPTR) - << QApplication::translate("WateringConfigDialog", "Bean", Q_NULLPTR) - << QApplication::translate("WateringConfigDialog", "Carrot", Q_NULLPTR) - << QApplication::translate("WateringConfigDialog", "Strawberry", Q_NULLPTR) - << QApplication::translate("WateringConfigDialog", "Raspberry", Q_NULLPTR) - << QApplication::translate("WateringConfigDialog", "Blueberry", Q_NULLPTR) - ); + plantComboBox->setItemText(0, QApplication::translate("WateringConfigDialog", "Squash", Q_NULLPTR)); + plantComboBox->setItemText(1, QApplication::translate("WateringConfigDialog", "Bean", Q_NULLPTR)); + plantComboBox->setItemText(2, QApplication::translate("WateringConfigDialog", "Carrot", Q_NULLPTR)); + plantComboBox->setItemText(3, QApplication::translate("WateringConfigDialog", "Strawberry", Q_NULLPTR)); + plantComboBox->setItemText(4, QApplication::translate("WateringConfigDialog", "Raspberry", Q_NULLPTR)); + plantComboBox->setItemText(5, QApplication::translate("WateringConfigDialog", "Blueberry", Q_NULLPTR)); + label_2->setText(QApplication::translate("WateringConfigDialog", "Water when:", Q_NULLPTR)); temperatureCheckBox->setText(QApplication::translate("WateringConfigDialog", "Temperature is higher than:", Q_NULLPTR)); temperatureSpinBox->setSpecialValueText(QString()); @@ -265,13 +273,11 @@ public: label_4->setText(QApplication::translate("WateringConfigDialog", "Amount:", Q_NULLPTR)); amountSpinBox->setSuffix(QApplication::translate("WateringConfigDialog", "l", Q_NULLPTR)); label_5->setText(QApplication::translate("WateringConfigDialog", "Source:", Q_NULLPTR)); - sourceComboBox->clear(); - sourceComboBox->insertItems(0, QStringList() - << QApplication::translate("WateringConfigDialog", "Foundain", Q_NULLPTR) - << QApplication::translate("WateringConfigDialog", "River", Q_NULLPTR) - << QApplication::translate("WateringConfigDialog", "Lake", Q_NULLPTR) - << QApplication::translate("WateringConfigDialog", "Public Water System", Q_NULLPTR) - ); + sourceComboBox->setItemText(0, QApplication::translate("WateringConfigDialog", "Foundain", Q_NULLPTR)); + sourceComboBox->setItemText(1, QApplication::translate("WateringConfigDialog", "River", Q_NULLPTR)); + sourceComboBox->setItemText(2, QApplication::translate("WateringConfigDialog", "Lake", Q_NULLPTR)); + sourceComboBox->setItemText(3, QApplication::translate("WateringConfigDialog", "Public Water System", Q_NULLPTR)); + label_6->setText(QApplication::translate("WateringConfigDialog", "Filter:", Q_NULLPTR)); filterCheckBox->setText(QString()); helpLabel->setText(QApplication::translate("WateringConfigDialog", "Show Details", Q_NULLPTR)); -- cgit v1.2.3