diff options
author | Friedemann Kleint <Friedemann.Kleint@theqtcompany.com> | 2015-10-13 09:06:58 +0200 |
---|---|---|
committer | Friedemann Kleint <Friedemann.Kleint@theqtcompany.com> | 2015-10-13 16:37:07 +0000 |
commit | f9bf737d74c2493f7a535048cb4992d3e4cd3c99 (patch) | |
tree | c86f65b9bbe030a0225d0a11d5924fb6e9ada832 /examples/widgets/tutorials | |
parent | dab4877a0a6ad755483a8e47205112a247058fef (diff) |
Examples/Doc snippets: Fix single-character string literals.
Use character literals where applicable.
Change-Id: I79fa5018f05735201ae35ee94ba0d356fcad1056
Reviewed-by: Topi Reiniƶ <topi.reinio@digia.com>
Diffstat (limited to 'examples/widgets/tutorials')
-rw-r--r-- | examples/widgets/tutorials/addressbook/part7/addressbook.cpp | 16 | ||||
-rw-r--r-- | examples/widgets/tutorials/modelview/5_edit/mymodel.cpp | 2 |
2 files changed, 9 insertions, 9 deletions
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 ); |