summaryrefslogtreecommitdiffstats
path: root/examples
diff options
context:
space:
mode:
authorLiang Qi <liang.qi@qt.io>2017-03-13 09:50:43 +0100
committerUlf Hermann <ulf.hermann@qt.io>2017-03-13 15:55:44 +0100
commitd51c3ecf8ef6e28557c66745f50a223cc5b1ce54 (patch)
tree023a1ecaa944152e08ba11291ec7aadc12f59dad /examples
parentf06f1adb6cc3835793a15eafa2d5a3affad712a2 (diff)
parent3a1f4b186d8ce79717da37f808ff9a4b3e949d9c (diff)
Merge remote-tracking branch 'origin/5.8' into 5.9
Conflicts: examples/network/network.pro mkspecs/features/mac/default_post.prf src/corelib/io/qfilesystemengine_win.cpp src/corelib/io/qprocess.cpp src/corelib/io/qprocess.h src/corelib/io/qprocess_p.h src/corelib/io/qprocess_unix.cpp src/corelib/io/qprocess_win.cpp src/corelib/thread/qmutex.cpp src/platformsupport/fontdatabases/windows/windows.pri src/plugins/platforms/eglfs/eglfsdeviceintegration.pro tests/auto/corelib/io/io.pro Change-Id: I8a27e0e141454818bba9c433200a4e84a88d147e
Diffstat (limited to 'examples')
-rw-r--r--examples/sql/relationaltablemodel/relationaltablemodel.cpp2
-rw-r--r--examples/widgets/tools/treemodelcompleter/mainwindow.cpp9
2 files changed, 6 insertions, 5 deletions
diff --git a/examples/sql/relationaltablemodel/relationaltablemodel.cpp b/examples/sql/relationaltablemodel/relationaltablemodel.cpp
index c8faece1dd..5292256cd9 100644
--- a/examples/sql/relationaltablemodel/relationaltablemodel.cpp
+++ b/examples/sql/relationaltablemodel/relationaltablemodel.cpp
@@ -117,7 +117,7 @@ int main(int argc, char *argv[])
initializeModel(&model);
- QTableView *view = createView(QObject::tr("Relational Table Model"), &model);
+ QScopedPointer<QTableView> view(createView(QObject::tr("Relational Table Model"), &model));
view->show();
return app.exec();
diff --git a/examples/widgets/tools/treemodelcompleter/mainwindow.cpp b/examples/widgets/tools/treemodelcompleter/mainwindow.cpp
index c00e058fc4..4aabb04023 100644
--- a/examples/widgets/tools/treemodelcompleter/mainwindow.cpp
+++ b/examples/widgets/tools/treemodelcompleter/mainwindow.cpp
@@ -194,16 +194,17 @@ QAbstractItemModel *MainWindow::modelFromFile(const QString& fileName)
if (line.isEmpty() || trimmedLine.isEmpty())
continue;
- QRegExp re("^\\s+");
- int nonws = re.indexIn(line);
+ QRegularExpression re("^\\s+");
+ QRegularExpressionMatch match = re.match(line);
+ int nonws = match.capturedStart();
int level = 0;
if (nonws == -1) {
level = 0;
} else {
if (line.startsWith("\t")) {
- level = re.cap(0).length();
+ level = match.capturedLength();
} else {
- level = re.cap(0).length()/4;
+ level = match.capturedLength()/4;
}
}