summaryrefslogtreecommitdiffstats
path: root/examples
diff options
context:
space:
mode:
Diffstat (limited to 'examples')
-rw-r--r--examples/corelib/tools/customtype/message.cpp2
-rw-r--r--examples/sql/masterdetail/dialog.cpp2
-rw-r--r--examples/widgets/draganddrop/draggabletext/dragwidget.cpp2
-rw-r--r--examples/widgets/draganddrop/fridgemagnets/dragwidget.cpp4
-rw-r--r--examples/widgets/graphicsview/flowlayout/window.cpp2
-rw-r--r--examples/widgets/itemviews/chart/mainwindow.cpp2
-rw-r--r--examples/widgets/itemviews/editabletreemodel/treemodel.cpp3
-rw-r--r--examples/widgets/itemviews/simpletreemodel/treemodel.cpp3
-rw-r--r--examples/widgets/tutorials/addressbook/part7/addressbook.cpp2
9 files changed, 12 insertions, 10 deletions
diff --git a/examples/corelib/tools/customtype/message.cpp b/examples/corelib/tools/customtype/message.cpp
index e83697cb74..489ec24a4d 100644
--- a/examples/corelib/tools/customtype/message.cpp
+++ b/examples/corelib/tools/customtype/message.cpp
@@ -61,7 +61,7 @@ Message::Message(const QString &body, const QStringList &headers)
QDebug operator<<(QDebug dbg, const Message &message)
{
const QString body = message.body();
- QVector<QStringRef> pieces = body.splitRef("\r\n", QString::SkipEmptyParts);
+ QVector<QStringRef> pieces = body.splitRef(QLatin1String("\r\n"), Qt::SkipEmptyParts);
if (pieces.isEmpty())
dbg.nospace() << "Message()";
else if (pieces.size() == 1)
diff --git a/examples/sql/masterdetail/dialog.cpp b/examples/sql/masterdetail/dialog.cpp
index bb1812eace..3267352b07 100644
--- a/examples/sql/masterdetail/dialog.cpp
+++ b/examples/sql/masterdetail/dialog.cpp
@@ -86,7 +86,7 @@ void Dialog::submit()
int albumId = addNewAlbum(title, artistId);
QStringList tracks;
- tracks = tracksEditor->text().split(',', QString::SkipEmptyParts);
+ tracks = tracksEditor->text().split(QLatin1Char(','), Qt::SkipEmptyParts);
addTracks(albumId, tracks);
increaseAlbumCount(indexOfArtist(artist));
diff --git a/examples/widgets/draganddrop/draggabletext/dragwidget.cpp b/examples/widgets/draganddrop/draggabletext/dragwidget.cpp
index 2135ba2ef9..4a430ebf56 100644
--- a/examples/widgets/draganddrop/draggabletext/dragwidget.cpp
+++ b/examples/widgets/draganddrop/draggabletext/dragwidget.cpp
@@ -113,7 +113,7 @@ void DragWidget::dropEvent(QDropEvent *event)
if (event->mimeData()->hasText()) {
const QMimeData *mime = event->mimeData();
QStringList pieces = mime->text().split(QRegularExpression(QStringLiteral("\\s+")),
- QString::SkipEmptyParts);
+ Qt::SkipEmptyParts);
QPoint position = event->pos();
QPoint hotSpot;
diff --git a/examples/widgets/draganddrop/fridgemagnets/dragwidget.cpp b/examples/widgets/draganddrop/fridgemagnets/dragwidget.cpp
index 4fbc6d3fd9..a02b1cb42a 100644
--- a/examples/widgets/draganddrop/fridgemagnets/dragwidget.cpp
+++ b/examples/widgets/draganddrop/fridgemagnets/dragwidget.cpp
@@ -163,8 +163,8 @@ void DragWidget::dropEvent(QDropEvent *event)
}
//! [11] //! [12]
} else if (event->mimeData()->hasText()) {
- QStringList pieces = event->mimeData()->text().split(QRegularExpression(QStringLiteral("\\s+")),
- QString::SkipEmptyParts);
+ QStringList pieces = event->mimeData()->text().split(
+ QRegularExpression(QStringLiteral("\\s+")), Qt::SkipEmptyParts);
QPoint position = event->pos();
for (const QString &piece : pieces) {
diff --git a/examples/widgets/graphicsview/flowlayout/window.cpp b/examples/widgets/graphicsview/flowlayout/window.cpp
index 8fe06d0e11..0edaa686b4 100644
--- a/examples/widgets/graphicsview/flowlayout/window.cpp
+++ b/examples/widgets/graphicsview/flowlayout/window.cpp
@@ -59,7 +59,7 @@ Window::Window(QGraphicsItem *parent) : QGraphicsWidget(parent, Qt::Window)
FlowLayout *lay = new FlowLayout;
const QString sentence(QLatin1String("I am not bothered by the fact that I am unknown."
" I am bothered when I do not know others. (Confucius)"));
- const QVector<QStringRef> words = sentence.splitRef(QLatin1Char(' '), QString::SkipEmptyParts);
+ const QVector<QStringRef> words = sentence.splitRef(QLatin1Char(' '), Qt::SkipEmptyParts);
for (const QStringRef &word : words) {
QGraphicsProxyWidget *proxy = new QGraphicsProxyWidget(this);
QLabel *label = new QLabel(word.toString());
diff --git a/examples/widgets/itemviews/chart/mainwindow.cpp b/examples/widgets/itemviews/chart/mainwindow.cpp
index 53f57fbb49..671cfb1941 100644
--- a/examples/widgets/itemviews/chart/mainwindow.cpp
+++ b/examples/widgets/itemviews/chart/mainwindow.cpp
@@ -134,7 +134,7 @@ void MainWindow::loadFile(const QString &fileName)
if (!line.isEmpty()) {
model->insertRows(row, 1, QModelIndex());
- const QStringList pieces = line.split(',', QString::SkipEmptyParts);
+ const QStringList pieces = line.split(QLatin1Char(','), Qt::SkipEmptyParts);
if (pieces.size() < 3)
continue;
model->setData(model->index(row, 0, QModelIndex()),
diff --git a/examples/widgets/itemviews/editabletreemodel/treemodel.cpp b/examples/widgets/itemviews/editabletreemodel/treemodel.cpp
index 836c2e8651..9678e45be7 100644
--- a/examples/widgets/itemviews/editabletreemodel/treemodel.cpp
+++ b/examples/widgets/itemviews/editabletreemodel/treemodel.cpp
@@ -267,7 +267,8 @@ void TreeModel::setupModelData(const QStringList &lines, TreeItem *parent)
if (!lineData.isEmpty()) {
// Read the column data from the rest of the line.
- const QStringList columnStrings = lineData.split('\t', QString::SkipEmptyParts);
+ const QStringList columnStrings =
+ lineData.split(QLatin1Char('\t'), Qt::SkipEmptyParts);
QVector<QVariant> columnData;
columnData.reserve(columnStrings.size());
for (const QString &columnString : columnStrings)
diff --git a/examples/widgets/itemviews/simpletreemodel/treemodel.cpp b/examples/widgets/itemviews/simpletreemodel/treemodel.cpp
index cfa65846ed..28640d6433 100644
--- a/examples/widgets/itemviews/simpletreemodel/treemodel.cpp
+++ b/examples/widgets/itemviews/simpletreemodel/treemodel.cpp
@@ -194,7 +194,8 @@ void TreeModel::setupModelData(const QStringList &lines, TreeItem *parent)
if (!lineData.isEmpty()) {
// Read the column data from the rest of the line.
- const QStringList columnStrings = lineData.split('\t', QString::SkipEmptyParts);
+ const QStringList columnStrings =
+ lineData.split(QLatin1Char('\t'), Qt::SkipEmptyParts);
QVector<QVariant> columnData;
columnData.reserve(columnStrings.count());
for (const QString &columnString : columnStrings)
diff --git a/examples/widgets/tutorials/addressbook/part7/addressbook.cpp b/examples/widgets/tutorials/addressbook/part7/addressbook.cpp
index 717d0882af..1ba23756c4 100644
--- a/examples/widgets/tutorials/addressbook/part7/addressbook.cpp
+++ b/examples/widgets/tutorials/addressbook/part7/addressbook.cpp
@@ -413,7 +413,7 @@ void AddressBook::exportAsVCard()
int index = name.indexOf(" ");
if (index != -1) {
- nameList = name.split(QRegularExpression("\\s+"), QString::SkipEmptyParts);
+ nameList = name.split(QRegularExpression("\\s+"), Qt::SkipEmptyParts);
firstName = nameList.first();
lastName = nameList.last();
} else {