From f9bf737d74c2493f7a535048cb4992d3e4cd3c99 Mon Sep 17 00:00:00 2001 From: Friedemann Kleint Date: Tue, 13 Oct 2015 09:06:58 +0200 Subject: Examples/Doc snippets: Fix single-character string literals. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Use character literals where applicable. Change-Id: I79fa5018f05735201ae35ee94ba0d356fcad1056 Reviewed-by: Topi Reiniƶ --- .../widgets/tutorials/addressbook/part7/addressbook.cpp | 16 ++++++++-------- examples/widgets/tutorials/modelview/5_edit/mymodel.cpp | 2 +- 2 files changed, 9 insertions(+), 9 deletions(-) (limited to 'examples/widgets/tutorials') diff --git a/examples/widgets/tutorials/addressbook/part7/addressbook.cpp b/examples/widgets/tutorials/addressbook/part7/addressbook.cpp index 6764423d71..2953ecd7de 100644 --- a/examples/widgets/tutorials/addressbook/part7/addressbook.cpp +++ b/examples/widgets/tutorials/addressbook/part7/addressbook.cpp @@ -421,23 +421,23 @@ void AddressBook::exportAsVCard() //! [export function part2] //! [export function part3] - out << "BEGIN:VCARD" << "\n"; - out << "VERSION:2.1" << "\n"; - out << "N:" << lastName << ";" << firstName << "\n"; + out << "BEGIN:VCARD" << '\n'; + out << "VERSION:2.1" << '\n'; + out << "N:" << lastName << ';' << firstName << '\n'; if (!nameList.isEmpty()) - out << "FN:" << nameList.join(' ') << "\n"; + out << "FN:" << nameList.join(' ') << '\n'; else - out << "FN:" << firstName << "\n"; + out << "FN:" << firstName << '\n'; //! [export function part3] //! [export function part4] address.replace(";", "\\;", Qt::CaseInsensitive); - address.replace("\n", ";", Qt::CaseInsensitive); + address.replace('\n', ";", Qt::CaseInsensitive); address.replace(",", " ", Qt::CaseInsensitive); - out << "ADR;HOME:;" << address << "\n"; - out << "END:VCARD" << "\n"; + out << "ADR;HOME:;" << address << '\n'; + out << "END:VCARD" << '\n'; QMessageBox::information(this, tr("Export Successful"), tr("\"%1\" has been exported as a vCard.").arg(name)); diff --git a/examples/widgets/tutorials/modelview/5_edit/mymodel.cpp b/examples/widgets/tutorials/modelview/5_edit/mymodel.cpp index 5eb677bb9d..c04c77772f 100644 --- a/examples/widgets/tutorials/modelview/5_edit/mymodel.cpp +++ b/examples/widgets/tutorials/modelview/5_edit/mymodel.cpp @@ -83,7 +83,7 @@ bool MyModel::setData(const QModelIndex & index, const QVariant & value, int rol { for(int col= 0; col < COLS; col++) { - result += m_gridData[row][col] + " "; + result += m_gridData[row][col] + ' '; } } emit editCompleted( result ); -- cgit v1.2.3