diff options
author | Marc Mutz <marc.mutz@kdab.com> | 2011-12-11 16:55:01 +0100 |
---|---|---|
committer | Qt by Nokia <qt-info@nokia.com> | 2012-02-20 15:17:08 +0100 |
commit | 49b08f96e824f49fab9aa5c9a1a0ed582d4558bb (patch) | |
tree | b9e1df0b1a332a78ce1ef9cf0d90265098c9e414 /tests/auto/tools/uic/baseline/default.ui.h | |
parent | ac1689245419a6fd44e3250d2fdf3d3a058a0c17 (diff) |
uic: use QStringLiteral() instead of QString::fromUtf8() where applicable
Many (most?) strings written aren't in fact UTF-8, and we can check at
compile-time which are and which aren't, so don't hard-code fromUtf8()
but use the much more efficient QStringLiteral() where applicable.
This is low-hanging fruit. This patch only optimises US-ASCII string
literals, not those that are latin-1 or even UTF-8, because that would
require more extensive changes to the original fixString() function.
Likewise, there are also other calls to QString::fromUtf8() being
generated (e.g. in the pixmap code) that could benefit from being
turned into QStringLiterals, but their code paths are more involved
than those this patch fixes.
This patch at least suffices in turning all the setObjectName()
arguments into QStringLiterals, which was the main goal.
The autotest baseline has been updated with the new expected results.
Change-Id: Ic1ef67f500f9ff92d36164d515f4e004ef2a10bc
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
Diffstat (limited to 'tests/auto/tools/uic/baseline/default.ui.h')
-rw-r--r-- | tests/auto/tools/uic/baseline/default.ui.h | 52 |
1 files changed, 26 insertions, 26 deletions
diff --git a/tests/auto/tools/uic/baseline/default.ui.h b/tests/auto/tools/uic/baseline/default.ui.h index 685fa0b476..0bde249375 100644 --- a/tests/auto/tools/uic/baseline/default.ui.h +++ b/tests/auto/tools/uic/baseline/default.ui.h @@ -66,18 +66,18 @@ public: void setupUi(QMainWindow *MainWindow) { if (MainWindow->objectName().isEmpty()) - MainWindow->setObjectName(QString::fromUtf8("MainWindow")); + MainWindow->setObjectName(QStringLiteral("MainWindow")); MainWindow->resize(388, 413); exitAction = new QAction(MainWindow); - exitAction->setObjectName(QString::fromUtf8("exitAction")); + exitAction->setObjectName(QStringLiteral("exitAction")); aboutQtAction = new QAction(MainWindow); - aboutQtAction->setObjectName(QString::fromUtf8("aboutQtAction")); + aboutQtAction->setObjectName(QStringLiteral("aboutQtAction")); editStyleAction = new QAction(MainWindow); - editStyleAction->setObjectName(QString::fromUtf8("editStyleAction")); + editStyleAction->setObjectName(QStringLiteral("editStyleAction")); aboutAction = new QAction(MainWindow); - aboutAction->setObjectName(QString::fromUtf8("aboutAction")); + aboutAction->setObjectName(QStringLiteral("aboutAction")); centralwidget = new QWidget(MainWindow); - centralwidget->setObjectName(QString::fromUtf8("centralwidget")); + centralwidget->setObjectName(QStringLiteral("centralwidget")); gridLayout = new QGridLayout(centralwidget); #ifndef Q_OS_MAC gridLayout->setSpacing(6); @@ -85,14 +85,14 @@ public: #ifndef Q_OS_MAC gridLayout->setContentsMargins(9, 9, 9, 9); #endif - gridLayout->setObjectName(QString::fromUtf8("gridLayout")); + gridLayout->setObjectName(QStringLiteral("gridLayout")); nameLabel = new QLabel(centralwidget); - nameLabel->setObjectName(QString::fromUtf8("nameLabel")); + nameLabel->setObjectName(QStringLiteral("nameLabel")); gridLayout->addWidget(nameLabel, 0, 0, 1, 1); nameCombo = new QComboBox(centralwidget); - nameCombo->setObjectName(QString::fromUtf8("nameCombo")); + nameCombo->setObjectName(QStringLiteral("nameCombo")); nameCombo->setEditable(true); gridLayout->addWidget(nameCombo, 0, 1, 1, 3); @@ -102,62 +102,62 @@ public: gridLayout->addItem(spacerItem, 1, 3, 1, 1); femaleRadioButton = new QRadioButton(centralwidget); - femaleRadioButton->setObjectName(QString::fromUtf8("femaleRadioButton")); + femaleRadioButton->setObjectName(QStringLiteral("femaleRadioButton")); gridLayout->addWidget(femaleRadioButton, 1, 2, 1, 1); agreeCheckBox = new QCheckBox(centralwidget); - agreeCheckBox->setObjectName(QString::fromUtf8("agreeCheckBox")); + agreeCheckBox->setObjectName(QStringLiteral("agreeCheckBox")); gridLayout->addWidget(agreeCheckBox, 6, 0, 1, 4); maleRadioButton = new QRadioButton(centralwidget); - maleRadioButton->setObjectName(QString::fromUtf8("maleRadioButton")); + maleRadioButton->setObjectName(QStringLiteral("maleRadioButton")); gridLayout->addWidget(maleRadioButton, 1, 1, 1, 1); genderLabel = new QLabel(centralwidget); - genderLabel->setObjectName(QString::fromUtf8("genderLabel")); + genderLabel->setObjectName(QStringLiteral("genderLabel")); gridLayout->addWidget(genderLabel, 1, 0, 1, 1); ageSpinBox = new QSpinBox(centralwidget); - ageSpinBox->setObjectName(QString::fromUtf8("ageSpinBox")); + ageSpinBox->setObjectName(QStringLiteral("ageSpinBox")); ageSpinBox->setMinimum(12); ageSpinBox->setValue(22); gridLayout->addWidget(ageSpinBox, 2, 1, 1, 3); buttonBox = new QDialogButtonBox(centralwidget); - buttonBox->setObjectName(QString::fromUtf8("buttonBox")); + buttonBox->setObjectName(QStringLiteral("buttonBox")); buttonBox->setOrientation(Qt::Horizontal); buttonBox->setStandardButtons(QDialogButtonBox::Cancel|QDialogButtonBox::NoButton|QDialogButtonBox::Ok); gridLayout->addWidget(buttonBox, 7, 2, 1, 2); ageLabel = new QLabel(centralwidget); - ageLabel->setObjectName(QString::fromUtf8("ageLabel")); + ageLabel->setObjectName(QStringLiteral("ageLabel")); gridLayout->addWidget(ageLabel, 2, 0, 1, 1); passwordLabel = new QLabel(centralwidget); - passwordLabel->setObjectName(QString::fromUtf8("passwordLabel")); + passwordLabel->setObjectName(QStringLiteral("passwordLabel")); gridLayout->addWidget(passwordLabel, 3, 0, 1, 1); passwordEdit = new QLineEdit(centralwidget); - passwordEdit->setObjectName(QString::fromUtf8("passwordEdit")); + passwordEdit->setObjectName(QStringLiteral("passwordEdit")); passwordEdit->setEchoMode(QLineEdit::Password); gridLayout->addWidget(passwordEdit, 3, 1, 1, 3); label = new QLabel(centralwidget); - label->setObjectName(QString::fromUtf8("label")); + label->setObjectName(QStringLiteral("label")); gridLayout->addWidget(label, 5, 0, 1, 1); countryLabel = new QLabel(centralwidget); - countryLabel->setObjectName(QString::fromUtf8("countryLabel")); + countryLabel->setObjectName(QStringLiteral("countryLabel")); gridLayout->addWidget(countryLabel, 4, 0, 1, 1); @@ -165,26 +165,26 @@ public: new QListWidgetItem(professionList); new QListWidgetItem(professionList); new QListWidgetItem(professionList); - professionList->setObjectName(QString::fromUtf8("professionList")); + professionList->setObjectName(QStringLiteral("professionList")); gridLayout->addWidget(professionList, 5, 1, 1, 3); countryCombo = new QComboBox(centralwidget); - countryCombo->setObjectName(QString::fromUtf8("countryCombo")); + countryCombo->setObjectName(QStringLiteral("countryCombo")); gridLayout->addWidget(countryCombo, 4, 1, 1, 3); MainWindow->setCentralWidget(centralwidget); menubar = new QMenuBar(MainWindow); - menubar->setObjectName(QString::fromUtf8("menubar")); + menubar->setObjectName(QStringLiteral("menubar")); menubar->setGeometry(QRect(0, 0, 388, 21)); menu_File = new QMenu(menubar); - menu_File->setObjectName(QString::fromUtf8("menu_File")); + menu_File->setObjectName(QStringLiteral("menu_File")); menu_Help = new QMenu(menubar); - menu_Help->setObjectName(QString::fromUtf8("menu_Help")); + menu_Help->setObjectName(QStringLiteral("menu_Help")); MainWindow->setMenuBar(menubar); statusbar = new QStatusBar(MainWindow); - statusbar->setObjectName(QString::fromUtf8("statusbar")); + statusbar->setObjectName(QStringLiteral("statusbar")); MainWindow->setStatusBar(statusbar); #ifndef QT_NO_SHORTCUT nameLabel->setBuddy(nameCombo); |