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/mainwindow.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/mainwindow.ui.h')
-rw-r--r-- | tests/auto/tools/uic/baseline/mainwindow.ui.h | 88 |
1 files changed, 44 insertions, 44 deletions
diff --git a/tests/auto/tools/uic/baseline/mainwindow.ui.h b/tests/auto/tools/uic/baseline/mainwindow.ui.h index ef6f4cfe9c..4e336a4262 100644 --- a/tests/auto/tools/uic/baseline/mainwindow.ui.h +++ b/tests/auto/tools/uic/baseline/mainwindow.ui.h @@ -89,14 +89,14 @@ public: void setupUi(QMainWindow *MainWindow) { if (MainWindow->objectName().isEmpty()) - MainWindow->setObjectName(QString::fromUtf8("MainWindow")); + MainWindow->setObjectName(QStringLiteral("MainWindow")); MainWindow->resize(829, 813); actionAdd_Custom_Font = new QAction(MainWindow); - actionAdd_Custom_Font->setObjectName(QString::fromUtf8("actionAdd_Custom_Font")); + actionAdd_Custom_Font->setObjectName(QStringLiteral("actionAdd_Custom_Font")); action_Exit = new QAction(MainWindow); - action_Exit->setObjectName(QString::fromUtf8("action_Exit")); + action_Exit->setObjectName(QStringLiteral("action_Exit")); centralwidget = new QWidget(MainWindow); - centralwidget->setObjectName(QString::fromUtf8("centralwidget")); + centralwidget->setObjectName(QStringLiteral("centralwidget")); vboxLayout = new QVBoxLayout(centralwidget); #ifndef Q_OS_MAC vboxLayout->setSpacing(6); @@ -104,9 +104,9 @@ public: #ifndef Q_OS_MAC vboxLayout->setContentsMargins(9, 9, 9, 9); #endif - vboxLayout->setObjectName(QString::fromUtf8("vboxLayout")); + vboxLayout->setObjectName(QStringLiteral("vboxLayout")); groupBox = new QGroupBox(centralwidget); - groupBox->setObjectName(QString::fromUtf8("groupBox")); + groupBox->setObjectName(QStringLiteral("groupBox")); hboxLayout = new QHBoxLayout(groupBox); #ifndef Q_OS_MAC hboxLayout->setSpacing(6); @@ -114,40 +114,40 @@ public: #ifndef Q_OS_MAC hboxLayout->setContentsMargins(9, 9, 9, 9); #endif - hboxLayout->setObjectName(QString::fromUtf8("hboxLayout")); + hboxLayout->setObjectName(QStringLiteral("hboxLayout")); label = new QLabel(groupBox); - label->setObjectName(QString::fromUtf8("label")); + label->setObjectName(QStringLiteral("label")); hboxLayout->addWidget(label); fontComboBox = new QFontComboBox(groupBox); - fontComboBox->setObjectName(QString::fromUtf8("fontComboBox")); + fontComboBox->setObjectName(QStringLiteral("fontComboBox")); hboxLayout->addWidget(fontComboBox); label_2 = new QLabel(groupBox); - label_2->setObjectName(QString::fromUtf8("label_2")); + label_2->setObjectName(QStringLiteral("label_2")); hboxLayout->addWidget(label_2); pixelSize = new QSpinBox(groupBox); - pixelSize->setObjectName(QString::fromUtf8("pixelSize")); + pixelSize->setObjectName(QStringLiteral("pixelSize")); pixelSize->setMinimum(1); hboxLayout->addWidget(pixelSize); label_7 = new QLabel(groupBox); - label_7->setObjectName(QString::fromUtf8("label_7")); + label_7->setObjectName(QStringLiteral("label_7")); hboxLayout->addWidget(label_7); weightCombo = new QComboBox(groupBox); - weightCombo->setObjectName(QString::fromUtf8("weightCombo")); + weightCombo->setObjectName(QStringLiteral("weightCombo")); hboxLayout->addWidget(weightCombo); italic = new QCheckBox(groupBox); - italic->setObjectName(QString::fromUtf8("italic")); + italic->setObjectName(QStringLiteral("italic")); hboxLayout->addWidget(italic); @@ -159,7 +159,7 @@ public: vboxLayout->addWidget(groupBox); groupBox_2 = new QGroupBox(centralwidget); - groupBox_2->setObjectName(QString::fromUtf8("groupBox_2")); + groupBox_2->setObjectName(QStringLiteral("groupBox_2")); vboxLayout1 = new QVBoxLayout(groupBox_2); #ifndef Q_OS_MAC vboxLayout1->setSpacing(6); @@ -167,9 +167,9 @@ public: #ifndef Q_OS_MAC vboxLayout1->setContentsMargins(9, 9, 9, 9); #endif - vboxLayout1->setObjectName(QString::fromUtf8("vboxLayout1")); + vboxLayout1->setObjectName(QStringLiteral("vboxLayout1")); chooseFromCodePoints = new QRadioButton(groupBox_2); - chooseFromCodePoints->setObjectName(QString::fromUtf8("chooseFromCodePoints")); + chooseFromCodePoints->setObjectName(QStringLiteral("chooseFromCodePoints")); chooseFromCodePoints->setChecked(true); vboxLayout1->addWidget(chooseFromCodePoints); @@ -179,9 +179,9 @@ public: vboxLayout2->setSpacing(6); #endif vboxLayout2->setContentsMargins(0, 0, 0, 0); - vboxLayout2->setObjectName(QString::fromUtf8("vboxLayout2")); + vboxLayout2->setObjectName(QStringLiteral("vboxLayout2")); characterRangeView = new QListWidget(groupBox_2); - characterRangeView->setObjectName(QString::fromUtf8("characterRangeView")); + characterRangeView->setObjectName(QStringLiteral("characterRangeView")); vboxLayout2->addWidget(characterRangeView); @@ -190,19 +190,19 @@ public: hboxLayout1->setSpacing(6); #endif hboxLayout1->setContentsMargins(0, 0, 0, 0); - hboxLayout1->setObjectName(QString::fromUtf8("hboxLayout1")); + hboxLayout1->setObjectName(QStringLiteral("hboxLayout1")); selectAll = new QPushButton(groupBox_2); - selectAll->setObjectName(QString::fromUtf8("selectAll")); + selectAll->setObjectName(QStringLiteral("selectAll")); hboxLayout1->addWidget(selectAll); deselectAll = new QPushButton(groupBox_2); - deselectAll->setObjectName(QString::fromUtf8("deselectAll")); + deselectAll->setObjectName(QStringLiteral("deselectAll")); hboxLayout1->addWidget(deselectAll); invertSelection = new QPushButton(groupBox_2); - invertSelection->setObjectName(QString::fromUtf8("invertSelection")); + invertSelection->setObjectName(QStringLiteral("invertSelection")); hboxLayout1->addWidget(invertSelection); @@ -217,7 +217,7 @@ public: vboxLayout1->addLayout(vboxLayout2); chooseFromSampleFile = new QRadioButton(groupBox_2); - chooseFromSampleFile->setObjectName(QString::fromUtf8("chooseFromSampleFile")); + chooseFromSampleFile->setObjectName(QStringLiteral("chooseFromSampleFile")); vboxLayout1->addWidget(chooseFromSampleFile); @@ -226,27 +226,27 @@ public: hboxLayout2->setSpacing(6); #endif hboxLayout2->setContentsMargins(0, 0, 0, 0); - hboxLayout2->setObjectName(QString::fromUtf8("hboxLayout2")); + hboxLayout2->setObjectName(QStringLiteral("hboxLayout2")); label_5 = new QLabel(groupBox_2); - label_5->setObjectName(QString::fromUtf8("label_5")); + label_5->setObjectName(QStringLiteral("label_5")); label_5->setEnabled(false); hboxLayout2->addWidget(label_5); sampleFile = new QLineEdit(groupBox_2); - sampleFile->setObjectName(QString::fromUtf8("sampleFile")); + sampleFile->setObjectName(QStringLiteral("sampleFile")); sampleFile->setEnabled(false); hboxLayout2->addWidget(sampleFile); browseSampleFile = new QPushButton(groupBox_2); - browseSampleFile->setObjectName(QString::fromUtf8("browseSampleFile")); + browseSampleFile->setObjectName(QStringLiteral("browseSampleFile")); browseSampleFile->setEnabled(false); hboxLayout2->addWidget(browseSampleFile); charCount = new QLabel(groupBox_2); - charCount->setObjectName(QString::fromUtf8("charCount")); + charCount->setObjectName(QStringLiteral("charCount")); charCount->setEnabled(false); hboxLayout2->addWidget(charCount); @@ -258,7 +258,7 @@ public: vboxLayout->addWidget(groupBox_2); groupBox_3 = new QGroupBox(centralwidget); - groupBox_3->setObjectName(QString::fromUtf8("groupBox_3")); + groupBox_3->setObjectName(QStringLiteral("groupBox_3")); hboxLayout3 = new QHBoxLayout(groupBox_3); #ifndef Q_OS_MAC hboxLayout3->setSpacing(6); @@ -266,9 +266,9 @@ public: #ifndef Q_OS_MAC hboxLayout3->setContentsMargins(9, 9, 9, 9); #endif - hboxLayout3->setObjectName(QString::fromUtf8("hboxLayout3")); + hboxLayout3->setObjectName(QStringLiteral("hboxLayout3")); preview = new QLineEdit(groupBox_3); - preview->setObjectName(QString::fromUtf8("preview")); + preview->setObjectName(QStringLiteral("preview")); hboxLayout3->addWidget(preview); @@ -276,7 +276,7 @@ public: vboxLayout->addWidget(groupBox_3); groupBox_4 = new QGroupBox(centralwidget); - groupBox_4->setObjectName(QString::fromUtf8("groupBox_4")); + groupBox_4->setObjectName(QStringLiteral("groupBox_4")); hboxLayout4 = new QHBoxLayout(groupBox_4); #ifndef Q_OS_MAC hboxLayout4->setSpacing(6); @@ -284,29 +284,29 @@ public: #ifndef Q_OS_MAC hboxLayout4->setContentsMargins(9, 9, 9, 9); #endif - hboxLayout4->setObjectName(QString::fromUtf8("hboxLayout4")); + hboxLayout4->setObjectName(QStringLiteral("hboxLayout4")); label_3 = new QLabel(groupBox_4); - label_3->setObjectName(QString::fromUtf8("label_3")); + label_3->setObjectName(QStringLiteral("label_3")); hboxLayout4->addWidget(label_3); path = new QLineEdit(groupBox_4); - path->setObjectName(QString::fromUtf8("path")); + path->setObjectName(QStringLiteral("path")); hboxLayout4->addWidget(path); browsePath = new QPushButton(groupBox_4); - browsePath->setObjectName(QString::fromUtf8("browsePath")); + browsePath->setObjectName(QStringLiteral("browsePath")); hboxLayout4->addWidget(browsePath); label_4 = new QLabel(groupBox_4); - label_4->setObjectName(QString::fromUtf8("label_4")); + label_4->setObjectName(QStringLiteral("label_4")); hboxLayout4->addWidget(label_4); fileName = new QLineEdit(groupBox_4); - fileName->setObjectName(QString::fromUtf8("fileName")); + fileName->setObjectName(QStringLiteral("fileName")); fileName->setEnabled(false); hboxLayout4->addWidget(fileName); @@ -319,9 +319,9 @@ public: hboxLayout5->setSpacing(6); #endif hboxLayout5->setContentsMargins(0, 0, 0, 0); - hboxLayout5->setObjectName(QString::fromUtf8("hboxLayout5")); + hboxLayout5->setObjectName(QStringLiteral("hboxLayout5")); generate = new QPushButton(centralwidget); - generate->setObjectName(QString::fromUtf8("generate")); + generate->setObjectName(QStringLiteral("generate")); hboxLayout5->addWidget(generate); @@ -334,13 +334,13 @@ public: MainWindow->setCentralWidget(centralwidget); menubar = new QMenuBar(MainWindow); - menubar->setObjectName(QString::fromUtf8("menubar")); + menubar->setObjectName(QStringLiteral("menubar")); menubar->setGeometry(QRect(0, 0, 829, 29)); menuFile = new QMenu(menubar); - menuFile->setObjectName(QString::fromUtf8("menuFile")); + menuFile->setObjectName(QStringLiteral("menuFile")); MainWindow->setMenuBar(menubar); statusbar = new QStatusBar(MainWindow); - statusbar->setObjectName(QString::fromUtf8("statusbar")); + statusbar->setObjectName(QStringLiteral("statusbar")); MainWindow->setStatusBar(statusbar); menubar->addAction(menuFile->menuAction()); |