summaryrefslogtreecommitdiffstats
path: root/examples/nfc
diff options
context:
space:
mode:
authorAlex Blasche <alexander.blasche@digia.com>2014-05-14 14:10:33 +0200
committerThe Qt Project <gerrit-noreply@qt-project.org>2014-05-15 10:10:05 +0200
commit10cd7743aa8c30fc3a5f8485ba4c4aad6bb5365e (patch)
tree4498b82fc104cf4e675241412d147de61147ed55 /examples/nfc
parentde750dc7971b3dfda350b5602501b6215ef3da8d (diff)
Utilize QStringLiteral where possible
The only exception are generated files and cases where QLatin1String based overloads are used (e.g. during QString comparisons) Change-Id: I6f36789fb8acb3b30c1dc1f8a920b118a979d74f Reviewed-by: Kai Koehne <kai.koehne@digia.com>
Diffstat (limited to 'examples/nfc')
-rw-r--r--examples/nfc/ndefeditor/mainwindow.cpp12
-rw-r--r--examples/nfc/ndefeditor/mimeimagerecordeditor.cpp24
-rw-r--r--examples/nfc/poster/qmlposter.cpp2
3 files changed, 19 insertions, 19 deletions
diff --git a/examples/nfc/ndefeditor/mainwindow.cpp b/examples/nfc/ndefeditor/mainwindow.cpp
index fedb0866..527ff6c7 100644
--- a/examples/nfc/ndefeditor/mainwindow.cpp
+++ b/examples/nfc/ndefeditor/mainwindow.cpp
@@ -105,13 +105,13 @@ void addRecord(Ui::MainWindow *ui, const QNdefRecord &record = QNdefRecord())
if (!vbox->isEmpty()) {
QFrame *hline = new QFrame;
hline->setFrameShape(QFrame::HLine);
- hline->setObjectName(QLatin1String("line-spacer"));
+ hline->setObjectName(QStringLiteral("line-spacer"));
vbox->addWidget(hline);
}
T *recordEditor = new T;
- recordEditor->setObjectName(QLatin1String("record-editor"));
+ recordEditor->setObjectName(QStringLiteral("record-editor"));
if (!record.isEmpty())
recordEditor->setRecord(record);
@@ -202,7 +202,7 @@ void MainWindow::saveMessage()
void MainWindow::touchReceive()
{
- ui->status->setStyleSheet(QLatin1String("background: blue"));
+ ui->status->setStyleSheet(QStringLiteral("background: blue"));
m_touchAction = ReadNdef;
@@ -214,7 +214,7 @@ void MainWindow::touchReceive()
void MainWindow::touchStore()
{
- ui->status->setStyleSheet(QLatin1String("background: yellow"));
+ ui->status->setStyleSheet(QStringLiteral("background: yellow"));
m_touchAction = WriteNdef;
@@ -337,8 +337,8 @@ void MainWindow::clearMessage()
{
QWidget *scrollArea = ui->scrollAreaWidgetContents;
- qDeleteAll(scrollArea->findChildren<QWidget *>(QLatin1String("line-spacer")));
- qDeleteAll(scrollArea->findChildren<QWidget *>(QLatin1String("record-editor")));
+ qDeleteAll(scrollArea->findChildren<QWidget *>(QStringLiteral("line-spacer")));
+ qDeleteAll(scrollArea->findChildren<QWidget *>(QStringLiteral("record-editor")));
}
QNdefMessage MainWindow::ndefMessage() const
diff --git a/examples/nfc/ndefeditor/mimeimagerecordeditor.cpp b/examples/nfc/ndefeditor/mimeimagerecordeditor.cpp
index adc33ef0..1b84ab4d 100644
--- a/examples/nfc/ndefeditor/mimeimagerecordeditor.cpp
+++ b/examples/nfc/ndefeditor/mimeimagerecordeditor.cpp
@@ -48,29 +48,29 @@
static QString imageFormatToMimeType(const QByteArray &format)
{
if (format == "bmp")
- return QLatin1String("image/bmp");
+ return QStringLiteral("image/bmp");
else if (format == "gif")
- return QLatin1String("image/gif");
+ return QStringLiteral("image/gif");
else if (format == "jpg" || format == "jpeg")
- return QLatin1String("image/jpeg");
+ return QStringLiteral("image/jpeg");
else if (format == "mng")
- return QLatin1String("video/x-mng");
+ return QStringLiteral("video/x-mng");
else if (format == "png")
- return QLatin1String("image/png");
+ return QStringLiteral("image/png");
else if (format == "pbm")
- return QLatin1String("image/x-portable-bitmap");
+ return QStringLiteral("image/x-portable-bitmap");
else if (format == "pgm")
- return QLatin1String("image/x-portable-graymap");
+ return QStringLiteral("image/x-portable-graymap");
else if (format == "ppm")
- return QLatin1String("image/x-portable-pixmap");
+ return QStringLiteral("image/x-portable-pixmap");
else if (format == "tiff")
- return QLatin1String("image/tiff");
+ return QStringLiteral("image/tiff");
else if (format == "xbm")
- return QLatin1String("image/x-xbitmap");
+ return QStringLiteral("image/x-xbitmap");
else if (format == "xpm")
- return QLatin1String("image/x-xpixmap");
+ return QStringLiteral("image/x-xpixmap");
else if (format == "svg")
- return QLatin1String("image/svg+xml");
+ return QStringLiteral("image/svg+xml");
else
return QString();
}
diff --git a/examples/nfc/poster/qmlposter.cpp b/examples/nfc/poster/qmlposter.cpp
index 2fc943d4..f6f3bbc8 100644
--- a/examples/nfc/poster/qmlposter.cpp
+++ b/examples/nfc/poster/qmlposter.cpp
@@ -45,7 +45,7 @@
int main(int argc, char *argv[])
{
QGuiApplication application(argc, argv);
- const QString mainQmlApp = QLatin1String("qrc:/poster.qml");
+ const QString mainQmlApp(QStringLiteral("qrc:/poster.qml"));
QQuickView view;
view.setSource(QUrl(mainQmlApp));
view.setResizeMode(QQuickView::SizeRootObjectToView);