diff options
Diffstat (limited to 'examples')
-rw-r--r-- | examples/bluetooth/picturetransfer/filetransfer.cpp | 2 | ||||
-rw-r--r-- | examples/bluetooth/picturetransfer/main.cpp | 2 | ||||
-rw-r--r-- | examples/bluetooth/pingpong/pingpong.cpp | 24 | ||||
-rw-r--r-- | examples/bluetooth/scanner/qmlscanner.cpp | 2 | ||||
-rw-r--r-- | examples/nfc/ndefeditor/mainwindow.cpp | 12 | ||||
-rw-r--r-- | examples/nfc/ndefeditor/mimeimagerecordeditor.cpp | 24 | ||||
-rw-r--r-- | examples/nfc/poster/qmlposter.cpp | 2 |
7 files changed, 34 insertions, 34 deletions
diff --git a/examples/bluetooth/picturetransfer/filetransfer.cpp b/examples/bluetooth/picturetransfer/filetransfer.cpp index 7cfd041d..6f0a25b2 100644 --- a/examples/bluetooth/picturetransfer/filetransfer.cpp +++ b/examples/bluetooth/picturetransfer/filetransfer.cpp @@ -63,5 +63,5 @@ void FileTransfer::initTransfer(QString address, QString fileName) void FileTransfer::updateProgress(qint64 transferred, qint64 total) { m_progress = ((float)transferred)/((float)total); - Q_EMIT progressChanged(); + emit progressChanged(); } diff --git a/examples/bluetooth/picturetransfer/main.cpp b/examples/bluetooth/picturetransfer/main.cpp index 7db3053e..cad9c66c 100644 --- a/examples/bluetooth/picturetransfer/main.cpp +++ b/examples/bluetooth/picturetransfer/main.cpp @@ -58,7 +58,7 @@ int main(int argc, char *argv[]) QStandardPaths::standardLocations(QStandardPaths::PicturesLocation).first()); qDebug() << QStandardPaths::standardLocations(QStandardPaths::PicturesLocation); - view.setSource(QUrl(QLatin1String("qrc:/bttransfer.qml"))); + view.setSource(QUrl(QStringLiteral("qrc:/bttransfer.qml"))); view.setResizeMode(QQuickView::SizeRootObjectToView); QObject::connect(view.engine(), SIGNAL(quit()), qApp, SLOT(quit())); view.show(); diff --git a/examples/bluetooth/pingpong/pingpong.cpp b/examples/bluetooth/pingpong/pingpong.cpp index d65a56a8..6d9466e9 100644 --- a/examples/bluetooth/pingpong/pingpong.cpp +++ b/examples/bluetooth/pingpong/pingpong.cpp @@ -60,7 +60,7 @@ PingPong::~PingPong() void PingPong::startGame() { m_showDialog = false; - Q_EMIT showDialogChanged(); + emit showDialogChanged(); //! [Start the game] if (m_role == 1) updateDirection(); @@ -91,7 +91,7 @@ void PingPong::update() size.append(size1); size.append(" \n"); socket->write(size.constData()); - Q_EMIT ballChanged(); + emit ballChanged(); } else if (m_role == 2) { size.setNum(m_rightBlockY); @@ -111,7 +111,7 @@ void PingPong::setSize(const float &x, const float &y) m_targetY = m_boardHeight/2; m_ballPreviousX = m_ballX = m_boardWidth/2; m_ballPreviousY = m_ballY = m_boardHeight - m_boardWidth/54; - Q_EMIT ballChanged(); + emit ballChanged(); } void PingPong::updateBall(const float &bX, const float &bY) @@ -176,7 +176,7 @@ void PingPong::checkBoundaries() result.append(" \n"); socket->write(result); qDebug() << result; - Q_EMIT resultChanged(); + emit resultChanged(); } else if (m_ballX < 0) { m_resultRight++; @@ -196,7 +196,7 @@ void PingPong::checkBoundaries() result.append(res); result.append(" \n"); socket->write(result); - Q_EMIT resultChanged(); + emit resultChanged(); } } @@ -240,7 +240,7 @@ void PingPong::startServer() setMessage(QStringLiteral("Server started, waiting for the client. You are the left player.")); // m_role is set to 1 if it is a server m_role = 1; - Q_EMIT roleChanged(); + emit roleChanged(); } void PingPong::startClient() @@ -259,7 +259,7 @@ void PingPong::startClient() setMessage(QStringLiteral("Starting server discovery. You are the right player")); // m_role is set to 2 if it is a client m_role = 2; - Q_EMIT roleChanged(); + emit roleChanged(); } void PingPong::clientConnected() @@ -380,7 +380,7 @@ void PingPong::readSocket() QByteArray rightSide = result.at(2); m_resultLeft = leftSide.toInt(); m_resultRight = rightSide.toInt(); - Q_EMIT resultChanged(); + emit resultChanged(); checkResult(); } } @@ -401,7 +401,7 @@ void PingPong::readSocket() if (boardSize.size() > 1) { QByteArray rightBlockY = boardSize.at(0); m_rightBlockY = m_proportionY * rightBlockY.toFloat(); - Q_EMIT rightBlockChanged(); + emit rightBlockChanged(); } } else if (m_role == 2) { @@ -413,8 +413,8 @@ void PingPong::readSocket() m_ballX = m_proportionX * ballX.toFloat(); m_ballY = m_proportionY * ballY.toFloat(); m_leftBlockY = m_proportionY * leftBlockY.toFloat(); - Q_EMIT leftBlockChanged(); - Q_EMIT ballChanged(); + emit leftBlockChanged(); + emit ballChanged(); } } } @@ -423,7 +423,7 @@ void PingPong::setMessage(const QString &message) { m_showDialog = true; m_message = message; - Q_EMIT showDialogChanged(); + emit showDialogChanged(); } int PingPong::role() const diff --git a/examples/bluetooth/scanner/qmlscanner.cpp b/examples/bluetooth/scanner/qmlscanner.cpp index 47d0bb26..5c09c8f3 100644 --- a/examples/bluetooth/scanner/qmlscanner.cpp +++ b/examples/bluetooth/scanner/qmlscanner.cpp @@ -47,7 +47,7 @@ int main(int argc, char *argv[]) { //QLoggingCategory::setFilterRules(QStringLiteral("qt.bluetooth* = true")); QGuiApplication application(argc, argv); - const QString mainQmlApp = QLatin1String("qrc:/scanner.qml"); + const QString mainQmlApp(QStringLiteral("qrc:/scanner.qml")); QQuickView view; view.setSource(QUrl(mainQmlApp)); view.setResizeMode(QQuickView::SizeRootObjectToView); 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); |