summaryrefslogtreecommitdiffstats
path: root/examples/widgets/tutorials
diff options
context:
space:
mode:
Diffstat (limited to 'examples/widgets/tutorials')
-rw-r--r--examples/widgets/tutorials/addressbook/part7/addressbook.cpp17
-rw-r--r--examples/widgets/tutorials/modelview/5_edit/mymodel.cpp2
2 files changed, 9 insertions, 10 deletions
diff --git a/examples/widgets/tutorials/addressbook/part7/addressbook.cpp b/examples/widgets/tutorials/addressbook/part7/addressbook.cpp
index 45ded876a7..2953ecd7de 100644
--- a/examples/widgets/tutorials/addressbook/part7/addressbook.cpp
+++ b/examples/widgets/tutorials/addressbook/part7/addressbook.cpp
@@ -370,7 +370,6 @@ void AddressBook::loadFromFile()
QDataStream in(&file);
in.setVersion(QDataStream::Qt_4_3);
- contacts.empty(); // empty existing contacts
in >> contacts;
QMap<QString, QString>::iterator i = contacts.begin();
@@ -422,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 );